var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,c){b.raw=c;return b};$jscomp.arrayIteratorImpl=function(b){var c=0;return function(){return c>>0,$jscomp.propertyToPolyfillSymbol[f]=$jscomp.IS_SYMBOL_NATIVE? $jscomp.global.Symbol(f):$jscomp.POLYFILL_PREFIX+d+"$"+f),$jscomp.defineProperty(e,$jscomp.propertyToPolyfillSymbol[f],{configurable:!0,writable:!0,value:c})))}; $jscomp.getConstructImplementation=function(){function b(){function d(){}new d;Reflect.construct(d,[],function(){});return new d instanceof d}if($jscomp.TRUST_ES6_POLYFILLS&&"undefined"!=typeof Reflect&&Reflect.construct){if(b())return Reflect.construct;var c=Reflect.construct;return function(d,e,f){d=c(d,e);f&&Reflect.setPrototypeOf(d,f.prototype);return d}}return function(d,e,f){void 0===f&&(f=d);f=$jscomp.objectCreate(f.prototype||Object.prototype);return Function.prototype.apply.call(d,f,e)|| f}};$jscomp.construct={valueOf:$jscomp.getConstructImplementation}.valueOf();$jscomp.underscoreProtoCanBeSet=function(){var b={a:!0},c={};try{return c.__proto__=b,c.a}catch(d){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(b,c){b.__proto__=c;if(b.__proto__!==c)throw new TypeError(b+" is not extensible");return b}:null; $jscomp.inherits=function(b,c){b.prototype=$jscomp.objectCreate(c.prototype);b.prototype.constructor=b;if($jscomp.setPrototypeOf){var d=$jscomp.setPrototypeOf;d(b,c)}else for(d in c)if("prototype"!=d)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(c,d);e&&Object.defineProperty(b,d,e)}else b[d]=c[d];b.superClass_=c.prototype};$jscomp.generator={}; $jscomp.generator.ensureIteratorResultIsObject_=function(b){if(!(b instanceof Object))throw new TypeError("Iterator result "+b+" is not an object");};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null}; $jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(b){this.yieldResult=b}; $jscomp.generator.Context.prototype.throw_=function(b){this.abruptCompletion_={exception:b,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.return=function(b){this.abruptCompletion_={return:b};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(b){this.abruptCompletion_={jumpTo:b};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(b,c){this.nextAddress=c;return{value:b}}; $jscomp.generator.Context.prototype.yieldAll=function(b,c){b=$jscomp.makeIterator(b);var d=b.next();$jscomp.generator.ensureIteratorResultIsObject_(d);if(d.done)this.yieldResult=d.value,this.nextAddress=c;else return this.yieldAllIterator_=b,this.yield(d.value,c)};$jscomp.generator.Context.prototype.jumpTo=function(b){this.nextAddress=b};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0}; $jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(b,c){this.catchAddress_=b;void 0!=c&&(this.finallyAddress_=c)};$jscomp.generator.Context.prototype.setFinallyBlock=function(b){this.catchAddress_=0;this.finallyAddress_=b||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(b,c){this.nextAddress=b;this.catchAddress_=c||0}; $jscomp.generator.Context.prototype.enterCatchBlock=function(b){this.catchAddress_=b||0;b=this.abruptCompletion_.exception;this.abruptCompletion_=null;return b};$jscomp.generator.Context.prototype.enterFinallyBlock=function(b,c,d){d?this.finallyContexts_[d]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=b||0;this.finallyAddress_=c||0}; $jscomp.generator.Context.prototype.leaveFinallyBlock=function(b,c){c=this.finallyContexts_.splice(c||0)[0];if(c=this.abruptCompletion_=this.abruptCompletion_||c){if(c.isException)return this.jumpToErrorHandler_();void 0!=c.jumpTo&&this.finallyAddress_>>0)+"_",e=0,f=function(g){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return new c(d+(g||"")+"_"+e++,g)};return f},"es6","es3"); $jscomp.polyfill("Symbol.iterator",function(b){if(b)return b;b=Symbol("Symbol.iterator");for(var c="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),d=0;d=g}},"es6","es3");$jscomp.polyfill("Object.is",function(b){return b?b:function(c,d){return c===d?0!==c||1/c===1/d:c!==c&&d!==d}},"es6","es3"); $jscomp.polyfill("Array.prototype.includes",function(b){return b?b:function(c,d){var e=this;e instanceof String&&(e=String(e));var f=e.length;d=d||0;for(0>d&&(d=Math.max(d+f,0));d=f}},"es6","es3"); $jscomp.polyfill("Array.prototype.fill",function(b){return b?b:function(c,d,e){var f=this.length||0;0>d&&(d=Math.max(0,f+d));if(null==e||e>f)e=f;e=Number(e);0>e&&(e=Math.max(0,f+e));for(d=Number(d||0);d_agent_.browser.version},isPad=function(){return _agent_.browser.device==_agent_.browser.DEVICE_PAD||_agent_.browser.device== _agent_.browser.DEVICE_PC&&_agent_.system.name==_agent_.system.ANDROID?!0:!1},isIpad=function(){var b=navigator.userAgent.toLowerCase();return 0_agent_.browser.version},isWeChat=function(){return _agent_.browser.wechat},isDingDing=function(){return _agent_.browser.dingding},isAndroidDefault=function(){return _agent_.system.name==_agent_.system.ANDROID&&_agent_.browser.safari},isPhoneBook=function(){if(_agent_.system.name==_agent_.system.ANDROID&&_agent_.browser.uc)return!0;var b=window.location.search;return(isPhone()||isPad())&& _agent_.system.name==_agent_.system.ANDROID&&4>parseInt(_agent_.system.version)||0<=b.toLowerCase().indexOf("phonebook=true")||(isPhone()||isPad())&&"slide"==bookConfig.FlipStyle.toLowerCase()?!0:!1},isHigherThanIOS8=function(){return _agent_.system.name==_agent_.system.IOS&&8<=_agent_.system.version},isInTheFrame=function(){return window.top!=window};function isBelowIE9(){return _agent_.browser.msie?9>_agent_.browser.version?!0:!1:!1} function isBelowIE8(){return _agent_.browser.msie?8>_agent_.browser.version?!0:!1:!1}function isBelowIE10(){return _agent_.browser.msie?10>_agent_.browser.version?!0:!1:!1}function isMacOSChrome(){var b=navigator.userAgent.toLowerCase();return/macintosh/.test(b)&&_agent_.browser.chrome}var global=function(){return this||(0,eval)("(this)")}(),virtual_function=function(){}; function getPackageByName(b){if(void 0==b||""==b)return global;var c=global;b=b.split(".");for(var d=0;dc?this.substr(0,b)+"...":this.toString()},remove:function(b){if("string"!=typeof b||!b)return this;var c=this.indexOf(b);if(0>c)return this;b=b.length;return this.substring(0,c)+this.substring(c+b,this.length)+""},removeStartFrom:function(b){if("string"==typeof b&&b)return b= this.indexOf(b),0>b?this:this.substring(0,b)+""},cycleToLength:function(b){if(!isNaN(b)){for(var c=parseInt(b/this.length),d=this;0this.length?this:this.substring(0,1).toUpperCase()+this.substring(1)},firstLowerCase:function(){return 1>this.length?this:this.substring(0,1).toLowerCase()+this.substring(1)},extract:function(){if(0==this.length||0==arguments.length)return[];for(var b=[],c=this.toString(),d=0;d=f?d.push(b.charAt(c)):128<=f&&2047>=f?d.push(String.fromCharCode(192|f>>6&31),String.fromCharCode(128|f&63)):2048<=f&&65535>=f&&d.push(String.fromCharCode(224|f>>12&15),String.fromCharCode(128|f>>6&63),String.fromCharCode(128|f&63))}return d.join("")},parseUtf8:function(b){if(!b)return"";var c,d=[],e=b.length;for(c=0;c>7&255))d.push(b.charAt(c));else if(6==(f[0]>>5&255)){f.push(b.charCodeAt(++c)); var g=[];g.push(f[0]&31);g.push(f[1]&63);d.push(String.fromCharCode(g[0]<<6|g[1]))}else 14==(f[0]>>4&255)&&(f.push(b.charCodeAt(++c)),f.push(b.charCodeAt(++c)),g=[],g.push(f[0]<<4|f[1]>>2&15),g.push((f[1]&3)<<6|f[2]&63),d.push(String.fromCharCode(g[0]<<8|g[1])))}return d.join("")}}}); Array.expand({remove:function(b){return isNaN(b)||b>this.length?!1:this.splice(b,1)[0]},indexOf:function(b){for(var c=0;cc&&(b=c);return b},isBetween:function(b,c,d){if(isNaN(c)||isNaN(d)||isNaN(b))return!1;var e=Math.max(c,d);return b>=Math.min(c,d)&&b<=e?!0:!1},fixed:function(b,c){if(isNaN(b))return b;isNaN(c)&&(c=0);c=Math.pow(10,c);return Math.round(b*c)/c},decimals:function(b){if(isNaN(b))return-1;b=Number(b).toString();var c=b.indexOf(".");return-1==c?0:b.length-c-1},random:function(b, c,d){if(isNaN(b)||isNaN(c))return 0;void 0==d&&Number.decimals(b)==Number.decimals(c)&&(d=Number.decimals(b));var e=Math.min(b,c);b=e+(Math.max(b,c)-e)*Math.random();return!d||0>d||isNaN(d)?Math.floor(b):Number.fixed(b,d)}}}); var Color=function(b){b&&"object"==typeof b&&b.toString&&(b=b.toString());return{value:ColorTable.value(b),toString:function(){function c(e,f,g){if(e.lengthf)for(;e.lengthd?Number(0):d;d=d.toString(16);8=c.length?"0"+c:c;f=1>=f.length?"0"+f:f;d=1>=d.length?"0"+d:d;e=1>=e.length?"0"+e:e;return"FF"==e?"#"+c+f+d:"#"+e+c+f+d},reduce:function(c){return this.add("object"==typeof c?c:{r:-c,g:-c,b:-c,a:1})},rgba:function(c){var d=this.split();c=void 0==c||""===c?d.a:parseFloat(c);1=d.length?"0"+d:d;e=1>=e.length?"0"+e:e;f=1>=f.length?"0"+f:f;c=1>=c.length?"0"+c:c;return"FF"==c?"#"+d+e+f:"#"+c+d+e+f}}};function colorSplit(b){return Color(b).split()}function colorAdd(b,c){return Color(b).add(c)}function colorDiv(b,c){return Color(b).reduce(c)}function equals(b,c){return 1E-7>Math.abs(b-c)} var Point=function(b,c){return{x:b,y:c,isNearTo:function(d,e){if(!d)return!1;void 0==e&&(e=5);return Math.abs(this.x-d.x)d/e)if(bd/e){var f=d,g=d/b*c;c=0;e=(e-g)/2}else g=e,f=e/c*b,c=(d-f)/2,e=0;return{scale:b/f,width:f,height:g,left:c,top:e}} function getInverseItem(b,c,d){b=JSON.parse(JSON.stringify(b));var e=b.location;if(window.articleConfig&&window.articleConfig.hotArea){var f=window.articleConfig.hotArea;b.overColor=f.overColor;b.downColor=f.downColor;b.outColor=f.outColor;b.overAlpha=f.overAlpha;b.downAlpha=f.downAlpha;b.outAlpha=f.outAlpha}"issuu"!=bookConfig.FlipStyle&&(e.pageWidth>c||e.pageHeight>d)&&(c=getContainSizeRate(e.pageWidth,e.pageHeight,c,d),d=(1-c.height)/2,b.location.x=b.location.x*c.width+(1-c.width)/2,b.location.y= b.location.y*c.height+d,b.location.width*=c.width,b.location.height*=c.height);return b}function getOffset(b){for(var c=b.target,d=0,e=0;c;)d+=c.offsetLeft,e+=c.offsetTop,c=c.offsetParent;return{X:window.pageXOffset+b.clientX-d,Y:window.pageYOffset+b.clientY-e}} function getPositionFromEvt(b){b=b.originalEvent&&b.originalEvent.changedTouches?b.originalEvent.changedTouches:b.changedTouches?b.changedTouches:[b];return{x:(b[0].pageX||b[0].clientX)+(document.documentElement.scrollLeft||document.body.scrollLeft),y:(b[0].pageY||b[0].clientY)+(document.documentElement.scrollTop||document.body.scrollTop)}} function getDeString(b){"[object String]"!==Object.prototype.toString.call(b)||b.match(/^[\[\{]/)||(b=window.Module._DeString(window.allocateUTF8(b)),b=window.UTF8ToString(b));return b}function getCustomEventName(){return bookConfig.productName&&bookConfig.productName.toLocaleLowerCase().match(/flip[ ]*pdf/)?"flip_pdf_customize_":bookConfig.productName&&bookConfig.productName.toLocaleLowerCase().match(/fliphtml5/)?"fliphtml5_customize_":""} function getEditorEventName(){return bookConfig.productName&&bookConfig.productName.toLocaleLowerCase().match(/flip[ ]*pdf/)?"flip_pdf_editor_":bookConfig.productName&&bookConfig.productName.toLocaleLowerCase().match(/fliphtml5/)?"fliphtml5_editor_":""} function DeString(b,c){if(""==b)return"";c&&""!=c||(c="fb5");c=escape(c);if(null==b||8>b.length)alert("A salt value could not be extracted from the encrypted message because it's length is too short. The message cannot be decrypted.");else if(null==c||0>=c.length)alert("Please enter a password with which to decrypt the message.");else{for(var d="",e=0;e\s*\(/gm, "{anonymous}()@"):"Unknown Stack Trace";var D=b.console&&(b.console.warn||b.console.log);D&&D.call(b.console,z,C);return m.apply(this,arguments)}}function l(m,r,t){r=r.prototype;var z=m.prototype=Object.create(r);z.constructor=m;z._super=r;t&&S(z,t)}function n(m,r){return function(){return m.apply(r,arguments)}}function p(m,r){return"function"==typeof m?m.apply(r?r[0]||e:e,r):m}function q(m,r,t){h(u(r),function(z){"undefined"!=typeof b.addEventListener?m.addEventListener(z,t,!1):m.attachEvent(z,t)})} function B(m,r,t){h(u(r),function(z){"undefined"!=typeof b.removeEventListener?m.removeEventListener(z,t,!1):m.detachEvent(z,t,!1)})}function v(m,r){for(;m;){if(m==r)return!0;m=m.parentNode}return!1}function u(m){return m.trim().split(/\s+/g)}function w(m,r,t){if(m.indexOf&&!t)return m.indexOf(r);for(var z=0;zw(C,E)&&z.push(m[D]);C[D]=E;D++}t&&(z=r?z.sort(function(J,P){return J[r]>P[r]}):z.sort());return z}function A(m,r){if(r&&r[0]){for(var t,z=r[0].toUpperCase()+r.slice(1),C=0;CV(E)?D:E;C?(D=C.pointers,D=K(z[0],z[1],Y)/K(D[0],D[1],Y)):D=1;t.scale=D;C?(C=C.pointers,z=M(z[1],z[0],Y)+M(C[1],C[0],Y)):z=0;t.rotation=z;t.maxPointers=r.prevInput? t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length;E=r.lastInterval||t;z=t.timeStamp-E.timeStamp;8!=t.eventType&&(25V(P)?J:P,D=I(D,E),r.lastInterval=t):(J=E.velocity,z=E.velocityX,C=E.velocityY,D=E.direction);t.velocity=J;t.velocityX=z;t.velocityY=C;t.direction=D;r=m.element;v(t.srcEvent.target,r)&&(r=t.srcEvent.target);t.target=r;m.emit("hammer.input",t); m.recognize(t);m.session.prevInput=t}function L(m){for(var r=[],t=0;t=V(r)?0>m?2:4:0>r?8:16}function K(m,r,t){t||(t=pa);var z= r[t[0]]-m[t[0]];m=r[t[1]]-m[t[1]];return Math.sqrt(z*z+m*m)}function M(m,r,t){t||(t=pa);return 180*Math.atan2(r[t[1]]-m[t[1]],r[t[0]]-m[t[0]])/Math.PI}function W(){this.evEl=za;this.evWin=Aa;this.pressed=!1;F.apply(this,arguments)}function Z(){this.evEl=qa;this.evWin=ra;F.apply(this,arguments);this.store=this.manager.session.pointerEvents=[]}function aa(){this.evTarget="touchstart";this.evWin="touchstart touchmove touchend touchcancel";this.started=!1;F.apply(this,arguments)}function T(){this.evTarget= Ba;this.targetIds={};F.apply(this,arguments)}function U(m,r){var t=x(m.touches),z=this.targetIds;if(r&3&&1===t.length)return z[t[0].identifier]=!0,[t,t];m=x(m.changedTouches);var C=[],D=this.target;var E=t.filter(function(J){return v(J.target,D)});if(1===r)for(t=0;tE&&(r.push(m),E=r.length-1):z&12&&(t=!0);0>E||(r[E]=m,this.callback(this.manager,z,{pointers:r,changedPointers:[m],pointerType:C,srcEvent:m}),t&&r.splice(E,1))}});var Ma={touchstart:1,touchmove:2,touchend:4,touchcancel:8};l(aa,F,{handler:function(m){var r=Ma[m.type];1===r&&(this.started=!0);if(this.started){var t=x(m.touches);var z=x(m.changedTouches);r&12&&(t=y(t.concat(z),"identifier",!0));t=[t, z];r&12&&0===t[0].length-t[1].length&&(this.started=!1);this.callback(this.manager,r,{pointers:t[0],changedPointers:t[1],pointerType:"touch",srcEvent:m})}}});var Na={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Ba="touchstart touchmove touchend touchcancel";l(T,F,{handler:function(m){var r=Na[m.type],t=U.call(this,m,r);t&&this.callback(this.manager,r,{pointers:t[0],changedPointers:t[1],pointerType:"touch",srcEvent:m})}});l(ha,F,{handler:function(m,r,t){var z="mouse"==t.pointerType;if(!(z&&t.sourceCapabilities&& t.sourceCapabilities.firesTouchEvents)){if("touch"==t.pointerType)r&1?(this.primaryTouch=t.changedPointers[0].identifier,sa.call(this,t)):r&12&&sa.call(this,t);else{if(z)a:{z=t.srcEvent.clientX;for(var C=t.srcEvent.clientY,D=0;D=Math.abs(z-E.x)&&25>=J){z=!0;break a}}z=!1}if(z)return}this.callback(m,r,t)}},destroy:function(){this.touch.destroy();this.mouse.destroy()}});var xa=A(Fa.style,"touchAction"),ya=xa!==e,ea=function(){if(!ya)return!1; var m={},r=b.CSS&&b.CSS.supports;"auto;manipulation;pan-y;pan-x;pan-x pan-y;none".split(";").forEach(function(t){m[t]=r?b.CSS.supports("touch-action",t):!0});return m}();ia.prototype={set:function(m){"compute"==m&&(m=this.compute());ya&&this.manager.element.style&&ea[m]&&(this.manager.element.style[xa]=m);this.actions=m.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var m=[];h(this.manager.recognizers,function(r){p(r.options.enable,[r])&&(m= m.concat(r.getTouchAction()))});return Ca(m.join(" "))},preventDefaults:function(m){var r=m.srcEvent,t=m.offsetDirection;if(this.manager.session.prevented)r.preventDefault();else{var z=this.actions,C=-1m.distance,J=250>m.deltaTime;if(1===m.pointers.length&&E&&J)return}if(!z||!D)if(C||D&&t&6||z&&t&24)return this.preventSrc(r)}},preventSrc:function(m){this.manager.session.prevented= !0;m.preventDefault()}};Q.prototype={defaults:{},set:function(m){S(this.options,m);this.manager&&this.manager.touchAction.update();return this},recognizeWith:function(m){if(g(m,"recognizeWith",this))return this;var r=this.simultaneous;m=ba(m,this);r[m.id]||(r[m.id]=m,m.recognizeWith(this));return this},dropRecognizeWith:function(m){if(g(m,"dropRecognizeWith",this))return this;m=ba(m,this);delete this.simultaneous[m.id];return this},requireFailure:function(m){if(g(m,"requireFailure",this))return this; var r=this.requireFail;m=ba(m,this);-1===w(r,m)&&(r.push(m),m.requireFailure(this));return this},dropRequireFailure:function(m){if(g(m,"dropRequireFailure",this))return this;m=ba(m,this);m=w(this.requireFail,m);-1z&&r(t.options.event+ta(z));r(t.options.event); m.additionalEvent&&r(m.additionalEvent);8<=z&&r(t.options.event+ta(z))},tryEmit:function(m){if(this.canEmit())return this.emit(m);this.state=32},canEmit:function(){for(var m=0;mD?2:4,t=D!=this.pX,z=Math.abs(m.deltaX)):(C=0===E?1:0>E?8:16,t=E!=this.pY,z=Math.abs(m.deltaY)));m.direction=C;return t&&z>r.threshold&&C&r.direction},attrTest:function(m){return N.prototype.attrTest.call(this,m)&&(this.state&2||!(this.state&2)&&this.directionTest(m))},emit:function(m){this.pX=m.deltaX;this.pY=m.deltaY;var r=ua(m.direction);r&&(m.additionalEvent=this.options.event+r);this._super.emit.call(this,m)}});l(ja,N,{defaults:{event:"pinch", threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(m){return this._super.attrTest.call(this,m)&&(Math.abs(m.scale-1)>this.options.threshold||this.state&2)},emit:function(m){1!==m.scale&&(m.additionalEvent=this.options.event+(1>m.scale?"in":"out"));this._super.emit.call(this,m)}});l(ka,Q,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(m){var r=this.options,t=m.pointers.length===r.pointers,z=m.distance< r.threshold,C=m.deltaTime>r.time;this._input=m;if(!z||!t||m.eventType&12&&!C)this.reset();else if(m.eventType&1)this.reset(),this._timer=f(function(){this.state=8;this.tryEmit()},r.time,this);else if(m.eventType&4)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(m){8===this.state&&(m&&m.eventType&4?this.manager.emit(this.options.event+"up",m):(this._input.timeStamp=fa(),this.manager.emit(this.options.event,this._input)))}});l(la,N,{defaults:{event:"rotate",threshold:0, pointers:2},getTouchAction:function(){return["none"]},attrTest:function(m){return this._super.attrTest.call(this,m)&&(Math.abs(m.rotation)>this.options.threshold||this.state&2)}});l(ma,N,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return ca.prototype.getTouchAction.call(this)},attrTest:function(m){var r=this.options.direction;if(r&30)var t=m.overallVelocity;else r&6?t=m.overallVelocityX:r&24&&(t=m.overallVelocityY);return this._super.attrTest.call(this, m)&&r&m.offsetDirection&&m.distance>this.options.threshold&&m.maxPointers==this.options.pointers&&V(t)>this.options.velocity&&m.eventType&4},emit:function(m){var r=ua(m.offsetDirection);r&&this.manager.emit(this.options.event+r,m);this.manager.emit(this.options.event,m)}});l(da,Q,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(m){var r=this.options,t=m.pointers.length===r.pointers,z=m.distance< r.threshold,C=m.deltaTime=v){f.animateInterval.stop();f.parameters.left=f.parameters.naturalLeft+50*(f.parameters.naturalWidth- f.parameters.width*g)/100;f.parameters.top=f.parameters.naturalTop+50*(f.parameters.naturalHeight-f.parameters.height*g)/100;f.parameters.width*=g;f.parameters.height*=g;f.css({width:f.parameters.width+"px",height:f.parameters.height+"px",left:f.parameters.left+"px",top:f.parameters.top+"px"});for(u=0;u=f.parameters.width*f.parameters.scale/f.parameters.naturalWidth&& f.zoomOut(f)}}.animation(this,320)}};this.panForMove=function(f,g,h,k){f.css({left:f.parameters.left+g+"px",top:f.parameters.top+h+"px"})};var c=!1,d=0,e=0;bookConfig.SupportOperatePageZoom&&this.dblclick(function(f){f.pointers=[{pageX:f.pageX,pageY:f.pageY}];this.onDoubleTap(f)}.bind(this));this.bind(_event._down,function(f){c=!0;d=f.pageX;e=f.pageY}.bind(this));this.bind(_event._move,function(f){f.pointers=[{pageX:f.pageX,pageY:f.pageY}];c&&(f.deltaX=f.pageX-d,f.deltaY=f.pageY-e,this.onPan(f))}.bind(this)); this.bind(_event._end,function(f){c=!1;this.parameters.left+=f.pageX-d;this.parameters.top+=f.pageY-e}.bind(this))}; jQuery.fn.zoom=function(b,c){this.options=b;this.isBook=c;this.parameters={width:$(this).width()||0,height:$(this).height()||0,naturalWidth:$(this).width()||0,naturalHeight:$(this).height()||0,left:$(this).offset().left-0||0,top:$(this).offset().top-0||0,toScale:1,scale:1,rotate:0,tran:{x:0,y:0},origin:{x:50,y:50},zoomFlag:!1,zoomming:!1,zoomOut:!1,resize:!1,eventCancel:!1,zoomDelay:!1,onPan:!1,onSwipe:!1,onDoubleTap:!1,onPinch:!1,zoomArea:{left:0,top:0,right:0,bottom:0}};this.onPan=function(d){if(!this.parameters.resize&& !this.parameters.eventCancel&&!this.parameters.zoomming&&d&&d.pointers&&1==d.pointers.length&&(this.swipeInterval&&this.swipeInterval.stop(),this.animateInterval&&this.animateInterval.stop(),this.parameters.zoomFlag)){"panstart"==d.type&&(this.parameters.onPan=!0);var e=this.getDelta(d);e=this.panForMove(this,e.deltaX,e.deltaY,!0);if(this.options&&this.options.onPan)this.options.onPan();if("panend"==d.type||"pancancel"==d.type)this.parameters.onPan=!1,this.setZoomParameters(this,e),this.restrictInBoundary(this)}}; this.onSwipe=function(d){if(!this.parameters.resize&&!this.parameters.eventCancel&&!this.parameters.zoomming)if(this.parameters.zoomFlag){var e=this.parameters.tran,f=this.tranLimit(this,this.parameters.scale,this.parameters.tran);if(f.x==parseInt(e.x)&&f.y==parseInt(e.y)){this.animateInterval&&this.animateInterval.stop();this.swipeInterval&&this.swipeInterval.stop();var g=0,h=0;d=this.getVelocity(d);g=d.velocityX;h=d.velocityY;this.swipeInterval=function(k,l){var n=this.parameters.tran,p=this.tranLimit(this, this.parameters.scale,this.parameters.tran);p.x!=parseInt(n.x)||p.y!=parseInt(n.y)?(this.swipeInterval.stop(),this.restrictInBoundary(this)):(n=(l-k)/l,n=this.panForMove(this,g*n*16.7,h*n*16.7,!0),this.setZoomParameters(this,n),k>=l&&(this.swipeInterval.stop(),this.restrictInBoundary(this)))}.animation(this,320)}}else d=this.getDirection(d),this.options&&this.options.swipeend&&this.options.swipeend(d)};this.getDirection=function(d){var e,f=bookConfig.upsideOnMobile();d.direction&Hammer.DIRECTION_RIGHT&& !f&&(e="right");d.direction&Hammer.DIRECTION_LEFT&&!f&&(e="left");d.direction&Hammer.DIRECTION_UP&&!f&&(e="up");d.direction&Hammer.DIRECTION_DOWN&&!f&&(e="down");d.direction&Hammer.DIRECTION_RIGHT&&f&&(e="down");d.direction&Hammer.DIRECTION_LEFT&&f&&(e="up");d.direction&Hammer.DIRECTION_UP&&f&&(e="left");d.direction&Hammer.DIRECTION_DOWN&&f&&(e="right");return e};this.getVelocity=function(d){var e=0,f=0,g=bookConfig.upsideOnMobile();0==d.velocityX||g||(e=d.velocityX);0==d.velocityY||g||(f=d.velocityY); 0!=d.velocityX&&g&&(e=d.velocityY);0!=d.velocityY&&g&&(f=-d.velocityX);return{velocityX:e,velocityY:f}};this.getDelta=function(d){var e=0,f=0,g=bookConfig.upsideOnMobile();0==d.deltaX||g||(e=d.deltaX);0==d.deltaY||g||(f=d.deltaY);0!=d.deltaX&&g&&(e=d.deltaY);0!=d.deltaY&&g&&(f=-d.deltaX);return{deltaX:e,deltaY:f}};this.onDoubleTap=function(d){if(!(BookInfo.getBook().status_resize||BookInfo.getBook().flipping||(BookInfo.getBook().endFlip(),global.windowTapInterval&&window.clearTimeout(global.windowTapInterval), this.parameters.resize||this.parameters.zoomming)))if(BookInfo.getBook().unSelect(),this.status_zoom=!0,!this.parameters.zoomFlag)BookEvent.trigger("zoomIn",["double tap",BookInfo.getCurrentPages().join("-")]),this.zoomIn(this),this.parameters.origin=this.mathOrigin(this,d),this.originObj(this,this.parameters.origin),this.parameters.zoomOut=!1,this.animateToScale(this,this.middleScale,d);else if(this.parameters.zoomFlag){this.beforeZoomOut(this);BookEvent.trigger("zoomOut",["double tap",BookInfo.getCurrentPages().join("-")]); var e=this.parameters.naturalWidth/this.parameters.width;this.parameters.zoomOut=!0;this.animateToScale(this,e,d)}};this.onPinch=function(d){"pinchstart"==d.type&&(this.pinchStart=!0);if(!(this.parameters.resize||this.parameters.zoomming||!this.parameters.zoomFlag&&1>=d.scale)&&d&&d.pointers){BookInfo.getBook().unSelect();this.animateInterval&&this.animateInterval.stop();this.swipeInterval&&this.swipeInterval.stop();var e=function(){this.pinchStart=!1;this.parameters.zoomFlag||(this.parameters.zoomOut= !1,this.zoomIn(this));BookEvent.trigger("zoomIn",["pinch",BookInfo.getCurrentPages().join("-")]);this.scale=this.parameters.toScale;this.parameters.origin=this.mathOrigin(this,d);this.originObj(this,this.parameters.origin);this.pinchMoveIn(this,parseFloat(this.scale)*parseFloat(d.scale),d,this.parameters.origin)}.bind(this);"pinchstart"==d.type&&(this.parameters.onPinch=!0,e(d));"pinchend"==d.type&&(this.parameters.scale=this.parameters.toScale,this.parameters.onPinch=!1,this.exceedScale(this,d), this.pinchStart=!1);"pinchmove"==d.type&&(this.pinchStart&&e(d),this.pinchMoveIn(this,parseFloat(this.scale)*parseFloat(d.scale),d,this.parameters.origin));"pinchcancel"==d.type&&(this.parameters.scale=this.parameters.toScale,this.parameters.onPinch=!1,this.exceedScale(this,d),this.pinchStart=!1)}};this.exceedScale=function(d,e){var f=d.parameters.width*d.parameters.toScale/d.parameters.naturalWidth,g=d.parameters.width*d.parameters.toScale,h=d.parameters.height*d.parameters.toScale,k=d.parameters.naturalWidth* d.maxScale/d.parameters.width,l=d.parameters.naturalWidth/d.parameters.width,n=d.parameters.toScale;f>d.maxScale&&(n=k);if(1>f||gwindowWidth){var x=windowWidth-p-l+h*e*d.parameters.zoomArea.right/100-w;l=-l-h*e*d.parameters.zoomArea.left/100+u}else x=-l-h*e*d.parameters.zoomArea.left/100+u,l=windowWidth-p-l+h*e*d.parameters.zoomArea.right/100-w;q>windowHeight?(h=windowHeight-q-n+k*e*d.parameters.zoomArea.bottom/100- v,d=-n-k*e*d.parameters.zoomArea.top/100+B):(h=-n-k*e*d.parameters.zoomArea.top/100+B,d=windowHeight-q-n+k*e*d.parameters.zoomArea.bottom/100-v);g=Number.between(g,x,l);f=Number.between(f,h,d);return{x:parseInt(g),y:parseInt(f)}}};this.pinchMoveIn=function(d,e,f){if(!d.parameters.eventCancel&&!d.parameters.zoomming&&f&&f.pointers&&2==f.pointers.length){var g={};g.scale=e;g.tran=d.mathTran(d,f,d.parameters.origin);d.transformSetting(d,g);d.parameters.toScale=e}};this.mathTran=function(d,e,f){if(!e|| !e.pointers||0>=e.pointers.length||!f)return{x:0,y:0};var g=this.getPageXY(e);e=g.pageX;g=g.pageY;var h=d.parameters.width;var k=d.parameters.height;var l=d.parameters.left;d=d.parameters.top;l=(f.x*h/100+l).toFixed(2);f=(f.y*k/100+d).toFixed(2);e-=parseFloat(l);f=g-parseFloat(f);return{x:parseFloat(e.toFixed(2)),y:parseFloat(f.toFixed(2))}};this.mathOrigin=function(d,e){if(!e||!e.pointers||0>=e.pointers.length)return{x:50,y:50};var f=this.getPageXY(e);e=f.pageX;f=f.pageY;var g=d.parameters.width; var h=d.parameters.height;var k=this.getBookOffset(d);e=(e-parseInt(k.left))/(g*d.parameters.scale);d=(f-parseInt(k.top))/(h*d.parameters.scale);return{x:(100*e).toFixed(2),y:(100*d).toFixed(2)}};this.getPageXY=function(d){var e=bookConfig.upsideOnMobile();if(1==d.pointers.length){var f=d.pointers[0].pageX;var g=d.pointers[0].pageY}1=n&&(q=d.parameters.tran,p=g.x-q.x,q=g.y-q.y);p=d.panForMove(d,p,q);d.setZoomParameters(d,p);l>=n&&(d.animateInterval.stop(),BookInfo.getBook().bookAttachments&&BookInfo.getBook().bookAttachments.Items.find("ZoomMap").each(function(B){B.refreshArea()}),e&&"function"==typeof e&&e())}.animation(this,320)}}};this.transformSetting=function(d,e){d.setZoomParameters(d,e);e= transformCSS(e);d.css(e)};this.panForMove=function(d,e,f,g){var h=d.parameters?d.parameters.tran:{x:0,y:0};g=d.parameters?d.parameters.scale:1;h||(h={x:0,y:0});g||0==g||(g=1);e=parseInt(h.x+e);var k=parseInt(h.y+f);f={x:e,y:k};BookInfo.getBook().disableDriection&&(f=bookConfig.FlipDirection||bookConfig.upsideOnMobile()?{x:e,y:h.y}:{x:h.x,y:k});h=transformCSS({tran:f,scale:g});d.css(h);return{tran:f,scale:g}};this.originObj=function(d,e){d.css({"-webkit-transform-origin":e.x+"% "+e.y+"%","-moz-transform-origin":e.x+ "% "+e.y+"%","-ms-transform-origin":e.x+"% "+e.y+"%","-o-transform-origin":e.x+"% "+e.y+"%"})};this.setZoomParameters=function(d,e){function f(k){return void 0!==k&&null!==k}function g(k){return f(e[k])&&!isNaN(e[k])?e[k]:d.parameters[k]}function h(k){return f(e[k])?e[k]:d.parameters[k]}d&&d.parameters&&e&&(d.parameters={width:g("width"),height:g("height"),naturalWidth:g("naturalWidth"),naturalHeight:g("naturalHeight"),left:g("left"),top:g("top"),scale:g("scale"),rotate:g("rotate"),toScale:g("toScale"), tran:h("tran"),origin:h("origin"),zoomFlag:h("zoomFlag"),zoomming:h("zoomming"),zoomOut:h("zoomOut"),resize:h("resize"),eventCancel:h("eventCancel"),zoomArea:h("zoomArea"),zoomDelay:h("zoomDelay"),onPan:h("onPan"),onSwipe:h("onSwipe"),onDoubleTap:h("onDoubleTap"),onPinch:h("onPinch")})};this.animateToTransform=function(d,e,f){if(!this.parameters.eventCancel&&!this.parameters.zoomming){this.options&&this.options.zoomStart&&this.options.zoomStart();var g=this.getBookOffset($(this));this.parameters.tran= getTransform(this[0]);if(parseInt(e.x)!=parseInt(this.parameters.tran.x)||parseInt(e.y)!=parseInt(this.parameters.tran.y)||d.toFixed(2)!=this.parameters.scale.toFixed(2)){this.parameters.zoomming=!0;this.parameters.left=g.left-this.parameters.tran.x;this.parameters.top=g.top-this.parameters.tran.y;this.parameters.width=$(this).width();this.parameters.height=$(this).height();this.parameters.naturalWidth=$(this).width();this.parameters.naturalHeight=$(this).height();this.setZoomSize();var h={};h.origin= this.parameters.origin;h.scale=d;h.tran=e;h.origin=f;this.zoomTran=h;e=transformCSS(h);this.originObj(this,h.origin);animateOnce(this,e,300,function(){getTransform(this[0]);this.transformSetting(this,h);this.parameters.scale=d;this.parameters.toScale=d;this.parameters.zoomming=!1;if(this.options.onZoomed)this.options.onZoomed(h)}.bind(this),"%stransform","ease-out")}}};this.animateToTransform=function(d,e,f){if(!this.parameters.eventCancel&&!this.parameters.zoomming){this.options&&this.options.zoomStart&& this.options.zoomStart();var g=this.getBookOffset($(this));this.parameters.tran=getTransform(this[0]);if(parseInt(e.x)!=parseInt(this.parameters.tran.x)||parseInt(e.y)!=parseInt(this.parameters.tran.y)||d.toFixed(2)!=this.parameters.scale.toFixed(2)){this.parameters.zoomming=!0;this.parameters.left=g.left-this.parameters.tran.x;this.parameters.top=g.top-this.parameters.tran.y;this.parameters.width=$(this).width();this.parameters.height=$(this).height();this.parameters.naturalWidth=$(this).width(); this.parameters.naturalHeight=$(this).height();this.setZoomSize();var h={};h.scale=d;h.tran=e;h.origin=f;this.zoomTran=h;this.originObj(this,h.origin);try{var k=$.easing.easeOutSine,l=function(){(function(p,q){n(p,q,"Sine")}).animation(this,300)}.bind(this),n=function(p,q,B){if(p(c/=f/2)?e/2*c*c+d:-e/2*(--c*(c-2)-1)+d},easeInCubic:function(b,c,d,e,f){return e*(c/=f)*c*c+d},easeOutCubic:function(b,c,d,e,f){return e*((c=c/f-1)*c*c+1)+d},easeInOutCubic:function(b,c,d,e,f){return 1>(c/=f/2)?e/2*c*c*c+d: e/2*((c-=2)*c*c+2)+d},easeInQuart:function(b,c,d,e,f){return e*(c/=f)*c*c*c+d},easeOutQuart:function(b,c,d,e,f){return-e*((c=c/f-1)*c*c*c-1)+d},easeInOutQuart:function(b,c,d,e,f){return 1>(c/=f/2)?e/2*c*c*c*c+d:-e/2*((c-=2)*c*c*c-2)+d},easeInQuint:function(b,c,d,e,f){return e*(c/=f)*c*c*c*c+d},easeOutQuint:function(b,c,d,e,f){return e*((c=c/f-1)*c*c*c*c+1)+d},easeInOutQuint:function(b,c,d,e,f){return 1>(c/=f/2)?e/2*c*c*c*c*c+d:e/2*((c-=2)*c*c*c*c+2)+d},easeInSine:function(b,c,d,e,f){return-e*Math.cos(c/ f*(Math.PI/2))+e+d},easeOutSine:function(b,c,d,e,f){return e*Math.sin(c/f*(Math.PI/2))+d},easeInOutSine:function(b,c,d,e,f){return-e/2*(Math.cos(Math.PI*c/f)-1)+d},easeInExpo:function(b,c,d,e,f){return 0==c?d:e*Math.pow(2,10*(c/f-1))+d},easeOutExpo:function(b,c,d,e,f){return c==f?d+e:e*(-Math.pow(2,-10*c/f)+1)+d},easeInOutExpo:function(b,c,d,e,f){return 0==c?d:c==f?d+e:1>(c/=f/2)?e/2*Math.pow(2,10*(c-1))+d:e/2*(-Math.pow(2,-10*--c)+2)+d},easeInCirc:function(b,c,d,e,f){return-e*(Math.sqrt(1-(c/=f)* c)-1)+d},easeOutCirc:function(b,c,d,e,f){return e*Math.sqrt(1-(c=c/f-1)*c)+d},easeInOutCirc:function(b,c,d,e,f){return 1>(c/=f/2)?-e/2*(Math.sqrt(1-c*c)-1)+d:e/2*(Math.sqrt(1-(c-=2)*c)+1)+d},easeInElastic:function(b,c,d,e,f){b=0;var g=e;if(0==c)return d;if(1==(c/=f))return d+e;b||(b=.3*f);gc?-.5*h*Math.pow(2,10*--c)*Math.sin(2*(c*f-b)*Math.PI/g)+d:h*Math.pow(2,-10*--c)*Math.sin(2*(c*f-b)*Math.PI/g)*.5+e+d},easeInBack:function(b,c,d,e,f,g){void 0==g&&(g=1.70158);return e*(c/=f)*c*((g+1)* c-g)+d},easeOutBack:function(b,c,d,e,f,g){void 0==g&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(b,c,d,e,f,g){void 0==g&&(g=1.70158);return 1>(c/=f/2)?e/2*c*c*(((g*=1.525)+1)*c-g)+d:e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-jQuery.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(b,c,d,e,f){return(c/=f)<1/2.75?7.5625*e*c*c+d:c<2/2.75?e*(7.5625*(c-=1.5/2.75)*c+.75)+d:c<2.5/2.75?e*(7.5625*(c-=2.25/2.75)*c+.9375)+d:e*(7.5625* (c-=2.625/2.75)*c+.984375)+d},easeInOutBounce:function(b,c,d,e,f){return cl+p&&(c=l+p-e.left-this.width()+f);e.top+k+this.height()>n+q&&(d=n+q-e.top-this.height()+g);e.left+h")[0];var h=g.getContext("2d")}catch(w){return}var k=f.width(),l=f.height(); f=f[0];void 0==c&&(c=!1);var n=getHost(f.src),p=getHost();if(n&&p!==n){if(g=f.src.replace(n,p),f.src=g,0==c)$(f).on("load",function(){try{e.changeButtonColor(b,!0,d)}catch(w){}})}else{g.width=k;g.height=l;try{h.drawImage(f,0,0,f.naturalWidth,f.naturalHeight,0,0,k,l);var q=h.getImageData(0,0,k,l),B=h.getImageData(0,0,k,l);if(1!=f.colorChanged&&q){var v=Color(b).split();k=0;for(var u=q.data.length;kbrowserType)){switch(browserType){case 1:this.css({"-webkit-transform":"rotate("+b+"deg)"});break;case 2:this.css({"-moz-transform":"rotate("+b+"deg)"});break;case 3:this.css({"-ms-transform":"rotate("+b+"deg)"});break;case 4:this.css({"-o-transform":"rotate("+b+"deg)"})}this.css({transform:"rotate("+b+"deg)"})}}; $.fn.scale=function(b,c){void 0==c&&(c="50% 50% 0");this.css({"-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")","-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"transform-origin":c})}; $.fn.transition3D=function(){this.css({"-ms-transform":"translate3d(0,0,0)","-webkit-transform":"translate3d(0,0,0)","-moz-transform":"translate3d(0,0,0)","-o-transform":"translate3d(0,0,0)",transform:"translate3d(0,0,0)"});return this}; jQuery.fn.appearance=function(b,c,d){d=d||{};this.background=$("
");this.addClass("main_dom");this.background.append(this);d.defaultHide&&this.background.css("opacity",0).hide();this.show=function(){var e=this;this.animating=!0;this.background.show();this.background.animate({opacity:1},function(){e.animating=!1;e.background.show();b&&b()})}.bind(this);this.hide=function(){var e=this;this.animating=!0;this.background.animate({opacity:0},function(){e.animating=!1;e.background.hide(); c&&c()})}.bind(this);this.getDom=function(){return this.background}.bind(this);this.background.click(function(e){e.target==e.currentTarget&&(this.animating||this.hide())}.bind(this));return this.background}; $.fn.speed=function(b){function c(u){u=void 0==u.originalEvent.touches?[u]:u.originalEvent.touches;if(1>18&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q>>12&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q>>6&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q&63);2==l?(q=k.charCodeAt(p)<<8,B=k.charCodeAt(++p),q+=B,n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q>> 10)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q>>4&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q<<2&63)+"="):1==l&&(q=k.charCodeAt(p),n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q<<4&63)+"==");return n},decode:function(k){k=String(k);for(var l=k.length,n=0,p,q,B="",v=-1;++v>(-2*n&6)));return B},version:"0.1.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return g});else if(c&&!c.nodeType)if(d)d.exports=g;else for(var h in g)g.hasOwnProperty(h)&&(c[h]=g[h]);else b.base64=g})(this);function parsHexToNormalString(b){for(var c="";2<=b.length;)c+=String.fromCharCode(parseInt(b.substring(0,2),16)),b=b.substring(2,b.length);return c} function parseHexString(b){for(var c=[];2<=b.length;)c.push(parseInt(b.substring(0,2),16)),b=b.substring(2,b.length);return c}function byteArray2String(b){for(var c="",d=0;df;f++)d[f]=f,e[f]=b.charCodeAt(f%b.length);for(f=b=0;256>f;f++){b=b+d[f]+e[f]&255;var g=d[f];d[f]=d[b];d[b]=g}b=e=0;g="";for(f=0;f>16)+(u>>16)+(w>>16)<<16|w&65535}function d(v,u,w,x,y,A){v=c(c(u,v),c(x,A));return c(v<>>32-y,w)}function e(v,u,w,x,y,A,G){return d(u&w|~u&x,v,u,y,A,G)}function f(v,u,w,x,y,A,G){return d(u&x|w&~x,v,u,y,A,G)}function g(v,u,w,x,y,A,G){return d(w^(u|~x),v,u,y,A,G)}function h(v,u){v[u>>5]|=128<>>9<<4)+14]=u;var w=1732584193,x=-271733879,y=-1732584194,A=271733878;for(u=0;u>5]>>>u%32&255);return w}function l(v){var u,w=[];w[(v.length>>2)-1]=void 0;for(u=0;u>5]|=(v.charCodeAt(u/8)&255)<v;v+=1)x[v]=w[v]^909522486,y[v]=w[v]^1549556828;u=h(x.concat(l(u)),512+8*u.length);return k(h(y.concat(u),640))}function q(v){var u="",w;for(w=0;w>>4&15)+"0123456789abcdef".charAt(x&15)}return u}function B(v,u,w){u?w?v=p(unescape(encodeURIComponent(u)),unescape(encodeURIComponent(v))):(v=p(unescape(encodeURIComponent(u)), unescape(encodeURIComponent(v))),v=q(v)):v=w?n(unescape(encodeURIComponent(v))):q(n(unescape(encodeURIComponent(v))));return v}"function"===typeof define&&define.amd?define(function(){return B}):"object"===typeof module&&module.exports?module.exports=B:b.md5=B})(this);String.prototype.MD5=function(b){return md5(this)}; var ObjectPool=Class({objects:null,length:0,create:function(){this.objects=[]},add:function(b){b&&(this.objects.push(b),this.length=this.objects.length)},remove:function(b){b&&(this.objects.removeElement(b),this.length=this.objects.length)},exists:function(b){if("string"!=typeof b||""==b)return!1;b=b.toLowerCase();for(var c=0;cc.length)return Point(0,0);c=c[1].split(", ");return Point(parseInt(c[0],10),parseInt(c[1],10))},getTransformScale=function(b){switch(browserType){case 3:var c= b.style["-ms-transform"];break;case 2:c=b.style["-moz-transform"];break;case 1:c=b.style["-webkit-transform"];break;case 4:c=b.style["-o-transform"];break;default:c=b.style.transform}if(void 0==c||null==c)if(c=b.style.transform,void 0==c||null==c)return 1;c=c.match(/scale\((.*?)\)/)||c.match(/scale3d\((.*?)\)/);if(null==c||""==c||2>c.length)return 1;c=c[1].split(",");return c[0]},getTransformRotate=function(b){switch(browserType){case 3:var c=b.style["-ms-transform"];break;case 2:c=b.style["-moz-transform"]; break;case 1:c=b.style["-webkit-transform"];break;case 4:c=b.style["-o-transform"];break;default:c=b.style.transform}if(void 0==c||null==c)if(c=b.style.transform,void 0==c||null==c)return 0;c=c.match(/rotate\((.*?)\)/)||c.match(/rotate3d\((.*?)\)/);if(null==c||""==c||2>c.length)return 0;c=c[1].split(",");return parseInt(c[0])},getColor=function(b,c){b=bookConfig[b];return void 0!=b?Color(b).toString():c},getImage=function(b){return b?$(""):new Image},parseBool=function(b,c){if(!0=== b||!1===b)return b;if(void 0==b||null==b)return!1;c=!!c;if("number"==typeof b)return 0!=b;if("string"!=typeof b||""==b)return!1;var d=["true","yes","show","enable"],e=["false","no","hide","disable"];b=b.toLowerCase();return 0>d.indexOf(b)&&0>e.indexOf(b)?c:0<=d.indexOf(b)},getLanguage=function(b,c){if(global.selectedLanguage&&selectedLanguage[b])return selectedLanguage[b];if(global.aliasLanguage&&aliasLanguage[b]){b=aliasLanguage[b];for(var d=0;d b.length)return b;var d=b.length;c=b.toLowerCase().indexOf(c.toLowerCase());if(50<=c){var e=Math.max(50<=d-c?c-50:d-100,0);e=".."+b.substring(e,c)}else e=b.substring(0,c);b=50g.length)){f=getRealPageNumber(g[0]);var h=getRealPageNumber(g[1]);g=Math.max(f,h);for(f=Math.min(f,h);f<=g;f++)f>bookConfig.totalPageCount||c(f)||d.push(f)}}}return d},isSlideBook=function(){return"slide"==bookConfig.FlipStyle.toLowerCase()||isBelowIE9()?!0:!1}; function addGoogleAdSense(){bookConfig.haveAdSense&&bookConfig.adSenseClientId&&loadJavascript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",function(){var b=document.createElement("ins");b=$(b);b.addClass("adsbygoogle");b.css({display:"inline-block",width:"100%",height:"100%"});b.attr("data-ad-client",bookConfig.adSenseClientId);b.attr("data-ad-slot",bookConfig.adSenseSlotId);var c=$("
");c.css({position:"absolute","z-index":100,left:bookConfig.adSenseLeft+"px",top:bookConfig.adSenseTop+ "px",width:bookConfig.adSenseWidth+"px",height:bookConfig.adSenseHeight+"px"});c.bind(_event._down,function(){BookEvent.trigger("googleAdSense",[bookConfig.adSenseClientId,bookConfig.adSenseSlotId,bookConfig.adSenseLeft,bookConfig.adSenseTop,bookConfig.adSenseWidth,bookConfig.adSenseHeight])});tmpContainer.append(c);c.append(b);eval("(adsbygoogle = window.adsbygoogle || []).push({});")})} var changeLanguage=function(b){selectLanguage(b);global.toolBar&&toolBar.changeLanguage&&toolBar.changeLanguage();global.printBody&&printBody.changeLanguage();global.helpBody&&helpBody.changeLanguage();global.aboutBody&&aboutBody.changeLanguage();global.sharePanel&&sharePanel.changeLanguage();global.languagePanel&&languagePanel.changeLanguage();global.videoGallery&&videoGallery.changeLanguage();global.photoGallery&&photoGallery.changeLanguage();global.bookmark&&bookmark.changeLanguage();global.frmTableOfContent&& frmTableOfContent.changeLanguage();global.frmSearch&&frmSearch.changeLanguage();global.thumbnail&&thumbnail.changeLanguage();global.bookInstructions&&global.bookInstructions.changeLanguage&&global.bookInstructions.changeLanguage();global.telephoneNumberForm&&global.telephoneNumberForm.changeLanguage();global.settingBody&&global.settingBody.changeLanguage();global.doubleSinglePageForm&&global.doubleSinglePageForm.changeLanguage();global.downLoadBody&&global.downLoadBody.changeLanguage();global.annotationPannel&& global.annotationPannel.changeLanguage();global.jsLoadingBar&&global.jsLoadingBar.changeLanguage(b);global.reportPanel&&global.reportPanel.changeLanguage(b);global.chatbotPanel&&global.chatbotPanel.changeLanguage(b);BookEvent.trigger("changeLanguage",[])},baiduAnalytics=function(){bookConfig.baiduAnalyticsID&&window.setTimeout(function(){var b=document.createElement("script");b.src="https://hm.baidu.com/hm.js?"+bookConfig.baiduAnalyticsID;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b, c)},3E3)},controlAudioVolume=function(){if(!isNaN(bookConfig.bgSoundVol)){var b=parseFloat(bookConfig.bgSoundVol/100);global.bgSound&&global.bgSound.setVolume(b);flipAudio&&(flipAudio[0].volume=b)}},TurnonAutoFlip=function(){bookConfig.autoFlipOnStart&&window.setTimeout(function(){auto_player&&auto_player.start();toolBar&&toolBar.changeAutoPlayIcon&&toolBar.changeAutoPlayIcon()},1E3)},playFlipSound=function(){if(global.flipSoundIsPlaying)if(!isPhone()&&!isPad()&&!isIE()){var b="flipsound";if(bookType== BookType.slide_book||bookType==BookType.singleSlide_book)b="slidesound";var c=soundBaseURL+b+".mp3";b=soundBaseURL+b+".ogg";bookConfig.flipSoundURL&&(b=c=bookConfig.flipSoundURL);0<$("#flippingSound").length&&$("#flippingSound").remove();c=$("");$("body").append(c);b=parseFloat(bookConfig.bgSoundVol/100); c[0].volume=b;c.bind("ended",function(){$(this).remove()});try{c[0].currentTime=0,c[0].play()}catch(d){}}else if(!isPlaying||!isAndroidDefault())try{flipAudio[0].currentTime=0,flipAudio[0].play()}catch(d){}},initFlipSound=function(){if(isPhone()||isPad()||isIE()){var b="flipsound";if(bookType==BookType.slide_book||bookType==BookType.singleSlide_book)b="slidesound";var c=soundBaseURL+b+".mp3";b=soundBaseURL+b+".ogg";bookConfig.flipSoundURL&&(b=c=bookConfig.flipSoundURL);flipAudio=$("");$("body").append(flipAudio)}},initSettingBody=function(){(isPhone()||isPad())&&"neat"===_get(htmlConfig,"phoneTemplate.name")&&"Chinese"==UserGroups?(console.log(toolBar.$morePanel,"initSettingBody"),toolBar.$morePanel&&toolBar.$morePanel.appendMusicButton()):global.settingBody?global.settingBody.reset&&global.settingBody.reset():isPhone()||isPad()?global.settingBody=new PhoneSettingForm({parent:tmpContainer, formType:"setting",rightToLeft:rightToLeft}):global.settingBody=new PcSoundSettingForm({parent:tmpContainer,formType:"brief"==global.templeteName?"setting":"settingpc",rightToLeft:rightToLeft})};function copyFromObj(b){if(b){b.focus();b.select();try{document.execCommand("Copy")}catch(c){b=b.val(),copyToClipboard(b)}}} function copyHref(b){global.isBelowIE9()||(b=new ClipboardJS(b,{text:function(c){c=_get(window,"toolBar.$shareForm.addCurrentPage");return share_url+(c?"#p="+BookInfo.getCurrentPageIndex():"")}}),b.on("success",function(c){"Chinese"==UserGroups&&alert("\u590d\u5236\u7f51\u5740\u6210\u529f");"English"==UserGroups&&alert("Copied successfully");c.clearSelection()}),b.on("error",function(c){uc?("Chinese"==UserGroups&&alert("\u590d\u5236\u7f51\u5740\u6210\u529f"),"English"==UserGroups&&alert("Copied successfully"), c.clearSelection()):("Chinese"==UserGroups&&alert("\u590d\u5236\u7f51\u5740\u5931\u8d25"),"English"==UserGroups&&alert("Copied failed"))}))} function copyToClipboard(b){if(window.clipboardData)window.clipboardData.clearData(),window.clipboardData.setData("Text",b);else if(-1!=navigator.userAgent.indexOf("Opera"))window.location=b;else if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(f){return alert(getLanguage("infCopyToClipboard","Your browser does not support clipboard.")),!1}var c=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard); if(c){var d=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(d){d.addDataFlavor("text/unicode");var e=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);e.data=b;d.setTransferData("text/unicode",e,2*b.length);if(!c)return!1;c.setData(d,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}else alert(getLanguage("infCopyToClipboard","Your browser does not support clipboard."))} function hideMoreBar(){global.moreBar&&moreBar.visible&&moreBar.hide()}function GetQueryString(b){b=new RegExp("(^|&)"+b+"=([^&]*)(&|$)","i");b=window.location.search.substr(1).match(b);return null!=b?decodeURIComponent(b).split(",")[2]:""}function getProtocal(){return window.location.href.toLowerCase().startsWith("https://")?"https://":"http://"} function showAlert(b,c){var d=$("body"),e=d.find(".alert-success");0

');f.append(""+b+"");c||(c="success");f.addClass(c);(isPhone()||isPad())&&f.addClass("phone");d.append(f);setTimeout(function(){f.addClass("show")},1);setTimeout(function(){f.fadeOut(function(){$(this).remove()})},2E3)} function toggleArticleTitle(b){if(!isPhone()&&!isPad()&&bookConfig.isMouseEnterToDisplayArticleTitle){var c=$("body"),d=c.find(".article-alert-title");d.length||(d=$("
"),c.append(d));if(b.isShow){c=b.pos.x;var e=b.pos.y;d.css({display:"block"});c+d.width()>windowWidth&&(c-=d[0].offsetWidth); e+d.height()>windowHeight&&(e-=d[0].offsetHeight);d.css({left:c+"px",top:e+"px"}).html(b.title)}else d.css({display:"none"})}}window.getHeight=function(){return void 0!=window.innerHeight?window.innerHeight:Math.min(document.documentElement.clientHeight,document.body.clientHeight)};window.getWidth=function(){return void 0!=window.innerWidth?window.innerWidth:Math.min(document.documentElement.clientWidth,document.body.clientWidth)}; function initBrowserType(){_agent_.browser.webkit&&(global.browserType=BrowserType.WEBKIT);_agent_.browser.mozilla&&(global.browserType=BrowserType.MOZ);_agent_.browser.opera&&(global.browserType=BrowserType.OPERA);_agent_.browser.msie&&(global.browserType=BrowserType.MS)} function resizeCatalogBook(){if(bookType==BookType.catalog_book&&global.catalogBook)if(bookConfig.FlipDirection)resizeCatalogCalendar();else{var b=catalogBook.getSpace(!1),c=catalogBook.getFitWH(),d=parseInt(c.x/2),e=parseInt(c.y),f=(windowWidth-b.left-b.right-c.x)/2+b.left;b=(windowHeight-b.top-b.bottom-c.y)/2+b.top;var g=-c.x/4;c=c.x/4;var h={},k=0;1==bookConfig.retainBookCenter&&(h=catalogBook.getCurrentPageIndex(),BookInfo.isCoverPage(h)&&BookInfo.isLeftPage(h,!0)&&(k=c),BookInfo.isCoverPage(h)&& !BookInfo.isLeftPage(h,!0)&&(k=g),h={tran:{x:k,y:0},scale:1,origin:{x:0,y:0}});h.top=b;h.left=f;useTheAliCloudChart(d,e);catalogBook.setCSS(h);catalogBook.onResize(d,e);catalogBook.resetZoomConfig()}} function resizeCatalogCalendar(){var b=catalogBook.getSpace(!1),c=catalogBook.getFitWH(),d=parseInt(c.x),e=parseInt(c.y/2),f=(windowWidth-b.left-b.right-c.x)/2+b.left;b=(windowHeight-b.top-b.bottom-c.y)/2+b.top;var g=-c.y/4;c=c.y/4;var h={},k=0;1==bookConfig.retainBookCenter&&(h=catalogBook.getCurrentPageIndex(),BookInfo.isCoverPage(h)&&BookInfo.isLeftPage(h,!0)&&(k=c),BookInfo.isCoverPage(h)&&!BookInfo.isLeftPage(h,!0)&&(k=g),h={tran:{x:0,y:k},scale:1,origin:{x:0,y:0}});h.top=b;h.left=f;useTheAliCloudChart(d, e);catalogBook.setCSS(h);catalogBook.onResize(d,e);catalogBook.resetZoomConfig()} function resizeFlipBook(){if(bookType==BookType.normal_book||bookType==BookType.single_book)if(bookConfig.FlipDirection)resizeFlipCalendar();else if("issuu"==bookConfig.FlipStyle)resizeIssuuBook();else{if(global.flipBook){var b=flipBook.getSpace(!1),c=flipBook.getFitWH(),d=parseInt(c.x/2),e=parseInt(c.y),f=(windowWidth-b.left-b.right-c.x)/2+b.left;b=(windowHeight-b.top-b.bottom-c.y)/2+b.top;var g=-c.x/4;c=c.x/4;var h={tran:{x:0,y:0},scale:1,origin:{x:0,y:0}},k=0;1==bookConfig.retainBookCenter&&(h= flipBook.getCurrentPageIndex(),BookInfo.isCoverPage(h)&&BookInfo.isLeftPage(h,!0)&&(k=c),BookInfo.isCoverPage(h)&&!BookInfo.isLeftPage(h,!0)&&(k=g),h={tran:{x:parseInt(k),y:0},scale:1,origin:{x:0,y:0}});h.top=b;h.left=f;bookType==BookType.normal_book&&useTheAliCloudChart(d,e);flipBook.setCSS(h);flipBook.onResize(d,e);flipBook.resetZoomConfig()}global.singlePageBook&&(bookConfig.isSingleBookFullWindowOnMobile&&(isPhone()||isPad())?(d=windowWidth,e=windowHeight,b=f=0):(c=singlePageBook.getFitWH(),d= c.x,e=c.y,b=singlePageBook.getSpace(!0),f=(windowWidth-b.left-b.right-d)/2+b.left,b=(windowHeight-b.top-b.bottom-e)/2+b.top),bookType==BookType.single_book&&useTheAliCloudChart(d,e),singlePageBook.onResize(d,e),singlePageBook.setCSS({top:b,left:f}),singlePageBook.setCSS({tran:{x:0,y:0},scale:1,origin:{x:0,y:0}}),singlePageBook.resetZoomConfig())}} function resizeIssuuBook(){if("issuu"==bookConfig.FlipStyle&&(bookType==BookType.normal_book||bookType==BookType.single_book)){if(global.flipBook){var b=flipBook.getCurrentPageIndex(),c=flipBook.getSpace(),d=flipBook.getFitWHByIndex(b),e=parseInt(d[0].x+d[1].x);d=parseInt(d[0].y);var f=(windowWidth-c.left-c.right-e)/2+c.left;c=(windowHeight-c.top-c.bottom-d)/2+c.top;var g=-e/4,h=e/4,k=0;1!=bookConfig.retainBookCenter||flipBook.getMovedXByIndex||(b=flipBook.getCurrentPageIndex(),BookInfo.isCoverPage(b)&& BookInfo.isLeftPage(b,!0)&&(k=h),BookInfo.isCoverPage(b)&&!BookInfo.isLeftPage(b,!0)&&(k=g),b={tran:{x:parseInt(k),y:0},scale:1,origin:{x:0,y:0}},b.top=c,b.left=f,flipBook.setCSS(b));bookType==BookType.normal_book&&useTheAliCloudChartOnIsuuBook(e,d);flipBook.onResize(e,d);flipBook.getMovedXByIndex&&(flipBook.getCurrentPageIndex(),b={tran:{x:0,y:0},scale:1,origin:{x:0,y:0}},b.top=c,b.left=f,flipBook.setCSS(b));flipBook.resetZoomConfig()}global.singlePageBook&&(bookConfig.isSingleBookFullWindowOnMobile&& (isPhone()||isPad())?(e=windowWidth,d=windowHeight,b=f=0):(b=singlePageBook.getCurrentPageIndex(),d=singlePageBook.getFitWHByIndex(b),e=d[0].x,d=d[0].y,c=singlePageBook.getSpace(!0),f=(windowWidth-c.left-c.right-e)/2+c.left,b=(windowHeight-c.top-c.bottom-d)/2+c.top),bookType==BookType.single_book&&useTheAliCloudChartOnIsuuBook(e,d),singlePageBook.onResize(e,d),singlePageBook.setCSS({top:b,left:f}),singlePageBook.setCSS({tran:{x:0,y:0},scale:1,origin:{x:0,y:0}}),singlePageBook.resetZoomConfig())}} function resizeFlipCalendar(){if(global.flipBook){var b=flipBook.getSpace(!1),c=flipBook.getFitWH(),d=parseInt(c.x),e=parseInt(c.y/2),f=(windowWidth-b.left-b.right-c.x)/2+b.left;b=(windowHeight-b.top-b.bottom-c.y)/2+b.top;var g=-c.y/4;c=c.y/4;var h={},k=0;1==bookConfig.retainBookCenter&&(h=flipBook.getCurrentPageIndex(),BookInfo.isCoverPage(h)&&BookInfo.isLeftPage(h,!0)&&(k=c),BookInfo.isCoverPage(h)&&!BookInfo.isLeftPage(h,!0)&&(k=g),h={tran:{x:0,y:k},scale:1,origin:{x:0,y:0}});h.top=b;h.left=f; bookType==BookType.normal_book&&useTheAliCloudChart(d,e);flipBook.setCSS(h);flipBook.onResize(d,e);flipBook.resetZoomConfig()}global.singlePageBook&&(bookConfig.isSingleBookFullWindowOnMobile&&(isPhone()||isPad())?(d=windowWidth,e=windowHeight,b=f=0):(c=singlePageBook.getFitWH(),d=c.x,e=c.y,b=singlePageBook.getSpace(!0),f=(windowWidth-b.left-b.right-d)/2+b.left,b=(windowHeight-b.top-b.bottom-e)/2+b.top),bookType==BookType.single_book&&useTheAliCloudChart(d,e),singlePageBook.onResize(d,e),singlePageBook.setCSS({top:b, left:f}),singlePageBook.setCSS({tran:{x:0,y:0},scale:1,origin:{x:0,y:0}}),singlePageBook.resetZoomConfig())}function resizeSlideBook(){if(bookType==BookType.singleSlide_book||bookType==BookType.slide_book){if(global.slideBook)slideBook.onResize();if(global.singleSlideBook)singleSlideBook.onResize()}} function resizeDocumentViewBook(){if(bookType==BookType.documentView_book||bookType==BookType.singleDocumentView_book){if(global.singleDocumentViewBook)singleDocumentViewBook.onResize();if(global.singleDocumentViewBook)singleDocumentViewBook.onResize()}}function resizeCardBook(){if(bookType==BookType.card_book&&global.cardBook)cardBook.onResize()} function changeShowBookByWindow(){if(bookConfig.FlipDirection)changeShowBookByWindowHorizonal();else{var b=!1;if(bookType==BookType.single_book&&windowWidth>=windowHeight&&"auto"==bookConfig.showDoublePage){bookType=BookType.normal_book;changeShowBook(bookType);var c=singlePageBook.currentPageIndex;b=!0}bookType==BookType.singleSlide_book&&windowWidth>=windowHeight&&"auto"==bookConfig.showDoublePage&&(bookType=BookType.slide_book,changeShowBook(bookType),c=singleSlideBook.getRealPageIndex(),b=!0); bookType==BookType.singleDocumentView_book&&windowWidth>=windowHeight&&"auto"==bookConfig.showDoublePage&&(bookType=BookType.singleDocumentView_book,changeShowBook(bookType),c=singleDocumentViewBook.getRealPageIndex(),b=!0);bookType==BookType.slide_book&&windowWidth=windowHeight&&"auto"==bookConfig.showDoublePage&&(bookType=BookType.singleSlide_book,changeShowBook(bookType),c=slideBook.getRealPageIndex(),b=!0);bookType==BookType.normal_book&&windowWidth>=windowHeight&&"auto"==bookConfig.showDoublePage&&(bookType=BookType.single_book,changeShowBook(bookType),c=flipBook.currentPageIndex, b=!0);bookType==BookType.documentView_book&&windowWidth>=windowHeight&&"auto"==bookConfig.showDoublePage&&(bookType=BookType.singleDocumentView_book,changeShowBook(bookType),c=singleDocumentViewBook.currentPageIndex,b=!0);resizeFlipBook();resizeCatalogBook();resizeSlideBook();resizeDocumentViewBook();resizeCardBook();b&&(gotoPageFun(c,!1,"change book type"),global.thumbnail&&thumbnail.clearHighLight(),global.thumbnail&&thumbnail.setHighLight(c))} function getStaticAdVisible(){return isPhone()||isPad()||!global.staticAd||!global.staticAd.haveAd||global.staticAd.adPosition?!1:!0} function initDocumentViewBook(b,c){if(bookType==BookType.documentView_book||bookType==BookType.singleDocumentView_book)if($.extend(b,{thickness:!1,bookshadow:!1,grayshadow:!1,miniFullscreen:!1,bookpagenumber:!1,staticad:!1,zoommap:!1,bookmarktab:!1,noteadd:!0}),$.extend(c,{thickness:!1,bookshadow:!1,grayshadow:!1,miniFullscreen:!1,bookpagenumber:!1,staticad:!1,zoommap:!1,bookmarktab:!1,noteadd:!0}),bookType==BookType.documentView_book||bookType==BookType.singleDocumentView_book)global.singleDocumentViewBook= new PcSingleDocViewBook(c)} function initFlipBook(b,c){"issuu"==bookConfig.FlipStyle||bookType!=BookType.normal_book&&bookType!=BookType.single_book||($.extend(b,{thickness:bookConfig.FlipDirection?!1:!0,bookshadow:!0,grayshadow:bookConfig.ShowTopLeftShadow?!0:!1,miniFullscreen:bookConfig.hideMiniFullscreen?!1:!0,bookpagenumber:bookConfig.updatePageNumberForFlip?!0:!1,staticad:getStaticAdVisible(),zoommap:bookConfig.ZoomMapVisible?!0:!1,bookmarktab:global.bmtConfig?!0:!1,noteadd:bookConfig.AnnotationButtonVisible?!0:!1}),$.extend(c, {thickness:bookConfig.showThicknessOnMobile&&!bookConfig.FlipDirection?!0:!1,bookshadow:!0,grayshadow:!1,miniFullscreen:bookConfig.hideMiniFullscreen?!1:!0,bookpagenumber:bookConfig.updatePageNumberForFlip?!0:!1,staticad:!1,zoommap:bookConfig.ZoomMapVisible?!0:!1,bookmarktab:global.bmtConfig?!0:!1,noteadd:bookConfig.AnnotationButtonVisible?!0:!1}),bookConfig.HardInnerPageEnable?bookConfig.FlipDirection?bookConfig.HardPageEnable?("single"!=bookConfig.showDoublePage&&(global.flipBook=bookConfig.isTheBookOpen? new OpenAlbumHardCalendar(b):new AlbumHardCalendar(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleAlbumHardCalendar(c))):("single"!=bookConfig.showDoublePage&&(global.flipBook=new AlbumCalendar(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleAlbumCalendar(c))):bookConfig.HardPageEnable?("single"!=bookConfig.showDoublePage&&(global.flipBook=bookConfig.isTheBookOpen?new OpenAlbumHardBook(b):new AlbumHardBook(b)),"double"!=bookConfig.showDoublePage&& (global.singlePageBook=new SingleAlbumHardBook(c))):("single"!=bookConfig.showDoublePage&&(global.flipBook=new AlbumBook(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleAlbumBook(c))):bookConfig.FlipDirection?bookConfig.HardPageEnable?("single"!=bookConfig.showDoublePage&&(global.flipBook=bookConfig.isTheBookOpen?new OpenHardCalendar(b):new HardCalendar(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleHardCalendar(c))):("single"!=bookConfig.showDoublePage&& (global.flipBook=new NormalCalendar(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleCalendar(c))):(bookConfig.HardPageEnable?("single"!=bookConfig.showDoublePage&&(global.flipBook=bookConfig.isTheBookOpen?new OpenHardBook(b):new HardBook(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleHardBook(c))):("single"!=bookConfig.showDoublePage&&(global.flipBook=new NormalBook(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleBook(c))), bookConfig.flipshortcutbutton&&window.flipShotButton&&flipShotButton.animate()))} function initIssuuBook(b,c){"issuu"!=bookConfig.FlipStyle||bookType!=BookType.normal_book&&bookType!=BookType.single_book||($.extend(b,{thickness:bookConfig.FlipDirection?!1:!0,staticad:getStaticAdVisible(),bookmarktab:global.bmtConfig?!0:!1}),$.extend(c,{thickness:bookConfig.showThicknessOnMobile&&!bookConfig.FlipDirection?!0:!1,bookshadow:!0,grayshadow:!1,miniFullscreen:bookConfig.hideMiniFullscreen?!1:!0,bookpagenumber:bookConfig.updatePageNumberForFlip?!0:!1,staticad:!1,zoommap:bookConfig.ZoomMapVisible? !0:!1,bookmarktab:global.bmtConfig?!0:!1,noteadd:bookConfig.AnnotationButtonVisible?!0:!1}),bookConfig.HardPageEnable?("single"!=bookConfig.showDoublePage&&(global.flipBook=new HardIssuuBook(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleHardIssuuBook(c))):("single"!=bookConfig.showDoublePage&&(global.flipBook=new IssuuBook(b)),"double"!=bookConfig.showDoublePage&&(global.singlePageBook=new SingleIssuuBook(c))),bookConfig.flipshortcutbutton&&window.flipShotButton&&flipShotButton.animate())} function initCatalogBook(b){bookType==BookType.catalog_book&&($.extend(b,{thickness:bookConfig.showThicknessOnMobile?!0:!1,bookshadow:!0,grayshadow:bookConfig.ShowTopLeftShadow?!0:!1,miniFullscreen:bookConfig.hideMiniFullscreen?!1:!0,bookpagenumber:bookConfig.updatePageNumberForFlip?!0:!1,staticad:getStaticAdVisible(),zoommap:bookConfig.ZoomMapVisible?!0:!1,bookmarktab:global.bmtConfig?!0:!1,noteadd:bookConfig.AnnotationButtonVisible?!0:!1}),"lite"==bookConfig.ToolbarViewMode.toLowerCase()?(global.catalogBook= bookConfig.FlipDirection?bookConfig.HardPageEnable?bookConfig.isTheBookOpen?new OpenCatalogSimpleHardCalendar(b):new CatalogSimpleHardCalendar(b):new CatalogSimpleCalendar(b):bookConfig.HardPageEnable?bookConfig.isTheBookOpen?new OpenCatalogSimpleHardBook(b):new CatalogSimpleHardBook(b):new CatalogSimpleBook(b),toolBar&&toolBar.hide()):global.catalogBook=bookConfig.FlipDirection?bookConfig.HardPageEnable?bookConfig.isTheBookOpen?new OpenCatalogHardCalendar(b):new CatalogHardCalendar(b):new CatalogCalendar(b): bookConfig.HardPageEnable?bookConfig.isTheBookOpen?new OpenCatalogHardBook(b):new CatalogHardBook(b):new CatalogBook(b))} function initSlideBook(b,c){if(bookType==BookType.slide_book||bookType==BookType.singleSlide_book){$.extend(b,{thickness:!1,bookshadow:!1,grayshadow:!1,miniFullscreen:!1,bookpagenumber:!1,staticad:getStaticAdVisible(),zoommap:!1,bookmarktab:!1,noteadd:!0});$.extend(c,{thickness:!1,bookshadow:!1,grayshadow:!1,miniFullscreen:!1,bookpagenumber:!1,staticad:!1,zoommap:!1,bookmarktab:!1,noteadd:!0});if(bookType==BookType.slide_book||bookType==BookType.singleSlide_book)"single"!=bookConfig.showDoublePage&& (global.slideBook=new PcDoubleSlideBook(b)),"double"!=bookConfig.showDoublePage&&(global.singleSlideBook=new PcSingleSlideBook(c));(isPhone()||isPad())&&global.QRbutton&&QRbutton.hide()}}function initCardBook(b){bookType==BookType.card_book&&($.extend(b,{thickness:!1,bookshadow:!1,grayshadow:!1,miniFullscreen:!1,bookpagenumber:!1,staticad:!1,zoommap:!1,bookmarktab:!1,noteadd:!0}),global.cardBook=new CardBook(b),(isPhone()||isPad())&&global.QRbutton&&QRbutton.hide())} function initBook(){var b=scrapOriginPageIndex(),c={parent:bookContainer,currentPageIndex:b,flippingTime:bookConfig.flippingTime,rightToLeft:bookConfig.RightToLeft,originTotalPageCount:originTotalPageCount,totalPageCount:totalPageCount,topMargin:bookConfig.topMargin,bottomMargin:bookConfig.bottomMargin,leftMargin:bookConfig.leftMargin,rightMargin:bookConfig.rightMargin,isDoublePage:!0},d=Math.max(1,bookConfig.totalPageCount-1);b={parent:bookContainer,currentPageIndex:bookConfig.SingleModeBanFlipToLastPage? Number.between(b,1,d):b,flippingTime:bookConfig.flippingTime,rightToLeft:bookConfig.RightToLeft,originTotalPageCount:originTotalPageCount,totalPageCount:totalPageCount,topMargin:bookConfig.topMargin,bottomMargin:bookConfig.bottomMargin,leftMargin:bookConfig.leftMargin,rightMargin:bookConfig.rightMargin,isDoublePage:!1};initFlipBook(c,b);initIssuuBook(c,b);initCatalogBook(c,b);initSlideBook(c,b);initDocumentViewBook(c,b);initCardBook(b)} function throttle(b,c){c=void 0===c?16:c;var d=0;return function(e){for(var f=[],g=0;gc)return d=g,b.apply(this,f)}}function debounce(b,c){var d=arguments,e=this;c=void 0===c?16:c;var f=null;return function(){f&&(clearTimeout(f),f=null);f=setTimeout(b.bind.apply(b,[e].concat($jscomp.arrayFromIterable(d))),c)}} function _get(b,c,d){c=Array.isArray(c)?c:c.split(".");for(var e=0;e');$(document.head).append(b);for(var d=$jscomp.makeIterator(document.styleSheets),e=d.next();!e.done;e=d.next())e=e.value,e.ownerNode===b[0]&&(c=e);return function(){return c}}var getLocalStyleSheet=initStyleSheet("local"); function updateStyleSheet(b,c,d,e){var f=getLocalStyleSheet();f||(getLocalStyleSheet=initStyleSheet("local"),f=getLocalStyleSheet());var g=e?e:f,h=g.cssRules;f=null;if(d&&""!==d){e=d.split("@media ")[1];for(var k=$jscomp.makeIterator(h),l=k.next();!l.done;l=k.next())if(l=l.value,!1!==l instanceof CSSMediaRule&&l.cssText.replace(/ /g,"").includes(e.replace(/ /g,""))&&l.cssText.includes(b)){f=l;break}null===f&&(f=g.insertRule(d+" { "+b+" {} }",h.length),f=h.item(f));updateStyleSheet(b,c,null,f)}else{var n= $jscomp.makeIterator(h);for(l=n.next();!l.done;l=n.next())if(l=l.value,l.selectorText===b){f=l;break}!f&&b&&(f=g.insertRule(b+" {}",h.length),f=h.item(f));for(k in c)(h=c[k])&&""===h?f.style.removeProperty(k):"object"===typeof h?updateStyleSheet(""+b+(k.startsWith(":")?"":" ")+k,h,d,e):(h=String(h).split(" !"),f.style.setProperty(k,h[0],h[1]))}} function updateStyleSheetBatch(b,c){function d(h,k){k=void 0===k?"":k;for(var l in h){var n=h[l];n&&updateStyleSheet(l,n,k,f)}}c=void 0===c?"":c;var e=getLocalStyleSheet();e||(getLocalStyleSheet=initStyleSheet("local"),e=getLocalStyleSheet());var f=e;if(""!==c)d(b,c);else for(var g in b)"body"===g?d(b[g]):g.startsWith("@media")?d(b[g],g):g.startsWith("@keyframes")?f.insertRule(g+" "+b[g]):updateStyleSheet(g,b[g])} function handlePropStyle(b,c){if(c){var d=Object.keys(c).includes("body"),e=d?c.body:c;d&&delete c.body;d={};for(var f in c){var g={};d[f]=(g[b]=c[f],g)}c={};updateStyleSheetBatch(Object.assign({},{body:(c[b]=e,c)},d))}}function getHashParams(b){for(var c=window.location.hash,d=/[#&]([^=#]+)=([^&#]*)/g,e,f={};e=d.exec(c);){var g=decodeURIComponent(e[1]);e=decodeURIComponent(e[2]);f[g]=e}return b?f[b]||"":f} function imageUrl2DataUrl(b){return new Promise(function(c,d){try{var e=getImage(b)[0];e.onload=function(){var f=document.createElement("canvas");f.width=e.width;f.height=e.height;f.getContext("2d").drawImage(e,0,0);f=f.toDataURL("image/png",1);c(f)}}catch(f){d(f)}})} function getWebpOriginFormat(b){if(!b||"string"!=typeof b)return"jpg";switch(b.subBetween("_wci_",".")){case "jpeg":return"jpeg";case "png":return"png";case "gif":return"gif";case "svg":return"svg";case "webp":return"webp"}return"jpg"}var fitPageWidthHeight=function(b,c,d,e){d||(d=bookConfig.largePageWidth);e||(e=bookConfig.largePageHeight);var f=Point(0,0);b/c>d/e?(f.x=Math.round(d*c/e),f.y=c):(f.x=b,f.y=Math.round(e*b/d));return f}; function getMetaTagValueByName(b){for(var c=document.getElementsByTagName("meta"),d=0;df)"headline"==c[f].fontType&&(d+=c[f].text,e=f);else if(e===f-1&&"headline"==c[f].fontType)d+=c[f].text,e=f;else break;d||(d=b.title);return d}function copyTextToClipboard(b){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(b).then(function(){}).catch(function(c){fallbackCopyTextToClipboard(b)}):fallbackCopyTextToClipboard(b)} function fallbackCopyTextToClipboard(b){var c=$(""),$("body").append(global.tmpCopyInput)); global.tmpCopyInput.val(b);copyFromObj(global.tmpCopyInput)},getArea:function(b){"panstart"==b.type&&(this.selectStartPoint=this.getRealPoint(b.srcEvent));var c=this.$container.width(),d=this.$container.height();var e=bookType===BookType.documentView_book||bookType===BookType.singleDocumentView_book?BookInfo.getBook().docViewBook.parameters?BookInfo.getBook().docViewBook.parameters.scale:1:bookType===BookType.card_book?BookInfo.getBook().flipBookElement.parameters?BookInfo.getBook().flipBookElement.parameters.scale: 1:BookInfo.getBook().flipBook.parameters?BookInfo.getBook().flipBook.parameters.scale:1;var f=this.selectStartPoint[0]/(c*e),g=this.selectStartPoint[1]/(d*e),h=b.deltaX,k=b.deltaY;bookConfig.upsideOnMobile()&&(h=b.deltaY,k=-b.deltaX);return{left:f,top:g,right:(this.selectStartPoint[0]+h)/(c*e),bottom:(this.selectStartPoint[1]+k)/(d*e)}},getRealPoint:function(b){if((b=b.originalEvent&&b.originalEvent.changedTouches?b.originalEvent.changedTouches:b.changedTouches?b.changedTouches:[b])&&!(3<=b.length)){var c= this.$container.offset().left,d=this.$container.offset().top;var e=bookType===BookType.documentView_book||bookType===BookType.singleDocumentView_book?BookInfo.getBook().docViewBook.parameters?BookInfo.getBook().docViewBook.parameters.scale:1:bookType===BookType.card_book?BookInfo.getBook().flipBookElement.parameters?BookInfo.getBook().flipBookElement.parameters.scale:1:BookInfo.getBook().flipBook.parameters?BookInfo.getBook().flipBook.parameters.scale:1;this.$container.width();e*=this.$container.height(); var f=b[0].pageX;b=b[0].pageY;return bookConfig.upsideOnMobile()?[b-d,e-(f-c)]:[f-c,b-d]}},onResize:function(){}}).extend(PageAttachment),PageWatermark=Class({create:function(b){b=void 0===b?{}:b;this.container=b.container;this.parent=b.parent;this.pageIndex=b.pageIndex;this.width=b.width;this.height=b.height;this.bookType=b.bookType;var c;this.asyncWatermark=null!=(c=b.asyncWatermark)?c:!1;bookConfig.printWatermarkFile&&(this.config={position:bookConfig.watermarkPosition,width:bookConfig.watermarkWidth, height:bookConfig.watermarkHeight,opacity:bookConfig.watermarkOpacity,spacing:bookConfig.watermarkSpacing,rotation:bookConfig.watermarkRotation,watermarkEdgeMargin:bookConfig.watermarkEdgeMargin,watermarkImage:new Image},this.config.watermarkImage.src=bookConfig.printWatermarkFile,this.initWatermark())},initWatermark:function(){this.canvas=$("");this.container&&this.container.append(this.canvas);this.canvas.css({position:"absolute", left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:99});this.watermarkCore=new WatermarkCore(this.canvas[0]);this.asyncWatermark||(this.config.watermarkImage.onload=this.drawWatermark.bind(this),this.config.watermarkImage.complete&&this.drawWatermark())},drawWatermark:function(){bookConfig.watermarkHeight||(this.config.height=bookConfig.watermarkWidth*this.config.watermarkImage.height/this.config.watermarkImage.width);this.watermarkCore.applyWatermark(this.config)},asyncDrawWatermark:function(){var b= this;if(bookConfig.printWatermarkFile)return new Promise(function(c){b.config.watermarkImage.onload=function(){b.drawWatermark();c()};b.config.watermarkImage.complete&&(b.drawWatermark(),c())})},setStyle:function(b){this.canvas&&this.canvas.css(b)},onResize:function(){},enterSide:function(){},leaveSide:function(){},destroy:function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}).extend(PageAttachment),PageAnimation=Class({create:function(b){this.$container= b.$container;this.pageIndex=b.pageIndex;this.page=b.page;this.width=b.width;this.height=b.height;this.$parent=b.$parent;this.bookType=b.bookType;this.callback=b.callback},pauseAnimation:function(){},startAnimation:function(){},enterSide:function(){},leaveSide:function(){},onResize:function(b,c){},resetSlider:function(){},destroySlider:function(){},initReaderOrSlider:function(){},refreshEvent:function(){}}),PageEditorLoad=Class({statics:{isLoading:!1,isCompleted:function(){try{if(window.PageItem&& window.PageItem.HtmlVideo)return!0}catch(b){}}}}),PageHisliderLoad=Class({statics:{isLoading:!1,isCompleted:function(){try{if(window.hiSliderFactory)return!0}catch(b){}}}}),PageEditorAnimation=Class({create:function(b){this.$container=b.$container;this.pageIndex=b.pageIndex;this.page=b.page;this.width=b.width;this.height=b.height;this.$parent=b.$parent;this.bookType=b.bookType;this.callback=b.callback;this.Items=new ObjectPool;this.needLoadResource()?this.loadResource():this.initPageEditor()},needLoadResource:function(){if(PageEditorLoad.isCompleted())return!0; for(var b=this.getPageAnnos()[this.pageIndex-1],c=0;c
"),this.$container.append(this.$readerContainer),this.$container.show(),this.createVueDom())},createVueDom:function(){var b=BookInfo.getCurrentPages();window.setVueDom({lazy:-1===b.indexOf(this.pageIndex),dom:"."+this.getBookPageStr()+"_animatePanel_"+(this.pageIndex-1)+" .reader_"+(this.pageIndex-1),pageStr:this.getBookPageStr(), pageIndex:this.pageIndex-1,width:this.width,height:this.height}).then(function(c){this.slider=c;this.slider.resize(this.width,this.height);c.reset();this.page.unLoading(!0);this.slider.getAutoPlayArray&&(this.sliderPlayerArray=this.slider.getAutoPlayArray());this.callback()}.bind(this))},getBookPageStr:function(){var b="double";1===this.bookType&&(b="single");return b},playSlider:function(){this.clearSliderTimeout();this.slider?(this.playTimeout&&(clearTimeout(this.playTimeout),this.playTimeout=null), this.slider.play()):this.playTimeout=setTimeout(this.playSlider.bind(this),100)},replaySlider:function(){this.clearSliderTimeout();this.slider?(this.playTimeout&&(clearTimeout(this.playTimeout),this.playTimeout=null),this.slider.replay()):this.playTimeout=setTimeout(this.replaySlider.bind(this),100)},destroySlider:function(){this.slider&&(this.slider.destoryed&&this.slider.destoryed(),this.slider=null,this.isAddReader=!1,this.$container.find(".app").remove())},pauseAnimation:function(){this.pauseSlider(); this.slider&&this.slider.startFlip&&this.slider.startFlip()},startAnimation:function(){this.playSlider();this.slider&&this.slider.endFlip&&this.slider.endFlip()},pauseSlider:function(){this.slider&&this.slider.pause()},onResize:function(b,c){this.width=b;this.height=c;this.slider&&this.bookType===BookInfo.getBookType()&&this.slider.resize(b,c)},sliderEnterPage:function(){try{window.vuePopDom&&window.vuePopDom.sliderEnterPage&&window.vuePopDom.sliderEnterPage()}catch(b){}},sliderLeavePage:function(){try{window.vuePopDom&& window.vuePopDom.sliderLeavePage&&window.vuePopDom.sliderLeavePage(),this.slider&&this.slider.sliderLeavePage&&this.slider.sliderLeavePage()}catch(b){}},enterSide:function(){this.slider&&(this.replaySlider(),this.slider&&this.slider.endFlip&&this.slider.endFlip())},leaveSide:function(){this.slider&&(this.slider.startFlip&&this.slider.startFlip(),this.sliderLeavePage())},searchSliderHighLight:function(){this.slider&&global.search_Text&&!Array.isArray(global.search_Text)&&this.slider.searchText(search_Text)}, clearSliderHighLight:function(){this.slider&&this.slider.clearHighLight()},clearSliderTimeout:function(){this.playTimeout&&(clearTimeout(this.playTimeout),this.playTimeout=null)},refreshEvent:function(){this.slider&&this.slider.refreshEvent&&this.slider.refreshEvent()}}).extend(PageAnimation),hddr=[],a=hddr.soo2,i=0,PageAnimationFactory=Class({create:function(b){this.$container=b.$container;this.pageIndex=b.pageIndex;this.page=b.page;this.width=b.width;this.height=b.height;this.$parent=b.$parent; this.bookType=b.bookType;this.callback=b.callback;this.option=b;this.isHiddenEditor()||this.initAnimation()},initAnimation:function(){this.hasReader()?window.setVueDom?this.initReader():this.loadPageReader():this.hasPageEditor()&&(this.pageEditor=new PageEditorAnimation(this.option));this.hasSlider()&&(window.hiSliderFactory?this.initSlider():this.loadPageSlider())},initReader:function(){this.pageReader||BookInfo.getBookType()!=this.bookType||this.pageReader||(this.pageReader=new PageReader(this.option))}, initSlider:function(){this.hasSlider()&&!this.pageHislider&&(this.pageHislider=new PageHislider(this.option))},initReaderOrSlider:function(){this.hasReader()&&(window.setVueDom?this.initReader():this.loadPageReader());this.hasSlider()&&(window.hiSliderFactory?this.initSlider():this.loadPageSlider())},loadPageReader:function(){var b=this;this.loadReaderInterval=window.setInterval(function(){window.setVueDom&&(b.destroyReaderInterval(),b.initReader())},100)},destroyReaderInterval:function(){this.loadReaderInterval&& (window.clearInterval(this.loadReaderInterval),this.loadReaderInterval=null)},loadPageSlider:function(){var b=this;this.loadSliderInterval=window.setInterval(function(){window.hiSliderFactory&&(b.destroySliderInterval(),b.initSlider())},100)},destroySliderInterval:function(){this.loadSliderInterval&&(window.clearInterval(this.loadSliderInterval),this.loadSliderInterval=null)},hasPageEditor:function(){if(this.judgeHasPageEditor()||window.inverseEditor&&window.inverseEditor.length&&window.inverseEditor[this.pageIndex- 1]&&window.inverseEditor[this.pageIndex-1].length)return!0},judgeHasPageEditor:function(){var b=this.pageIndex-1;return window.pageEditor&&(!pageEditor.pageAnnos&&pageEditor[b]&&0=this.pageIndex&&(this.hasReaderItems()||window.inverseEditor&&window.inverseEditor.length&&window.inverseEditor[this.pageIndex-1]&&window.inverseEditor[this.pageIndex-1].length)?!0:!1},hasReaderItems:function(){var b=window.readerConfig.pages[this.pageIndex-1];return b&&0!==Object.values(b).filter(function(c){return Array.isArray(c)&&c.length}).length},hasSlider:function(){return window.sliderJS&&window.sliderJS[this.pageIndex- 1]&&window.sliderJS[this.pageIndex-1].elements&&0"),this.$animation.css({width:this.width+"px",height:this.height+"px"}),this.parent.append(this.$animation))}; PageAttachmentsParser.prototype.hasAnimation=function(){var b=this.pageIndex-1;return this.isHiddenEditor()?!1:global.pageEditor&&(!pageEditor.pageAnnos&&pageEditor[b]&&0"),this.$select.css({width:this.width+"px",height:this.height+"px",bottom:0,right:0,margin:"auto"}),this.pageSelect=this.factory.createAttachment("select",this.$select,this.width,this.height,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageSelect),this.parent.append(this.$select))}; PageAttachmentsParser.prototype.destroySelect=function(){this.Items.find("PageSelect").each(function(b){b.destroySelect()});this.Items.remove(this.pageSelect);this.$select=void 0;this.pageSelect=null}; PageAttachmentsParser.prototype.initMagnifierEvent=function(){this.pageMagnifier||(this.$magnifier=$("
"),this.$magnifier.css({width:this.width+"px",height:this.height+"px",bottom:0,right:0,margin:"auto"}),this.pageMagnifier=this.factory.createAttachment("magnifier",this.$magnifier,this.width,this.height,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageMagnifier), this.parent.append(this.$magnifier))};PageAttachmentsParser.prototype.destroyMagnifier=function(){this.Items.find("PageMagnifier").each(function(b){b.destroyMagnifier()});this.Items.remove(this.pageMagnifier);this.$magnifier=void 0;this.pageMagnifier=null};PageAttachmentsParser.prototype.addHistoryTexts=function(){this.Items.find("PageAnnotation").each(function(b){b.enterSide()})}; PageAttachmentsParser.prototype.highlightSearch=function(){if(bookConfig.SearchButtonVisible&&window.frmSearch&&!this.pageHighlight){var b=!0;window.frmSearch&&frmSearch.visible&&0"),this.$highlight.css({width:this.width+ "px",height:this.height+"px",bottom:0,right:0,margin:"auto"}),this.pageHighlight=this.factory.createAttachment("highlight",this.$highlight,this.width,this.height,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageHighlight),this.parent.append(this.$highlight))}};PageAttachmentsParser.prototype.clearHighlight=function(){this.Items.find("PageHighlight").each(function(b){b.clearHighlight()});this.Items.remove(this.pageHighlight);this.$highlight=void 0;this.pageHighlight=null}; PageAttachmentsParser.prototype.createAnnotation=function(){if(bookConfig.AnnotationButtonVisible&&!this.pageAnnotation){var b=fitPageWidthHeight(this.pageWidth,this.pageHeight,bookConfig.largePageWidth,bookConfig.largePageHeight);this.$annotation=this.parent;this.pageAnnotation=this.factory.createAttachment("annotation",this.$annotation,b.x,b.y,this.pageIndex,this.parent,this.bookType);this.Items.add(this.pageAnnotation);this.onResizeAnimation(this.width,this.height,this.pageWidth,this.pageHeight)}}; PageAttachmentsParser.prototype.createWatermark=function(){bookConfig.showWatermark&&!this.pageWatermark&&(this.pageWatermark=this.factory.createAttachment("watermark",this.parent,this.width,this.height,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageWatermark))};PageAttachmentsParser.prototype.enterSide=function(){this.Items.each(function(b){b.enterSide()})}; PageAttachmentsParser.prototype.leaveSide=function(){this.Items.each(function(b){b.leaveSide()});this.destroySelect();global.annotationPannel&&global.annotationPannel.resetAnnoConfig()};PageAttachmentsParser.prototype.pauseAnimation=function(){this.Items.find("PageAnimation").each(function(b){b.pauseAnimation()})};PageAttachmentsParser.prototype.startAnimation=function(){this.Items.find("PageAnimation").each(function(b){b.startAnimation()})};PageAttachmentsParser.prototype.resetSlider=function(){this.Items.find("PageAnimation").each(function(b){b.resetSlider()})}; PageAttachmentsParser.prototype.destroySlider=function(){this.Items.find("PageAnimation").each(function(b){b.destroySlider()})};PageAttachmentsParser.prototype.initReaderOrSlider=function(){this.Items.each(function(b){b.initReaderOrSlider&&b.initReaderOrSlider()})};PageAttachmentsParser.prototype.removeAttachment=function(){this.attachment&&this.destroyMM()}; PageAttachmentsParser.prototype.onResize=function(b,c,d,e){this.width=b;this.height=c;this.pageWidth=d;this.pageHeight=e;this.onResizeAnimation(b,c,d,e);this.onResizeAnnotation(b,c,d,e);this.$select&&this.$select.css({width:this.width+"px",height:this.height+"px"});this.$magnifier&&this.$magnifier.css({width:this.width+"px",height:this.height+"px"});this.$highlight&&this.$highlight.css({width:this.width+"px",height:this.height+"px"});this.Items.each(function(f){if(f!=this.pageAnimation&&f!=this.pageAnnotation)f.onResize(b, c)}.bind(this))};PageAttachmentsParser.prototype.onResizeAnimation=function(b,c,d,e){if(this.pageAnimation){b=fitPageWidthHeight(d,e,bookConfig.largePageWidth,bookConfig.largePageHeight);c=bookConfig.largePageWidth/bookConfig.largePageHeight;var f=d/e;.01>c-f&&-.01");this.$page.attr("id",c+"Mask"+b);this.setMaskCss();this.$page.append(this.page.side)},setMaskCss:function(){if(bookConfig.FlipDirection){var b="vertical-mask";this.isSingleBook&&rightToLeft&&(b="single-book-right-vertical-mask");this.isSingleBook&&!rightToLeft&&(b="single-book-vertical-mask")}else b="mask", this.isSingleBook&&rightToLeft&&(b="single-book-right-mask"),this.isSingleBook&&!rightToLeft&&(b="single-book-mask");this.setCSSByName(b)},onResize:function(b,c,d){this.pageWidth=b;this.pageHeight=c;d||(d=1);var e=parseInt(Math.sqrt(Math.pow(b,2)+Math.pow(c,2)));0!=(e-c)%2&&(e+=1);this.width=e;this.$page.css({width:e,height:e,opacity:d});if(this.page)this.page.onResize(b,c);bookConfig.FlipDirection?(this.$page.css({left:"50%","margin-left":-this.width/2+"px"}),this.page&&this.page.side.css({left:(this.width- b)/2})):(this.$page.css({top:"50%","margin-top":-this.width/2+"px"}),this.page&&this.page.side.css({top:(this.width-c)/2}))},setLeftOrRight:function(b){var c=this.isSingleBook?"left-single-mask-side":"left-mask-side";b||(c=this.isSingleBook?"right-single-mask-side":"right-mask-side");this.setCSSByName(c);this.page&&this.page.setLeftOrRight(b)},setUpOrDown:function(b){var c=this.isSingleBook?"up-single-mask-side":"up-mask-side";b||(c=this.isSingleBook?"down-single-mask-side":"down-mask-side");this.setCSSByName(c); this.page&&this.page.setUpOrDown(b)},beginToFlip:function(){this.setMaskCss()}}).extend(PageInterface);bdor[39]=function(){return 8}();var bookMouseDown=!1,nBookStatu=0;global.bdor[200]=function(b){return bdor[b]}; var Book=Class({bookType:void 0,parent:null,width:0,height:0,flippingTime:600,currentPageIndex:1,rightToLeft:!1,pageArray:null,pageWidth:0,pageHeight:0,visible:!1,create:function(b){this.init(b)},init:function(b){this.options=b;this.parent=b.parent;this.currentPageIndex=b.currentPageIndex;this.flippingTime=1E3*b.flippingTime;this.rightToLeft=b.rightToLeft;this.pageArray=[]},getBookType:function(){return this.bookType},onBookPageLoaded:function(b){if(!this.flipping&&this.visible&&BookInfo.getBook()== this){var c=this.getCurrentPages();if(c)for(var d=0;d");this.noteAdd.bind("mousedown mouseup pointerdown",function(c){c.stopPropagation()}.bind(this));this.noteAdd.bind(_event._down,function(){this.noteAdd.css({opacity:"0.7"})}.bind(this));this.noteAdd.bind(_event._up,function(c){c.stopPropagation();this.noteAdd.css({opacity:""});global.annotationPannel&&global.annotationPannel.noteEvent(this.noteAdd)}.bind(this)); b.append(this.noteAdd)},show:function(){this.noteAdd.css({display:"block"})},hide:function(){this.noteAdd.css({display:"none"})},getPageWidth:function(){var b=BookInfo.getBook().currentPageIndex,c="";if(BookInfo.getBook().pageArray.length&&BookInfo.getBook().pageArray[b])return"slide"==bookConfig.FlipStyle.toLocaleLowerCase()&&BookInfo.isDoublePage(BookInfo.getBookType())?(BookInfo.getBook().pageArray[b].leftPage?c=BookInfo.getBook().pageArray[b].leftPage:BookInfo.getBook().pageArray[b].rightPage&& (c=BookInfo.getBook().pageArray[b].rightPage),rightToLeft&&BookInfo.getBook().pageArray[b].rightPage&&(c=BookInfo.getBook().pageArray[b].rightPage)):c=BookInfo.getBook().pageArray[b].page,{width:c.pageWidth,height:c.pageHeight}},isFirstOrLastPage:function(){return this.isFirstPage()||this.isLastPage()?!0:!1},isCurrentDoublePage:function(){return 1e/2&&24>d/2?this.noteAdd.css({display:"none"}):24<=e/2?rightToLeft?(this.noteAdd.css({display:"block",top:"0",right:"auto",left:"-22px"}),this.isLastPage()&&1d.x||d.x>c.width||0>d.y||d.y>c.height)){d=c.mouseInBook.x+15;var e=c.mouseInBook.y;c.zoomHint=new divHint(getLanguage("lblDoubleClickToZoomIn","Double click to zoom in."),d,e,b);c.zoomHint.show();c.hideCount=0}}else c.oldMouseInBook.x=c.mouseInBook.x,c.oldMouseInBook.y=c.mouseInBook.y;else 2==++c.hideCount&& (bookContainer.unbind(_event._move,c.trackMousePoint),c.zoomHint.destroy(),c.zoomHint=null,window.clearInterval(c.zoomHintTimer))},1500)},globalToBook:function(b,c,d){switch(bookType){case BookType.single_book:var e=Point(c-singlePageBook.getLeft(),d-singlePageBook.getTop());break;case BookType.normal_book:e=Point(c-((b?0:flipBook.getPageWidth())+flipBook.getLeft()),d-flipBook.getTop());break;case BookType.catalog_book:e=catalogBook.getTran(),b=c-((b?0:catalogBook.getPageWidth())+catalogBook.getCssLeft())- e.x,d=d-catalogBook.getCssTop()-e.y,e=Point(b,d)}return e},clearZoomHintTimer:function(){try{window.clearInterval(this.zoomHintTimer)}catch(b){}null!=this.zoomHint&&(bookContainer.unbind(_event._move,this.trackMousePoint),this.zoomHint.destroy(),this.zoomHint=null)}}),TipsBox=Class({create:function(b,c){this.visible=!1;this.option=b;this.duration=b.duration?b.duration:1500;this.background=$("
");$(c).append(this.background)},setTimer:function(){this.timer= window.setInterval(function(){this.hideTipsBox();window.clearInterval(this.timer)}.bind(this),this.duration)},resetTimer:function(){window.clearInterval(this.timer);this.setTimer()},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")},onResize:function(b,c){},getWidth:function(){return $(this.background).width()},getHeight:function(){return $(this.background).height()},setCaption:function(b){this.background.html(b)},showTipsBox:function(){this.visible? this.resetTimer():(this.setTimer(),this.visible=!0,$(this.background).show(),$(this.background).animate({opacity:this.option.opacity?this.option.opacity:.5},300))},hideTipsBox:function(){this.visible&&(this.visible=!1,$(this.background).animate({opacity:0},300,function(){$(this.background).hide()}.bind(this)))}}),BookMiniFullscreen=Class({create:function(){},init:function(){if(!isIE()){if(isPhone()||isPad()){if(!bookConfig.isShowMobileBottomFullscreenPrompts)return}else if(MiniStyle.isMini()||bookConfig.hideMiniFullscreen)return; fullScreenApi.supportsFullScreen&&fullScreenApi.isFullScreen()||this.miniFullScreen||(this.miniFullScreen=$("
"),this.miniFullScreen.html(getLanguage("lblFullscreen","Click to view in fullscreen.")),this.onResize(),bookContainer.append(this.miniFullScreen),this.miniFullscreenEnter=!1,bookConfig.alwaysShowBottomFullscreenPrompt||(this.miniFullscreenTimeout&&window.clearTimeout(this.miniFullscreenTimeout),this.miniFullscreenTimeout=window.setTimeout(function(){this.removeMiniFullScreen()}.bind(this), 1E3*bookConfig.bottomFullscreenPromptDisplayDuration)),this.initMiniFullScreenEvent())}},initMiniFullScreenEvent:function(){this.miniFullScreen.bind(_event._end,function(){bookType==BookType.catalog_book&&global.catalogBook&&catalogBook.guidBar&&catalogBook.guidBar.fullscreenBtn?catalogBook.guidBar.fullscreenBtn.trigger(_event._end):readAsFullscreen();this.miniFullScreen.remove();this.miniFullScreen=void 0}.bind(this));this.miniFullScreen.bind(_event._enter,function(){this.miniFullscreenEnter=!0}.bind(this)); this.miniFullScreen.bind(_event._leave,function(){this.miniFullscreenEnter=!1;bookConfig.alwaysShowBottomFullscreenPrompt||(this.miniFullscreenTimeout&&window.clearTimeout(this.miniFullscreenTimeout),this.miniFullscreenTimeout=window.setTimeout(function(){this.removeMiniFullScreen()}.bind(this),1E3*bookConfig.bottomFullscreenPromptDisplayDuration))}.bind(this))},removeMiniFullScreen:function(){if(this.miniFullScreen&&!this.miniFullscreenEnter){var b={alpha:.7};$(b).animate({alpha:0},{duration:300, easing:"easeOutSine",step:function(){this.miniFullScreen&&this.miniFullScreen.css({opacity:b.alpha})}.bind(this),complete:function(){this.miniFullScreen&&this.miniFullScreen.remove();this.miniFullScreen&&(this.miniFullScreen=void 0)}.bind(this)})}},onResize:function(){if(this.miniFullScreen)if(!MiniStyle.isMini()||isPhone()||isPad()){var b=BookInfo.top();this.miniFullScreen.css({top:b+BookInfo.height()-80+"px"})}else this.miniFullScreen.remove(),this.miniFullScreen=void 0},show:function(){this.miniFullScreen&& this.miniFullScreen.show()},hide:function(){this.miniFullScreen&&this.miniFullScreen.hide()},remove:function(){this.miniFullScreen&&this.miniFullScreen.remove();this.miniFullScreen=void 0},setStyle:function(b){b&&this.miniFullScreen&&this.miniFullScreen.css(b)}}),BookPageNumberForFlip=Class({create:function(){},init:function(){if(bookConfig.updatePageNumberForFlip){var b=-1==BookInfo.getCurrentPageIndex()?1:BookInfo.getCurrentPageIndex();this.miniFullScreen?this.miniFullScreen.html(getShownPageNumberInfo(b)): (this.miniFullScreen=$("
"),this.miniFullScreen.html(getShownPageNumberInfo(b)),this.onResize(),bookContainer.append(this.miniFullScreen),this.miniFullscreenEnter=!1,this.miniFullscreenTimeout&&window.clearTimeout(this.miniFullscreenTimeout),this.miniFullscreenTimeout=window.setTimeout(function(){this.removeMiniFullScreen()}.bind(this),3E3),this.initMiniFullScreenEvent())}},initMiniFullScreenEvent:function(){},removeMiniFullScreen:function(){if(this.miniFullScreen&& !this.miniFullscreenEnter){var b={alpha:.5};$(b).animate({alpha:0},{duration:300,easing:"easeOutSine",step:function(){this.miniFullScreen&&this.miniFullScreen.css({opacity:b.alpha})}.bind(this),complete:function(){this.miniFullScreen&&this.miniFullScreen.remove();this.miniFullScreen&&(this.miniFullScreen=void 0)}.bind(this)})}},onResize:function(){if(this.miniFullScreen)if(MiniStyle.isMini())this.miniFullScreen.remove(),this.miniFullScreen=void 0;else{var b=BookInfo.top();this.miniFullScreen.css({top:b+ BookInfo.height()-40+"px"})}},show:function(){this.miniFullScreen&&this.miniFullScreen.show()},hide:function(){this.miniFullScreen&&this.miniFullScreen.hide()},remove:function(){this.miniFullScreen&&this.miniFullScreen.remove();this.miniFullScreen=void 0},setStyle:function(b){b&&this.miniFullScreen&&this.miniFullScreen.css(b)}}),BookAttachmentsFactory=Class({create:function(b,c,d,e){this.isDoublePage=e;this.container=b;this.book=d;this.pageIndex=c},createAttachment:function(b,c){switch(b){case "thickness":var d= c?new ThicknessManager(this.container,this.book):new SingleBookThicknessManager(this.container,this.book);d.refreshThickness();break;case "bookshadow":d=new BookShadow(this.container);break;case "zoomhint":d=new ZoomHint(this.parent);break;case "minifullscreen":d=new BookMiniFullscreen;0<=BookInfo.getCurrentPages().indexOf(1)&&d.init();break;case "bookpagenumber":d=new BookPageNumberForFlip;break;case "staticad":d=new StaticAd(this.container);break;case "zoommap":d=new ZoomMap(this.book);d.fillContent(this.pageIndex); break;case "bookmarktab":d=new BookmarkTab(this.container,!this.isDoublePage);break;case "noteadd":d=new NoteAdd(this.container)}return d}}),BookAttachmentsBuilder=Class({Package:"BookAttachment",create:function(b,c,d,e){this.parent=b;this.pageIndex=c;this.book=d;this.isDoublePage=e;this.Items=this.createAttachmentsForBook()},createAttachmentsForBook:function(){var b=new ObjectPool;this.factory=new BookAttachmentsFactory(this.parent,this.pageIndex,this.book,this.isDoublePage);return b},thickness:function(b){this.bookThickness= this.factory.createAttachment("thickness",b);this.Items.add(this.bookThickness)},bookshadow:function(){this.bookShadow=this.factory.createAttachment("bookshadow");this.Items.add(this.bookShadow)},grayshadow:function(){_agent_.browser.msie||_agent_.browser.safari||!bookConfig.ShowTopLeftShadow||this.book.bookType!=BookType.normal_book||(this.grayshadow=this.factory.createAttachment("grayshadow"),this.Items.add(this.grayshadow))},miniFullscreen:function(){this.miniFullscreen=this.factory.createAttachment("minifullscreen"); this.Items.add(this.miniFullscreen)},bookpagenumber:function(){this.bookPageNumber=this.factory.createAttachment("bookpagenumber");this.bookPageNumber.init();this.Items.add(this.bookPageNumber)},staticad:function(){void 0!=global.staticAd&&1==staticAd.haveAd&&(this.staticAd=this.factory.createAttachment("staticad"),this.Items.add(this.staticAd))},zoommap:function(){isPad()||isPhone()||!bookConfig.ZoomMapVisible||(this.zoomMap=this.factory.createAttachment("zoommap"),this.Items.add(this.zoomMap))}, bookmarktab:function(){(function(){isPhone()||isPad()||(this.bookMarkTab=this.factory.createAttachment("bookmarktab"),this.Items.add(this.bookMarkTab))}).delay(this,1)},noteadd:function(){!bookConfig.AnnotationButtonVisible||isPhone()||isPad()||(this.noteAdd=this.factory.createAttachment("noteadd"),this.Items.add(this.noteAdd))},zoomhint:function(){isTouchDevice()},hide:function(){this.Items.find("StaticAd").each(function(b){b.hide()});this.Items.find("ZoomMap").each(function(b){b.hide()});this.Items.find("BookMiniFullscreen").each(function(b){b.hide()}); this.Items.find("BookPageNumberForFlip").each(function(b){b.hide()})},show:function(){this.Items.find("BookMiniFullscreen").each(function(b){b.show()});this.Items.find("BookPageNumberForFlip").each(function(b){b.show()});this.Items.find("BookmarkTab").each(function(b){b.refresh()});this.Items.find("StaticAd").each(function(b){b.show()});this.book.flipping||1!=this.book.currentPageIndex||bookConfig.isTheBookOpen||this.Items.find("StaticAd").each(function(b){b.setStyle({"z-index":3})}.bind(this))}, onResize:function(b,c){this.width=b;this.height=c;if(this.book.getCssLeft)var d=this.book.getCssLeft();if(this.book.getCssTop)var e=this.book.getCssTop();this.Items.find("StaticAd").each(function(f){rightToLeft&&(d+=b);f.setStyle({width:b+"px"});0===staticAd.adPosition&&f.setStyle({left:d,top:e,height:c+"px"})});this.Items.each(function(f){f.onResize(b,c)}.bind(this));this.Items.find("ZoomMap").each(function(f){f.refreshArea()}.bind(this))},afterCurling:function(){this.isDoublePage&&this.Items.find("BookmarkTab").each(function(b){b.adjustBar()}); this.Items.find("ThicknessManager").each(function(b){b.refreshThickness()});this.book.flipping||1!=this.book.currentPageIndex||bookConfig.isTheBookOpen||this.Items.find("StaticAd").each(function(b){b.setStyle({"z-index":3})}.bind(this))},setAttachmentBeforeFlipTo:function(b){this.Items.find("ThicknessManager").each(function(c){c.setAttachmentBefore(b)});this.Items.find("StaticAd").each(function(c){0===staticAd.adPosition&&c.setStyle({"z-index":1})}.bind(this));this.isDoublePage&&this.Items.find("BookmarkTab").each(function(c){c.setAttachmentBefore(b)}.bind(this))}, setAttachmentAfterFlipTo:function(b){this.Items.find("ThicknessManager").each(function(c){c.refreshThickness()});this.Items.find("BookmarkTab").each(function(c){c.refresh()}.bind(this));this.Items.find("ZoomMap").each(function(c){c.fillContent(b);c.refreshArea()}.bind(this));this.book.flipping||1!=this.book.currentPageIndex||bookConfig.isTheBookOpen||this.Items.find("StaticAd").each(function(c){c.setStyle({"z-index":3})}.bind(this))},afterZoomIn:function(b,c){isPhone()||isPad()||this.Items.find("ThicknessManager").each(function(d){d.onResize(b, c)}.bind(this));this.Items.find("BookmarkTab").each(function(d){d.onResize()}.bind(this));this.Items.find("ZoomMap").each(function(d){d.refreshArea()}.bind(this));this.Items.find("noteadd").length&&this.Items.find("noteadd").get(0).hide()},getItemByName:function(b){var c;return null==(c=this.Items.find(b))?void 0:c.get(0)}}),FlipPage=Class({downMask:null,upMask:null,currentIndex:0,nextIndex:0,hardPage:!1,coverPage:!1,coordinate:null,startPoint:null,toPoint:null,fromPoint:null,AliceToLeft:!1,AliceToRight:!1, loosen:!0,flipping:!1,dragMoveToFlip:!1,fallback:!1,pageWidth:0,pageHeight:0,maskWidth:0,create:function(b){this.book=b},startToFlip:function(){this.loosen=this.flipping=!0;this.fallback=this.AliceToRight=this.AliceToLeft=!1},meetFlipCondition:function(){var b=this.toPoint&&this.startPoint&&(this.book.mouseMoveDirection==this.book.moveDirectionType.MOVE_LEFT&&0this.startPoint.x);return this.toPoint&&this.startPoint&& (this.toPoint.xthis.book.MiddleX&&0>this.startPoint.x)||b},flipToPoint:function(b,c,d){if(b&&c)if(1==this.hardPage)this.flipToHardPoint(b,c);else if(this.downMask&&this.upMask&&this.downMask.page&&this.upMask.page){this.coordinate=c;var e=this.pageWidth,f=computePoint(e,this.pageHeight,this.maskWidth,b,c);if(f){var g=transformCSS({rotate:f.rotate,tran:{x:f.maskTranX,y:f.maskTranY}}),h=transformCSS({rotate:f.rotate,tran:{x:f.maskTranX,y:f.maskTranY}}), k=transformCSS({rotate:-f.rotate,tran:{x:-f.pageTranX,y:0}}),l=transformCSS({rotate:f.rotate,tran:{x:f.pageTranX,y:0}});this.downMask&&this.downMask.setCSSByStyle(g);this.upMask&&this.upMask.setCSSByStyle(h);this.downMask&&this.downMask.page&&this.downMask.page.setCSSByStyle(k);this.upMask&&this.upMask.page&&this.upMask.page.setCSSByStyle(l);this.setFlipAlpha(e,b,c);this.setFlipShadow(f,d);this.book.followToPoint(this,b,c)}}},flipToHardPoint:function(b,c){if(b&&c){var d=this.pageWidth,e=this.pageHeight, f=this.maskWidth;c.x>d&&(c.x=d);c.x<-d&&(c.x=-d);this.coordinate=c;if(e=computePoint(d,e,f,b,c)){f=-90+90*Math.abs(c.x/b.x);0>c.x&&(f=90-90*Math.abs(c.x/b.x));var g=transformCSS({perspective:6E3,rotateY:f}),h=transformCSS({perspective:6E3,rotateY:f});e.rotate=f;this.downMask&&this.downMask.setCSSByStyle(g);this.upMask&&this.upMask.setCSSByStyle(h);0>c.x/b.x?this.setPagesVisible(!1):this.setPagesVisible(!0);this.setHardFlipShadow(e);this.setFlipAlpha(d,b,c);this.book.followToPoint(this,b,c)}}},setPagesVisible:function(b){}, setHardFlipShadow:function(b){b&&(this.upMask&&this.upMask.setFlipShadow(b,!0),this.downMask&&this.downMask.setFlipShadow(b,!1))},setFlipAlpha:function(b,c,d){},setFlipShadow:function(b,c){b&&(this.upMask.page&&this.upMask.page.setFlipShadow(b,!0,c),this.nextPage&&!this.isMiniPage()&&this.nextPage.setFlipShadow(b,!1,c))},isMiniPage:function(){return 1c.x&&(f=90-90*Math.abs(c.x/b.x));var g=transformCSS({perspective:6E3,rotateY:f});f=transformCSS({perspective:6E3,rotateY:f});this.downMask&&this.downMask.setCSSByStyle(g); this.upMask&&this.upMask.setCSSByStyle(f);0>c.x/b.x?(this.upMask.setVisible(!1),this.downMask.setVisible(!1)):(this.upMask.setVisible(!1),this.downMask.setVisible(!0));this.setHardFlipShadow(e);this.setFlipAlpha(d,b,c);this.book.followToPoint(this,b,c)}}},setHardFlipShadow:function(b){b&&(this.upMask&&this.upMask.setFlipShadow(b,!0),this.downMask&&this.downMask.setFlipShadow(b,!1))},setPageZIndex:function(){var b=this.downMask.pageIndex,c=this.upMask.pageIndex,d=originTotalPageCount+5+c,e=originTotalPageCount+ 5-b;if(bookConfig.HardPageEnable){if(c==totalPageCount||1==c)d=2*(bookConfig.totalPageCount+5)+10;if(b==totalPageCount||1==b)e=2*(bookConfig.totalPageCount+5)+10}this.upMask.setZIndex(d);this.downMask.setZIndex(e)},setFlipAlpha:function(b,c,d){},setFlipOriginPoint:function(){this.dragMoveToFlip||rightToLeft||(this.fromPoint={x:this.pageWidth,y:this.pageHeight});!this.dragMoveToFlip&&rightToLeft&&(this.fromPoint={x:-this.pageWidth,y:this.pageHeight});this.toPoint="left"==this.book.flipToDirection? {x:-this.pageWidth,y:this.fromPoint.y}:{x:this.pageWidth,y:this.fromPoint.y};this.startPoint||(this.startPoint={x:0,y:0});this.startPoint.x=-this.toPoint.x;this.startPoint.y=this.toPoint.y},endFlipByIndex:function(b){b=transformCSS({rotate:0,tran:{x:0,y:0}});this.upMask.setCSSByStyle(b);this.upMask.page&&this.upMask.page.setCSSByStyle(b);this.downMask.setCSSByStyle(b);this.downMask.page&&this.downMask.page.setCSSByStyle(b);this.upMask.setLeftOrRight(rightToLeft);this.downMask.setLeftOrRight(rightToLeft); this.book.setZIndexByPageIndex(this.upMask);this.book.setZIndexByPageIndex(this.downMask);this.upMask.clearFlipShadow();this.downMask.clearFlipShadow()}}).extend(FlipPage),DoubleFlipPage=Class({setPagesVisible:function(b){b?(this.upMask.setVisible(!1),this.downMask.setVisible(!0)):(this.upMask.setVisible(!0),this.downMask.setVisible(!1))},setPageZIndex:function(b){var c=this.downMask.pageIndex,d=this.upMask.pageIndex,e=originTotalPageCount+5+d,f=originTotalPageCount+5-c;"min"==b.flipTo&&(e=2*originTotalPageCount+ 5-d);"min"==b.flipTo&&(f=5+c);if(bookConfig.HardPageEnable){if(d==totalPageCount||1==d)e=2*(bookConfig.totalPageCount+5)+10;if(c==totalPageCount||1==c)f=2*(bookConfig.totalPageCount+5)+10}this.upMask.setZIndex(e);this.downMask.setZIndex(f)},setFlipOriginPoint:function(b){this.dragMoveToFlip||"left"!=b||(this.fromPoint={x:this.pageWidth,y:this.pageHeight});this.dragMoveToFlip||"right"!=b||(this.fromPoint={x:-this.pageWidth,y:this.pageHeight});this.toPoint={x:-this.fromPoint.x,y:this.fromPoint.y};this.startPoint|| (this.startPoint={x:0,y:0});this.startPoint.x=this.fromPoint.x;this.startPoint.y=this.fromPoint.y},endFlipByIndex:function(b){var c=transformCSS({rotate:0,tran:{x:0,y:0}});this.upMask.setCSSByStyle(c);this.upMask.page&&this.upMask.page.setCSSByStyle(c);this.downMask.setCSSByStyle(c);this.downMask.page&&this.downMask.page.setCSSByStyle(c);b?(this.downMask.setLeftOrRight(!0),this.upMask.setLeftOrRight(!0)):(this.downMask.setLeftOrRight(!1),this.upMask.setLeftOrRight(!1));this.book.setZIndexByPageIndex(this.upMask); this.book.setZIndexByPageIndex(this.downMask);this.upMask.clearFlipShadow();this.downMask.clearFlipShadow()}}).extend(FlipPage),FlipPageManager=Class({create:function(b){this.book=b;this.array=[];this.pinDownCurlingArray=[];this.fallbackArray=[];this.flipArray=[];this.zoomArray=[];this.resizeArray=[];this.hardFlipArray=[];this.softFlipArray=[];this.coverFlipArray=[]},initFlipPageByIndex:function(b,c,d){if(this.book.isCoverPage(b,c))return this.initCoverFlipByIndex(b,c,d);if(this.book.isHardPage(b, c))return this.initHardFlipByIndex(b,c,d);d=this.book.getDownUpPage(b,c,d);var e=b+"-"+c;this[e]||(this[e]=this.book.newFlipPage());this[e].downMask=d[0];this[e].upMask=d[1];this[e].currentIndex=b;this[e].nextIndex=c;this[e].hardPage=!1;this[e].resetWidthHeight();0>this.array.indexOf(e)&&this.array.push(e);0>this.softFlipArray.indexOf(e)&&this.softFlipArray.push(e);return this[e]},initHardFlipByIndex:function(b,c,d){d=this.book.getDownUpHardPage(b,c,d);var e=b+"-"+c;this[e]||(this[e]=this.book.newFlipPage()); this[e].downMask=d[0];this[e].upMask=d[1];this[e].currentIndex=b;this[e].nextIndex=c;this[e].hardPage=!0;this[e].resetWidthHeight();0>this.array.indexOf(e)&&this.array.push(e);0>this.hardFlipArray.indexOf(e)&&this.hardFlipArray.push(e);return this[e]},initCoverFlipByIndex:function(b,c,d){d=this.book.getDownUpHardPage(b,c,d);var e=b+"-"+c;this[e]||(this[e]=this.book.newFlipPage());this[e].downMask=d[0];this[e].upMask=d[1];this[e].currentIndex=b;this[e].nextIndex=c;this[e].hardPage=!0;this[e].coverPage= !0;this[e].resetWidthHeight();0>this.array.indexOf(e)&&this.array.push(e);0>this.coverFlipArray.indexOf(e)&&this.coverFlipArray.push(e);return this[e]},checkFlipping:function(){for(var b=this.array.length,c=0;cthis.book.currentPageIndex&&(c=!0);rightToLeft&&b=this.pinDownCurlingArray.length)return!1;c=this.book.getPagesByIndex(c);for(var d=this.pinDownCurlingArray.length,e=0;ec.indexOf(f.nextIndex))return!0}return!1},existMutexPages:function(b){return this.hardFlipArray&&0=b||b>originTotalPageCount?!0:!1},beforeFlip:function(b,c){try{var d=this.book.beforeFlipTo(b,!0);this.isDragMoveToFlip(d);if(!d.dragMoveToFlip){var e=this.book.getFromStartPointByIndex(b,d); d.flipToPoint(e[0],e[1],!0)}var f=d.currentIndex+"-"+d.nextIndex;this.book.optionPage==f&&(this.book.optionPage=null);0this.flipArray.indexOf(f)&&this.flipArray.push(f);this.fallbackArray.removeElement(f);this.pinDownCurlingArray.removeElement(f);d.startToFlip();this.book.flipping=!0;return d}catch(g){}},isDragMoveToFlip:function(b){b.dragMoveToFlip=!1;b.coordinate&&b.startPoint&&b.coordinate.x!=b.startPoint.x&&(b.dragMoveToFlip=!0)}}), FlipBookIntervalManager=Class({create:function(b){this.book=b;this.flippingTime=1E3*bookConfig.flippingTime},flipIntervalTmp:function(b,c,d,e){if(b){this.book.flipping=!0;b.flipping=!0;var f=.05;if(isIE()||isFirefox())f=0;b.setFlipOriginPoint(e);b.coordinate||(b.coordinate=b.startPoint);var g=b.coordinate.x,h=b.coordinate.y,k,l=this.flippingTime;l=l*Math.abs(b.toPoint.x-g)/Math.abs(b.toPoint.x-b.startPoint.x);e=isAndroidWeChat()||isAndroidDefault()||isIE()||isFirefox()?function(){var p=0;k=function(){n(p, 25,"Sine");p++}.interval(this,l/25)}.bind(this):function(){k=function(p,q){n(p,q,"Sine")}.animation(this,l)}.bind(this);var n=function(p,q,B){if(!b)return!1;var v=b.pageWidth,u=b.pageHeight,w=$.easing["easeInOut"+B],x=$.easing["easeOut"+B];B=x(null,p,g,b.toPoint.x-g,q);x=x(null,p,h,b.toPoint.y-h,q);b.dragMoveToFlip||(B=w(null,p,g,b.toPoint.x-g,q),x=bookConfig.FlipDirection?f*Math.sqrt(u*u-B*B):u-f*Math.sqrt(v*v-B*B));pMath.abs(f.toFixed(2)-this.flipPageManager[c].toPoint.x)&&1>Math.abs(d.toFixed(2)-this.flipPageManager[c].toPoint.y)||isNaN(f)||isNaN(d))&&(this.flipPageManager[c].Alice=!1,f=this.flipPageManager[c].toPoint.x, d=this.flipPageManager[c].toPoint.y,this.flipIntervalManager.flipToPoint(this.flipPageManager[c],e,g,this.flipPageManager[c].fromPoint,{x:f,y:d}),this.flipPageManager[c].endFlipByIndex(0>this.flipPageManager[c].toPoint.x),this.flipPageManager.removeFlipArrayByIndex(this.flipPageManager[c]),this.afterCurling(),b--)}}}else this.flipIntervalManager.flipInterval.stop=!0,this.flipIntervalManager.flipInterval=void 0;this.flipIntervalManager.flipInterval&&(isAndroidWeChat()||isAndroidDefault()||isIE()|| isFirefox()?window.setTimeout(this.flipIntervalManager.flipInterval,30):window.requestAnimationFrame(this.flipIntervalManager.flipInterval))}}.bind(this.book);this.flipInterval()},flipToPoint:function(b,c,d,e,f,g){b&&b.flipToPoint(e,f,g);c=Math.abs(f.x-e.x)*this.book.pageWidth/b.pageWidth;(!this.book.movedLength||Math.abs(this.book.movedLength)>c||!b.loosen||b.flipping)&&this.book.movetoCenter(b.currentIndex,b.nextIndex,c)},endFlip:function(){},destroy:function(){}}),computePoint=function(b,c,d,e, f){if(!e||!f)return{rotate:0,pageTranX:0,maskTranX:0,maskTranY:0};f.x>b&&(f.x=b);f.x<-b&&(f.x=-b);isAndroidDefault()&&(e.y=f.y);if(e.x==f.x){var g=0;0>e.x&&(g+=180);return{rotate:g,pageTranX:0,maskTranX:e.x,maskTranY:0}}g=Math.sqrt(Math.pow(e.y-c,2)+Math.pow(e.x-0,2));if(Math.sqrt(Math.pow(f.y-c,2)+Math.pow(f.x-0,2))>g){var h=Math.atan((f.y-c)/(f.x-0)),k=Math.abs(Math.cos(h)*g);f.y=c-Math.abs(Math.sin(h)*g);f.x=0g&&(h=Math.atan((f.y-0)/(f.x-0)),k=Math.abs(Math.cos(h)*g),f.y=Math.abs(Math.sin(h)*g),f.x=0e.x&&(g+=180,h=-b/2);f=Math.sqrt(Math.pow(e.y-f.y,2)+Math.pow(e.x-f.x,2))/2;f=0<=g&&180>g?Math.abs((c-Math.abs(e.y))*Math.sin(n))+f:Math.abs(e.y*Math.sin(n))+f;d=Math.abs(f/(Math.sin(Math.atan(b/c)+Math.abs(n))*d));d=Math.min(1,d);e=((p-h)*l+k+Math.pow(l,2)*q)/(1+Math.pow(l,2)); l=l*(q-e)+p;k=Math.sqrt(Math.pow(h-l,2)+Math.pow(k-e,2));Math.abs(l)");this.parent.append(this.flipBook);this.initAttachments()},initAttachments:function(){this.showPage=this.flipBook;this.bookAttachments=new BookAttachmentsBuilder(this.flipBook,this.currentPageIndex,this,this.options.isDoublePage);this.options.thickness&&this.bookAttachments.thickness(!0); this.options.bookshadow&&this.bookAttachments.bookshadow();this.options.grayshadow&&this.bookAttachments.grayshadow();this.options.miniFullscreen&&this.bookAttachments.miniFullscreen();this.options.bookpagenumber&&this.bookAttachments.bookpagenumber();this.options.staticad&&this.bookAttachments.staticad();this.options.zoommap&&this.bookAttachments.zoommap();this.options.bookmarktab&&this.bookAttachments.bookmarktab();this.options.noteadd&&this.bookAttachments.noteadd();this.resetBookShadow(this.currentPageIndex)}, resetPages:function(){},getBook:function(){return this.flipBook},addPageArray:function(b){if(b&&this.pageArray)for(var c=0;c=b[c]||b[c]>originTotalPageCount||(this.pageArray[b[c]]&&this.fillContent(b[c]),this.pageArray[b[c]]))){var d=this.newPage(b[c]);d.fillPreviewImage();var e=this.pageInfoArray[b[c]];d.onResize(this.pageWidth*e.pageWidth,this.pageHeight*e.pageHeight,e.opacity);this.pageArray[b[c]]=d;this.fillContent(b[c]);this.flipBook.append(d.$page)}},onResize:function(b, c){this.resizeBook(b,c);0==this.pageArray.length&&this.resetPages(this.currentPageIndex);isPhone()||isPad()||this.switchNormalImage(!0);this.resizeAttachments(b,c);this.showPages()},resizeAttachments:function(b,c){},loading:function(){if(!this.flipping){var b=this.getCurrentPages();if(b&&!(0>=b.length))for(var c=b.length,d=0;dthis.getCurrentPages().indexOf(b)|| (this.pageArray[b]&&!c&&this.pageArray[b].fillContent(),this.pageBackArray&&this.pageBackArray[b]&&c&&this.pageBackArray[b].fillContent())},fillPage:function(b,c){if(b)for(var d=this.pageArray.length,e=0;e$("#flipBook").offset().left+$("#flipBook").outerWidth()||b.srcEvent[0].pageX<$("#flipBook").offset().left||b.srcEvent[0].pageY>$("#flipBook").offset().top+$("#flipBook").outerHeight()||b.srcEvent[0].pageY<$("#flipBook").offset().top||(this.endFlip(),this.zoomToPage(this.currentPageIndex,b.srcEvent.pageX,b.srcEvent.pageY))}},onPan:function(b){if("panend"!=b.type&&!(this.selected||this.status_zoom|| this.isZoomming||bookType!=this.bookType||this.status_zoom||this.status_resize||this.flipping||this.flipPageManager.fallbackArray&&0this.MiddleX&&0>b.deltaY))&&this.curling(c,d):("panstart"==b.type&&d||30this.MiddleX&&0>b.deltaX))&&this.curling(c,d)}},onPress:function(b){if(!(bookConfig.EnableRecognizeQRcodePressOnMobile&&(isPhone()||isPad())||this.selected||this.status_zoom||this.isZoomming||bookType!=this.bookType||this.status_zoom||this.status_resize||this.flipping|| this.flipPageManager.fallbackArray&&0this.MiddleX?"r":"l"),this.curling(b,c))}},onRotate:function(b){},onSwipe:function(b){if(!(this.selected||this.status_zoom||this.isZoomming||this.dragToFlip)&&bookConfig.mouseDragFlip)if(bookConfig.FlipDirection||bookConfig.upsideOnMobile())switch(b.type){case "swipeup":this.flipFromDirection(this.coordinate_bottom_right, "swipe to flip");break;case "swipedown":this.flipFromDirection(this.coordinate_bottom_left,"swipe to flip")}else switch(b.type){case "swipeleft":this.flipFromDirection(this.coordinate_bottom_right,"swipe to flip");break;case "swiperight":this.flipFromDirection(this.coordinate_bottom_left,"swipe to flip")}},onTap:function(b){var c=b;b.srcEvent&&(c=b.srcEvent);if(this.selected||this.status_zoom||this.isZoomming)b=this.realPoint(c)[0],this.aroundFlipBound(b)&&onWindowTap(c);else if(bookType==this.bookType&& !this.status_zoom&&!this.status_resize){b=this.realPoint(c)[0];var d=this.aroundFlipCorner(b);!d||bookConfig.BanFlipFromDirection?this.aroundFlipBound(b)&&onWindowTap(c):(this.flipPageManager[this.optionPage]&&(this.flipPageManager[this.optionPage].loosen=!0),this.optionPage=null,this.flipFromDirection(d,"direction"))}},onOver:function(b){if(!(isPhone()||isPad()||this.selected||this.status_zoom||this.isZoomming||bookType!=this.bookType||this.fingleDown||this.flipping)&&bookConfig.CurlingPageCorner){b= this.realPoint(b)[0];var c=this.aroundCorner(b);c?this.curling(b,c):(this.flipPageManager[this.optionPage]&&(this.flipPageManager[this.optionPage].loosen=!0),this.optionPage=null);this.unCurling()}},aroundFlipCorner:function(b){var c=this.aroundCorner(b);if(c)return c;if(!this.doublePage){var d=this.getCurrentPageWidthHeight(b.x);bookConfig.FlipDirection?(c=d.pageHeight,d=d.pageWidth):(c=d.pageWidth,d=d.pageHeight);0>this.MiddleX&&(b.x=-b.x);if(!(b.x>c-1||1>b.x||b.y>d-1||1>b.y||b.x<.8*c&&b.x>.2*c|| b.y>.2*d&&b.y<.8*d)){var e=Math.sqrt(Math.pow(.2*d,2)-Math.pow((c-Math.abs(b.x))*d/c,2));c=Math.sqrt(Math.pow(.2*d,2)-Math.pow(Math.abs(b.x)*d/c,2));if(b.ythis.MiddleX||b.ythis.MiddleX&&0-this.MiddleX&&0>this.MiddleX)return"tl";if(b.y>d-c&&b.xd-c&&b.x<-this.MiddleX&&0>this.MiddleX||b.y>d-e&&b.x>this.MiddleX&&0d-e&&b.x>-this.MiddleX&&0>this.MiddleX)return"bl"}}},aroundCorner:function(b){this.edgeX();var c=this.getCurrentPageWidthHeight(b.x);if(bookConfig.FlipDirection){var d=c.pageHeight;c=c.pageWidth}else d=c.pageWidth,c=c.pageHeight;if(!(Math.abs(b.x)>d-1||b.y>c-1||1>b.y||Math.abs(b.x)<.8*d||b.y>.2*c&&b.y<.8*c)){d=Math.sqrt(Math.pow(.2*c,2)-Math.pow((d-Math.abs(b.x))*c/d,2));if(b.ythis.MiddleX)return"tr";if(b.y>c-d&&b.x c-d&&b.x>this.MiddleX)return"br"}},aroundFlipBound:function(b){this.edgeX();var c=this.getCurrentPageWidthHeight(b.x);if(bookConfig.FlipDirection){var d=c.pageHeight;c=c.pageWidth}else d=c.pageWidth,c=c.pageHeight;return Math.abs(b.x)>d||Math.abs(b.y)>c||0>b.y?!1:!0},getCurrentPageWidthHeight:function(b){this.edgeX();var c=this.getCurrentPages();if(1==c.length||b<=this.MiddleX&&!rightToLeft||b>=this.MiddleX&&rightToLeft)return{pageWidth:this.pageInfoArray[c[0]].pageWidth*this.pageWidth,pageHeight:this.pageInfoArray[c[0]].pageHeight* this.pageHeight};if(b<=this.MiddleX&&rightToLeft||b>=this.MiddleX&&!rightToLeft)return{pageWidth:this.pageInfoArray[c[1]].pageWidth*this.pageWidth,pageHeight:this.pageInfoArray[c[1]].pageHeight*this.pageHeight}},pageDragToFlip:function(){bookConfig.mouseDragFlip&&(this.flipPageManager[this.optionPage].toPoint.y=this.flipPageManager[this.optionPage].startPoint.y,this.flipPageManager[this.optionPage].toPoint.x=-this.flipPageManager[this.optionPage].startPoint.x,this.mouseMoveDirection=this.moveDirectionType.MOVE_NONE, this.flipPageManager[this.optionPage].startToFlip(),this.flipPageManager[this.optionPage].dragMoveToFlip=!0,this.flipToDirection=0>this.flipPageManager[this.optionPage].startPoint.x?"right":"left",this.tmpDragToFlipTimeout&&window.clearTimeout(this.tmpDragToFlipTimeout),this.dragToFlip=!0,this.tmpDragToFlipTimeout=window.setTimeout(function(){this.dragToFlip=!1}.bind(this),500),this.getNextPage("drag to flip"))},flipFromDirection:function(b,c){if(!(this.flipPageManager.fallbackArray&&0c.indexOf(d)&&this.pageArray[d].visible&&(this.zoomPageArray.push(this.pageArray[d]),this.pageArray[d].setVisible(!1)), this.pageBackArray&&this.pageBackArray[d]&&(this.zoomPageArray.push(this.pageBackArray[d]),this.pageBackArray[d].setVisible(!1))},showPages:function(){if(this.zoomPageArray){for(var b=this.zoomPageArray.length,c=0;cthis.MiddleX||c&&0<=c.indexOf("r")){if(this.flipping&&"right"==this.flipToDirection)return;d=this.realIndex(!0)[0];e=this.realIndex(!0)[1];f=d+"-"+e;g=!0}if(f&&d&&e){var h=originTotalPageCount;bookConfig.SingleModeBanFlipToLastPage&& this.bookType==BookType.single_book&&(h=Math.max(1,bookConfig.totalPageCount-1));if(!(0>=d||d>h||0>=e||e>h||this.flipPageManager[f]&&this.flipPageManager[f].fallback||this.flipPageManager[f]&&this.flipPageManager[f].flipping||BookEvent.trigger("beforeFlipPage",[e])))if(h=e,BookInfo.isDoublePage()&&(h=BookInfo.getMinPageIndex(h)),passwardType()&&bookConfig.excludeFrontPages&&h>=parseInt(bookConfig.excludeFrontPages)&&!verifyPassward())global.passwardPannel||(global.passwardPannel=new PasswardPannel), global.passwardPannel.show();else return this.defineFlipPage(f,b,c,d,e,g),f}},defineFlipPage:function(b,c,d,e,f,g){if(c){var h=originTotalPageCount;bookConfig.SingleModeBanFlipToLastPage&&this.bookType==BookType.single_book&&(h=Math.max(1,bookConfig.totalPageCount-1));0>=e||e>h||0>=f||f>h||(this.flipPageManager[b]?d=this.getFromStartPointByCoordinate(c,d,this.flipPageManager[b]):(this.beforeFlipTo(f),d=this.getFromStartPointByCoordinate(c,d,this.flipPageManager[b]),this.flipIntervalManager.flipToPoint(this.flipPageManager[b], e,f,d[0],d[1],!0)),g?(this.flipPageManager[b].AliceToLeft=!0,this.flipPageManager[b].AliceToRight=!1):(this.flipPageManager[b].AliceToLeft=!1,this.flipPageManager[b].AliceToRight=!0),this.flipPageManager[b].loosen=!1,this.flipPageManager[b].fromPoint=d[0],this.flipPageManager[b].startPoint=d[1],this.flipPageManager[b].toPoint=c,0>this.flipPageManager.pinDownCurlingArray.indexOf(b)&&this.flipPageManager.pinDownCurlingArray.push(b),this.flipPageManager.fallbackArray.removeElement(b),this.flipPageManager.flipArray.removeElement(b))}}, unCurling:function(){if(!(this.selected||this.status_zoom||this.status_resize)&&this.flipPageManager.array)for(var b=this.flipPageManager.array.length,c=0;cthis.flipPageManager.fallbackArray.indexOf(d)&&this.flipPageManager.fallbackArray.push(d);this.flipPageManager.pinDownCurlingArray.removeElement(d);this.flipPageManager.flipArray.removeElement(d)}}},getFromStartPointByCoordinate:function(b, c,d){if(b){var e={x:0,y:0},f={x:0,y:0};if(bookConfig.FlipDirection){var g=d.getPageWidthHeight().height;d=d.getPageWidthHeight().width}else g=d.getPageWidthHeight().width,d=d.getPageWidthHeight().height;var h=b.y>d/2?b.y-5:b.y+5;0>b.x&&(e={x:-g,y:h});0(new Date).getTime()-b)var d=!1;else b=(new Date).getTime(),d=!0;if(!d)return!1;d=c.originalEvent;d=Math.max(-1,Math.min(1,d.wheelDelta||-d.detail)); c=c.originalEvent?c.originalEvent:c;this.status_zoom&&(c={pointers:[{pageX:c.pageX,pageY:c.pageY},{pageX:c.pageX,pageY:c.pageY}]},0>d?this.controlBar&&this.controlBar.zoomDown(c):this.controlBar&&this.controlBar.zoomUp(c));this.status_zoom||!bookConfig.mouseWheelFlip||this.flipping||(0>d?nextPageFun("mouse wheel flip"):previousPageFun("mouse wheel flip"));if(bookConfig.mouseWheelFlip)return stopEvent(c),!1}.bind(this))},mouseZoomEvent:function(){$(this.flipBook).bind(_event._move,function(b){var c= BookInfo.getBook();if(c.status_zoom&&!this.flipBook.parameters.zoomming&&c.controlBar&&c.controlBar.moveByMousePosition){c=this.flipBook;var d=c.width(),e=c.height(),f=b.pageX;b=b.pageY;d=f-f*d/windowWidth;e=b-b*e/windowHeight;b={};b.origin=c.parameters.origin;b.scale=c.parameters.scale;d-=c.parameters.left;e-=c.parameters.top;b.tran={x:d,y:e};e=transformCSS(b);c.css(e);this.bookAttachments&&this.bookAttachments.zoomMap&&this.bookAttachments.zoomMap.refreshArea()}}.bind(this))}}); var DoubleFlipBook=Class({newFlipPage:function(){return new DoubleFlipPage(this)},resetPages:function(b){isNaN(b)||0>=b||(b=this.getMinPageIndex(b),this.unWrapPageExcludeArray([b,b+1,b+2,b+3,b-1,b-2]),this.addPageArray([b,b+1,b+2,b+3,b-1,b-2]),this.currentPage=this.pageArray[b],this.currentPage2=this.pageArray[b+1],this.nextPage=this.pageArray[b+2],this.nextPage2=this.pageArray[b+3],this.previousPage=this.pageArray[b-1],this.previousPage2=this.pageArray[b-2],this.setPageCss(),this.loading())},setPageCss:function(){var b= transformCSS({rotate:0,tran:{x:0,y:0}});this.currentPage&&(this.setZIndexByPageIndex(this.currentPage),this.currentPage.setCSSByStyle(b));this.previousPage&&(this.setZIndexByPageIndex(this.previousPage),this.previousPage.setCSSByStyle(b));this.previousPage2&&(this.setZIndexByPageIndex(this.previousPage2),this.previousPage2.setCSSByStyle(b));this.currentPage2&&(this.setZIndexByPageIndex(this.currentPage2),this.currentPage2.setCSSByStyle(b));this.nextPage&&(this.setZIndexByPageIndex(this.nextPage), this.nextPage.setCSSByStyle(b));this.nextPage2&&(this.setZIndexByPageIndex(this.nextPage2),this.nextPage2.setCSSByStyle(b));rightToLeft?(this.currentPage&&this.currentPage.setLeftOrRight(!1),this.previousPage&&this.previousPage.setLeftOrRight(!1),this.previousPage2&&this.previousPage2.setLeftOrRight(!1),this.currentPage2&&this.currentPage2.setLeftOrRight(!0),this.nextPage&&this.nextPage.setLeftOrRight(!0),this.nextPage2&&this.nextPage2.setLeftOrRight(!0)):(this.currentPage&&this.currentPage.setLeftOrRight(!0), this.previousPage&&this.previousPage.setLeftOrRight(!0),this.previousPage2&&this.previousPage2.setLeftOrRight(!0),this.currentPage2&&this.currentPage2.setLeftOrRight(!1),this.nextPage&&this.nextPage.setLeftOrRight(!1),this.nextPage2&&this.nextPage2.setLeftOrRight(!1))},getDownUpHardPage:function(b,c,d){this.addPageArray([b,c]);d?(this.pageArray[b]&&this.pageArray[b].setCSSByName("flip-hard-left-side"),this.pageArray[c]&&this.pageArray[c].setCSSByName("flip-hard-right-side")):(this.pageArray[b]&&this.pageArray[b].setCSSByName("flip-hard-right-side"), this.pageArray[c]&&this.pageArray[c].setCSSByName("flip-hard-left-side"));return[this.pageArray[b],this.pageArray[c]]},getDownUpPage:function(b,c){this.addPageArray([b,c]);this.pageArray[b]&&this.pageArray[b].beginToFlip();this.pageArray[c]&&this.pageArray[c].beginToFlip();this.pageArray[b]&&(this.pageArray[b].page.setCSSByName("right-flip-side"),this.setZIndexByPageIndex(this.pageArray[b]));this.pageArray[c]&&(this.pageArray[c].page.setCSSByName("flip-side"),this.pageArray[c].page.side.addClass("boxShadow"), this.setZIndexByPageIndex(this.pageArray[c]));return[this.pageArray[b],this.pageArray[c]]},flipToMax:function(b,c,d,e){e=this.flipPageManager.initFlipPageByIndex(b,c,e);this.addPagesBeforeFlipToMax(c,d);this.pageArray[c+1]&&(this.pageArray[c+1].setLeftOrRight(rightToLeft),e.nextPage=this.pageArray[c+1]);this.setPagesStyleBeforeFlipToMax(c,d);this.deleteUnnecessaryPagesBeforeFlipToMax(b,c);return e},addPagesBeforeFlipToMax:function(b,c){this.addPageArray([b+1]);c&&this.supportSerialsFlip()&&this.addPageArray([b+ 2,b+3])},setPagesStyleBeforeFlipToMax:function(b,c){c&&this.supportSerialsFlip()&&(this.pageArray[b+1]&&this.setZIndexByPageIndex(this.pageArray[b+1],b),this.pageArray[b+2]&&(this.setZIndexByPageIndex(this.pageArray[b+2],b),this.pageArray[b+2].setLeftOrRight(rightToLeft)),this.pageArray[b+3]&&(this.setZIndexByPageIndex(this.pageArray[b+3],b),this.pageArray[b+3].setLeftOrRight(rightToLeft)))},deleteUnnecessaryPagesBeforeFlipToMax:function(b,c){for(var d=c+4;d<=originTotalPageCount;d++)this.pageArray[d]&& (this.pageArray[d].remove(),this.pageArray[d]=void 0);for(d=b+1;dc;d--)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0)},afterFlipToMin:function(b, c){b=this.getMaxPageIndex(b);this.addPagesAfterFlipToMin(b);this.setPagesStyleAfterFlipToMin(b);this.deleteUnnecessaryPagesAfterFlipToMin(b)},addPagesAfterFlipToMin:function(b){this.flipping||this.addPageArray([b-3,b,b+1,b+2]);this.supportSerialsFlip()||this.addPageArray([b-2,b-3]);this.pageArray[b-1]&&this.fillContent(b-1);this.pageArray[b-2]&&this.fillContent(b-2);this.pageArray[b-3]&&this.fillContent(b-3)},setPagesStyleAfterFlipToMin:function(b){this.pageArray[b]&&(this.setZIndexByPageIndex(this.pageArray[b], b),this.pageArray[b].setLeftOrRight(rightToLeft));this.pageArray[b+1]&&(this.setZIndexByPageIndex(this.pageArray[b+1],b),this.pageArray[b+1].setLeftOrRight(rightToLeft));this.pageArray[b+2]&&(this.setZIndexByPageIndex(this.pageArray[b+2],b),this.pageArray[b+2].setLeftOrRight(rightToLeft));this.supportSerialsFlip()&&this.flipping||(this.pageArray[b-1]&&this.setZIndexByPageIndex(this.pageArray[b-1]),this.pageArray[b-2]&&(this.setZIndexByPageIndex(this.pageArray[b-2]),this.pageArray[b-2].setLeftOrRight(!rightToLeft)), this.pageArray[b-3]&&(this.setZIndexByPageIndex(this.pageArray[b-3]),this.pageArray[b-3].setLeftOrRight(!rightToLeft)))},deleteUnnecessaryPagesAfterFlipToMin:function(b){for(b+=3;b<=originTotalPageCount;b++)this.pageArray[b]&&(this.pageArray[b].remove(),this.pageArray[b]=void 0)},getFlipTo:function(b){var c=this.getMinPageIndex(this.currentPageIndex);b=this.getMinPageIndex(b);var d=c+1,e="";b>d&&(e="max");b+1this.movedX*k&&this.toTrans!=k?this.movedX:h;this.toTrans=k;b=2*e;void 0==d&&(d=b);isNaN(d)||(this.movedLength=d,this.movedX=$.easing.easeInOutSine(null,d,this.fromTrans,this.toTrans-this.fromTrans,b),d={tran:{x:parseInt(this.movedX),y:0}},this.setCSS(d))}},edgeX:function(){this.MiddleX=0},getFromStartPointByIndex:function(b,c){var d=this.getMinPageIndex(this.currentPageIndex),e=d+1;if(b!=e&&b!=d){var f={x:0,y:0},g={x:0,y:0},h=c.getPageWidthHeight().width; c=c.getPageWidthHeight().height;var k=!1;if(b>e&&!rightToLeft||be&&rightToLeft)f={x:-h,y:c},g.x=f.x+2,g.y=f.y-2,k=!1;this.flipToDirection=k?"left":"right";return[f,g]}},afterZoomIn:function(b){if(!isPhone()&&!isPad()||bookConfig.usePdfJs){if(isPhone()||isPad()||this.showPages(),b&&this.flipBook.parameters&&!this.flipBook.parameters.resize){this.flipBook.parameters.resize=!0;b=this.flipBook.offset().left;var c=this.flipBook.offset().top, d=this.flipBook.parameters.left,e=c-this.flipBook.parameters.top;f=this.flipBook.parameters.scale;d={tran:{x:parseInt(b-d),y:parseInt(e)},scale:1,origin:{x:0,y:0}};1!=f&&this.resizeBook(Math.round(this.width*f/2),Math.round(this.height*f));this.status_zoom||(f=0,1==this.currentPageIndex&&bookConfig.retainBookCenter&&!bookConfig.isTheBookOpen&&(f=rightToLeft?this.width/4:-this.width/4),this.currentPageIndex==totalPageCount&&bookConfig.retainBookCenter&&(f=rightToLeft?-this.width/4:this.width/4),d.tran= {x:parseInt(f),y:0},d.left=b-f,d.top=c-0);this.setCSS(d);this.flipBook.parameters.tran=d.tran;this.flipBook.parameters.scale=1;this.flipBook.parameters.toScale=1;this.flipBook.parameters.width=$(this.flipBook).width();this.flipBook.parameters.height=$(this.flipBook).height();this.flipBook.parameters.origin={x:0,y:0};this.flipBook.parameters.resize=!1;isPhone()||isPad()||this.switchLargeImage()}}else if(c=BookInfo.getCurrentPages(),void 0!=c&&null!=c)for(d=0;d=b||(this.unWrapPageBackExcludeArray([b,b+1]),this.unWrapPageExcludeArray([b,b+1]),this.addPageArray([b,b+1]),this.addPageBackArray([b]), this.currentPage=this.pageArray[b],this.currentPage2=this.pageBackArray[b],this.nextPage=this.pageArray[b+1],this.previousPage=this.pageArray[b-1],this.previousPage2=this.pageBackArray[b-1],this.setPageCss(),this.loading())},setPageCss:function(){var b=transformCSS({rotate:0,tran:{x:0,y:0}});this.currentPage&&(this.setZIndexByPageIndex(this.currentPage),this.currentPage.setCSSByStyle(b));this.previousPage&&(this.setZIndexByPageIndex(this.previousPage),this.previousPage.setCSSByStyle(b));this.previousPage2&& (this.setZIndexByPageIndex(this.previousPage2),this.previousPage2.setCSSByStyle(b));this.currentPage2&&(this.setZIndexByPageIndex(this.currentPage2),this.currentPage2.setCSSByStyle(b));this.nextPage&&(this.setZIndexByPageIndex(this.nextPage),this.nextPage.setCSSByStyle(b));rightToLeft?(this.currentPage&&this.currentPage.setLeftOrRight(!0),this.previousPage&&this.previousPage.setLeftOrRight(!0),this.previousPage2&&this.previousPage2.setLeftOrRight(!0),this.currentPage2&&this.currentPage2.setLeftOrRight(!0), this.nextPage&&this.nextPage.setLeftOrRight(!0)):(this.currentPage&&this.currentPage.setLeftOrRight(!1),this.previousPage&&this.previousPage.setLeftOrRight(!1),this.previousPage2&&this.previousPage2.setLeftOrRight(!1),this.currentPage2&&this.currentPage2.setLeftOrRight(!1),this.nextPage&&this.nextPage.setLeftOrRight(!1))},addPageBackArray:function(b){if(b&&this.pageBackArray)for(var c=0;c=b[c]||b[c]>originTotalPageCount||(!this.pageBackArray[b[c]]||this.flipping&&!imageLoaded[b[c]]|| this.fillContent(b[c],!0),this.pageBackArray[b[c]]))){var d=this.newPageBack(b[c]),e=this.pageInfoArray[b[c]];d.mirrorSide();d.onResize(this.pageWidth*e.pageWidth,this.pageHeight*e.pageHeight,e.opacity);this.pageBackArray[b[c]]=d;this.flipping&&!imageLoaded[b[c]]||this.fillContent(b[c],!0);this.flipBook.append(d.$page)}},getDownUpPage:function(b,c){var d=b;b>c&&(d=c);this.addPageArray([d]);this.addPageBackArray([d]);this.pageArray[d]&&this.pageArray[d].beginToFlip();this.pageBackArray[d]&&this.pageBackArray[d].beginToFlip(); this.pageArray[d]&&this.pageArray[d].page.setCSSByName("right-flip-side");this.pageBackArray[d]&&(this.pageBackArray[d].page.setCSSByName("flip-side"),this.pageBackArray[d].page.side.addClass("boxShadow"));return[this.pageArray[d],this.pageBackArray[d]]},getDownUpHardPage:function(b,c){var d=b;b>c&&(d=c);this.addPageArray([d]);this.addPageBackArray([d]);rightToLeft?(this.pageArray[d]&&this.pageArray[d].setCSSByName("flip-hard-left-side"),this.pageBackArray[d]&&this.pageBackArray[d].setCSSByName("flip-hard-right-side")): (this.pageArray[d]&&this.pageArray[d].setCSSByName("flip-hard-right-side"),this.pageBackArray[d]&&this.pageBackArray[d].setCSSByName("flip-hard-left-side"));return[this.pageArray[d],this.pageBackArray[d]]},flipToMax:function(b,c,d){var e=this.flipPageManager.initFlipPageByIndex(b,c);this.addPagesBeforeFlipToMax(c,d);this.pageArray[c]&&(this.pageArray[c].setLeftOrRight(rightToLeft),e.nextPage=this.pageArray[c]);this.setPagesStyleBeforeFlipToMax(c,d);this.deleteUnnecessaryPagesBeforeFlipToMax(b,c); return e},hidePagesBeforeFlip:function(b){if(!this.supportSerialsFlip()){var c=this.pageArray.length;this.flipPageArray=[];var d=b.currentIndex;b=b.nextIndex;for(var e=[d,b],f=0;fe.indexOf(f)&&(this.pageArray[f]&&this.pageArray[f].visible&&(this.flipPageArray.push(this.pageArray[f]),this.pageArray[f].setVisible(!1)),this.pageBackArray[f]&&this.pageBackArray[f].visible&&(this.flipPageArray.push(this.pageBackArray[f]),this.pageBackArray[f].setVisible(!1)));c=Math.max(d,b);this.pageBackArray[c]&& this.pageBackArray[c].visible&&(this.flipPageArray.push(this.pageBackArray[c]),this.pageBackArray[c].setVisible(!1))}},showPagesAfterFlip:function(){if(!this.supportSerialsFlip()&&this.flipPageArray){for(var b=this.flipPageArray.length,c=0;cc;b--)if(this.pageArray[b]|| this.pageBackArray[b])this.pageArray[b]&&this.pageArray[b].remove(),this.pageBackArray[b]&&this.pageBackArray[b].remove(),this.pageArray[b]=void 0,this.pageBackArray[b]=void 0},afterFlipToMin:function(b){this.addPagesAfterFlipToMin(b);this.setPagesStyleAfterFlipToMin(b);this.deleteUnnecessaryPagesAfterFlipToMin(b)},addPagesAfterFlipToMin:function(b){this.supportSerialsFlip()||(this.addPageArray([b]),this.addPageBackArray([b]),this.addPageArray([b-1]));this.pageArray[b]&&this.fillContent(b);this.pageArray[b- 1]&&this.fillContent(b-1)},setPagesStyleAfterFlipToMin:function(b){this.pageArray[b+1]&&(this.setZIndexByPageIndex(this.pageArray[b+1]),this.pageArray[b+1].setLeftOrRight(rightToLeft));this.supportSerialsFlip()||(this.pageArray[b]&&(this.setZIndexByPageIndex(this.pageArray[b]),this.pageArray[b].setLeftOrRight(rightToLeft)),this.pageBackArray[b]&&(this.setZIndexByPageIndex(this.pageBackArray[b]),this.pageBackArray[b].setLeftOrRight(rightToLeft)),this.pageArray[b-1]&&(this.setZIndexByPageIndex(this.pageArray[b- 1]),this.pageArray[b-1].setLeftOrRight(rightToLeft)))},deleteUnnecessaryPagesAfterFlipToMin:function(b){for(var c=b+2;c<=originTotalPageCount;c++)if(this.pageArray[c]||this.pageBackArray[c])this.pageArray[c]&&this.pageArray[c].remove(),this.pageBackArray[c]&&this.pageBackArray[c].remove(),this.pageArray[c]=void 0,this.pageBackArray[c]=void 0;this.pageBackArray[b+1]&&(this.pageBackArray[b+1]&&this.pageBackArray[b+1].remove(),this.pageBackArray[b+1]=void 0)},getCurrentPages:function(){return[this.currentPageIndex]}, getPagesByIndex:function(b){return[b]},movetoCenter:function(){},getFromStartPointByIndex:function(b,c){var d=this.currentPageIndex;if(b!=d&&b!=d){var e={x:0,y:0},f=c.getPageWidthHeight().width,g=c.getPageWidthHeight().height,h=!1;c={x:f,y:g};rightToLeft&&(c={x:-f,y:g});if(b>d&&!rightToLeft||bd&&rightToLeft)h=!1;b>d&&(e={x:c.x*(f-2)/f,y:g-2});bd/ 2?b.y-5:b.y+5;b.xthis.MiddleX&&(e.y=h,f.x=g);c&&0<=c.indexOf("r")&&(f.x=g);c&&0<=c.indexOf("l")&&(f.x=-g);"tl"==c&&(e.y=0);"bl"==c&&(e.y=d);"tr"==c&&(e.y=0);"br"==c&&(e.y=d);e.x=rightToLeft?-g:g;f.y=e.y;return[e,f]}},getFlipTo:function(b){var c=this.currentPageIndex,d="";b>c&&(d="max");b");this.btnZoomDown=$("
");this.btnZoomOut=$("
");this.btnPre=$("
");this.btnNext=$("
");this.btnMoveMode=$("
");this.btnClose=$("
")},initBar:function(b){this.height=40;this.bar=$("
");this.bar.append(this.btnZoomUp);this.bar.append(this.btnZoomDown);this.bar.append(this.btnZoomOut);this.bar.append(this.btnPre);this.bar.append(this.btnNext);this.bar.append(this.btnMoveMode);this.bar.append(this.btnClose); this.bar.css({"background-color":bookConfig.toolbarColor});"slide"==bookConfig.FlipStyle.toLowerCase()&&this.btnMoveMode.css({display:"none"});b.append(this.bar);this.width=this.bar.width()},getImageUrl:function(b){return window.zoom_icons&&zoom_icons[b]?"data:image/png;base64,"+zoom_icons[b]:uiBaseURL+b+".png"},setVisible:function(b){b&&this.buttonChangeColor();this.bar.css({display:b?"block":"none"});b&&(this.bar.attr("tabindex",0),this.bar.focus())},buttonChangeColor:function(){this.hasChanged|| (this.btnZoomUp.changeButtonColor(bookConfig.iconColor),this.btnZoomDown.changeButtonColor(bookConfig.iconColor),this.btnZoomOut.changeButtonColor(bookConfig.iconColor),this.btnPre.changeButtonColor(bookConfig.iconColor),this.btnNext.changeButtonColor(bookConfig.iconColor),this.btnMoveMode.changeButtonColor(bookConfig.iconColor),this.btnClose.changeButtonColor(bookConfig.iconColor),this.hasChanged=!0)},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);this.bar.css(d[0],b+"px");this.bar.css(d[1], c+"px")},initEvent:function(){var b=this;this.btnZoomUp.bind(_event._click,function(){BookEvent.trigger("zoomIn",["zoom bar",BookInfo.getCurrentPages().join("-")]);this.zoomUp()}.bind(this));this.btnZoomDown.bind(_event._click,function(){BookEvent.trigger("zoomOut",["zoom bar",BookInfo.getCurrentPages().join("-")]);this.zoomDown()}.bind(this));this.btnZoomOut.bind(_event._click,function(){BookEvent.trigger("zoomOut",["zoom bar",BookInfo.getCurrentPages().join("-")]);this.zoomOut()}.bind(this));this.btnPre.bind(_event._click, function(){rightToLeft?nextPageFun("zoom bar"):previousPageFun("zoom bar")});this.btnNext.bind(_event._click,function(){rightToLeft?previousPageFun("zoom bar"):nextPageFun("zoom bar")});this.btnMoveMode.bind(_event._click,function(){BookEvent.trigger("zoomMove",["zoom bar",BookInfo.getCurrentPages().join("-")]);this.changeMoveMode()}.bind(this));this.btnClose.bind(_event._click,function(){b.bar.hide()})},changeMoveMode:function(){1==this.moveByMousePosition?(this.moveByMousePosition=!1,this.btnMoveMode.empty().append(getImage(this.moveByPositionUrl)).attr("title", getLanguage("btnPositionToMove","Move by mouse position"))):(this.moveByMousePosition=!0,this.btnMoveMode.empty().append(getImage(this.moveByDragUrl)).attr("title",getLanguage("btnDragToMove","Move by mouse drag")));this.btnMoveMode.changeButtonColor(bookConfig.iconColor)},destroy:function(){this.bar.remove()},zoomUp:function(b){var c=BookInfo.getBook().showPage;if(bookType===BookType.documentView_book||bookType===BookType.singleDocumentView_book)c=BookInfo.getBook().docViewBook;if(!c.parameters.eventCancel&& !c.parameters.zoomming){bookConfig.AnnotationButtonVisible&&global.annotationCookie&&global.annotationCookie.saveCookie();c.scale=c.parameters.toScale;var d=Math.min(c.parameters.naturalHeight*c.maxScale/c.parameters.height,1.5*parseFloat(c.scale));d!=c.scale&&(b||(b={pointers:[{pageX:windowWidth/2,pageY:windowHeight/2},{pageX:windowWidth/2,pageY:windowHeight/2}]}),c.parameters.origin=c.mathOrigin(c,b),c.originObj(c,c.parameters.origin),c.animateToScale(c,d,b,150))}},zoomDown:function(b){var c=BookInfo.getBook().showPage; if(bookType===BookType.documentView_book||bookType===BookType.singleDocumentView_book)c=BookInfo.getBook().docViewBook;if(!c.parameters.eventCancel&&!c.parameters.zoomming){bookConfig.AnnotationButtonVisible&&global.annotationCookie&&global.annotationCookie.saveCookie();b||(b={pointers:[{pageX:windowWidth/2,pageY:windowHeight/2},{pageX:windowWidth/2,pageY:windowHeight/2}]});c.scale=c.parameters.toScale;c.parameters.origin=c.mathOrigin(c,b);c.originObj(c,c.parameters.origin);var d=c.parameters.naturalHeight/ c.parameters.height,e=.5*parseFloat(c.scale);e<=d&&(c.parameters.zoomOut=!0);c.animateToScale(c,Math.max(d,e),b,150)}},zoomOut:function(){var b=BookInfo.getBook().showPage;if(bookType===BookType.documentView_book||bookType===BookType.singleDocumentView_book)b=BookInfo.getBook().docViewBook;b.onDoubleTap.bind(b)({pointers:[{pageX:windowWidth/2,pageY:windowHeight/2}]});StateSynchronous.instance().findButtons("ZoomButton",!0).each(function(c){c.setAsZoomin();c.executeCallback()})},setA11y:function(){this.bar.find(".button").each(function(){$(this).attr("tabindex", 0);$(this).attr("role","button");$(this).off("keydown.a11y").on("keydown.a11y",function(b){"Enter"!==b.key&&" "!==b.key||$(this).trigger("click")})})}}),CatalogZoomControlBar=Class({}).extend(ZoomControlBar),ZoomMap=Class({create:function(b){this.book=b;this.maxWidth=80;this.maxHeight=100;this.pageHeight=this.pageWidth=this.height=this.width=0;this.doublePage=!1;this.init();this.initEvent()},init:function(){this.map=$("
");bookConfig.FlipDirection?(this.imageLeft=$(""), this.imageRight=$("")):(this.imageLeft=$(""),this.imageRight=$(""));this.mapCursor=$("
");this.map.append(this.imageLeft);this.map.append(this.imageRight);this.map.append(this.mapCursor);bookContainer.append(this.map)},show:function(){this.visible=!0;this.refreshArea();this.map.show()},hide:function(){this.visible=!1;this.map.hide()},onResize:function(){bookConfig.largePageWidth/ bookConfig.largePageHeight");this.flipShotObj.css({"z-index":2*(bookConfig.totalPageCount+5)+1});this.isLeft=b;this.visible=!0;this.width=50;this.height=0;this.init();this.initEvents();this.flipShotObj.append(this.firstDiv);this.flipShotObj.append(this.prevDiv)},init:function(){this.firstDiv=$("
");this.prevDiv=$("
");this.isLeft?(this.firstDiv.addClass("left"),this.prevDiv.addClass("left"),this.prevImageUrl= uiBaseURL+"slide_leftButton.png",this.firstImageUrl=uiBaseURL+"catalog_firstButton.png"):(this.firstDiv.addClass("right"),this.prevDiv.addClass("right"),this.prevImageUrl=uiBaseURL+"slide_rightButton.png",this.firstImageUrl=uiBaseURL+"catalog_lastButton.png");this.prevDiv.append("");this.firstDiv.append("")},onResize:function(b,c){var d=Math.min(50,.7*c/8),e=Math.min(.7*c,310);this.width=d;this.height=e;this.flipShotObj.css({width:d, height:e});this.setPosition(b,c)},setPosition:function(b,c){this.flipShotObj.css({left:this.isLeft?1-this.width:"100%",top:(c-this.height)/2})},setScale:function(b){this.width*=b;this.height*=b;this.flipShotObj.css({width:this.width,height:this.height})},setVisible:function(b){this.flipShotObj.css({display:b?"block":"none"});this.visible=b},getContainer:function(){return this.flipShotObj},initEvents:function(){this.isLeft?(this.prevDiv.bind(_event._end,function(b){rightToLeft?nextPageFun("flip shot bar"): previousPageFun("flip shot bar")}),this.firstDiv.bind(_event._end,function(b){rightToLeft?lastPageFun("flip shot bar"):firstPageFun("flip shot bar")})):(this.prevDiv.bind(_event._end,function(b){rightToLeft?previousPageFun("flip shot bar"):nextPageFun("flip shot bar")}),this.firstDiv.bind(_event._end,function(b){rightToLeft?firstPageFun("flip shot bar"):lastPageFun("flip shot bar")}));this.prevDiv.on("mousedown mouseup touchstart",function(b){b.stopPropagation()});this.firstDiv.on("mousedown mouseup touchstart", function(b){b.stopPropagation()})},setVisibleByIndex:function(b){this.isLeft?(1=b&&(bookConfig.RightToLeft||1>=b&&this.setVisible(!1)),b>=originTotalPageCount-2&&bookConfig.RightToLeft&&b>=originTotalPageCount-1&&this.setVisible(!1)):(1=b&&bookConfig.RightToLeft&&1>=b&&this.setVisible(!1),b>=originTotalPageCount- 2&&(bookConfig.RightToLeft||b>=originTotalPageCount-1&&this.setVisible(!1)))},refresh:function(){}}),setCurrentIndexTextField=function(b){b=getShownPageNumberInfo(b);$("#guidPageIndex").html(""+b+"");$("#currentPageIndexTextField")&&$("#currentPageIndexTextField")[0]&&!$("#currentPageIndexTextField")[0].onFocus&&$("#currentPageIndexTextField").val(b);if(isMacOSChrome()){var c,d;null==(c=global)||null==(d=c.toolBar)||d.resetPageNumberSize(b.length)}c=$(".currentPageIndexTextField");for(d=0;d< c.length;d++)c[d]&&!c[d].onFocus&&$(c[d]).val(b)},getShownPageNumberInfo=function(b){BookInfo.isDoublePage();b=BookInfo.getCurrentPages();for(var c=originTotalPageCount,d="",e=0;ef;f++,g/=10)e=Math.floor(b%g/(g/10)),d+=c[2-f][e];return d} var getShownPageNumber=function(b){var c=bookConfig.pageNumberCaption;if(""==c||void 0==c)return b;b=parseInt(b);c=getShownPageArray();return void 0==c[b]?b:c[b]},getRealPageNumber=function(b){b=getRealPage(b);isNaN(b)&&(b=1);return b},getRealPage=function(b,c){c=void 0===c?!1:c;var d=bookConfig.pageNumberCaption;if(""==d||void 0==d)return parseInt(b);b+="";d=getShownPageArray();for(var e=c?[]:-1,f=d.length,g=1;g<=f;g++)if(c)(d[g]+"").includes(b)&&e.push(g);else if(d[g]+""==b){e=g;break}return c? 0b&&bookConfig.isShowFirstOrLastPagePrompt||b>e&&bookConfig.isShowFirstOrLastPagePrompt){if(0>BookInfo.getCurrentPages().indexOf(e)&&b>e){gotoPageFun(e,c,d);return}if(0>BookInfo.getCurrentPages().indexOf(1)&&1>b){gotoPageFun(1,c,d);return}if(bookConfig.isShowFirstOrLastPagePrompt){b=1>b?getLanguage("lblFirst","This is the first page"):getLanguage("lblLast","This is the last page");global._tipsBox||(_tipsBox=new TipsBox(b, bookContainer));_tipsBox.setCaption(b);_tipsBox.showTipsBox();return}}d=b;BookInfo.isDoublePage()&&(d=BookInfo.getMaxPageIndex(d));d=Math.max(1,d);if(passwardType()&&bookConfig.excludeFrontPages&&d>=parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()&&(global.passwardPannel||(global.passwardPannel=new PasswardPannel),global.passwardPannel.show(),d>parseInt(bookConfig.excludeFrontPages)))return;switch(bookType){case BookType.normal_book:flipBook.gotoPage(b,c);break;case BookType.single_book:singlePageBook.gotoPage(b, c);break;case BookType.slide_book:slideBook.gotoPage(b,c);break;case BookType.singleSlide_book:singleSlideBook.gotoPage(b,c);break;case BookType.catalog_book:catalogBook.gotoPage(b,c);break;case BookType.singleCatalog_book:singleCatalogBook.gotoPage(b,c);break;case BookType.documentView_book:singleDocumentViewBook.gotoPage(b,c);break;case BookType.singleDocumentView_book:singleDocumentViewBook.gotoPage(b,c);break;case BookType.card_book:cardBook.gotoPage(b,c)}global.bookmark&&global.bookmark.elements.refreshElements(); bookConfig.SelectTextButtonVisible&&BookInfo.getBook().unSelect();bookConfig.MagnifierButtonVisible&&BookInfo.getBook().unMagnifierZoom();global.annotationPannel&&global.annotationPannel.clearBtnDownCase();bookConfig.addCurrentPage&&global.sharePanel&&global.sharePanel.elements&&global.sharePanel.elements.fillArea(!0,"link");global.downLoadBody&&downLoadBody.gotoPage(b);if(bookConfig.AnnotationButtonVisible&&!isPhone()&&!isPad()&&BookInfo.getBook().bookAttachments.noteAdd)BookInfo.getBook().bookAttachments.noteAdd.onResize(); setCurrentIndexTextField(BookInfo.getCurrentPageIndex(),BookInfo.isDoublePage());setLocationHash(BookInfo.getCurrentPageIndex());global.phoneGotoPagePanel&&global.phoneGotoPagePanel.visible&&global.phoneGotoPagePanel.refreshSlider();global.NeatStyle&&NeatStyle.refreshSlider();global.assistant&&global.assistant.refresh();global.pcArticlePages&&(global.pcArticlePages.clearHighLight(),global.pcArticlePages.setHighLight(b));global.phoneArticlePages&&(global.phoneArticlePages.clearHighLight(),global.phoneArticlePages.setHighLight(b)); global.flipPageAudio&&global.flipPageAudio.playByIndex(b);global.phoneGotoPagePanel&&global.phoneGotoPagePanel.showFirstOrLast();global.flipShotButton&&global.flipShotButton.showFirstOrLast();global.toolbar&&global.toolBar&&global.toolBar.showFirstOrLast&&global.toolBar.showFirstOrLast();bookConfig.delayToFlipFirst&&1!==b&&(delayToFlipFirstTimer&&clearTimeout(delayToFlipFirstTimer),delayToFlipFirstTimer=setTimeout(function(){firstPageFun("auto flip")},1E3*bookConfig.timeToFlipFirst))}},gotoPageVisit= function(b,c){var d=window.lastVisitTime?(new Date).getTime()-window.lastVisitTime:0;window.lastVisitTime=(new Date).getTime();0>=b||b>bookConfig.totalPageCount||BookEvent.trigger("flipPage",[c,BookInfo.getCurrentPages().join("-"),BookInfo.getCurrentPagesByIndex(b).join("-"),d])},BookInfo=Class({statics:{getCurrentPages:function(){var b=[];if(this.isDoublePage()){var c=this.getCurrentPageIndex();b=this.getPagesByIndex(c)}else c=this.getCurrentPageIndex(),b.push(c);return b},getCurrentPagesByIndex:function(b){var c= [];this.isDoublePage()?c=this.getPagesByIndex(b):c.push(b);return c},getPageCount:function(){return bookConfig.totalPageCount},isRightToLeft:function(){return rightToLeft},getBookType:function(){return bookType},getBook:function(){switch(this.getBookType()){case BookType.normal_book:var b=global.flipBook;break;case BookType.single_book:b=global.singlePageBook;break;case BookType.slide_book:b=global.slideBook;break;case BookType.singleSlide_book:b=global.singleSlideBook;break;case BookType.catalog_book:b= global.catalogBook;break;case BookType.singleCatalog_book:b=global.singleCatalogBook;break;case BookType.documentView_book:b=global.singleDocumentViewBook;break;case BookType.singleDocumentView_book:b=global.singleDocumentViewBook;break;case BookType.card_book:b=global.cardBook}return b},getBooks:function(){var b=[];global.flipBook&&b.push(global.flipBook);global.singlePageBook&&b.push(global.singlePageBook);global.slideBook&&b.push(global.slideBook);global.singleSlideBook&&b.push(global.singleSlideBook); global.catalogBook&&b.push(global.catalogBook);global.singleCatalogBook&&b.push(global.singleCatalogBook);global.cardBook&&b.push(global.cardBook);return b},getCurrentPageIndex:function(){var b=this.getBook();return b&&b.getCurrentPageIndex?b.getCurrentPageIndex():bookConfig.OriginPageIndex},isDoublePage:function(b){var c=this.getBookType();void 0!=b&&(c=b);switch(c){case BookType.single_book:return!1;case BookType.singleSlide_book:return!1;case BookType.singleCatalog_book:return!1;case BookType.documentView_book:return!1; case BookType.singleDocumentView_book:return!1;case BookType.card_book:return!1}return!0},left:function(){var b=this.getBook();return b&&b.getLeft?b.getLeft():0},top:function(){var b=this.getBook();return b&&b.getTop?b.getTop():0},width:function(){var b=this.getBook();return b&&b.getWidth?b.getWidth():0},height:function(){var b=this.getBook();return b&&b.getHeight?b.getHeight():0},scale:function(){var b=this.getBook();return b&&b.getScale?b.getScale():0},isZoomming:function(){return bookType===BookType.documentView_book|| bookType===BookType.singleDocumentView_book?this.getBook().docViewBook.parameters.zoomming:this.getBook().showPage.parameters.zoomming},zoomStatus:function(){return this.getBook()&&this.getBook().status_zoom?!0:!1},container:function(){return bookContainer},getThumbnailPages:function(){for(var b=[],c=Math.ceil(bookConfig.totalPageCount/2),d=0;d<=c;d++){var e=this.getPagesByIndex(2*d+1);0=this.pageIndex&&(this.hasReaderItems()||window.inverseEditor&&window.inverseEditor.length&&window.inverseEditor[this.pageIndex-1]&&window.inverseEditor[this.pageIndex-1].length)?!0:!1},hasReaderItems:function(){var b=window.readerConfig.pages[this.pageIndex- 1];return b&&0!==Object.values(b).filter(function(c){return Array.isArray(c)&&c.length}).length},loading:function(){"restrict"==BookRestrict.isRestrictPage(this.pageIndex)||this.originalImageLoaded||this.removeLoad||(this.loadingImage||(this.loadingImage=$("
loadingOuter
")),this.sideContent.append(this.loadingImage))},unLoading:function(b){this.hasReader()&&!b||!this.loadingImage|| (this.loadingImage.css({display:"none"}),this.loadingImage.remove(),this.loadingImage=null)},restrict:function(){if(!this.restrictImage){this.restrictImage=$("
");var b=1==this.pageIndex?getMeta("og:image"):bookConfig.pageRestrictUrl;this.restrictImage.css({"background-image":"url("+b+")"});1==this.pageIndex?this.restrictImage.css({"background-size":"contain"}):this.restrictImage.css({"background-size":"auto"});this.mirrorRestrict();this.sideContent.append(this.restrictImage)}}, unRestrict:function(){this.restrictImage&&(this.restrictImage.remove(),this.restrictImage=null)},mirrorRestrict:function(){if(this.isMirrorSide&&this.restrictImage){var b="scaleX(-1)";bookConfig.FlipDirection&&(b="scaleY(-1)");this.restrictImage.css({"-webkit-transform":b,"-moz-transform":b,"-o-transform":b,"-ms-transform":b,opacity:.2})}},mirrorSide:function(){this.isMirrorSide=!0;var b="scaleX(-1)";bookConfig.FlipDirection&&(b="scaleY(-1)");this.sideImage.css({"-webkit-transform":b,"-moz-transform":b, "-o-transform":b,"-ms-transform":b,opacity:.2});this.rendering&&(this.rendering.destroy(),this.rendering=null);this.unLoading()},fillPreviewImage:function(){var b=this,c,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress)return bookConfig.loadPreviewImage?b.isMirrorSide||window.sliderJS&&window.sliderJS[b.pageIndex-1]&&sliderJS[b.pageIndex-1].elements&&sliderJS[b.pageIndex-1].elements.length?e.jumpTo(0):e.yield(getPageDir(b.pageIndex,"previewPage",originTotalPageCount), 3):e.return();c=e.yieldResult;c.startsWith("none")||(b.sideImage.css({"background-image":"url("+c+")","background-size":"contain","background-repeat":"no-repeat","background-position":"center"}),bookConfig.removeLoad&&(d=$(""),d[0].onload=function(){this.unLoading();this.unRestrict();this.removeLoad=!0}.bind(b)));e.jumpToEnd()})},setFlipShadow:function(b,c,d){this.pageFlipShadow&&this.pageFlipShadow.flip(b,c,d)},addFlipShadow:function(){bookConfig.HardInnerPageEnable?this.addHardFlipShadow(): this.pageFlipShadow||(this.pageFlipShadow="magazine"==bookConfig.pageHighlightType?new IssuuPageHighlightsFlipShadow(this.side,this.pageIndex):new IssuuPageFlipShadow(this.side,this.pageIndex))},addHardFlipShadow:function(){this.pageFlipShadow||(this.pageFlipShadow=new HardPageFlipShadow(this.side))},clearFlipShadow:function(){this.pageFlipShadow&&this.pageFlipShadow.clear();this.side.removeClass("boxShadow")},resizeFlipShadow:function(b,c){this.pageFlipShadow&&this.pageFlipShadow.resize(b,c)},centerPage:function(){this.isLeft= !1;this.side.attr("class","center-side")},setLeftOrRight:function(b){(this.isLeft=b)?this.side.attr("class","left-side"):this.side.attr("class","right-side")},setUpOrDown:function(b){(this.isUp=b)?this.side.attr("class","up-side"):this.side.attr("class","down-side")},renderPage:function(){this.rendering&&(this.rendering.destroy(),this.rendering=null);this.rendering=new PageRendering(this.side,this.pageIndex,this.bookType);this.rendering.onResize(this.width,this.height);this.rendering.render()},hideMiddleShadow:function(){this.rendering&& this.rendering.hideMiddleShadow()},fillContent:function(b){"restrict"==BookRestrict.isRestrictPage(this.pageIndex)?this.restrict():this.fillPage(this.pageIndex,b)},fillPage:function(b,c,d){this.isMirrorSide&&!bookConfig.showMirrorSide||b!=this.pageIndex||this.originalImageLoaded||(d||(d="normal",this.isMirrorSide&&(d="thumb")),"normal"==d&&(bookConfig.usePdfJs?(b=function(e,f,g){this.pageBackground.load.renderCnvas(e,f,g,this.pageIndex,this.pageWidth,this.pageHeight,this.initContents.bind(this))}.bind(this), this.initPageBackground(c,"normal",b)):this.initPageBackground(c,"normal",this.initContents.bind(this))),"thumb"==d&&(this.type="thumb",this.initPageBackground(c,"thumb",this.onMirrorSideLoaded.bind(this))))},initPageBackground:function(b,c,d){if(!this.pageBackground||b)this.pageBackground=new IsuuPageBackground(this.pageIndex,c,d,this.pageWidth,this.pageHeight,this.isMirrorSide,this.sideImage),this.imageURL=this.pageBackground.imageURL},initContents:function(b,c,d){imageLoaded[this.pageIndex]=!0; this.isReaderConfigLoaded(function(){try{this.onOriginalImageLoaded(b,c,d)}catch(e){}}.bind(this))},onMirrorSideLoaded:function(b,c,d){b&&(this.originalImageLoaded=!1,this.unLoading(),this.unRestrict(),isPhone()||isPad()?bookConfig.EnableRecognizeQRcodePressOnMobile||$(d).css({"pointer-events":"none"}):bookConfig.isStopMouseMenu&&$(d).css({"pointer-events":"none"}),this.sideImage&&this.sideImage.empty().append(d))},onOriginalImageLoaded:function(b,c,d){var e=this,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(!b)return l.return(); e.originalImageLoaded=!0;e.unLoading();e.unRestrict();if(e.sideImage&&("string"==typeof c&&!c.startsWith("none")||"string"!=typeof c))if("string"==typeof c||"object"==typeof c&&0<=c[0].indexOf(".zip"))isPhone()||isPad()?bookConfig.EnableRecognizeQRcodePressOnMobile||$(d).css({"pointer-events":"none"}):bookConfig.isStopMouseMenu&&$(d).css({"pointer-events":"none"}),e.sideImage.empty().append(d);else{e.sideImage.empty();for(f=0;fh-k&&-.01");this.$page.attr("id",c+"Mask"+b);this.$pageMask=$("
");this.$page.append(this.$pageMask);this.setMaskCss();this.$pageMask.append(this.page.side)},setMaskCss:function(){if(bookConfig.FlipDirection){var b="vertical-mask";this.isSingleBook&&rightToLeft&&(b="single-book-right-vertical-mask"); this.isSingleBook&&!rightToLeft&&(b="single-book-vertical-mask")}else b="mask",this.isSingleBook&&rightToLeft&&(b="single-book-right-mask"),this.isSingleBook&&!rightToLeft&&(b="single-book-mask");this.setCSSByName(b)},onResize:function(b,c,d){this.pageWidth=b;this.pageHeight=c;d||(d=1);var e=parseInt(Math.sqrt(Math.pow(b,2)+Math.pow(c,2)));0!=(e-c)%2&&(e+=1);this.width=this.maskWidth=e;this.$page.css({width:b,height:c,opacity:d});this.$pageMask.css({width:e,height:e});if(this.page)this.page.onResize(b, c);bookConfig.FlipDirection?(this.$pageMask.css({left:"50%","margin-left":-this.width/2+"px"}),this.page&&this.page.side.css({left:(this.width-b)/2})):(this.$pageMask.css({top:"50%","margin-top":-this.width/2+"px"}),this.page&&this.page.side.css({top:(this.width-c)/2}))},setLeftOrRight:function(b){var c=this.isSingleBook?"left-single-mask-side":"left-mask-side";b||(c=this.isSingleBook?"right-single-mask-side":"right-mask-side");this.setCSSByName(c);this.page&&this.page.setLeftOrRight(b)},setUpOrDown:function(b){var c= this.isSingleBook?"up-single-mask-side":"up-mask-side";b||(c=this.isSingleBook?"down-single-mask-side":"down-mask-side");this.setCSSByName(c);this.page&&this.page.setUpOrDown(b)},beginToFlip:function(){this.setMaskCss()},setMaskCSSByStyle:function(b){this.$pageMask.css(b)}}).extend(PageInterface);bdor[39]=function(){return 8}(); var IssuuPageAttachmentsParser=function(b,c,d,e,f,g,h,k,l){this.parent=b;this.width=c;this.page=k;this.height=d;this.pageWidth=e;this.pageHeight=f;this.pageIndex=g;this.bookType=h;this.callback=l;this.createAttachmentsForPage()};IssuuPageAttachmentsParser.prototype.createAttachmentsForPage=function(){this.Items=new ObjectPool;this.factory=new PageAttachmentsFactory;this.isHiddenEditor()||getArticleEditor().then(this.createAnimation.bind(this));this.createAnnotation();this.highlightSearch()}; IssuuPageAttachmentsParser.prototype.isHiddenEditor=function(){return!bookConfig.isPreview||bookConfig.previewPages&&-1!==(Array.isArray(bookConfig.previewPages)&&bookConfig.previewPages.indexOf(this.pageIndex))?!1:!0}; IssuuPageAttachmentsParser.prototype.createAnimation=function(){this.hasAnimation()&&(this.createAnimationDom(),this.pageAnimation=this.factory.createAttachment("animation",this.$animation,this.width,this.height,this.pageIndex,this.parent,this.bookType,this.page,function(){this.callback();this.onResizeAnimation(this.width,this.height,this.pageWidth,this.pageHeight)}.bind(this)),this.Items.add(this.pageAnimation))}; IssuuPageAttachmentsParser.prototype.createAnimationDom=function(){this.$animation||(this.$animation=$("
"),this.$animation.css({width:this.width+"px",height:this.height+"px"}),this.parent.append(this.$animation))}; IssuuPageAttachmentsParser.prototype.hasAnimation=function(){var b=this.pageIndex-1;return this.isHiddenEditor()?!1:global.pageEditor&&(!pageEditor.pageAnnos&&pageEditor[b]&&0"),this.$select.css({width:this.width+"px",height:this.height+"px",bottom:0,right:0,margin:"auto"}),this.pageSelect=this.factory.createAttachment("select",this.$select,this.width,this.height,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageSelect),this.parent.append(this.$select))}; IssuuPageAttachmentsParser.prototype.destroySelect=function(){this.Items.find("PageSelect").each(function(b){b.destroySelect()});this.Items.remove(this.pageSelect);this.$select=void 0;this.pageSelect=null}; IssuuPageAttachmentsParser.prototype.initMagnifierEvent=function(){this.pageMagnifier||(this.$magnifier=$("
"),this.$magnifier.css({width:this.width+"px",height:this.height+"px",bottom:0,right:0,margin:"auto"}),this.pageMagnifier=this.factory.createAttachment("magnifier",this.$magnifier,this.width,this.height,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageMagnifier), this.parent.append(this.$magnifier))};IssuuPageAttachmentsParser.prototype.destroyMagnifier=function(){this.Items.find("PageMagnifier").each(function(b){b.destroyMagnifier()});this.Items.remove(this.pageMagnifier);this.$magnifier=void 0;this.pageMagnifier=null};IssuuPageAttachmentsParser.prototype.addHistoryTexts=function(){this.Items.find("PageAnnotation").each(function(b){b.enterSide()})}; IssuuPageAttachmentsParser.prototype.highlightSearch=function(){if(bookConfig.SearchButtonVisible&&window.frmSearch&&!this.pageHighlight){var b=!0;window.frmSearch&&frmSearch.visible&&0"),this.$highlight.css({width:this.width+ "px",height:this.height+"px",bottom:0,right:0,margin:"auto"}),this.pageHighlight=this.factory.createAttachment("highlight",this.$highlight,this.width,this.height,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageHighlight),this.parent.append(this.$highlight))}};IssuuPageAttachmentsParser.prototype.clearHighlight=function(){this.Items.find("PageHighlight").each(function(b){b.clearHighlight()});this.Items.remove(this.pageHighlight);this.$highlight=void 0;this.pageHighlight=null}; IssuuPageAttachmentsParser.prototype.createAnnotation=function(){bookConfig.AnnotationButtonVisible&&!this.pageAnnotation&&(this.createAnimationDom(),this.$annotation=this.$animation,this.pageAnnotation=this.factory.createAttachment("annotation",this.$annotation,this.pageWidth,this.pageHeight,this.pageIndex,this.parent,this.bookType),this.Items.add(this.pageAnnotation),this.onResizeAnimation(this.width,this.height,this.pageWidth,this.pageHeight))};IssuuPageAttachmentsParser.prototype.enterSide=function(){this.Items.each(function(b){b.enterSide()})}; IssuuPageAttachmentsParser.prototype.leaveSide=function(){this.Items.each(function(b){b.leaveSide()});this.destroySelect();global.annotationPannel&&global.annotationPannel.resetAnnoConfig()};IssuuPageAttachmentsParser.prototype.pauseAnimation=function(){this.Items.find("PageAnimation").each(function(b){b.pauseAnimation()})};IssuuPageAttachmentsParser.prototype.startAnimation=function(){this.Items.find("PageAnimation").each(function(b){b.startAnimation()})}; IssuuPageAttachmentsParser.prototype.resetSlider=function(){this.Items.find("PageAnimation").each(function(b){b.resetSlider()})};IssuuPageAttachmentsParser.prototype.destroySlider=function(){this.Items.find("PageAnimation").each(function(b){b.destroySlider()})};IssuuPageAttachmentsParser.prototype.initReaderOrSlider=function(){this.Items.each(function(b){b.initReaderOrSlider&&b.initReaderOrSlider()})};IssuuPageAttachmentsParser.prototype.removeAttachment=function(){this.attachment&&this.destroyMM()}; IssuuPageAttachmentsParser.prototype.onResize=function(b,c,d,e){this.width=b;this.height=c;this.pageWidth=d;this.pageHeight=e;this.onResizeAnimation(b,c,d,e);this.onResizeAnnotation(b,c,d,e);this.$select&&this.$select.css({width:this.width+"px",height:this.height+"px"});this.$magnifier&&this.$magnifier.css({width:this.width+"px",height:this.height+"px"});this.$highlight&&this.$highlight.css({width:this.width+"px",height:this.height+"px"});this.Items.each(function(f){if(f!=this.pageAnimation&&f!=this.pageAnnotation)f.onResize(b, c)}.bind(this))};IssuuPageAttachmentsParser.prototype.onResizeAnimation=function(b,c,d,e){this.pageAnimation&&(this.$animation.css({width:d+"px",height:e+"px",left:"0px",top:"0px"}),this.pageAnimation.onResize(d,e))};IssuuPageAttachmentsParser.prototype.onResizeAnnotation=function(b,c,d,e){this.pageAnnotation&&(this.$annotation.css({width:d+"px",height:e+"px",left:"0px",top:"0px"}),this.pageAnnotation.onResize(d,e))}; IssuuPageAttachmentsParser.prototype.resizeOnMobile=function(){var b=1024,c=1024;BookInfo.isDoublePage()&&this.bookType==BookType.normal_book&&(c=b=768);b=fitPageWidthHeight(b,c,this.pageWidth,this.pageHeight);this.pageAnimation.onResize(Math.ceil(b.x),Math.ceil(b.y));this.scale(Math.ceil(b.x),Math.ceil(b.y))}; IssuuPageAttachmentsParser.prototype.highDefinition=function(){var b=6*Math.min(windowWidth,windowHeight),c=6*Math.min(windowWidth,windowHeight);isPad()&&(b=3*Math.min(windowWidth,windowHeight),c=3*Math.min(windowWidth,windowHeight));b=fitPageWidthHeight(b,c,this.pageWidth,this.pageHeight);this.pageAnimation.onResize(Math.ceil(b.x),Math.ceil(b.y));this.scale(Math.ceil(b.x),Math.ceil(b.y))}; IssuuPageAttachmentsParser.prototype.scale=function(b,c){var d=fitPageWidthHeight(this.pageWidth,this.pageHeight,this.pageWidth,this.pageHeight).y/c;this.$animation.css({width:b+"px",height:c+"px",left:(this.pageWidth-b*d)/2+"px",top:(this.pageHeight-c*d)/2+"px"});b=!1;if(isPhone()||isPad())b=!0;d=transformCSS({scale:d,origin:{x:0,y:0}},b);this.$animation.css(d)}; var IssuuImageArrayLoadImage=Class({index:0,type:0,pageWidth:0,pageHeight:0,width:0,height:0,$image:null,imageURL:"",isMirrorSide:"",create:function(b,c,d,e,f,g,h,k,l){var n=this,p,q;return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){n.index=b;n.type=d;n.i=l;n.callback=e;n.errorCallback=f;n.pageWidth=g;n.pageHeight=h;n.isMirrorSide=k;p=c;bookConfig.useTheAliCloudChart&&BookInfo.getBook().status_zoom&&(p=p.removeStartFrom("?"));n.imageURL=p;n.imageObject=new ImageObject;n.imageObject.alt(n.index); n.imageObject.src(n.imageURL);n.imageObject.css({"z-index":0});n.$image=n.imageObject.$image;bookConfig.EnableRecognizeQRcodePressOnMobile&&n.imageObject.css({"-webkit-touch-callout":"default"});n.loaded=!1;n.$image[0].onload=function(){this.loaded=!0;this.callback&&this.callback(this.$image);this.width=this.$image[0].naturalWidth;this.height=this.$image[0].naturalHeight;this.onResize(this.pageWidth,this.pageHeight)}.bind(n);n.$image[0].onerror=function(){this.loaded=!0;this.errorCallback&&this.errorCallback(this.$image)}.bind(n); bookConfig.textSharpening&&(q="-webkit-optimize-contrast",_agent_.browser.firefox&&(q="-moz-crisp-edges"),_agent_.browser.opera&&(q="-o-crisp-edges"),n.$image.css({"image-rendering":q,"-ms-interpolation-mode":"nearest-neighbor"}));B.jumpToEnd()})},zoomIn:function(b){bookConfig.useTheAliCloudChart&&isPC()?this.switchLargeImage(b):(isPhone()||isPad())&&this.highDefinition()},zoomOut:function(b,c){bookConfig.useTheAliCloudChart&&isPC()?this.switchNormalImage(b,c):(isPhone()||isPad())&&this.resize()}, onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;if((isPhone()||isPad())&&!this.isMirrorSide&&BookInfo.getBook().status_zoom)this.highDefinition();else{this.imageObject.css({width:"100%",height:"100%",position:"absolute",top:0,left:0});b=!1;if(isPhone()||isPad())b=!0;b=transformCSS({scale:1,origin:{x:0,y:0}},b);this.imageObject.css(b)}},resize:function(){this.imageObject.css({width:"100%",height:"100%",position:"absolute",top:0,left:0});var b=!1;if(isPhone()||isPad())b=!0;b=transformCSS({scale:1, origin:{x:0,y:0}},b);this.imageObject.css(b)},highDefinition:function(){this.scale(this.width,this.height)},scale:function(b,c){var d=this.parent.width();var e=this.parent.height()/c;d/=b;this.imageObject.css({width:b+"px",height:c+"px",position:"absolute",left:0,bottom:"auto",top:0,right:"auto"});b=!1;if(isPhone()||isPad())b=!0;e=transformCSS({scale:{x:d,y:e},origin:{x:0,y:0}},b);this.imageObject.css(e)},switchLargeImage:function(b){if(bookConfig.useTheAliCloudChart){b=this.imageURL.removeStartFrom("?"); window.isSupportWebp?0>b.indexOf("webp")?b+="?x-oss-process=image/format,webp":bookConfig.textClarityEnhancement&&(b+="?x-oss-process=image"):b+="?x-oss-process=image/format,"+getWebpOriginFormat(b);switch(bookConfig.textClarityEnhancement){case 1:b+="/sharpen,100";break;case 2:b+="/sharpen,150";break;case 3:b+="/sharpen,200"}this.loaded&&(this.callback=void 0);this.imageObject.attr("src",b)}},switchNormalImage:function(b,c){var d=this,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){if(1== f.nextAddress)return bookConfig.useTheAliCloudChart?b?f.yield(getPageDir(d.index,"normal",originTotalPageCount)[d.i],3):f.jumpTo(2):f.return();if(2!=f.nextAddress){e=f.yieldResult;if(!e||e==d.imageURL)return f.return();d.imageURL=e}d.loaded&&(d.callback=void 0);d.imageObject.attr("src",d.imageURL);f.jumpToEnd()})},destroy:function(){this.imageObject.destroy()}}),IssuuImageArrayLoadSvg=Class({index:0,type:0,pageWidth:0,pageHeight:0,width:0,height:0,$image:null,imageURL:"",isMirrorSide:"",create:function(b, c,d,e,f,g,h,k,l){var n=this,p;return $jscomp.asyncExecutePromiseGeneratorProgram(function(q){n.index=b;n.type=d;n.i=l;n.callback=e;n.errorCallback=f;n.pageWidth=g;n.pageHeight=h;n.isMirrorSide=k;p=c;bookConfig.useTheAliCloudChart&&!bookConfig.isEncryptionBook&&(p=p.removeStartFrom("?"));n.imageURL=p;n.$image=$("");bookConfig.EnableRecognizeQRcodePressOnMobile&&n.$image.css({"-webkit-touch-callout":"default"});n.$image[0].onload=function(){this.callback&& this.callback(this.$image);this.width=this.$image[0].naturalWidth;this.height=this.$image[0].naturalHeight;this.onResize(this.pageWidth,this.pageHeight)}.bind(n);n.$image[0].onerror=function(){this.errorCallback&&this.errorCallback(this.$image)}.bind(n);q.jumpToEnd()})},zoomIn:function(b){},zoomOut:function(b,c){},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.$image.css({width:"100%",height:"100%",position:"absolute",top:0,left:0});b=!1;if(isPhone()||isPad())b=!0;b=transformCSS({scale:1, origin:{x:0,y:0}},b);_agent_.system.name!=_agent_.system.ANDROID&&this.$image.css(b)},scale:function(b,c){var d=this.parent.width();var e=this.parent.height()/c;d/=b;this.$image.css({width:b+"px",height:c+"px",position:"absolute",left:0,bottom:"auto",top:0,right:"auto"});b=!1;if(isPhone()||isPad())b=!0;e=transformCSS({scale:{x:d,y:e},origin:{x:0,y:0}},b);this.$image.css(e)},destroy:function(){this.$image=this.$image[0].onload=null},resizeSvg:function(b,c){if(isPhone()||isPad())b=fitPageWidthHeight(b, c,this.width,this.height),this.scale(b.x,b.y)}}),IssuuImageArrayLoad=Class({index:0,type:0,pageWidth:0,pageHeight:0,width:0,height:0,$image:null,imageURL:"",isMirrorSide:"",create:function(b,c,d,e,f,g){var h=this,k,l,n,p,q,B;return $jscomp.asyncExecutePromiseGeneratorProgram(function(v){if(1==v.nextAddress)return h.index=b,h.type=c,h.pageWidth=e,h.pageHeight=f,h.isMirrorSide=g,h.callback=d,h.$images=[],h.loadArray=[],v.yield(getPageDir(b,c,originTotalPageCount),2);k=v.yieldResult;h.imagesURL=k;l= 0;n=function(){l++;this.callback&&l==k.length&&this.callback(k,k,this.$images,this.index)}.bind(h);p=function(u){l++;this.$images.removeElement(u);this.callback&&l==k.length&&this.callback(k,k,this.$images,this.index)}.bind(h);for(q=0;q1.25*this.pageWidth&&this.height>1.25*this.pageHeight)||!0!==bookConfig.canvasRender&&"true"!==bookConfig.canvasRender||isPhone()||isPad())this.width=this.$image[0].naturalWidth,this.height=this.$image[0].naturalHeight,this.callback&&this.callback(this.realImageURL,this.realImageURL,this.$image[0],this.index),this.onResize(); else try{this.canvasDom=document.createElement("canvas");this.canvasDom.setAttribute("id","pageCanvas");this.canvasDom.setAttribute("width",this.width);this.canvasDom.setAttribute("height",this.height);var b=this.canvasDom.getContext("2d");b.width=this.width;b.height=this.height;b.drawImage(this.$image[0],0,0);canvasReload(this.canvasDom,this.pageWidth,this.pageHeight,!0);this.callback&&this.callback(this.realImageURL,this.realImageURL,this.canvasDom,this.index)}catch(c){this.width=this.$image[0].naturalWidth, this.height=this.$image[0].naturalHeight,this.callback&&this.callback(this.realImageURL,this.realImageURL,this.$image[0],this.index),this.onResize()}},enableRecognizeQRcode:function(){bookConfig.EnableRecognizeQRcodePressOnMobile&&this.setImageCss({"-webkit-touch-callout":"default"})},setTextSharpening:function(){if(bookConfig.textSharpening){var b="-webkit-optimize-contrast";_agent_.browser.firefox&&(b="-moz-crisp-edges");_agent_.browser.opera&&(b="-o-crisp-edges");this.setImageCss({"image-rendering":b, "-ms-interpolation-mode":"nearest-neighbor"})}},zoomIn:function(b){bookConfig.useTheAliCloudChart&&this.switchLargeImage(b);isPhone()||isPad()?this.highDefinition():_agent_.browser.safari&&this.$image.css("image-rendering","auto")},zoomOut:function(b,c){bookConfig.useTheAliCloudChart&&this.switchNormalImage(b,c);isPhone()||isPad()?this.resize():_agent_.browser.safari&&this.$image.css("image-rendering","-webkit-optimize-contrast")},onResize:function(b,c){try{if(!(!0!==bookConfig.canvasRender&&"true"!== bookConfig.canvasRender||isPhone()||isPad())&&this.canvasDom){this.pageWidth=b;this.pageHeight=c;this.canvasDom.setAttribute("width",this.width);this.canvasDom.setAttribute("height",this.height);var d=this.canvasDom.getContext("2d");d.width=this.width;d.width=this.height;d.drawImage(this.$image[0],0,0);canvasReload(this.canvasDom,this.pageWidth,this.pageHeight,!0);return}}catch(e){console.log("this function cross-domain !")}b&&c&&(this.pageWidth=b,this.pageHeight=c);if((isPhone()||isPad())&&!this.isMirrorSide&& BookInfo.getBook().status_zoom)this.highDefinition();else{this.setImageCss({width:"100%",height:"100%",position:"absolute",top:0,left:0});b=!1;if(isPhone()||isPad())b=!0;b=transformCSS({scale:1,origin:{x:0,y:0}},b);this.setImageCss(b)}},resize:function(){this.setImageCss({width:"100%",height:"100%",position:"absolute",top:0,left:0});var b=!1;if(isPhone()||isPad())b=!0;b=transformCSS({scale:1,origin:{x:0,y:0}},b);this.setImageCss(b)},highDefinition:function(){this.scale(this.width,this.height)},scale:function(b, c){var d=this.parent.width();var e=this.parent.height()/c;d/=b;this.setImageCss({width:b+"px",height:c+"px",position:"absolute",left:0,bottom:"auto",top:0,right:"auto"});b=!1;if(isPhone()||isPad())b=!0;e=transformCSS({scale:{x:d,y:e},origin:{x:0,y:0}},b);this.setImageCss(e)},switchLargeImage:function(b){if(bookConfig.useTheAliCloudChart){var c=this.imageURL.removeStartFrom("?");window.isSupportWebp?0>c.indexOf("webp")?c+="?x-oss-process=image/format,webp":bookConfig.textClarityEnhancement&&(c+="?x-oss-process=image"): c+="?x-oss-process=image/format,"+getWebpOriginFormat(c);switch(bookConfig.textClarityEnhancement){case 1:c+="/sharpen,100";break;case 2:c+="/sharpen,150";break;case 3:c+="/sharpen,200"}if(isPhone()||isPad())if(this.largeImageObject)this.largeImageObject&&this.largeImageObject.show();else{this.largeImageObject=new ImageObject;this.largeImageObject.attr("id",this.id);this.largeImageObject.alt(this.id);this.largeImageObject.src(c);var d=this.largeImageObject.$image;bookConfig.isStopMouseMenu&&$(d).css({"pointer-events":"none"}); d[0].onload=function(){this.onResize();this.parent.append(d)}.bind(this)}else b&&(this.callback=b),this.imageObject.attr("src",c)}},switchNormalImage:function(b,c){var d=this,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){if(1==f.nextAddress)return bookConfig.useTheAliCloudChart?b?f.yield(getPageDir(d.index,"normal",originTotalPageCount),3):f.jumpTo(2):f.return();if(2!=f.nextAddress){e=f.yieldResult;if(e==d.imageURL)return f.return();d.imageURL=e}isPhone()||isPad()?d.largeImageObject&& d.largeImageObject.hide():(c&&(d.callback=c),d.imageObject.attr("src",d.imageURL));f.jumpToEnd()})},setImageCss:function(b){this.imageObject&&this.imageObject.css(b);this.largeImageObject&&this.largeImageObject.css(b)}}),IssuuPdfLoad=Class({index:0,pageWidth:0,pageHeight:0,create:function(b,c,d,e,f,g,h){var k=this,l,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){if(1==p.nextAddress)return k.index=b,k.type=c,k.pageWidth=e,k.pageHeight=f,k.renderWidth=e,k.renderHeight=f,k.callback= d,k.parent=h,l=k,p.yield(getPageDir(b,c,originTotalPageCount),2);if(3!=p.nextAddress)return l.imageURL=p.yieldResult,n=k,p.yield(getPageDir(b,"thumb",originTotalPageCount),3);n.thumbUrl=p.yieldResult;k.$content=$("
");k.pdfLoadingTask=new PdfLoadingTask(k.index,k.type,e,f,k.loaded.bind(k));window.pdfLoadStack||(window.pdfLoadStack=new PdfLoadArray(3));window.pdfLoadStack&&pdfLoadStack.push(k.pdfLoadingTask);p.jumpToEnd()})}, enterSide:function(){this.enter=!0},leaveSide:function(){this.enter=!1;this.pdfLoadingTask&&this.pdfLoadingTask.leaveSide()},zoomIn:function(){isPhone()||isPad()},zoomOut:function(){isPhone()||isPad()},onResize:function(b,c){var d={width:"100%",height:"100%",position:"absolute",top:0,left:0};this.$canvas&&this.$canvas.css(d);this.$content&&this.$content.css(d);window.pdfLoadStack&&(isPC()||isSlideBook()||0<=BookInfo.getCurrentPages().indexOf(this.index)||bookConfig.upsideOnMobile())&&this.pdfLoadingTask&& (this.pdfLoadingTask.changeRenderWH(b,c),pdfLoadStack.push(this.pdfLoadingTask))},loaded:function(b){this.pdfLoaded=!0;this.changeImageSrc(b)},changeImageSrc:function(b){this.pdfLoaded&&(this.width=parseFloat(b.style.width),this.height=parseFloat(b.style.height),this.$canvas=$(b),this.$content.empty().append(this.$canvas),this.callback&&this.callback(this.imageURL,this.imageURL,this.$content,this.index),this.resizeImage())},resizeImage:function(){if(this.zoom)b=this.renderWidth,c=this.renderHeight; else{var b=this.parent.width(),c=this.parent.height();this.pageWidth=b;this.pageHeight=c;this.renderWidth=b;this.renderHeight=c}var d={width:"100%",height:"100%",position:"absolute",top:0,left:0};2>=b-this.width&&(d.width=this.width+"px",d.left=Math.round((b-this.width)/2)+"px");2>=c-this.height&&(d.height=this.height+"px",d.top=Math.round((c-this.height)/2)+"px");this.$canvas.css(d);d=b-this.width;var e=c-this.height;(0!==d||0!==e)&&4>=d&&4>=e&&(this.$thumb||(this.$thumb=$('')),this.$content.append(this.$thumb));d=transformCSS({scaleX:this.pageWidth/b,scaleY:this.pageHeight/c,origin:{x:0,y:0}},!1);this.$content.css(d);this.$content.css({width:b+"px",height:c+"px"})},resizeSvg:function(b,c){this.renderWidth=b;this.renderHeight=c;this.zoom=this.renderHeight>this.pageHeight?!0:!1;window.pdfLoadStack&&(isPC()||isSlideBook()||0<=BookInfo.getCurrentPages().indexOf(this.index))&&(this.pdfLoadingTask.changeRenderWH(b, c),pdfLoadStack.push(this.pdfLoadingTask))},destroy:function(){this.pdfLoadingTask&&(window.pdfLoadStack&&pdfLoadStack.pop(this.pdfLoadingTask),this.pdfLoadingTask.destroy(),this.pdfLoadingTask=null)}}),IsuuPageBackground=Class({create:function(b,c,d,e,f,g,h){var k=this,l,n,p;return $jscomp.asyncExecutePromiseGeneratorProgram(function(q){if(1==q.nextAddress){if(!b||!c)return q.return();k.type=c;k.pageWidth=e;k.pageHeight=f;return q.yield(getPageDir(b,c,originTotalPageCount),2)}l=q.yieldResult;n=getPageSize(b, c);k.imageURL=l;k.load=null;k.parent=h;p=k.getUrlType(l,n);k.urlType=p;switch(p){case 0:k.load=new CanvasLoad(b,c,d,k.pageWidth,k.pageHeight,g,h);break;case 1:k.load=new IssuuImageLoad(b,c,d,k.pageWidth,k.pageHeight,g,h);break;case 2:k.load=new JsLoad(b,c,d,k.pageWidth,k.pageHeight,g,h);break;case 3:k.load=new SvgLoad(b,c,d,k.pageWidth,k.pageHeight,g,h);break;case 4:k.load=new IssuuImageArrayLoad(b,c,d,k.pageWidth,k.pageHeight,g,h);break;case 5:k.load=new IssuuPdfLoad(b,c,d,k.pageWidth,k.pageHeight, g,h);break;case 6:k.load=new ImageStageLoad(b,c,d,k.pageWidth,k.pageHeight,g,h);break;case 7:k.load=new NoneLoad(b,c,d,k.pageWidth,k.pageHeight,g,h)}q.jumpToEnd()})},getUrlType:function(b,c){return this.isPdf(b)?5:c&&isPC()?6:"object"==typeof b?4:"normal"==this.type&&bookConfig.usePdfJs?0:-1");bookConfig.FlipDirection?(this.flipBackShadow=$("
"),this.flipFrontShadow=$("
")):(this.flipBackShadow=$("
"),this.flipFrontShadow=$("
")); this.flipShadowContent.append(this.flipBackShadow);this.flipShadowContent.append(this.flipFrontShadow);this.parent.append(this.flipShadowContent)},setCSSByStyle:function(b){this.flipShadowContent.css(b)},flip:function(b,c,d){var e=b.shadowRate;d=b.rotate;var f=.9e?.2*e/.1:.2;if(bookConfig.FlipDirection){var g=transformCSS({scaleY:f,rotate:-d,tran:{x:0,y:(b.frontShadowDistance-100*(90b?100/3:100*(this.width+this.maskWidth)/(3*this.maskWidth),b=90b?100*(this.height+this.maskWidth)/(3*this.maskWidth):100/3);this.flipFrontShadow.css({"transform-origin":c+"% "+b+"%","-webkit-transform-origin":c+"% "+b+"%","-moz-transform-origin":c+"% "+b+"%","-ms-transform-origin":c+"% "+b+"%"})},clear:function(){this.flipBackShadow&&this.flipBackShadow.css({visibility:"hidden"});this.flipFrontShadow&&this.flipFrontShadow.css({visibility:"hidden"})}, resize:function(b,c){this.width=b;this.height=c;this.maskWidth=parseInt(Math.sqrt(Math.pow(b,2)+Math.pow(c,2)));bookConfig.FlipDirection?(this.flipFrontShadow.css({width:3*this.maskWidth,left:-this.maskWidth}),this.flipBackShadow.css({width:this.maskWidth,left:(this.width-this.maskWidth)/2})):(this.flipFrontShadow.css({height:3*this.maskWidth,top:-this.maskWidth}),this.flipBackShadow.css({height:this.maskWidth,top:(this.height-this.maskWidth)/2}))}}); HardPageFlipShadow=Class({init:function(){this._super();var b=Color(bookConfig.thicknessColor);this.flipThickWidth=getMaxThicknessWidth()/5;this.flipThick=bookConfig.FlipDirection?$("
"):$("
");this.flipThick.css({background:b.reduce(50)});this.parent.append(this.flipThick)},flip:function(b,c){var d=b.shadowRate?b.shadowRate:0;d=.5>d?2*d:2*(1-d);var e={"background-image":"none","box-shadow":"rgba(0,0,0,0.3) 0 0 2000px 5000px inset", width:"100%",height:"100%",top:0,left:0};this.flipFrontShadow.css(e);this.flipFrontShadow.css({opacity:d});this.flipBackShadow.css(e);this.flipBackShadow.css({opacity:d});b=bookConfig.FlipDirection?transformCSS({perspective:5E3,rotateX:-b.rotate,scaleY:this.flipThickWidth/6*d}):transformCSS({perspective:5E3,rotateY:-b.rotate,scaleX:this.flipThickWidth/6*d});this.flipThick.css(b);c?(this.flipBackShadow&&this.flipBackShadow.css({visibility:"hidden"}),this.flipFrontShadow&&this.flipFrontShadow.css({visibility:"visible"})): (this.flipBackShadow&&this.flipBackShadow.css({visibility:"visible"}),this.flipFrontShadow&&this.flipFrontShadow.css({visibility:"hidden"}));this.flipThick&&this.flipThick.css({visibility:"visible"})}}).extend(PageFlipShadow); var IssuuPageHighlightsFlipShadow=Class({create:function(b,c){this.parent=b;this.pageIndex=c;this.init()},init:function(){this.flipShadowContent=$("
");bookConfig.FlipDirection?(this.flipBackShadow=$("
"),this.flipFrontShadow=$("
"),this.flipFrontHighlightShadow=$("
"), this.flipFrontEdgeShadow=$("
"),this.flipFrontTopHighlightShadow=$("
")):(this.flipBackShadow=$("
"),this.flipFrontShadow=$("
"),this.flipFrontHighlightShadow=$("
"),this.flipFrontEdgeShadow=$("
"),this.flipFrontTopHighlightShadow=$("
")); this.flipShadowContent.append(this.flipBackShadow);this.flipShadowContent.append(this.flipFrontShadow);this.flipShadowContent.append(this.flipFrontEdgeShadow);this.flipShadowContent.append(this.flipFrontHighlightShadow);this.flipShadowContent.append(this.flipFrontTopHighlightShadow);this.parent.append(this.flipShadowContent)},setCSSByStyle:function(b){this.flipShadowContent.css(b)},flip:function(b,c,d){var e=b.shadowRate;d=b.rotate;var f=.9e?1*e/.1:1;var g= 1,h=(b.frontShadowDistance-(90=b.frontShadowDistance&&(g=b.frontShadowDistance/21,l=(b.frontShadowDistance-(90b?100/3:100*(this.width+this.maskWidth)/(3*this.maskWidth),b=90b?100*(this.height+this.maskWidth)/(3*this.maskWidth):100/3);d["transform-origin"]=c+"% "+b+"%";d["-webkit-transform-origin"]=c+"% "+b+"%";d["-moz-transform-origin"]=c+"% "+b+"%";d["-ms-transform-origin"]= c+"% "+b+"%";this.flipFrontShadow.css(d);this.flipFrontHighlightShadow.css(d);this.flipFrontEdgeShadow.css(d);this.flipFrontTopHighlightShadow.css(d)},clear:function(){this.flipBackShadow&&this.flipBackShadow.css({visibility:"hidden"});this.flipFrontShadow&&this.flipFrontShadow.css({visibility:"hidden"});this.flipFrontHighlightShadow&&this.flipFrontHighlightShadow.css({visibility:"hidden"});this.flipFrontEdgeShadow&&this.flipFrontEdgeShadow.css({visibility:"hidden"});this.flipFrontTopHighlightShadow&& this.flipFrontTopHighlightShadow.css({visibility:"hidden"})},resize:function(b,c){this.width=b;this.height=c;this.maskWidth=parseInt(Math.sqrt(Math.pow(b,2)+Math.pow(c,2)));bookConfig.FlipDirection?(this.flipFrontShadow.css({width:3*this.maskWidth,left:-this.maskWidth}),this.flipFrontTopHighlightShadow.css({width:3*this.maskWidth,left:-this.maskWidth}),this.flipFrontEdgeShadow.css({width:3*this.maskWidth,left:-this.maskWidth}),this.flipFrontHighlightShadow.css({width:3*this.maskWidth,left:-this.maskWidth}), this.flipBackShadow.css({width:this.maskWidth,left:(this.width-this.maskWidth)/2})):(this.flipFrontTopHighlightShadow.css({height:3*this.maskWidth,top:-this.maskWidth}),this.flipFrontEdgeShadow.css({height:3*this.maskWidth,top:-this.maskWidth}),this.flipFrontHighlightShadow.css({height:3*this.maskWidth,top:-this.maskWidth}),this.flipFrontShadow.css({height:3*this.maskWidth,top:-this.maskWidth}),this.flipBackShadow.css({height:this.maskWidth,top:(this.height-this.maskWidth)/2}))}}),IssuuFlipBookIntervalManager= Class({create:function(b){this.book=b;this.flippingTime=1E3*bookConfig.flippingTime},flipIntervalTmp:function(b,c,d,e){if(b){this.book.flipping=!0;b.flipping=!0;var f=.05;if(isIE()||isFirefox())f=0;b.setFlipOriginPoint(e);b.coordinate||(b.coordinate=b.startPoint);var g=b.coordinate.x,h=b.coordinate.y,k,l=this.flippingTime;l=l*Math.abs(b.toPoint.x-g)/Math.abs(b.toPoint.x-b.startPoint.x);e=isAndroidWeChat()||isAndroidDefault()||isIE()||isFirefox()?function(){var p=0;k=function(){n(p,25,"Sine");p++}.interval(this, l/25)}.bind(this):function(){k=function(p,q){n(p,q,"Sine")}.animation(this,l)}.bind(this);var n=function(p,q,B){if(!b)return!1;var v=b.pageWidth,u=b.pageHeight,w=$.easing["easeInOut"+B],x=$.easing["easeOut"+B];B=x(null,p,g,b.toPoint.x-g,q);x=x(null,p,h,b.toPoint.y-h,q);b.dragMoveToFlip||(B=w(null,p,g,b.toPoint.x-g,q),x=bookConfig.FlipDirection?f*Math.sqrt(u*u-B*B):u-f*Math.sqrt(v*v-B*B));pMath.abs(f.toFixed(2)-this.flipPageManager[c].toPoint.x)&&1>Math.abs(d.toFixed(2)-this.flipPageManager[c].toPoint.y)||isNaN(f)||isNaN(d))&&(this.flipPageManager[c].Alice=!1,f=this.flipPageManager[c].toPoint.x, d=this.flipPageManager[c].toPoint.y,this.flipIntervalManager.flipToPoint(this.flipPageManager[c],e,g,this.flipPageManager[c].fromPoint,{x:f,y:d}),this.flipPageManager[c].endFlipByIndex(0>this.flipPageManager[c].toPoint.x),this.flipPageManager.removeFlipArrayByIndex(this.flipPageManager[c]),this.afterCurling(),b--)}}}else this.flipIntervalManager.flipInterval.stop=!0,this.flipIntervalManager.flipInterval=void 0;this.flipIntervalManager.flipInterval&&(isAndroidWeChat()||isAndroidDefault()||isIE()|| isFirefox()?window.setTimeout(this.flipIntervalManager.flipInterval,30):window.requestAnimationFrame(this.flipIntervalManager.flipInterval))}}.bind(this.book);this.flipInterval()},flipToPoint:function(b,c,d,e,f,g){b&&b.flipToPoint(e,f,g);c=Math.abs(f.x-e.x)*this.book.width/(2*b.pageWidth);(!this.book.movedLength||Math.abs(this.book.movedLength)>c||!b.loosen||b.flipping)&&this.book.movetoCenter(b.currentIndex,b.nextIndex,c)},endFlip:function(){},destroy:function(){}}),IssuuFlipPage=Class({downMask:null, upMask:null,currentIndex:0,nextIndex:0,hardPage:!1,coverPage:!1,coordinate:null,startPoint:null,toPoint:null,fromPoint:null,AliceToLeft:!1,AliceToRight:!1,loosen:!0,flipping:!1,dragMoveToFlip:!1,fallback:!1,pageWidth:0,pageHeight:0,maskWidth:0,create:function(b){this.book=b},startToFlip:function(){this.loosen=this.flipping=!0;this.fallback=this.AliceToRight=this.AliceToLeft=!1},meetFlipCondition:function(){var b=this.toPoint&&this.startPoint&&(this.book.mouseMoveDirection==this.book.moveDirectionType.MOVE_LEFT&& 0this.startPoint.x);return this.toPoint&&this.startPoint&&(this.toPoint.xthis.book.MiddleX&&0>this.startPoint.x)||b},flipToPoint:function(b,c,d){if(b&&c)if(1==this.hardPage)this.flipToHardPoint(b,c);else if(this.downMask&&this.upMask&&this.downMask.page&&this.upMask.page){this.coordinate=c;var e=this.downMask.pageWidth,f=computePoint(e,this.downMask.pageHeight, this.downMask.maskWidth,b,c);if(f){var g=transformCSS({rotate:f.rotate,tran:{x:f.maskTranX,y:f.maskTranY}}),h=transformCSS({rotate:f.rotate,tran:{x:f.maskTranX,y:f.maskTranY}}),k=transformCSS({rotate:-f.rotate,tran:{x:-f.pageTranX,y:0}}),l=transformCSS({rotate:f.rotate,tran:{x:f.pageTranX,y:0}});this.downMask&&this.downMask.setMaskCSSByStyle(g);this.upMask&&this.upMask.setMaskCSSByStyle(h);this.downMask&&this.downMask.page&&this.downMask.page.setCSSByStyle(k);this.upMask&&this.upMask.page&&this.upMask.page.setCSSByStyle(l); this.setFlipAlpha(e,b,c);this.setFlipShadow(f,d);this.book.followToPoint(this,b,c)}}},flipToHardPoint:function(b,c){if(b&&c){var d=this.pageWidth,e=this.pageHeight,f=this.maskWidth;c.x>d&&(c.x=d);c.x<-d&&(c.x=-d);this.coordinate=c;if(e=computePoint(d,e,f,b,c)){f=-90+90*Math.abs(c.x/b.x);0>c.x&&(f=90-90*Math.abs(c.x/b.x));var g,h;transformCSS({perspective:6E3,rotateY:f,scale:null!=(h=null==(g=this.downMask)?void 0:g.scale)?h:1});var k,l;transformCSS({perspective:6E3,rotateY:f,scale:null!=(l=null== (k=this.upMask)?void 0:k.scale)?l:1});e.rotate=f;this.downMask.rotateY=f;this.upMask.rotateY=f;0>c.x/b.x?this.setPagesVisible(!1):this.setPagesVisible(!0);this.setHardFlipShadow(e);this.setFlipAlpha(d,b,c);this.book.followToPoint(this,b,c)}}},setPagesVisible:function(b){},setHardFlipShadow:function(b){b&&(this.upMask&&this.upMask.setFlipShadow(b,!0),this.downMask&&this.downMask.setFlipShadow(b,!1))},setFlipAlpha:function(b,c,d){},setFlipShadow:function(b,c){b&&(this.upMask.page&&this.upMask.page.setFlipShadow(b, !0,c),this.nextPage&&!this.isMiniPage()&&this.nextPage.setFlipShadow(b,!1,c))},isMiniPage:function(){return!1},resetWidthHeight:function(){var b=this.getPageWidthHeight().width,c=this.getPageWidthHeight().height,d=parseInt(Math.sqrt(Math.pow(b,2)+Math.pow(c,2)));0!=(d-c)%2&&(d+=1);this.pageWidth=b;this.pageHeight=c;this.maskWidth=d},getPageWidthHeight:function(){if(this.downMask)return{width:this.downMask.pageWidth,height:this.downMask.pageHeight};if(this.upMask)return{width:this.upMask.pageWidth, height:this.upMask.pageHeight}},setPageZIndex:function(){},setFlipOriginPoint:function(){},endFlipByIndex:function(){},isDragMoveToFlip:function(){this.dragMoveToFlip=!1;this.coordinate&&this.startPoint&&this.coordinate.x!=this.startPoint.x&&(this.dragMoveToFlip=!0)},endFlip:function(){this.flipping=!1},destroy:function(){}}),IssuuDoubleFlipPage=Class({setPagesVisible:function(b){b?(this.upMask.setVisible(!1),this.downMask.setVisible(!0)):(this.upMask.setVisible(!0),this.downMask.setVisible(!1))}, setPageZIndex:function(b){var c=this.downMask.pageIndex,d=this.upMask.pageIndex,e=originTotalPageCount+5+d,f=originTotalPageCount+5-c;"min"==b.flipTo&&(e=2*originTotalPageCount+5-d);"min"==b.flipTo&&(f=5+c);if(bookConfig.HardPageEnable){if(d==totalPageCount||1==d)e=2*(bookConfig.totalPageCount+5)+10;if(c==totalPageCount||1==c)f=2*(bookConfig.totalPageCount+5)+10}this.upMask.setZIndex(e);this.downMask.setZIndex(f)},setFlipOriginPoint:function(b){this.dragMoveToFlip||"left"!=b||(this.fromPoint={x:this.downMask.pageWidth, y:this.downMask.pageHeight});this.dragMoveToFlip||"right"!=b||(this.fromPoint={x:-this.downMask.pageWidth,y:this.downMask.pageHeight});this.toPoint={x:-this.fromPoint.x,y:this.fromPoint.y};this.startPoint={x:this.fromPoint.x,y:this.fromPoint.y}},endFlipByIndex:function(b){var c=transformCSS({rotate:0,tran:{x:0,y:0}});this.upMask.clearTran();this.upMask.page&&this.upMask.page.setCSSByStyle(c);this.downMask.clearTran();this.downMask.page&&this.downMask.page.setCSSByStyle(c);b?(this.downMask.setLeftOrRight(!0), this.upMask.setLeftOrRight(!0)):(this.downMask.setLeftOrRight(!1),this.upMask.setLeftOrRight(!1));this.book.setZIndexByPageIndex(this.upMask);this.book.setZIndexByPageIndex(this.downMask);this.upMask.clearFlipShadow();this.downMask.clearFlipShadow()}}).extend(IssuuFlipPage),IssuuSingleFlipPage=Class({flipToHardPoint:function(b,c){if(b&&c){this.coordinate=c;var d=this.pageWidth,e=computePoint(d,this.pageHeight,this.maskWidth,b,c);if(e){var f=-90+90*Math.abs(c.x/b.x);0>c.x&&(f=90-90*Math.abs(c.x/b.x)); transformCSS({perspective:6E3,rotateY:f});transformCSS({perspective:6E3,rotateY:f});this.downMask.rotateY=f;this.upMask.rotateY=f;0>c.x/b.x?(this.upMask.setVisible(!1),this.downMask.setVisible(!1)):(this.upMask.setVisible(!1),this.downMask.setVisible(!0));this.setHardFlipShadow(e);this.setFlipAlpha(d,b,c);this.book.followToPoint(this,b,c)}}},setHardFlipShadow:function(b){b&&(this.upMask&&this.upMask.setFlipShadow(b,!0),this.downMask&&this.downMask.setFlipShadow(b,!1))},setPageZIndex:function(){var b= this.downMask.pageIndex,c=this.upMask.pageIndex,d=originTotalPageCount+5+c,e=originTotalPageCount+5-b;if(bookConfig.HardPageEnable){if(c==totalPageCount||1==c)d=2*(bookConfig.totalPageCount+5)+10;if(b==totalPageCount||1==b)e=2*(bookConfig.totalPageCount+5)+10}this.upMask.setZIndex(d);this.downMask.setZIndex(e)},setFlipAlpha:function(b,c,d){},setFlipOriginPoint:function(){this.dragMoveToFlip||rightToLeft||(this.fromPoint={x:this.pageWidth,y:this.pageHeight});!this.dragMoveToFlip&&rightToLeft&&(this.fromPoint= {x:-this.pageWidth,y:this.pageHeight});this.toPoint="left"==this.book.flipToDirection?{x:-this.pageWidth,y:this.fromPoint.y}:{x:this.pageWidth,y:this.fromPoint.y};this.startPoint||(this.startPoint={x:0,y:0});this.startPoint.x=-this.toPoint.x;this.startPoint.y=this.toPoint.y},endFlipByIndex:function(b){b=transformCSS({rotate:0,tran:{x:0,y:0}});this.upMask.clearTran();this.upMask.page&&this.upMask.page.setCSSByStyle(b);this.downMask.clearTran();this.downMask.page&&this.downMask.page.setCSSByStyle(b); this.upMask.setLeftOrRight(rightToLeft);this.downMask.setLeftOrRight(rightToLeft);this.book.setZIndexByPageIndex(this.upMask);this.book.setZIndexByPageIndex(this.downMask);this.upMask.clearFlipShadow();this.downMask.clearFlipShadow()}}).extend(IssuuFlipPage),IssuuFlipPageManager=Class({create:function(b){this.book=b;this.array=[];this.pinDownCurlingArray=[];this.fallbackArray=[];this.flipArray=[];this.zoomArray=[];this.resizeArray=[];this.hardFlipArray=[];this.softFlipArray=[];this.coverFlipArray= []},initFlipPageByIndex:function(b,c,d){if(this.book.isCoverPage(b,c))return this.initCoverFlipByIndex(b,c,d);if(this.book.isHardPage(b,c))return this.initHardFlipByIndex(b,c,d);d=this.book.getDownUpPage(b,c,d);var e=b+"-"+c;this[e]||(this[e]=this.book.newFlipPage());this[e].downMask=d[0];this[e].upMask=d[1];this[e].currentIndex=b;this[e].nextIndex=c;this[e].hardPage=!1;this[e].resetWidthHeight();0>this.array.indexOf(e)&&this.array.push(e);0>this.softFlipArray.indexOf(e)&&this.softFlipArray.push(e); return this[e]},initHardFlipByIndex:function(b,c,d){d=this.book.getDownUpHardPage(b,c,d);var e=b+"-"+c;this[e]||(this[e]=this.book.newFlipPage());this[e].downMask=d[0];this[e].upMask=d[1];this[e].currentIndex=b;this[e].nextIndex=c;this[e].hardPage=!0;this[e].resetWidthHeight();0>this.array.indexOf(e)&&this.array.push(e);0>this.hardFlipArray.indexOf(e)&&this.hardFlipArray.push(e);return this[e]},initCoverFlipByIndex:function(b,c,d){d=this.book.getDownUpHardPage(b,c,d);var e=b+"-"+c;this[e]||(this[e]= this.book.newFlipPage());this[e].downMask=d[0];this[e].upMask=d[1];this[e].currentIndex=b;this[e].nextIndex=c;this[e].hardPage=!0;this[e].coverPage=!0;this[e].resetWidthHeight();0>this.array.indexOf(e)&&this.array.push(e);0>this.coverFlipArray.indexOf(e)&&this.coverFlipArray.push(e);return this[e]},checkFlipping:function(){for(var b=this.array.length,c=0;cthis.book.currentPageIndex&&(c=!0);rightToLeft&&b=this.pinDownCurlingArray.length)return!1;c=this.book.getPagesByIndex(c);for(var d=this.pinDownCurlingArray.length,e=0;ec.indexOf(f.nextIndex))return!0}return!1},existMutexPages:function(b){return this.hardFlipArray&& 0=b||b>originTotalPageCount?!0:!1},beforeFlip:function(b, c){try{var d=this.book.beforeFlipTo(b,!0);this.isDragMoveToFlip(d);if(!d.dragMoveToFlip){var e=this.book.getFromStartPointByIndex(b,d);d.flipToPoint(e[0],e[1],!0)}var f=d.currentIndex+"-"+d.nextIndex;this.book.optionPage==f&&(this.book.optionPage=null);0this.flipArray.indexOf(f)&&this.flipArray.push(f);this.fallbackArray.removeElement(f);this.pinDownCurlingArray.removeElement(f);d.startToFlip();this.book.flipping=!0;return d}catch(g){}}, isDragMoveToFlip:function(b){b.dragMoveToFlip=!1;b.coordinate&&b.startPoint&&b.coordinate.x!=b.startPoint.x&&(b.dragMoveToFlip=!0)}}),IssuuSingleFlipBook=Class({pageBackArray:null,create:function(b){this.pageBackArray=[];this._super(b)},newFlipPage:function(){return new IssuuSingleFlipPage(this)},resetPages:function(b){isNaN(b)||0>=b||(this.unWrapPageBackExcludeArray([b,b+1]),this.unWrapPageExcludeArray([b,b+1]),this.addPageArray([b,b+1]),this.addPageBackArray([b]),this.currentPage=this.pageArray[b], this.currentPage2=this.pageBackArray[b],this.nextPage=this.pageArray[b+1],this.previousPage=this.pageArray[b-1],this.previousPage2=this.pageBackArray[b-1],this.setPageCss(),this.loading())},setPageCss:function(){this.currentPage&&(this.setZIndexByPageIndex(this.currentPage),this.currentPage.clearTran());this.previousPage&&(this.setZIndexByPageIndex(this.previousPage),this.previousPage.clearTran());this.previousPage2&&(this.setZIndexByPageIndex(this.previousPage2),this.previousPage2.clearTran());this.currentPage2&& (this.setZIndexByPageIndex(this.currentPage2),this.currentPage2.clearTran());this.nextPage&&(this.setZIndexByPageIndex(this.nextPage),this.nextPage.clearTran());rightToLeft?(this.currentPage&&this.currentPage.setLeftOrRight(!0),this.previousPage&&this.previousPage.setLeftOrRight(!0),this.previousPage2&&this.previousPage2.setLeftOrRight(!0),this.currentPage2&&this.currentPage2.setLeftOrRight(!0),this.nextPage&&this.nextPage.setLeftOrRight(!0)):(this.currentPage&&this.currentPage.setLeftOrRight(!1), this.previousPage&&this.previousPage.setLeftOrRight(!1),this.previousPage2&&this.previousPage2.setLeftOrRight(!1),this.currentPage2&&this.currentPage2.setLeftOrRight(!1),this.nextPage&&this.nextPage.setLeftOrRight(!1))},addPageBackArray:function(b){if(b&&this.pageBackArray)for(var c=0;c=b[c]||b[c]>originTotalPageCount||(!this.pageBackArray[b[c]]||this.flipping&&!imageLoaded[b[c]]||this.fillContent(b[c],!0),this.pageBackArray[b[c]]))){var d=this.newPageBack(b[c]),e=this.pageInfoArray[b[c]]; d.mirrorSide();d.onResize(this.pageWidth*e.pageWidth,this.pageHeight*e.pageHeight,e.opacity);this.pageBackArray[b[c]]=d;this.flipping&&!imageLoaded[b[c]]||this.fillContent(b[c],!0);this.flipBook.append(d.$page)}},getDownUpPage:function(b,c){var d=b;b>c&&(d=c);this.addPageArray([d]);this.addPageBackArray([d]);this.pageArray[d]&&this.pageArray[d].beginToFlip();this.pageBackArray[d]&&this.pageBackArray[d].beginToFlip();this.pageArray[d]&&this.pageArray[d].page.setCSSByName("right-flip-side");this.pageBackArray[d]&& (this.pageBackArray[d].page.setCSSByName("flip-side"),this.pageBackArray[d].page.side.addClass("boxShadow"));return[this.pageArray[d],this.pageBackArray[d]]},getDownUpHardPage:function(b,c){var d=b;b>c&&(d=c);this.addPageArray([d]);this.addPageBackArray([d]);rightToLeft?(this.pageArray[d]&&this.pageArray[d].setCSSByName("flip-hard-left-side"),this.pageBackArray[d]&&this.pageBackArray[d].setCSSByName("flip-hard-right-side")):(this.pageArray[d]&&this.pageArray[d].setCSSByName("flip-hard-right-side"), this.pageBackArray[d]&&this.pageBackArray[d].setCSSByName("flip-hard-left-side"));return[this.pageArray[d],this.pageBackArray[d]]},flipToMax:function(b,c,d){var e=this.flipPageManager.initFlipPageByIndex(b,c);this.addPagesBeforeFlipToMax(c,d);this.pageArray[c]&&(this.pageArray[c].setLeftOrRight(rightToLeft),e.nextPage=this.pageArray[c]);this.setPagesStyleBeforeFlipToMax(c,d);this.deleteUnnecessaryPagesBeforeFlipToMax(b,c);return e},hidePagesBeforeFlip:function(b){if(!this.supportSerialsFlip()){var c= this.pageArray.length;this.flipPageArray=[];var d=b.currentIndex;b=b.nextIndex;for(var e=[d,b],f=0;fe.indexOf(f)&&(this.pageArray[f]&&this.pageArray[f].visible&&(this.flipPageArray.push(this.pageArray[f]),this.pageArray[f].setVisible(!1)),this.pageBackArray[f]&&this.pageBackArray[f].visible&&(this.flipPageArray.push(this.pageBackArray[f]),this.pageBackArray[f].setVisible(!1)));c=Math.max(d,b);this.pageBackArray[c]&&this.pageBackArray[c].visible&&(this.flipPageArray.push(this.pageBackArray[c]), this.pageBackArray[c].setVisible(!1))}},showPagesAfterFlip:function(){if(!this.supportSerialsFlip()&&this.flipPageArray){for(var b=this.flipPageArray.length,c=0;cc;b--)if(this.pageArray[b]||this.pageBackArray[b])this.pageArray[b]&&this.pageArray[b].remove(),this.pageBackArray[b]&&this.pageBackArray[b].remove(), this.pageArray[b]=void 0,this.pageBackArray[b]=void 0},afterFlipToMin:function(b){this.addPagesAfterFlipToMin(b);this.setPagesStyleAfterFlipToMin(b);this.deleteUnnecessaryPagesAfterFlipToMin(b)},addPagesAfterFlipToMin:function(b){this.supportSerialsFlip()||(this.addPageArray([b]),this.addPageBackArray([b]),this.addPageArray([b-1]));this.pageArray[b]&&this.fillContent(b);this.pageArray[b-1]&&this.fillContent(b-1)},setPagesStyleAfterFlipToMin:function(b){this.pageArray[b+1]&&(this.setZIndexByPageIndex(this.pageArray[b+ 1]),this.pageArray[b+1].setLeftOrRight(rightToLeft));this.supportSerialsFlip()||(this.pageArray[b]&&(this.setZIndexByPageIndex(this.pageArray[b]),this.pageArray[b].setLeftOrRight(rightToLeft)),this.pageBackArray[b]&&(this.setZIndexByPageIndex(this.pageBackArray[b]),this.pageBackArray[b].setLeftOrRight(rightToLeft)),this.pageArray[b-1]&&(this.setZIndexByPageIndex(this.pageArray[b-1]),this.pageArray[b-1].setLeftOrRight(rightToLeft)))},deleteUnnecessaryPagesAfterFlipToMin:function(b){for(var c=b+2;c<= originTotalPageCount;c++)if(this.pageArray[c]||this.pageBackArray[c])this.pageArray[c]&&this.pageArray[c].remove(),this.pageBackArray[c]&&this.pageBackArray[c].remove(),this.pageArray[c]=void 0,this.pageBackArray[c]=void 0;this.pageBackArray[b+1]&&(this.pageBackArray[b+1]&&this.pageBackArray[b+1].remove(),this.pageBackArray[b+1]=void 0)},getCurrentPages:function(){return[this.currentPageIndex]},getPagesByIndex:function(b){return[b]},movetoCenter:function(){},getFromStartPointByIndex:function(b,c){var d= this.currentPageIndex;if(b!=d&&b!=d){var e={x:0,y:0},f=c.getPageWidthHeight().width,g=c.getPageWidthHeight().height,h=!1;c={x:f,y:g};rightToLeft&&(c={x:-f,y:g});if(b>d&&!rightToLeft||bd&&rightToLeft)h=!1;b>d&&(e={x:c.x*(f-2)/f,y:g-2});bd/2?b.y-5:b.y+5;b.xthis.MiddleX&&(e.y=h,f.x=g);c&&0<=c.indexOf("r")&&(f.x=g);c&&0<=c.indexOf("l")&& (f.x=-g);"tl"==c&&(e.y=0);"bl"==c&&(e.y=d);"tr"==c&&(e.y=0);"br"==c&&(e.y=d);e.x=rightToLeft?-g:g;f.y=e.y;return[e,f]}},getFlipTo:function(b){var c=this.currentPageIndex,d="";b>c&&(d="max");b=b||(b=this.getMinPageIndex(b),this.unWrapPageExcludeArray([b,b+1,b+2,b+3,b-1,b-2]),this.addPageArray([b,b+1,b+2,b+3,b-1,b-2]),this.currentPage=this.pageArray[b],this.currentPage2=this.pageArray[b+1],this.nextPage=this.pageArray[b+2],this.nextPage2= this.pageArray[b+3],this.previousPage=this.pageArray[b-1],this.previousPage2=this.pageArray[b-2],this.setPageCss(),this.loading())},setPageCss:function(){this.currentPage&&(this.setZIndexByPageIndex(this.currentPage),this.currentPage.clearTran());this.previousPage&&(this.setZIndexByPageIndex(this.previousPage),this.previousPage.clearTran());this.previousPage2&&(this.setZIndexByPageIndex(this.previousPage2),this.previousPage2.clearTran());this.currentPage2&&(this.setZIndexByPageIndex(this.currentPage2), this.currentPage2.clearTran());this.nextPage&&(this.setZIndexByPageIndex(this.nextPage),this.nextPage.clearTran());this.nextPage2&&(this.setZIndexByPageIndex(this.nextPage2),this.nextPage2.clearTran());rightToLeft?(this.currentPage&&this.currentPage.setLeftOrRight(!1),this.previousPage&&this.previousPage.setLeftOrRight(!1),this.previousPage2&&this.previousPage2.setLeftOrRight(!1),this.currentPage2&&this.currentPage2.setLeftOrRight(!0),this.nextPage&&this.nextPage.setLeftOrRight(!0),this.nextPage2&& this.nextPage2.setLeftOrRight(!0)):(this.currentPage&&this.currentPage.setLeftOrRight(!0),this.previousPage&&this.previousPage.setLeftOrRight(!0),this.previousPage2&&this.previousPage2.setLeftOrRight(!0),this.currentPage2&&this.currentPage2.setLeftOrRight(!1),this.nextPage&&this.nextPage.setLeftOrRight(!1),this.nextPage2&&this.nextPage2.setLeftOrRight(!1))},getDownUpHardPage:function(b,c,d){this.addPageArray([b,c]);d?(this.pageArray[b]&&this.pageArray[b].setCSSByName("flip-hard-left-side"),this.pageArray[c]&& this.pageArray[c].setCSSByName("flip-hard-right-side")):(this.pageArray[b]&&this.pageArray[b].setCSSByName("flip-hard-right-side"),this.pageArray[c]&&this.pageArray[c].setCSSByName("flip-hard-left-side"));return[this.pageArray[b],this.pageArray[c]]},getDownUpPage:function(b,c){this.addPageArray([b,c]);this.pageArray[b]&&this.pageArray[b].beginToFlip();this.pageArray[c]&&this.pageArray[c].beginToFlip();this.pageArray[b]&&(this.pageArray[b].page.setCSSByName("right-flip-side"),this.setZIndexByPageIndex(this.pageArray[b])); this.pageArray[c]&&(this.pageArray[c].page.setCSSByName("flip-side"),this.pageArray[c].page.side.addClass("boxShadow"),this.setZIndexByPageIndex(this.pageArray[c]));return[this.pageArray[b],this.pageArray[c]]},flipToMax:function(b,c,d,e){e=this.flipPageManager.initFlipPageByIndex(b,c,e);this.addPagesBeforeFlipToMax(c,d);this.pageArray[c+1]&&(this.pageArray[c+1].setLeftOrRight(rightToLeft),e.nextPage=this.pageArray[c+1]);this.setPagesStyleBeforeFlipToMax(c,d);this.deleteUnnecessaryPagesBeforeFlipToMax(b, c);return e},addPagesBeforeFlipToMax:function(b,c){this.addPageArray([b+1]);c&&this.supportSerialsFlip()&&this.addPageArray([b+2,b+3])},setPagesStyleBeforeFlipToMax:function(b,c){c&&this.supportSerialsFlip()&&(this.pageArray[b+1]&&this.setZIndexByPageIndex(this.pageArray[b+1],b),this.pageArray[b+2]&&(this.setZIndexByPageIndex(this.pageArray[b+2],b),this.pageArray[b+2].setLeftOrRight(rightToLeft)),this.pageArray[b+3]&&(this.setZIndexByPageIndex(this.pageArray[b+3],b),this.pageArray[b+3].setLeftOrRight(rightToLeft)))}, deleteUnnecessaryPagesBeforeFlipToMax:function(b,c){for(var d=c+4;d<=originTotalPageCount;d++)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0);for(d=b+1;dc;d--)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0)},afterFlipToMin:function(b,c){b=this.getMaxPageIndex(b);this.addPagesAfterFlipToMin(b);this.setPagesStyleAfterFlipToMin(b);this.deleteUnnecessaryPagesAfterFlipToMin(b)},addPagesAfterFlipToMin:function(b){this.flipping||this.addPageArray([b-3,b,b+1,b+2]);this.supportSerialsFlip()||this.addPageArray([b-2,b-3]);this.pageArray[b-1]&&this.fillContent(b-1);this.pageArray[b-2]&&this.fillContent(b-2);this.pageArray[b-3]&& this.fillContent(b-3)},setPagesStyleAfterFlipToMin:function(b){this.pageArray[b]&&(this.setZIndexByPageIndex(this.pageArray[b],b),this.pageArray[b].setLeftOrRight(rightToLeft));this.pageArray[b+1]&&(this.setZIndexByPageIndex(this.pageArray[b+1],b),this.pageArray[b+1].setLeftOrRight(rightToLeft));this.pageArray[b+2]&&(this.setZIndexByPageIndex(this.pageArray[b+2],b),this.pageArray[b+2].setLeftOrRight(rightToLeft));this.supportSerialsFlip()&&this.flipping||(this.pageArray[b-1]&&this.setZIndexByPageIndex(this.pageArray[b- 1]),this.pageArray[b-2]&&(this.setZIndexByPageIndex(this.pageArray[b-2]),this.pageArray[b-2].setLeftOrRight(!rightToLeft)),this.pageArray[b-3]&&(this.setZIndexByPageIndex(this.pageArray[b-3]),this.pageArray[b-3].setLeftOrRight(!rightToLeft)))},deleteUnnecessaryPagesAfterFlipToMin:function(b){for(b+=3;b<=originTotalPageCount;b++)this.pageArray[b]&&(this.pageArray[b].remove(),this.pageArray[b]=void 0)},getFlipTo:function(b){var c=this.getMinPageIndex(this.currentPageIndex);b=this.getMinPageIndex(b); var d=c+1,e="";b>d&&(e="max");b+1this.movedX*k&&this.toTrans!=k?this.movedX:h;this.toTrans=k;b=2*e;void 0==d&&(d=b);isNaN(d)||(this.movedLength=d,this.movedX=$.easing.easeInOutSine(null,d,this.fromTrans,this.toTrans-this.fromTrans,b),d={tran:{x:parseInt(this.movedX),y:0}},this.setCSS(d))}},edgeX:function(){this.MiddleX= 0},getFromStartPointByIndex:function(b,c){var d=this.getMinPageIndex(this.currentPageIndex),e=d+1;if(b!=e&&b!=d){var f={x:0,y:0},g={x:0,y:0},h=c.getPageWidthHeight().width;c=c.getPageWidthHeight().height;var k=!1;if(b>e&&!rightToLeft||be&&rightToLeft)f={x:-h,y:c},g.x=f.x+2,g.y=f.y-2,k=!1;this.flipToDirection=k?"left":"right";return[f,g]}},afterZoomIn:function(b){if(!isPhone()&&!isPad()||bookConfig.usePdfJs){if(isPhone()|| isPad()||this.showPages(),b&&this.flipBook.parameters&&!this.flipBook.parameters.resize){this.flipBook.parameters.resize=!0;b=this.flipBook.offset().left;var c=this.flipBook.offset().top,d=this.flipBook.parameters.left,e=c-this.flipBook.parameters.top;var f=this.flipBook.parameters.scale;d={tran:{x:parseInt(b-d),y:parseInt(e)},scale:1,origin:{x:0,y:0}};1!=f&&this.resizeBook(Math.round(this.width*f),Math.round(this.height*f),f);this.status_zoom||(d.tran={x:0,y:0},d.left=b-0,d.top=c-0);this.setCSS(d); this.flipBook.parameters.tran=d.tran;this.flipBook.parameters.scale=1;this.flipBook.parameters.toScale=1;this.flipBook.parameters.width=$(this.flipBook).width();this.flipBook.parameters.height=$(this.flipBook).height();this.flipBook.parameters.origin={x:0,y:0};this.flipBook.parameters.resize=!1;isPhone()||isPad()||this.switchLargeImage()}}else if(c=BookInfo.getCurrentPages(),void 0!=c&&null!=c)for(f=0;f=b[c]||b[c]>originTotalPageCount||(this.pageArray[b[c]]&&this.fillContent(b[c]), this.pageArray[b[c]]))){var d=this.newPage(b[c]);d.fillPreviewImage();var e=this.getFitWHByIndex(this.currentPageIndex);if(b[c]>=this.getMaxPageIndex(this.currentPageIndex)&&bookConfig.RightToLeft||b[c]<=this.getMinPageIndex(this.currentPageIndex)&&!bookConfig.RightToLeft)d.onResize(e[0].x,e[0].y);else d.onResize(e[1].x,e[1].y);this.pageArray[b[c]]=d;this.fillContent(b[c]);this.flipBook.append(d.$page)}},resizeAttachments:function(b,c){this.bookAttachments.onResize(b,c)},resetPages:function(b){this._super(b); b=this.getTranScaleByIndex(b);this.scalePages(BookInfo.getRightPages(this.currentPageIndex),2,2,b[1],b[1],{x:0,y:50});this.scalePages(BookInfo.getLeftPages(this.currentPageIndex),2,2,b[0],b[0],{x:100,y:50})},afterFlipTo:function(b,c){this._super(b,c);resizeFlipBook();this.scalePages(BookInfo.getRightPages(this.currentPageIndex),2,2,{x:1,y:1},{x:1,y:1},{x:0,y:50});this.scalePages(BookInfo.getLeftPages(this.currentPageIndex),2,2,{x:1,y:1},{x:1,y:1},{x:100,y:50})},afterCurling:function(){this._super(); this.getTranScaleByIndex(this.currentPageIndex);this.scalePages(BookInfo.getRightPages(this.currentPageIndex),2,2,{x:1,y:1},{x:1,y:1},{x:0,y:50});this.scalePages(BookInfo.getLeftPages(this.currentPageIndex),2,2,{x:1,y:1},{x:1,y:1},{x:100,y:50})},movetoCenter:function(b,c,d){if(bookConfig.retainBookCenter){var e=this.getMovedXByIndex(c).x-this.getMovedXByIndex(b).x,f=this.width;if(void 0==d||d>f)d=f;if(!isNaN(d)){this.movedLength=d;var g=this.getFitWHByIndex(b),h=this.getFitWHByIndex(c);this.status_zoom&& (g=this.getFitWHByIndex(b,this.width,this.height),h=this.getFitWHByIndex(c,this.width,this.height));this.getFlipTo(c);var k=BookInfo.getMinPageIndex(b),l=BookInfo.getMaxPageIndex(b);if(bookConfig.RightToLeft)if(b=this.MiddleX&&rightToLeft)return{pageWidth:c[0].x, pageHeight:c[0].y};if(b<=this.MiddleX&&rightToLeft||b>=this.MiddleX&&!rightToLeft)return{pageWidth:c[1].x,pageHeight:c[1].y}},realPoint:function(b){if((b=b.originalEvent&&b.originalEvent.changedTouches?b.originalEvent.changedTouches:b.changedTouches?b.changedTouches:[b])&&!(3<=b.length)){var c=this.realBookPosition()[0],d=this.realBookPosition()[1],e=b[0].pageX,f=b[0].pageY;bookConfig.upsideOnMobile()&&(e=b[0].pageY,f=windowHeight-b[0].pageX);var g=this.getFitWHByIndex(this.currentPageIndex);if(bookConfig.FlipDirection){f= f-d-g[0].y;var h=this.getCurrentPageWidthHeight(f),k=h.pageWidth;e=this.pageWidth-(e-c)-(this.pageWidth-k)/2;if(!b[1])return[{x:f,y:e}];h=b[1].pageX;b=b[1].pageY;h=this.pageWidth-(h-c)-(this.pageWidth-k)/2;b=b-d-g[0].y;return[{x:f,y:e},{x:b,y:h}]}e=e-c-g[0].x;h=this.getCurrentPageWidthHeight(e);k=h.pageHeight;f=f-d-(this.pageHeight-k)/2;if(!b[1])return[{x:e,y:f}];h=b[1].pageX;b=b[1].pageY;h=h-c-g[0].x;b=b-d-(this.pageHeight-k)/2;return[{x:e,y:f},{x:h,y:b}]}}}).extend(IssuuDoubleFlipBook),SingleIssuuBook= Class({bookType:BookType.single_book,doublePage:!1,create:function(b){bookConfig.bookPageStretch=!0;this._super(b);this.resetZoomArea();bookConfig.supportSerialsFlip=!1},initBook:function(){this._super()},resetBookShadow:function(b){},hasTwoSingleFlipPage:function(b){for(var c=this.flipPageManager.array.length,d,e=0;e=b[c]||b[c]>originTotalPageCount||(this.pageArray[b[c]]&&this.fillContent(b[c]),this.pageArray[b[c]]))){var d= this.newPage(b[c]);d.fillPreviewImage();var e=this.getFitWHByIndex(this.currentPageIndex);d.onResize(e[0].x,e[0].y);this.pageArray[b[c]]=d;this.fillContent(b[c]);this.flipBook.append(d.$page)}},resizeAttachments:function(b,c){this.bookAttachments.onResize(b,c)},resetPages:function(b){this._super(b);var c=this.getTranScaleByIndex(b);this.scalePages(BookInfo.getRightPages(b),2,2,c[1],c[1],{x:0,y:50});this.scalePages(BookInfo.getLeftPages(b),2,2,c[0],c[0],{x:100,y:50})},afterFlipTo:function(b,c){this._super(b, c);resizeFlipBook();this.scalePages(BookInfo.getRightPages(),2,2,{x:1,y:1},{x:1,y:1},{x:0,y:50});this.scalePages(BookInfo.getLeftPages(),2,2,{x:1,y:1},{x:1,y:1},{x:100,y:50})},afterCurling:function(){this._super();this.scalePages(BookInfo.getRightPages(),2,2,{x:1,y:1},{x:1,y:1},{x:0,y:50});this.scalePages(BookInfo.getLeftPages(),2,2,{x:1,y:1},{x:1,y:1},{x:100,y:50})},movetoCenter:function(b,c,d){if(bookConfig.retainBookCenter){var e=this.getMovedXByIndex(c).x-this.getMovedXByIndex(b).x,f=this.width; if(void 0==d||d>f)d=f;if(!isNaN(d)){this.movedLength=d;var g=this.getFitWHByIndex(b),h=this.getFitWHByIndex(c);this.status_zoom&&(g=this.getFitWHByIndex(b,this.width,this.height),h=this.getFitWHByIndex(c,this.width,this.height));if(bookConfig.RightToLeft)if(bc&&(d=c);this.addPageArray([d]);this.addPageBackArray([d]);b=this.getFitWHByIndex(this.currentPageIndex);b=transformCSS({tran:{x:-b[1].x,y:0},origin:{x:100,y:50}});this.pageArray[d]&&(this.pageArray[d].beginToFlip(),this.pageArray[d].setCSSByStyle(b));this.pageBackArray[d]&&(this.pageBackArray[d].beginToFlip(),this.pageBackArray[d].setCSSByStyle(b));this.pageArray[d]&&this.pageArray[d].page.setCSSByName("right-flip-side");this.pageBackArray[d]&&(this.pageBackArray[d].page.setCSSByName("flip-side"), this.pageBackArray[d].page.side.addClass("boxShadow"));return[this.pageArray[d],this.pageBackArray[d]]},getMovedXByIndex:function(b){var c=this.getSpace(),d=this.getFitWHByIndex(b);b=parseInt(d[0].x+d[1].x);d=parseInt(d[0].y);return{x:(windowWidth-c.left-c.right-b)/2+c.left,y:(windowHeight-c.top-c.bottom-d)/2+c.top}},scalePages:function(b,c,d,e,f,g,h,k,l){var n=this;try{var p=1,q=1;p=$.easing.easeInOutSine(null,c,1,f.x/e.x-1,d);q=$.easing.easeInOutSine(null,c,1,f.y/e.y-1,d);c=function(v){if(v){var u= transformCSS({tran:l?l:{x:0,y:0},scale:{x:p,y:q},origin:g});if(n.isCoverPage(v.pageIndex))if(v.tran=l?l:{x:0,y:0},v.scale={x:p,y:q},v.rotateY){v.$page[0].style.removeProperty("transform-origin");var w;u=transformCSS({scale:{x:p,y:q},perspective:6E3,rotateY:null!=(w=v.rotateY)?w:0})}else{var x;u=transformCSS({origin:g,scale:{x:p,y:q},perspective:6E3,rotateY:null!=(x=v.rotateY)?x:0})}v.setCSSByStyle(u);u=h?transformCSS({scale:{x:k.x/p,y:1},origin:g}):transformCSS({scale:{x:1,y:1},origin:g});v.page.pageFlipShadow&& v.page.pageFlipShadow.setCSSByStyle(u)}};for(d=0;d");this.parent.append(this.flipBookElement)},refreshPages:function(b){if(bookConfig.RightToLeft){var c=1-(this.currentOffset-this.startOffset-this.pageWidth)/this.unitOffset;var d=Math.max(1,Math.ceil(1-(this.currentOffset-this.startOffset+this.width)/this.unitOffset)-2);c=Math.min(bookConfig.totalPageCount,Math.floor(c)+2)}else d=this.currentOffset-this.startOffset, c=d+this.width,d=Math.max(1,Math.floor(d/this.unitOffset)+1-2),c=Math.min(bookConfig.totalPageCount,Math.ceil(c/this.unitOffset)+2);for(var e=d;e<=c;e++){if(bookConfig.RightToLeft){var f=this.startOffset+this.unitOffset*(1-e)-this.currentOffset;var g=this.unitRotate*(1-e)-this.k*this.currentOffset}else f=this.startOffset+this.unitOffset*(e-1)-this.currentOffset,g=this.unitRotate*(e-1)-this.k*this.currentOffset;if(this.pageArray[e]){var h=this.pageArray[e];h.refreshTransform({x:f,y:0},{x:0,y:g});if(!["flipping", "flipped"].includes(b))h.onResize(this.pageWidth,this.pageHeight)}else h=new CardBookPage(this,e),h.initialize(this.pageWidth,this.pageHeight,{x:f,y:0},{x:0,y:g},e),this.pageArray[e]=h}if("flipping"!==b)for(b=0;bc)&&this.pageArray[b]&&(this.pageArray[b].remove(),this.pageArray[b]=void 0);if(b=this.pageArray[this.currentPageIndex])this.showPage=b.pagesElement,$(".card-side").css({"z-index":3}),$("#card-side-"+this.currentPageIndex).css({"z-index":4})},initAttachments:function(){this.bookAttachments= new BookAttachmentsBuilder(this.flipBookElement,this.currentPageIndex,this,this.options.isDoublePage);this.options.thickness&&this.bookAttachments.thickness(!0);this.options.bookshadow&&this.bookAttachments.bookshadow();this.options.grayshadow&&this.bookAttachments.grayshadow();this.options.miniFullscreen&&this.bookAttachments.miniFullscreen();this.options.bookpagenumber&&this.bookAttachments.bookpagenumber();this.options.staticad&&this.bookAttachments.staticad();this.options.zoommap&&this.bookAttachments.zoommap(); this.options.bookmarktab&&this.bookAttachments.bookmarktab();this.options.noteadd&&this.bookAttachments.noteadd()},getBook:function(){return this.flipBookElement},show:function(){this.visible=!0;this.setStyleByCSS({display:"block"});this.enterPage();this.bookAttachments&&this.bookAttachments.show()},hide:function(){this.visible=!1;this.setStyleByCSS({display:"none"});this.stopMedia();this.resetSlider();this.bookAttachments&&this.bookAttachments.hide()},setStyleByCSS:function(b){this.flipBookElement.css(b)}, enterPage:function(){this.afterChangeBookType();this.openShownMedia();this.addSearchHighlight()},afterChangeBookType:function(){for(var b=0;b=this.scrollableWidth)){var c=b.originalEvent;c=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));if(this.status_zoom){b={pointers:[{pageX:b.pageX,pageY:b.pageY},{pageX:b.pageX,pageY:b.pageY}]};var d=this.pageArray[this.currentPageIndex];d&&d.controlBar&&(0>c?d.controlBar.zoomDown(b):d.controlBar.zoomUp(b))}!this.status_zoom&& bookConfig.mouseWheelFlip&&this.canAcceptMouseWheel()&&(bookConfig.automaticAdsorption?(d=Math.ceil(this.scrollSpeed),c=bookConfig.RightToLeft?0c?this.currentPageIndex+d:this.currentPageIndex-d,this.isUpdateOffset=!0,gotoPageFun(c,!1,"mouse wheel flip")):(d=this.unitOffset*this.scrollSpeed/5,bookConfig.RightToLeft?(this.isNextPage=0c?!0:!1,c=this.currentOffset+-c*d,d=0>c?0:c>this.scrollableWidth?bookConfig.totalPageCount+1:this.getTargetPageIndex(c)),this.totalOffset=bookConfig.RightToLeft?Number.between(c,-this.scrollableWidth,0):Number.between(c,0,this.scrollableWidth),this.isUpdateOffset=!1,gotoPageFun(d,!1,"mouse wheel flip")));if(bookConfig.mouseWheelFlip)return stopEvent(b),!1}},canAcceptMouseWheel:function(){if(0!==this.dMouseWheelTime&&150>(new Date).getTime()-this.dMouseWheelTime)return!1;this.dMouseWheelTime= (new Date).getTime();return!0},onPan:function(b){bookType!==this.bookType||!bookConfig.mouseDragFlip||0>=this.scrollableWidth||this.selected||this.isZoomming||this.status_zoom||this.status_resize||this.flipping||("panstart"==b.type?this.dragStartOffset=this.currentOffset:"panmove"==b.type&&(bookConfig.upsideOnMobile()?(bookConfig.RightToLeft?(b=this.dragStartOffset+-b.deltaY*this.panSpeed,this.isNextPage=bthis.dragStartOffset?!0:!1),this.currentOffset=b):(bookConfig.RightToLeft?(b=this.dragStartOffset+-b.deltaX*this.panSpeed,this.isNextPage=bthis.dragStartOffset?!0:!1),this.currentOffset=b),this.refreshPages("flipping")))},onPanEnd:function(b){bookType!==this.bookType||!bookConfig.mouseDragFlip||0>=this.scrollableWidth||this.selected||this.isZoomming||this.status_zoom||this.status_resize||this.flipping|| (b=this.currentOffset-this.dragStartOffset,bookConfig.automaticAdsorption?(Math.abs(b)>=.05*this.unitOffset?(b=bookConfig.RightToLeft?-b/this.unitOffset:b/this.unitOffset,b=0");this.sideElement.attr("id","card-side-"+c);this.pagesElement=$("
");this.pageElement=this.createPage(c);this.parentElement.append(this.sideElement);this.sideElement.append(this.pagesElement);this.pagesElement.append(this.pageElement);this.initEvent()},defineProperty:function(){this.controlBar= null;this.pageIndex=this.pageHeight=this.pageWidth=0;this.clickStartPosition=this.page=null},createPage:function(b){b=new Page(b,"page-",this.bookType);b.hideMiddleShadow();b.centerPage();this.page=b;return b.side},initEvent:function(){this.sideElement.bind("mousedown",function(b){this.clickStartPosition={x:b.pageX,y:b.pageY}}.bind(this));this.sideElement.bind("click",this.onClick.bind(this));isBelowIE9()?this.pagesElement.IEZoom({sideElement:this,zoomIn:this.zoomIn.bind(this),zoomOut:this.zoomOut.bind(this), onZoomed:this.onZoomed.bind(this)}):this.pagesElement.zoom({sideElement:this,zoomIn:this.zoomIn.bind(this),zoomOut:this.zoomOut.bind(this),onZoomed:this.onZoomed.bind(this)})},initialize:function(b,c,d,e,f){this.onResize(b,c);this.refreshTransform(d,e);this.loading();this.fillContent(f)},enterSide:function(){this.page.enterSide()},leaveSide:function(){this.page.leaveSide()},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;var d=transformCSS({rotate:0,tran:{x:0,y:0},scale:1});this.sideElement.css({top:this.parent.height/ 2-c/2+"px",width:b+"px",height:c+"px"});this.pagesElement.css(Object.assign({},d,{width:b+"px",height:c+"px"}));this.page.onResize(b,c);this.resetPagesParameters();this.parent.showAllPage()},resetPagesParameters:function(){this.pagesElement.parameters&&(this.pagesElement.parameters.width=$(this.pagesElement).width(),this.pagesElement.parameters.height=$(this.pagesElement).height(),this.pagesElement.parameters.origin={x:0,y:0},this.pagesElement.parameters.tran={x:0,y:0},this.pagesElement.parameters.scale= 1,this.pagesElement.parameters.toScale=1,this.pagesElement.parameters.resize=!1,this.pagesElement.swipeInterval&&this.pagesElement.swipeInterval.stop(),this.pagesElement.animateInterval&&this.pagesElement.animateInterval.stop(),this.pagesElement.parameters.zoomFlag=!1,this.pagesElement.parameters.zoomOut=!0,this.pagesElement.parameters.toScale=1,this.pagesElement.parameters.scale=1)},refreshTransform:function(b,c){b=transformCSS({tran:b,rotateY:c.y});this.sideElement.css(b)},fillContent:function(b){this.page.fillContent(b)}, fillPage:function(b,c){this.page.fillPage(b,c)},onClick:function(b){b.stopPropagation();this.clickStartPosition&&2=bookConfig.restorePageDuration||31>=c&&(new Date).getDate()!=parseInt(c))&&showMessage(getLanguage("restorePage","Would you like to restore previous session"),function(){window.localStorage.setItem(realLocation+"?historySubmmit",(new Date).getTime());gotoPageFun(window.localStorage[realLocation+"?historyPageIndex"])}):setTimeout(function(){gotoPageFun(d)}, 300))}return b} function initialization(){var b,c,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){switch(e.nextAddress){case 1:return window.tmpContainer=$("
"),isPC()&&_agent_.browser.safari&&_agent_.system.name==_agent_.system.WINDOWS&&tmpContainer.css({"z-index":0}),$("body").append(tmpContainer),window.bookContainer=$("
"),tmpContainer.append(bookContainer),window.soundBaseURL="style/raw/",b= window.getWidth(),windowHeight=c=window.getHeight(),windowWidth=b,e.yield(checkBookConfig(),2);case 2:return e.yield(validateDomainAccess(),3);case 3:d=e.yieldResult;if(!d)return e.return();selectLanguage(bookConfig.language);initImageBaseUrl();global.onBookLoad=new LoadingBook(tmpContainer,bookConfig.loadingBackground);return e.yield(initToolBarBrand(),4);case 4:delayLoading(),e.jumpToEnd()}})}function extractBrandPath(b){b=b.split("/");b.pop();return b.join("/")} function initToolBarBrand(){var b,c,d,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){if(1==f.nextAddress){b=_get(window,"bookConfig.toolBarBrandInfoVisible",void 0);if(void 0===b)return f.return();c=_get(window,"bookConfig.toolBarBrandInfoUrl","");return b&&""!==c?f.yield(fetchBrandInfo(c),2):(bookConfig.appLogoIcon="",f.return())}d=f.yieldResult;e=extractBrandPath(c);bookConfig.appLogoIcon=d&&d.logo?e+"/"+d.logo.replace("./",""):"";bookConfig.appLogoLinkURL=d&&d.url?getRealURL(d.url): "";f.jumpToEnd()})}function fetchBrandInfo(b){var c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return d.setCatchFinallyBlocks(2),d.yield($.ajax({url:b,type:"get",dataType:"json"}),4);if(2!=d.nextAddress)return c=d.yieldResult,d.return(c);d.enterCatchBlock();return d.return(null)})} function delayLoading(){var b=function(){window.jsLoadingBar&&(jsLoadingBar.destroy(),onBookLoad.chooseBookStyle(),window.hasOwnProperty("GuideLoadingJS")&&jsLoadingBar instanceof GuideLoadingJS||(jsLoadingBar=null))};window.setTimeout(function(){window.loadingConfig&&loadingConfig.loadingVideo&&jsLoadingBar&&jsLoadingBar.showVideo?(jsLoadingBar.showVideo(),$(jsLoadingBar.video).bind("pause",function(){b()}),$(jsLoadingBar.video).bind("ended",function(){b()}),jsLoadingBar.video.ontimeupdate=function(){60<= jsLoadingBar.video.currentTime&&b()}):window.jsLoadingBar?b():onBookLoad.chooseBookStyle()},Math.max(1E3*parseInt(window.loadingConfig&&window.loadingConfig.loadingDisplayTime||.01),10))}var onWindowClick=function(){};window.isSupportWebp=!1; (function(){function b(d){window.isSupportWebp=d&&"load"===d.type?1==c.width:!1;"false"==GetQueryString("isSupportWebp")&&(window.isSupportWebp=!1);"true"==GetQueryString("isSupportWebp")&&(window.isSupportWebp=!0);var e=window.setInterval(function(){window.Module&&Module.isReady&&(window.clearInterval(e),initialization())},100)}var c=new Image;c.onerror=b;c.onload=b;c.src="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA="})(); function initBookFrame(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){if(1==b.nextAddress)return useTheFliphtml5Service(),window.rightToLeft=bookConfig.RightToLeft,initBrowserType(),changeBookConfigValue("pageRestrictUrl",uiBaseURL+"articleEmpty.png"),changeBookConfigValue("OriginPageIndex",bookConfig.OriginPageIndex?bookConfig.OriginPageIndex:1),changeBookConfigValue("upsideOnMobile",function(){return isPhone()||isPad()?bookConfig.alwaysDoublePageOnMobile&&window.innerHeight>window.innerWidth? !0:!1:!1}),global.originTotalPageCount=parseInt(bookConfig.totalPageCount),global.totalPageCount=originTotalPageCount+(1==originTotalPageCount%2&&!bookConfig.isTheBookOpen||0==originTotalPageCount%2&&bookConfig.isTheBookOpen?1:0),b.yield(checkExpandBookConfig(),2);initBook();changeShowBook(bookType);resizeFlipBook();resizeSlideBook();resizeDocumentViewBook();resizeCardBook();onBookLoad.isReady=!0;try{Module._monitorWH(window.key_index,bookConfig.largePageWidth/bookConfig.largePageHeight,originTotalPageCount)}catch(c){}b.jumpToEnd()})} function validateDomainAccess(b){function c(){$("body").css({background:"#ffffff",color:"#000000","text-align":"center","font-size":"20px"}).append($("\n
\n \n

"+bookConfig.OnlyOpenInIframeInfo+"

\n
\n "))}b=void 0===b?5E3:b;return bookConfig.domainAccess&&bookConfig.domainAccess.length&& window.parent!=window.self&&"undefined"===typeof BookPreviewPublic?new Promise(function(d){function e(h){if(h.data&&"PARENT_DOMAIN"===h.data.type){f=!0;clearTimeout(g);window.removeEventListener("message",e);var k="string"===typeof bookConfig.domainAccess?bookConfig.domainAccess.split(/[,;]/).map(function(n){return n.trim()}):Array.isArray(bookConfig.domainAccess)?bookConfig.domainAccess.map(function(n){return n.trim()}):[];k=k.map(function(n){return n.replace(/^https?:\/\//,"").split(":")[0].toLowerCase()}); var l=h.origin.replace(/^https?:\/\//,"").split(":")[0].toLowerCase();h=h.data.domain.replace(/^https?:\/\//,"").split(":")[0].toLowerCase();k.includes(h)&&k.includes(l)?d(!0):($("body").empty().removeAttr("style"),c(),d(!1))}}var f=!1,g=setTimeout(function(){f||(console.warn("Domain validation timeout, access denied by default"),$("body").empty().removeAttr("style"),c(),d(!1))},b);window.addEventListener("message",e)}):!0};