1/** 2 * @preserve 3 * Plugin Name: dflip 4 * Description: dflip - 3D & 2D FlipBook 5 * 6 * Author: Deepak Ghimire 7 * Author URI: http://codecanyon.net/user/dearhive?ref=dearhive 8 */ 9"use strict"; 10var DJFlipBook = DJFlipBook || {}; 11var PRESENTATION = DJFlipBook; 12(function e(t, i) { 13 t.version = "1.7.3.5"; 14 t.PAGE_MODE = {SINGLE: 1, DOUBLE: 2, AUTO: null}; 15 t.SINGLE_PAGE_MODE = {ZOOM: 1, BOOKLET: 2, AUTO: null}; 16 t.CONTROLSPOSITION = {HIDDEN: "hide", TOP: "top", BOTTOM: "bottom"}; 17 t.DIRECTION = {LTR: 1, RTL: 2}; 18 t.LINK_TARGET = {NONE: 0, SELF: 1, BLANK: 2, PARENT: 3, TOP: 4}; 19 t.CORNERS = {TL: "tl", TR: "tr", BL: "bl", BR: "br", L: "l", R: "r", NONE: null}; 20 t.SOURCE_TYPE = {IMAGE: "image", PDF: "pdf", HTML: "html"}; 21 t.DISPLAY_TYPE = {WEBGL: "3D", HTML: "2D"}; 22 t.PAGE_SIZE = {AUTO: 0, SINGLE: 1, DOUBLEINTERNAL: 2}; 23 var n = t.defaults = { 24 webgl: true, 25 webglShadow: true, 26 soundEnable: true, 27 search: false, 28 height: "auto", 29 autoEnableOutline: false, 30 autoEnableThumbnail: false, 31 overwritePDFOutline: false, 32 enableDownload: true, 33 duration: 800, 34 direction: t.DIRECTION.LTR, 35 pageMode: t.PAGE_MODE.AUTO, 36 singlePageMode: t.SINGLE_PAGE_MODE.AUTO, 37 backgroundColor: "#fff", 38 forceFit: true, 39 transparent: false, 40 hard: "none", 41 openPage: 1, 42 annotationClass: "", 43 autoPlay: false, 44 autoPlayDuration: 5e3, 45 autoPlayStart: false, 46 maxTextureSize: 1600, 47 minTextureSize: 256, 48 rangeChunkSize: 524288, 49 icons: { 50 altnext: "ti-angle-right", 51 altprev: "ti-angle-left", 52 next: "ti-angle-right", 53 prev: "ti-angle-left", 54 end: "ti-angle-double-right", 55 start: "ti-angle-double-left", 56 share: "ti-sharethis", 57 help: "ti-help-alt", 58 more: "ti-more-alt", 59 download: "ti-download", 60 zoomin: "ti-zoom-in", 61 zoomout: "ti-zoom-out", 62 fullscreen: "ti-fullscreen", 63 fitscreen: "ti-arrows-corner", 64 thumbnail: "ti-layout-grid2", 65 outline: "ti-menu-alt", 66 close: "ti-close", 67 search: "ti-search", 68 doublepage: "ti-book", 69 singlepage: "ti-file", 70 sound: "ti-volume", 71 facebook: "ti-facebook", 72 google: "ti-google", 73 twitter: "ti-twitter-alt", 74 mail: "ti-email", 75 play: "ti-control-play", 76 pause: "ti-control-pause" 77 }, 78 /*text: { 79 toggleSound: "Turn on/off Sound", 80 toggleThumbnails: "Toggle Thumbnails", 81 toggleOutline: "Toggle Outline/Bookmark", 82 previousPage: "Previous Page", 83 nextPage: "Next Page", 84 toggleFullscreen: "Toggle Fullscreen", 85 zoomIn: "Zoom In", 86 zoomOut: "Zoom Out", 87 toggleHelp: "Toggle Help", 88 singlePageMode: "Single Page Mode", 89 doublePageMode: "Double Page Mode", 90 downloadPDFFile: "Download PDF File", 91 gotoFirstPage: "Goto First Page", 92 gotoLastPage: "Goto Last Page", 93 play: "Start AutoPlay", 94 pause: "Pause AutoPlay", 95 share: "Share", 96 mailSubject: "I wanted you to see this FlipBook", 97 mailBody: "Check out this site {{url}}", 98 loading: "Loading" 99 },*/ 100 text: { 101 toggleSound: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_TOGGLESOUND')), 102 toggleThumbnails: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_TOGGLETHUMBNAILS')), 103 toggleOutline: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_TOGGLEOUTLINE')), 104 previousPage: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_PREVIOUSPAGE')), 105 nextPage: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_NEXTPAGE')), 106 toggleFullscreen: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_TOGGLEFULLSCREEN')), 107 zoomIn: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_ZOOMIN')), 108 zoomOut: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_ZOOMOUT')), 109 toggleHelp: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_TOGGLEHELP')), 110 singlePageMode: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_SINGLEPAGEMODE')), 111 doublePageMode: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_DOUBLEPAGEMODE')), 112 downloadPDFFile: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_DOWNLOADPDFFILE')), 113 gotoFirstPage: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_GOTOFIRSTPAGE')), 114 gotoLastPage: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_GOTOLASTPAGE')), 115 play: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_PLAY')), 116 pause: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_PAUSE')), 117 share: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_SHARE')), 118 mailSubject: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_MAILSUBJECT')), 119 mailBody: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_MAILBODY')), 120 loading: getAText(Joomla.Text._('PLG_SYSTEM_DJFLIPBOOK_LOADING')) 121 }, 122 allControls: "altPrev,pageNumber,altNext,play,outline,thumbnail,zoomIn,zoomOut,fullScreen,share,download,search,more,pageMode,startPage,endPage,sound", 123 moreControls: "download,pageMode,startPage,endPage,sound", 124 hideControls: "", 125 controlsPosition: t.CONTROLSPOSITION.BOTTOM, 126 paddingTop: 30, 127 paddingLeft: 20, 128 paddingRight: 20, 129 paddingBottom: 30,
vendor: 8,151 bytes, lines 130-343
130 enableAnalytics: false, 131 scrollWheel: true, 132 onCreate: function (e) { 133 }, 134 onCreateUI: function (e) { 135 }, 136 onFlip: function (e) { 137 }, 138 beforeFlip: function (e) { 139 }, 140 onReady: function (e) { 141 }, 142 zoomRatio: 1.5, 143 pageSize: t.PAGE_SIZE.AUTO, 144 pdfjsSrc: "js/libs/pdf.min.js", 145 pdfjsCompatibilitySrc: "js/libs/compatibility.js", 146 pdfjsWorkerSrc: "js/libs/pdf.worker.min.js", 147 threejsSrc: "js/libs/three.min.js", 148 mockupjsSrc: "js/libs/mockup.min.js", 149 soundFile: "sound/turn2.mp3", 150 imagesLocation: "images", 151 imageResourcesPath: "images/pdfjs/", 152 cMapUrl: "cmaps/", 153 enableDebugLog: false, 154 canvasToBlob: false, 155 enableAnnotation: true, 156 pdfRenderQuality: .9, 157 textureLoadFallback: "blank", 158 stiffness: 3, 159 backgroundImage: "", 160 pageRatio: null, 161 pixelRatio: window.devicePixelRatio || 1, 162 thumbElement: "div", 163 spotLightIntensity: .22, 164 ambientLightColor: "#fff", 165 ambientLightIntensity: .8, 166 shadowOpacity: .15, 167 linkTarget: t.LINK_TARGET.BLANK, 168 sharePrefix: "flipbook-" 169 }; 170 function getAText(text) { 171 var tt = text.replace(/["']/g, ''); // Remove double quotes 172 return tt.replace(/,/g, ''); // Remove commas 173 } 174 var a = "WebKitCSSMatrix" in window || document.body && "MozPerspective" in document.body.style, 175 o = "onmousedown" in window, r = "ontouchstart" in window; 176 var s = navigator.userAgent; 177 var l = t.utils = { 178 drag: {left: 0, right: 1, none: -1}, 179 mouseEvents: o ? {type: "mouse", start: "mousedown", move: "mousemove", end: "mouseup"} : { 180 type: "touch", 181 start: "touchstart", 182 move: "touchmove", 183 end: "touchend" 184 }, 185 html: {div: "<div/>", img: "<img/>", a: "<a>", input: "<input type='text'/>"}, 186 getSharePrefix: function () { 187 var e = l.getSharePrefixes(); 188 return e[0] 189 }, 190 getSharePrefixes: function () { 191 var e = (t.defaults.sharePrefix + ",dflip-,flipbook-,dearflip-").split(",").filter(function (e) { 192 return e 193 }); 194 return e 195 }, 196 toRad: function (e) { 197 return e * Math.PI / 180 198 }, 199 isset: function (e, t) { 200 return e == null ? t : e 201 }, 202 isnull: function (e) { 203 return e == null || e == null 204 }, 205 toDeg: function (e) { 206 return e * 180 / Math.PI 207 }, 208 transition: function (e, t) { 209 return e ? t / 1e3 + "s ease-out" : "0s none" 210 }, 211 hasCompatibility: function () { 212 var e = false; 213 if (window.dFlipLocation != null) { 214 if (window.dFlipLocation.indexOf("lip-lit") > 0) e = true 215 } 216 return e 217 }, 218 scrollIntoView: function (e, t, i) { 219 t = t || e.parentNode; 220 t.scrollTop = e.offsetTop - t.offsetTop + (i === false ? e.offsetHeight - t.offsetHeight : 0); 221 t.scrollLeft = e.offsetLeft - t.offsetLeft 222 }, 223 display: function (e) { 224 return e ? "block" : "none" 225 }, 226 resetTranslate: function () { 227 return w(0, 0) 228 }, 229 translateStr: function (e, t) { 230 return a ? " translate3d(" + e + "px," + t + "px, 0px) " : " translate(" + e + "px, " + t + "px) " 231 }, 232 httpsCorrection: function (e) { 233 var t = window.location; 234 if (t.href.indexOf("https://") > -1 && e.indexOf(t.hostname) > -1) { 235 e = e.replace("http://", "https://") 236 } 237 if (t.href.indexOf("http://") > -1 && e.indexOf(t.hostname) > -1) { 238 e = e.replace("https://", "http://") 239 } 240 return e 241 }, 242 resetBoxShadow: function () { 243 return "rgba(0, 0, 0, 0) 0px 0px 20px" 244 }, 245 rotateStr: function (e) { 246 return " rotateZ(" + e + "deg) " 247 }, 248 bg: function (e) { 249 return "#fff" + C(e) 250 }, 251 bgImage: function (e) { 252 return e == null || e == "blank" ? "" : " url(" + e + ")" 253 }, 254 src: function (e) { 255 return e != null ? "" + e + "" : "" 256 }, 257 limitAt: function (e, t, i) { 258 return e < t ? t : e > i ? i : e 259 }, 260 distOrigin: function (e, t) { 261 return Math.sqrt(Math.pow(e, 2) + Math.pow(t, 2)) 262 }, 263 distPoints: function (e, t, i, n) { 264 return Math.sqrt(Math.pow(i - e, 2) + Math.pow(n - t, 2)) 265 }, 266 calculateScale: function (e, t) { 267 var i = I(e[0].x, e[0].y, e[1].x, e[1].y), n = I(t[0].x, t[0].y, t[1].x, t[1].y); 268 return n / i 269 }, 270 getVectorAvg: function (e) { 271 return { 272 x: e.map(function (e) { 273 return e.x 274 }).reduce(l.sum) / e.length, y: e.map(function (e) { 275 return e.y 276 }).reduce(l.sum) / e.length 277 } 278 }, 279 sum: function (e, t) { 280 return e + t 281 }, 282 getTouches: function (e, t) { 283 t = t || {left: 0, top: 0}; 284 return Array.prototype.slice.call(e.touches).map(function (e) { 285 return {x: e.pageX - t.left, y: e.pageY - t.top} 286 }) 287 }, 288 angleByDistance: function (e, t) { 289 var i = t / 2; 290 var n = S(e, 0, t); 291 return n < i ? m(Math.asin(n / i)) : 90 + m(Math.asin((n - i) / i)) 292 }, 293 log: function (e) { 294 if (n.enableDebugLog == true && window.console) console.log(e) 295 }, 296 lowerPowerOfTwo: function (e) { 297 return Math.pow(2, Math.floor(Math.log(e) / Math.LN2)) 298 }, 299 nearestPowerOfTwo: function (e, t) { 300 return Math.min(t || 2048, Math.pow(2, Math.ceil(Math.log(e) / Math.LN2))) 301 }, 302 zoomStops: function (e, t, i, n, a) { 303 if (n == null) n = 256; 304 if (a == null) a = 2048; 305 var o = Math.log(e / n) / Math.log(t); 306 return n * Math.pow(t, i == null ? Math.round(o) : i == true ? Math.ceil(o) : Math.floor(o)) 307 }, 308 extendOptions: function (e, t) { 309 return i.extend(true, {}, e, t) 310 }, 311 getFullscreenElement: function () { 312 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement 313 }, 314 hasFullscreenEnabled: function () { 315 return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled 316 }, 317 getBasePage: function (e) { 318 return Math.floor(e / 2) * 2 319 }, 320 loadResources: function e(t, i, n) { 321 var a = document, o = a.createElement(t), r = a.getElementsByTagName(t)[0]; 322 o.async = true; 323 if (n) { 324 o.addEventListener("load", function (e) { 325 n(null, e) 326 }, false) 327 } 328 o.src = i; 329 r.parentNode.insertBefore(o, r) 330 }, 331 getScriptCallbacks: [], 332 getScript: function (e, t, n) { 333 var a = l.getScriptCallbacks[e], o; 334 335 function r(e, t) { 336 if (o != null) { 337 if (t || !o.readyState || /loaded|complete/.test(o.readyState)) { 338 o.onload = o.onreadystatechange = null; 339 o = null; 340 o = null; 341 if (!t) { 342 for (var i = 0; i < a.length; i++) { 343 if (a[i]) a[i]();
344 a[i] = null 345 } 346 n = null 347 } 348 } 349 } 350 } 351 352 if (i("script[src='" + e + "']").length === 0) { 353 a = l.getScriptCallbacks[e] = []; 354 a.push(t); 355 o = document.createElement("script"); 356 var s = document.body.getElementsByTagName("script")[0]; 357 o.async = 1; 358 o.setAttribute("data-cfasync", false); 359 if (s != null) { 360 s.parentNode.insertBefore(o, s); 361 s = null 362 } else { 363 document.body.appendChild(o) 364 } 365 o.addEventListener("load", r, false); 366 o.addEventListener("readystatechange", r, false); 367 o.addEventListener("complete", r, false); 368 if (n) { 369 o.addEventListener("error", n, false) 370 } 371 o.src = e + (N.dom == "MS" ? "?" + Math.random(1) : "") 372 } else { 373 a.push(t) 374 } 375 }, 376 isHardPage: function (e, t, i, n) { 377 if (e != null) { 378 if (e == "cover") { 379 return t == 0 || n && t == 1 || t == Math.ceil(i / (n ? 1 : 2)) - (n ? 0 : 1) 380 } else if (e == "all") { 381 return true 382 } else { 383 var a = ("," + e + ",").indexOf("," + (t * 2 + 1) + ",") > -1; 384 var o = ("," + e + ",").indexOf("," + (t * 2 + 2) + ",") > -1; 385 return a || o 386 } 387 } 388 return false 389 }, 390 fixMouseEvent: function (e) { 391 if (e) { 392 var t = e.originalEvent || e; 393 if (t.changedTouches && t.changedTouches.length > 0) { 394 var n = i.event.fix(e); 395 var a = t.changedTouches[0]; 396 n.clientX = a.clientX; 397 n.clientY = a.clientY; 398 n.pageX = a.pageX; 399 n.touches = t.touches; 400 n.pageY = a.pageY; 401 n.movementX = a.movementX; 402 n.movementY = a.movementY; 403 return n 404 } else { 405 return e 406 } 407 } else { 408 return e 409 } 410 }, 411 hasWebgl: function () { 412 try { 413 var e = document.createElement("canvas"); 414 return !!(window.WebGLRenderingContext && (e.getContext("webgl") || e.getContext("experimental-webgl"))) 415 } catch (e) { 416 return false 417 } 418 }(), 419 isBookletMode: function (e) { 420 return e.pageMode == t.PAGE_MODE.SINGLE && e.singlePageMode == t.SINGLE_PAGE_MODE.BOOKLET 421 }, 422 isRTLMode: function (e) { 423 return e.direction == t.DIRECTION.RTL 424 }, 425 isMobile: function () { 426 var e = false; 427 (function (t) { 428 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
428sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4))) e = true 429 })(s || navigator.vendor || window.opera); 430 return e 431 }(), 432 isIOS: /(iPad|iPhone|iPod)/g.test(s), 433 isSafari: /constructor/i.test(window.HTMLElement) || function (e) { 434 return e.toString() === "[object SafariRemoteNotification]" 435 }(!window["safari"] || safari.pushNotification), 436 prefix: function () { 437 var e = window.getComputedStyle(document.documentElement, ""), 438 t = Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)[1], 439 i = "WebKit|Moz|MS".match(new RegExp("(" + t + ")", "i"))[1]; 440 return {dom: i, lowercase: t, css: "-" + t + "-", js: t[0].toUpperCase() + t.substr(1)} 441 }(), 442 __extends: function (e, t) { 443 for (var i in t) if (t.hasOwnProperty(i)) e[i] = t[i]; 444 445 function n() { 446 this.constructor = e 447 } 448 449 n.prototype = t.prototype; 450 e.prototype = new n; 451 e.__super = t.prototype; 452 return e 453 } 454 }; 455 var c = t.SOURCE_TYPE, u = t.DISPLAY_TYPE, d = l.drag, f = l.mouseEvents, h = l.html, p = l.isset, g = l.isnull, 456 v = l.toRad, m = l.toDeg, b = l.transition, w = l.translateStr, x = l.resetBoxShadow, P = l.rotateStr, y = l.bg, 457 C = l.bgImage, L = l.src, S = l.limitAt, E = l.distOrigin, I = l.distPoints, T = l.angleByDistance, k = l.log, 458 O = l.nearestPowerOfTwo, R = l.extendOptions, F = l.getBasePage, M = l.getScript, D = l.fixMouseEvent, 459 N = l.prefix, A = l.isBookletMode, z = l.isRTLMode, B = l.isMobile, j = l.hasWebgl, _ = l.isSafari, U = l.isIOS, 460 H = l.__extends; 461 (function e() { 462 if (window.CanvasPixelArray) { 463 if (typeof window.CanvasPixelArray.prototype.set !== "function") { 464 window.CanvasPixelArray.prototype.set = function (e) { 465 for (var t = 0, i = this.length; t < i; t++) { 466 this[t] = e[t] 467 } 468 } 469 } 470 } else { 471 var t = false, i; 472 if (_) { 473 i = s.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); 474 t = i && parseInt(i[1]) < 6 475 } 476 if (t) { 477 var n = window.CanvasRenderingContext2D.prototype; 478 var a = n.createImageData; 479 n.createImageData = function (e, t) { 480 var i = a.call(this, e, t); 481 i.data.set = function (e) { 482 for (var t = 0, i = this.length; t < i; t++) { 483 this[t] = e[t] 484 } 485 }; 486 return i 487 }; 488 n = null 489 } 490 } 491 })(); 492 (function e() { 493 function t(e) { 494 window.setTimeout(e, 20) 495 } 496 497 if ("requestAnimationFrame" in window) { 498 return 499 } 500 window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || t 501 })(); 502 (function e() { 503 if (typeof Uint8Array !== "undefined") { 504 if (typeof Uint8Array.prototype.subarray === "undefined") { 505 Uint8Array.prototype.subarray = function e(t, i) { 506 return new Uint8Array(this.slice(t, i)) 507 }; 508 Float32Array.prototype.subarray = function e(t, i) { 509 return new Float32Array(this.slice(t, i)) 510 } 511 } 512 if (typeof Float64Array === "undefined") { 513 window.Float64Array = Float32Array 514 } 515 return 516 } 517 518 function t(e, t) { 519 return new n(this.slice(e, t)) 520 } 521 522 function i(e, t) { 523 if (arguments.length < 2) { 524 t = 0 525 } 526 for (var i = 0, n = e.length; i < n; ++i, ++t) { 527 this[t] = e[i] & 255 528 } 529 } 530 531 function n(e) { 532 var n, a, o; 533 if (typeof e === "number") { 534 n = []; 535 for (a = 0; a < e; ++a) { 536 n[a] = 0 537 } 538 } else if ("slice" in e) { 539 n = e.slice(0) 540 } else { 541 n = []; 542 for (a = 0, o = e.length; a < o; ++a) { 543 n[a] = e[a] 544 } 545 } 546 n.subarray = t; 547 n.buffer = n; 548 n.byteLength = n.length; 549 n.set = i; 550 if (typeof e === "object" && e.buffer) { 551 n.buffer = e.buffer 552 } 553 return n 554 } 555 556 window.Uint8Array = n; 557 window.Int8Array = n; 558 window.Uint32Array = n; 559 window.Int32Array = n; 560 window.Uint16Array = n; 561 window.Float32Array = n; 562 window.Float64Array = n 563 })(); 564 var W = function (e) { 565 return i.extend(true, {}, n, e) 566 }; 567 var V = function (e, n) { 568 var a = "df-ui"; 569 var o = "df-ui-wrapper"; 570 var r = a + "-" + "btn"; 571 var s = z(n.target); 572 var c = n.ui = i(h.div, {class: a}); 573 var u = n.options; 574 c.dispose = function () { 575 e.find("." + r).each(function () { 576 i(this).off() 577 }); 578 P.off(); 579 f.off(); 580 p.off(); 581 g.off(); 582 v.off(); 583 m.off(); 584 b.off(); 585 w.off(); 586 y.off(); 587 E.off(); 588 M.off(); 589 D.off(); 590 j.off(); 591 _.off(); 592 H.off(); 593 W.off(); 594 V.off(); 595 G.off(); 596 q.off(); 597 Z.off(); 598 N.remove(); 599 x.remove(); 600 p.remove(); 601 f.remove(); 602 v.remove(); 603 if (c.shareBox) { 604 if (c.shareBox.dispose) c.shareBox.dispose(); 605 c.shareBox = null 606 } 607 document.removeEventListener("keyup", be, false); 608 window.removeEventListener("click", I, false); 609 c.update = null; 610 n = null 611 }; 612 var d = function (e) { 613 if (isNaN(e)) e = n.target._activePage; else if (e < 1) e = 1; else if (e >
vendor: 213,036 bytes, lines 613-5512
613 n.target.pageCount) e = n.target.pageCount; 614 return e 615 }; 616 var f = c.next = i(h.div, { 617 class: r + " " + a + "-next " + u.icons["next"], 618 title: s ? u.text.previousPage : u.text.nextPage, 619 html: "<span>" + u.text.nextPage + "</span>" 620 }).on("click", function () { 621 n.next() 622 }); 623 var p = c.prev = i(h.div, { 624 class: r + " " + a + "-prev " + u.icons["prev"], 625 title: s ? u.text.nextPage : u.text.previousPage, 626 html: "<span>" + u.text.previousPage + "</span>" 627 }).on("click", function () { 628 n.prev() 629 }); 630 var g = i(h.div, { 631 class: r + " " + a + "-play " + u.icons["play"], 632 title: u.text.play, 633 html: "<span>" + u.text.play + "</span>" 634 }).on("click", function () { 635 var e = i(this); 636 n.setAutoPlay(!e.hasClass(u.icons["pause"])) 637 }); 638 if (u.autoPlay == true) { 639 c.play = g; 640 n.setAutoPlay(u.autoPlayStart) 641 } 642 var v = i(h.div, {class: o + " " + a + "-zoom"}); 643 var m = c.zoomIn = i(h.div, { 644 class: r + " " + a + "-zoomin " + u.icons["zoomin"], 645 title: u.text.zoomIn, 646 html: "<span>" + u.text.zoomIn + "</span>" 647 }).on("click", function () { 648 n.zoom(1); 649 c.update(); 650 if (n.target.startPoint && n.target.pan) n.target.pan(n.target.startPoint) 651 }); 652 var b = c.zoomOut = i(h.div, { 653 class: r + " " + a + "-zoomout " + u.icons["zoomout"], 654 title: u.text.zoomOut, 655 html: "<span>" + u.text.zoomOut + "</span>" 656 }).on("click", function () { 657 n.zoom(-1); 658 c.update(); 659 if (n.target.startPoint && n.target.pan) n.target.pan(n.target.startPoint) 660 }); 661 v.append(m).append(b); 662 var w = c.pageNumber = i(h.div, {class: r + " " + a + "-page"}).on("change", function () { 663 var e = parseInt(c.pageInput.val(), 10); 664 e = d(e); 665 n.gotoPage(e) 666 }).on("keyup", function (e) { 667 if (e.keyCode == 13) { 668 var t = parseInt(c.pageInput.val(), 10); 669 t = d(t); 670 if (t !== d(n.target._activePage || n._activePage)) n.gotoPage(t) 671 } 672 }); 673 c.pageInput = i('<input id="df_book_page_number" type="text"/>').appendTo(w); 674 c.pageLabel = i('<label for="df_book_page_number"/>').appendTo(w); 675 var x = i(h.div, {class: o + " " + a + "-size"}); 676 var P = i(h.div, { 677 class: r + " " + a + "-help " + u.icons["help"], 678 title: u.text.toggleHelp, 679 html: "<span>" + u.text.toggleHelp + "</span>" 680 }).on("click", function () { 681 }); 682 var y = c.sound = i(h.div, { 683 class: r + " " + a + "-sound " + u.icons["sound"], 684 title: u.text.toggleSound, 685 html: "<span>" + u.text.toggleSound + "</span>" 686 }).on("click", function () { 687 u.soundEnable = !u.soundEnable; 688 c.updateSound() 689 }); 690 c.updateSound = function () { 691 if (u.soundEnable == false || u.soundEnable == "false") y.addClass("disabled"); else y.removeClass("disabled") 692 }; 693 c.updateSound(); 694 695 function C(e) { 696 c.search.removeClass("df-active") 697 } 698 699 if (typeof u.source == "string" && u.search == true) { 700 var L = c.search = i(h.div, {class: r + " " + a + "-search " + u.icons["search"]}).on("click", function (e) { 701 if (!L.hasClass("df-active")) { 702 i(this).addClass("df-active"); 703 e.stopPropagation() 704 } 705 }); 706 window.addEventListener("click", C, false); 707 var S = i(h.div, {class: "search-container"}); 708 L.append(S) 709 } 710 var E = c.more = i(h.div, {class: r + " " + a + "-more " + u.icons["more"]}).on("click", function (e) { 711 if (!E.hasClass("df-active")) { 712 i(this).addClass("df-active"); 713 e.stopPropagation() 714 } 715 }); 716 717 function I(e) { 718 E.removeClass("df-active") 719 } 720 721 window.addEventListener("click", I, false); 722 723 var T = i(h.div, {class: "more-container"}); 724 E.append(T); 725 if (typeof u.source == "string" && u.enableDownload == true) { 726 var O = r + " " + a + "-download " + u.icons["download"]; 727 var R = c.download = i('<a download target="_blank" class="' + O + '"><span>' + u.text.downloadPDFFile + "</span></a>"); 728 R.attr("href", u.source).attr("title", u.text.downloadPDFFile) 729 } 730 var F = l.hasFullscreenEnabled(); 731 if (!F) { 732 e.addClass("df-custom-fullscreen") 733 } 734 c.switchFullscreen = function () { 735 var e = l.getFullscreenElement(); 736 var t = n.container[0]; 737 if (c.isFullscreen != true) { 738 n.container.addClass("df-fullscreen"); 739 if (t.requestFullscreen) { 740 t.requestFullscreen() 741 } else if (t.msRequestFullscreen) { 742 t.msRequestFullscreen() 743 } else if (t.mozRequestFullScreen) { 744 t.mozRequestFullScreen() 745 } else if (t.webkitRequestFullscreen) { 746 t.webkitRequestFullscreen() 747 } 748 c.isFullscreen = true 749 } else { 750 n.container.removeClass("df-fullscreen"); 751 c.isFullscreen = false; 752 if (document.exitFullscreen) { 753 if (document.fullscreenElement) document.exitFullscreen() 754 } else if (document.msExitFullscreen) { 755 document.msExitFullscreen() 756 } else if (document.mozCancelFullScreen) { 757 if (document.fullscreenElement) document.mozCancelFullScreen() 758 } else if (document.webkitExitFullscreen) { 759 document.webkitExitFullscreen() 760 } 761 } 762 if (!l.hasFullscreenEnabled()) { 763 setTimeout(function () { 764 n.resize() 765 }, 50) 766 } 767 }; 768 var M = c.fullScreen = i(h.div, { 769 class: r + " " + a + "-fullscreen " + u.icons["fullscreen"], 770 title: u.text.toggleFullscreen, 771 html: "<span>" + u.text.toggleFullscreen + "</span>" 772 }).on("click", c.switchFullscreen); 773 var D = c.fit = i(h.div, {class: r + " " + a + "-fit " + u.icons["fitscreen"]}).on("click", function () { 774 i(this).toggleClass("df-button-fit-active") 775 }); 776 x.append(M); 777 var N = i(h.div, {class: o + " " + a + "-controls"}); 778 var A = c.shareBox = new t.Share(e, u); 779 var j = c.share = i(h.div, { 780 class: r + " " + a + "-share " + u.icons["share"], 781 title: u.text.share, 782 html: "<span>" + u.text.share + "</span>" 783 }).on("click", function (e) { 784 if (c.shareBox.isOpen == true) c.shareBox.close(); else { 785 c.shareBox.update(n.getURLHash()); 786 c.shareBox.show() 787 } 788 }); 789 var _ = c.startPage = i(h.div, { 790 class: r + " " + a + "-start " + (s ? u.icons["end"] : u.icons["start"]), 791 title: u.text.gotoFirstPage, 792 html: "<span>" + u.text.gotoFirstPage + "</span>" 793 }).on("click", function () { 794 n.start() 795 }); 796 var H = c.endPage = i(h.div, { 797 class: r + " " + a + "-end " + (s ? u.icons["start"] : u.icons["end"]), 798 title: u.text.gotoLastPage, 799 html: "<span>" + u.text.gotoLastPage + "</span>" 800 }).on("click", function () { 801 n.end() 802 }); 803 var W = c.pageMode = i(h.div, { 804 class: r + " " + a + "-pagemode " + u.icons["singlepage"], 805 html: "<span>" + u.text.singlePageMode + "</span>" 806 }).on("click", function () { 807 var e = i(this); 808 n.setPageMode(!e.hasClass(u.icons["doublepage"])) 809 }); 810 n.setPageMode(n.target.pageMode == t.PAGE_MODE.SINGLE); 811 var V = c.altPrev = i(h.div, { 812 class: r + " " + a + "-prev" + " " + a + "-alt " + u.icons["prev"], 813 title: s ? u.text.nextPage : u.text.previousPage, 814 html: "<span>" + u.text.previousPage + "</span>" 815 }).on("click", function () { 816 n.prev() 817 }); 818 var G = c.altNext = i(h.div, { 819 class: r + " " + a + "-next" + " " + a + "-alt " + u.icons["next"], 820 title: s ? u.text.previousPage : u.text.nextPage, 821 html: "<span>" + u.text.nextPage + "</span>" 822 }).on("click", function () { 823 n.next() 824 }); 825 var q = c.thumbnail = i(h.div, { 826 class: r + " " + a + "-thumbnail " + u.icons["thumbnail"], 827 title: u.text.toggleThumbnails, 828 html: "<span>" + u.text.toggleThumbnails + "</span>" 829 }).on("click", function () { 830 var e = i(this); 831 if (n.target.thumbContainer) { 832 var t = n.target.thumbContainer; 833 t.toggleClass("df-sidemenu-visible"); 834 e.toggleClass("df-active") 835 } else { 836 n.contentProvider.initThumbs(); 837 e.toggleClass("df-active") 838 } 839 if (e.hasClass("df-active")) { 840 e.siblings(".df-active").trigger("click") 841 } 842 c.update(true) 843 }); 844 var Z = c.outline = i(h.div, { 845 class: r + " " + a + "-outline " + u.icons["outline"], 846 title: u.text.toggleOutline, 847 html: "<span>" + u.text.toggleOutline + "</span>" 848 }).on("click", function () { 849 var e = i(this); 850 if (n.target.outlineContainer) { 851 var t = n.target.outlineContainer; 852 e.toggleClass("df-active"); 853 t.toggleClass("df-sidemenu-visible"); 854 if (e.hasClass("df-active")) { 855 e.siblings(".df-active").trigger("click") 856 } 857 c.update(true) 858 } 859 }); 860 var Y = u.allControls.replace(/ /g, "").split(","), K = "," + u.moreControls.replace(/ /g, "") + ",", 861 X = "," + u.hideControls.replace(/ /g, "") + ","; 862 if (U && B) { 863 X += ",fullScreen," 864 } 865 var Q = K.split(","); 866 for (var $ = 0; $ < Y.length; $++) { 867 var J = Y[$]; 868 if (X.indexOf("," + J + ",") < 0) { 869 var ee = c[J]; 870 if (ee != null && typeof ee == "object") { 871 if (K.indexOf("," + J + ",") > -1 && J !== "more" && J !== "pageNumber") { 872 T.append(ee) 873 } else { 874 N.append(ee) 875 } 876 } 877 } 878 } 879 e.append(N).append(p).append(f).append(v); 880 var te = false, ie = false, ne = false; 881 var ae = 16, oe = 17, re = 18, se = 83, le = 86, ce = 67, ue = 69, de = 71, fe = 78, he = 79, pe = 46, ge = 39, 882 ve = 37, me = 27; 883 document.addEventListener("keyup", be, false); 884 885 function be(e) { 886 switch (e.keyCode) { 887 case me: 888 if (c.isFullscreen == true) { 889 c.fullScreen.trigger("click") 890 } else if (window.dfLightBox && window.dfActiveLightBoxBook) { 891 window.dfLightBox.closeButton.trigger("click") 892 } 893 break; 894 case ae: 895 ie = false; 896 break; 897 case oe: 898 te = false; 899 break; 900 case re: 901 ne = false; 902 break; 903 case ve: 904 n.prev(); 905 break; 906 case ge: 907 n.next(); 908 break; 909 default: 910 break 911 } 912 } 913 914 c.update = function (i) { 915 k("ui update"); 916 var a = n.target; 917 var o = d(a._activePage || n._activePage); 918 var r = a.pageCount || n.pageCount; 919 var s = a.direction == t.DIRECTION.RTL, l = o == 1 || o == 0, u = o == r; 920 c.next.show(); 921 c.prev.show(); 922 c.altNext.removeClass("disabled"); 923 c.altPrev.removeClass("disabled"); 924 if (l && !s || u && s) { 925 c.prev.hide(); 926 c.altPrev.addClass("disabled") 927 } 928 if (u && !s || l && s) { 929 c.next.hide(); 930 c.altNext.addClass("disabled") 931 } 932 c.pageInput.val(o); 933 c.pageLabel.html(o + "/" + r); 934 if (e.find(".df-sidemenu-visible").length > 0) { 935 e.addClass("df-sidemenu-open") 936 } else { 937 e.removeClass("df-sidemenu-open") 938 } 939 if (i == true) n.resize(); 940 if (a.contentProvider.zoomScale == a.contentProvider.maxZoom) { 941 c.zoomIn.addClass("disabled") 942 } else { 943 c.zoomIn.removeClass("disabled") 944 } 945 if (a.contentProvider.zoomScale == 1) { 946 c.zoomOut.addClass("disabled") 947 } else { 948 c.zoomOut.removeClass("disabled") 949 } 950 }; 951 if (n.target != null) { 952 n.target.ui = c 953 } 954 if (u.onCreateUI != null) u.onCreateUI(n) 955 }; 956 var G = null; 957 958 function q() { 959 G = function (e) { 960 H(t, e); 961 962 function t(t) { 963 t = t || {}; 964 var a = this; 965 e.call(this, t); 966 a.options = t; 967 a.canvas = i(a.renderer.domElement).addClass("df-3dcanvas"); 968 a.container = t.container; 969 a.container.append(a.canvas); 970 a.type = "PreviewStage"; 971 a.mouse = new THREE.Vector2; 972 a.raycaster = new THREE.Raycaster; 973 a.camera.position.set(0, 20, 600); 974 a.camera.lookAt(new THREE.Vector3(0, 0, 0)); 975 a.spotLight.position.set(-220, 330, 550); 976 a.spotLight.castShadow = B ? false : t.webglShadow; 977 if (a.spotLight.shadow) { 978 a.spotLight.shadow.bias = -8e-4 979 } 980 a.spotLight.intensity = p(t.spotLightIntensity, n.spotLightIntensity); 981 a.ambientLight.color = new THREE.Color(p(t.ambientLightColor, n.ambientLightColor)); 982 a.ambientLight.intensity = p(t.ambientLightIntensity, n.ambientLightIntensity); 983 var o = new THREE.ShadowMaterial; 984 o.opacity = p(t.shadowOpacity, n.shadowOpacity); 985 a.ground.material = o; 986 a.ground.position.z = -2; 987 a.orbitControl.maxAzimuthAngle = 0; 988 a.orbitControl.minAzimuthAngle = 0; 989 a.orbitControl.minPolarAngle = Math.PI / 2; 990 a.orbitControl.maxPolarAngle = 2.2; 991 a.orbitControl.mouseButtons.ORBIT = THREE.MOUSE.RIGHT; 992 a.orbitControl.mouseButtons.PAN = -1; 993 a.orbitControl.maxDistance = 5e3; 994 a.orbitControl.minDistance = 50; 995 a.orbitControl.noZoom = true; 996 a.selectiveRendering = true; 997 a.orbitControl.zoomSpeed = 5; 998 a.orbitControl.keyPanSpeed = 0; 999 a.orbitControl.center.set(0, 0, 0); 1000 a.orbitControl.update(); 1001 a.swipe_threshold = B ? 15 : 20; 1002 var r = a.cssRenderer = new THREE.CSS3DRenderer; 1003 i(r.domElement).css({ 1004 position: "absolute", 1005 top: 0, 1006 pointerEvents: "none" 1007 }).addClass("df-3dcanvas df-csscanvas"); 1008 a.container[0].appendChild(r.domElement); 1009 var s = a.cssScene = new THREE.Scene; 1010 var c = document.createElement("div"); 1011 c.className = "df-page-content df-page-content-left"; 1012 var u = document.createElement("div"); 1013 u.className = "df-page-content df-page-content-right"; 1014 var d = s.divLeft = new THREE.CSS3DObject(c); 1015 var h = s.divRight = new THREE.CSS3DObject(u); 1016 s.add(d); 1017 s.add(h); 1018 a.resizeCallback = function () { 1019 r.setSize(a.canvas.width(), a.canvas.height()) 1020 }; 1021 1022 function g() { 1023 a.renderRequestPending = true 1024 } 1025 1026 window.addEventListener(f.move, g, false); 1027 window.addEventListener("keyup", g, false); 1028 a.dispose = function () { 1029 -a.clearChild(); 1030 a.render(); 1031 window.removeEventListener(f.move, g, false); 1032 if (a.options.scrollWheel == true) { 1033 a.container[0].removeEventListener("mousewheel", v, false); 1034 a.container[0].removeEventListener("DOMMouseScroll", v, false) 1035 } 1036 window.removeEventListener("keyup", g, false); 1037 a.renderer.domElement.removeEventListener("mousemove", m, false); 1038 a.renderer.domElement.removeEventListener("touchmove", m, false); 1039 a.renderer.domElement.removeEventListener("mousedown", b, false); 1040 a.renderer.domElement.removeEventListener("touchstart", b, false); 1041 a.renderer.domElement.removeEventListener("mouseup", x, false); 1042 a.renderer.domElement.removeEventListener("touchend", x, false); 1043 a.canvas.remove(); 1044 r.domElement.parentNode.removeChild(r.domElement); 1045 r = null; 1046 a.renderCallback = null; 1047 a.renderCallback = null; 1048 a.orbitControl.dispose(); 1049 a.orbitControl = null; 1050 a.renderer.dispose(); 1051 a.cancelRAF() 1052 }; 1053 a.renderCallback = function () { 1054 if (TWEEN.getAll().length > 0) a.renderRequestPending = true; 1055 TWEEN.update(); 1056 r.render(s, a.camera) 1057 }; 1058 var v = function (e) { 1059 var t = 0; 1060 if (e.wheelDelta != null) { 1061 t = e.wheelDelta 1062 } else if (e.detail != null) { 1063 t = -e.detail 1064 } 1065 if (t) { 1066 var i = a.previewObject.contentProvider.zoomScale; 1067 if (t > 0 && i == 1 || t < 0 && i > 1) { 1068 e.preventDefault() 1069 } 1070 a.previewObject.zoom(t > 0 ? 1 : -1) 1071 } 1072 g() 1073 }; 1074 var m = function (e) { 1075 a.renderRequestPending = true; 1076 e = D(e); 1077 if (a.isMouseDown && e.movementX != 0 && e.movementY != 0) { 1078 a.isMouseMoving = true 1079 } 1080 if (e.touches != null && e.touches.length == 2 && a.startTouches != null) { 1081 a.zoomDirty = true; 1082 var t = l.getVectorAvg(l.getTouches(e, a.container.offset())), 1083 i = l.calculateScale(a.startTouches, l.getTouches(e)), n = i / a.lastScale; 1084 var o = a.previewObject.contentProvider.zoomScale, r = t.x, s = t.y; 1085 a.camera.position.z = a.originalZ / i; 1086 a.lastScale = i; 1087 a.lastZoomCenter = t; 1088 e.preventDefault(); 1089 return 1090 } 1091 if (a.isMouseDown == true && a.previewObject.contentProvider.zoomScale == 1) { 1092 var c = e.pageX - a.lastPos, u = performance.now() - a.lastTime; 1093 if (Math.abs(c) > a.swipe_threshold) { 1094 if (c < 0) { 1095 a.target.next() 1096 } else { 1097 a.target.prev() 1098 } 1099 e.preventDefault(); 1100 a.isMouseDown = false 1101 } 1102 a.lastPos = e.pageX; 1103 a.lastTime = performance.now() 1104 } 1105 }; 1106 var b = function (e) { 1107 e = D(e); 1108 if (e.touches != null && e.touches.length == 2 && a.startTouches == null) { 1109 a.startTouches = l.getTouches(e); 1110 a.lastScale = 1; 1111 a.originalZ = a.camera.position.z * 1 1112 } 1113 document.activeElement.blur(); 1114 a.mouseValue = e.pageX + "," + e.pageY; 1115 a.isMouseMoving = false; 1116 a.isMouseDown = true; 1117 a.lastPos = e.pageX; 1118 a.lastTime = performance.now() 1119 }; 1120 var w = function (e) { 1121 a.isMouseDown = false; 1122 if (e.button !== 0) return this; 1123 var t = e.pageX + "," + e.pageY; 1124 if (a.isMouseMoving) { 1125 } else if (t == a.mouseValue) { 1126 e = e || window.event; 1127 e = i.event.fix(e); 1128 var n = a.mouse, o = a.raycaster; 1129 n.x = e.offsetX / a.canvas.innerWidth() * 2 - 1; 1130 n.y = 1 - e.offsetY / a.canvas.innerHeight() * 2; 1131 o.setFromCamera(n, a.camera); 1132 var r = o.intersectObjects(a.target instanceof MOCKUP.Bundle ? a.target.children : [a.target], true); 1133 if (r.length > 0) { 1134 var s, l = 0; 1135 do { 1136 s = r[l] != null ? r[l].object : null; 1137 l++ 1138 } while ((s instanceof THREE.BoxHelper || !(s instanceof MOCKUP.Paper) || s.isFlipping == true) && l < r.length); 1139 if (s.userData.object != null) { 1140 } else { 1141 if (s.angles[1] > 90) { 1142 if (s.isEdge != true) a.target.next() 1143 } else { 1144 if (s.isEdge != true) a.target.prev() 1145 } 1146 } 1147 } else { 1148 } 1149 } 1150 }; 1151 var x = function (e) { 1152 e = D(e); 1153 if (e.touches != null && e.touches.length == 0) { 1154 var t = a.previewObject.contentProvider.zoomScale; 1155 if (a.zoomDirty == true) { 1156 a.previewObject.contentProvider.zoomScale = l.limitAt(a.previewObject.contentProvider.zoomScale * a.lastScale, 1, a.previewObject.contentProvider.maxZoom); 1157 a.previewObject.zoomValue = a.previewObject.contentProvider.zoomScale * 1; 1158 a.previewObject.resize(); 1159 a.zoomDirty = false 1160 } 1161 a.lastScale = null; 1162 a.startTouches = null 1163 } 1164 if (e.touches != null && e.touches.length > 1) return; 1165 w(e) 1166 }; 1167 a.renderer.domElement.addEventListener("mousemove", m, false); 1168 a.renderer.domElement.addEventListener("touchmove", m, false); 1169 a.renderer.domElement.addEventListener("mousedown", b, false); 1170 a.renderer.domElement.addEventListener("touchstart", b, false); 1171 a.renderer.domElement.addEventListener("mouseup", x, false); 1172 a.renderer.domElement.addEventListener("touchend", x, false); 1173 if (a.options.scrollWheel == true) { 1174 a.container[0].addEventListener("mousewheel", v, false); 1175 a.container[0].addEventListener("DOMMouseScroll", v, false) 1176 } 1177 i(a.renderer.domElement).css({display: "block"}); 1178 i(window).trigger("resize"); 1179 return this 1180 } 1181 1182 t.prototype.width = function () { 1183 return this.container.width() 1184 }; 1185 t.prototype.height = function () { 1186 return this.container.height() 1187 }; 1188 return t 1189 }(MOCKUP.Stage); 1190 MOCKUP.PreviewStage = G; 1191 var e = function (e) { 1192 H(i, e); 1193 1194 function i(t, i) { 1195 t = t || {}; 1196 t.folds = 1; 1197 e.call(this, t, i); 1198 this.angle = 0; 1199 this.isFlipping = false; 1200 this.material.materials[5].transparent = true; 1201 this.material.materials[4].transparent = true; 1202 this.type = "BookPaper" 1203 } 1204 1205 i.prototype.tween = function (e, i) { 1206 var n = this; 1207 var a = 1e-5; 1208 n.originalStiff = n.stiffness; 1209 var o = n.newStiffness; 1210 var r = A(n.parent); 1211 var s = i - e; 1212 var l = e > 90; 1213 var c = n.parent.direction == t.DIRECTION.RTL; 1214 n.init = { 1215 angle: e, 1216 angle2: e < 90 ? 0 : 180, 1217 stiff: n.originalStiff, 1218 index: l && !c || !l && c ? 1 : 0 1219 }; 1220 n.first = { 1221 angle: e + s / 4, 1222 angle2: e < 90 ? 90 : 90, 1223 stiff: n.originalStiff, 1224 index: l && !c || !l && c ? 1 : .25 1225 }; 1226 n.mid = { 1227 angle: e + s * 2 / 4, 1228 angle2: e < 90 ? 135 : 45, 1229 stiff: n.newStiffness, 1230 index: l && !c || !l && c ? .5 : .5 1231 }; 1232 n.mid2 = { 1233 angle: e + s * 3 / 4, 1234 angle2: e < 90 ? 180 : 0, 1235 stiff: n.newStiffness, 1236 index: l && !c || !l && c ? .25 : 1 1237 }; 1238 n.end = {angle: i, angle2: e < 90 ? 180 : 0, stiff: n.newStiffness, index: l && !c || !l && c ? 0 : 1}; 1239 n.isFlipping = true; 1240 var u = function (e, t) { 1241 n.angles[1] = e.angle; 1242 n.angles[4] = n.isHard ? e.angle : e.angle2; 1243 if (n.isHard == true) { 1244 n.stiffness = 0 1245 } else { 1246 n.stiffness = e.stiff / (o + a) * (n.newStiffness + a); 1247 n.stiffness = isNaN(n.stiffness) ? 0 : e.stiff 1248 } 1249 if (r) { 1250 n.material.materials[5].opacity = n.material.materials[4].opacity = e.index; 1251 n.castShadow = l && !c || !l && c ? e.index > .5 : e.index > .5 1252 } 1253 n.updateAngle(true) 1254 }; 1255 if (r && (!l && !c || l && c)) { 1256 n.material.materials[5].opacity = n.material.materials[4].opacity = 0; 1257 n.castShadow = false 1258 } 1259 n.currentTween = new TWEEN.Tween(n.init).to({ 1260 angle: [n.first.angle, n.mid.angle, n.mid2.angle, n.end.angle], 1261 angle2: [n.first.angle2, n.mid.angle2, n.mid2.angle2, n.end.angle2], 1262 stiff: [n.first.stiff, n.mid.stiff, n.mid2.stiff, n.end.stiff], 1263 index: [n.first.index, n.mid.index, n.mid2.index, n.end.index] 1264 }, n.parent.duration).onUpdate(function (e) { 1265 u(this, e) 1266 }).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(function (e) { 1267 n.stiffness = n.newStiffness; 1268 n.updateAngle(); 1269 n.material.materials[5].opacity = n.material.materials[4].opacity = 1; 1270 n.castShadow = true; 1271 n.isFlipping = false; 1272 if (n.parent && n.parent.refresh) n.parent.refresh() 1273 }).start() 1274 }; 1275 return i 1276 }(MOCKUP.FlexBoxPaper); 1277 MOCKUP.BookPaper = e; 1278 var a = function (e) { 1279 H(i, e); 1280 1281 function i(i, n) { 1282 i = i || {}; 1283 i.segments = i.segments || 50; 1284 this.pageCount = i.pageCount; 1285 this.height = i.height; 1286 this.width = i.width; 1287 this.direction = i.direction || t.DIRECTION.LTR; 1288 this.startPage = 1; 1289 this.endPage = this.pageCount; 1290 this.stackCount = i.stackCount || 6; 1291 this.materials = []; 1292 e.call(this, i, n); 1293 this.angles = [0, 0, 0, 0, 0, 0]; 1294 this.stiffness = i.stiffness == null ? 1.5 : i.stiffness; 1295 this.hardConfig = i.hard; 1296 this._activePage = i.openPage || this.startPage; 1297 this.createStack(i); 1298 this.pageMode = i.pageMode || (B || this.pageCount <= 2 ? t.PAGE_MODE.SINGLE : t.PAGE_MODE.DOUBLE); 1299 this.singlePageMode = i.singlePageMode || (B ? t.SINGLE_PAGE_MODE.BOOKLET : t.SINGLE_PAGE_MODE.ZOOM); 1300 this.type = "Book" 1301 } 1302 1303 i.prototype.getPageByNumber = function (e) { 1304 var t = A(this) ? z(this) ? e + 1 : e : Math.floor((e - 1) / 2); 1305 return this.getObjectByName(t.toString()) 1306 }; 1307 i.prototype.isPageHard = function (e) { 1308 return l.isHardPage(this.hardConfig, e, this.pageCount) 1309 }; 1310 i.prototype.activePage = function (e) { 1311 if (e == null) return this._activePage; 1312 this.gotoPage(e) 1313 }; 1314 i.prototype.gotoPage = function (e) { 1315 e = parseInt(e, 10); 1316 this._activePage = e; 1317 if (this.autoPlay == true) { 1318 this.previewObject.setAutoPlay(this.autoPlay) 1319 } 1320 this.updatePage(e); 1321 if (this && this.thumblist && this.thumblist.review) this.thumblist.review() 1322 }; 1323 i.prototype.moveBy = function (e) { 1324 var t = this._activePage + e; 1325 t = S(t, this.startPage, this.endPage); 1326 if (this.firstFlipped != true) { 1327 this.previewObject.analytics({eventAction: "First Page Flip", options: this.previewObject.options}); 1328 this.firstFlipped = true 1329 } 1330 this.gotoPage(t) 1331 }; 1332 i.prototype.next = function (e) { 1333 if (e == null) e = this.direction == t.DIRECTION.RTL ? -this.pageMode : this.pageMode; 1334 this.moveBy(e) 1335 }; 1336 i.prototype.prev = function (e) { 1337 if (e == null) e = this.direction == t.DIRECTION.RTL ? this.pageMode : -this.pageMode; 1338 this.moveBy(e) 1339 }; 1340 i.prototype.updateAngle = function () { 1341 var e = this.angles[1]; 1342 var t = this.angles[4]; 1343 var i = t - e; 1344 var n = this.stackCount; 1345 for (var a = 0; a < n; a++) { 1346 var o = this.children[a]; 1347 o.angles[1] = e + a * i / (n * 100); 1348 o.stiffness = this.stiffness; 1349 o.updateAngle() 1350 } 1351 }; 1352 i.prototype.refresh = function () { 1353 this.updatePage(this._activePage); 1354 if (this.flipCallback != null) this.flipCallback() 1355 }; 1356 i.prototype.updatePage = function (e) { 1357 var i = this.direction == t.DIRECTION.RTL, a = A(this), o = F(e); 1358 var r = a ? 1 : 2; 1359 e = Math.floor(e / r); 1360 if (i) e = Math.ceil(this.pageCount / r) - e; 1361 var s = this.oldBaseNumber || 0; 1362 var l = this.pageCount / r; 1363 var c = this.stackCount; 1364 var u = .02; 1365 var d = .4; 1366 var f = a ? 0 : (.5 - Math.abs(l / 2 - e) / l) / this.stiffness; 1367 var h = 1; 1368 var p = Math.floor(c / 2); 1369 var g = false; 1370 if (s > e) { 1371 g = true; 1372 this.children[c - 1].skipFlip = true; 1373 this.children.unshift(this.children.pop()) 1374 } else if (s < e) { 1375 this.children[0].skipFlip = true; 1376 this.children.push(this.children.shift()) 1377 } 1378 var v = l - e; 1379 var m = 5 / l; 1380 var b = m * e / 2; 1381 var w = m * v / 2; 1382 var x = b < w ? w : b; 1383 for (var P = 0; P < c; P++) { 1384 var y = this.children[P]; 1385 var C = y.color; 1386 var L = y.angles[1]; 1387 var S; 1388 var E = e - p + P; 1389 if (i) E = a ? this.pageCount - E : Math.ceil(this.pageCount / 2) - E - 1; 1390 var I = y.isHard = this.isPageHard(E); 1391 var T = y.name; 1392 y.isEdge = false; 1393 if (P == 0) { 1394 y.depth = b < d ? d : b 1395 } else if (P == c - 1) { 1396 y.depth = w < d ? d : w 1397 } else { 1398 y.depth = d; 1399 y.isEdge = false 1400 } 1401 if (y.isFlipping == true) { 1402 y.depth = d 1403 } 1404 y.position.x = 0; 1405 var k = u * P, O = 180 - u * (P - p) + u * P; 1406 if (P < p) { 1407 y.newStiffness = I || this.stiffness == 0 ? 0 : f / (e / l) / 4; 1408 S = k; 1409 y.position.z = x - (-P + p) * d; 1410 if (g == true) y.position.z -= d 1411 } else { 1412 S = O; 1413 y.newStiffness = I || this.stiffness == 0 ? 0 : f / (Math.abs(l - e) / l) / 4; 1414 y.position.z = x - (-c + P + p + 1) * d - y.depth 1415 } 1416 if (y.isFlipping == false) { 1417 if (Math.abs(L - S) > 20 && y.skipFlip == false) { 1418 y.depth = d; 1419 var R = y.stiffness; 1420 if (L > S) { 1421 R = f / (Math.abs(l - e) / l) / 4 1422 } else { 1423 R = f / (e / l) / 4 1424 } 1425 y.position.z += d; 1426 y.stiffness = isNaN(R) ? y.stiffness : R; 1427 y.updateAngle(true); 1428 y.targetStiffness = I ? 0 : P < e ? f / (Math.abs(l - e) / l) / 4 : f / (e / l) / 4; 1429 y.targetStiffness = I ? 0 : isNaN(y.targetStiffness) ? y.stiffness : y.targetStiffness; 1430 y.isFlipping = true; 1431 y.tween(L, S); 1432 if (this.preFlipCallback != null) this.preFlipCallback() 1433 } else { 1434 y.skipFlip = false; 1435 y.newStiffness = isNaN(y.newStiffness) ? 0 : y.newStiffness; 1436 if (y.angles[1] != S || y.stiffness != y.newStiffness || y.depth != y.oldDepth) { 1437 y.angles[1] = y.angles[4] = S; 1438 y.stiffness = y.newStiffness; 1439 y.updateAngle(true) 1440 } else { 1441 } 1442 } 1443 } 1444 y.visible = a ? i ? P < p || y.isFlipping : P >= p || y.isFlipping : E >= 0 && E < l || a && E == l; 1445 if (this.requestPage != null) { 1446 y.name = E.toString(); 1447 if (y.name != T) { 1448 y.textureLoaded = false; 1449 y.frontImage(n.textureLoadFallback); 1450 y.frontPageStamp = "-1"; 1451 y.frontTextureLoaded = false; 1452 y.thumbLoaded = false; 1453 y.backImage(n.textureLoadFallback); 1454 y.backPageStamp = "-1"; 1455 y.backTextureLoaded = false; 1456 this.requestPage() 1457 } 1458 } 1459 y.oldDepth = y.depth; 1460 var M = Math.abs(y.geometry.boundingBox.max.x) < Math.abs(y.geometry.boundingBox.min.x) ? y.geometry.boundingBox.max.x : y.geometry.boundingBox.min.x; 1461 y.position.x = y.isEdge == true && y.isFlipping == false ? P < p ? M : -M : 0 1462 } 1463 this.oldBaseNumber = e; 1464 if (this.updatePageCallback != null) this.updatePageCallback() 1465 }; 1466 i.prototype.createCover = function (e) { 1467 e.width = e.width * 2; 1468 this.cover = new MOCKUP.BiFold(e); 1469 this.add(this.cover) 1470 }; 1471 i.prototype.createStack = function (e) { 1472 var t = "red,green,blue,yellow,orange,black".split(","); 1473 for (var i = 0; i < this.stackCount; i++) { 1474 e.angles = [, this.stackCount - i]; 1475 e.stiffness = (this.stackCount - i) / 100; 1476 var n = new MOCKUP.BookPaper(e); 1477 n.angles[1] = 180; 1478 n.index = i; 1479 n.updateAngle(); 1480 n.textureReady = false; 1481 n.textureRequested = false; 1482 this.add(n); 1483 n.color = t[i]; 1484 n.position.z = -1 * i 1485 } 1486 }; 1487 i.prototype.shininess = function (e) { 1488 if (e == null) { 1489 return this.mainObject.shininess() 1490 } else { 1491 this.mainObject.shininess(e) 1492 } 1493 }; 1494 i.prototype.bumpScale = function (e) { 1495 if (e == null) { 1496 return this.mainObject.bumpScale() 1497 } else { 1498 this.mainObject.bumpScale(e) 1499 } 1500 }; 1501 i.prototype.frontImage = function (e) { 1502 if (e == null) { 1503 return this.mainObject.frontImage() 1504 } else { 1505 this.mainObject.frontImage(e) 1506 } 1507 }; 1508 i.prototype.backImage = function (e) { 1509 if (e == null) { 1510 return this.mainObject.backImage() 1511 } else { 1512 this.mainObject.backImage(e) 1513 } 1514 }; 1515 return i 1516 }(MOCKUP.Bundle); 1517 MOCKUP.Book = a 1518 } 1519 1520 var Z = function (e) { 1521 function n(e) { 1522 e = e || {}; 1523 this.type = "PreviewObject"; 1524 var i = this; 1525 i.zoomValue = 1; 1526 1527 function n() { 1528 setTimeout(function () { 1529 i.resize() 1530 }, 50) 1531 } 1532 1533 window.addEventListener("resize", n, false); 1534 this.sound = document.createElement("audio"); 1535 this.sound.setAttribute("src", e.soundFile + "?ver=" + t.version); 1536 this.sound.setAttribute("type", "audio/mpeg"); 1537 this.autoPlayFunction = function () { 1538 if (i && i.target.autoPlay) { 1539 if (i.target.direction == t.DIRECTION.RTL) i.target.prev(); else i.target.next() 1540 } 1541 }; 1542 this.dispose = function () { 1543 clearInterval(this.autoPlayTimer); 1544 this.autoPlayTimer = null; 1545 this.autoPlayFunction = null; 1546 if (this.target && this.target.children) { 1547 for (var e = 0; e < this.target.children.length; e++) { 1548 var t = this.target.children[e]; 1549 if (t && t.currentTween) t.currentTween.stop() 1550 } 1551 } 1552 if (this.zoomTween) { 1553 if (this.zoomTween.stop) this.zoomTween.stop(); 1554 this.zoomTween = null 1555 } 1556 if (this.container && this.container.info && this.container.info.remove) this.container.info.remove(); 1557 if (this.target && this.target.dispose) this.target.dispose(); 1558 this.target = null; 1559 if (this.stage && this.stage.dispose) this.stage.dispose(); 1560 this.stage = null; 1561 if (this.ui && this.ui.dispose) this.ui.dispose(); 1562 this.ui = null; 1563 if (this.contentProvider && this.contentProvider.dispose) this.contentProvider.dispose(); 1564 this.contentProvider = null; 1565 window.removeEventListener("resize", n) 1566 } 1567 } 1568 1569 n.prototype = { 1570 start: function () { 1571 this.target.gotoPage(this.target.startPage) 1572 }, end: function () { 1573 this.target.gotoPage(this.target.endPage) 1574 }, next: function () { 1575 }, prev: function () { 1576 }, getPageTextContent: function (e) { 1577 return this.contentProvider.pdfDocument.getPage(e + 1).then(function (e) { 1578 return e.getTextContent({normalizeWhitespace: true}) 1579 }) 1580 }, calculateSize: function (e, t, i, n, a, o, r, s) { 1581 var l = e; 1582 var c = t - a; 1583 var u = l - n; 1584 var d = Math.ceil(s ? c : c / 2); 1585 var f = d / r; 1586 var h = null; 1587 if (o) { 1588 h = Math.min(f, i - n); 1589 l = h 1590 } else { 1591 h = Math.min(u, i - n) 1592 } 1593 var p = f > h; 1594 var g, v; 1595 if (p) { 1596 v = h; 1597 g = Math.floor(v * r) 1598 } else { 1599 g = d; 1600 v = Math.ceil(d / r) 1601 } 1602 if (o) { 1603 l = Math.max(v + n, 320) 1604 } 1605 return {stageHeight: l, isWide: p, height: v, width: g} 1606 }, zoom: function (e) { 1607 this.pendingZoom = true; 1608 this.zoomDelta = e; 1609 this.resize(); 1610 if (this.ui) this.ui.update() 1611 }, resize: function () { 1612 var e = this; 1613 if (e.target == null || e.target.ui == null || e.target.contentProvider == null || e.target.contentProvider.viewport == null || e.target.stage == null) return; 1614 if (this.ui && this.ui.isFullscreen == true && l.hasFullscreenEnabled() == true && l.getFullscreenElement() == null) { 1615 this.ui.switchFullscreen() 1616 } 1617 var n = e.target, a = e.container, o = e.options, r = n.stage, s = n.contentProvider, u = s.pageRatio, 1618 d = s.zoomViewport, f = z(n), h = n.mode !== "css", p = s.pageRatio > 1, 1619 g = this.ui.isFullscreen == true ? false : o.height === "auto", v, m, b, w, x, P, y, 1620 C = a.hasClass("df-sidemenu-open") ? 220 : 0, L = this.target.pageMode == t.PAGE_MODE.SINGLE; 1621 var I = a.width(); 1622 if (I < 400) { 1623 e.container.addClass("df-xs") 1624 } else { 1625 e.container.removeClass("df-xs") 1626 } 1627 var T = a.find(".df-ui-controls").height(); 1628 var k = o.paddingTop + (o.controlsPosition == t.CONTROLSPOSITION.TOP ? T : 0), O = o.paddingRight, 1629 R = o.paddingBottom + (o.controlsPosition == t.CONTROLSPOSITION.BOTTOM ? T : 0), F = o.paddingLeft; 1630 k = isNaN(k) ? 0 : S(k, 0, k), R = isNaN(R) ? 0 : S(R, 0, R), F = isNaN(F) ? 0 : S(F, 0, F), O = isNaN(O) ? 0 : S(O, 0, O); 1631 var M = k + R, D = F + O; 1632 var N = I - C; 1633 a.height(o.height); 1634 var A = i(window).height(); 1635 var B = Math.min(a.height(), A); 1636 var j = e.calculateSize(B, N, A, M, D, g, u, L); 1637 if (g) { 1638 B = _ = e.calculateSize(B, N + C, A, M, D, g, u, L).stageHeight 1639 } else { 1640 B = _ = j.stageHeight 1641 } 1642 a.height(B); 1643 var _ = B; 1644 var U = N - D, H = _ - M; 1645 b = Math.floor(L ? U : U / 2); 1646 m = Math.floor(b / u); 1647 v = m > H; 1648 if (v) { 1649 m = H; 1650 b = m * u 1651 } 1652 y = s.maxZoom = s.zoomViewport.height / m; 1653 if (e.zoomValue == null) e.zoomValue = 1; 1654 if (s.zoomScale == null) s.zoomScale = 1; 1655 if (e.pendingZoom == true && e.zoomDelta != null) { 1656 var W = e.zoomDelta, V, G = Math.max(m, b); 1657 e.zoomValue = e.zoomDelta > 0 ? e.zoomValue * e.options.zoomRatio : e.zoomValue / e.options.zoomRatio; 1658 e.zoomValue = S(e.zoomValue, 1, y); 1659 if (e.zoomValue == 1) { 1660 s.zoomScale = 1 1661 } else { 1662 s.zoomScale = S(e.zoomValue, 1, y) 1663 } 1664 } 1665 P = s.zoomScale; 1666 s.checkViewportSize(b, m, P); 1667 if (s.contentSourceType == c.PDF) { 1668 b = s.imageViewport.width / P; 1669 m = s.imageViewport.height / P 1670 } 1671 if (s.zoomScale != 1) { 1672 this.target.container.addClass("df-zoom-enabled") 1673 } 1674 var q = n.zoomWidth = Math.floor(b * P), Z = n.zoomHeight = Math.floor(m * P); 1675 var Y = q * 2; 1676 if (h) { 1677 var K = Z / n.height, X = N / _; 1678 var Q = P * (m + M) / K, $ = P * (b * (L ? 1 : 2) + D) / K; 1679 var J = v ? Q : $ / X; 1680 r.resizeCanvas(N, _); 1681 w = 1 / (2 * Math.tan(Math.PI * r.camera.fov * .5 / 180) / (J / P)) + 2.2; 1682 r.camera.updateProjectionMatrix(); 1683 r.renderRequestPending = true; 1684 var ee = (k - R) * (n.height / m) / P / 2; 1685 var te = s.zoomScale == 1; 1686 if (r.camera.position.z !== w && e.pendingZoom == true) { 1687 if (e.zoomTween != null) e.zoomTween.stop(); 1688 e.zoomTween = new TWEEN.Tween({ 1689 campos: r.camera.position.z, 1690 otx: r.orbitControl.target.x, 1691 oty: r.orbitControl.target.y, 1692 otz: r.orbitControl.target.z 1693 }).delay(0).to({campos: w, otx: 0, oty: ee, otz: 0}, 100).onUpdate(function () { 1694 r.camera.position.z = this.campos; 1695 if (te) { 1696 r.camera.position.y = this.oty; 1697 r.orbitControl.target = new THREE.Vector3(this.otx, this.oty, this.otz) 1698 } 1699 r.orbitControl.update() 1700 }).easing(TWEEN.Easing.Linear.None).onComplete(function () { 1701 r.camera.position.z = w; 1702 if (s.zoomScale == 1) { 1703 r.camera.position.set(0, ee, w); 1704 r.orbitControl.target = new THREE.Vector3(0, ee, 0) 1705 } 1706 r.orbitControl.update() 1707 }).start() 1708 } else { 1709 if (s.zoomScale == 1) { 1710 r.camera.position.set(0, ee, w); 1711 r.orbitControl.target = new THREE.Vector3(0, ee, 0) 1712 } 1713 r.orbitControl.update() 1714 } 1715 r.orbitControl.update(); 1716 r.orbitControl.mouseButtons.ORBIT = P != 1 ? -1 : THREE.MOUSE.RIGHT; 1717 r.orbitControl.mouseButtons.PAN = P != 1 ? THREE.MOUSE.LEFT : -1 1718 } else { 1719 n.pageWidth = Math.round(b); 1720 n.fullWidth = n.pageWidth * 2; 1721 n.height = Math.round(m); 1722 var ie = n.shiftHeight = Math.round(S((Z - _ + M) / 2, 0, Z)), 1723 ne = n.shiftWidth = Math.round(S((Y - N + D) / 2, 0, Y)); 1724 if (P == 1) { 1725 n.left = 0; 1726 n.top = 0 1727 } 1728 n.stage.css({ 1729 top: -ie, 1730 bottom: -ie, 1731 right: -ne + (f ? C : 0), 1732 left: -ne + (f ? 0 : C), 1733 paddingTop: k, 1734 paddingRight: O, 1735 paddingBottom: R, 1736 paddingLeft: F, 1737 transform: "translate3d(" + n.left + "px," + n.top + "px,0)" 1738 }); 1739 n.stageHeight = r.height(); 1740 n.wrapper.css({width: Y, height: Z, marginTop: B - Z - M > 0 ? (B - M - Z) / 2 : 0}); 1741 var ae = Math.floor(E(b, m) * P); 1742 n.stage.find(".df-page-wrapper").width(ae).height(ae); 1743 n.stage.find(".df-book-page, .df-page-front , .df-page-back, .df-page-fold-inner-shadow").height(Z).width(q) 1744 } 1745 e.checkCenter({type: "resize"}); 1746 if (s.zoomScale == 1) { 1747 this.target.container.removeClass("df-zoom-enabled") 1748 } 1749 if (n.thumblist) { 1750 n.thumblist.reset(i(n.thumblist.container).height()) 1751 } 1752 e.pendingZoom = false 1753 }, playSound: function () { 1754 try { 1755 if (this.options && this.options.soundEnable == true) { 1756 this.sound.currentTime = 0; 1757 this.sound.play() 1758 } 1759 } catch (e) { 1760 } 1761 }, setPageMode: function (e) { 1762 if (e == true) { 1763 this.ui.pageMode.addClass(this.options.icons["doublepage"]); 1764 this.ui.pageMode.html("<span>" + this.options.text.doublePageMode + "</span>"); 1765 this.ui.pageMode.attr("title", this.options.text.doublePageMode); 1766 this.target.pageMode = t.PAGE_MODE.SINGLE 1767 } else { 1768 this.ui.pageMode.removeClass(this.options.icons["doublepage"]); 1769 this.ui.pageMode.html("<span>" + this.options.text.singlePageMode + "</span>"); 1770 this.ui.pageMode.attr("title", this.options.text.singlePageMode); 1771 this.target.pageMode = t.PAGE_MODE.DOUBLE 1772 } 1773 if (this.target && this.target.singlePageMode == t.SINGLE_PAGE_MODE.BOOKLET) { 1774 this.target.reset() 1775 } 1776 this.resize() 1777 }, setAutoPlay: function (e) { 1778 if (this.options.autoPlay) { 1779 e = e == true; 1780 var t = e ? this.options.text.pause : this.options.text.play; 1781 this.ui.play.toggleClass(this.options.icons["pause"], e); 1782 this.ui.play.html("<span>" + t + "</span>"); 1783 this.ui.play.attr("title", t); 1784 clearInterval(this.autoPlayTimer); 1785 if (e) { 1786 this.autoPlayTimer = setInterval(this.autoPlayFunction, this.options.autoPlayDuration) 1787 } 1788 this.target.autoPlay = e 1789 } 1790 }, height: function (e) { 1791 if (e == null) { 1792 return this.container.height() 1793 } else { 1794 this.options.height = e; 1795 this.container.height(e); 1796 this.resize() 1797 } 1798 }, checkCenter: function (e) { 1799 e = e == null ? {} : e; 1800 this.centerType = this.centerType || "start"; 1801 var i = this.target; 1802 var n = 0, a = 0, o = 0; 1803 var r = l.getBasePage(i._activePage); 1804 var s = i._activePage % 2 == 0; 1805 var c = i.direction == t.DIRECTION.RTL; 1806 var u = i.pageMode == t.PAGE_MODE.SINGLE, d = u && i.singlePageMode == t.SINGLE_PAGE_MODE.BOOKLET; 1807 var f = i.stage.width(), h; 1808 if (i.mode == "css") { 1809 h = i.wrapper.width(); 1810 n = Math.max((h - f) / 2, 0); 1811 a = -h / 4; 1812 o = h / 4; 1813 if (r == 0 || d) { 1814 i.wrapper.css({left: u ? c ? o - n : a - n : c ? o : a}); 1815 i.shadow.css({width: "50%", left: c ? 0 : "50%", transitionDelay: ""}) 1816 } else if (r == i.pageCount) { 1817 i.wrapper.css({left: u ? c ? a - n : o - n : c ? a : o}); 1818 i.shadow.css({width: "50%", left: c ? "50%" : 0, transitionDelay: ""}) 1819 } else { 1820 i.wrapper.css({left: u ? c ? s ? a - n : o - n : s ? o - n : a - n : 0}); 1821 i.shadow.css({width: "100%", left: 0, transitionDelay: parseInt(i.duration, 10) + 50 + "ms"}) 1822 } 1823 i.wrapper.css({transition: e.type == "resize" ? "none" : ""}) 1824 } else if (i.stage != null) { 1825 var p = i.position.x, g; 1826 n = i.width / 4; 1827 h = i.width; 1828 a = -h / 2; 1829 o = h / 2; 1830 if (r == 0 || d) { 1831 g = c ? o : a 1832 } else if (r == i.pageCount) { 1833 g = c ? a : o 1834 } else { 1835 g = u ? c ? s ? a : o : s ? o : a : 0 1836 } 1837 if (g !== this.centerEnd) { 1838 this.centerTween = new TWEEN.Tween({x: p}).delay(0).to({x: g}, i.duration).onUpdate(function () { 1839 i.position.x = this.x; 1840 i.stage.cssScene.position.x = this.x 1841 }).easing(i.ease).start(); 1842 this.centerEnd = g 1843 } 1844 } 1845 }, width: function (e) { 1846 if (e == null) { 1847 return this.container.width() 1848 } else { 1849 this.options.width = e; 1850 this.container.width(e); 1851 this.resize() 1852 } 1853 } 1854 }; 1855 return n 1856 }({}); 1857 t.PreviewObject = Z; 1858 var Y = function (e) { 1859 H(a, e); 1860 1861 function a(e, a, o, r) { 1862 o = o || {}; 1863 var s = this; 1864 s.contentRawSource = e || [n.textureLoadFallback]; 1865 s.contentSource = s.contentRawSource; 1866 s.contentSourceType = null; 1867 s.minDimension = o.minTextureSize || 256; 1868 s.maxDimension = o.maxTextureSize || 2048; 1869 s.pdfRenderQuality = o.pdfRenderQuality || t.defaults.pdfRenderQuality; 1870 s.flipbook = r; 1871 s.waitPeriod = 50; 1872 s.maxLength = 297; 1873 s.enableDebug = false; 1874 s.zoomScale = 1; 1875 s.maxZoom = 2; 1876 s.options = o; 1877 s.outline = o.outline; 1878 s.links = o.links; 1879 s.html = o.html; 1880 s.isCrossOrigin = o.isCrossOrigin; 1881 s.normalViewport = {height: 297, width: 210, scale: 1}; 1882 s.viewport = {height: 297, width: 210, scale: 1}; 1883 s.imageViewport = {height: 297, width: 210, scale: 1}; 1884 s.bookSize = {height: 297, width: 210}; 1885 s.zoomViewport = {height: 297, width: 210}; 1886 s.thumbsize = 128; 1887 s.cacheIndex = 256; 1888 s.cache = []; 1889 s.pageRatio = o.pageRatio || s.viewport.width / s.viewport.height; 1890 s.textureLoadTimeOut = null; 1891 s.type = "TextureLibrary"; 1892 if (Array === s.contentSource.constructor || Array.isArray(s.contentSource) || s.contentSource instanceof Array) { 1893 s.contentSourceType = c.IMAGE; 1894 s.pageCount = s.contentSource.length; 1895 for (var u = 0; u < s.contentSource.length; u++) { 1896 s.contentSource[u] = l.httpsCorrection(s.contentSource[u].toString()) 1897 } 1898 i("<img/>").attr("src", s.contentSource[0]).on("load", function () { 1899 s.viewport.height = this.height; 1900 s.viewport.width = this.width; 1901 s.pageRatio = s.viewport.width / s.viewport.height; 1902 s.bookSize = { 1903 width: (s.pageRatio > 1 ? 1 : s.pageRatio) * s.maxLength, 1904 height: s.maxLength / (s.pageRatio < 1 ? 1 : s.pageRatio) 1905 }; 1906 s.zoomViewport = { 1907 width: (s.pageRatio > 1 ? 1 : s.pageRatio) * s.maxDimension, 1908 height: s.maxDimension / (s.pageRatio < 1 ? 1 : s.pageRatio) 1909 }; 1910 s.linkService = new PDFLinkService; 1911 i(this).off(); 1912 if (s.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL) { 1913 s.pageCount = s.contentSource.length * 2 - 2; 1914 if (s.options.webgl == true) s.requiresImageTextureScaling = true 1915 } 1916 if (a != null) { 1917 a(s); 1918 a = null 1919 } 1920 k(this.height + ":" + this.width) 1921 }) 1922 } else if (typeof s.contentSource == "string" || s.contentSource instanceof String) { 1923 var d = function () { 1924 if (s.contentSource.indexOf(".base64") > 1) { 1925 i.ajax({ 1926 url: s.contentSource, xhrFields: { 1927 onprogress: function (e) { 1928 if (e.lengthComputable) { 1929 var t = 100 * e.loaded / e.total; 1930 s.updateInfo(s.options.text.loading + " PDF " + t.toString().split(".")[0] + "% ...") 1931 } 1932 } 1933 }, success: function (e) { 1934 s.options.docParameters = {data: atob(e)}; 1935 f() 1936 } 1937 }) 1938 } else { 1939 f() 1940 } 1941 }; 1942 var f = function () { 1943 if (s) { 1944 pdfjsLib.GlobalWorkerOptions.workerSrc = n.pdfjsWorkerSrc; 1945 s.contentSourceType = c.PDF; 1946 var i = s.options.disableFontFace; 1947 if (_ || U || s.options.disableFontFace == true) { 1948 } 1949 var o = s.loading = pdfjsLib.getDocument(s.options.docParameters ? s.options.docParameters : { 1950 url: l.httpsCorrection(e), 1951 rangeChunkSize: isNaN(s.options.rangeChunkSize) ? 524288 : s.options.rangeChunkSize, 1952 cMapUrl: n.cMapUrl, 1953 cMapPacked: true, 1954 imageResourcesPath: n.imageResourcesPath, 1955 disableAutoFetch: true, 1956 disableStream: true, 1957 disableFontFace: i 1958 }); 1959 o.promise.then(function e(i) { 1960 s.pdfDocument = i; 1961 i.getPage(1).then(function (e) { 1962 s.normalViewport = e.getViewport({scale: 1}); 1963 s.viewport = e.getViewport({scale: 1}); 1964 s.viewport.height = s.viewport.height / 10; 1965 s.viewport.width = s.viewport.width / 10; 1966 s.pageRatio = s.viewport.width / s.viewport.height; 1967 s.bookSize = { 1968 width: (s.pageRatio > 1 ? 1 : s.pageRatio) * s.maxLength, 1969 height: s.maxLength / (s.pageRatio < 1 ? 1 : s.pageRatio) 1970 }; 1971 s.zoomViewport = { 1972 width: (s.pageRatio > 1 ? 1 : s.pageRatio) * s.maxDimension, 1973 height: s.maxDimension / (s.pageRatio < 1 ? 1 : s.pageRatio) 1974 }; 1975 s.refPage = e; 1976 if (i.numPages > 1) { 1977 i.getPage(2).then(function (e) { 1978 if (s.options.pageSize == t.PAGE_SIZE.AUTO) { 1979 var n = e.getViewport({scale: 1}); 1980 var o = n.width / n.height; 1981 if (o > s.pageRatio * 1.5) { 1982 s.options.pageSize = t.PAGE_SIZE.DOUBLEINTERNAL; 1983 s.pageCount = i.numPages * 2 - 2 1984 } else { 1985 s.options.pageSize = t.PAGE_SIZE.SINGLE 1986 } 1987 } 1988 if (a != null) { 1989 a(s); 1990 a = null 1991 } 1992 }) 1993 } else { 1994 if (a != null) { 1995 a(s); 1996 a = null 1997 } 1998 } 1999 }); 2000 s.linkService = new PDFLinkService; 2001 s.linkService.setDocument(i, null); 2002 s.pageCount = i.numPages; 2003 s.contentSource = i 2004 }, function e(t) { 2005 if (s) { 2006 var i = "", n = document.createElement("a"); 2007 n.href = s.contentSource; 2008 if (n.hostname !== window.location.hostname) i = "CROSS ORIGIN!! "; 2009 s.updateInfo(i + "Cannot access file! " + s.contentSource) 2010 } 2011 }); 2012 o.onProgress = function e(t) { 2013 if (s) { 2014 var i = 100 * t.loaded / t.total; 2015 if (isNaN(i)) { 2016 if (t && t.loaded) { 2017 s.updateInfo(s.options.text.loading + " PDF " + (Math.ceil(t.loaded / 1e4) / 100).toString() + "MB ...") 2018 } else { 2019 s.updateInfo(s.options.text.loading + " PDF ...") 2020 } 2021 } else { 2022 s.updateInfo(s.options.text.loading + " PDF " + i.toString().split(".")[0] + "% ...") 2023 } 2024 } 2025 } 2026 } 2027 }; 2028 var h = function () { 2029 if (s) { 2030 if (n.pdfjsWorkerSrc.indexOf("?ver") < 0) n.pdfjsWorkerSrc += "?ver=" + t.version; 2031 s.updateInfo(s.options.text.loading + " PDF Worker ..."); 2032 var e = document.createElement("a"); 2033 e.href = n.pdfjsWorkerSrc; 2034 if (e.hostname !== window.location.hostname) { 2035 s.updateInfo(s.options.text.loading + " PDF Worker CORS ..."); 2036 i.ajax({ 2037 url: n.pdfjsWorkerSrc, cache: true, success: function (e) { 2038 n.pdfjsWorkerSrc = t.createObjectURL(e, "text/javascript"); 2039 d() 2040 } 2041 }) 2042 } else { 2043 d() 2044 } 2045 } 2046 }; 2047 if (window.pdfjsLib == null) { 2048 if (s) { 2049 s.updateInfo(s.options.text.loading + " PDF Service ..."); 2050 M(n.pdfjsSrc + "?ver=" + t.version, function () { 2051 if (typeof define === "function" && define.amd && window.requirejs) { 2052 s.updateInfo(s.options.text.loading + " PDF Service (require) ..."); 2053 require.config({paths: {"pdfjs-dist/build/pdf.worker": n.pdfjsWorkerSrc.replace(".js", "")}}); 2054 require(["pdfjs-dist/build/pdf"], function (e) { 2055 window.pdfjsLib = e; 2056 h() 2057 }) 2058 } else if (typeof exports === "object" && exports["pdfjs-dist/build/pdf"] != null) { 2059 window.pdfjsLib = exports["pdfjs-dist/build/pdf"]; 2060 h() 2061 } else { 2062 h() 2063 } 2064 }, function () { 2065 s.updateInfo("Unable to load PDF service..") 2066 }) 2067 } 2068 } else { 2069 d() 2070 } 2071 } else { 2072 console.error("Unknown source type. Please check documentation for help") 2073 } 2074 this.dispose = function () { 2075 if (s.loading && s.loading.destroy) { 2076 s.loading.destroy() 2077 } 2078 s.loading = null; 2079 if (s.textureLoadTimeOut) { 2080 clearTimeout(s.textureLoadTimeOut); 2081 s.textureLoadTimeOut = null 2082 } 2083 if (this.targetObject) { 2084 if (this.targetObject.thumbContainer && this.targetObject.thumbContainer.remove) this.targetObject.thumbContainer.remove(); 2085 if (this.targetObject.outlineContainer && this.targetObject.outlineContainer.remove) this.targetObject.outlineContainer.remove(); 2086 if (this.targetObject.dispose) this.targetObject.dispose(); 2087 this.targetObject.processPage = null; 2088 this.targetObject.requestPage = null; 2089 if (this.targetObject.container && this.targetObject.container.off) this.targetObject.container.off() 2090 } 2091 if (this.pdfDocument && this.pdfDocument.destroy) this.pdfDocument.destroy(); 2092 if (this.linkService && this.linkService.dispose) this.linkService.dispose(); 2093 if (this.outlineViewer && this.outlineViewer.dispose) this.outlineViewer.dispose(); 2094 if (this.thumblist && this.thumblist.dispose) { 2095 this.thumblist.review = null; 2096 this.thumblist.dispose() 2097 } 2098 this.activeThumb = null; 2099 this.targetObject = null; 2100 this.pdfDocument = null; 2101 this.linkService = null; 2102 this.outlineViewer = null; 2103 this.thumblist = null; 2104 s = null 2105 }; 2106 return this 2107 } 2108 2109 a.prototype.updateInfo = function (e) { 2110 if (this.flipbook && this.flipbook.updateInfo) { 2111 this.flipbook.updateInfo(e) 2112 } 2113 }; 2114 a.prototype.initThumbs = function () { 2115 var e = this; 2116 if (e.cache[e.thumbsize] == null) e.cache[e.thumbsize] = []; 2117 var t; 2118 var n = function () { 2119 clearTimeout(t); 2120 t = setTimeout(function () { 2121 t = setTimeout(a, e.waitPeriod / 2) 2122 }, e.waitPeriod) 2123 }; 2124 var a = function () { 2125 var a = 0; 2126 if (Date.now() - e.thumblist.lastScrolled < 100) { 2127 a = 1 2128 } else { 2129 e.targetObject.container.find(".df-thumb-container .df-vrow").each(function () { 2130 var t = i(this); 2131 if (!t.hasClass("df-thumb-loaded")) { 2132 a++; 2133 var o = i(this).attr("id").replace("df-thumb", ""); 2134 e.getPage(o, n, true); 2135 t.addClass("df-thumb-loaded"); 2136 return false 2137 } 2138 }); 2139 if (a == 0) { 2140 clearTimeout(t) 2141 } 2142 } 2143 if (a > 0) { 2144 n() 2145 } 2146 if (e.activeThumb != e.targetObject._activePage) { 2147 var o = e.targetObject.thumbContainer != null && e.targetObject.thumbContainer.hasClass("df-sidemenu-visible"); 2148 if (o) { 2149 var r = e.thumblist.container; 2150 var s = r.scrollTop, c = r.getBoundingClientRect().height; 2151 var u = e.targetObject.thumbContainer.find("#df-thumb" + e.targetObject._activePage); 2152 if (u.length > 0) { 2153 e.targetObject.thumbContainer.find(".df-selected").removeClass("df-selected"); 2154 u.addClass("df-selected"); 2155 u = u[0]; 2156 if (s + c < u.offsetTop + u.scrollHeight) l.scrollIntoView(u, null, false); else if (s > u.offsetTop) l.scrollIntoView(u); 2157 e.activeThumb = e.targetObject._activePage 2158 } else { 2159 i(r).scrollTop(e.targetObject._activePage * 124); 2160 n() 2161 } 2162 } 2163 } 2164 }; 2165 e.thumblist = e.targetObject.thumblist = new ThumbList({ 2166 h: 500, addFn: function (e) { 2167 }, scrollFn: n, itemHeight: 128, totalRows: e.pageCount, generatorFn: function (e) { 2168 var t = document.createElement("div"); 2169 var i = e + 1; 2170 t.id = "df-thumb" + i; 2171 var n = document.createElement("div"); 2172 n.innerHTML = i; 2173 t.appendChild(n); 2174 return t 2175 } 2176 }); 2177 e.thumblist.lastScrolled = Date.now(); 2178 e.thumblist.review = n; 2179 n(); 2180 var o = i("<div>").addClass("df-thumb-container df-sidemenu-visible df-sidemenu"); 2181 o.append(i(e.thumblist.container).addClass("df-thumb-wrapper")); 2182 e.targetObject.thumbContainer = o; 2183 e.targetObject.container.append(o); 2184 var r = i(h.div, {class: "df-ui-btn df-ui-sidemenu-close ti-close"}); 2185 o.append(r); 2186 e.thumblist.reset(i(e.thumblist.container).height()); 2187 e.targetObject.container.on("click", ".df-thumb-container .df-vrow", function (t) { 2188 t.stopPropagation(); 2189 var n = i(this).attr("id").replace("df-thumb", ""); 2190 e.targetObject.gotoPage(parseInt(n, 10)) 2191 }) 2192 }; 2193 a.prototype.initOutline = function () { 2194 var e = this; 2195 var t = i("<div>").addClass("df-outline-container df-sidemenu"); 2196 var n = i("<div>").addClass("df-outline-wrapper"); 2197 var a = i(h.div, {class: "df-ui-btn df-ui-sidemenu-close ti-close"}); 2198 t.append(a).append(n); 2199 e.targetObject.container.append(t); 2200 e.targetObject.outlineContainer = t; 2201 e.outlineViewer = new BookMarkViewer({ 2202 container: n[0], 2203 linkService: e.linkService, 2204 outlineItemClass: "df-outline-item", 2205 outlineToggleClass: "df-outline-toggle", 2206 outlineToggleHiddenClass: "df-outlines-hidden" 2207 }); 2208 2209 function o(t) { 2210 if (e.options.overwritePDFOutline == true) { 2211 t = [] 2212 } 2213 t = t || []; 2214 if (e.outline) { 2215 for (var i = 0; i < e.outline.length; i++) { 2216 e.outline[i].custom = true; 2217 if (t) t.push(e.outline[i]) 2218 } 2219 } 2220 if (t.length === 0 && e.targetObject.ui.outline != null) { 2221 e.targetObject.ui.outline.hide() 2222 } 2223 e.outlineViewer.render({outline: t}) 2224 } 2225 2226 if (e.pdfDocument) { 2227 e.pdfDocument.getOutline().then(function (e) { 2228 o(e) 2229 }) 2230 } else { 2231 o([]) 2232 } 2233 if (e.options.autoEnableOutline == true) { 2234 e.targetObject.ui.outline.trigger("click") 2235 } 2236 if (e.options.autoEnableThumbnail == true) { 2237 e.targetObject.ui.thumbnail.trigger("click") 2238 } 2239 }; 2240 a.prototype.checkViewportSize = function (e, t, i) { 2241 var a = this; 2242 var o = a.targetObject; 2243 var r = e * i, s = t * i; 2244 var l = a.cacheIndex; 2245 if (a.contentSourceType == c.PDF) { 2246 a.cacheIndex = Math.ceil(Math.max(r, s)); 2247 a.cacheIndex = Math.floor(Math.max(r, s)); 2248 a.cacheIndex = S(a.cacheIndex * n.pixelRatio, a.minDimension, a.maxDimension); 2249 if (a.cache[a.cacheIndex] == null) a.cache[a.cacheIndex] = []; 2250 if (l !== a.cacheIndex) { 2251 for (var u = 0; u < o.children.length; u++) { 2252 var d = o.children[u] 2253 } 2254 o.refresh() 2255 } 2256 a.imageViewport = a.refPage.getViewport({scale: s / a.normalViewport.height}); 2257 a.viewport = o.mode == "css" ? a.imageViewport : a.refPage.getViewport({scale: a.bookSize.height / a.normalViewport.height}); 2258 k(a.cacheIndex); 2259 a.annotedPage = undefined; 2260 a.review() 2261 } else { 2262 if (a.cache[a.cacheIndex] == null) a.cache[a.cacheIndex] = [] 2263 } 2264 }; 2265 a.prototype.getCache = function (e, t) { 2266 return t == true ? this.cache[this.thumbsize] == null ? null : this.cache[this.thumbsize][e] : this.cache[this.cacheIndex] == null ? null : this.cache[this.cacheIndex][e] 2267 }; 2268 a.prototype.setCache = function (e, t, i, n) { 2269 if (i == true) { 2270 if (this.cache[this.thumbsize] != null) this.cache[this.thumbsize][e] = t 2271 } else { 2272 var a = n == null ? this.cacheIndex : n; 2273 if (this.cache[a] != null) this.cache[a][e] = t 2274 } 2275 }; 2276 a.prototype.setTarget = function (e) { 2277 var t = this; 2278 if (e == null) { 2279 return this.targetObject 2280 } else { 2281 this.targetObject = e; 2282 e.contentProvider = this; 2283 e.container.removeClass("df-loading df-init"); 2284 if (t.linkService != null) { 2285 t.linkService.setViewer(e); 2286 t.initOutline() 2287 } 2288 e.processPage = function (e, i) { 2289 if (e > 0 && e <= t.pageCount) { 2290 t.getPage(e, i) 2291 } else { 2292 t.setPage(e, n.textureLoadFallback, i) 2293 } 2294 }; 2295 e.requestPage = function () { 2296 t.review("Request") 2297 }; 2298 if (e.resize != null) e.resize() 2299 } 2300 }; 2301 a.prototype.review = function (e) { 2302 var t = this; 2303 e = e || "timer review"; 2304 clearTimeout(t.textureLoadTimeOut); 2305 t.textureLoadTimeOut = setTimeout(function () { 2306 t.textureLoadTimeOut = setTimeout(t.reviewPages, t.waitPeriod / 2, t, e) 2307 }, t.waitPeriod) 2308 }; 2309 a.prototype.reviewPages = function (e, t) { 2310 e = e || this; 2311 var n = e.targetObject; 2312 if (n == null) return; 2313 var a = A(n); 2314 if (t != null) k(t); 2315 var o = false; 2316 var r, s; 2317 for (r = 0; r < e.targetObject.children.length; r++) { 2318 s = n.children[r]; 2319 if (s.isFlipping == true) { 2320 o = true; 2321 break 2322 } 2323 } 2324 if (o == false) { 2325 var l = n.children.length > 3 ? 3 : n.children.length; 2326 var c = l / 2; 2327 var u = a ? n._activePage : F(n._activePage); 2328 e.baseNumber = u; 2329 if (e.zoomScale > 1) { 2330 l = 1 2331 } 2332 for (r = 0; r < l; r++) { 2333 var d = Math.floor(r / 2); 2334 var f = r % 2 == 0 ? -d * (a ? 1 : 2) : (d == 0 ? 1 : d) * (a ? 1 : 2); 2335 var h = u + f, p = u + f + 1; 2336 var g = n.getPageByNumber(h), v = n.getPageByNumber(p), m = h + "|" + e.cacheIndex, 2337 b = p + "|" + e.cacheIndex; 2338 var w = 0; 2339 if (g != null && g.frontPageStamp != m && g.visible == true) { 2340 g.frontTextureLoaded = false; 2341 n.processPage(h, function () { 2342 e.review("Batch Call") 2343 }); 2344 g.frontPageStamp = m; 2345 w++ 2346 } 2347 if (v != null && v.backPageStamp != b && v.visible == true && !a) { 2348 v.backTextureLoaded = false; 2349 n.processPage(p, function () { 2350 e.review("Batch Call") 2351 }); 2352 v.backPageStamp = b; 2353 w++ 2354 } 2355 if (f == 0 && e.annotedPage !== u) { 2356 e.getAnnotations(h); 2357 if (!a) e.getAnnotations(p); 2358 e.annotedPage = u 2359 } 2360 if (w > 0) { 2361 break 2362 } 2363 } 2364 if (w == 0) { 2365 if (n.mode !== "css") { 2366 e.setLoading(u) 2367 } else { 2368 } 2369 } 2370 } else { 2371 e.review("Revisit request"); 2372 if (e.annotedPage != null && n.mode !== "css") { 2373 var x = F(n._activePage); 2374 i(n.getContentLayer(x)).html(""); 2375 i(n.getContentLayer(x + 1)).html(""); 2376 e.annotedPage = null 2377 } 2378 } 2379 }; 2380 a.prototype.getPage = function (e, a, o) { 2381 var r = this; 2382 e = parseInt(e, 10); 2383 var s = e; 2384 var l = r.contentSource; 2385 if (e <= 0 && e >= r.pageCount) { 2386 r.setPage(e, n.textureLoadFallback, a, o) 2387 } else { 2388 if (r.contentSourceType == c.PDF) { 2389 if (r.getCache(e, o) != null) { 2390 r.setPage(e, r.getCache(e, o), a, o); 2391 k("Page " + e + " loaded from cache") 2392 } else { 2393 if (o !== true) r.setLoading(e, true); 2394 if (r.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL && e > 2) { 2395 s = Math.ceil((e - 1) / 2) + 1 2396 } 2397 l.getPage(s, o).then(function (t) { 2398 f(t, e, a, o) 2399 }) 2400 } 2401 } else if (r.contentSourceType == c.IMAGE || r.contentSourceType == c.HTML) { 2402 if (r.getCache(e, o) != null) { 2403 r.setPage(e, r.getCache(e, o), a, o); 2404 k("Page " + e + " loaded from cache") 2405 } else { 2406 if (o !== true) r.setLoading(e, true); 2407 if (r.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL && e > 2) { 2408 s = Math.ceil((e - 1) / 2) + 1 2409 } 2410 d(l[s - 1], function (t) { 2411 r.setCache(e, t, o, r.cacheIndex); 2412 r.setPage(e, t, a, o); 2413 if (a != null) a() 2414 }, r.isCrossOrigin) 2415 } 2416 } 2417 } 2418 2419 function u(e, i, a) { 2420 var o = new Image; 2421 o.crossOrigin = "Anonymous"; 2422 o.onload = function () { 2423 if (a == true) { 2424 var r = document.createElement("canvas"), s = r.getContext("2d"); 2425 r.width = o.width; 2426 r.height = o.height; 2427 s.drawImage(o, 0, 0); 2428 if (n.canvasToBlob == true) { 2429 r.toBlob(function (e) { 2430 var n = t.createObjectURL(e, "image/jpeg"); 2431 if (i != null) i(n) 2432 }, "image/jpeg", .85) 2433 } else { 2434 if (i != null) i(r) 2435 } 2436 } else { 2437 if (i != null) i(e) 2438 } 2439 o.onload = null; 2440 o = null 2441 }; 2442 o.src = e; 2443 if (o.complete || o.complete === undefined) { 2444 o.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="; 2445 o.src = e 2446 } 2447 } 2448 2449 function d(e, t, n) { 2450 i("<img/>").attr("src", e).on("load", function () { 2451 i(this).off(); 2452 if (t != null) { 2453 t(e) 2454 } 2455 k(this.height + ":" + this.width) 2456 }) 2457 } 2458 2459 function f(e, i, n, a) { 2460 var o = r.options.forceFit; 2461 var s = r.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL && i > 1 && i < r.pageCount; 2462 var l = s && o ? 2 : 1; 2463 var c = o ? e.getViewport({scale: 1}) : r.normalViewport; 2464 var u = r.cacheIndex / Math.max(c.width / l, c.height); 2465 if (r.webgl == true) { 2466 u = O(r.cacheIndex) / (r.pageRatio > 1 ? c.width / l : c.height) 2467 } 2468 var d = document.createElement("canvas"); 2469 var f = performance.now(); 2470 var h = r.cacheIndex; 2471 var p = d.getContext("2d"); 2472 if (a == true) { 2473 u = r.thumbsize / r.normalViewport.height 2474 } 2475 d.height = Math.round(c.height * u); 2476 d.width = Math.round(c.width / l * u); 2477 if (r.targetObject.mode == "css" && Math.abs(r.targetObject.zoomHeight - d.height) < 2) { 2478 d.height = r.targetObject.zoomHeight + 0; 2479 d.width = r.targetObject.zoomWidth + 0 2480 } 2481 c = e.getViewport({scale: u}); 2482 k("rendering " + i + " at " + d.width + "x" + d.height); 2483 if (s) { 2484 if (z(r.targetObject)) { 2485 if (i % 2 == 0) { 2486 c.transform[4] = -d.width 2487 } 2488 } else { 2489 if (i % 2 == 1) { 2490 c.transform[4] = -d.width 2491 } 2492 } 2493 } 2494 var g = {canvasContext: p, viewport: c}; 2495 e.cleanupAfterRender = true; 2496 var v = e.render(g); 2497 v.promise.then(function () { 2498 k(performance.now() - f); 2499 f = performance.now(); 2500 if (a == true || r.options.canvasToBlob == true && r.webgl !== true) { 2501 d.toBlob(function (e) { 2502 var o = t.createObjectURL(e, "image/jpeg"); 2503 k(performance.now() - f); 2504 r.setCache(i, o, a, h); 2505 r.setPage(i, o, n, a) 2506 }, "image/jpeg", r.pdfRenderQuality) 2507 } else { 2508 k("Setting Page " + i); 2509 r.setPage(i, d, n, a) 2510 } 2511 g = null 2512 }) 2513 } 2514 }; 2515 a.prototype.getTargetPage = function (e) { 2516 }; 2517 a.prototype.setLoading = function (e, t) { 2518 if (this.targetObject != null) { 2519 if (this.webgl == true) { 2520 var n = this.targetObject.container; 2521 if (t == true) { 2522 if (n.isLoading !== true) { 2523 n.addClass("df-loading"); 2524 n.isLoading = true; 2525 k("Loading icon at " + e + " as " + t) 2526 } 2527 } else { 2528 if (n.isLoading != null) { 2529 n.removeClass("df-loading"); 2530 n.isLoading = null; 2531 k("Loading icon at " + e + " as " + t) 2532 } 2533 } 2534 } else { 2535 var a = i(this.targetObject.getContentLayer(e)); 2536 if (a != null) { 2537 if (t == true) a.addClass("df-page-loading"); else a.removeClass("df-page-loading"); 2538 k("Loading icon at " + e + " as " + t) 2539 } 2540 } 2541 } 2542 }; 2543 a.prototype.getAnnotations = function (e) { 2544 var n = this; 2545 if (n.options.enableAnnotation == false) return; 2546 var a = n.targetObject; 2547 e = parseInt(e, 10); 2548 var o = n.contentSource; 2549 var r = i(a.getContentLayer(e)); 2550 r.empty(); 2551 if (e > 0 && e <= n.pageCount) { 2552 if (n.contentSourceType == c.PDF) { 2553 var s = F(e); 2554 var l = e; 2555 if (n.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL && e > 2) { 2556 l = Math.ceil((e - 1) / 2) + 1 2557 } 2558 o.getPage(l).then(function (t) { 2559 if (r != null && r.length > 0) { 2560 var i = t.getViewport({scale: 1}); 2561 i = t.getViewport({scale: n.viewport.height / i.height}); 2562 n.setupAnnotations(t, i, r, e) 2563 } 2564 }) 2565 } 2566 if (n.links != null && n.links[e] != null) { 2567 var u = n.links[e]; 2568 for (var d = 0; d < u.length; d++) { 2569 var f = u[d]; 2570 var h; 2571 if (f.dest && f.dest.indexOf && f.dest.indexOf("[html]") == 0) { 2572 h = document.createElement("div"); 2573 h.innerHTML = f.dest.substr(6); 2574 h.className = "customHtmlAnnotation" 2575 } else { 2576 h = document.createElement("a"); 2577 h.setAttribute("dest", f.dest); 2578 h.className = "customLinkAnnotation"; 2579 h.href = "#" + f.dest; 2580 h.onclick = function () { 2581 var e = this.getAttribute("dest"); 2582 if (e) { 2583 n.linkService.customNavigateTo(e) 2584 } 2585 return false 2586 } 2587 } 2588 h.style.left = f.x + "%"; 2589 h.style.top = f.y + "%"; 2590 h.style.width = f.w + "%"; 2591 h.style.height = f.h + "%"; 2592 r[0].appendChild(h) 2593 } 2594 } 2595 if (n.html != null && n.html[e] != null) { 2596 var p = n.html[e]; 2597 r.append(i("<div class='customHTMLAnnotation'>").html(p)) 2598 } 2599 } 2600 }; 2601 a.prototype.setPage = function (e, t, i, a) { 2602 var o = this; 2603 var r = o.targetObject; 2604 var s = z(r); 2605 var l = A(r); 2606 if (a == true) { 2607 var c = o.targetObject.container.find("#df-thumb" + e); 2608 c.css({backgroundImage: C(t)}) 2609 } else { 2610 if (t == n.textureLoadFallback) { 2611 k("Fallback on " + e) 2612 } 2613 var u = r.getPageByNumber(e); 2614 if (u != null) { 2615 if (e % 2 != 0 && !s || e % 2 != 1 && s && !l || l && !s) { 2616 k(e + "rendered to back of " + u.color); 2617 u.backImage(t, function (t, n) { 2618 u.backTextureLoaded = true; 2619 o.setLoading(e); 2620 if (o.requiresImageTextureScaling && n && e != 1 && e != o.pageCount) { 2621 n.repeat.x = .5; 2622 n.offset.x = .5 2623 } 2624 if (i != null) i() 2625 }) 2626 } else { 2627 k(e + "rendered to front of " + u.color); 2628 u.frontImage(t, function (t, n) { 2629 u.frontTextureLoaded = true; 2630 o.setLoading(e); 2631 if (o.requiresImageTextureScaling && n && e != 1 && e != o.pageCount) { 2632 n.repeat.x = .5 2633 } 2634 if (i != null) i() 2635 }) 2636 } 2637 } else { 2638 k("Invalid set request on Page " + e) 2639 } 2640 } 2641 }; 2642 a.prototype.setupAnnotations = function (e, a, o, r) { 2643 if (o == null || i(o).length == 0) return; 2644 var s = this; 2645 return e.getAnnotations().then(function (l) { 2646 a = a.clone({dontFlip: true}); 2647 if (s.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL && r > 2 && r % 2 == 1) { 2648 } else if (r == 1) { 2649 } 2650 if (o == null) { 2651 return 2652 } 2653 o = i(o); 2654 if (o.find(".annotationDiv").length == 0) { 2655 o.append(i("<div class='annotationDiv'>")) 2656 } 2657 var c = o.find(".annotationDiv"); 2658 c.empty(); 2659 if (s.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL && r > 2 && r % 2 == 1) { 2660 c.css({left: "-100%"}) 2661 } else if (r == 1) { 2662 c.css({left: ""}) 2663 } 2664 pdfjsLib.AnnotationLayer.render({ 2665 annotations: l, 2666 div: c[0], 2667 page: e, 2668 viewport: a, 2669 imageResourcesPath: n.imageResourcesPath, 2670 linkService: s.linkService 2671 }); 2672 if (s.options.annotationClass && s.options.annotationClass !== "") { 2673 c.find(" > section").addClass(s.options.annotationClass) 2674 } 2675 if (s.options.search == true) { 2676 if (o.find(".textLayerDiv").length == 0) { 2677 o.append(i("<div class='textLayerDiv'>")) 2678 } 2679 var u = o.find(".textLayerDiv"); 2680 e.getTextContent().then(function (e) { 2681 var i = new t.TextLayerBuilder({ 2682 textLayerDiv: u[0], 2683 pageIndex: null, 2684 viewport: a.clone({dontFlip: false}) 2685 }); 2686 i.setTextContent(e); 2687 i.render() 2688 }) 2689 } 2690 }) 2691 }; 2692 return a 2693 }({}); 2694 var K = function () { 2695 function e(e) { 2696 this.angles = e.angles || [0, 0, 0, 0, 0, 0]; 2697 this.stiffness = e.angles || .1; 2698 this.segments = e.segments || 1; 2699 this.canvasMode = e.contentSourceType !== c.IMAGE && e.canvasToBlob == false; 2700 this.initDOM() 2701 } 2702 2703 function a(e) { 2704 var t = e.contentLayer = i(h.div, {class: "df-page-content"}); 2705 e.append(t) 2706 } 2707 2708 e.prototype = { 2709 initDOM: function () { 2710 var e = this.element = i(h.div, {class: "df-book-page"}); 2711 var t = this.wrapper = i(h.div, {class: "df-page-wrapper"}); 2712 var n = this.front = i(h.div, {class: "df-page-front"}); 2713 var o = this.back = i(h.div, {class: "df-page-back"}); 2714 var r = this.foldInnerShadow = i(h.div, {class: "df-page-fold-inner-shadow"}); 2715 var s = this.foldOuterShadow = i(h.div, {class: "df-page-fold-outer-shadow"}); 2716 this.frontIMG = new Image; 2717 this.backIMG = new Image; 2718 a(n, this.segments, true); 2719 a(o, this.segments, false); 2720 e.append(t).append(s); 2721 t.append(n).append(o).append(r) 2722 }, updatePoint: function (e) { 2723 if (e == null) return; 2724 var i = this.parent.dragPage != null ? this.parent.dragPage : e.page != null ? e.page : this; 2725 var n = i.element.width(), a = i.element.height(); 2726 var o = this.parent.corner != null ? this.parent.corner : e.corner, r = t.CORNERS; 2727 var s = i.side == d.right, l = o == r.BL || o == r.BR; 2728 e.rx = s == true ? n * 2 - e.x : e.x; 2729 e.ry = l == true ? a - e.y : e.y; 2730 var c = Math.atan2(e.ry, e.rx); 2731 c = Math.PI / 2 - S(c, 0, v(90)); 2732 var u = s ? e.x / 2 : n - e.x / 2, f = e.ry / 2, 2733 h = Math.max(0, Math.sin(c - Math.atan2(f, u)) * E(u, f)), p = .5 * E(e.rx, e.ry); 2734 var g = Math.round(n - h * Math.sin(c)), b = Math.round(h * Math.cos(c)), x = m(c); 2735 var y = l ? s ? 180 + (90 - x) : 180 + x : s ? x : 90 - x; 2736 var C = l ? s ? 180 + (90 - x) : x : s ? x + 180 : y, 2737 L = l ? s ? 90 - x : x + 90 : s ? y - 90 : y + 180, I = s ? n - g : g, T = l ? a + b : -b, 2738 k = s ? -g : g - n, O = l ? -a - b : b; 2739 var R = S(e.distance * .5 / n, 0, .5); 2740 var F = S((n * 2 - e.rx) * .5 / n, .05, .3); 2741 i.element.addClass("df-folding"); 2742 var M = s ? i.back : i.front; 2743 var D = s ? i.front : i.back; 2744 var A = i.foldOuterShadow; 2745 var z = i.foldInnerShadow; 2746 i.wrapper.css({transform: w(I, T) + P(y)}); 2747 M.css({transform: P(-y) + w(-I, -T)}); 2748 D.css({transform: P(C) + w(k, O), boxShadow: "rgba(0, 0, 0, " + R + ") 0px 0px 20px"}); 2749 z.css({ 2750 transform: P(C) + w(k, O), 2751 opacity: F / 2, 2752 backgroundImage: N.css + "linear-gradient( " + L + "deg, rgba(0, 0, 0, 0.25) , rgb(0, 0, 0) " + p * .7 + "px, rgb(255, 255, 255) " + p + "px)" 2753 }); 2754 A.css({ 2755 opacity: F / 2, 2756 left: s ? "auto" : 0, 2757 right: s ? 0 : "auto", 2758 backgroundImage: N.css + "linear-gradient( " + (-L + 180) + "deg, rgba(0, 0, 0,0) " + p / 3 + "px, rgb(0, 0, 0) " + p + "px)" 2759 }) 2760 }, updateAngle: function (e, t) { 2761 var i = this.element.width() * 5; 2762 this.wrapper.css({perspective: i, perspectiveOrigin: t == true ? "0% 50%" : "100% 50%"}); 2763 this.front.css({ 2764 display: t == true ? e <= -90 ? "block" : "none" : e < 90 ? "block" : "none", 2765 transform: (N.dom !== "MfS" ? "" : "perspective(" + i + "px) ") + (t == true ? "translateX(-100%) " : "") + "rotateY(" + ((t == true ? 180 : 0) + e) + "deg)" 2766 }); 2767 this.back.css({ 2768 display: t == true ? e > -90 ? "block" : "none" : e >= 90 ? "block" : "none", 2769 transform: (N.dom !== "MSd" ? "" : "perspective(" + i + "px) ") + (t == false ? "translateX(100%) " : "") + "rotateY(" + ((t == false ? -180 : 0) + e) + "deg)" 2770 }); 2771 return 2772 }, tween: function (e) { 2773 var i = this; 2774 if (i == null || i.parent == null) return; 2775 var n = A(i.parent); 2776 var a = i.side == d.right; 2777 var o = i.parent.direction == t.DIRECTION.RTL; 2778 var r = i.parent.corner == t.CORNERS.BL || i.parent.corner == t.CORNERS.BR; 2779 var s = i.magnetic == true; 2780 var l = r ? i.parent.height : 0; 2781 var c, u, f, h = 0; 2782 var p = i.end = i && i.animateToReset == true ? { 2783 x: a ? i.parent.fullWidth : 0, 2784 y: l 2785 } : {x: a ? 0 : i.parent.fullWidth, y: l}; 2786 i.ease = i.isHard ? TWEEN.Easing.Quadratic.InOut : TWEEN.Easing.Linear.None; 2787 var g = i.parent.duration; 2788 if (i.isHard == true) { 2789 if (e != null) { 2790 h = T(e.distance, e.fullWidth) 2791 } 2792 c = i.init = {angle: h * (a ? -1 : 1)}; 2793 p = i.end = i && i.animateToReset == true ? {angle: a ? 0 : -0} : {angle: a ? -180 : 180} 2794 } else { 2795 if (e == null) { 2796 c = i.init = i && i.animateToReset == true ? { 2797 x: a ? 0 : i.parent.fullWidth, 2798 y: 0 2799 } : {x: a ? i.parent.fullWidth : 0, y: 0}; 2800 u = i.first = {x: (a ? 3 : 1) * i.parent.fullWidth / 4, y: 0}; 2801 f = i.mid = {x: (a ? 1 : 3) * i.parent.fullWidth / 4, y: 0} 2802 } else { 2803 c = i.init = {x: e.x, y: e.y, opacity: 1}; 2804 u = i.first = {x: e.x * 3 / 4, y: e.y * 3 / 4, opacity: 1}; 2805 f = i.mid = {x: e.x / 4, y: e.y / 4, opacity: 1}; 2806 g = i.parent.duration * I(c.x, c.y, p.x, p.y) / i.parent.fullWidth; 2807 g = S(g, i.parent.duration / 3, i.parent.duration) 2808 } 2809 } 2810 c.index = 0; 2811 p.index = 1; 2812 i.isFlipping = true; 2813 var v = function (e) { 2814 if (i.isHard == true) { 2815 i.updateAngle(e.angle, a); 2816 i.angle = e.angle 2817 } else { 2818 i.updatePoint({x: e.x, y: e.y}); 2819 i.x = e.x; 2820 i.y = e.y 2821 } 2822 if (n && !s) i.element[0].style.opacity = a && !o || !a && o ? e.index > .5 ? 2 * (1 - e.index) : 1 : e.index < .5 ? 2 * e.index : 1 2823 }; 2824 if (n && (!a && !o || a && o)) i.element[0].style.opacity = 0; 2825 var m = i.completeTween = i.completeTween || function (e) { 2826 i.isFlipping = false; 2827 if (i.isHard == true) { 2828 i.updateAngle(i.end.angle); 2829 i.back.css({display: "block"}); 2830 i.front.css({display: "block"}) 2831 } else { 2832 i.updatePoint({x: i.end.x, y: i.end.y}) 2833 } 2834 i.element[0].style.opacity = 1; 2835 if (i.animateToReset !== true) { 2836 i.side = i.side == d.right ? d.left : d.right 2837 } else i.animateToReset = null; 2838 i.currentTween = null; 2839 i.pendingPoint = null; 2840 i.magnetic = false; 2841 i.parent.dragPage = null; 2842 i.parent.corner = t.CORNERS.NONE; 2843 if (e != true) i.parent.refresh() 2844 }; 2845 if (i.isHard == true) { 2846 i.currentTween = new TWEEN.Tween(c).delay(0).to(p, i.parent.duration).onUpdate(function () { 2847 v(this) 2848 }).easing(i.ease).onComplete(i.completeTween).start() 2849 } else { 2850 if (e == null) { 2851 i.currentTween = new TWEEN.Tween(c).delay(0).to(p, i.parent.duration).onUpdate(function () { 2852 v(this) 2853 }).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(i.completeTween).start() 2854 } else { 2855 i.currentTween = new TWEEN.Tween(c).delay(0).to(p, g).onUpdate(function () { 2856 v(this) 2857 }).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(i.completeTween); 2858 i.currentTween.start() 2859 } 2860 } 2861 }, frontImage: function (e, t) { 2862 var a = this; 2863 2864 function o() { 2865 a.front.css({backgroundImage: C(e)}); 2866 if (t != null) t() 2867 } 2868 2869 if (a.canvasMode == true) { 2870 a.front.find(">canvas").remove(); 2871 if (e !== n.textureLoadFallback) { 2872 a.front.append(i(e)) 2873 } 2874 if (t != null) t() 2875 } else { 2876 if (e == n.textureLoadFallback) { 2877 o() 2878 } else { 2879 a.frontIMG.onload = o; 2880 a.frontIMG.src = e 2881 } 2882 } 2883 }, backImage: function (e, t) { 2884 var a = this; 2885 2886 function o() { 2887 a.back.css({backgroundImage: C(e)}); 2888 if (t != null) t() 2889 } 2890 2891 if (a.canvasMode == true) { 2892 a.back.find(">canvas").remove(); 2893 if (e !== n.textureLoadFallback) { 2894 a.back.append(i(e)) 2895 } 2896 if (t != null) t() 2897 } else { 2898 if (e == n.textureLoadFallback) { 2899 o() 2900 } else { 2901 a.backIMG.onload = o; 2902 a.backIMG.src = e 2903 } 2904 } 2905 }, updateCSS: function (e) { 2906 this.element.css(e) 2907 }, resetCSS: function () { 2908 this.wrapper.css({transform: ""}); 2909 this.front.css({transform: "", boxShadow: ""}); 2910 this.back.css({transform: "", boxShadow: ""}) 2911 }, clearTween: function (e) { 2912 this.currentTween.stop(); 2913 this.completeTween(e == true); 2914 this.resetCSS() 2915 } 2916 }; 2917 return e 2918 }(); 2919 var X = function (e) { 2920 H(s, e); 2921 2922 function o(e) { 2923 e.parent.container.find(".df-folding").removeClass("df-folding"); 2924 e.element.addClass("df-folding") 2925 } 2926 2927 function r(e) { 2928 var t = false; 2929 for (var i = 0; i < e.pages.length; i++) { 2930 var n = e.pages[i]; 2931 if (n.isFlipping == true) { 2932 t = true; 2933 break 2934 } 2935 } 2936 return t 2937 } 2938 2939 function s(e, n) { 2940 var s = this; 2941 s.type = "BookCSS"; 2942 s.images = e.images || []; 2943 s.pageCount = e.pageCount || 1; 2944 s.foldSense = 50; 2945 s.stackCount = 4; 2946 s.mode = "css"; 2947 s.pages = []; 2948 s.duration = e.duration; 2949 s.container = i(n); 2950 s.options = e; 2951 s.drag = d.none; 2952 s.pageMode = e.pageMode || (B || s.pageCount <= 2 ? t.PAGE_MODE.SINGLE : t.PAGE_MODE.DOUBLE); 2953 s.singlePageMode = e.singlePageMode || (B ? t.SINGLE_PAGE_MODE.BOOKLET : t.SINGLE_PAGE_MODE.ZOOM); 2954 s.swipe_threshold = B ? 15 : 50; 2955 s.direction = e.direction || t.DIRECTION.LTR; 2956 s.startPage = 1; 2957 s.endPage = s.pageCount; 2958 s._activePage = e.openPage || s.startPage; 2959 s.hardConfig = e.hard; 2960 a = "WebKitCSSMatrix" in window || document.body && "MozPerspective" in document.body.style; 2961 s.animateF = function () { 2962 if (TWEEN.getAll().length > 0) TWEEN.update(); else clearInterval(s.animate) 2963 }; 2964 s.init(e); 2965 s.skipDrag = false; 2966 2967 function c(e) { 2968 if (s.dragPage != e.page && e.page.visible == true) { 2969 s.dragPage.clearTween(true); 2970 s.dragPage = e.page; 2971 s.corner = e.corner; 2972 s.dragPage.pendingPoint = e 2973 } 2974 } 2975 2976 var u = function (e) { 2977 var i = s.eventToPoint(e); 2978 if (e.touches != null && e.touches.length == 2 && s.startTouches != null) { 2979 s.zoomDirty = true; 2980 var n = l.getVectorAvg(l.getTouches(e, s.container.offset())), 2981 a = l.calculateScale(s.startTouches, l.getTouches(e)), o = a / s.lastScale; 2982 var c = s.contentProvider.zoomScale, u = n.x, f = n.y; 2983 s.stage.css({transform: "translate3d(" + s.left + "px," + s.top + "px,0) scale3d(" + a + "," + a + ",1)"}); 2984 s.lastScale = a; 2985 s.lastZoomCenter = n; 2986 e.preventDefault() 2987 } 2988 if (e.touches != null && e.touches.length > 1 || s.startPoint == null || s.startTouches != null) return; 2989 var h = s.dragPage || i.page; 2990 if (s.contentProvider.zoomScale !== 1) { 2991 if (e.touches != null || s.isPanning == true) { 2992 s.pan(i); 2993 e.preventDefault() 2994 } 2995 } else { 2996 if (s.skipDrag !== true) { 2997 var p = i.distance; 2998 if (!r(s)) { 2999 if (s.dragPage != null || i.isInside == true) { 3000 if (s.dragPage != null) { 3001 k("set mouse down move") 3002 } else { 3003 i.y = S(i.y, 1, s.height - 1); 3004 i.x = S(i.x, 1, i.fullWidth - 1) 3005 } 3006 var g = s.corner || i.corner; 3007 if (h.isHard) { 3008 var v = g == t.CORNERS.BR || g == t.CORNERS.TR; 3009 var m = T(i.distance, i.fullWidth); 3010 h.updateAngle(m * (v ? -1 : 1), v) 3011 } else { 3012 h.updatePoint(i, s) 3013 } 3014 h.magnetic = true; 3015 h.magneticCorner = i.corner; 3016 e.preventDefault() 3017 } 3018 if (s.dragPage == null && h != null && i.isInside == false && h.magnetic == true) { 3019 h.pendingPoint = i; 3020 h.animateToReset = true; 3021 s.corner = h.magneticCorner; 3022 s.animatePage(h); 3023 h.pendingPoint = null; 3024 h.magnetic = false; 3025 h.magneticCorner = null 3026 } 3027 if (s.isPanning == true && s.dragPage == null && s.contentProvider.zoomScale == 1) { 3028 var b = i.x - s.lastPos, w = performance.now() - s.lastTime; 3029 if (Math.abs(b) > s.swipe_threshold) { 3030 if (b < 0) { 3031 s.next() 3032 } else { 3033 s.prev() 3034 } 3035 s.drag = d.none; 3036 s.isPanning = false; 3037 e.preventDefault() 3038 } 3039 s.lastPos = i.x; 3040 s.lastTime = performance.now() 3041 } 3042 } 3043 } 3044 } 3045 }, f = function (e) { 3046 if (e.touches != null && e.touches.length == 0) { 3047 var i = s.contentProvider.zoomScale; 3048 if (s.zoomDirty == true) { 3049 s.previewObject.contentProvider.zoomScale = l.limitAt(s.previewObject.contentProvider.zoomScale * s.lastScale, 1, s.previewObject.contentProvider.maxZoom); 3050 s.previewObject.zoomValue = s.previewObject.contentProvider.zoomScale * 1; 3051 s.previewObject.resize(); 3052 s.zoomDirty = false 3053 } 3054 s.wrapper.css({transform: ""}); 3055 s.lastScale = null; 3056 s.startTouches = null 3057 } 3058 s.isPanning = false; 3059 if (e.touches != null && e.touches.length > 1) return; 3060 if (s.skipDrag !== true) { 3061 var n = s.eventToPoint(e); 3062 if (s.dragPage) { 3063 e.preventDefault(); 3064 s.dragPage.pendingPoint = n; 3065 if (n.x == s.startPoint.x && n.y == s.startPoint.y && n.isInside == true) { 3066 if (s.corner == t.CORNERS.BR || s.corner == t.CORNERS.TR) { 3067 c(n); 3068 if (s.dragPage.isFlipping !== true) s.next() 3069 } else if (s.corner == t.CORNERS.BL || s.corner == t.CORNERS.TL) { 3070 c(n); 3071 if (s.dragPage.isFlipping !== true) s.prev() 3072 } 3073 } else if (s.dragPage.isFlipping !== true) { 3074 if (n.distance > n.fullWidth / 2) { 3075 if (n.x > n.fullWidth / 2) s.prev(); else s.next() 3076 } else { 3077 s.dragPage.animateToReset = true; 3078 s.animatePage(s.dragPage) 3079 } 3080 } 3081 if (s.dragPage) { 3082 s.dragPage.pendingPoint = null; 3083 s.dragPage.magnetic = false 3084 } 3085 } else { 3086 } 3087 s.drag = d.none 3088 } 3089 }, h = function (e) { 3090 var i = s.eventToPoint(e); 3091 var n = e.srcElement || e.originalTarget; 3092 if (s.dragPage && s.dragPage.magnetic) return; 3093 if (s.wrapper[0].contains(e.target) && s.contentProvider.zoomScale == 1 && i.x == s.startPoint.x && i.y == s.startPoint.y && i.isInsidePage && s.startPoint.page == i.page && !i.page.isFlipping && n.nodeName !== "A") { 3094 if (s.startPoint.page.side == 0) { 3095 s.corner = t.CORNERS.TL; 3096 s.prev(); 3097 s.startPoint.page = null 3098 } else { 3099 s.corner = t.CORNERS.TR; 3100 s.next(); 3101 s.startPoint.page = null 3102 } 3103 s.isPanning = false 3104 } 3105 }, p = function (e) { 3106 if (e.touches != null && e.touches.length == 2 && s.startTouches == null) { 3107 s.startTouches = l.getTouches(e); 3108 s.lastScale = 1 3109 } 3110 if (e.touches != null && e.touches.length > 1 || e.touches == null && e.button !== 0) return; 3111 var i = s.eventToPoint(e); 3112 s.startPoint = i; 3113 s.left = s.left || 0; 3114 s.top = s.top || 0; 3115 s.isPanning = true; 3116 s.lastPos = i.x; 3117 s.lastTime = performance.now(); 3118 if (s.skipDrag !== true) { 3119 if (i.isInside == true && !r(s)) { 3120 s.startPoint = i; 3121 s.drag = i.drag; 3122 s.dragPage = i.page; 3123 s.corner = i.corner; 3124 k(s.corner); 3125 o(s.dragPage); 3126 if (i.page.isHard) { 3127 } else { 3128 i.page.updatePoint(i, s) 3129 } 3130 if (i.page.name == "0") { 3131 s.shadow.css({ 3132 width: "50%", 3133 left: s.direction == t.DIRECTION.RTL ? 0 : "50%", 3134 transitionDelay: "" 3135 }) 3136 } else if (i.page.name == Math.ceil(s.pageCount / 2) - 1) { 3137 s.shadow.css({ 3138 width: "50%", 3139 left: s.direction == t.DIRECTION.RTL ? "50%" : 0, 3140 transitionDelay: "" 3141 }) 3142 } 3143 } 3144 } 3145 }, g = function (e) { 3146 var t = 0; 3147 if (e.wheelDelta != null) { 3148 t = e.wheelDelta / 120 3149 } else if (e.detail != null) { 3150 t = -e.detail / 3 3151 } 3152 var i = s.contentProvider.zoomScale, n = s.contentProvider.maxZoom; 3153 if (t) { 3154 if (t > 0 && i < n || t < 0 && i > 1) { 3155 e.stopPropagation(); 3156 e.preventDefault(); 3157 var a = s.eventToPoint(e); 3158 var o = s.eventToPoint(e); 3159 var r = {x: s.container.width() / 2, y: -23 + s.container.height() / 2}; 3160 s.previewObject.zoom(t); 3161 var l = s.contentProvider.zoomScale; 3162 if (i !== l) { 3163 var c = l / i; 3164 if (l == 1) { 3165 s.left = 0; 3166 s.top = 0 3167 } else { 3168 s.left *= c; 3169 s.top *= c 3170 } 3171 var u = (a.raw.x - r.x) * c, d = (a.raw.y - r.y) * c; 3172 o.raw.x = r.x + u; 3173 o.raw.y = r.y + d; 3174 s.startPoint = o; 3175 s.pan(a); 3176 var f = s.dragPage || a.page; 3177 if (s.dragPage == null && f != null && a.isInside == true && f.magnetic == true) { 3178 f.pendingPoint = a; 3179 f.animateToReset = true; 3180 s.corner = f.magneticCorner; 3181 s.animatePage(f); 3182 f.pendingPoint = null; 3183 f.magnetic = false; 3184 f.magneticCorner = null 3185 } 3186 } 3187 } 3188 } 3189 }; 3190 var v = s.container[0]; 3191 var m = s.stage[0]; 3192 if (v) { 3193 m.addEventListener("mousemove", u, false); 3194 m.addEventListener("touchmove", u, false); 3195 m.addEventListener("mousedown", p, false); 3196 m.addEventListener("click", h, false); 3197 m.addEventListener("mouseup", f, false); 3198 m.addEventListener("touchend", f, false); 3199 m.addEventListener("touchstart", p, false); 3200 if (s.options.scrollWheel == true) { 3201 m.addEventListener("mousewheel", g, false); 3202 m.addEventListener("DOMMouseScroll", g, false) 3203 } 3204 } 3205 this.dispose = function () { 3206 m.removeEventListener("mousemove", u, false); 3207 m.removeEventListener("touchmove", u, false); 3208 m.removeEventListener("mousedown", p, false); 3209 m.removeEventListener("click", h, false); 3210 m.removeEventListener("mouseup", f, false); 3211 m.removeEventListener("touchend", f, false); 3212 m.removeEventListener("touchstart", p, false); 3213 if (s.options.scrollWheel == true) { 3214 m.removeEventListener("mousewheel", g, false); 3215 m.removeEventListener("DOMMouseScroll", g, false) 3216 } 3217 s.updatePageCallback = null; 3218 s.flipCallback = null; 3219 s.animateF = null; 3220 s.stage.remove() 3221 } 3222 } 3223 3224 s.prototype = { 3225 add: function (e) { 3226 if (e instanceof K) this.container.append(i(e.element)); else this.container.append(i(e)) 3227 }, pan: function (e) { 3228 var t = this.startPoint; 3229 var i = this.contentProvider.zoomScale; 3230 var n = this.left + (e.raw.x - t.raw.x), a = this.top + (e.raw.y - t.raw.y); 3231 this.left = Math.round(S(n, -this.shiftWidth, this.shiftWidth)); 3232 this.top = Math.round(S(a, -this.shiftHeight, this.shiftHeight)); 3233 if (i == 1) { 3234 this.left = 0; 3235 this.top = 0 3236 } 3237 this.startPoint = e; 3238 this.stage.css({transform: "translate3d(" + this.left + "px," + this.top + "px,0)"}) 3239 }, getPageByNumber: function (e) { 3240 var t = A(this) ? z(this) ? e + 1 : e : Math.floor((e - 1) / 2); 3241 var i; 3242 for (var n = 0; n < this.pages.length; n++) { 3243 if (t == parseInt(this.pages[n].name, 10)) i = this.pages[n] 3244 } 3245 return i 3246 }, getPageSide: function (e) { 3247 var i = this.direction == t.DIRECTION.RTL; 3248 var n = this.getPageByNumber(e); 3249 if (n == null) return; 3250 if (A(this)) return i ? n.front : n.back; 3251 if (e % 2 == 0) return i ? n.back : n.front; else return i ? n.front : n.back 3252 }, getContentLayer: function (e) { 3253 var t = this.getPageSide(e); 3254 return t == null ? null : t.contentLayer 3255 } 3256 }; 3257 s.prototype.init = function (e) { 3258 var t = this; 3259 t.stage = i(h.div, {class: "df-book-stage"}); 3260 t.wrapper = i(h.div, {class: "df-book-wrapper"}); 3261 t.shadow = i(h.div, {class: "df-book-shadow"}); 3262 t.container.append(t.stage); 3263 t.stage.append(t.wrapper); 3264 t.wrapper.append(t.shadow); 3265 t.createStack(e) 3266 }; 3267 s.prototype.createStack = function (e) { 3268 var t = "red,green,blue,yellow,orange,black".split(","); 3269 for (var i = 0; i < this.stackCount; i++) { 3270 e.angles = [, this.stackCount - i]; 3271 e.stiffness = (this.stackCount - i) / 100; 3272 var n = new K(e); 3273 n.angles[1] = 180; 3274 n.index = i; 3275 n.parent = this; 3276 n.textureReady = false; 3277 n.textureRequested = false; 3278 this.wrapper.append(n.element); 3279 n.isFlipping = false; 3280 this.pages.push(n); 3281 n.color = t[i] 3282 } 3283 this.children = this.pages 3284 }; 3285 s.prototype.isPageHard = function (e) { 3286 return l.isHardPage(this.hardConfig, e, this.pageCount, A(this)) 3287 }; 3288 s.prototype.setDuration = function (e) { 3289 this.duration = e 3290 }; 3291 s.prototype.moveBy = function (e) { 3292 var t = this._activePage + e; 3293 t = S(t, this.startPage, this.endPage); 3294 if (this.firstFlipped != true) { 3295 this.previewObject.analytics({eventAction: "First Page Flip", options: this.previewObject.options}); 3296 this.firstFlipped = true 3297 } 3298 this.gotoPage(t) 3299 }; 3300 s.prototype.next = function (e) { 3301 if (e == null) e = this.direction == t.DIRECTION.RTL ? -this.pageMode : this.pageMode; 3302 this.moveBy(e) 3303 }; 3304 s.prototype.prev = function (e) { 3305 if (e == null) e = this.direction == t.DIRECTION.RTL ? this.pageMode : -this.pageMode; 3306 this.moveBy(e) 3307 }; 3308 s.prototype.eventToPoint = function (e) { 3309 e = D(e); 3310 var n = this.wrapper, a = this.pages, o = this.pageWidth, r = this.fullWidth, s = this.height, 3311 l = i(window), c = {x: e.clientX, y: e.clientY}; 3312 var u = c.x - n[0].getBoundingClientRect().left; 3313 var f = c.y - n[0].getBoundingClientRect().top; 3314 c.x = c.x - this.container[0].getBoundingClientRect().left; 3315 c.y = c.y - this.container[0].getBoundingClientRect().top; 3316 var h = this.drag == d.none ? u < o ? u : r - u : this.drag == d.left ? u : r - u; 3317 var p = u < o ? a[this.stackCount / 2 - 1] : a[this.stackCount / 2]; 3318 var g = u < this.foldSense ? d.left : u > r - this.foldSense ? d.right : d.none; 3319 var v = u, m = f, b = s, w = r, x = this.foldSense, P = t.CORNERS, y; 3320 if (v >= 0 && v < x) { 3321 if (m >= 0 && m <= x) y = P.TL; else if (m >= b - x && m <= b) y = P.BL; else if (m > x && m < b - x) y = P.L; else y = P.NONE 3322 } else if (v >= w - x && v <= w) { 3323 if (m >= 0 && m <= x) y = P.TR; else if (m >= b - x && m <= b) y = P.BR; else if (m > x && m < b - x) y = P.R; else y = P.NONE 3324 } else y = P.NONE; 3325 return { 3326 isInsidePage: v >= 0 && v <= w && m >= 0 && m <= b, 3327 isInside: y !== P.NONE && y !== P.L && y !== P.R, 3328 x: u, 3329 y: f, 3330 fullWidth: r, 3331 rawDistance: r - u, 3332 distance: h, 3333 page: p, 3334 drag: g, 3335 foldSense: this.foldSense, 3336 event: e, 3337 raw: c, 3338 corner: y 3339 } 3340 }; 3341 s.prototype.gotoPage = function (e) { 3342 e = parseInt(e, 10); 3343 this._activePage = e; 3344 if (this.autoPlay == true) { 3345 this.previewObject.setAutoPlay(this.autoPlay) 3346 } 3347 this.updatePage(e); 3348 if (this && this.thumblist && this.thumblist.review) this.thumblist.review() 3349 }; 3350 s.prototype.refresh = function () { 3351 this.updatePage(this._activePage); 3352 if (this.flipCallback != null) this.flipCallback() 3353 }; 3354 s.prototype.updatePage = function (e) { 3355 var a = this.direction == t.DIRECTION.RTL, o = A(this), r = F(e); 3356 var s = o ? 1 : 2; 3357 e = Math.floor(e / s); 3358 if (a) e = Math.ceil(this.pageCount / s) - e; 3359 var l = this.oldBaseNumber || 0; 3360 var c = this.pageCount / s; 3361 var u = this.stackCount; 3362 var f = Math.floor(u / 2); 3363 if (l > e) { 3364 this.children[u - 1].skipFlip = true; 3365 this.children.unshift(this.children.pop()) 3366 } else if (l < e) { 3367 this.children[0].skipFlip = true; 3368 this.children.push(this.children.shift()) 3369 } 3370 for (var h = 0; h < u; h++) { 3371 var p = this.children[h]; 3372 if (l !== e) { 3373 if (p.currentTween != null) { 3374 p.clearTween(true) 3375 } 3376 } 3377 var g = p.side; 3378 var v; 3379 var m = e - f + h; 3380 if (a) m = o ? this.pageCount - m : Math.ceil(this.pageCount / 2) - m - 1; 3381 var b = p.name; 3382 p.isHard = this.isPageHard(m); 3383 if (p.isHard) { 3384 p.element.addClass("df-hard-page") 3385 } else { 3386 p.element.removeClass("df-hard-page"); 3387 p.front.css({display: "block"}); 3388 p.back.css({display: "block"}) 3389 } 3390 if (m == 0 || m == c) { 3391 p.element.addClass("df-cover-page") 3392 } else { 3393 p.element.removeClass("df-cover-page") 3394 } 3395 var w = i(p.element).attr("pageNumber"); 3396 if (w != m) { 3397 p.front.contentLayer.empty(); 3398 p.back.contentLayer.empty() 3399 } 3400 i(p.element).attr("pageNumber", m); 3401 p.isEdge = false; 3402 if (h == 0) { 3403 } else if (h == u - 1) { 3404 } else { 3405 p.isEdge = false 3406 } 3407 if (h < f) { 3408 v = d.left 3409 } else { 3410 v = d.right 3411 } 3412 if (p.isFlipping == false) { 3413 if (v !== g && p.skipFlip == false) { 3414 this.animatePage(p); 3415 if (this.preFlipCallback != null) this.preFlipCallback() 3416 } else { 3417 p.skipFlip = false; 3418 p.element.removeClass("df-flipping df-quick-turn df-folding df-left-side df-right-side"); 3419 p.element.addClass(h < f ? "df-left-side" : "df-right-side"); 3420 p.side = v 3421 } 3422 } 3423 p.visible = o ? a ? h < f || p.isFlipping : h >= f || p.isFlipping : m >= 0 && m < c || o && m == c; 3424 if (this.requestPage != null && p.visible == true) { 3425 p.name = m.toString(); 3426 if (p.name != b) { 3427 p.backTextureLoaded = false; 3428 p.frontTextureLoaded = false; 3429 p.backPageStamp = "-1"; 3430 p.frontPageStamp = "-1"; 3431 p.thumbLoaded = false; 3432 p.front.contentLayer.html(""); 3433 p.back.contentLayer.html(""); 3434 p.frontImage(n.textureLoadFallback); 3435 p.backImage(n.textureLoadFallback); 3436 this.requestPage() 3437 } 3438 } 3439 p.oldDepth = p.depth; 3440 p.updateCSS({ 3441 display: p.visible == true ? "block" : "none", 3442 zIndex: 6 + (h < f ? h - f : f - h), 3443 transform: "" 3444 }); 3445 if (p.pendingPoint == null && p.isFlipping == false) { 3446 p.resetCSS() 3447 } 3448 } 3449 if (TWEEN.getAll().length == 0) { 3450 clearInterval(this.animate) 3451 } 3452 i(".quick-hint").html(e); 3453 this.oldBaseNumber = e; 3454 if (this.updatePageCallback) this.updatePageCallback() 3455 }; 3456 s.prototype.animatePage = function (e) { 3457 e.element.addClass("df-flipping"); 3458 e.isFlipping = true; 3459 if (this.animate != null) { 3460 clearInterval(this.animate) 3461 } 3462 this.animate = setInterval(this.animateF, 30); 3463 e.tween(e.pendingPoint) 3464 }; 3465 return s 3466 }({}); 3467 var Q = function (e) { 3468 H(a, e); 3469 3470 function a(n, a, o) { 3471 e.call(this, o); 3472 var r = this; 3473 r.type = "FlipBook"; 3474 r.container = n; 3475 r.options = o; 3476 r.options.source = a; 3477 r.contentSource = a; 3478 if (o.height != null && o.height.toString().indexOf("%") < 0) { 3479 r.container.height(Math.min(o.height, i(window).height())) 3480 } else { 3481 r.container.height(o.height) 3482 } 3483 if (r.options.isLightBox) { 3484 window.dfLightBox.closeButton.addClass(r.options.icons["close"]) 3485 } 3486 if (r.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL) { 3487 if (Array === r.contentSource.constructor || Array.isArray(r.contentSource) || r.contentSource instanceof Array) { 3488 r.options.singlePageMode = t.SINGLE_PAGE_MODE.ZOOM 3489 } 3490 r.container.addClass("df-double-internal") 3491 } 3492 if (!r.options.isLightBox && r.container.attr("id") != null) { 3493 r.options.id = r.container.attr("id") 3494 } 3495 if (r.options.parsed !== true && r.options.links != null) { 3496 t.parseLinks(r.options.links) 3497 } 3498 var l = r.webgl = o.webgl == true && j == true; 3499 n.addClass("df-container df-loading df-init df-floating" + " df-controls-" + r.options.controlsPosition); 3500 if (r.options.transparent == true) { 3501 n.addClass("df-transparent") 3502 } 3503 if (r.options.direction == t.DIRECTION.RTL) { 3504 n.addClass("df-rtl") 3505 } 3506 r.container.info = i(h.div, {class: "loading-info"}).appendTo(r.container).html(r.options.text.loading + "..."); 3507 if (s.indexOf("MSIE") !== -1 || navigator.appVersion.indexOf("Trident/") > 0 || _ && !U) { 3508 r.options.webgl = false 3509 } 3510 if (!!s.match(/msie\s[5-9]/i)) { 3511 r.container.info.html("Your browser (Internet Explorer) is out of date to run DFlip Flipbook Plugin. <br><a href='http://browsehappy.com/'>Upgrade to a new one</a>").addClass("df-old-browser"); 3512 n.removeClass("df-loading"); 3513 return r 3514 } 3515 var c = o.backgroundImage == null || o.backgroundImage == "" ? "" : "url('" + o.backgroundImage + "')"; 3516 r.container.css({ 3517 position: "relative", 3518 overflow: "hidden", 3519 backgroundColor: o.backgroundColor, 3520 backgroundImage: c 3521 }); 3522 if (r.options.isLightBox == true) { 3523 r.analytics({eventAction: "Open Book", options: r.options}) 3524 } 3525 r.init(l, a); 3526 if (r.options.onCreate != null) r.options.onCreate(r); 3527 return r 3528 } 3529 3530 a.prototype.init = function (e) { 3531 var a = this; 3532 var o = a.target; 3533 var r = a.options; 3534 if (e == true) { 3535 var s = function (e) { 3536 var i = function () { 3537 MOCKUP.defaults.anisotropy = 0; 3538 MOCKUP.defaults.groundTexture = "blank"; 3539 THREE.skipPowerOfTwo = true; 3540 q(); 3541 if (e != null) e() 3542 }; 3543 if (window.MOCKUP == null) { 3544 a.updateInfo(r.text.loading + " WEBGL 3D ..."); 3545 if (typeof define === "function" && define.amd && window.requirejs) { 3546 requirejs.config({ 3547 paths: {three: n.threejsSrc.replace(".js", "")}, 3548 shim: {three: {exports: "THREE"}} 3549 }); 3550 require(["three"], function (e) { 3551 window.THREE = e; 3552 M(n.mockupjsSrc + "?ver=" + t.version, function () { 3553 i() 3554 }); 3555 return e 3556 }) 3557 } else if (typeof define === "function" && define.amd) { 3558 require(["three", n.threejsSrc.replace(".js", "")], function (e, t) { 3559 e(function () { 3560 }) 3561 }) 3562 } else { 3563 M(n.threejsSrc + "?ver=" + t.version, function () { 3564 M(n.mockupjsSrc + "?ver=" + t.version, function () { 3565 i() 3566 }) 3567 }) 3568 } 3569 } else { 3570 i() 3571 } 3572 }; 3573 s(function () { 3574 a.container.css({minHeight: 300, minWidth: 300}); 3575 a.stage = new G(R(a.options, {container: a.container})); 3576 a.stage.previewObject = a; 3577 a.contentProvider = new Y(a.contentSource, function (n) { 3578 var r = { 3579 pageCount: n.pageCount, 3580 stackCount: 6, 3581 segments: 20, 3582 width: n.bookSize.width, 3583 height: n.bookSize.height 3584 }; 3585 a.target = o = a.stage.target = new MOCKUP.Book(R(a.options, r), a.stage); 3586 a.extendtarget(); 3587 V(a.container, a); 3588 o.ui = a.ui; 3589 o.container = a.container; 3590 n.webgl = e; 3591 n.setTarget(a.target); 3592 o.getContentLayer = function (e) { 3593 var i = o.direction == t.DIRECTION.RTL, n = a.stage.cssScene.divLeft.element, 3594 r = a.stage.cssScene.divRight.element; 3595 var s = F(o._activePage); 3596 if (A(o)) return i ? n : r; 3597 if (e % 2 == 0) return i ? r : n; else return i ? n : r 3598 }; 3599 o.stage = a.stage; 3600 o.flipCallback = function () { 3601 if (a.contentProvider) { 3602 a.contentProvider.review("flipCallback"); 3603 var e = F(o._activePage); 3604 var n, r; 3605 var s = o.getPageByNumber(e), l = o.getPageByNumber(e + 1); 3606 var c = o.parent.cssScene.divLeft, u = o.parent.cssScene.divRight; 3607 var d = o.pageMode == t.PAGE_MODE.SINGLE; 3608 var f = o.direction == t.DIRECTION.RTL; 3609 if (s != null && c != null) { 3610 n = Math.abs(s.geometry.boundingBox.max.x - s.geometry.boundingBox.min.x); 3611 r = Math.abs(s.geometry.boundingBox.max.z - s.geometry.boundingBox.min.z); 3612 c.rotation.y = -Math.atan2(r, n) * .9; 3613 c.position.z = r * .8; 3614 c.position.x = r / 2.5; 3615 i(c.element).css({width: n, left: -n / 2}) 3616 } 3617 if (l != null && u != null) { 3618 n = Math.abs(l.geometry.boundingBox.max.x - l.geometry.boundingBox.min.x); 3619 r = Math.abs(l.geometry.boundingBox.max.z - l.geometry.boundingBox.min.z); 3620 u.rotation.y = Math.atan2(r, n) * .9; 3621 u.position.z = r * .8; 3622 u.position.x = -r / 2.5; 3623 i(u.element).css({width: n, left: n / 2}) 3624 } 3625 if (a.options.onFlip != null) a.options.onFlip(a) 3626 } 3627 }; 3628 o.resize = function () { 3629 a.resize() 3630 }(); 3631 o.updatePageCallback = function () { 3632 a.ui.update(); 3633 a.checkCenter(); 3634 a.stage.renderRequestPending = true 3635 }; 3636 var s = i(a.stage.cssScene.divLeft.element); 3637 var l = i(a.stage.cssScene.divRight.element); 3638 o.preFlipCallback = function () { 3639 s.empty(); 3640 l.empty(); 3641 if (a.options.beforeFlip != null) a.options.beforeFlip(a); 3642 a.playSound() 3643 }; 3644 i(window).trigger("resize"); 3645 s.css({width: n.bookSize.width, height: n.bookSize.height, left: -n.bookSize.width / 2}); 3646 l.css({width: n.bookSize.width, height: n.bookSize.height, left: n.bookSize.width / 2}); 3647 o.ease = TWEEN.Easing.Cubic.InOut; 3648 o.contentProvider = n; 3649 o.duration = a.options.duration; 3650 o.gotoPage(o._activePage); 3651 o.flipCallback(); 3652 if (a.options.isLightBox == true) { 3653 a.analytics({eventAction: "Book Ready", options: a.options}) 3654 } 3655 if (a.options.onReady != null) a.options.onReady(a) 3656 }, r, a) 3657 }) 3658 } else { 3659 a.contentProvider = new Y(a.contentSource, function (t) { 3660 var n = {pageCount: t.pageCount, contentSourceType: t.contentSourceType}; 3661 a.target = o = new X(R(a.options, n), a.container); 3662 a.target.previewObject = a; 3663 a.extendtarget(); 3664 V(a.container, a); 3665 t.webgl = e; 3666 t.setTarget(a.target); 3667 t.waitPeriod = 2; 3668 o.ease = TWEEN.Easing.Quadratic.InOut; 3669 o.duration = a.options.duration; 3670 o.container = a.container; 3671 o.updatePageCallback = function () { 3672 a.ui.update(); 3673 a.checkCenter() 3674 }; 3675 o.resize = function () { 3676 a.resize() 3677 }(); 3678 i(window).trigger("resize"); 3679 o.flipCallback = function () { 3680 if (a.contentProvider) { 3681 a.contentProvider.review("flipCallback"); 3682 if (a.options.onFlip != null) a.options.onFlip(a) 3683 } 3684 }; 3685 o.preFlipCallback = function () { 3686 if (a.options.beforeFlip != null) a.options.beforeFlip(a); 3687 a.playSound() 3688 }; 3689 o.gotoPage(o._activePage); 3690 o.flipCallback(); 3691 if (a.options.onReady != null) a.options.onReady(a); 3692 a.analytics({eventAction: "Book Ready", options: a.options}) 3693 }, r, a) 3694 } 3695 }; 3696 a.prototype.extendtarget = function () { 3697 var e = this; 3698 e.target.previewObject = e; 3699 e.target.reset = function () { 3700 for (var t = 0; t < e.target.children.length; t++) { 3701 var i = e.target.children[t]; 3702 i.skipFlip = true; 3703 i.name = "-2" 3704 } 3705 e.contentProvider.annotedPage = "-2"; 3706 e.target.refresh() 3707 } 3708 }; 3709 a.prototype.getURLHash = function () { 3710 if (this.options.id != null) { 3711 var e = l.getSharePrefix() + (this.options.slug != null ? this.options.slug : this.options.id) + "/"; 3712 if (this.target != null && this.target._activePage != null) { 3713 e += this.target._activePage + "/" 3714 } 3715 window.location.hash = e 3716 } 3717 return window.location.href 3718 }; 3719 a.prototype.end = function () { 3720 this.target.gotoPage(this.target.endPage) 3721 }; 3722 a.prototype.gotoPage = function (e) { 3723 this.target.gotoPage(e); 3724 if (this.ui != null) this.ui.update() 3725 }; 3726 a.prototype.prev = function () { 3727 this.target.prev() 3728 }; 3729 a.prototype.next = function () { 3730 this.target.next() 3731 }; 3732 a.prototype.updateInfo = function (e) { 3733 if (this.container && this.container.info && this.container.info.html) this.container.info.html(e) 3734 }; 3735 a.prototype.analytics = function (e) { 3736 if (this.options.enableAnalytics == true) { 3737 try { 3738 var t = e.options, i = undefined; 3739 if (t) { 3740 i = t.bookTitle || t.slug || t.id 3741 } 3742 var n = window.gtag; 3743 if (n) { 3744 n("event", e.eventAction, {event_category: "Flipbook", event_label: i}) 3745 } else { 3746 var a = window.ga || window.__gaTracker; 3747 a("send", { 3748 hitType: "event", 3749 eventCategory: "Flipbook", 3750 eventAction: e.eventAction, 3751 eventLabel: i 3752 }) 3753 } 3754 } catch (e) { 3755 } 3756 } 3757 }; 3758 return a 3759 }(Z); 3760 i.fn.extend({ 3761 shelf: function () { 3762 }, flipBook: function (e, t) { 3763 return new Q(i(this), e, W(t)) 3764 } 3765 }) 3766})(DJFlipBook, jQuery); 3767(function (e) { 3768 "use strict"; 3769 e.URL = e.URL || e.webkitURL; 3770 if (e.Blob && e.URL) { 3771 try { 3772 new Blob; 3773 return 3774 } catch (e) { 3775 } 3776 } 3777 var t = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || function (e) { 3778 var t = function (e) { 3779 return Object.prototype.toString.call(e).match(/^\[object\s(.*)\]$/)[1] 3780 }, i = function e() { 3781 this.data = [] 3782 }, n = function e(t, i, n) { 3783 this.data = t; 3784 this.size = t.length; 3785 this.type = i; 3786 this.encoding = n 3787 }, a = i.prototype, o = n.prototype, r = e.FileReaderSync, s = function (e) { 3788 this.code = this[this.name = e] 3789 }, 3790 l = ("NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR").split(" "), 3791 c = l.length, u = e.URL || e.webkitURL || e, d = u.createObjectURL, f = u.revokeObjectURL, h = u, 3792 p = e.btoa, g = e.atob, v = e.ArrayBuffer, m = e.Uint8Array, b = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/; 3793 n.fake = o.fake = true; 3794 while (c--) { 3795 s.prototype[l[c]] = c + 1 3796 } 3797 if (!u.createObjectURL) { 3798 h = e.URL = function (e) { 3799 var t = document.createElementNS("http://www.w3.org/1999/xhtml", "a"), i; 3800 t.href = e; 3801 if (!("origin" in t)) { 3802 if (t.protocol.toLowerCase() === "data:") { 3803 t.origin = null 3804 } else { 3805 i = e.match(b); 3806 t.origin = i && i[1] 3807 } 3808 } 3809 return t 3810 } 3811 } 3812 h.createObjectURL = function (e) { 3813 var t = e.type, i; 3814 if (t === null) { 3815 t = "application/octet-stream" 3816 } 3817 if (e instanceof n) { 3818 i = "data:" + t; 3819 if (e.encoding === "base64") { 3820 return i + ";base64," + e.data 3821 } else if (e.encoding === "URI") { 3822 return i + "," + decodeURIComponent(e.data) 3823 } 3824 if (p) { 3825 return i + ";base64," + p(e.data) 3826 } else { 3827 return i + "," + encodeURIComponent(e.data) 3828 } 3829 } else if (d) { 3830 return d.call(u, e) 3831 } 3832 }; 3833 h.revokeObjectURL = function (e) { 3834 if (e.substring(0, 5) !== "data:" && f) { 3835 f.call(u, e) 3836 } 3837 }; 3838 a.append = function (e) { 3839 var i = this.data; 3840 if (m && (e instanceof v || e instanceof m)) { 3841 var a = "", o = new m(e), l = 0, c = o.length; 3842 for (; l < c; l++) { 3843 a += String.fromCharCode(o[l]) 3844 } 3845 i.push(a) 3846 } else if (t(e) === "Blob" || t(e) === "File") { 3847 if (r) { 3848 var u = new r; 3849 i.push(u.readAsBinaryString(e)) 3850 } else { 3851 throw new s("NOT_READABLE_ERR") 3852 } 3853 } else if (e instanceof n) { 3854 if (e.encoding === "base64" && g) { 3855 i.push(g(e.data)) 3856 } else if (e.encoding === "URI") { 3857 i.push(decodeURIComponent(e.data)) 3858 } else if (e.encoding === "raw") { 3859 i.push(e.data) 3860 } 3861 } else { 3862 if (typeof e !== "string") { 3863 e += "" 3864 } 3865 i.push(unescape(encodeURIComponent(e))) 3866 } 3867 }; 3868 a.getBlob = function (e) { 3869 if (!arguments.length) { 3870 e = null 3871 } 3872 return new n(this.data.join(""), e, "raw") 3873 }; 3874 a.toString = function () { 3875 return "[object BlobBuilder]" 3876 }; 3877 o.slice = function (e, t, i) { 3878 var a = arguments.length; 3879 if (a < 3) { 3880 i = null 3881 } 3882 return new n(this.data.slice(e, a > 1 ? t : this.data.length), i, this.encoding) 3883 }; 3884 o.toString = function () { 3885 return "[object Blob]" 3886 }; 3887 o.close = function () { 3888 this.size = 0; 3889 delete this.data 3890 }; 3891 return i 3892 }(e); 3893 e.Blob = function (e, i) { 3894 var n = i ? i.type || "" : ""; 3895 var a = new t; 3896 if (e) { 3897 for (var o = 0, r = e.length; o < r; o++) { 3898 if (Uint8Array && e[o] instanceof Uint8Array) { 3899 a.append(e[o].buffer) 3900 } else { 3901 a.append(e[o]) 3902 } 3903 } 3904 } 3905 var s = a.getBlob(n); 3906 if (!s.slice && s.webkitSlice) { 3907 s.slice = s.webkitSlice 3908 } 3909 return s 3910 }; 3911 var i = Object.getPrototypeOf || function (e) { 3912 return e.__proto__ 3913 }; 3914 e.Blob.prototype = i(new e.Blob) 3915})(window); 3916(function (e) { 3917 "use strict"; 3918 var t = e.Uint8Array, i = e.HTMLCanvasElement, n = i && i.prototype, a = /\s*;\s*base64\s*(?:;|$)/i, 3919 o = "toDataURL", r, s = function (e) { 3920 var i = e.length, n = new t(i / 4 * 3 | 0), a = 0, o = 0, s = [0, 0], l = 0, c = 0, u, d; 3921 while (i--) { 3922 d = e.charCodeAt(a++); 3923 u = r[d - 43]; 3924 if (u !== 255 && u != null) { 3925 s[1] = s[0]; 3926 s[0] = d; 3927 c = c << 6 | u; 3928 l++; 3929 if (l === 4) { 3930 n[o++] = c >>> 16; 3931 if (s[1] !== 61) { 3932 n[o++] = c >>> 8 3933 } 3934 if (s[0] !== 61) { 3935 n[o++] = c 3936 } 3937 l = 0 3938 } 3939 } 3940 } 3941 return n 3942 }; 3943 if (t) { 3944 r = new t([62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]) 3945 } 3946 if (i && !n.toBlob) { 3947 n.toBlob = function (e, i) { 3948 if (!i) { 3949 i = "image/png" 3950 } 3951 if (this.mozGetAsFile) { 3952 e(this.mozGetAsFile("canvas", i)); 3953 return 3954 } 3955 if (this.msToBlob && /^\s*image\/png\s*(?:$|;)/i.test(i)) { 3956 e(this.msToBlob()); 3957 return 3958 } 3959 var n = Array.prototype.slice.call(arguments, 1), r = this[o].apply(this, n), l = r.indexOf(","), 3960 c = r.substring(l + 1), u = a.test(r.substring(0, l)), d; 3961 if (Blob.fake) { 3962 d = new Blob; 3963 if (u) { 3964 d.encoding = "base64" 3965 } else { 3966 d.encoding = "URI" 3967 } 3968 d.data = c; 3969 d.size = c.length 3970 } else if (t) { 3971 if (u) { 3972 d = new Blob([s(c)], {type: i}) 3973 } else { 3974 d = new Blob([decodeURIComponent(c)], {type: i}) 3975 } 3976 } 3977 e(d) 3978 }; 3979 if (n.toDataURLHD) { 3980 n.toBlobHD = function () { 3981 o = "toDataURLHD"; 3982 var e = this.toBlob(); 3983 o = "toDataURL"; 3984 return e 3985 } 3986 } else { 3987 n.toBlobHD = n.toBlob 3988 } 3989 } 3990})(window); 3991(function e() { 3992 if ("performance" in window === false) { 3993 window.performance = {} 3994 } 3995 Date.now = Date.now || function () { 3996 return (new Date).getTime() 3997 }; 3998 if ("now" in window.performance === false) { 3999 var t = window.performance.timing && window.performance.timing.navigationStart ? window.performance.timing.navigationStart : Date.now(); 4000 window.performance.now = function () { 4001 return Date.now() - t 4002 } 4003 } 4004})(); 4005(function e() { 4006 var t = t || function () { 4007 var e = []; 4008 return { 4009 getAll: function () { 4010 return e 4011 }, removeAll: function () { 4012 e = [] 4013 }, add: function (t) { 4014 e.push(t) 4015 }, remove: function (t) { 4016 var i = e.indexOf(t); 4017 if (i !== -1) { 4018 e.splice(i, 1) 4019 } 4020 }, update: function (t) { 4021 if (e.length === 0) { 4022 return false 4023 } 4024 var i = 0; 4025 t = t != null ? t : window.performance.now(); 4026 while (i < e.length) { 4027 if (e[i].update(t)) { 4028 i++ 4029 } else { 4030 e.splice(i, 1) 4031 } 4032 } 4033 return true 4034 } 4035 } 4036 }(); 4037 t.Tween = function (e) { 4038 var i = e; 4039 var n = {}; 4040 var a = {}; 4041 var o = {}; 4042 var r = 1e3; 4043 var s = 0; 4044 var l = false; 4045 var c = false; 4046 var u = false; 4047 var d = 0; 4048 var f = null; 4049 var h = t.Easing.Linear.None; 4050 var p = t.Interpolation.Linear; 4051 var g = []; 4052 var v = null; 4053 var m = false; 4054 var b = null; 4055 var w = null; 4056 var x = null; 4057 for (var P in e) { 4058 n[P] = parseFloat(e[P], 10) 4059 } 4060 this.to = function (e, t) { 4061 if (t != null) { 4062 r = t 4063 } 4064 a = e; 4065 return this 4066 }; 4067 this.start = function (e) { 4068 t.add(this); 4069 c = true; 4070 m = false; 4071 f = e != null ? e : window.performance.now(); 4072 f += d; 4073 for (var r in a) { 4074 if (a[r] instanceof Array) { 4075 if (a[r].length === 0) { 4076 continue 4077 } 4078 a[r] = [i[r]].concat(a[r]) 4079 } 4080 if (n[r] === null) { 4081 continue 4082 } 4083 n[r] = i[r]; 4084 if (n[r] instanceof Array === false) { 4085 n[r] *= 1 4086 } 4087 o[r] = n[r] || 0 4088 } 4089 return this 4090 }; 4091 this.stop = function () { 4092 if (!c) { 4093 return this 4094 } 4095 t.remove(this); 4096 c = false; 4097 if (x !== null) { 4098 x.call(i) 4099 } 4100 this.stopChainedTweens(); 4101 return this 4102 }; 4103 this.stopChainedTweens = function () { 4104 for (var e = 0, t = g.length; e < t; e++) { 4105 g[e].stop() 4106 } 4107 }; 4108 this.complete = function () { 4109 if (!c) { 4110 return this 4111 } 4112 t.remove(this); 4113 c = false; 4114 if (w !== null) { 4115 w.call(i) 4116 } 4117 this.completeChainedTweens(); 4118 return this 4119 }; 4120 this.completeChainedTweens = function () { 4121 for (var e = 0, t = g.length; e < t; e++) { 4122 g[e].complete() 4123 } 4124 }; 4125 this.delay = function (e) { 4126 d = e; 4127 return this 4128 }; 4129 this.repeat = function (e) { 4130 s = e; 4131 return this 4132 }; 4133 this.yoyo = function (e) { 4134 l = e; 4135 return this 4136 }; 4137 this.easing = function (e) { 4138 h = e == null ? h : e; 4139 return this 4140 }; 4141 this.interpolation = function (e) { 4142 p = e; 4143 return this 4144 }; 4145 this.chain = function () { 4146 g = arguments; 4147 return this 4148 }; 4149 this.onStart = function (e) { 4150 v = e; 4151 return this 4152 }; 4153 this.onUpdate = function (e) { 4154 b = e; 4155 return this 4156 }; 4157 this.onComplete = function (e) { 4158 w = e; 4159 return this 4160 }; 4161 this.onStop = function (e) { 4162 x = e; 4163 return this 4164 }; 4165 this.update = function (e) { 4166 var t; 4167 var c; 4168 var x; 4169 if (e < f) { 4170 return true 4171 } 4172 if (m === false) { 4173 if (v !== null) { 4174 v.call(i) 4175 } 4176 m = true 4177 } 4178 c = (e - f) / r; 4179 c = c > 1 ? 1 : c; 4180 x = h(c); 4181 for (t in a) { 4182 if (n[t] === null) { 4183 continue 4184 } 4185 var P = n[t] || 0; 4186 var y = a[t]; 4187 if (y instanceof Array) { 4188 i[t] = p(y, x) 4189 } else { 4190 if (typeof y === "string") { 4191 if (y.startsWith("+") || y.startsWith("-")) { 4192 y = P + parseFloat(y, 10) 4193 } else { 4194 y = parseFloat(y, 10) 4195 } 4196 } 4197 if (typeof y === "number") { 4198 i[t] = P + (y - P) * x 4199 } 4200 } 4201 } 4202 if (b !== null) { 4203 b.call(i, x) 4204 } 4205 if (c === 1) { 4206 if (s > 0) { 4207 if (isFinite(s)) { 4208 s-- 4209 } 4210 for (t in o) { 4211 if (typeof a[t] === "string") { 4212 o[t] = o[t] + parseFloat(a[t], 10) 4213 } 4214 if (l) { 4215 var C = o[t]; 4216 o[t] = a[t]; 4217 a[t] = C 4218 } 4219 n[t] = o[t] 4220 } 4221 if (l) { 4222 u = !u 4223 } 4224 f = e + d; 4225 return true 4226 } else { 4227 if (w !== null) { 4228 w.call(i) 4229 } 4230 for (var L = 0, S = g.length; L < S; L++) { 4231 g[L].start(f + r) 4232 } 4233 return false 4234 } 4235 } 4236 return true 4237 } 4238 }; 4239 t.Easing = { 4240 Linear: { 4241 None: function (e) { 4242 return e 4243 } 4244 }, Quadratic: { 4245 In: function (e) { 4246 return e * e 4247 }, Out: function (e) { 4248 return e * (2 - e) 4249 }, InOut: function (e) { 4250 if ((e *= 2) < 1) { 4251 return .5 * e * e 4252 } 4253 return -.5 * (--e * (e - 2) - 1) 4254 } 4255 }, Quartic: { 4256 In: function (e) { 4257 return e * e * e * e 4258 }, Out: function (e) { 4259 return 1 - --e * e * e * e 4260 }, InOut: function (e) { 4261 if ((e *= 2) < 1) { 4262 return .5 * e * e * e * e 4263 } 4264 return -.5 * ((e -= 2) * e * e * e - 2) 4265 } 4266 }, Sinusoidal: { 4267 In: function (e) { 4268 return 1 - Math.cos(e * Math.PI / 2) 4269 }, Out: function (e) { 4270 return Math.sin(e * Math.PI / 2) 4271 }, InOut: function (e) { 4272 return .5 * (1 - Math.cos(Math.PI * e)) 4273 } 4274 }, Cubic: { 4275 In: function (e) { 4276 return e * e * e 4277 }, Out: function (e) { 4278 return --e * e * e + 1 4279 }, InOut: function (e) { 4280 if ((e *= 2) < 1) { 4281 return .5 * e * e * e 4282 } 4283 return .5 * ((e -= 2) * e * e + 2) 4284 } 4285 } 4286 }; 4287 t.Interpolation = { 4288 Linear: function (e, i) { 4289 var n = e.length - 1; 4290 var a = n * i; 4291 var o = Math.floor(a); 4292 var r = t.Interpolation.Utils.Linear; 4293 if (i < 0) { 4294 return r(e[0], e[1], a) 4295 } 4296 if (i > 1) { 4297 return r(e[n], e[n - 1], n - a) 4298 } 4299 return r(e[o], e[o + 1 > n ? n : o + 1], a - o) 4300 }, Bezier: function (e, i) { 4301 var n = 0; 4302 var a = e.length - 1; 4303 var o = Math.pow; 4304 var r = t.Interpolation.Utils.Bernstein; 4305 for (var s = 0; s <= a; s++) { 4306 n += o(1 - i, a - s) * o(i, s) * e[s] * r(a, s) 4307 } 4308 return n 4309 }, Utils: { 4310 Linear: function (e, t, i) { 4311 return (t - e) * i + e 4312 }, Bernstein: function (e, i) { 4313 var n = t.Interpolation.Utils.Factorial; 4314 return n(e) / n(i) / n(e - i) 4315 }, Factorial: function () { 4316 var e = [1]; 4317 return function (t) { 4318 var i = 1; 4319 if (e[t]) { 4320 return e[t] 4321 } 4322 for (var n = t; n > 1; n--) { 4323 i *= n 4324 } 4325 e[t] = i; 4326 return i 4327 } 4328 }(), CatmullRom: function (e, t, i, n, a) { 4329 var o = (i - e) * .5; 4330 var r = (n - t) * .5; 4331 var s = a * a; 4332 var l = a * s; 4333 return (2 * t - 2 * i + o + r) * l + (-3 * t + 3 * i - 2 * o - r) * s + o * a + t 4334 } 4335 } 4336 }; 4337 window.TWEEN = t 4338})(); 4339DJFlipBook.createBlob = function e(t, i) { 4340 if (typeof Blob !== "undefined") { 4341 return new Blob([t], {type: i}) 4342 } 4343 var n = new MozBlobBuilder; 4344 n.append(t); 4345 return n.getBlob(i) 4346}; 4347DJFlipBook.createObjectURL = function e() { 4348 var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 4349 return function e(i, n) { 4350 if (typeof URL !== "undefined" && URL.createObjectURL) { 4351 var a = DJFlipBook.createBlob(i, n); 4352 return URL.createObjectURL(a) 4353 } 4354 var o = "data:" + n + ";base64,"; 4355 for (var r = 0, s = i.length; r < s; r += 3) { 4356 var l = i[r] & 255; 4357 var c = i[r + 1] & 255; 4358 var u = i[r + 2] & 255; 4359 var d = l >> 2, f = (l & 3) << 4 | c >> 4; 4360 var h = r + 1 < s ? (c & 15) << 2 | u >> 6 : 64; 4361 var p = r + 2 < s ? u & 63 : 64; 4362 o += t[d] + t[f] + t[h] + t[p] 4363 } 4364 return o 4365 } 4366}(); 4367var ThumbList = function e() { 4368 function t(e) { 4369 var i = e && e.w + "px" || "100%"; 4370 var n = e && e.h + "px" || "100%"; 4371 var a = this.itemHeight = e.itemHeight; 4372 this.items = e.items; 4373 this.generatorFn = e.generatorFn; 4374 this.totalRows = e.totalRows || e.items && e.items.length; 4375 this.addFn = e.addFn; 4376 this.scrollFn = e.scrollFn; 4377 var o = t.createScroller(a * this.totalRows); 4378 this.container = t.createContainer(i, n); 4379 this.container.appendChild(o); 4380 this.screenItemsLen = Math.ceil(e.h / a); 4381 this.offsetItems = this.screenItemsLen; 4382 this.cachedItemsLen = this.screenItemsLen + this.offsetItems * 2; 4383 this._renderChunk(this.container, 0); 4384 var r = this; 4385 r.lastRepaintY = 0; 4386 var s = this.screenItemsLen * a; 4387 var l = 0; 4388 var c; 4389 4390 function u(e) { 4391 var t = e.target.scrollTop; 4392 if (!r.lastRepaintY || Math.abs(t - r.lastRepaintY) >= r.offsetItems * r.itemHeight) { 4393 var i = parseInt(t / a, 10) - r.offsetItems; 4394 r._renderChunk(r.container, i < 0 ? 0 : i); 4395 r.lastRepaintY = t 4396 } 4397 r.lastScrolled = l = Date.now(); 4398 if (r.scrollFn != null) { 4399 r.scrollFn() 4400 } 4401 e.preventDefault && e.preventDefault() 4402 } 4403 4404 r.dispose = function () { 4405 if (r.container) { 4406 if (r.container.parentNode) { 4407 r.container.parentNode.removeChild(r.container) 4408 } 4409 } 4410 r.container.removeEventListener("scroll", u) 4411 }; 4412 r.container.addEventListener("scroll", u) 4413 } 4414 4415 t.prototype.reset = function (e) { 4416 this.screenItemsLen = Math.ceil(e / this.itemHeight); 4417 this.cachedItemsLen = this.screenItemsLen + this.offsetItems * 2; 4418 var t = parseInt(this.lastRepaintY / this.itemHeight, 10) - this.offsetItems; 4419 this.needReset = true; 4420 this._renderChunk(this.container, Math.max(t, 0)) 4421 }; 4422 t.prototype.createRow = function (e) { 4423 var t; 4424 if (this.generatorFn) { 4425 t = this.generatorFn(e); 4426 t.classList.add("df-vrow"); 4427 t.style.position = "absolute"; 4428 t.style.top = e * this.itemHeight + "px"; 4429 t.setAttribute("index", e) 4430 } 4431 return t 4432 }; 4433 t.prototype._renderChunk = function (e, t) { 4434 var i = this.range == null; 4435 this.range = this.range || {min: 0, max: this.cachedItemsLen}; 4436 var n = this.range; 4437 var a = n.min, o = n.max; 4438 var r = i ? true : t >= a; 4439 if (!i && t == a && this.needReset == false) return; 4440 var s; 4441 var l = i ? a : r ? o : t; 4442 l = l > this.totalRows ? this.totalRows : l < 0 ? 0 : l; 4443 var c = t + this.cachedItemsLen; 4444 c = c > this.totalRows ? this.totalRows : c; 4445 for (s = l; s < c; s++) { 4446 if (r) e.appendChild(this.createRow(s)); else e.insertBefore(this.createRow(s), e.childNodes[1 + s - l]); 4447 if (this.addFn != null) { 4448 this.addFn(s) 4449 } 4450 } 4451 var u = Math.abs(t - a); 4452 this.needReset = false; 4453 if (!i && e.childNodes.length > this.cachedItemsLen + 1) { 4454 var d = r ? 1 : 1 + this.cachedItemsLen, f = d + (c - l); 4455 for (var h = f; h > d; h--) { 4456 if (e.childNodes[d]) this.container.removeChild(e.childNodes[d]) 4457 } 4458 } 4459 this.range.min = t; 4460 this.range.max = c 4461 }; 4462 t.createContainer = function (e, t) { 4463 var i = document.createElement("div"); 4464 i.style.width = e; 4465 i.style.height = t; 4466 i.style.overflow = "auto"; 4467 i.style.position = "relative"; 4468 i.style.padding = 0; 4469 return i 4470 }; 4471 t.createScroller = function (e) { 4472 var t = document.createElement("div"); 4473 t.style.opacity = 0; 4474 t.style.position = "absolute"; 4475 t.style.top = 0; 4476 t.style.left = 0; 4477 t.style.width = "1px"; 4478 t.style.height = e + "px"; 4479 return t 4480 }; 4481 return t 4482}(); 4483var BookMarkViewer = function e() { 4484 function t(e) { 4485 this.outline = null; 4486 this.lastToggleIsShow = true; 4487 this.container = e.container; 4488 this.linkService = e.linkService; 4489 this.outlineItemClass = e.outlineItemClass || "outlineItem"; 4490 this.outlineToggleClass = e.outlineToggleClass || "outlineItemToggler"; 4491 this.outlineToggleHiddenClass = e.outlineToggleHiddenClass || "outlineItemsHidden" 4492 } 4493 4494 t.prototype = { 4495 dispose: function () { 4496 if (this.container) { 4497 if (this.container.parentNode) { 4498 this.container.parentNode.removeChild(this.container) 4499 } 4500 } 4501 this.linkService = null 4502 }, reset: function e() { 4503 this.outline = null; 4504 this.lastToggleIsShow = true; 4505 var t = this.container; 4506 while (t.firstChild) { 4507 t.removeChild(t.firstChild) 4508 } 4509 }, _dispatchEvent: function e(t) { 4510 var i = document.createEvent("CustomEvent"); 4511 i.initCustomEvent("outlineloaded", true, true, {outlineCount: t}); 4512 this.container.dispatchEvent(i) 4513 }, _bindLink: function e(t, i) { 4514 var n = this.linkService; 4515 if (i.custom == true) { 4516 t.href = n.getCustomDestinationHash(i.dest); 4517 t.onclick = function e(t) { 4518 n.customNavigateTo(i.dest); 4519 return false 4520 } 4521 } else { 4522 if (i.url) { 4523 pdfjsLib.addLinkAttributes(t, {url: i.url}); 4524 return 4525 } 4526 t.href = n.getDestinationHash(i.dest); 4527 t.onclick = function e(t) { 4528 n.navigateTo(i.dest); 4529 return false 4530 } 4531 } 4532 }, _addToggleButton: function e(t) { 4533 var i = document.createElement("div"); 4534 i.className = this.outlineToggleClass + " " + this.outlineToggleHiddenClass; 4535 i.onclick = function (e) { 4536 e.stopPropagation(); 4537 i.classList.toggle(this.outlineToggleHiddenClass); 4538 if (e.shiftKey) { 4539 var n = !i.classList.contains(this.outlineToggleHiddenClass); 4540 this._toggleOutlineItem(t, n) 4541 } 4542 }.bind(this); 4543 t.insertBefore(i, t.firstChild) 4544 }, _toggleOutlineItem: function e(t, i) { 4545 this.lastToggleIsShow = i; 4546 var n = t.querySelectorAll("." + this.outlineToggleClass); 4547 for (var a = 0, o = n.length; a < o; ++a) { 4548 n[a].classList[i ? "remove" : "add"](this.outlineToggleHiddenClass) 4549 } 4550 }, toggleOutlineTree: function e() { 4551 if (!this.outline) { 4552 return 4553 } 4554 this._toggleOutlineItem(this.container, !this.lastToggleIsShow) 4555 }, render: function e(t) { 4556 var i = t && t.outline || null; 4557 var n = 0; 4558 if (this.outline) { 4559 this.reset() 4560 } 4561 this.outline = i; 4562 if (!i) { 4563 return 4564 } 4565 var a = document.createDocumentFragment(); 4566 var o = [{parent: a, items: this.outline}]; 4567 var r = false; 4568 while (o.length > 0) { 4569 var s = o.shift(); 4570 var l = s.custom; 4571 for (var c = 0, u = s.items.length; c < u; c++) { 4572 var d = s.items[c]; 4573 var f = document.createElement("div"); 4574 f.className = this.outlineItemClass; 4575 var h = document.createElement("a"); 4576 if (d.custom == null && l != null) d.custom = l; 4577 this._bindLink(h, d); 4578 h.textContent = d.title.replace(/\x00/g, ""); 4579 f.appendChild(h); 4580 if (d.items && d.items.length > 0) { 4581 r = true; 4582 this._addToggleButton(f); 4583 var p = document.createElement("div"); 4584 p.className = this.outlineItemClass + "s"; 4585 f.appendChild(p); 4586 o.push({parent: p, custom: d.custom, items: d.items}) 4587 } 4588 s.parent.appendChild(f); 4589 n++ 4590 } 4591 } 4592 if (r) { 4593 if (this.container.classList != null) { 4594 this.container.classList.add(this.outlineItemClass + "s") 4595 } else if (this.container.className != null) { 4596 this.container.className += " picWindow" 4597 } 4598 } 4599 this.container.appendChild(a); 4600 this._dispatchEvent(n) 4601 } 4602 }; 4603 return t 4604}(); 4605var DFLightBox = function e(t) { 4606 function i(e, i) { 4607 this.duration = 300; 4608 var n = this; 4609 n.lightboxWrapper = t("<div>").addClass("df-lightbox-wrapper"); 4610 n.container = t("<div>").addClass("df-container").appendTo(n.lightboxWrapper); 4611 n.controls = t("<div>").addClass("df-lightbox-controls").appendTo(n.lightboxWrapper); 4612 n.closeButton = t("<div>").addClass("df-lightbox-close df-ui-btn").on("click", function () { 4613 n.close(e) 4614 }).appendTo(n.controls); 4615 n.lightboxWrapper.append(n.container); 4616 return n 4617 } 4618 4619 i.prototype.show = function (e) { 4620 if (this.lightboxWrapper.parent().length == 0) t("body").append(this.lightboxWrapper); 4621 t("html,body").addClass("df-lightbox-open"); 4622 this.lightboxWrapper.fadeIn(this.duration, e); 4623 return this 4624 }; 4625 i.prototype.close = function (e) { 4626 this.lightboxWrapper.fadeOut(this.duration); 4627 setTimeout(e, this.duration); 4628 t("html,body").removeClass("df-lightbox-open"); 4629 return this 4630 }; 4631 return i 4632}(jQuery); 4633DJFlipBook.Share = function e(t) { 4634 function i(e, i) { 4635 var n = this; 4636 var a = "<div>"; 4637 var o = "df-share-button"; 4638 var r = "width=500,height=400"; 4639 n.isOpen = false; 4640 n.shareUrl = ""; 4641 n.wrapper = t('<div class="df-share-wrapper" style="display: none;">').on("click", function (e) { 4642 n.close() 4643 }); 4644 n.box = t('<div class="df-share-box">').on("click", function (e) { 4645 e.preventDefault(); 4646 e.stopPropagation() 4647 }).appendTo(n.wrapper).html('<span class="df-share-title">' + i.text.share + "</span>"); 4648 n.urlInput = t('<textarea class="df-share-url">').on("click", function () { 4649 t(this).select() 4650 }); 4651 n.facebook = t(a, {class: o + " df-share-facebook " + i.icons["facebook"]}).on("click", function (e) { 4652 window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(n.shareUrl), "Sharer", r) 4653 }); 4654 n.google = t(a, {class: o + " df-share-google " + i.icons["google"]}).on("click", function (e) { 4655 window.open("https://plus.google.com/share?url=" + encodeURIComponent(n.shareUrl), "Sharer", r) 4656 }); 4657 n.twitter = t(a, {class: o + " df-share-twitter " + i.icons["twitter"]}).on("click", function (e) { 4658 window.open("http://twitter.com/share?url=" + encodeURIComponent(n.shareUrl), "Sharer", r) 4659 }); 4660 n.mail = t("<a>", { 4661 class: o + " df-share-mail " + i.icons["mail"], 4662 href: "mailto:?subject=" + i.text["mailSubject"] + "&body=" + i.text["mailBody"].replace("{{url}}", encodeURIComponent(n.shareUrl)), 4663 target: "_blank" 4664 }).on("click", function (e) { 4665 t(this).attr("href", "mailto:?subject=" + i.text["mailSubject"] + "&body=" + i.text["mailBody"].replace("{{url}}", encodeURIComponent(n.shareUrl))); 4666 e.stopPropagation() 4667 }); 4668 n.box.append(n.urlInput).append(n.facebook).append(n.twitter).append(n.mail); 4669 t(e).append(n.wrapper) 4670 } 4671 4672 i.prototype.show = function () { 4673 this.wrapper.fadeIn(300); 4674 this.urlInput.val(this.shareUrl); 4675 this.urlInput.trigger("click"); 4676 this.isOpen = true 4677 }; 4678 i.prototype.dispose = function () { 4679 var e = this; 4680 e.box.off(); 4681 e.google.off(); 4682 e.twitter.off(); 4683 e.facebook.off(); 4684 e.mail.off(); 4685 e.urlInput.off(); 4686 e.wrapper.off().remove() 4687 }; 4688 i.prototype.close = function () { 4689 this.wrapper.fadeOut(300); 4690 this.isOpen = false 4691 }; 4692 i.prototype.update = function (e) { 4693 this.shareUrl = e 4694 }; 4695 return i 4696}(jQuery); 4697DJFlipBook.Popup = function e(t) { 4698 function i(e, i) { 4699 var n = this; 4700 var a = "<div>"; 4701 var o = "width=500,height=400"; 4702 n.isOpen = false; 4703 n.wrapper = t('<div class="df-popup-wrapper" style="display: none;">').on("click", function (e) { 4704 n.close() 4705 }); 4706 n.box = t('<div class="df-popup-box">').on("click", function (e) { 4707 e.preventDefault(); 4708 e.stopPropagation() 4709 }).appendTo(n.wrapper); 4710 t(e).append(n.wrapper) 4711 } 4712 4713 i.prototype.show = function () { 4714 this.wrapper.fadeIn(300); 4715 this.isOpen = true 4716 }; 4717 i.prototype.dispose = function () { 4718 var e = this; 4719 e.box.off(); 4720 e.wrapper.off().remove() 4721 }; 4722 i.prototype.close = function () { 4723 this.wrapper.fadeOut(300); 4724 this.isOpen = false 4725 }; 4726 return i 4727}(jQuery); 4728var PDFLinkService = function () { 4729 function e() { 4730 this.baseUrl = null; 4731 this.pdfDocument = null; 4732 this.pdfViewer = null; 4733 this.pdfHistory = null; 4734 this._pagesRefCache = null 4735 } 4736 4737 e.prototype = { 4738 dispose: function () { 4739 this.baseUrl = null; 4740 this.pdfDocument = null; 4741 this.pdfViewer = null; 4742 this.pdfHistory = null; 4743 this._pagesRefCache = null 4744 }, setDocument: function e(t, i) { 4745 this.baseUrl = i; 4746 this.pdfDocument = t; 4747 this._pagesRefCache = Object.create(null) 4748 }, setViewer: function e(t) { 4749 this.pdfViewer = t; 4750 this.externalLinkTarget = t.previewObject.options.linkTarget 4751 }, setHistory: function e(t) { 4752 this.pdfHistory = t 4753 }, get pagesCount() { 4754 return this.pdfDocument.numPages 4755 }, get page() { 4756 return this.pdfViewer.currentPageNumber 4757 }, set page(e) { 4758 this.pdfViewer.currentPageNumber = e 4759 }, navigateTo: function e(t) { 4760 var i = ""; 4761 var n = this; 4762 var a = function (e) { 4763 var o = e instanceof Object ? n._pagesRefCache[e.num + " " + e.gen + " R"] : e + 1; 4764 if (o) { 4765 if (n.pdfViewer.contentProvider.options.pageSize == DJFlipBook.PAGE_SIZE.DOUBLEINTERNAL && o > 2) { 4766 o = o * 2 - 1 4767 } 4768 if (o > n.pdfViewer.pageCount) { 4769 o = n.pdfViewer.pageCount 4770 } 4771 n.pdfViewer.gotoPage(o); 4772 if (n.pdfHistory) { 4773 n.pdfHistory.push({dest: t, hash: i, page: o}) 4774 } 4775 } else { 4776 n.pdfDocument.getPageIndex(e).then(function (t) { 4777 var i = t + 1; 4778 var o = e.num + " " + e.gen + " R"; 4779 n._pagesRefCache[o] = i; 4780 a(e) 4781 }) 4782 } 4783 }; 4784 var o; 4785 if (typeof t === "string") { 4786 i = t; 4787 o = this.pdfDocument.getDestination(t) 4788 } else { 4789 o = Promise.resolve(t) 4790 } 4791 o.then(function (e) { 4792 t = e; 4793 if (!(e instanceof Array)) { 4794 return 4795 } 4796 a(e[0]) 4797 }) 4798 }, customNavigateTo: function e(t) { 4799 if (t == "" || t == null || t == "null") return; 4800 var i = null; 4801 if (!isNaN(Math.round(t))) { 4802 i = t 4803 } else if (typeof t === "string") { 4804 i = parseInt(t.replace("#", ""), 10); 4805 if (isNaN(i)) { 4806 window.open(t, DJFlipBook.defaults.linkTarget == DJFlipBook.LINK_TARGET.SELF ? "_self" : "_blank"); 4807 return 4808 } 4809 } 4810 if (i != null) this.pdfViewer.gotoPage(i) 4811 }, getDestinationHash: function e(t) { 4812 if (typeof t === "string") { 4813 return this.getAnchorUrl("#" + escape(t)) 4814 } 4815 if (t instanceof Array) { 4816 var i = t[0]; 4817 var n = i instanceof Object ? this._pagesRefCache[i.num + " " + i.gen + " R"] : i + 1; 4818 if (n) { 4819 var a = this.getAnchorUrl("#page=" + n); 4820 var o = t[1]; 4821 if (typeof o === "object" && "name" in o && o.name === "XYZ") { 4822 var r = t[4] || this.pdfViewer.currentScaleValue; 4823 var s = parseFloat(r); 4824 if (s) { 4825 r = s * 100 4826 } 4827 a += "&zoom=" + r; 4828 if (t[2] || t[3]) { 4829 a += "," + (t[2] || 0) + "," + (t[3] || 0) 4830 } 4831 } 4832 return a 4833 } 4834 } 4835 return this.getAnchorUrl("") 4836 }, getCustomDestinationHash: function e(t) { 4837 return "#" + escape(t) 4838 }, getAnchorUrl: function e(t) { 4839 return (this.baseUrl || "") + t 4840 }, setHash: function e(t) { 4841 if (t.indexOf("=") >= 0) { 4842 var i = parseQueryString(t); 4843 if ("nameddest" in i) { 4844 if (this.pdfHistory) { 4845 this.pdfHistory.updateNextHashParam(i.nameddest) 4846 } 4847 this.navigateTo(i.nameddest); 4848 return 4849 } 4850 var n, a; 4851 if ("page" in i) { 4852 n = i.page | 0 || 1 4853 } 4854 if ("zoom" in i) { 4855 var o = i.zoom.split(","); 4856 var r = o[0]; 4857 var s = parseFloat(r); 4858 if (r.indexOf("Fit") === -1) { 4859 a = [null, {name: "XYZ"}, o.length > 1 ? o[1] | 0 : null, o.length > 2 ? o[2] | 0 : null, s ? s / 100 : r] 4860 } else { 4861 if (r === "Fit" || r === "FitB") { 4862 a = [null, {name: r}] 4863 } else if (r === "FitH" || r === "FitBH" || (r === "FitV" || r === "FitBV")) { 4864 a = [null, {name: r}, o.length > 1 ? o[1] | 0 : null] 4865 } else if (r === "FitR") { 4866 if (o.length !== 5) { 4867 console.error("PDFLinkService_setHash: " + "Not enough parameters for 'FitR'.") 4868 } else { 4869 a = [null, {name: r}, o[1] | 0, o[2] | 0, o[3] | 0, o[4] | 0] 4870 } 4871 } else { 4872 console.error("PDFLinkService_setHash: '" + r + "' is not a valid zoom value.") 4873 } 4874 } 4875 } 4876 if (a) { 4877 this.pdfViewer.scrollPageIntoView(n || this.page, a) 4878 } else if (n) { 4879 this.page = n 4880 } 4881 if ("pagemode" in i) { 4882 var l = document.createEvent("CustomEvent"); 4883 l.initCustomEvent("pagemode", true, true, {mode: i.pagemode}); 4884 this.pdfViewer.container.dispatchEvent(l) 4885 } 4886 } else if (/^\d+$/.test(t)) { 4887 this.page = t 4888 } else { 4889 if (this.pdfHistory) { 4890 this.pdfHistory.updateNextHashParam(unescape(t)) 4891 } 4892 this.navigateTo(unescape(t)) 4893 } 4894 }, executeNamedAction: function e(t) { 4895 switch (t) { 4896 case"GoBack": 4897 if (this.pdfHistory) { 4898 this.pdfHistory.back() 4899 } 4900 break; 4901 case"GoForward": 4902 if (this.pdfHistory) { 4903 this.pdfHistory.forward() 4904 } 4905 break; 4906 case"NextPage": 4907 this.page++; 4908 break; 4909 case"PrevPage": 4910 this.page--; 4911 break; 4912 case"LastPage": 4913 this.page = this.pagesCount; 4914 break; 4915 case"FirstPage": 4916 this.page = 1; 4917 break; 4918 default: 4919 break 4920 } 4921 var i = document.createEvent("CustomEvent"); 4922 i.initCustomEvent("namedaction", true, true, {action: t}); 4923 this.pdfViewer.container.dispatchEvent(i) 4924 }, cachePageRef: function e(t, i) { 4925 var n = i.num + " " + i.gen + " R"; 4926 this._pagesRefCache[n] = t 4927 } 4928 }; 4929 return e 4930}(); 4931var FindStates = {FIND_FOUND: 0, FIND_NOTFOUND: 1, FIND_WRAPPED: 2, FIND_PENDING: 3}; 4932var FIND_SCROLL_OFFSET_TOP = -50; 4933var FIND_SCROLL_OFFSET_LEFT = -400; 4934var CHARACTERS_TO_NORMALIZE = { 4935 "â": "'", 4936 "â": "'", 4937 "â": "'", 4938 "â": "'", 4939 "â": '"', 4940 "â": '"', 4941 "â": '"', 4942 "â": '"', 4943 "¼": "1/4", 4944 "½": "1/2", 4945 "¾": "3/4" 4946}; 4947DJFlipBook.PDFFindController = function e() { 4948 function t(e) { 4949 this.pdfViewer = e.pdfViewer || null; 4950 this.onUpdateResultsCount = null; 4951 this.onUpdateState = null; 4952 this.reset(); 4953 var t = Object.keys(CHARACTERS_TO_NORMALIZE).join(""); 4954 this.normalizationRegex = new RegExp("[" + t + "]", "g") 4955 } 4956 4957 t.prototype = { 4958 reset: function e() { 4959 this.startedTextExtraction = false; 4960 this.extractTextPromises = []; 4961 this.pendingFindMatches = Object.create(null); 4962 this.active = false; 4963 this.pageContents = []; 4964 this.pageMatches = []; 4965 this.pageMatchesLength = null; 4966 this.matchCount = 0; 4967 this.selected = {pageIdx: -1, matchIdx: -1}; 4968 this.offset = {pageIdx: null, matchIdx: null}; 4969 this.pagesToSearch = null; 4970 this.resumePageIdx = null; 4971 this.state = null; 4972 this.dirtyMatch = false; 4973 this.findTimeout = null; 4974 this.firstPagePromise = new Promise(function (e) { 4975 this.resolveFirstPage = e 4976 }.bind(this)) 4977 }, normalize: function e(t) { 4978 return t.replace(this.normalizationRegex, function (e) { 4979 return CHARACTERS_TO_NORMALIZE[e] 4980 }) 4981 }, _prepareMatches: function e(t, i, n) { 4982 function a(e, t) { 4983 var i, n, a; 4984 i = e[t]; 4985 a = e[t + 1]; 4986 if (t < e.length - 1 && i.match === a.match) { 4987 i.skipped = true; 4988 return true 4989 } 4990 for (var o = t - 1; o >= 0; o--) { 4991 n = e[o]; 4992 if (n.skipped) { 4993 continue 4994 } 4995 if (n.match + n.matchLength < i.match) { 4996 break 4997 } 4998 if (n.match + n.matchLength >= i.match + i.matchLength) { 4999 i.skipped = true; 5000 return true 5001 } 5002 } 5003 return false 5004 } 5005 5006 var o, r; 5007 t.sort(function (e, t) { 5008 return e.match === t.match ? e.matchLength - t.matchLength : e.match - t.match 5009 }); 5010 for (o = 0, r = t.length; o < r; o++) { 5011 if (a(t, o)) { 5012 continue 5013 } 5014 i.push(t[o].match); 5015 n.push(t[o].matchLength) 5016 } 5017 }, calcFindPhraseMatch: function e(t, i, n) { 5018 var a = []; 5019 var o = t.length; 5020 var r = -o; 5021 while (true) { 5022 r = n.indexOf(t, r + o); 5023 if (r === -1) { 5024 break 5025 } 5026 a.push(r) 5027 } 5028 this.pageMatches[i] = a 5029 }, calcFindWordMatch: function e(t, i, n) { 5030 var a = []; 5031 var o = t.match(/\S+/g); 5032 var r, s, l; 5033 for (var c = 0, u = o.length; c < u; c++) { 5034 r = o[c]; 5035 s = r.length; 5036 l = -s; 5037 while (true) { 5038 l = n.indexOf(r, l + s); 5039 if (l === -1) { 5040 break 5041 } 5042 a.push({match: l, matchLength: s, skipped: false}) 5043 } 5044 } 5045 if (!this.pageMatchesLength) { 5046 this.pageMatchesLength = [] 5047 } 5048 this.pageMatchesLength[i] = []; 5049 this.pageMatches[i] = []; 5050 this._prepareMatches(a, this.pageMatches[i], this.pageMatchesLength[i]) 5051 }, calcFindMatch: function e(t) { 5052 var i = this.normalize(this.pageContents[t]); 5053 var n = this.normalize(this.state.query); 5054 var a = this.state.caseSensitive; 5055 var o = this.state.phraseSearch; 5056 var r = n.length; 5057 if (r === 0) { 5058 return 5059 } 5060 if (!a) { 5061 i = i.toLowerCase(); 5062 n = n.toLowerCase() 5063 } 5064 if (o) { 5065 this.calcFindPhraseMatch(n, t, i) 5066 } else { 5067 this.calcFindWordMatch(n, t, i) 5068 } 5069 this.updatePage(t); 5070 if (this.resumePageIdx === t) { 5071 this.resumePageIdx = null; 5072 this.nextPageMatch() 5073 } 5074 if (this.pageMatches[t].length > 0) { 5075 this.matchCount += this.pageMatches[t].length; 5076 this.updateUIResultsCount() 5077 } 5078 }, extractText: function e() { 5079 if (this.startedTextExtraction) { 5080 return 5081 } 5082 this.startedTextExtraction = true; 5083 this.pageContents = []; 5084 var t = []; 5085 var i = this.pdfViewer.contentProvider.pdfDocument.numPages; 5086 for (var n = 0; n < i; n++) { 5087 this.extractTextPromises.push(new Promise(function (e) { 5088 t.push(e) 5089 })) 5090 } 5091 var a = this; 5092 5093 function o(e) { 5094 a.pdfViewer.getPageTextContent(e).then(function i(n) { 5095 var r = n.items; 5096 var s = []; 5097 for (var l = 0, c = r.length; l < c; l++) { 5098 s.push(r[l].str) 5099 } 5100 a.pageContents.push(s.join("")); 5101 t[e](e); 5102 console.log("extracting Page" + e); 5103 if (e + 1 < a.pdfViewer.contentProvider.pdfDocument.numPages) { 5104 o(e + 1) 5105 } 5106 }) 5107 } 5108 5109 o(0) 5110 }, executeCommand: function e(t, i) { 5111 if (this.state === null || t !== "findagain") { 5112 this.dirtyMatch = true 5113 } 5114 this.state = i; 5115 this.updateUIState(FindStates.FIND_PENDING); 5116 this.firstPagePromise.then(function () { 5117 this.extractText(); 5118 clearTimeout(this.findTimeout); 5119 if (t === "find") { 5120 this.findTimeout = setTimeout(this.nextMatch.bind(this), 250) 5121 } else { 5122 this.nextMatch() 5123 } 5124 }.bind(this)) 5125 }, updatePage: function e(t) { 5126 if (this.selected.pageIdx === t) { 5127 this.pdfViewer.currentPageNumber = t + 1 5128 } 5129 var i = this.pdfViewer.getPageView(t); 5130 if (i.textLayer) { 5131 i.textLayer.updateMatches() 5132 } 5133 }, nextMatch: function e() { 5134 var t = this.state.findPrevious; 5135 var i = this.pdfViewer.currentPageNumber - 1; 5136 var n = this.pdfViewer.contentProvider.pageCount; 5137 this.active = true; 5138 if (this.dirtyMatch) { 5139 this.dirtyMatch = false; 5140 this.selected.pageIdx = this.selected.matchIdx = -1; 5141 this.offset.pageIdx = i; 5142 this.offset.matchIdx = null; 5143 this.hadMatch = false; 5144 this.resumePageIdx = null; 5145 this.pageMatches = []; 5146 this.matchCount = 0; 5147 this.pageMatchesLength = null; 5148 var a = this; 5149 for (var o = 0; o < n; o++) { 5150 this.updatePage(o); 5151 if (!(o in this.pendingFindMatches)) { 5152 this.pendingFindMatches[o] = true; 5153 this.extractTextPromises[o].then(function (e) { 5154 delete a.pendingFindMatches[e]; 5155 a.calcFindMatch(e) 5156 }) 5157 } 5158 } 5159 } 5160 if (this.state.query === "") { 5161 this.updateUIState(FindStates.FIND_FOUND); 5162 return 5163 } 5164 if (this.resumePageIdx) { 5165 return 5166 } 5167 var r = this.offset; 5168 this.pagesToSearch = n; 5169 if (r.matchIdx !== null) { 5170 var s = this.pageMatches[r.pageIdx].length; 5171 if (!t && r.matchIdx + 1 < s || t && r.matchIdx > 0) { 5172 this.hadMatch = true; 5173 r.matchIdx = t ? r.matchIdx - 1 : r.matchIdx + 1; 5174 this.updateMatch(true); 5175 return 5176 } 5177 this.advanceOffsetPage(t) 5178 } 5179 this.nextPageMatch() 5180 }, matchesReady: function e(t) { 5181 var i = this.offset; 5182 var n = t.length; 5183 var a = this.state.findPrevious; 5184 if (n) { 5185 this.hadMatch = true; 5186 i.matchIdx = a ? n - 1 : 0; 5187 this.updateMatch(true); 5188 return true 5189 } 5190 this.advanceOffsetPage(a); 5191 if (i.wrapped) { 5192 i.matchIdx = null; 5193 if (this.pagesToSearch < 0) { 5194 this.updateMatch(false); 5195 return true 5196 } 5197 } 5198 return false 5199 }, updateMatchPosition: function e(t, i, n, a) { 5200 if (this.selected.matchIdx === i && this.selected.pageIdx === t) { 5201 var o = {top: FIND_SCROLL_OFFSET_TOP, left: FIND_SCROLL_OFFSET_LEFT}; 5202 scrollIntoView(n[a], o, true) 5203 } 5204 }, nextPageMatch: function e() { 5205 if (this.resumePageIdx !== null) { 5206 console.error("There can only be one pending page.") 5207 } 5208 do { 5209 var t = this.offset.pageIdx; 5210 var i = this.pageMatches[t]; 5211 if (!i) { 5212 this.resumePageIdx = t; 5213 break 5214 } 5215 } while (!this.matchesReady(i)) 5216 }, advanceOffsetPage: function e(t) { 5217 var i = this.offset; 5218 var n = this.extractTextPromises.length; 5219 i.pageIdx = t ? i.pageIdx - 1 : i.pageIdx + 1; 5220 i.matchIdx = null; 5221 this.pagesToSearch--; 5222 if (i.pageIdx >= n || i.pageIdx < 0) { 5223 i.pageIdx = t ? n - 1 : 0; 5224 i.wrapped = true 5225 } 5226 }, updateMatch: function e(t) { 5227 var i = FindStates.FIND_NOTFOUND; 5228 var n = this.offset.wrapped; 5229 this.offset.wrapped = false; 5230 if (t) { 5231 var a = this.selected.pageIdx; 5232 this.selected.pageIdx = this.offset.pageIdx; 5233 this.selected.matchIdx = this.offset.matchIdx; 5234 i = n ? FindStates.FIND_WRAPPED : FindStates.FIND_FOUND; 5235 if (a !== -1 && a !== this.selected.pageIdx) { 5236 this.updatePage(a) 5237 } 5238 } 5239 this.updateUIState(i, this.state.findPrevious); 5240 if (this.selected.pageIdx !== -1) { 5241 this.updatePage(this.selected.pageIdx) 5242 } 5243 }, updateUIResultsCount: function e() { 5244 if (this.onUpdateResultsCount) { 5245 this.onUpdateResultsCount(this.matchCount) 5246 } 5247 }, updateUIState: function e(t, i) { 5248 if (this.onUpdateState) { 5249 this.onUpdateState(t, i, this.matchCount) 5250 } 5251 } 5252 }; 5253 return t 5254}(); 5255DJFlipBook.TextLayerBuilder = function e() { 5256 function t(e) { 5257 this.textLayerDiv = e.textLayerDiv; 5258 this.renderingDone = false; 5259 this.divContentDone = false; 5260 this.pageIdx = e.pageIndex; 5261 this.pageNumber = this.pageIdx + 1; 5262 this.matches = []; 5263 this.viewport = e.viewport; 5264 this.textDivs = []; 5265 this.findController = e.findController || null; 5266 this.textLayerRenderTask = null; 5267 this.enhanceTextSelection = e.enhanceTextSelection; 5268 this._bindMouse() 5269 } 5270 5271 t.prototype = { 5272 _finishRendering: function e() { 5273 this.renderingDone = true; 5274 if (!this.enhanceTextSelection) { 5275 var t = document.createElement("div"); 5276 t.className = "endOfContent"; 5277 this.textLayerDiv.appendChild(t) 5278 } 5279 }, render: function e(t) { 5280 if (!this.divContentDone || this.renderingDone) { 5281 return 5282 } 5283 if (this.textLayerRenderTask) { 5284 this.textLayerRenderTask.cancel(); 5285 this.textLayerRenderTask = null 5286 } 5287 this.textDivs = []; 5288 var i = document.createDocumentFragment(); 5289 this.textLayerRenderTask = pdfjsLib.renderTextLayer({ 5290 textContent: this.textContent, 5291 container: i, 5292 viewport: this.viewport, 5293 textDivs: this.textDivs, 5294 timeout: t, 5295 enhanceTextSelection: this.enhanceTextSelection 5296 }); 5297 this.textLayerRenderTask.promise.then(function () { 5298 this.textLayerDiv.appendChild(i); 5299 this._finishRendering(); 5300 this.updateMatches() 5301 }.bind(this), function (e) { 5302 }) 5303 }, setTextContent: function e(t) { 5304 if (this.textLayerRenderTask) { 5305 this.textLayerRenderTask.cancel(); 5306 this.textLayerRenderTask = null 5307 } 5308 this.textContent = t; 5309 this.divContentDone = true 5310 }, convertMatches: function e(t, i) { 5311 var n = 0; 5312 var a = 0; 5313 var o = this.textContent.items; 5314 var r = o.length - 1; 5315 var s = this.findController === null ? 0 : this.findController.state.query.length; 5316 var l = []; 5317 if (!t) { 5318 return l 5319 } 5320 for (var c = 0, u = t.length; c < u; c++) { 5321 var d = t[c]; 5322 while (n !== r && d >= a + o[n].str.length) { 5323 a += o[n].str.length; 5324 n++ 5325 } 5326 if (n === o.length) { 5327 console.error("Could not find a matching mapping") 5328 } 5329 var f = {begin: {divIdx: n, offset: d - a}}; 5330 if (i) { 5331 d += i[c] 5332 } else { 5333 d += s 5334 } 5335 while (n !== r && d > a + o[n].str.length) { 5336 a += o[n].str.length; 5337 n++ 5338 } 5339 f.end = {divIdx: n, offset: d - a}; 5340 l.push(f) 5341 } 5342 return l 5343 }, renderMatches: function e(t) { 5344 if (t.length === 0) { 5345 return 5346 } 5347 var i = this.textContent.items; 5348 var n = this.textDivs; 5349 var a = null; 5350 var o = this.pageIdx; 5351 var r = this.findController === null ? false : o === this.findController.selected.pageIdx; 5352 var s = this.findController === null ? -1 : this.findController.selected.matchIdx; 5353 var l = this.findController === null ? false : this.findController.state.highlightAll; 5354 var c = {divIdx: -1, offset: undefined}; 5355 5356 function u(e, t) { 5357 var i = e.divIdx; 5358 n[i].textContent = ""; 5359 d(i, 0, e.offset, t) 5360 } 5361 5362 function d(e, t, a, o) { 5363 var r = n[e]; 5364 var s = i[e].str.substring(t, a); 5365 var l = document.createTextNode(s); 5366 if (o) { 5367 var c = document.createElement("span"); 5368 c.className = o; 5369 c.appendChild(l); 5370 r.appendChild(c); 5371 return 5372 } 5373 r.appendChild(l) 5374 } 5375 5376 var f = s, h = f + 1; 5377 if (l) { 5378 f = 0; 5379 h = t.length 5380 } else if (!r) { 5381 return 5382 } 5383 for (var p = f; p < h; p++) { 5384 var g = t[p]; 5385 var v = g.begin; 5386 var m = g.end; 5387 var b = r && p === s; 5388 var w = b ? " selected" : ""; 5389 if (this.findController) { 5390 this.findController.updateMatchPosition(o, p, n, v.divIdx) 5391 } 5392 if (!a || v.divIdx !== a.divIdx) { 5393 if (a !== null) { 5394 d(a.divIdx, a.offset, c.offset) 5395 } 5396 u(v) 5397 } else { 5398 d(a.divIdx, a.offset, v.offset) 5399 } 5400 if (v.divIdx === m.divIdx) { 5401 d(v.divIdx, v.offset, m.offset, "highlight" + w) 5402 } else { 5403 d(v.divIdx, v.offset, c.offset, "highlight begin" + w); 5404 for (var x = v.divIdx + 1, P = m.divIdx; x < P; x++) { 5405 n[x].className = "highlight middle" + w 5406 } 5407 u(m, "highlight end" + w) 5408 } 5409 a = m 5410 } 5411 if (a) { 5412 d(a.divIdx, a.offset, c.offset) 5413 } 5414 }, updateMatches: function e() { 5415 if (!this.renderingDone) { 5416 return 5417 } 5418 var t = this.matches; 5419 var i = this.textDivs; 5420 var n = this.textContent.items; 5421 var a = -1; 5422 for (var o = 0, r = t.length; o < r; o++) { 5423 var s = t[o]; 5424 var l = Math.max(a, s.begin.divIdx); 5425 for (var c = l, u = s.end.divIdx; c <= u; c++) { 5426 var d = i[c]; 5427 d.textContent = n[c].str; 5428 d.className = "" 5429 } 5430 a = s.end.divIdx + 1 5431 } 5432 if (this.findController === null || !this.findController.active) { 5433 return 5434 } 5435 var f, h; 5436 if (this.findController !== null) { 5437 f = this.findController.pageMatches[this.pageIdx] || null; 5438 h = this.findController.pageMatchesLength ? this.findController.pageMatchesLength[this.pageIdx] || null : null 5439 } 5440 this.matches = this.convertMatches(f, h); 5441 this.renderMatches(this.matches) 5442 }, _bindMouse: function e() { 5443 var t = this.textLayerDiv; 5444 var i = this; 5445 t.addEventListener("mousedown", function (e) { 5446 if (i.enhanceTextSelection && i.textLayerRenderTask) { 5447 i.textLayerRenderTask.expandTextDivs(true); 5448 return 5449 } 5450 var n = t.querySelector(".endOfContent"); 5451 if (!n) { 5452 return 5453 } 5454 var a = e.target !== t; 5455 a = a && window.getComputedStyle(n).getPropertyValue("-moz-user-select") !== "none"; 5456 if (a) { 5457 var o = t.getBoundingClientRect(); 5458 var r = Math.max(0, (e.pageY - o.top) / o.height); 5459 n.style.top = (r * 100).toFixed(2) + "%" 5460 } 5461 n.classList.add("active") 5462 }); 5463 t.addEventListener("mouseup", function (e) { 5464 if (i.enhanceTextSelection && i.textLayerRenderTask) { 5465 i.textLayerRenderTask.expandTextDivs(false); 5466 return 5467 } 5468 var n = t.querySelector(".endOfContent"); 5469 if (!n) { 5470 return 5471 } 5472 n.style.top = ""; 5473 n.classList.remove("active") 5474 }) 5475 } 5476 }; 5477 return t 5478}(); 5479DJFlipBook.ConvertPageLinks = function () { 5480 var e = arguments[0] / 100, t = arguments[1] / 100; 5481 var i = function (i, n, a, o, r) { 5482 return {x: i / e, y: n / t, w: a / e, h: o / t, dest: r} 5483 }; 5484 var n = []; 5485 var a; 5486 for (var o = 2; o < arguments.length; o++) { 5487 a = arguments[o]; 5488 n[o - 2] = i.apply(this, a) 5489 } 5490 return n 5491}; 5492DJFlipBook.parseLinks = function (e) { 5493 var t; 5494 if (e != null && e.length > 0) { 5495 for (var i = 0; i < e.length; i++) { 5496 t = e[i]; 5497 if (t != null && t[0] != null && t[0].dest == null) { 5498 t = DJFlipBook.ConvertPageLinks.apply(this, t); 5499 e[i] = t 5500 } 5501 } 5502 } 5503 return e 5504}; 5505(function (e) { 5506 function t(e) { 5507 return e == "true" || e == true 5508 } 5509 5510 function i(e) { 5511 if (e.webgl != null) e.webgl = t(e.webgl); 5512 if (e.enableDownload != null) e.enableDownload = t(e.enableDownload);
5513 if (e.search != null) e.search = t(e.search); 5514 if (e.enableAnalytics != null) e.enableAnalytics = t(e.enableAnalytics); 5515 if (e.scrollWheel != null) e.scrollWheel = t(e.scrollWheel); 5516 if (e.autoEnableOutline != null) e.autoEnableOutline = t(e.autoEnableOutline); 5517 if (e.autoEnableThumbnail != null) e.autoEnableThumbnail = t(e.autoEnableThumbnail); 5518 if (e.transparent != null) e.transparent = t(e.transparent); 5519 if (e.overwritePDFOutline != null) e.overwritePDFOutline = t(e.overwritePDFOutline); 5520 if (e.soundEnable != null) e.soundEnable = t(e.soundEnable); 5521 if (e.forceFit != null) e.forceFit = t(e.forceFit); 5522 if (e.enableAnnotation != null) e.enableAnnotation = t(e.enableAnnotation); 5523 if (e.webglShadow != null) e.webglShadow = t(e.webglShadow); 5524 if (e.autoPlay != null) e.autoPlay = t(e.autoPlay); 5525 if (e.autoPlayStart != null) e.autoPlayStart = t(e.autoPlayStart); 5526 if (e.paddingTop != null) e.paddingTop = parseInt(e.paddingTop, 10); 5527 if (e.paddingRight != null) e.paddingRight = parseInt(e.paddingRight, 10); 5528 if (e.paddingBottom != null) e.paddingBottom = parseInt(e.paddingBottom, 10); 5529 if (e.paddingLeft != null) e.paddingLeft = parseInt(e.paddingLeft, 10); 5530 if (e.zoomRatio != null) e.zoomRatio = parseFloat(e.zoomRatio, 10);
vendor: 10,013 bytes, lines 5531-5746
5531 if (e.stiffness != null) e.stiffness = parseFloat(e.stiffness, 10); 5532 if (e.autoPlayDuration != null) e.autoPlayDuration = parseInt(e.autoPlayDuration, 10); 5533 if (e.linkTarget != null) e.linkTarget = parseInt(e.linkTarget, 10); 5534 if (e.pageMode == 0 || e.pageMode == "0") e.pageMode = null; 5535 if (e.singlePageMode == 0 || e.singlePageMode == "0") e.singlePageMode = null 5536 } 5537 5538 function n(e) { 5539 if (e.parsed == true) return; 5540 e.parsed = true; 5541 var t = []; 5542 i(e); 5543 if (typeof dFlipWPGlobal !== "undefined" && e.wpOptions == "true") { 5544 try { 5545 for (var n in e.links) { 5546 var a = e.links[n]; 5547 var o = [100, 100]; 5548 for (var r = 0; r < a.length; r++) { 5549 var s = a[r]; 5550 var l = s.substr(1).slice(0, -1).split(","); 5551 var c = []; 5552 for (var u = 0; u < 5; u++) { 5553 c[u] = l[u] 5554 } 5555 o.push(c) 5556 } 5557 t[parseInt(n, 10) + 1] = o 5558 } 5559 } catch (e) { 5560 console.error(e.stack) 5561 } 5562 e.links = DJFlipBook.parseLinks(t) 5563 } else { 5564 e.links = DJFlipBook.parseLinks(e.links) 5565 } 5566 } 5567 5568 DJFlipBook.getOptions = function (t) { 5569 t = e(t); 5570 var i = t.attr("id"); 5571 var a = "option_" + i, o = t.attr("source") || t.attr("df-source"); 5572 a = a == null || a == "" || window[a] == null ? {} : window[a]; 5573 a.source = o == null || o == "" ? a.source : o; 5574 var r = { 5575 webgl: t.attr("webgl"), 5576 height: t.attr("height"), 5577 soundEnable: t.attr("sound"), 5578 bookTitle: t.data("title"), 5579 transparent: t.attr("transparent"), 5580 enableDownload: t.attr("download"), 5581 search: t.attr("search"), 5582 duration: t.attr("duration"), 5583 hard: t.attr("hard"), 5584 openPage: t.data("page"), 5585 pageMode: t.attr("pagemode"), 5586 direction: t.attr("direction"), 5587 backgroundColor: t.attr("backgroundcolor"), 5588 scrollWheel: t.attr("scrollwheel"), 5589 backgroundImage: t.attr("backgroundimage"), 5590 paddingTop: t.attr("paddingtop"), 5591 paddingRight: t.attr("paddingright"), 5592 paddingBottom: t.attr("paddingbottom"), 5593 paddingLeft: t.attr("paddingleft"), 5594 wpOptions: t.attr("wpoptions") 5595 }; 5596 a = e.extend(true, {}, a, r); 5597 n(a); 5598 return a 5599 }; 5600 DJFlipBook.parseBooks = function () { 5601 e("._df_button, ._df_thumb, ._df_custom, ._df_book").each(function () { 5602 var t = e(this); 5603 var i = t.attr("parsed") || t.attr("df-parsed"); 5604 if (i !== "true") { 5605 t.attr("df-parsed", "true"); 5606 if (t.hasClass("_df_book")) { 5607 var n = t.attr("id"), a = t.attr("slug"); 5608 var o = DJFlipBook.getOptions(t); 5609 o.id = n; 5610 if (a != null) o.slug = a; 5611 if (n) { 5612 window[n.toString()] = e(t).flipBook(o.source, o) 5613 } else { 5614 e(t).flipBook(o.source, o) 5615 } 5616 } else { 5617 if (t.hasClass("_df_thumb")) { 5618 var r = e("<div class='_df_book-cover'>"); 5619 var s = t.html().trim(); 5620 t.html(""); 5621 var l = e("<span class='_df_book-title'>").html(s).appendTo(r); 5622 var c = t.attr("thumb") || t.attr("df-thumb"), 5623 u = t.attr("thumbtype") || DJFlipBook.defaults.thumbElement || "div", 5624 d = t.attr("tags") || t.attr("df-tags"); 5625 if (d) { 5626 d = d.split(","); 5627 if (d.length > 0) { 5628 for (var f = 0; f < d.length; f++) { 5629 t.append("<span class='_df_book-tag'>" + d[f] + "</span>") 5630 } 5631 } 5632 } 5633 if (c != null && c.toString().trim() != "") { 5634 if (u == "img") { 5635 r.append('<img src="' + c + '" alt="' + s + '"/>'); 5636 t.attr("thumb-type", "img") 5637 } else { 5638 r.css({backgroundImage: "url('" + c + "')"}) 5639 } 5640 } else { 5641 r.addClass("_df_thumb-not-found") 5642 } 5643 t.append(r) 5644 } 5645 } 5646 } 5647 }) 5648 }; 5649 e(document).ready(function () { 5650 5651 if (typeof dFlipLocation == "undefined" && DJFlipBook.autoDetectLocation != false) { 5652 e("script").each(function () { 5653 var t = e(this)[0].src; 5654 if ((t.indexOf("/dflip.js") > -1 || t.indexOf("/dflip.min.js") > -1) && (t.indexOf("https://") > -1 || t.indexOf("http://") > -1) && t.indexOf("js/dflip.") > -1) { 5655 var i = t.split("/"); 5656 window.dFlipLocation = i.slice(0, -2).join("/") 5657 } 5658 }) 5659 } 5660 if (typeof dFlipLocation !== "undefined") { 5661 if (dFlipLocation.length > 2 && dFlipLocation.slice(-1) !== "/") { 5662 window.dFlipLocation += "/" 5663 } 5664 DJFlipBook.defaults.mockupjsSrc = dFlipLocation + "js/libs/mockup.min.js"; 5665 DJFlipBook.defaults.pdfjsSrc = dFlipLocation + "js/libs/pdf.min.js"; 5666 DJFlipBook.defaults.pdfjsCompatibilitySrc = dFlipLocation + "js/libs/compatibility.js"; 5667 DJFlipBook.defaults.threejsSrc = dFlipLocation + "js/libs/three.min.js"; 5668 DJFlipBook.defaults.pdfjsWorkerSrc = dFlipLocation + "js/libs/pdf.worker.min.js"; 5669 DJFlipBook.defaults.soundFile = dFlipLocation + "sound/turn2.mp3"; 5670 DJFlipBook.defaults.imagesLocation = dFlipLocation + "images"; 5671 DJFlipBook.defaults.imageResourcesPath = dFlipLocation + "images/pdfjs/"; 5672 DJFlipBook.defaults.cMapUrl = dFlipLocation + "js/libs/cmaps/"; 5673 if (typeof dFlipWPGlobal !== "undefined") { 5674 i(dFlipWPGlobal); 5675 e.extend(true, DJFlipBook.defaults, dFlipWPGlobal) 5676 } 5677 } 5678 DJFlipBook.preParseHash = window.location.hash; 5679 e("body").on("click", "._df_button, ._df_thumb, ._df_custom", function (t) { 5680 t.preventDefault(); 5681 var i = e(this); 5682 if (!window.dfLightBox) { 5683 window.dfLightBox = new DFLightBox(function () { 5684 Array.prototype.forEach.call(DJFlipBook.utils.getSharePrefixes(), function (e) { 5685 if (window.location.hash.indexOf("#" + e) == 0) window.location.hash = "#_" 5686 }); 5687 window.dfActiveLightBoxBook.analytics({ 5688 eventAction: "Book Closed", 5689 options: window.dfActiveLightBoxBook.options 5690 }); 5691 window.dfActiveLightBoxBook.dispose(); 5692 window.dfActiveLightBoxBook = null 5693 }) 5694 } 5695 window.dfLightBox.duration = 500; 5696 if (window.dfActiveLightBoxBook && window.dfActiveLightBoxBook.dispose) { 5697 window.dfActiveLightBoxBook.dispose() 5698 } else { 5699 window.dfLightBox.show(function () { 5700 var t = DJFlipBook.getOptions(i); 5701 t.transparent = false; 5702 t.height = "100%"; 5703 t.id = i.attr("id"); 5704 var n = i.attr("slug"); 5705 if (n != null) t.slug = n; 5706 t.isLightBox = true; 5707 window.dfActiveLightBoxBook = e(window.dfLightBox.container).flipBook(t.source, t) 5708 }) 5709 } 5710 }); 5711 if (DJFlipBook.utils.isSafari || DJFlipBook.utils.isIOS) { 5712 e("body").addClass("df-webkit") 5713 } 5714 var t = false; 5715 Array.prototype.forEach.call(DJFlipBook.utils.getSharePrefixes(), function (i) { 5716 if (DJFlipBook.preParseHash && DJFlipBook.preParseHash.indexOf(i) >= 0 && t === false) { 5717 var n = DJFlipBook.preParseHash.split(i)[1].split("/")[0]; 5718 var a = DJFlipBook.preParseHash.split(i)[1].split("/")[1]; 5719 if (a != null) { 5720 a = a.split("/")[0] 5721 } 5722 var o; 5723 o = e("[slug=" + n + "]"); 5724 if (o.length == 0) o = e("#" + n); 5725 if (o.length == 0) o = e("[_slug=" + n + "]"); 5726 if (o.length > 0) { 5727 if (a != null) { 5728 o.data("page", a) 5729 } 5730 if (o.is("._df_button, ._df_thumb, ._df_custom")) { 5731 o.trigger("click"); 5732 t = true 5733 } 5734 } 5735 } 5736 }); 5737 DJFlipBook.parseBooks(); 5738 if (e("body").hasClass("attachment-pdf")) { 5739 var n = e("[attachment_pdf_flipbook_lightbox]"); 5740 if (n.length > 0) { 5741 e(n[0]).trigger("click") 5742 } 5743 } 5744 e("body").on("click", ".df-ui-sidemenu-close", function () { 5745 var t = e(this); 5746 t.closest(".df-container").find(".df-ui-outline.df-active , .df-ui-thumbn
5746ail.df-active").trigger("click") 5747 }) 5748 }) 5749})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.