1/******* Do not edit this file ******* 2Simple Custom CSS and JS - by Silkypress.com 3Saved: Jun 03 2025 | 01:33:19 */ 4window.pdfflipinterfaceLocation = window.location.origin + "/"; 5 6! function () { 7 8 var e = { 9 10 745: function () { 11 12 ! function () { 13 14 var e, t, i = i || (e = [], { 15 16 getAll: function () { 17 18 return e 19 20 }, 21 22 removeAll: function () { 23 24 e = [] 25 26 }, 27 28 add: function (t) { 29 30 e.push(t) 31 32 }, 33 34 remove: function (t) { 35 36 var i = e.indexOf(t); - 1 !== i && e.splice(i, 1) 37 38 }, 39 40 update: function (t) { 41 42 if (0 === e.length) return !1; 43 44 var i = 0; 45 46 for (t = null != t ? t : window.performance.now(); i < e.length;) e[i].update(t) ? i++ : e.splice(i, 1); 47 48 return !0 49 50 } 51 52 }); 53 54 i.Tween = function (e) { 55 56 var t = e, 57 58 n = {}, 59 60 o = {}, 61 62 a = {}, 63 64 r = 1e3, 65 66 s = 0, 67 68 l = !1, 69 70 u = !1, 71 72 h = !1, 73 74 p = 0, 75 76 c = null, 77 78 d = i.Easing.Linear.None, 79 80 f = i.Interpolation.Linear, 81 82 g = [], 83 84 v = null, 85 86 m = !1, 87 88 y = null, 89 90 b = null, 91 92 w = null; 93 94 for (var P in e) n[P] = parseFloat(e[P], 10); 95 96 this.to = function (e, t) { 97 98 return null != t && (r = t), o = e, this 99 100 }, this.start = function (e) { 101 102 for (var r in i.add(this), u = !0, m = !1, c = null != e ? e : window.performance.now(), c += p, o) { 103 104 if (o[r] instanceof Array) { 105 106 if (0 === o[r].length) continue; 107 108 o[r] = [t[r]].concat(o[r]) 109 110 } 111 112 null != n[r] && (n[r] = t[r], n[r] instanceof Array == !1 && (n[r] *= 1), a[r] = n[r] || 0) 113 114 } 115 116 return this 117 118 }, this.stop = function () { 119 120 return u ? (i.remove(this), u = !1, null != w && w.call(t), this.stopChainedTweens(), this) : this 121 122 }, this.stopChainedTweens = function () { 123 124 for (var e = 0, t = g.length; e < t; e++) g[e].stop() 125 126 }, this.complete = function () { 127 128 return u ? (i.remove(this), u = !1, null != b && b.call(t), this.completeChainedTweens(), this) : this 129 130 }, this.completeChainedTweens = function () { 131 132 for (var e = 0, t = g.length; e < t; e++) g[e].complete() 133 134 }, this.delay = function (e) { 135 136 return p = e, this 137 138 }, this.repeat = function (e) { 139 140 return s = e, this 141 142 }, this.yoyo = function (e) { 143 144 return l = e, this 145 146 }, this.easing = function (e) { 147 148 return d = null == e ? d : e, this 149 150 }, this.interpolation = function (e) { 151 152 return f = e, this 153 154 }, this.chain = function () { 155 156 return g = arguments, this 157 158 }, this.onStart = function (e) { 159 160 return v = e, this 161 162 }, this.onUpdate = function (e) { 163 164 return y = e, this 165 166 }, this.onComplete = function (e) { 167 168 return b = e, this 169 170 }, this.onStop = function (e) { 171 172 return w = e, this 173 174 }, this.update = function (e) { 175 176 var i, u, w; 177 178 if (e < c) return !0; 179 180 for (i in !1 === m && (null != v && v.call(t), m = !0), w = d(u = (u = (e - c) / r) > 1 ? 1 : u), o) 181 182 if (null != n[i]) { 183 184 var P = n[i] || 0, 185 186 S = o[i]; 187 188 S instanceof Array ? t[i] = f(S, w) : ("string" == typeof S && (S = S.startsWith("+") || S.startsWith("-") ? P + parseFloat(S, 10) : parseFloat(S, 10)), "number" == typeof S && (t[i] = P + (S - P) * w)) 189 190 } if (null != y && y.call(t, w), 1 === u) { 191 192 if (s > 0) { 193 194 for (i in isFinite(s) && s--, a) { 195 196 if ("string" == typeof o[i] && (a[i] = a[i] + parseFloat(o[i], 10)), l) { 197 198 var C = a[i]; 199 200 a[i] = o[i], o[i] = C 201 202 } 203 204 n[i] = a[i] 205 206 } 207 208 return l && (h = !h), c = e + p, !0 209 210 } 211 212 null != b && b.call(t); 213 214 for (var T = 0, x = g.length; T < x; T++) g[T].start(c + r); 215 216 return !1 217 218 } 219 220 return !0 221 222 } 223 224 }, i.Easing = { 225 226 Linear: { 227 228 None: function (e) { 229 230 return e 231 232 } 233 234 }, 235 236 Quadratic: { 237 238 In: function (e) { 239 240 return e * e 241 242 }, 243 244 Out: function (e) { 245 246 return e * (2 - e) 247 248 }, 249 250 InOut: function (e) { 251 252 return (e *= 2) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1) 253 254 } 255 256 }, 257 258 Quartic: { 259 260 In: function (e) { 261 262 return e * e * e * e 263 264 }, 265 266 Out: function (e) { 267 268 return 1 - --e * e * e * e 269 270 }, 271 272 InOut: function (e) { 273 274 return (e *= 2) < 1 ? .5 * e * e * e * e : -.5 * ((e -= 2) * e * e * e - 2) 275 276 } 277 278 }, 279 280 Sinusoidal: { 281 282 In: function (e) { 283 284 return 1 - Math.cos(e * Math.PI / 2) 285 286 }, 287 288 Out: function (e) { 289 290 return Math.sin(e * Math.PI / 2) 291 292 }, 293 294 InOut: function (e) { 295 296 return .5 * (1 - Math.cos(Math.PI * e)) 297 298 } 299 300 }, 301 302 Cubic: { 303 304 In: function (e) { 305 306 return e * e * e 307 308 }, 309 310 Out: function (e) { 311 312 return --e * e * e + 1 313 314 }, 315 316 InOut: function (e) { 317 318 return (e *= 2) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2) 319 320 } 321 322 } 323 324 }, i.Interpolation = { 325 326 Linear: function (e, t) { 327 328 var n = e.length - 1, 329 330 o = n * t, 331 332 a = Math.floor(o), 333 334 r = i.Interpolation.Utils.Linear; 335 336 return t < 0 ? r(e[0], e[1], o) : t > 1 ? r(e[n], e[n - 1], n - o) : r(e[a], e[a + 1 > n ? n : a + 1], o - a) 337 338 }, 339 340 Bezier: function (e, t) { 341 342 for (var n = 0, o = e.length - 1, a = Math.pow, r = i.Interpolation.Utils.Bernstein, s = 0; s <= o;
vendor: 4,564 bytes, lines 342-591
342 s++) n += a(1 - t, o - s) * a(t, s) * e[s] * r(o, s); 343 344 return n 345 346 }, 347 348 Utils: { 349 350 Linear: function (e, t, i) { 351 352 return (t - e) * i + e 353 354 }, 355 356 Bernstein: function (e, t) { 357 358 var n = i.Interpolation.Utils.Factorial; 359 360 return n(e) / n(t) / n(e - t) 361 362 }, 363 364 Factorial: (t = [1], function (e) { 365 366 var i = 1; 367 368 if (t[e]) return t[e]; 369 370 for (var n = e; n > 1; n--) i *= n; 371 372 return t[e] = i, i 373 374 }), 375 376 CatmullRom: function (e, t, i, n, o) { 377 378 var a = .5 * (i - e), 379 380 r = .5 * (n - t), 381 382 s = o * o; 383 384 return (2 * t - 2 * i + a + r) * (o * s) + (-3 * t + 3 * i - 2 * a - r) * s + a * o + t 385 386 } 387 388 } 389 390 }, window.TWEEN = i 391 392 }() 393 394 } 395 396 }, 397 398 t = {}; 399 400 401 402 function i(n) { 403 404 var o = t[n]; 405 406 if (void 0 !== o) return o.exports; 407 408 var a = t[n] = { 409 410 exports: {} 411 412 }; 413 414 return e[n](a, a.exports, i), a.exports 415 416 } 417 418 i.amdO = {}, 419 420 function () { 421 422 "use strict"; 423 424 var e = { 425 426 jQuery: jQuery, 427 428 version: "2.2.48", 429 430 autoDetectLocation: !0, 431 432 slug: void 0, 433 434 locationVar: "pdfflipinterfaceLocation", 435 436 locationFile: void 0, 437 438 MOUSE_CLICK_ACTIONS: { 439 440 NONE: "none", 441 442 NAV: "nav" 443 444 }, 445 446 ARROW_KEYS_ACTIONS: { 447 448 NONE: "none", 449 450 NAV: "nav" 451 452 }, 453 454 MOUSE_DBL_CLICK_ACTIONS: { 455 456 NONE: "none", 457 458 ZOOM: "zoom" 459 460 }, 461 462 MOUSE_SCROLL_ACTIONS: { 463 464 NONE: "none", 465 466 ZOOM: "zoom", 467 468 NAV: "nav" 469 470 }, 471 472 PAGE_SCALE: { 473 474 PAGE_FIT: "fit", 475 476 PAGE_WIDTH: "width", 477 478 AUTO: "auto", 479 480 ACTUAL: "actual", 481 482 MANUAL: "manual" 483 484 }, 485 486 READ_DIRECTION: { 487 488 LTR: "ltr", 489 490 RTL: "rtl" 491 492 }, 493 494 TURN_DIRECTION: { 495 496 LEFT: "left", 497 498 RIGHT: "right", 499 500 NONE: "none" 501 502 }, 503 504 INFO_TYPE: { 505 506 INFO: "info", 507 508 ERROR: "error" 509 510 }, 511 512 FLIPBOOK_PAGE_MODE: { 513 514 SINGLE: "single", 515 516 DOUBLE: "double", 517 518 AUTO: "auto" 519 520 }, 521 522 FLIPBOOK_SINGLE_PAGE_MODE: { 523 524 ZOOM: "zoom", 525 526 BOOKLET: "booklet", 527 528 AUTO: "auto" 529 530 }, 531 532 FLIPBOOK_PAGE_SIZE: { 533 534 AUTO: "auto", 535 536 SINGLE: "single", 537 538 DOUBLE_INTERNAL: "dbl_int", 539 540 DOUBLE: "dbl", 541 542 DOUBLE_COVER_BACK: "dbl_cover_back" 543 544 }, 545 546 LINK_TARGET: { 547 548 NONE: 0, 549 550 SELF: 1, 551 552 BLANK: 2, 553 554 PARENT: 3, 555 556 TOP: 4 557 558 }, 559 560 CONTROLS_POSITION: { 561 562 HIDDEN: "hidden", 563 564 TOP: "top", 565 566 BOTTOM: "bottom" 567 568 }, 569 570 TURN_CORNER: { 571 572 TL: "tl", 573 574 TR: "tr", 575 576 BL: "bl", 577 578 BR: "br", 579 580 L: "l", 581 582 R: "r", 583 584 NONE: "none" 585 586 }, 587 588 REQUEST_STATUS: { 589 590 OFF: "none", 591
592 ON: "pending", 593 594 COUNT: "counting" 595 596 }, 597 598 TEXTURE_TARGET: { 599 600 THUMB: 0, 601 602 VIEWER: 1, 603 604 ZOOM: 2 605 606 }, 607 608 FLIPBOOK_CENTER_SHIFT: { 609 610 RIGHT: 1, 611 612 LEFT: -1, 613 614 NONE: 0 615 616 }, 617 618 FLIPBOOK_COVER_TYPE: { 619 620 NONE: "none", 621 622 PLAIN: "plain", 623 624 BASIC: "basic", 625 626 RIDGE: "ridge" 627 628 } 629 630 }; 631 632 633 634 function t(e) { 635 636 return t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 637 638 return typeof e 639 640 } : function (e) { 641 642 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 643 644 }, t(e) 645 646 } 647 648 e._defaults = { 649 650 is3D: !0, 651 652 has3DShadow: !0, 653 654 color3DCover: "#aaaaaa", 655 656 color3DSheets: "#fff", 657 658 cover3DType: e.FLIPBOOK_COVER_TYPE.NONE, 659 660 flexibility: .9, 661 662 height: "auto", 663 664 autoOpenOutline: !1, 665 666 autoOpenThumbnail: !1, 667 668 showDownloadControl: !0, 669 670 showSearchControl: !0, 671 672 showPrintControl: !0, 673 674 enableSound: !0, 675 676 duration: 800, 677 678 pageRotation: 0, 679 680 flipbook3DTiltAngleUp: 0, 681 682 flipbook3DTiltAngleLeft: 0, 683 684 readDirection: e.READ_DIRECTION.LTR, 685 686 pageMode: e.FLIPBOOK_PAGE_MODE.AUTO, 687 688 singlePageMode: e.FLIPBOOK_SINGLE_PAGE_MODE.AUTO, 689 690 flipbookFitPages: !1, 691 692 backgroundColor: "transparent", 693 694 flipbookHardPages: "none", 695 696 openPage: 1, 697 698 annotationClass: "", 699 700 maxTextureSize: 3200, 701 702 minTextureSize: 256, 703 704 rangeChunkSize: 524288, 705 706 disableAutoFetch: !0, 707 708 disableStream: !0, 709 710 disableFontFace: !1, 711 712 icons: { 713 714 altnext: "pf-icon-arrow-right1", 715 716 altprev: "pf-icon-arrow-left1", 717 718 next: "pf-icon-arrow-right1", 719 720 prev: "pf-icon-arrow-left1", 721 722 end: "pf-icon-last-page", 723 724 start: "pf-icon-first-page", 725 726 share: "pf-icon-share", 727 728 "outline-open": "pf-icon-arrow-right", 729 730 "outline-close": "pf-icon-arrow-down", 731 732 help: "pf-icon-help", 733 734 more: "pf-icon-more", 735 736 download: "pf-icon-download", 737 738 zoomin: "pf-icon-add-circle", 739 740 zoomout: "pf-icon-minus-circle", 741 742 resetzoom: "pf-icon-minus-circle", 743 744 fullscreen: "pf-icon-fullscreen", 745 746 "fullscreen-off": "pf-icon-fit-screen", 747 748 fitscreen: "pf-icon-fit-screen", 749 750 thumbnail: "pf-icon-grid-view", 751 752 outline: "pf-icon-list", 753 754 close: "pf-icon-close", 755 756 doublepage: "pf-icon-double-page", 757 758 singlepage: "pf-icon-file", 759 760 print: "pf-icon-print", 761 762 play: "pf-icon-play", 763 764 pause: "pf-icon-pause", 765 766 search: "pf-icon-search", 767 768 sound: "pf-icon-volume", 769 770 "sound-off": "pf-icon-volume", 771 772 facebook: "pf-icon-facebook", 773 774 google: "pf-icon-google", 775 776 twitter: "pf-icon-twitter", 777 778 whatsapp: "pf-icon-whatsapp", 779 780 linkedin: "pf-icon-linkedin", 781 782 pinterest: "pf-icon-pinterest", 783 784 mail: "pf-icon-mail" 785 786 }, 787 788 text: { 789 790 toggleSound: "Turn on/off Sound", 791 792 toggleThumbnails: "Toggle Thumbnails", 793 794 toggleOutline: "Toggle Outline/Bookmark", 795 796 previousPage: "Previous Page", 797 798 nextPage: "Next Page", 799 800 toggleFullscreen: "Toggle Fullscreen", 801 802 zoomIn: "Zoom In", 803 804 zoomOut: "Zoom Out", 805 806 resetZoom: "Reset Zoom", 807 808 pageFit: "Fit Page", 809 810 widthFit: "Fit Width", 811 812 toggleHelp: "Toggle Help", 813 814 search: "Search in PDF", 815 816 singlePageMode: "Single Page Mode", 817 818 doublePageMode: "Double Page Mode", 819 820 downloadPDFFile: "Download PDF File", 821 822 gotoFirstPage: "Goto First Page", 823 824 gotoLastPage: "Goto Last Page", 825 826 print: "Print", 827 828 play: "Start AutoPlay", 829 830 pause: "Pause AutoPlay", 831 832 share: "Share", 833 834 close: "Close", 835 836 mailSubject: "Check out this FlipBook", 837 838 mailBody: "Check out this site {{url}}", 839 840 loading: "Loading", 841 842 analyticsEventCategory: "Ppf-FLIP", 843 844 analyticsViewerReady: "Document Ready", 845 846 analyticsViewerOpen: "Document Opened", 847 848 analyticsViewerClose: "Document Closed", 849 850 analyticsFirstPageChange: "First Page Changed" 851 852 }, 853 854 share: { 855 856 facebook: "https://www.facebook.com/sharer/sharer.php?u={{url}}&t={{mailsubject}}", 857 858 twitter: "https://twitter.com/share?url={{url}}&text={{mailsubject}}", 859 860 mail: void 0, 861
862 whatsapp: "https://api.whatsapp.com/send/?text={{mailsubject}}+{{url}}&type=custom_url&app_absent=0", 863 864 linkedin: "https://www.linkedin.com/shareArticle?url={{url}}&title={{mailsubject}}", 865 866 pinterest: "https://www.pinterest.com/pin/create/button/?url={{url}}&media=&description={{mailsubject}}" 867 868 }, 869 870 allControls: "altPrev,pageNumber,altNext,play,outline,thumbnail,zoomIn,zoomOut,zoom,fullScreen,share,download,search,pageMode,startPage,endPage,sound,search,print,more", 871 872 moreControls: "download,pageMode,pageFit,startPage,endPage,sound", 873 874 leftControls: "outline,thumbnail", 875 876 rightControls: "fullScreen,share,download,more", 877 878 hideControls: "", 879 880 hideShareControls: "", 881 882 controlsPosition: e.CONTROLS_POSITION.BOTTOM, 883 884 paddingTop: 20, 885 886 paddingLeft: 15, 887 888 paddingRight: 15, 889 890 paddingBottom: 20, 891 892 enableAnalytics: !1, 893 894 zoomRatio: 2, 895 896 pageScale: e.PAGE_SCALE.PAGE_FIT, 897 898 controlsFloating: !0, 899 900 sideMenuOverlay: !0, 901 902 enableAnnotation: !0, 903 904 enableAutoLinks: !0, 905 906 arrowKeysAction: e.ARROW_KEYS_ACTIONS.NAV, 907 908 clickAction: e.MOUSE_CLICK_ACTIONS.NAV, 909 910 dblClickAction: e.MOUSE_DBL_CLICK_ACTIONS.NONE, 911 912 mouseScrollAction: e.MOUSE_SCROLL_ACTIONS.NONE, 913 914 linkTarget: e.LINK_TARGET.BLANK, 915 916 soundFile: "sound/turn2.mp3", 917 918 imagesLocation: "images", 919 920 imageResourcesPath: "images/pdfjs/", 921 922 popupThumbPlaceholder: "data:image/svg+xml," + escape('<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 210 297"><rect width="210" height="297" style="fill:#f1f2f2"/><circle cx="143" cy="95" r="12" style="fill:#e3e8ed"/><polygon points="131 138 120 149 95 124 34 184 176 185 131 138" style="fill:#e3e8ed"/></svg>'), 923 924 cMapUrl: "wp-content/themes/Avada-Child-Theme/js/cmaps/", 925 926 logo: "", 927 928 logoUrl: "", 929 930 sharePrefix: "", 931 932 pageSize: e.FLIPBOOK_PAGE_SIZE.AUTO, 933 934 backgroundImage: "", 935 936 pixelRatio: window.devicePixelRatio || 1, 937 938 spotLightIntensity: .22, 939 940 ambientLightColor: "#fff", 941 942 ambientLightIntensity: .8, 943 944 shadowOpacity: .1, 945 946 slug: void 0, 947 948 headerElementSelector: void 0, 949 950 onReady: function (e) { }, 951 952 onPageChanged: function (e) { }, 953 954 beforePageChanged: function (e) { }, 955 956 onCreate: function (e) { }, 957 958 onCreateUI: function (e) { }, 959 960 onFlip: function (e) { }, 961 962 beforeFlip: function (e) { }, 963 964 autoPDFLinktoViewer: !1, 965 966 autoLightBoxFullscreen: !1, 967 968 thumbLayout: "book-title-hover", 969 970 cleanupAfterRender: !0, 971 972 canvasWillReadFrequently: !0, 973 974 providerType: "pdf", 975 976 loadMoreCount: -1, 977 978 autoPlay: !1, 979 980 autoPlayDuration: 1e3, 981 982 autoPlayStart: !1, 983 984 popupBackGroundColor: "#eee", 985 986 mockupMode: !1, 987 988 pdfVersion: "default" 989 990 }, e.defaults = {}, e.jQuery.extend(!0, e.defaults, e._defaults), e.viewers = {}, e.providers = {}, e.openFileOptions = {}, e.executeCallback = function () { }; 991 992 var n, o, a = e, 993 994 r = e.jQuery, 995 996 s = "WebKitCSSMatrix" in window || document.body && "MozPerspective" in document.body.style, 997 998 l = "onmousedown" in window, 999 1000 u = a.utils = { 1001 1002 mouseEvents: l ? { 1003 1004 type: "mouse", 1005 1006 start: "mousedown", 1007 1008 move: "mousemove", 1009 1010 end: "mouseup" 1011 1012 } : { 1013 1014 type: "touch", 1015 1016 start: "touchstart", 1017 1018 move: "touchmove", 1019 1020 end: "touchend" 1021 1022 }, 1023 1024 html: { 1025 1026 div: "<div></div>", 1027 1028 a: "<a>", 1029 1030 input: "<input type='text'/>", 1031 1032 select: "<select></select>" 1033 1034 }, 1035 1036 getSharePrefix: function () { 1037 return u.getSharePrefixes()[0] 1038 1039 }, 1040 1041 getSharePrefixes: function () { 1042 1043 return (a.defaults.sharePrefix + ",pdfflip-,flipbook-,pfflip-,pTPDFFLIP-").split(",").map((function (e) { 1044 1045 return e.trim() 1046 1047 })) 1048 1049 }, 1050 1051 toRad: function (e) { 1052 1053 return e * Math.PI / 180 1054 1055 }, 1056 1057 toDeg: function (e) { 1058 1059 return 180 * e / Math.PI 1060 1061 }, 1062 1063 ifdef: function (e) { 1064 1065 return null == e ? arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null : e 1066 1067 }, 1068 1069 createBtn: function (e, t, i) { 1070 1071 var n = r(u.html.div, { 1072 1073 class: "pf-ui-btn pf-ui-" + e, 1074 1075 title: i, 1076 1077 html: void 0 !== i ? "<span>" + i + "</span>" : "" 1078 1079 }); 1080 1081 return void 0 !== t && t.indexOf("<svg") > -1 ? n.html(t.replace("<svg", '<svg xmlns="http://www.w3.org/2000/svg" ')) : n.addClass(t), n 1082 1083 }, 1084 1085 transition: function (e, t) { 1086 1087 return e ? t / 1e3 + "s ease-out" : "0s none" 1088 1089 }, 1090 1091 display: function (e) { 1092 1093 return e ? "block" : "none" 1094 1095 }, 1096 1097 resetTranslate: function () { 1098 1099 return u.translateStr(0, 0) 1100 1101 }, 1102 1103 bgImage: function (e) { 1104 1105 return null == e || "blank" === e ? "" : ' url("' + e + '")' 1106 1107 }, 1108 1109 translateStr: function (e, t) { 1110 1111 return s ? " translate3d(" + e + "px," + t + "px, 0px) " : " translate(" + e + "px, " + t + "px) " 1112 1113 }, 1114 1115 httpsCorrection: function (e) { 1116 1117 try { 1118 1119 if (null == e) return null; 1120 1121 if ("string" != typeof e) return e; 1122 1123 var t = window.location; 1124 1125 if (t.href.split(".")[0] === e.split(".")[0]) return e; 1126 1127 e.split("://")[1].split("/")[0].replace("www.", "") === t.hostname.replace("www.", "") && e.indexOf(t.hostname.replace("www.", "")) > -1 && (t.href.indexOf("https://") > -1 ? e = e.replace("http://", "https://") : t.href.indexOf("http://") > -1 && (e = e.replace("https://", "http://")), t.href.indexOf("://www.") > -1 && -1 === e.indexOf("://www.") && (e = e.replace("://", "://www.")), -1 === t.href.indexOf("://www.") && e.indexOf("://www.") > -1 && (e = e.replace("://www.", "://"))) 1128 1129 } catch (t) { 1130 1131 console.log("Skipping URL correction: " + e) 1132 1133 } 1134 1135 return e 1136 1137 }, 1138 1139 rotateStr: function (e) { 1140 1141 return " rotateZ(" + e + "deg) " 1142 1143 }, 1144 1145 lowerPowerOfTwo: function (e) { 1146 1147 return Math.pow(2, Math.floor(Math.log(e) / Math.LN2)) 1148 1149 }, 1150 1151 nearestPowerOfTwo: function (e, t) { 1152 1153 return Math.min(t || 2048, Math.pow(2, Math.ceil(Math.log(e) / Math.LN2))) 1154 1155 }, 1156 1157 getFullscreenElement: function () { 1158 1159 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement 1160 1161 }, 1162 1163 hasFullscreenEnabled: function () { 1164 1165 return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled 1166 1167 }, 1168 1169 fixMouseEvent: function (e) { 1170 1171 if (e) { 1172 1173 var t = e.originalEvent || e; 1174 1175 if (t.changedTouches && t.changedTouches.length > 0) { 1176 1177 var i = r.event.fix(e), 1178 1179 n = t.changedTouches[0]; 1180 1181 return i.clientX = n.clientX, i.clientY = n.clientY, i.pageX = n.pageX, i.touches = t.touches, i.pageY = n.pageY, i.movementX = n.movementX, i.movementY = n.movementY, i 1182 1183 } 1184 1185 return e 1186 1187 } 1188 1189 return e 1190 1191 }, 1192 1193 limitAt: function (e, t, i) { 1194 1195 return e < t ? t : e > i ? i : e 1196 1197 }, 1198 1199 distOrigin: function (e, t) { 1200 1201 return u.distPoints(0, 0, e, t) 1202 1203 }, 1204 1205 distPoints: function (e, t, i, n) { 1206 1207 return Math.sqrt(Math.pow(i - e, 2) + Math.pow(n - t, 2)) 1208 1209 }, 1210 1211 angleByDistance: function (e, t) { 1212 1213 var i = t / 2, 1214 1215 n = u.limitAt(e, 0, t); 1216 1217 return n < i ? u.toDeg(Math.asin(n / i)) : 90 + u.toDeg(Math.asin((n - i) / i)) 1218 1219 }, 1220 1221 calculateScale: function (e, t) { 1222 1223 var i = u.distPoints(e[0].x, e[0].y, e[1].x, e[1].y); 1224 1225 return u.distPoints(t[0].x, t[0].y, t[1].x, t[1].y) / i 1226 1227 }, 1228 1229 getVectorAvg: function (e) { 1230 1231 return { 1232 1233 x: e.map((function (e) { 1234 1235 return e.x 1236 1237 })).reduce(u.sum) / e.length, 1238 1239 y: e.map((function (e) { 1240 1241 return e.y 1242 1243 })).reduce(u.sum) / e.length 1244 1245 } 1246 1247 }, 1248 1249 sum: function (e, t) { 1250 1251 return e + t 1252 1253 }, 1254 1255 getTouches: function (e, t) { 1256 1257 return t = t || { 1258 1259 left: 0, 1260 1261 top: 0 1262 1263 }, Array.prototype.slice.call(e.touches).map((function (e) { 1264 1265 return { 1266 1267 x: e.pageX - t.left, 1268 1269 y: e.pageY - t.top 1270 1271 } 1272 1273 })) 1274 1275 }, 1276 1277 getScriptCallbacks: [], 1278 1279 getScript: function (e, t, i, n) { 1280 1281 var o, a = u.getScriptCallbacks[e]; 1282 1283 1284 1285 function s() { 1286 1287 o.removeEventListener("load", l, !1), o.removeEventListener("readystatechange", l, !1), o.removeEventListener("complete", l, !1), o.removeEventListener("error", h, !1), o.onload = o.onreadystatechange = null, o = null, o = null 1288 1289 } 1290 1291 1292 1293 function l(e, t) { 1294 1295 if (null != o && (t || !o.readyState || /loaded|complete/.test(o.readyState))) { 1296 1297 if (!t) { 1298 1299 for (var n = 0; n < a.length; n++) a[n] && a[n](), a[n] = null; 1300 1301 i = null 1302 1303 } 1304 1305 s() 1306 1307 } 1308 1309 } 1310 1311 1312 1313 function h() { 1314 1315 i(), s(), i = null 1316 1317 } 1318 1319 if (0 === r("script[src='" + e + "']").length) { 1320
1321 (a = u.getScriptCallbacks[e] = []).push(t), o = document.createElement("script"); 1322 1323 var p = document.body.getElementsByTagName("script")[0]; 1324 1325 o.async = !0, o.setAttribute("data-cfasync", "false"), !0 === n && o.setAttribute("type", "module"), null != p ? (p.parentNode.insertBefore(o, p), p = null) : document.body.appendChild(o), o.addEventListener("load", l, !1), o.addEventListener("readystatechange", l, !1), o.addEventListener("complete", l, !1), i && o.addEventListener("error", h, !1), o.src = e + ("MS" === u.prefix.dom ? "?" + Math.random() : "") 1326 1327 } else a.push(t) 1328 1329 }, 1330 1331 detectScriptLocation: function () { 1332 1333 if (void 0 === window[e.locationVar]) r("script").each((function () { 1334 1335 var t = r(this)[0].src; 1336 1337 if ((t.indexOf("/" + e.locationFile + ".js") > -1 || t.indexOf("/" + e.locationFile + ".min.js") > -1 || t.indexOf("js/" + e.locationFile + ".") > -1) && (t.indexOf("https://") > -1 || t.indexOf("http://") > -1)) { 1338 1339 var i = t.split("/"); 1340 1341 window[e.locationVar] = i.slice(0, -2).join("/") 1342 1343 } 1344 1345 })); 1346 1347 else if (-1 == window[e.locationVar].indexOf(":")) { 1348 1349 var t = document.createElement("a"); 1350 1351 t.href = window[e.locationVar], window[e.locationVar] = t.href, t = null 1352 1353 } 1354 1355 void 0 !== window[e.locationVar] && window[e.locationVar].length > 2 && "/" !== window[e.locationVar].slice(-1) && (window.window[e.locationVar] += "/") 1356 1357 }, 1358 1359 disposeObject: function (e) { 1360 1361 return e && e.dispose && e.dispose(), e = null 1362 1363 }, 1364 1365 log: function () { 1366 1367 var e; 1368 1369 !0 === a.defaults.enableDebugLog && window.console && (e = console).log.apply(e, arguments) 1370 1371 }, 1372 1373 color: { 1374 1375 getBrightness: function (e) { 1376 1377 var t = e.replace("#", "").match(/.{1,2}/g).map((function (e) { 1378 1379 return parseInt(e, 16) 1380 1381 })); 1382 1383 return .299 * t[0] + .587 * t[1] + .114 * t[2] 1384 1385 }, 1386 1387 isLight: function (e) { 1388 1389 return !u.color.isDark(e) 1390 1391 }, 1392 1393 isDark: function (e) { 1394 1395 return u.color.getBrightness(e) < 128 1396 1397 } 1398 1399 }, 1400 1401 isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 1402 1403 isIOS: /(iPad|iPhone|iPod)/g.test(navigator.userAgent), 1404 1405 isIPad: "iPad" === navigator.platform || void 0 !== navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /Mac/.test(navigator.platform), 1406 1407 isMac: navigator.platform.toUpperCase().indexOf("MAC") >= 0, 1408 1409 isSafari: /constructor/i.test(window.HTMLElement) || "[object SafariRemoteNotification]" === (!window.safari || window.safari.pushNotification).toString(), 1410 1411 isIEUnsupported: !!navigator.userAgent.match(/(MSIE|Trident)/), 1412 1413 isSafariWindows: function () { 1414 1415 return !u.isMac && u.isSafari 1416 1417 }, 1418 1419 hasWebgl: function () { 1420 1421 try { 1422 1423 var e = document.createElement("canvas"); 1424 1425 return !(!window.WebGLRenderingContext || !e.getContext("webgl") && !e.getContext("experimental-webgl")) 1426 1427 } catch (e) { 1428 1429 return !1 1430 1431 } 1432 1433 }(), 1434 1435 hasES2022: void 0 !== Array.prototype.at, 1436 1437 canSupport3D: function () { 1438 1439 var e = !0; 1440 1441 try { 1442 1443 if (0 == u.hasWebgl) e = !1, console.log("Proper Support for Canvas webgl 3D not detected!"); 1444 1445 else if (0 == u.hasES2022) e = !1, console.log("Proper Support for 3D not extpected in older browser!"); 1446 1447 else if (-1 !== navigator.userAgent.indexOf("MSIE") || navigator.appVersion.indexOf("Trident/") > 0) e = !1, console.log("Proper Support for 3D not detected for IE!"); 1448 1449 else if (u.isSafariWindows()) e = !1, console.log("Proper Support for 3D not detected for Safari!"); 1450 1451 else { 1452 1453 var t = navigator.userAgent.toString().toLowerCase().match(/android\s([0-9\.]*)/i); 1454 1455 (t = t ? t[1] : void 0) && (t = parseInt(t, 10), !isNaN(t) && t < 9 && (e = !1, console.log("Proper Support for 3D not detected for Android below 9.0!"))) 1456 1457 } 1458 1459 } catch (e) { } 1460 1461 return e 1462 1463 }, 1464 1465 prefix: (n = window.getComputedStyle(document.documentElement, ""), o = Array.prototype.slice.call(n).join("").match(/-(moz|webkit|ms)-/)[1], { 1466 1467 dom: "WebKit|Moz|MS".match(new RegExp("(" + o + ")", "i"))[1], 1468 1469 lowercase: o, 1470 1471 css: "-" + o + "-", 1472 1473 js: o[0].toUpperCase() + o.substr(1) 1474 1475 }), 1476 1477 scrollIntoView: function (e, t, i) { 1478 1479 (t = t || e.parentNode).scrollTop = e.offsetTop + (!1 === i ? e.offsetHeight - t.offsetHeight : 0), t.scrollLeft = e.offsetLeft - t.offsetLeft 1480 1481 }, 1482 1483 getVisibleElements: function (e) { 1484 1485 var t = e.container, 1486 1487 i = e.elements, 1488 1489 n = e.visible || [], 1490 1491 o = t.scrollTop, 1492 1493 a = o + t.clientHeight; 1494 1495 if (0 == a) return n; 1496 1497 var r = 0, 1498 1499 s = i.length - 1, 1500 1501 l = i[r], 1502 1503 u = l.offsetTop + l.clientTop + l.clientHeight; 1504 1505 if (u < o) 1506 1507 for (; r < s;) { 1508 1509 var h = r + s >> 1; 1510 1511 (u = (l = i[h]).offsetTop + l.clientTop + l.clientHeight) > o ? s = h : r = h + 1 1512 1513 } 1514 1515 for (var p = r; p < i.length; p++) { 1516 1517 if (!((l = i[p]).offsetTop + l.clientTop <= a)) break; 1518 1519 n.push(p + 1) 1520 1521 } 1522 1523 return n 1524 1525 }, 1526 1527 getMouseDelta: function (e) { 1528 1529 var t = 0; 1530 1531 return null != e.wheelDelta ? t = e.wheelDelta : null != e.detail && (t = -e.detail), t 1532 1533 }, 1534 1535 pan: function (e, t) { 1536 1537 var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], 1538 1539 n = e.startPoint, 1540 1541 o = e.app.zoomValue, 1542 1543 a = e.left + (!0 === i ? 0 : t.raw.x - n.raw.x), 1544 1545 r = e.top + (!0 === i ? 0 : t.raw.y - n.raw.y); 1546
1547 e.left = Math.ceil(u.limitAt(a, -e.shiftWidth, e.shiftWidth)), e.top = Math.ceil(u.limitAt(r, -e.shiftHeight, e.shiftHeight)), 1 === o && (e.left = 0, e.top = 0), !1 === i && (e.startPoint = t) 1548 1549 } 1550 1551 }; 1552 1553 u.isChromeExtension = function () { 1554 1555 return 0 === window.location.href.indexOf("chrome-extension://") 1556 1557 }; 1558 1559 var h = /\x00+/g, 1560 1561 p = /[\x01-\x1F]/g; 1562 1563 u.removeNullCharacters = function (e) { 1564 1565 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; 1566 1567 return "string" != typeof e ? (warn("The argument for removeNullCharacters must be a string."), e) : (t && (e = e.replace(p, " ")), e.replace(h, "")) 1568 1569 }, e.hashFocusBookFound = !1, u.detectHash = function () { 1570 1571 e.preParseHash = window.location.hash; 1572 1573 var t = u.getSharePrefixes(); - 1 == t.indexOf("") && t.push(""), Array.prototype.forEach.call(t, (function (t) { 1574 1575 var i = e.preParseHash; 1576 1577 if (i && i.indexOf(t) >= 0 && !1 === e.hashFocusBookFound) { 1578 1579 t.length > 0 && (i = i.split(t)[1]); 1580 1581 var n = i.split("/")[0].replace("#", ""); 1582 1583 if (n.length > 0) { 1584 1585 var o, a = i.split("/")[1]; 1586 1587 if (null != a && (a = a.split("/")[0]), 0 === (o = r("[data-pf-slug=" + n + "]")).length && (o = r("[data-slug=" + n + "]")), 0 === o.length && (o = r("#pf-" + n + ",#" + n)), 0 === o.length && (o = r("[data-_slug=" + n + "]")), o.length > 0 && o.is("._pdfflip_thumb,._pdfflip_button,._df_custom,._df_link,._df_book,.pf-element,.dp-element")) { 1588 1589 o = r(o[0]), e.hashFocusBookFound = !0, a = parseInt(a, 10), u.focusHash(o); 1590 1591 var s = e.activeLightBox && e.activeLightBox.app || o.data("pf-app"); 1592 1593 if (null != s) return s.gotoPage(a), s.hashNavigationEnabled = !0, u.focusHash(s.element), !1; 1594 1595 null != a && o.attr("data-hash-page", a), o.addClass("pf-hash-focused", !0), (null != o.data("lightbox") || null != o.data("pf-lightbox") || null != o.attr("href") && o.attr("href").indexOf(".pdf") > -1) && o.trigger("click") 1596 1597 } 1598 1599 } 1600 1601 } 1602 1603 })) 1604 1605 }, u.focusHash = function (e) { 1606 1607 var t, i; 1608 1609 null === (t = (i = e[0]).scrollIntoView) || void 0 === t || t.call(i, { 1610 1611 behavior: "smooth", 1612 1613 block: "nearest", 1614 1615 inline: "nearest" 1616 1617 }) 1618 1619 }, u.contain = function (e, t, i, n) { 1620 1621 var o = Math.min(i / e, n / t); 1622 1623 return { 1624 1625 width: e * o, 1626 1627 height: t * o 1628 1629 } 1630 1631 }, u.containUnStretched = function (e, t, i, n) { 1632 1633 var o = Math.min(1, i / e, n / t); 1634 1635 return { 1636 1637 width: e * o, 1638 1639 height: t * o 1640 1641 } 1642 1643 }, u.fallbackOptions = function (e) { 1644 1645 return void 0 === e.share.mail && (e.share.mail = "mailto:?subject=" + e.text.mailSubject + "&body=" + e.text.mailBody), e.openPage && (e.openPage = parseInt(e.openPage, 10)), e 1646 1647 }; 1648 1649 u.getOptions = function (e) { 1650 1651 null == (e = r(e)).data("pf-option") & null == e.data("option") && e.data("pf-option", "option_" + e.attr("id")), void 0 !== e.attr("source") && e.data("pf-source", e.attr("source")); 1652 1653 var i = e.data("pf-option") || e.data("option"), 1654 1655 n = void 0; 1656 1657 n = "object" === t(i) ? i : null == i || "" === i || null == window[i] ? {} : window[i]; 1658 1659 var o = function (e) { 1660 1661 var t = {}, 1662 1663 i = { 1664 1665 id: "", 1666 1667 thumb: "", 1668 1669 openPage: "data-hash-page,pf-page,data-
1669pf-page,data-page,page", 1670 1671 target: "", 1672 1673 height: "", 1674 1675 source: "ppf-source,pf-source,source", 1676 1677 is3D: "webgl,is3d", 1678 1679 viewerType: "viewertype,viewer-type", 1680 1681 pagemode: "" 1682 1683 }; 1684 1685 for (var n in i) 1686 1687 for (var o = (n + "," + i[n]).split(","), a = 0; a < o.length; a++) { 1688 1689 var r = o[a]; 1690 1691 if ("" !== r) { 1692 1693 var s = e.data(r); 1694 1695 if (null !== s && "" != s && null != s) { 1696 1697 t[n] = s; 1698 1699 break 1700 1701 } 1702 1703 if (null !== (s = e.attr(r)) && "" != s && null != s) { 1704 1705 t[n] = s; 1706 1707 break 1708 1709 } 1710 1711 } 1712 1713 } 1714 1715 return e.removeAttr("data-hash-page"), t 1716 1717 }(e); 1718 1719 return n = r.extend(!0, {}, n, o) 1720 1721 }, u.isTrue = function (e) { 1722 1723 return "true" === e || !0 === e 1724 1725 }, u.parseInt = function (e) { 1726 1727 return parseInt(e, 10) 1728 1729 }, u.parseFloat = function (e) { 1730 1731 return parseFloat(e) 1732 1733 }, u.parseIntIfExists = function (e) { 1734 1735 return void 0 !== e && (e = parseInt(e, 10)), e 1736 1737 }, u.parseFloatIfExists = function (e) { 1738 1739 return void 0 !== e && (e = parseFloat(e)), e 1740 1741 }, u.parseBoolIfExists = function (e) { 1742 1743 return void 0 !== e && (e = u.isTrue(e)), e 1744 1745 }, u.sanitizeOptions = function (e) { 1746 1747 if (e.showDownloadControl = u.parseBoolIfExists(e.showDownloadControl), e.showSearchControl = u.parseBoolIfExists(e.showSearchControl), e.showPrintControl = u.parseBoolIfExists(e.showPrintControl), e.flipbook3DTiltAngleLeft = u.parseIntIfExists(e.flipbook3DTiltAngleLeft), e.flipbook3DTiltAngleUp = u.parseIntIfExists(e.flipbook3DTiltAngleUp), e.paddingLeft = u.parseIntIfExists(e.paddingLeft), e.paddingRight = u.parseIntIfExists(e.paddingRight), e.paddingTop = u.parseIntIfExists(e.paddingTop), e.paddingBottom = u.parseIntIfExists(e.paddingBottom), e.duration = u.parseIntIfExists(e.duration), e.rangeChunkSize = u.parseIntIfExists(e.rangeChunkSize), e.maxTextureSize = u.parseIntIfExists(e.maxTextureSize), e.linkTarget = u.parseIntIfExists(e.linkTarget), e.zoomRatio = u.parseFloatIfExists(e.zoomRatio), e.enableAnalytics = u.parseBoolIfExists(e.enableAnalytics), e.autoPlay = u.parseBoolIfExists(e.autoPlay), e.autoPlayStart = u.parseBoolIfExists(e.autoPlayStart), e.autoPlayDuration = u.parseIntIfExists(e.autoPlayDuration), void 0 !== e.loadMoreCount && (e.loadMoreCount = u.parseInt(e.loadMoreCount), (isNaN(e.loadMoreCount) || 0 === e.loadMoreCount) && (e.loadMoreCount = -1)), null != e.source && (Array === e.source.constructor || Array.isArray(e.source) || e.source instanceof Array)) 1748 1749 for (var t = 0; t < e.source.length; t++) e.source[t] = u.httpsCorrection(e.source[t]); 1750 1751 else e.source = u.httpsCorrection(e.source); 1752 1753 return e 1754 1755 }, u.finalizeOptions = function (e) { 1756 1757 return e 1758 1759 }, u.urlify = function (e) { 1760 1761 for (var t, i = /[a-z0-9][^\s,]{3,}\.[^\s,]+[a-z0-9]/gi, n = []; t = i.exec(e);) { 1762 1763 var o = t[0]; 1764 1765 1 == (o.match(/@/g) || []).length ? o.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,7})+/gi) && n.push({ 1766 1767 index: t.index, 1768 1769 length: o.length, 1770 1771 text: o 1772 1773 }) : o.match(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b[-a-zA-Z0-9@:%_\+.~#?&//=]*/g) && (0 !== o.indexOf("http:") && 0 !== o.indexOf("https:") && 0 !== o.indexOf("www.") || n.push({ 1774 1775 index: t.index, 1776 1777 length: o.length, 1778 1779 text: o 1780 1781 })) 1782 1783 } 1784 1785 return n 1786 1787 }, u.oldurlify = function (e) { 1788 1789 return e.replace(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;
1789:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/g, (function (e, t, i, n, o) { 1790 1791 var a = e = e.toLowerCase(); 1792 1793 if (e.indexOf(":") > 0 && -1 === e.indexOf("http:") && -1 === e.indexOf("https:")) return u.log("AutoLink Rejected: " + a + " for " + e), e; 1794 1795 if (0 === e.indexOf("www.")) a = "http://" + e; 1796 1797 else if (0 === e.indexOf("http://") || 0 === e.indexOf("https://")); 1798 1799 else if (0 === e.indexOf("mailto:")); 1800 1801 else if (e.indexOf("@") > 0) { 1802 1803 a = "mailto:" + e; 1804 1805 if (null === e.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/)) return u.log("AutoLink Rejected: " + a + " for " + e), e 1806 1807 } 1808 1809 return u.log("AutoLink: " + a + " for " + e), '<a href="' + a + '" class="pf-autolink" target="_blank" rel="noopener">' + e + "</a>" 1810 1811 })) 1812 1813 }, u.supportsPassive = !1; 1814 1815 try { 1816 1817 var c = Object.defineProperty({}, "passive", { 1818 1819 get: function () { 1820 1821 u.supportsPassive = !0 1822 1823 } 1824 1825 }); 1826 1827 window.addEventListener("testPassive", null, c), window.removeEventListener("testPassive", null, c) 1828 1829 } catch (e) { } 1830 1831 e.parseCSSElements = function () { 1832 1833 r(".dvcss").each((function () { 1834 1835 var e, t = r(this), 1836 1837 i = function (e) { 1838 1839 for (var t, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "dvcss_e_", n = e.classList, o = 0; o < n.length; o++) 1840 1841 if (0 === (t = n[o]).indexOf(i)) return t; 1842 1843 return null 1844 1845 }(t[0]); 1846 1847 t.removeClass(i).removeClass("dvcss"), i = i.replace("dvcss_e_", ""); 1848 1849 try { 1850 1851 e = JSON.parse(atob(i)) 1852 1853 } catch (e) { } 1854 1855 if (e) { 1856 1857 var n = "df_option_" + e.id; 1858 1859 window[n] = r.extend(!0, {}, window[n], e), t.addClass("pf-element"), "none" !== e.lightbox && (t.attr("data-pf-lightbox", void 0 === e.lightbox ? "custom" : e.lightbox), "thumb" == e.lightbox && t.attr("data-pf-thumb", e.pdfThumb), e.thumbLayout && t.attr("data-pf-thumb-layout", e.thumbLayout), e.apl && t.attr("apl", e.apl)), t.data("pf-option", n), t.attr("data-pf-slug", e.slug), t.attr("id", "df_" + e.id) 1860 1861 } 1862 1863 })) 1864 1865 }, e.parseThumbs = function (t) { 1866 1867 t.element.html(""), null != t.thumbURL && "" != t.thumbURL.toString().trim() || (t.element.addClass("pf-thumb-not-found"), t.thumbURL = e.defaults.popupThumbPlaceholder); 1868 1869 var i = r("<span class='pf-book-title'>").html(t.title), 1870 1871 n = r("<div class='pf-book-wrapper'>").appendTo(t.element); 1872 1873 n.append(r("<div class='pf-book-page1'>")), n.append(r("<div class='pf-book-page2'>")); 1874 1875 var o = r("<div class='pf-book-cover'>").append(i).appendTo(n), 1876 1877 a = r('<img width="100px" height="297px" class="pf-lazy" alt="' + t.title + '"/>'); 1878 1879 a.attr("data-src", t.thumbURL), a.attr("src", e.defaults.popupThumbPlaceholder), o.prepend(a), e.addLazyElement(a[0]), !0 === e.defaults.displayLightboxPlayIcon && o.addClass("pf-icon-play-popup"), "book-title-bottom" !== t.thumbLayout && "cover-title" !== t.thumbLayout || (t.hasShelf ? t.thumbLayout = "book-title-fixed" : i.appendTo(t.element), !0 === e.defaults.displayLightboxPlayIcon && (t.element.removeClass("pf-icon-play-popup"), n.addClass("pf-icon-play-popup"))), t.element.addClass("pf-tl-" + t.thumbLayout), t.element.attr("title", t.title) 1880 1881 }, e.initId = 10, e.embeds = [], e.removeEmbeds = [], e.removeEmbedsLimit = u.isMobile ? 1 : 2, e.parseNormalElements = function () { 1882 1883 r(".pf-posts").each((function () { 1884
1885 if (!1 !== e.defaults.loadMoreCount && -1 !== e.defaults.loadMoreCount) { 1886 1887 var t = r(this); 1888 1889 if ("true" !== t.data("pf-parsed")) { 1890 1891 t.data("pf-parsed", "true"), t.attr("pf-parsed", "true"); 1892 1893 var i = 0, 1894 1895 n = t.find(".pf-element"), 1896 1897 o = n.length; 1898 1899 n.each((function () { 1900 1901 ++i > e.defaults.loadMoreCount && r(this).attr("skip-parse", "true") 1902 1903 })), o > e.defaults.loadMoreCount && t.append("<div class='pf-load-more-button-wrapper'><div class='pf-load-more-button'>Load More..</div></div>") 1904 1905 } 1906 1907 } 1908 1909 })), e.triggerId = 10, r(".pf-element").each((function () { 1910 1911 var t = r(this); 1912 1913 if ("true" !== t.attr("skip-parse") && "true" !== t.data("pf-parsed")) { 1914 1915 t.data("pf-parsed", "true"), t.attr("pf-parsed", "true"); 1916 1917 var i = t.data("pf-lightbox") || t.data("lightbox"); 1918 1919 if (void 0 === i) t.addClass("pf-lazy-embed"), e.addLazyElement(t[0]); 1920 1921 else if (t.addClass("pf-popup-" + i), "thumb" === i) { 1922 1923 var n = t.data("pf-thumb-layout") || e.defaults.thumbLayout, 1924 1925 o = u.httpsCorrection(t.data("pf-thumb")); 1926 1927 t.removeAttr("data-thumb").removeAttr("data-thumb-layout"); 1928 1929 var a = t.html().trim(); 1930 1931 void 0 !== a && "" !== a || (a = "Click to Open"); 1932 1933 var s = t.parent().hasClass("pdfflip-onshelf"); 1934 1935 e.parseThumbs({ 1936 1937 element: t, 1938 1939 thumbURL: o, 1940 1941 title: a, 1942 1943 thumbLayout: n, 1944 1945 hasShelf: s 1946 1947 }), s && t.after(r("<ppf-flip-shelf>")) 1948 1949 } else "button" === i && e.defaults.buttonClass && t.addClass(e.defaults.buttonClass); 1950 1951 var l = t.attr("data-trigger"); 1952 1953 null != l && l.length > 1 && (l = l.split(","), e.triggerId++, l.forEach((function (i) { 1954 1955 t.attr("pf-trigger-id", e.triggerId), r("#" + i).addClass("pf-trigger").attr("pf-trigger", e.triggerId) 1956 1957 }))), t.data("pf-editlink") && t.append('<a class="pf-edit-link" href="' + t.data("pf-editlink") + '" >Edit Book</a>') 1958 1959 } 1960 1961 })), e.handleLazy = function () { 1962 1963 var t; 1964 1965 if (e.removeEmbeds.length > e.removeEmbedsLimit && (t = e.removeEmbeds.shift())) { 1966 1967 var i = r("[initID='" + t + "']"); 1968 1969 if (i.length > 0) { 1970 1971 var n = i.data("pf-app"); 1972 1973 n && (i.attr("data-pf-page", n.currentPageNumber), u.log("Removed app id " + t), n.dispose(), n = null) 1974 1975 } 1976 1977 } 1978 1979 if (t = e.embeds.shift()) { 1980 1981 var o = r("[initID='" + t + "']"); 1982 1983 if (o.length > 0) 1984 1985 if (o.is("img")) o.hasClass("pf-lazy") ? (o.attr("src", o.attr("data-src")), o.removeAttr("data-src"), o.removeClass("pf-lazy"), e.lazyObserver.unobserve(o[0]), e.handleLazy()) : (u.log("Prevent this"), e.handleLazy()); 1986 1987 else { 1988 1989 var a = o.data("pf-app"); 1990 1991 null == a ? o.pdfflipinterface() : a.softInit(), u.log("Created app id " + t) 1992 1993 } 1994 1995 } 1996 1997 e.removeEmbeds.length <= e.removeEmbedsLimit && 0 == e.embeds.length && (e.checkRequestQueue = null) 1998 1999 } 2000 2001 }, e.lazyObserver = { 2002 2003 observe: function (e) { 2004 2005 (e = r(e)).is("img") ? e.hasClass("pf-lazy") && (e.attr("src", e.attr("data-src")), e.removeAttr("data-src"), e.removeClass("pf-lazy")) : e.pdfflipinterface() 2006 2007 } 2008 2009 }, "function" == typeof IntersectionObserver && (e.lazyObserver = new IntersectionObserver((function (t, i) { 2010 2011 t.forEach((function (t) { 2012 2013 var i, n = r(t.target), 2014 2015 o = n.attr("initID"); 2016 2017 t.isIntersecting ? (n.attr("initID") || (n.attr("initID", e.initId), o = e.initId.toString(), e.initId++), (i = e.removeEmbeds.indexOf(o)) > -1 ? (e.removeEmbeds.splice(i, 1), u.log("Removed id " + o + "from Removal list")) :
2017-1 == (i = e.embeds.indexOf(o)) && (e.embeds.push(o), u.log("Added id " + o + "to Add list"))) : o && ((i = e.embeds.indexOf(o)) > -1 ? (e.embeds.splice(i, 1), u.log("Removed id " + o + " from Add list")) : -1 == (i = e.removeEmbeds.indexOf(o)) && (e.removeEmbeds.push(o), u.log("Added id " + o + " to Removal list"))), d = 0, (e.removeEmbeds.length > e.removeEmbedsLimit || e.embeds.length > 0) && null == e.checkRequestQueue && (e.checkRequestQueue = function () { 2018 2019 d++, e.checkRequestQueue && requestAnimationFrame((function () { 2020 2021 e && e.checkRequestQueue && e.checkRequestQueue() 2022 2023 })), d > 20 && (d = 0, e.handleLazy()) 2024 2025 }, e.checkRequestQueue()) 2026 2027 })) 2028 2029 }))); 2030 2031 var d = 0; 2032 2033 2034 2035 function f(e) { 2036 2037 return f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 2038 2039 return typeof e 2040 2041 } : function (e) { 2042 2043 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 2044 2045 }, f(e) 2046 2047 } 2048 2049 2050 2051 function g(e, t) { 2052 2053 for (var i = 0; i < t.length; i++) { 2054 2055 var n = t[i]; 2056 2057 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 2058 2059 if ("object" !== f(e) || null === e) return e; 2060 2061 var i = e[Symbol.toPrimitive]; 2062 2063 if (void 0 !== i) { 2064 2065 var n = i.call(e, t || "default"); 2066 2067 if ("object" !== f(n)) return n; 2068 2069 throw new TypeError("@@toPrimitive must return a primitive value.") 2070 2071 } 2072 2073 return ("string" === t ? String : Number)(e) 2074 2075 }(o, "string"), "symbol" === f(a) ? a : String(a)), n) 2076 2077 } 2078 2079 var o, a 2080 2081 } 2082 2083 e.addLazyElement = function (t) { 2084 2085 e.lazyObserver.observe(t) 2086 2087 }, e.parseElements = u.parseElements = function () { 2088 2089 e.parseCSSElements(), e.parseNormalElements() 2090 2091 }, e.initUtils = function () { 2092 2093 u.detectScriptLocation(); 2094 2095 var t = r("body"); 2096 2097 (u.isSafari || u.isIOS) && t.addClass("pf-ios"), t.on("click", (function () { })), t.on("click", ".pf-posts .pf-load-more-button", (function () { 2098 2099 var t = r(this).closest(".pf-posts"); 2100 2101 if (t.length > 0) { 2102 2103 var i = 0; 2104 2105 t.find(".pf-element").each((function () { 2106 2107 var t = r(this); 2108 2109 "true" === t.attr("skip-parse") && (i < e.defaults.loadMoreCount && t.removeAttr("skip-parse"), i++) 2110 2111 })), e.parseNormalElements() 2112 2113 } 2114 2115 })), e.defaults.shelfImage && "" != e.defaults.shelfImage && t.append("<style>.pdfflip-onshelf ppf-flip-shelf:before, .pdfflip-onshelf ppf-flip-shelf:after{background-image: url('" + e.defaults.shelfImage + "');}</style>") 2116 2117 }; 2118 2119 var v = e, 2120 2121 m = e.utils, 2122 2123 y = function () { 2124 2125 function t(e, i) { 2126 2127 ! function (e, t) { 2128 2129 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 2130 2131 }(this, t), this.pages = [], this.app = i, this.parentElement = this.app.viewerContainer; 2132 2133 var n = "pf-viewer " + (e.viewerClass || ""); 2134 2135 this.element = jQuery("<div>", { 2136 2137 class: n 2138 2139 }), this.parentElement.append(this.element), this.wrapper = jQuery("<div>", { 2140 2141 class: "pf-viewer-wrapper" 2142 2143 }), this.element.append(this.wrapper), this.oldBasePageNumber = 0, this.pages = [], this.minZoom = 1, this.maxZoom = 4, this.swipeThreshold = 20, this.stageDOM = null, this.events = {}, this.arrowKeysAction = e.arrowKeysAction, this.clickAction = e.clickAction, this.scrollAction = e.scrollAction, this.dblClickAction = e.dblClickAction, this.pageBuffer = [], this.pageBufferSize = 10 2144 2145 } 2146 2147 var i, n, o; 2148 2149 return i = t, n = [{ 2150 2151 key: "init", 2152 2153 value: function () { } 2154 2155 }, { 2156 2157 key: "softDispose", 2158 2159 value: function () { } 2160 2161 }, { 2162 2163 key: "updateBuffer", 2164 2165 value: function (e) { } 2166 2167 }, { 2168 2169 key: "pageResetCallback", 2170 2171 value: function (e) { } 2172 2173 }, { 2174 2175 key: "initCustomControls", 2176 2177 value: function () { } 2178 2179 }, { 2180 2181 key: "_getInnerWidth", 2182 2183 value: function () { 2184 2185 return this.app.dimensions.containerWidth - this.app.dimensions.padding.width - this.app.dimensions.offset.width 2186 2187 } 2188 2189 }, { 2190 2191 key: "_getInnerHeight", 2192 2193 value: function () { 2194 2195 return this.app.dimensions.maxHeight - this.app.dimensions.padding.height 2196 2197 } 2198 2199 }, { 2200 2201 key: "_getOuterHeight", 2202 2203 value: function (e) { 2204 2205 return e 2206 2207 } 2208 2209 }, { 2210 2211 key: "dispose", 2212 2213 value: function () { 2214 2215 this.stageDOM && (this.stageDOM.removeEventListener("mousemove", this.events.mousemove, !1), this.stageDOM.removeEventListener("mousedown", this.events.mousedown, !1), this.stageDOM.removeEventListener("mouseup", this.events.mouseup, !1), this.stageDOM.removeEventListener("touchmove", this.events.mousemove, !1), this.stageDOM.removeEventListener("touchstart", this.events.mousedown, !1), this.stageDOM.removeEventListener("touchend", this.events.mouseup, !1), this.stageDOM.removeEventListener("dblclick", this.events.dblclick, !1), this.stageDOM.removeEventListener("scroll", this.events.scroll,
2215!1), this.stageDOM.removeEventListener("mousewheel", this.events.mousewheel, !1), this.stageDOM.removeEventListener("DOMMouseScroll", this.events.mousewheel, !1)), this.events = null, this.stageDOM = null, this.element.remove() 2216 2217 } 2218 2219 }, { 2220 2221 key: "checkDocumentPageSizes", 2222 2223 value: function () { } 2224 2225 }, { 2226 2227 key: "getViewerPageNumber", 2228 2229 value: function (e) { 2230 2231 return e 2232 2233 } 2234 2235 }, { 2236 2237 key: "getDocumentPageNumber", 2238 2239 value: function (e) { 2240 2241 return e 2242 2243 } 2244 2245 }, { 2246 2247 key: "getRenderContext", 2248 2249 value: function (t, i) { 2250 2251 var n = this.app, 2252 2253 o = n.provider, 2254 2255 a = i.pageNumber, 2256 2257 r = m.ifdef(i.textureTarget, e.TEXTURE_TARGET.VIEWER), 2258 2259 s = (n.dimensions.pageFit, o.viewPorts[a]), 2260 2261 l = n.viewer.getTextureSize(i), 2262 2263 u = null; 2264 2265 if (u = r === e.TEXTURE_TARGET.THUMB ? n.thumbSize : Math.floor(l.height), void 0 === o.getCache(a, u)) { 2266 2267 var h = l.height / s.height, 2268 2269 p = document.createElement("canvas"), 2270 2271 c = this.filterViewPort(t.getViewport({ 2272 2273 scale: h, 2274 2275 rotation: t._pageInfo.rotate + n.options.pageRotation 2276 2277 }), a); 2278 2279 r === e.TEXTURE_TARGET.THUMB && (h = c.width / c.height > 180 / n.thumbSize ? 180 * h / c.width : h * n.thumbSize / c.height, c = this.filterViewPort(t.getViewport({ 2280 2281 scale: h, 2282 2283 rotation: t._pageInfo.rotate + n.options.pageRotation 2284 2285 }), a)), p.height = Math.floor(c.height), p.width = Math.floor(c.width); 2286 2287 var d = Math.abs(p.width - l.width) / l.width * 100; 2288 2289 return d > .001 && d < 2 && (p.width = Math.floor(l.width), p.height = Math.floor(l.height)), n.viewer.filterViewPortCanvas(c, p, a), { 2290 2291 canvas: p, 2292 2293 canvasContext: p.getContext("2d", { 2294 2295 willReadFrequently: !0 === e.defaults.canvasWillReadFrequently 2296 2297 }), 2298 2299 viewport: c 2300 2301 } 2302 2303 } 2304 2305 } 2306 2307 }, { 2308 2309 key: "filterViewPort", 2310 2311 value: function (e, t) { 2312 2313 return e 2314 2315 } 2316 2317 }, { 2318 2319 key: "getViewPort", 2320 2321 value: function (e) { 2322 2323 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 2324 2325 i = this.app.provider.viewPorts[e]; 2326 2327 return t ? null != i ? i : this.app.provider.defaultPage.viewPort : i 2328 2329 } 2330 2331 }, { 2332 2333 key: "pagesReady", 2334 2335 value: function () { } 2336 2337 }, { 2338 2339 key: "onReady", 2340 2341 value: function () { } 2342 2343 }, { 2344 2345 key: "filterViewPortCanvas", 2346 2347 value: function (e) { } 2348 2349 }, { 2350 2351 key: "finalizeAnnotations", 2352 2353 value: function () { } 2354 2355 }, { 2356 2357 key: "finalizeTextContent", 2358 2359 value: function () { } 2360 2361 }, { 2362 2363 key: "updateTextContent", 2364 2365 value: function (e) { 2366 2367 null == e && (e = this.getBasePage(e)), this.app.provider.processTextContent(e, this.getTextElement(e, !0)) 2368 2369 } 2370 2371 }, { 2372 2373 key: "isActivePage", 2374 2375 value: function (e) { 2376 2377 return e === this.app.currentPageNumber 2378 2379 } 2380 2381 }, { 2382 2383 key: "initEvents", 2384 2385 value: function () { 2386 2387 var e = this, 2388 2389 t = e.stageDOM = m.ifdef(e.stageDOM, e.parentElement[0]); 2390 2391 if (t) { 2392 2393 var i = !1; 2394 2395 t.addEventListener("mousemove", e.events.mousemove = e.mouseMove.bind(e), !1), t.addEventListener("mousedown", e.events.mousedown = e.mouseDown.bind(e), !1), t.addEventListener("mouseup", e.events.mouseup = e.mouseUp.bind(e), !1), t.addEventListener("touchmove", e.events.mousemove = e.mouseMove.bind(e), i), t.addEventListener("touchstart", e.events.mousedown = e.mouseDown.bind(e), i), t.addEventListener("touchend", e.events.mouseup = e.mouseUp.bind(e), !1), t.addEventListener("dblclick", e.events.dblclick = e.dblclick.bind(e), !1), t.addEventListener("scroll", e.events.scroll = e.onScroll.bind(e), !1), t.addEventListener("mousewheel", e.events.mousewheel = e.mouseWheel.bind(e), i), t.addEventListener("DOMMouseScroll", e.events.mousewheel = e.mouseWheel.bind(e), !1) 2396 2397 } 2398 2399 this.startTouches = null, this.lastScale = null, this.startPoint = null 2400 2401 } 2402 2403 }, { 2404 2405 key: "refresh", 2406 2407 value: function () { } 2408 2409 }, { 2410 2411 key: "reset", 2412 2413 value: function () { } 2414 2415 }, { 2416 2417 key: "eventToPoint", 2418 2419 value: function (e) { 2420 2421 var t = { 2422 2423 x: e.clientX, 2424 2425 y: e.clientY 2426 2427 }; 2428 2429 return t.x = t.x - this.app.viewerContainer[0].getBoundingClientRect().left, t.y = t.y - this.app.viewerContainer[0].getBoundingClientRect().top, { 2430 2431 raw: t 2432 2433 } 2434 2435 } 2436 2437 }, { 2438 2439 key: "mouseMove", 2440 2441 value: function (e) { 2442 2443 e = m.fixMouseEvent(e), this.pinchMove(e), !0 === this.pinchZoomDirty && e.preventDefault(), this.startPoint && 1 != this.pinchZoomDirty && (this.pan(this.eventToPoint(e)), e.preventDefault()) 2444 2445 } 2446 2447 }, { 2448 2449 key: "mouseDown", 2450 2451 value: function (e) { 2452 2453 e = m.fixMouseEvent(e), this.pinchDown(e), this.startPoint = this.eventToPoint(e) 2454 2455 } 2456 2457 }, { 2458 2459 key: "mouseUp", 2460 2461 value: function (e) { 2462 2463 e = m.fixMouseEvent(e); 2464 2465 var t = this; 2466 2467 !0 === t.pinchZoomDirty && e.preventDefault(); 2468 2469 var i = t.eventToPoint(e), 2470 2471 n = e.target || e.originalTarget, 2472 2473 o = t.startPoint && i.x === t.startPoint.x && i.y === t.startPoint.y && "A" !== n.nodeName; 2474 2475 !0 === e.ctrlKey && o && this.zoomOnPoint(i), this.pinchUp(e), this.startPoint = null 2476 2477 } 2478 2479 }, { 2480 2481 key: "pinchDown", 2482 2483 value: function (e) { } 2484 2485 }, { 2486 2487 key: "pinchUp", 2488 2489 value: function (e) { } 2490 2491 }, { 2492 2493 key: "pinchMove", 2494 2495 value: function (e) { } 2496 2497 }, { 2498 2499 key: "updateTemporaryScale",
2500 2501 value: function () { 2502 2503 if (!0 === (arguments.length > 0 && void 0 !== arguments[0] && arguments[0])) this.parentElement[0].style.transform = "none"; 2504 2505 else if (this.app.viewer.zoomCenter) { 2506 2507 var e = this.app.viewer.pinchZoomUpdateScale; 2508 2509 this.parentElement[0].style.transformOrigin = this.app.viewer.zoomCenter.x + "px " + this.app.viewer.zoomCenter.y + "px", this.parentElement[0].style.transform = "scale3d(" + e + "," + e + ",1)" 2510 2511 } 2512 2513 } 2514 2515 }, { 2516 2517 key: "pan", 2518 2519 value: function (t) { 2520 2521 var i = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; 2522 2523 this.panRequestStatus = e.REQUEST_STATUS.ON, m.pan(this, t, i) 2524 2525 } 2526 2527 }, { 2528 2529 key: "updatePan", 2530 2531 value: function () { 2532 2533 this.element.css({ 2534 2535 transform: "translate3d(" + this.left + "px," + this.top + "px,0)" 2536 2537 }) 2538 2539 } 2540 2541 }, { 2542 2543 key: "dblclick", 2544 2545 value: function (e) { } 2546 2547 }, { 2548 2549 key: "onScroll", 2550 2551 value: function (e) { } 2552 2553 }, { 2554 2555 key: "mouseWheel", 2556 2557 value: function (t) { 2558 2559 var i = this.app, 2560 2561 n = m.getMouseDelta(t), 2562 2563 o = !0 === t.ctrlKey, 2564 2565 a = i.options.mouseScrollAction === e.MOUSE_SCROLL_ACTIONS.ZOOM; 2566 //a = i.options.mouseScrollAction === e.MOUSE_SCROLL_ACTIONS.ZOOM && (!0 === i.options.isLightBox || !0 === i.isFullscreen); 2567 2568 o || a ? (n > 0 || n < 0) && (t.preventDefault(), i.viewer.zoomCenter = this.eventToPoint(t).raw, i.zoom(n), i.ui.update()) : i.options.mouseScrollAction === e.MOUSE_SCROLL_ACTIONS.NAV && (n > 0 ? i.next() : n < 0 && i.prev()) 2569 2570 } 2571 2572 }, { 2573 2574 key: "zoomOnPoint", 2575 2576 value: function (e) { 2577 2578 this.app.viewer.zoomCenter = e.raw, this.app.zoom(1) 2579 2580 } 2581 2582 }, { 2583 2584 key: "getVisiblePages", 2585 2586 value: function () { 2587 2588 return this.visiblePagesCache = [], { 2589 2590 main: this.visiblePagesCache, 2591 2592 buffer: [] 2593 2594 } 2595 2596 } 2597 2598 }, { 2599 2600 key: "getBasePage", 2601 2602 value: function () { 2603 2604 return this.app.currentPageNumber 2605 2606 } 2607 2608 }, { 2609 2610 key: "isFirstPage", 2611 2612 value: function (e) { 2613 2614 return void 0 === e && (e = this.app.currentPageNumber), 1 === e 2615 2616 } 2617 2618 }, { 2619 2620 key: "isLastPage", 2621 2622 value: function (e) { 2623 2624 return void 0 === e && (e = this.app.currentPageNumber), e === this.app.pageCount 2625 2626 } 2627 2628 }, { 2629 2630 key: "isEdgePage", 2631 2632 value: function (e) { 2633 2634 return void 0 === e && (e = this.app.currentPageNumber), 1 === e || e === this.app.pageCount 2635 2636 } 2637 2638 }, { 2639 2640 key: "checkRequestQueue", 2641 2642 value: function () { 2643 2644 var t = e.REQUEST_STATUS; 2645 2646 this.panRequestStatus === t.ON && (this.updatePan(), this.panRequestStatus = t.OFF), this.app.viewer.pinchZoomRequestStatus === t.ON && (this.app.viewer.updateTemporaryScale(), this.app.viewer.pinchZoomRequestStatus = t.OFF) 2647 2648 } 2649 2650 }, { 2651 2652 key: "isAnimating", 2653 2654 value: function () { 2655 2656 return !1 2657 2658 } 2659 2660 }, { 2661 2662 key: "updatePendingStatusClass", 2663 2664 value: function (e) { 2665 2666 void 0 === e && (e = this.isAnimating()), this.app.container.toggleClass("pf-pending", e) 2667 2668 } 2669 2670 }, { 2671 2672 key: "initPages", 2673 2674 value: function () { } 2675 2676 }, { 2677 2678 key: "resize", 2679 2680 value: function () { } 2681 2682 }, { 2683 2684 key: "determinePageMode", 2685 2686 value: function () { } 2687 2688 }, { 2689 2690 key: "zoom", 2691 2692 value: function () { } 2693 2694 }, { 2695 2696 key: "gotoPageCallBack", 2697 2698 value: function () { 2699 2700 this.requestRefresh() 2701 2702 } 2703 2704 }, { 2705 2706 key: "requestRefresh", 2707 2708 value: function () { 2709 2710 var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; 2711 2712 this.app.refreshRequestStatus = !0 === e ? v.REQUEST_STATUS.ON : v.REQUEST_STATUS.OFF 2713 2714 } 2715 2716 }, { 2717 2718 key: "getPageByNumber", 2719 2720 value: function (e) { 2721 2722 var t = this.pages, 2723 2724 i = void 0; 2725 2726 if (this.app.isValidPage(e)) 2727 2728 for (var n = 0; n < t.length; n++) 2729 2730 if (e === t[n].pageNumber) { 2731 2732 i = t[n]; 2733 2734 break 2735 2736 } return i 2737 2738 } 2739 2740 }, { 2741 2742 key: "changeAnnotation", 2743 2744 value: function () { 2745 2746 return !1 2747 2748 } 2749 2750 }, { 2751 2752 key: "getAnnotationElement", 2753 2754 value: function (e) { 2755 2756 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 2757 2758 i = this.getPageByNumber(e); 2759 2760 if (void 0 !== i) return void 0 === i.annotationElement && (i.annotationElement = jQuery("<div class='pf-link-content'>"), i.contentLayer.append(i.annotationElement)), !0 === t && i.annotationElement.html(""), i.annotationElement[0] 2761 2762 } 2763 2764 }, { 2765 2766 key: "getTextElement", 2767 2768 value: function (e) { 2769 2770 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 2771 2772 i = this.getPageByNumber(e); 2773 2774 if (void 0 !== i) return void 0 === i.textElement && (i.textElement = jQuery("<div class='pf-text-content'>"), i.contentLayer.append(i.textElement)), !0 === t && (i.textElement.html(""), i.textElement.siblings(".pf-auto-link-content").html("")), i.textElement[0] 2775 2776 } 2777 2778 }, { 2779 2780 key: "render", 2781 2782 value: function () { } 2783 2784 }, { 2785 2786 key: "textureLoadedCallback", 2787 2788 value: function (e) { } 2789 2790 }, { 2791 2792 key: "handleZoom", 2793 2794 value: function () { } 2795 2796 }, { 2797 2798 key: "getTextureSize", 2799 2800 value: function (e) { 2801 2802 console.error("Texture calculation missing!") 2803 2804 } 2805 2806 }, { 2807 2808 key: "textureHeightLimit", 2809 2810 value: function (e) { 2811 2812 return m.limitAt(e, 1, this.app.dimensions.maxTextureHeight) 2813 2814 } 2815 2816 }, { 2817 2818 key: "textureWidthLimit", 2819 2820 value: function (e) { 2821 2822 return m.limitAt(e, 1, this.app.dimensions.maxTextureWidth) 2823 2824 } 2825 2826 }, { 2827 2828 key: "setPage", 2829 2830 value: function (e) { 2831 2832 m.log("Set Page detected", e.pageNumber); 2833 2834 var t = this.getPageByNumber(e.pageNumber); 2835 2836 return !!t && (e.callback = this.textureLoadedCallback.bind(this), t.loadTexture(e), this.updateBuffer(t), !0) 2837 2838 } 2839 2840 }, { 2841 2842 key: "cleanPage", 2843 2844 value: function (e) { 2845 2846 return !0 2847 2848 } 2849 2850 }, { 2851 2852 key: "validatePageChange", 2853 2854 value: function (e) { 2855 2856 return e !== this.app.currentPageNumber 2857 2858 } 2859 2860 }, { 2861 2862 key: "afterControlUpdate", 2863 2864 value: function () { } 2865 2866 }, { 2867 2868 key: "searchPage", 2869 2870 value: function (e) { 2871 2872 return { 2873 2874 include: !0, 2875 2876 label: this.app.provider.getLabelforPage(e) 2877 2878 } 2879 2880 } 2881 2882 }], n && g(i.prototype, n), o && g(i, o), Object.defineProperty(i, "prototype", { 2883 2884 writable: !1 2885 2886 }), t 2887 2888 }(); 2889 2890 2891 2892 function b(e, t) { 2893 2894 return b = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 2895 2896 return e.__proto__ = t, e 2897 2898 }, b(e, t) 2899 2900 } 2901 2902 2903 2904 function w(e) { 2905 2906 var t = function () { 2907 2908 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 2909 2910 if (Reflect.construct.sham) return !1; 2911 2912 if ("function" == typeof Proxy) return !0; 2913 2914 try { 2915 2916 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 2917 2918 } catch (e) { 2919 2920 return !1 2921 2922 } 2923 2924 }(); 2925 2926 return function () { 2927 2928 var i, n = P(e); 2929 2930 if (t) { 2931 2932 var o = P(this).constructor; 2933 2934 i = Reflect.construct(n, arguments, o) 2935 2936 } else i = n.apply(this, arguments); 2937 2938 return function (e, t) { 2939 2940 if (t && ("object" === S(t) || "function" == typeof t)) return t; 2941 2942 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 2943 2944 return function (e) { 2945 2946 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 2947 2948 return e 2949 2950 }(e) 2951 2952 }(this, i) 2953 2954 } 2955 2956 } 2957 2958 2959 2960 function P(e) { 2961 2962 return P = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 2963 2964 return e.__proto__ || Object.getPrototypeOf(e) 2965 2966 }, P(e) 2967 2968 } 2969 2970 2971 2972 function S(e) { 2973 2974 return S = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 2975 2976 return typeof e 2977 2978 } : function (e) { 2979 2980 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 2981 2982 }, S(e) 2983 2984 } 2985 2986 2987 2988 function C(e, t) { 2989 2990 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 2991 2992 } 2993 2994 2995 2996 function T(e, t) { 2997 2998 for (var i = 0; i < t.length; i++) { 2999 3000 var n = t[i]; 3001 3002 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 3003 3004 if ("object" !== S(e) || null === e) return e; 3005 3006 var i = e[Symbol.toPrimitive]; 3007 3008 if (void 0 !== i) { 3009 3010 var n = i.call(e, t || "default"); 3011 3012 if ("object" !== S(n)) return n; 3013 3014 throw new TypeError("@@toPrimitive must return a primitive value.") 3015 3016 } 3017 3018 return ("string" === t ? String : Number)(e) 3019 3020 }(o, "string"), "symbol" === S(a) ? a : String(a)), n) 3021 3022 } 3023 3024 var o, a 3025 3026 } 3027 3028 3029 3030 function x(e, t, i) { 3031 3032 return t && T(e.prototype, t), i && T(e, i), Object.defineProperty(e, "prototype", { 3033 3034 writable: !1 3035 3036 }), e 3037 3038 } 3039 3040 var k = e.utils, 3041 3042 E = function () { 3043 3044 function e() { 3045 3046 C(this, e), this.textureLoadFallback = "blank", this.textureStamp = "-1", this.textureLoaded = !1, this.texture = "blank", this.textureSrc = "blank", this.pageNumber = void 0, this.contentLayer = jQuery("<div>", { 3047 3048 class: "pf-page-content" 3049 3050 }) 3051 3052 } 3053 3054 return x(e, [{ 3055 3056 key: "reset", 3057 3058 value: function () { 3059 3060 this.resetTexture(), this.resetContent() 3061 3062 } 3063 3064 }, { 3065 3066 key: "resetTexture", 3067 3068 value: function () { 3069 3070 this.textureLoaded = !1, this.textureStamp = "-1", this.loadTexture({ 3071 3072 texture: this.textureLoadFallback 3073 3074 }), this.contentLayer.removeClass("pf-content-loaded") 3075 3076 } 3077 3078 }, { 3079 3080 key: "clearTexture", 3081 3082 value: function () { 3083 3084 this.loadTexture({ 3085 3086 texture: this.textureLoadFallback 3087 3088 }) 3089 3090 } 3091 3092 }, { 3093 3094 key: "resetContent", 3095 3096 value: function () { } 3097 3098 }, { 3099 3100 key: "loadTexture", 3101 3102 value: function (e) { } 3103 3104 }, { 3105 3106 key: "getTexture", 3107 3108 value: function () { 3109 3110 var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], 3111 3112 t = this.textureSrc; 3113 3114
3114return !0 === e && t && t.cloneNode && (t = t.cloneNode()).getContext && t.getContext("2d").drawImage(this.textureSrc, 0, 0), t 3115 3116 } 3117 3118 }, { 3119 3120 key: "setLoading", 3121 3122 value: function () { } 3123 3124 }, { 3125 3126 key: "updateTextureLoadStatus", 3127 3128 value: function (e) { 3129 3130 this.textureLoaded = !0 === e, k.log((!0 === this.textureLoaded ? "Loaded " : "Loading ") + this.textureStamp + " for " + this.pageNumber), this.contentLayer.toggleClass("pf-content-loaded", !0 === e), this.setLoading() 3131 3132 } 3133 3134 }, { 3135 3136 key: "changeTexture", 3137 3138 value: function (e, t) { 3139 3140 var i = this, 3141 3142 n = e + "|" + t; 3143 3144 return i.textureStamp !== n && (k.log("Page " + e + " : texture changed from - " + i.textureStamp + " to " + n), i.textureLoaded = !1, i.textureStamp = n, i.updateTextureLoadStatus(!1), !0) 3145 3146 } 3147 3148 }]), e 3149 3150 }(), 3151 3152 O = function (e) { 3153 3154 ! function (e, t) { 3155 3156 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 3157 3158 e.prototype = Object.create(t && t.prototype, { 3159 3160 constructor: { 3161 3162 value: e, 3163 3164 writable: !0, 3165 3166 configurable: !0 3167 3168 } 3169 3170 }), Object.defineProperty(e, "prototype", { 3171 3172 writable: !1 3173 3174 }), t && b(e, t) 3175 3176 }(i, e); 3177 3178 var t = w(i); 3179 3180 3181 3182 function i(e) { 3183 3184 var n; 3185 3186 return C(this, i), (n = t.call(this)).canvasMode = null, e && e.parentElement && (n.parentElement = e.parentElement), n.init(), n 3187 3188 } 3189 3190 return x(i, [{ 3191 3192 key: "init", 3193 3194 value: function () { 3195 3196 var e = this.element = jQuery("<div>", { 3197 3198 class: "pf-page" 3199 3200 }); 3201 3202 e[0].appendChild(this.contentLayer[0]), this.texture = new Image, this.parentElement && this.parentElement[0].append(e[0]) 3203 3204 } 3205 3206 }, { 3207 3208 key: "resetContent", 3209 3210 value: function () { 3211 3212 void 0 !== this.annotationElement && this.annotationElement.html(""), void 0 !== this.textElement && this.textElement.html("") 3213 3214 } 3215 3216 }, { 3217 3218 key: "setLoading", 3219 3220 value: function () { 3221 3222 this.element.toggleClass("pf-loading", !0 !== this.textureLoaded) 3223 3224 } 3225 3226 }, { 3227 3228 key: "loadTexture", 3229 3230 value: function (e) { 3231 3232 var t = this, 3233 3234 i = e.texture, 3235 3236 n = e.callback; 3237 3238 3239 3240 function o() { 3241 3242 t.textureSrc = i, t.element.css({ 3243 3244 backgroundImage: k.bgImage(i) 3245 3246 }), t.updateTextureLoadStatus(!0), "function" == typeof n && n(e) 3247 3248 } 3249 3250 null === t.canvasMode && i && "CANVAS" === i.nodeName && (t.canvasMode = !0), !0 === t.canvasMode ? (t.element.find(">canvas").remove(), i !== t.textureLoadFallback && (t.textureSrc = i, t.element.append(jQuery(i))), t.updateTextureLoadStatus(!0), "function" == typeof n && n(e)) : i === t.textureLoadFallback ? o() : (t.texture.onload = o, t.texture.src = i) 3251 3252 } 3253 3254 }, { 3255 3256 key: "updateCSS", 3257 3258 value: function (e) { 3259 3260 this.element.css(e) 3261 3262 } 3263 3264 }, { 3265 3266 key: "resetCSS", 3267 3268 value: function () { 3269 3270 this.element.css({ 3271 3272 transform: "", 3273 3274 boxShadow: "", 3275 3276 display: "block" 3277 3278 }) 3279 3280 } 3281 3282 }]), i 3283 3284 }(E); 3285 3286 3287 3288 function R(e) { 3289 3290 return R = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 3291 3292 return typeof e 3293 3294 } : function (e) { 3295 3296 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 3297 3298 }, R(e) 3299 3300 } 3301 3302 3303 3304 function L(e, t) { 3305 3306 for (var i = 0; i < t.length; i++) { 3307 3308 var n = t[i]; 3309 3310 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 3311 3312 if ("object" !== R(e) || null === e) return e; 3313 3314 var i = e[Symbol.toPrimitive]; 3315 3316 if (void 0 !== i) { 3317 3318 var n = i.call(e, t || "default"); 3319 3320 if ("object" !== R(n)) return n; 3321 3322 throw new TypeError("@@toPrimitive must return a primitive value.") 3323 3324 } 3325 3326 return ("string" === t ? String : Number)(e) 3327 3328 }(o, "string"), "symbol" === R(a) ? a : String(a)), n) 3329 3330 } 3331 3332 var o, a 3333 3334 } 3335 3336 3337 3338 function N() { 3339 3340 return N = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, i) { 3341 3342 var n = function (e, t) { 3343 3344 for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = M(e));); 3345 3346 return e 3347 3348 }(e, t); 3349 3350 if (n) { 3351 3352 var o = Object.getOwnPropertyDescriptor(n, t); 3353 3354 return o.get ? o.get.call(arguments.length < 3 ? e : i) : o.value 3355 3356 } 3357 3358 }, N.apply(this, arguments) 3359 3360 } 3361 3362 3363 3364 function I(e, t) { 3365
3366 return I = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 3367 3368 return e.__proto__ = t, e 3369 3370 }, I(e, t) 3371 3372 } 3373 3374 3375 3376 function _(e) { 3377 3378 var t = function () { 3379 3380 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 3381 3382 if (Reflect.construct.sham) return !1; 3383 3384 if ("function" == typeof Proxy) return !0; 3385 3386 try { 3387 3388 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 3389 3390 } catch (e) { 3391 3392 return !1 3393 3394 } 3395 3396 }(); 3397 3398 return function () { 3399 3400 var i, n = M(e); 3401 3402 if (t) { 3403 3404 var o = M(this).constructor; 3405 3406 i = Reflect.construct(n, arguments, o) 3407 3408 } else i = n.apply(this, arguments); 3409 3410 return function (e, t) { 3411 3412 if (t && ("object" === R(t) || "function" == typeof t)) return t; 3413 3414 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 3415 3416 return A(e) 3417 3418 }(this, i) 3419 3420 } 3421 3422 } 3423 3424 3425 3426 function A(e) { 3427 3428 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 3429 3430 return e 3431 3432 } 3433 3434 3435 3436 function M(e) { 3437 3438 return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 3439 3440 return e.__proto__ || Object.getPrototypeOf(e) 3441 3442 }, M(e) 3443 3444 } 3445 3446 var D = e.utils, 3447 3448 F = function (t) { 3449 3450 ! function (e, t) { 3451 3452 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 3453 3454 e.prototype = Object.create(t && t.prototype, { 3455 3456 constructor: { 3457 3458 value: e, 3459 3460 writable: !0, 3461 3462 configurable: !0 3463 3464 } 3465 3466 }), Object.defineProperty(e, "prototype", { 3467 3468 writable: !1 3469 3470 }), t && I(e, t) 3471 3472 }(r, t); 3473 3474 var i, n, o, a = _(r); 3475 3476 3477 3478 function r(t, i) { 3479 3480 var n; 3481 3482 return function (e, t) { 3483 3484 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 3485 3486 }(this, r), t.viewerClass = "pf-reader", i.options.mouseScrollAction = e.MOUSE_SCROLL_ACTIONS.NONE, (n = a.call(this, t, i)).app.jumpStep = 1, n.minZoom = .25, n.stackCount = n.app.pageCount, n.app.options.paddingLeft = 0, n.app.options.paddingRight = 0, n.app.options.paddingTop = 10, n.app.options.paddingBottom = !0 === n.app.options.controlsFloating ? 20 : 10, n.app.pageScaling = n.app.options.pageScale, n.acceptAppMouseEvents = !0, n.scrollStatus = e.REQUEST_STATUS.OFF, n.deltaPanX = 0, n.deltaPanY = 0, i._viewerPrepared(), n.zoomViewer = A(n), n 3487 3488 } 3489 3490 return i = r, n = [{ 3491 3492 key: "init", 3493 3494 value: function () { 3495 3496 N(M(r.prototype), "init", this).call(this), this.initEvents(), this.initPages(), this.initScrollBar() 3497 3498 } 3499 3500 }, { 3501 3502 key: "initEvents", 3503 3504 value: function () { 3505 3506 this.stageDOM = this.element[0], N(M(r.prototype), "initEvents", this).call(this) 3507 3508 } 3509 3510 }, { 3511 3512 key: "initPages", 3513 3514 value: function () { 3515 3516 this.stackCount = this.app.pageCount; 3517 3518 for (var e = 0; e < this.stackCount; e++) { 3519 3520 var t = new O({ 3521 3522 parentElement: this.wrapper 3523 3524 }); 3525 3526 t.index = e, t.viewer = this, this.pages.push(t) 3527 3528 } 3529 3530 } 3531 3532 }, { 3533 3534 key: "initScrollBar", 3535 3536 value: function () { 3537 3538 this.scrollBar = jQuery("<div class='pf-reader-scrollbar'>"), this.scrollBar.appendTo(this.app.container), this.scrollPageNumber = jQuery("<div class='pf-reader-scroll-page-number'>").appendTo(this.app.container) 3539 3540 } 3541 3542 }, { 3543 3544 key: "afterControlUpdate", 3545 3546 value: function () { 3547 3548 void 0 !== this.scrollBar && (this.scrollBar[0].innerHTML = this.app.getCurrentLabel(), this.app.provider.pageLabels ? this.scrollPageNumber[0].innerHTML = this.app.getCurrentLabel() + "<div>(" + this.app.currentPageNumber + " of " + this.app.pageCount + ")</div>" : this.scrollPageNumber[0].innerHTML = this.app.getCurrentLabel() + "<div>of " + this.app.pageCount + "</div>") 3549 3550 } 3551 3552 }, { 3553 3554 key: "updateBuffer", 3555 3556 value: function (e) { 3557 3558 if ("-1" !== e.textureStamp && void 0 !== e.pageNumber) { 3559 3560 for (var t = e.pageNumber, i = e.pageNumber, n = 0, o = 0; o < this.pageBuffer.length; o++) { 3561 3562 var a = this.pageBuffer[o].pageNumber; 3563 3564 if (t === a) return void D.log("Page " + t + " already in buffer, skipping"); 3565 3566 Math.abs(this.app.currentPageNumber - a) > Math.abs(this.app.currentPageNumber - i) && (i = a, n = o) 3567 3568 } 3569 3570 this.pageBuffer.push(e), this.pageBuffer.length > this.pageBufferSize && (D.log("Farthest buffer: " + i), this.pageBuffer[n].reset(), this.pageBuffer.splice(n, 1)) 3571 3572 } 3573 3574 } 3575 3576 }, { 3577 3578 key: "initCustomControls", 3579 3580 value: function () { 3581 3582 var e = this.app.ui.controls; 3583 3584 e.openRight.hide(), e.openLeft.hide() 3585 3586 } 3587 3588 }, { 3589 3590 key: "dispose", 3591 3592 value: function () { 3593 3594 N(M(r.prototype), "dispose", this).call(this), this.scrollBar && this.scrollBar.remove(), this.scrollPageNumber && this.scrollPageNumber.remove(), this.element.remove() 3595 3596 } 3597 3598 }, { 3599 3600 key: "_getInnerHeight", 3601 3602 value: function () { 3603 3604 N(M(r.prototype), "_getInnerHeight", this).call(this); 3605 3606 var t = this.app.dimensions.maxHeight - this.app.dimensions.padding.height, 3607 3608 i = this.app.dimensions.defaultPage.viewPort, 3609 3610 n = this.app.dimensions.containerWidth - 20 - this.app.dimensions.padding.width; 3611 3612 this.app.pageScaling === e.PAGE_SCALE.ACTUAL && (n = 1 * this.app.provider.defaultPage.viewPort.width); 3613 3614 var o = t; 3615 3616 return this.app.pageScaling === e.PAGE_SCALE.PAGE_WIDTH ? o = 100 * i.height : this.app.pageScaling === e.PAGE_SCALE.AUTO ? o = 1.5 * i.height : this.app.pageScaling === e.PAGE_SCALE.ACTUAL && (o = 1 * i.height), o -= 2, this._containCover = D.contain(i.width, i.height, n, o), o = Math.min(t, this._containCover.height + 2), this.app.pageScaleValue = this._containCover.height / i.height, this.app.dimensions.isFixedHeight ? t : o 3617 3618 } 3619 3620 }, { 3621 3622 key: "handleZoom", 3623 3624 value: function () { 3625 3626 var e = this.app, 3627 3628 t = this.maxZoom = 4, 3629 3630 i = e.zoomValue; 3631 3632 !0 === e.pendingZoom && null != e.zoomDelta ? i = e.zoomDelta > 0 ? i * e.options.zoomRatio : i / e.options.zoomRatio : null != this.lastScale && (i *= this.lastScale, this.lastScale = null), i = D.limitAt(i, this.minZoom, t), e.zoomValueChange = i / e.zoomValue, e.zoomChanged = e.zoomValue !== i, e.zoomValue = i 3633 3634 } 3635 3636 }, { 3637 3638 key: "resize", 3639 3640 value: function () { 3641 3642 var e = this, 3643 3644 t = e.app, 3645 3646 i = (t.dimensions, t.dimensions.padding), 3647 3648 n = this.shiftHeight = 0; 3649 3650 this.element.css({ 3651 3652 top: -n, 3653 3654 bottom: -n, 3655 3656 right: -0, 3657 3658 left: -0, 3659 3660 paddingTop: i.top, 3661 3662 paddingRight: i.right, 3663 3664 paddingBottom: i.bottom, 3665 3666 paddingLeft: i.left 3667 3668 }); 3669 3670 for (var o = e.getVisiblePages().main[0] - 1, a = (o = e.pages[o].element[0]).getBoundingClientRect(), r = this.parentElement[0].getBoundingClientRect(), s = 0; s < e.pages.length; s++) { 3671 3672 var l = e.pages[s], 3673 3674 u = e.getViewPort(s + 1, !0), 3675 3676 h = l.element[0].style; 3677 3678 h.height = Math.floor(u.height * t.pageScaleValue * t.zoomValue) + "px", h.width = Math.floor(u.width * t.pageScaleValue * t.zoomValue) + "px" 3679 3680 } 3681 3682 if (e.oldScrollHeight != e.element[0].scrollHeight && void 0 !== e.oldScrollHeight) { 3683 3684 var p, c = e.element[0].scrollHeight / e.oldScrollHeight; 3685 3686 e.skipScrollCheck = !0; 3687 3688 var d = o.offsetTop + o.clientTop - (a.top - r.top + o.
3688clientTop) * c, 3689 3690 f = o.offsetLeft + o.clientLeft - (a.left - r.left + o.clientLeft) * c; 3691 3692 d += 10 * (c - 1) / 2, f += 10 * (c - 1) / 2, this.zoomCenter = null !== (p = this.zoomCenter) && void 0 !== p ? p : { 3693 3694 x: 0, 3695 3696 y: 0 3697 3698 }, d += (c - 1) * this.zoomCenter.y, f += (c - 1) * this.zoomCenter.x, this.zoomCenter = null, e.element[0].scrollTop = d, e.element[0].scrollLeft = f, e.skipScrollCheck = !1 3699 3700 } 3701 3702 e.oldScrollHeight = e.element[0].scrollHeight, this.scrollBar[0].style.transform = "none", this.updateScrollBar() 3703 3704 } 3705 3706 }, { 3707 3708 key: "onReady", 3709 3710 value: function () { 3711 3712 this.gotoPageCallBack(), this.oldScrollHeight = this.element[0].scrollHeight 3713 3714 } 3715 3716 }, { 3717 3718 key: "refresh", 3719 3720 value: function () { 3721 3722 for (var t = this, i = this.app, n = t.getVisiblePages().main, o = 0; o < n.length; o++) { 3723 3724 var a = void 0, 3725 3726 r = n[o]; 3727 3728 r !== (a = t.pages[r - 1]).pageNumber && (a.resetTexture(), this.app.textureRequestStatus = e.REQUEST_STATUS.ON), a.element.attr("number", r), a.pageNumber = r 3729 3730 } 3731 3732 t.requestRefresh(!1), i.textureRequestStatus = e.REQUEST_STATUS.ON 3733 3734 } 3735 3736 }, { 3737 3738 key: "isAnimating", 3739 3740 value: function () { 3741 3742 return this.scrollStatus === e.REQUEST_STATUS.ON || this.scrollStatus === e.REQUEST_STATUS.COUNT 3743 3744 } 3745 3746 }, { 3747 3748 key: "checkRequestQueue", 3749 3750 value: function () { 3751 3752 N(M(r.prototype), "checkRequestQueue", this).call(this), this.scrollStatus === e.REQUEST_STATUS.ON && (this.scrollStatus = e.REQUEST_STATUS.OFF), this.scrollStatus === e.REQUEST_STATUS.COUNT && (this.scrollStatus = e.REQUEST_STATUS.ON) 3753 3754 } 3755 3756 }, { 3757 3758 key: "isActivePage", 3759 3760 value: function (e) { 3761 3762 return void 0 !== this.visiblePagesCache && this.visiblePagesCache.includes(e) 3763 3764 } 3765 3766 }, { 3767 3768 key: "getVisiblePages", 3769 3770 value: function () { 3771 3772 var e = D.getVisibleElements({ 3773 3774 container: this.element[0], 3775 3776 elements: this.wrapper[0].children 3777 3778 }); 3779 3780 return e = 0 === e.length ? [this.app.currentPageNumber] : e.splice(0, this.pageBufferSize), this.visiblePagesCache = e, { 3781 3782 main: e, 3783 3784 buffer: [] 3785 3786 } 3787 3788 } 3789 3790 }, { 3791 3792 key: "getPageByNumber", 3793 3794 value: function (e) { 3795 3796 var t = this.pages[e - 1]; 3797 3798 return void 0 === t && D.log("Page Not found for: " + e), t 3799 3800 } 3801 3802 }, { 3803 3804 key: "onScroll", 3805 3806 value: function (t) { 3807 3808 for (var i = this, n = i.element[0].scrollTop + i.app.dimensions.containerHeight / 2, o = i.getVisiblePages().main, a = o[0], r = 0; r < o.length; r++) { 3809 3810 a = o[r]; 3811 3812 var s = i.pages[a - 1].element[0], 3813 3814 l = s.offsetTop + s.clientTop; 3815 3816 if (l <= n && s.clientHeight + l >= n) break; 3817 3818 if (r > 0 && l > n && s.clientHeight + l >= n) { 3819 3820 a = o[r - 1];
3821 3822 break 3823 3824 } 3825 3826 } 3827 3828 i.skipScrollIntoView = !0, i.app.gotoPage(a), i.skipScrollIntoView = !1, i.updateScrollBar(), t.preventDefault && t.preventDefault(), t.stopPropagation(), i.requestRefresh(), this.scrollStatus = e.REQUEST_STATUS.COUNT, e.handlePopup(i.element, !1) 3829 3830 } 3831 3832 }, { 3833 3834 key: "updateScrollBar", 3835 3836 value: function () { 3837 3838 var e = this.element[0], 3839 3840 t = (this.app.container[0], e.scrollLeft, 60 + (e.offsetHeight - 40 - 60 - 60) * e.scrollTop / (e.scrollHeight - e.offsetHeight)); 3841 3842 isNaN(t) && (t = 60), this.scrollBar.lastY = t, this.scrollBar[0].style.transform = "translateY(" + t + "px)" 3843 3844 } 3845 3846 }, { 3847 3848 key: "validatePageChange", 3849 3850 value: function (e) { } 3851 3852 }, { 3853 3854 key: "gotoPageCallBack", 3855 3856 value: function () { 3857 3858 var e = this; 3859 3860 if (!0 !== e.skipScrollIntoView) { 3861 3862 var t = e.getPageByNumber(e.app.currentPageNumber); 3863 3864 null != t && D.scrollIntoView(t.element[0], e.element[0]) 3865 3866 } 3867 3868 e.skipScrollIntoView = !1, e.requestRefresh() 3869 3870 } 3871 3872 }, { 3873 3874 key: "getTextureSize", 3875 3876 value: function (e) { 3877 3878 var t = this.app.provider.viewPorts[1]; 3879 3880 this.app.provider.viewPorts[e.pageNumber] && (t = this.app.provider.viewPorts[e.pageNumber]); 3881 3882 var i = this.app.options.pixelRatio; 3883 3884 return { 3885 3886 height: t.height * this.app.zoomValue * this.app.pageScaleValue * i, 3887 3888 width: t.width * this.app.zoomValue * this.app.pageScaleValue * i 3889 3890 } 3891 3892 } 3893 3894 }, { 3895 3896 key: "textureLoadedCallback", 3897 3898 value: function (e) { 3899 3900 var t = this.getPageByNumber(e.pageNumber), 3901 3902 i = this.app, 3903 3904 n = this.getViewPort(e.pageNumber, !0); 3905 3906 t.element.height(Math.floor(n.height * i.pageScaleValue * i.zoomValue)).width(Math.floor(n.width * i.pageScaleValue * i.zoomValue)) 3907 3908 } 3909 3910 }, { 3911 3912 key: "pan", 3913 3914 value: function (t) { 3915 3916 var i = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 3917 3918 n = this, 3919 3920 o = n.startPoint, 3921 3922 a = t.raw.y - o.raw.y, 3923 3924 r = t.raw.x - o.raw.x; 3925 3926 n.deltaPanY += a, n.deltaPanX += r, n.panRequestStatus = e.REQUEST_STATUS.ON, !1 === i && (n.startPoint = t) 3927 3928 } 3929 3930 }, { 3931 3932 key: "updatePan", 3933 3934 value: function () { 3935 3936 this.element[0].scrollTop = this.element[0].scrollTop - this.deltaPanY, this.element[0].scrollLeft = this.element[0].scrollLeft - this.deltaPanX, this.deltaPanY = 0, this.deltaPanX = 0 3937 3938 } 3939 3940 }, { 3941 3942 key: "mouseMove", 3943 3944 value: function (e) { 3945 3946 if (this.startPoint && this.isScrollBarPressed) { 3947 3948 var t = D.fixMouseEvent(e), 3949 3950 i = this.eventToPoint(t), 3951 3952 n = this.element[0], 3953 3954 o = this.scrollBar.lastY - (this.startPoint.raw.y - i.raw.y); 3955 3956 return this.scrollBar.lastY = o, n.scrollTop = (o - 60) * (n.scrollHeight - n.offsetHeight) / (n.offsetHeight - 40 - 60 - 60), this.startPoint = i, void e.preventDefault() 3957 3958 } 3959 3960 e.touches && e.touches.length < 2 || N(M(r.prototype), "mouseMove", this).call(this, e) 3961 3962 } 3963 3964 }, { 3965 3966 key: "mouseDown", 3967 3968 value: function (e) { 3969 3970 N(M(r.prototype), "mouseDown", this).call(this, e), e.srcElement === this.scrollBar[0] && (this.isScrollBarPressed = !0, this.scrollBar.addClass("pf-active"), this.scrollPageNumber.addClass("pf-active")) 3971 3972 } 3973 3974 }, { 3975 3976 key: "mouseUp", 3977 3978 value: function (e) { 3979 3980 N(M(r.prototype), "mouseUp", this).call(this, e), (this.isScrollBarPressed = this.scrollBar) && (this.isScrollBarPressed = !1, this.scrollBar.removeClass("pf-active"), this.scrollPageNumber.removeClass("pf-active")) 3981 3982 } 3983 3984 }], n && L(i.prototype, n), o && L(i, o), Object.defineProperty(i, "prototype", { 3985 3986 writable: !1 3987 3988 }), r 3989 3990 }(y); 3991 3992 3993 3994 function z(e) { 3995 3996 return z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 3997 3998 return typeof e 3999 4000 } : function (e) { 4001 4002 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 4003 4004 }, z(e) 4005 4006 } 4007 4008 4009 4010 function B(e, t) { 4011 4012 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 4013 4014 } 4015 4016 4017 4018 function H(e, t) { 4019 4020 for (var i = 0; i < t.length; i++) { 4021 4022 var n = t[i]; 4023 4024 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 4025 4026 if ("object" !== z(e) || null === e) return e; 4027 4028 var i = e[Symbol.toPrimitive]; 4029 4030 if (void 0 !== i) { 4031 4032 var n = i.call(e, t || "default"); 4033 4034 if ("object" !== z(n)) return n; 4035 4036 throw new TypeError("@@toPrimitive must return a primitive value.") 4037 4038 } 4039 4040 return ("string" === t ? String : Number)(e) 4041 4042 }(o, "string"), "symbol" === z(a) ? a : String(a)), n) 4043 4044 } 4045 4046 var o, a 4047 4048 } 4049 4050 4051 4052 function U(e, t, i) { 4053 4054 return t && H(e.prototype, t), i && H(e, i), Object.defineProperty(e, "prototype", { 4055 4056 writable: !1 4057 4058 }), e 4059 4060 } 4061 4062 4063 4064 function j() { 4065 4066 return j = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, i) { 4067 4068 var n = function (e, t) { 4069 4070 for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = q(e));); 4071 4072 return e 4073 4074 }(e, t); 4075 4076 if (n) { 4077 4078 var o = Object.getOwnPropertyDescriptor(n, t); 4079 4080 return o.get ? o.get.call(arguments.length < 3 ? e : i) : o.value 4081 4082 } 4083 4084 }, j.apply(this, arguments) 4085 4086 } 4087 4088 4089 4090 function V(e, t) { 4091 4092 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 4093 4094 e.prototype = Object.create(t && t.prototype, { 4095 4096 constructor: { 4097 4098 value: e, 4099 4100 writable: !0, 4101 4102 configurable: !0 4103 4104 } 4105 4106 }), Object.defineProperty(e, "prototype", { 4107 4108 writable: !1 4109 4110 }), t && W(e, t) 4111 4112 } 4113 4114 4115 4116 function W(e, t) { 4117 4118 return W = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 4119 4120 return e.__proto__ = t, e 4121 4122 }, W(e, t) 4123 4124 } 4125 4126 4127 4128 function G(e) { 4129 4130 var t = function () { 4131 4132 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 4133 4134 if (Reflect.construct.sham) return !1; 4135 4136 if ("function" == typeof Proxy) return !0; 4137 4138 try { 4139 4140 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 4141 4142 } catch (e) { 4143 4144 return !1 4145 4146 } 4147 4148 }(); 4149 4150 return function () { 4151 4152 var i, n = q(e); 4153 4154 if (t) { 4155 4156 var o = q(this).constructor; 4157 4158 i = Reflect.construct(n, arguments, o) 4159 4160 } else i = n.apply(this, arguments); 4161 4162 return function (e, t) { 4163 4164 if (t && ("object" === z(t) || "function" == typeof t)) return t; 4165 4166 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 4167 4168 return function (e) { 4169 4170 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 4171 4172 return e 4173 4174 }(e) 4175 4176 }(this, i) 4177 4178 } 4179 4180 } 4181 4182 4183 4184 function q(e) { 4185 4186 return q = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 4187 4188 return e.__proto__ || Object.getPrototypeOf(e) 4189 4190 }, q(e) 4191 4192 } 4193 4194 var Z = e.utils, 4195 4196 K = function (t) { 4197 4198 V(n, t); 4199 4200 var i = G(n); 4201 4202 4203 4204 function n(t, o) { 4205 4206 var a, r; 4207 4208 return B(this, n), t.viewerClass = "pf-flipbook " + (t.viewerClass || ""), (r = i.call(this, t, o)).isFlipBook = !0, r.sheets = [], r.isRTL = r.app.isRTL, r.foldSense = 50, r.isOneSided = !1, r.stackCount = null !== (a = t.stackCount) && void 0 !== a ? a : 6, r.annotedPage = null, r.pendingAnnotations = [], r.seamPosition = 0, r.dragSheet = null, r.drag = null, r.soundOn = !0 === t.enableSound, r.soundFile = null, r.minZoom = 1, r.maxZoom = 4, r.app.options.pageSize !== e.FLIPBOOK_PAGE_SIZE.AUTO && r.app.options.pageSize !== e.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL || (r.app.checkSecondPage = !0), r.app.pageScaling = e.PAGE_SCALE.PAGE_FIT, t.viewerClass = "", r.zoomViewer = new Q(t, o), r 4209 4210 } 4211 4212 return U(n, [{ 4213 4214 key: "init", 4215 4216 value: function () { 4217 4218 j(q(n.prototype), "init", this).call(this), this.initSound(); 4219 4220 var t = this.app; 4221 4222 this.pageMode = t.options.pageMode === e.FLIPBOOK_PAGE_MODE.AUTO ? Z.isMobile || t.pageCount <= 2 ? e.FLIPBOOK_PAGE_MODE.SINGLE : e.FLIPBOOK_PAGE_MODE.DOUBLE : t.options.pageMode, this.singlePageMode = t.options.singlePageMode || (Z.isMobile ? e.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET : e.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM), this.updatePageMode(), this.rightSheetHeight = this.leftSheetHeight = this._defaultPageSize.height, this.leftSheetWidth = this.rightSheetWidth = this._defaultPageSize.width, this.leftSheetTop = this.rightSheetTop = (this.availablePageHeight() - this._defaultPageSize.height) / 2, this.zoomViewer.rightSheetHeight = this.zoomViewer.leftSheetHeight = this._defaultPageSize.height, this.zoomViewer.leftSheetWidth = this.zoomViewer.rightSheetWidth = this._defaultPageSize.width 4223 4224 } 4225 4226 }, { 4227 4228 key: "determineHeight", 4229 4230 value: function () { } 4231 4232 }, { 4233 4234 key: "initCustomControls", 4235 4236 value: function () { 4237 4238 j(q(n.prototype), "initCustomControls", this).call(this); 4239 4240 var e = this, 4241 4242 t = this.app, 4243 4244 i = t.ui, 4245 4246 o = i.controls, 4247 4248 a = t.options.text, 4249 4250 r = t.options.icons; 4251 4252 o.sound = Z.createBtn("sound", r.sound, a.toggleSound).on("click", (function () { 4253 4254 e.soundOn = !e.soundOn, i.updateSound() 4255 4256 })), i.updateSound = function () { 4257 4258 !1 === e.soundOn ? o.sound.addClass("disabled") : o.sound.removeClass("disabled") 4259 4260 }, i.updateSound() 4261 4262 } 4263 4264 }, { 4265 4266 key: "dispose", 4267 4268 value: function () { 4269 4270 j(q(n.prototype), "dispose", this).call(this); 4271 4272 for (var e = 0; e < this.sheets.length; e++) { 4273 4274 var t = this.sheets[e]; 4275 4276 t && t.currentTween && (t.currentTween.stop(), t.currentTween = null) 4277 4278 } 4279 4280 this.zoomViewer.dispose(), this.soundFile = null 4281 4282 } 4283 4284 }, { 4285 4286 key: "determinePageMode", 4287 4288 value: function () { 4289 4290 var t = this.app, 4291 4292 i = this.pageMode; 4293 4294 if (this.app.pageCount < 3) this.pageMode = e.FLIPBOOK_PAGE_MODE.SINGLE; 4295 4296 else if (this.app.options.pageMode === e.FLIPBOOK_PAGE_MODE.AUTO && 1 != this.pageModeChangedManually) { 4297 4298 if (!0 === Z.isMobile) 4299 4300 if (this.app.dimensions.isAutoHeight && 0 == this.app.dimensions.isFixedHeight) { 4301 4302 var n = this._calculateInnerHeight(!0), 4303 4304 o = t.dimensions.stage.innerWidth + (1 != t.options.sideMenuOverlay && t.isSideMenuOpen ? 220 : 0); 4305 4306 this.pageMode = n > 1.1 * o && o < 768 ? e.FLIPBOOK_PAGE_MODE.SINGLE : e.FLIPBOOK_PAGE_MODE.DOUBLE, this._calculateInnerHeight() 4307 4308 } else { 4309 4310 var a = t.dimensions.stage.innerWidth + (1 != t.options.sideMenuOverlay && t.isSideMenuOpen ? 220 : 0); 4311 4312 this.pageMode = t.dimensions.stage.innerHe
4312ight > 1.1 * a && a < 768 ? e.FLIPBOOK_PAGE_MODE.SINGLE : e.FLIPBOOK_PAGE_MODE.DOUBLE 4313 4314 } this.pageMode != i && this.setPageMode({ 4315 4316 isSingle: this.pageMode == e.FLIPBOOK_PAGE_MODE.SINGLE 4317 4318 }) 4319 4320 } 4321 4322 } 4323 4324 }, { 4325 4326 key: "initSound", 4327 4328 value: function () { 4329 4330 this.soundFile = document.createElement("audio"), this.soundFile.setAttribute("src", this.app.options.soundFile + "?ver=" + e.version), this.soundFile.setAttribute("type", "audio/mpeg") 4331 4332 } 4333 4334 }, { 4335 4336 key: "playSound", 4337 4338 value: function () { 4339 4340 var e = this; 4341 4342 try { 4343 4344 !0 === e.app.userHasInteracted && !0 === e.soundOn && (e.soundFile.currentTime = 0, e.soundFile.play()) 4345 4346 } catch (e) { } 4347 4348 } 4349 4350 }, { 4351 4352 key: "checkDocumentPageSizes", 4353 4354 value: function () { 4355 4356 var t = this.app.provider; 4357 4358 t.pageSize === e.FLIPBOOK_PAGE_SIZE.AUTO && (t._page2Ratio && t._page2Ratio > 1.5 * t.defaultPage.pageRatio ? t.pageSize = e.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL : t.pageSize = e.FLIPBOOK_PAGE_SIZE.SINGLE), t.pageSize === e.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL && (t.pageCount = 1 === t.numPages ? 1 : 2 * t.numPages - 2), t.pageSize !== e.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK && t.pageSize !== e.FLIPBOOK_PAGE_SIZE.DOUBLE || (t.pageCount = 2 * t.numPages) 4359 4360 } 4361 4362 }, { 4363 4364 key: "getViewerPageNumber", 4365 4366 value: function (t) { 4367 4368 return this.app.provider.pageSize === e.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL && t > 2 && (t = 2 * t - 1), this.app.provider.pageSize === e.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK && t > 2 && (t = 2 * t - 1), t 4369 4370 } 4371 4372 }, { 4373 4374 key: "getDocumentPageNumber", 4375 4376 value: function (t) { 4377 4378 return this.app.provider.pageSize === e.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL && t > 2 ? Math.ceil((t - 1) / 2) + 1 : this.app.provider.pageSize === e.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK && t > 1 ? t === this.app.pageCount ? 1 : Math.ceil((t - 1) / 2) + 1 : t 4379 4380 } 4381 4382 }, { 4383 4384 key: "getViewPort", 4385 4386 value: function (e) { 4387 4388 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 4389 4390 i = arguments.length > 2 ? arguments[2] : void 0; 4391 4392 return this.filterViewPort(j(q(n.prototype), "getViewPort", this).call(this, e, t), e, i) 4393 4394 } 4395 4396 }, { 4397 4398 key: "isDoubleInternal", 4399 4400 value: function () { 4401 4402 return this.app.provider.pageSize === e.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL 4403 4404 } 4405 4406 }, { 4407 4408 key: "isDoubleCoverBack", 4409 4410 value: function () { 4411 4412 return this.app.provider.pageSize === e.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK 4413 4414 } 4415 4416 }, { 4417 4418 key: "isDoubleInternalPage", 4419 4420 value: function (e) { 4421 4422 return this.isDoubleInternal() && e > 1 && e < this.app.provider.pageCount 4423 4424 } 4425 4426 }, { 4427 4428 key: "getDoublePageWidthFix", 4429 4430 value: function (e) { 4431 4432 return this.isDoubleInternalPage(e) || this.isDoubleCoverBack() ? 2 : 1 4433 4434 } 4435 4436 }, { 4437 4438 key: "isDoublePageFix", 4439 4440 value: function (e) { 4441 4442 var t = !1; 4443 4444 return (this.isDoubleCoverBack() || this.isDoubleInternalPage(e)) && (this.app.isRTL ? e % 2 == 0 && (t = !0) : e % 2 == 1 && (t = !0)), t 4445 4446 } 4447 4448 }, { 4449 4450 key: "finalizeAnnotations", 4451 4452 value: function (e, t) { } 4453 4454 }, { 4455 4456 key: "finalizeTextContent", 4457 4458 value: function (e, t) { } 4459 4460 }, { 4461 4462 key: "isActivePage", 4463 4464 value: function (e) { 4465 4466 return void 0 !== this.visiblePagesCache && this.visiblePagesCache.includes(e) 4467 4468 } 4469 4470 }, { 4471 4472 key: "isSheetCover", 4473 4474 value: function (e) { 4475 4476 var t = this.isBooklet; 4477 4478 return 0 === e || t && 1 === e || e === Math.ceil(this.app.pageCount / (t ? 1 : 2)) - (t ? 0 : 1) 4479 4480 } 4481 4482 }, { 4483 4484 key: "isSheetHard", 4485 4486 value: function (e) { 4487 4488 var t = this.app.options.flipbookHardPages;
4489 4490 this.isBooklet; 4491 4492 if ("cover" === t) return this.isSheetCover(e); 4493 4494 if ("all" === t) return !0; 4495 4496 var i = ("," + t + ",").indexOf("," + (2 * e + 1) + ",") > -1, 4497 4498 n = ("," + t + ",").indexOf("," + (2 * e + 2) + ",") > -1; 4499 4500 return i || n 4501 4502 } 4503 4504 }, { 4505 4506 key: "sheetsIndexShift", 4507 4508 value: function (e, t, i) { 4509 4510 e > t ? (this.sheets[i - 1].skipFlip = !0, this.sheets.unshift(this.sheets.pop())) : e < t && (this.sheets[0].skipFlip = !0, this.sheets.push(this.sheets.shift())) 4511 4512 } 4513 4514 }, { 4515 4516 key: "checkSwipe", 4517 4518 value: function (e, t) { 4519 4520 var i = this; 4521 4522 if (!0 !== i.pinchZoomDirty && 1 === i.app.zoomValue && !0 === i.canSwipe) { 4523 4524 var n = "vertical" == i.orientation ? e.y - i.lastPosY : e.x - i.lastPosX; 4525 4526 Math.abs(n) > i.swipeThreshold && (n < 0 ? i.app.openRight() : i.app.openLeft(), i.canSwipe = !1, t.preventDefault()), i.lastPosX = e.x, i.lastPosY = e.y 4527 4528 } 4529 4530 } 4531 4532 }, { 4533 4534 key: "checkCenter", 4535 4536 value: function () { 4537 4538 var t, i = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], 4539 4540 n = this, 4541 4542 o = this.app, 4543 4544 a = e.FLIPBOOK_CENTER_SHIFT, 4545 4546 r = o.currentPageNumber % 2 == 0, 4547 4548 s = n.getBasePage(), 4549 4550 l = n.isRTL, 4551 4552 u = n.isSingle; 4553 4554 t = 0 === s || n.isBooklet ? n.isRTL ? a.RIGHT : a.LEFT : s === o.pageCount ? l ? a.LEFT : a.RIGHT : u ? l ? r ? a.LEFT : a.RIGHT : r ? a.RIGHT : a.LEFT : a.NONE, !0 !== n.centerNeedsUpdate && (n.centerNeedsUpdate = n.centerShift !== t), n.centerNeedsUpdate && (n.centerShift = t, n.updateCenter(i), n.centerNeedsUpdate = !1) 4555 4556 } 4557 4558 }, { 4559 4560 key: "updateCenter", 4561 4562 value: function () { 4563 4564 console.log("UpdateCenter: missing implementation.") 4565 4566 } 4567 4568 }, { 4569 4570 key: "reset", 4571 4572 value: function () { 4573 4574 for (var e, t = 0; t < this.sheets.length; t++)(e = this.sheets[t]).reset(), e.pageNumber = -1, e.frontPage && (e.frontPage.pageNumber = -1), e.backPage && (e.backPage.pageNumber = -1), e.resetTexture(); 4575 4576 this.annotedPage = null, this.oldBasePageNumber = -1, this.centerShift = null, this.refresh() 4577 4578 } 4579 4580 }, { 4581 4582 key: "handleZoom", 4583 4584 value: function () { 4585 4586 var e = this.app, 4587 4588 t = (e.dimensions, this.getLeftPageTextureSize({ 4589 4590 zoom: !1, 4591 4592 isAnnotation: !0 4593 4594 })), 4595 4596 i = this.getRightPageTextureSize({ 4597 4598 zoom: !1, 4599 4600 isAnnotation: !0 4601 4602 }), 4603 4604 n = (this.maxZoom, e.zoomValue, this.maxZoom = e.dimensions.maxTextureSize / Math.max(t.height, t.width, i.height, i.width)), 4605 4606 o = e.zoomValue, 4607 4608 a = !1, 4609 4610 r = !1; 4611 4612 (n < this.minZoom && (n = this.maxZoom = this.minZoom), !0 === e.pendingZoom && null != e.zoomDelta) ? o = e.zoomDelta > 0 ? o * e.options.zoomRatio : o / e.options.zoomRatio : null != this.lastScale && (o *= this.lastScale, this.lastScale = null); 4613 4614 o = Z.limitAt(o, this.minZoom, n), e.zoomValueChange = o / e.zoomValue, !(e.zoomChanged = e.zoomValue !== o) || 1 !== o && 1 !== e.zoomValue || (a = 1 === o, r = 1 === e.zoomValue), e.zoomValue = o, (r || a) && (e.container.toggleClass("pf-zoom-active", 1 !== o), r && this.enterZoom(), a && this.exitZoom()) 4615 4616 } 4617 4618 }, { 4619 4620 key: "refresh", 4621 4622 value: function () { 4623 4624 var t = this, 4625 4626 i = this.app, 4627 4628 n = t.stackCount, 4629 4630 o = t.isRTL, 4631 4632 a = t.isBooklet, 4633 4634 r = t.getBasePage(), 4635 4636 s = a ? 1 : 2; 4637 4638 o && (r = i.pageCount - r); 4639 4640 var l, u = t.oldBasePageNumber, 4641 4642 h = Math.ceil(i.pageCount / s), 4643 4644 p = Math.floor(n / 2); 4645 4646 r !== t.oldBasePageNumber && (t.pageNumberChanged = !0, this.updatePendingStatusClass(!0), t.zoomViewer.reset()), t.sheetsIndexShift(u, r, n); 4647 4648 var c = Math.ceil(r / s); 4649 4650 for (l = 0; l < n; l++) { 4651 4652 var d = void 0, 4653 4654 f = c - p + l; 4655 4656 if (o && (f = h - f - 1), null != (d = t.sheets[l])) { 4657 4658 d.targetSide = l < p ? e.TURN_DIRECTION.LEFT : e.TURN_DIRECTION.RIGHT; 4659 4660 var g = d.side !== d.targetSide, 4661 4662 v = f !== d.pageNumber, 4663 4664 m = g && !1 === d.skipFlip && 1 === i.zoomValue; 4665 4666 if (!g && v && d.isFlipping && d.currentTween && d.currentTween.stop(), d.isHard = t.isSheetHard(f), d.isCover = t.isSheetCover(f), v) d.resetTexture(), (this.app.isRTL ? d.backPage : d.frontPage).pageNumber = this.isBooklet ? f : 2 * f + 1, (this.app.isRTL ? d.frontPage : d.backPage).pageNumber = this.isBooklet ? -1 : 2 * f + 2, i.textureRequestStatus = e.REQUEST_STATUS.ON; 4667 4668 d.pageNumber = f, t.refreshSheet({ 4669 4670 sheet: d, 4671 4672 sheetNumber: f, 4673 4674 totalSheets: h, 4675 4676 zIndex: this.stackCount + (l < p ? l - p : p - l), 4677 4678 visible: a ? o ? l < p || d.isFlipping || m : l >= p || d.isFlipping || m : f >= 0 && f < h || a && f === h, 4679 4680 index: l, 4681 4682 needsFlip: m, 4683 4684 midPoint: p 4685 4686 }) 4687 4688 } 4689 4690 } 4691 4692 t.requestRefresh(!1), i.textureRequestStatus = e.REQUEST_STATUS.ON, t.oldBasePageNumber = r, this.checkCenter(), this.zoomViewer.refresh(), t.pageNumberChanged = !1 4693 4694 } 4695 4696 }, { 4697 4698 key: "validatePageChange", 4699 4700 value: function (e) { 4701 4702 if (e === this.app.currentPageNumber) return !1; 4703 4704 var t = this.app, 4705 4706 i = !this.isFlipping() || void 0 === t.oldPageNumber; 4707 4708 return i = (i = i || t.currentPageNumber < e && t.oldPageNumber < t.currentPageNumber) || t.currentPageNumber > e && t.oldPageNumber > t.currentPageNumber 4709 4710 } 4711 4712 }, { 4713 4714 key: "getVisiblePages", 4715 4716 value: function () { 4717 4718 for (var e = this, t = [], i = e.getBasePage(), n = e.app.zoomValue > 1 ? 1 : e.isBooklet && Z.isMobile ? Math.min(e.stackCount / 2, 2) : e.stackCount / 2, o = 0; o < n; o++) t.push(i - o), t.push(i + o + 1); 4719 4720 return this.visiblePagesCache = t, { 4721 4722 main: t, 4723 4724 buffer: [] 4725 4726 } 4727 4728 } 4729 4730 }, { 4731 4732 key: "getBasePage", 4733 4734 value: function (e) { 4735 4736 return void 0 === e && (e = this.app.currentPageNumber), this.isBooklet ? e : 2 * Math.floor(e / 2) 4737 4738 } 4739 4740 }, { 4741 4742 key: "getRightPageNumber", 4743 4744 value: function () { 4745 4746 return this.getBasePage() + (this.isBooklet || this.isRTL ? 0 : 1) 4747 4748 } 4749 4750 }, { 4751 4752 key: "getLeftPageNumber", 4753 4754 value: function () { 4755 4756 return this.getBasePage() + (this.isBooklet ? 0 : this.isRTL ? 1 : 0) 4757 4758 } 4759 4760 }, { 4761 4762 key: "afterFlip", 4763 4764 value: function () { 4765 4766 !0 !== this.isAnimating() && (this.pagesReady(), this.updatePendingStatusClass()) 4767 4768 } 4769 4770 }, { 4771 4772 key: "isFlipping", 4773 4774 value: function () { 4775 4776 var e = !1; 4777
4778 return this.sheets.forEach((function (t) { 4779 4780 !0 === t.isFlipping && (e = !0) 4781 4782 })), e 4783 4784 } 4785 4786 }, { 4787 4788 key: "isAnimating", 4789 4790 value: function () { 4791 4792 return this.isFlipping() 4793 4794 } 4795 4796 }, { 4797 4798 key: "mouseWheel", 4799 4800 value: function (t) { 4801 4802 this.app.options.mouseScrollAction === e.MOUSE_SCROLL_ACTIONS.ZOOM ? this.zoomViewer.mouseWheel(t) : j(q(n.prototype), "mouseWheel", this).call(this, t) 4803 4804 } 4805 4806 }, { 4807 4808 key: "checkRequestQueue", 4809 4810 value: function () { 4811 4812 this.app.zoomValue > 1 ? this.zoomViewer.checkRequestQueue() : j(q(n.prototype), "checkRequestQueue", this).call(this) 4813 4814 } 4815 4816 }, { 4817 4818 key: "updatePan", 4819 4820 value: function () { } 4821 4822 }, { 4823 4824 key: "resetPageTween", 4825 4826 value: function () { } 4827 4828 }, { 4829 4830 key: "gotoPageCallBack", 4831 4832 value: function () { 4833 4834 this.resetPageTween(), 1 !== this.app.zoomValue && !0 === this.app.options.resetZoomBeforeFlip && this.app.resetZoom(), this.beforeFlip(), this.requestRefresh() 4835 4836 } 4837 4838 }, { 4839 4840 key: "beforeFlip", 4841 4842 value: function () { 4843 4844 var e = this; 4845 4846 e.app.executeCallback("beforeFlip"), 1 === e.app.zoomValue && e.playSound() 4847 4848 } 4849 4850 }, { 4851 4852 key: "onFlip", 4853 4854 value: function () { 4855 4856 this.app.executeCallback("onFlip") 4857 4858 } 4859 4860 }, { 4861 4862 key: "getAnnotationElement", 4863 4864 value: function (e) { 4865 4866 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 4867 4868 i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], 4869 4870 o = void 0; 4871 4872 return (o = this.app.zoomValue > 1 || !0 === i ? this.zoomViewer.getAnnotationElement(e, t) : j(q(n.prototype), "getAnnotationElement", this).call(this, e, t)) && (o.parentNode.classList.toggle("pf-double-internal", this.isDoubleInternalPage(e)), o.parentNode.classList.toggle("pf-double-internal-fix", this.isDoublePageFix(e))), o 4873 4874 } 4875 4876 }, { 4877 4878 key: "getTextElement", 4879 4880 value: function (e) { 4881 4882 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 4883 4884 i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; 4885 4886 return this.app.zoomValue > 1 || !0 === i ? this.zoomViewer.getTextElement(e, t) : j(q(n.prototype), "getTextElement", this).call(this, e, t) 4887 4888 } 4889 4890 }, { 4891 4892 key: "enterZoom", 4893 4894 value: function () { 4895 4896 this.exchangeTexture(this, this.zoomViewer) 4897 4898 } 4899 4900 }, { 4901 4902 key: "exitZoom", 4903 4904 value: function () { 4905 4906 this.exchangeTexture(this.zoomViewer, this) 4907 4908 } 4909 4910 }, { 4911 4912 key: "exchangeTexture", 4913 4914 value: function (e, t) { 4915 4916 var i = this.getBasePage(), 4917 4918 n = e.getPageByNumber(i), 4919 4920 o = t.getPageByNumber(i); 4921 4922 if (o && "-1" === o.textureStamp ? (o.textureStamp = n.textureStamp, o.loadTexture({ 4923 4924 texture: n.getTexture(!0) 4925 4926 }), Z.log("Texture Exchanging at " + i)) : Z.log("Texture Exchanging Bypassed at " + i), !this.isBooklet) { 4927 4928 var a = e.getPageByNumber(i + 1), 4929 4930 r = t.getPageByNumber(i + 1); 4931 4932 r && "-1" === r.textureStamp ? (r.textureStamp = a.textureStamp, r.loadTexture({ 4933 4934 texture: a.getTexture(!0) 4935 4936 }), Z.log("Texture Exchanging at " + (i + 1))) : Z.log("Texture Exchanging Bypassed at " + (i + 1)) 4937 4938 } 4939 4940 t.pagesReady() 4941 4942 } 4943 4944 }, { 4945 4946 key: "setPageMode", 4947 4948 value: function (t) { 4949 4950 var i = this.app, 4951 4952 n = !0 === t.isSingle; 4953 4954 this.pageMode = n ? e.FLIPBOOK_PAGE_MODE.SINGLE : e.FLIPBOOK_PAGE_MODE.DOUBLE, this.updatePageMode(), i.resizeRequestStart(), i.viewer.pageMode === e.FLIPBOOK_PAGE_MODE.DOUBLE && i.ui.controls.pageMode ? i.ui.controls.pageMode.removeClass(i.options.icons.doublepage).addClass(i.options.icons.singlepage).attr("title", i.options.text.singlePageMode).html("<span>" + i.options.text.singlePageMode + "</span>") : i.ui.controls.pageMode.addClass(i.options.icons.doublepage).removeClass(i.options.icons.singlepage).attr("title", i.options.text.doublePageMode).html("<span>" + i.options.text.doublePageMode + "</span>") 4955 4956 } 4957 4958 }, { 4959 4960 key: "updatePageMode", 4961 4962 value: function () { 4963 4964 this.app.pageCount < 3 && (this.pageMode = e.FLIPBOOK_PAGE_MODE.SINGLE), this.isSingle = this.pageMode === e.FLIPBOOK_PAGE_MODE.SINGLE, this.isBooklet = this.isSingle && this.singlePageMode === e.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET, this.app.jumpStep = this.isSingle ? 1 : 2, this.totalSheets = Math.ceil(this.app.pageCount / (this.isBooklet ? 1 : 2)), this.sheets.length > 0 && this.reset() 4965 4966 } 4967 4968 }, { 4969 4970 key: "setPage", 4971 4972 value: function (t) { 4973 4974 return t.textureTarget === e.TEXTURE_TARGET.ZOOM ? this.zoomViewer.setPage(t) : j(q(n.prototype), "setPage", this).call(this, t) 4975 4976 } 4977 4978 }, { 4979 4980 key: "_calculateInnerHeight", 4981 4982 value: function () { 4983 4984 var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0; 4985 4986 void 0 === t && (t = this.pageMode === e.FLIPBOOK_PAGE_MODE.SINGLE); 4987 4988 var i = this.app.dimensions.defaultPage.viewPort, 4989 4990 n = this.availablePageWidth(!1, !0, t), 4991 4992 o = this.app.dimensions.maxHeight - this.app.dimensions.padding.height; 4993 4994 "vertical" == this.orientation && 0 == t && (o /= 2), this._defaultPageSize = Z.contain(i.width, i.height, n, o), this._pageFitArea = { 4995 4996 width: n, 4997 4998 height: o 4999 5000 }; 5001 5002 var a = this.app.dimensions.isFixedHeight ? o : this._pageFitArea.height; 5003 5004 return this.app.dimensions.isAutoHeight && 0 == this.app.dimensions.isFixedHeight && (a = Math.floor(this._defaultPageSize.height)), a 5005 5006 } 5007 5008 }, { 5009 5010 key: "_getInnerHeight", 5011 5012 value: function () { 5013 5014 var e = this._calculateInnerHeight(); 5015 5016 return this.app.dimensions.stage.width = this.app.dimensions.stage.innerWidth + this.app.dimensions.padding.width, this.app.dimensions.stage.height = e + this.app.dimensions.padding.height, e 5017 5018 } 5019 5020 }, { 5021 5022 key: "availablePageWidth", 5023 5024 value: function () { 5025 5026 var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], 5027 5028 i = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], 5029 5030 n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0; 5031 5032 void 0 === n && (n = this.pageMode === e.FLIPBOOK_PAGE_MODE.SINGLE); 5033 5034 var o = !0 === i ? this.app.dimensions.offset.width : 0, 5035 5036 a = this.app.dimensions.stage.innerWidth + o; 5037 5038 return a /= !0 === n || "vertical" == this.orientation ? 1 : 2, Math.floor(a * (t ? this.app.zoomValue : 1)) 5039 5040 } 5041 5042 }, { 5043 5044 key: "availablePageHeight", 5045 5046 value: function () { 5047 5048 var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], 5049 5050 i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0; 5051 5052 void 0 === i && (i = this.pageMode === e.FLIPBOOK_PAGE_MODE.SINGLE); 5053 5054 var n = this.app.dimensions.stage.innerHe
5054ight; 5055 5056 return !1 === i && "vertical" == this.orientation && (n /= 2), Math.floor(n * (t ? this.app.zoomValue : 1)) 5057 5058 } 5059 5060 }, { 5061 5062 key: "getTextureSize", 5063 5064 value: function (e) { 5065 5066 var t = this.getViewPort(e.pageNumber, !0), 5067 5068 i = this.app.options.pixelRatio, 5069 5070 n = Z.contain(t.width, t.height, i * this.availablePageWidth(e.zoom), i * this.availablePageHeight(e.zoom)); 5071 5072 return { 5073 5074 height: (n = Z.containUnStretched(n.width, n.height, this.app.options.maxTextureSize, this.app.options.maxTextureSize)).height, 5075 5076 width: n.width 5077 5078 } 5079 5080 } 5081 5082 }, { 5083 5084 key: "getLeftPageTextureSize", 5085 5086 value: function () { 5087 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; 5088 5089 return e.pageNumber = this.getLeftPageNumber(), this.getTextureSize(e) 5090 5091 } 5092 5093 }, { 5094 5095 key: "getRightPageTextureSize", 5096 5097 value: function () { 5098 5099 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; 5100 5101 return e.pageNumber = this.getRightPageNumber(), this.getTextureSize(e) 5102 5103 } 5104 5105 }, { 5106 5107 key: "filterViewPort", 5108 5109 value: function (e, t) { 5110 5111 if (void 0 !== e) { 5112 5113 if (1 != (!(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2])) return e; 5114 5115 var i = e.clone(); 5116 5117 return i.width = i.width / this.getDoublePageWidthFix(t), i 5118 5119 } 5120 5121 } 5122 5123 }, { 5124 5125 key: "filterViewPortCanvas", 5126 5127 value: function (e, t, i) { 5128 5129 this.isDoublePageFix(i) && (e.transform[4] = e.transform[4] - Math.floor(Math.min(t.width, 2 * e.width - t.width))), e.widthFix = this.isDoubleInternalPage(i) ? 2 : 1 5130 5131 } 5132 5133 }, { 5134 5135 key: "isClosedPage", 5136 5137 value: function (e) { 5138 5139 return void 0 === e && (e = this.app.currentPageNumber), 1 === e || e === this.app.jumpStep * Math.ceil(this.app.pageCount / this.app.jumpStep) && !this.isBooklet 5140 5141 } 5142 5143 }, { 5144 5145 key: "isLeftPage", 5146 5147 value: function (e) { 5148 5149 return void 0 === e && (e = this.app.currentPageNumber), this.isBooklet ? this.isRTL : e % 2 == (this.isRTL ? 1 : 0) 5150 5151 } 5152 5153 }, { 5154 5155 key: "cleanPage", 5156 5157 value: function (e) { 5158 5159 if (this.isDoubleInternalPage(e)) { 5160 5161 var t = e + (e % 2 == 1 ? -1 : 1); 5162 5163 return !1 === this.app.provider.requestedPages[e] && !1 === this.app.provider.requestedPages[t] 5164 5165 } 5166 5167 return j(q(n.prototype), "cleanPage", this).call(this, e) 5168 5169 } 5170 5171 }, { 5172 5173 key: "onReady", 5174 5175 value: function () { 5176 5177 j(q(n.prototype), "onReady", this).call(this) 5178 5179 } 5180 5181 }, { 5182 5183 key: "searchPage", 5184 5185 value: function (e) { 5186 5187 return { 5188 5189 include: !this.isDoublePageFix(e), 5190 5191 label: this.app.provider.getLabelforPage(e) + (this.isDoubleInternalPage(e) ? "-" + this.app.provider.getLabelforPage(e + 1) : "") 5192 5193 } 5194 5195 } 5196 5197 }]), n 5198 5199 }(y), 5200 5201 Q = function (t) { 5202 5203 V(n, t); 5204 5205 var i = G(n); 5206 5207 5208 5209 function n(e, t) { 5210 5211 var o; 5212 5213 return B(this, n), e.viewerClass = "pf-zoomview " + (e.viewerClass || ""), (o = i.call(this, e, t)).viewer = o.app.viewer, o.events = {}, o.init(), o.initEvents(), o.left = 0, o.top = 0, o 5214 5215 } 5216 5217 return U(n, [{ 5218 5219 key: "init", 5220 5221 value: function () { 5222 5223 this.leftPage = new O, this.rightPage = new O, this.pages.push(this.leftPage), this.pages.push(this.rightPage), this.leftPage.element.addClass("pf-page-back"), this.rightPage.element.addClass("pf-page-front"), this.wrapper.append(this.leftPage.element), this.wrapper.append(this.rightPage.element), this.bookShadow = jQuery("<div>", { 5224 5225 class: "pf-book-shadow" 5226 5227 }), this.wrapper.append(this.bookShadow), this.wrapper.addClass("pf-sheet") 5228 5229 } 5230 5231 }, { 5232 5233 key: "initEvents", 5234 5235 value: function () { 5236 5237 this.stageDOM = this.element[0], j(q(n.prototype), "initEvents", this).call(this) 5238 5239 } 5240 5241 }, { 5242 5243 key: "dispose", 5244 5245 value: function () { 5246 5247 this.element.remove() 5248 5249 } 5250 5251 }, { 5252 5253 key: "resize", 5254 5255 value: function () { 5256 5257 var t = this, 5258 5259 i = t.app.dimensions, 5260 5261 n = i.padding, 5262 5263 o = this.app.viewer.availablePageHeight(), 5264 5265 a = this.app.viewer.availablePageWidth(), 5266 5267 r = t.fullWidth = a * (this.app.viewer.pageMode === e.FLIPBOOK_PAGE_MODE.SINGLE ? 1 : 2), 5268 5269 s = i.stage.innerWidth, 5270
5271 l = i.stage.innerHeight, 5272 5273 u = t.shiftHeight = Math.ceil(Z.limitAt((o - l) / 2, 0, o)), 5274 5275 h = t.shiftWidth = Math.ceil(Z.limitAt((r - s) / 2, 0, r)); 5276 5277 1 === t.app.zoomValue && (t.left = 0, t.top = 0), t.element.css({ 5278 5279 top: -u, 5280 5281 bottom: -u, 5282 5283 right: -h, 5284 5285 left: -h, 5286 5287 paddingTop: n.top, 5288 5289 paddingRight: n.right, 5290 5291 paddingBottom: n.bottom, 5292 5293 paddingLeft: n.left, 5294 5295 transform: "translate3d(" + t.left + "px," + t.top + "px,0)" 5296 5297 }), t.wrapper.css({ 5298 5299 width: r, 5300 5301 height: o, 5302 5303 marginTop: i.height - o - n.height > 0 ? (i.height - n.height - o) / 2 : 0 5304 5305 }), this.wrapper.height(o).width(r - r % 2), !0 === t.app.pendingZoom && t.zoom(), this.app.viewer.annotedPage = null, this.pagesReady() 5306 5307 } 5308 5309 }, { 5310 5311 key: "zoom", 5312 5313 value: function () { 5314 5315 var e = this, 5316 5317 t = this.app; 5318 5319 if (t.zoomChanged) { 5320 5321 var i = t.dimensions.origin, 5322 5323 n = t.zoomValueChange; 5324 5325 if (1 === t.zoomValue) e.left = 0, e.top = 0; 5326 5327 else { 5328 5329 e.left *= n, e.top *= n, t.viewer.zoomCenter || (t.viewer.zoomCenter = { 5330 5331 x: i.x, 5332 5333 y: i.y 5334 5335 }); 5336 5337 var o = { 5338 5339 raw: t.viewer.zoomCenter 5340 5341 }, 5342 5343 a = { 5344 5345 raw: {} 5346 5347 }, 5348 5349 r = (o.raw.x - i.x) * n, 5350 5351 s = (o.raw.y - i.y) * n; 5352 5353 a.raw.x = i.x + r, a.raw.y = i.y + s, e.startPoint = a, e.pan(o), e.startPoint = null 5354 5355 } 5356 5357 } 5358 5359 t.viewer.zoomCenter = null 5360 5361 } 5362 5363 }, { 5364 5365 key: "reset", 5366 5367 value: function () { 5368 5369 this.leftPage.resetTexture(), this.rightPage.resetTexture() 5370 5371 } 5372 5373 }, { 5374 5375 key: "refresh", 5376 5377 value: function () { 5378 5379 var e = this.app, 5380 5381 t = e.viewer, 5382 5383 i = t.getBasePage(), 5384 5385 n = t.isBooklet ? !e.isRTL : e.isRTL, 5386 5387 o = n ? this.rightPage : this.leftPage, 5388 5389 a = n ? this.leftPage : this.rightPage; 5390 5391 o.pageNumber = i, a.pageNumber = i + 1, o.updateCSS({ 5392 5393 display: 0 === i ? "none" : "block" 5394 5395 }), a.updateCSS({ 5396 5397 display: a.pageNumber > e.pageCount || t.isBooklet ? "none" : "block" 5398 5399 }) 5400 5401 } 5402 5403 }, { 5404 5405 key: "updateCenter", 5406 5407 value: function () { 5408 5409 var e = this; 5410 5411 if (null !== e && null !== e.app.viewer) { 5412 5413 var t = e.app.viewer.centerShift,
5414 5415 i = e.app.viewer.isRTL, 5416 5417 n = t * (!i && e.app.currentPageNumber > 1 || i && e.app.currentPageNumber < e.app.pageCount ? e.leftSheetWidth : e.rightSheetWidth) / 2; 5418 5419 e.wrapper[0].style.left = n + "px" 5420 5421 } 5422 5423 } 5424 5425 }, { 5426 5427 key: "isDoubleInternalPage", 5428 5429 value: function (e) { 5430 5431 return this.app.viewer.isDoubleInternalPage(e) 5432 } 5433 5434 }, { 5435 5436 key: "pagesReady", 5437 5438 value: function () { 5439 5440 if (!this.app.viewer.isFlipping() && (1 !== this.app.zoomValue && this.app.viewer.updatePendingStatusClass(!1), !1 === this.app.options.flipbookFitPages)) { 5441 5442 var e = this.app.viewer.getBasePage(), 5443 5444 t = this.leftVie
5444wport = this.app.viewer.getViewPort(e + (this.app.viewer.isBooklet ? 0 : this.app.viewer.isRTL ? 1 : 0)), 5445 5446 i = this.rightViewPort = this.app.viewer.getViewPort(e + (this.app.viewer.isBooklet || this.app.viewer.isRTL ? 0 : 1)); 5447 5448 if (t) { 5449 5450 var n = Z.contain(t.width, t.height, this.app.viewer.availablePageWidth(), this.app.viewer.availablePageHeight()); 5451 5452 this.leftSheetWidth = Math.floor(n.width), this.leftSheetHeight = Math.floor(n.height), this.leftSheetTop = (this.app.viewer.availablePageHeight() - this.leftSheetHeight) / 2 5453 5454 } 5455 5456 if (i) { 5457 5458 var o = Z.contain(i.width, i.height, this.app.viewer.availablePageWidth(), this.app.viewer.availablePageHeight()); 5459 5460 this.rightSheetWidth = Math.floor(o.width), this.rightSheetHeight = Math.floor(o.height), this.rightSheetTop = (this.app.viewer.availablePageHeight() - this.rightSheetHeight) / 2 5461 5462 } 5463 5464 null == t && null == i || (this.totalSheetsWidth = this.leftSheetWidth + this.rightSheetWidth, this.leftPage.element.height(Math.floor(this.leftSheetHeight)).width(Math.floor(this.leftSheetWidth)).css({ 5465 5466 transform: "translateY(" + Math.floor(this.leftSheetTop) + "px)" 5467 5468 }), this.rightPage.element.height(Math.floor(this.rightSheetHeight)).width(Math.floor(this.rightSheetWidth)).css({ 5469 5470 transform: "translateY(" + Math.floor(this.rightSheetTop) + "px)" 5471 5472 })) 5473 5474 } 5475 5476 } 5477 5478 }, { 5479 5480 key: "textureLoadedCallback", 5481 5482 value: function (e) { 5483 5484 this.getPageByNumber(e.pageNumber); 5485 5486 this.pagesReady() 5487 5488 } 5489 5490 }]), n 5491 5492 }(y), 5493 5494 X = function () { 5495 5496 function t(e) { 5497 5498 B(this, t), this.parentElement = e.parentElement, this.isFlipping = !1, this.isOneSided = !1, this.viewer = e.viewer, this.frontPage = null, this.backPage = null, this.pageNumber = void 0, this.animateToReset = null 5499 5500 } 5501 5502 return U(t, [{ 5503 5504 key: "init", 5505 5506 value: function () { } 5507 5508 }, { 5509 5510 key: "flip", 5511 5512 value: function () { } 5513 5514 }, { 5515 5516 key: "frontImage", 5517 5518 value: function (e) { 5519 5520 this.frontPage.loadTexture({ 5521 5522 texture: e.texture, 5523 5524 callback: e.callback 5525 5526 }) 5527 5528 } 5529 5530 }, { 5531 5532 key: "backImage", 5533 5534 value: function (e) { 5535 5536 this.backPage.loadTexture({ 5537 5538 texture: e.texture, 5539 5540 callback: e.callback 5541 5542 }) 5543 5544 } 5545 5546 }, { 5547 5548 key: "resetTexture", 5549 5550 value: function () { 5551 5552 this.frontPage.resetTexture(), this.backPage.resetTexture() 5553 5554 } 5555 5556 }, { 5557 5558 key: "reset", 5559 5560 value: function () { 5561 5562 var t = this; 5563 5564 t.animateToReset = null, t.isFlipping = !1, t.currentTween = null, t.pendingPoint = null, t.magnetic = !1, t.skipFlip = !0, t.animateToReset = null, t.viewer.dragPage = null, t.viewer.flipPage = null, t.viewer.corner = e.TURN_CORNER.NONE 5565 5566 } 5567 5568 }]), t 5569 5570 }(); 5571 5572 5573 5574 function Y(e) { 5575 5576 return Y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 5577 5578 return typeof e 5579 5580 } : function (e) { 5581 5582 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 5583 5584 }, Y(e) 5585 5586 } 5587 5588 5589 5590 function J() { 5591 5592 return J = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, i) { 5593 5594 var n = function (e, t) { 5595 5596 for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = ae(e));); 5597 5598 return e 5599 5600 }(e, t); 5601 5602 if (n) { 5603 5604 var o = Object.getOwnPropertyDescriptor(n, t); 5605 5606 return o.get ? o.get.call(arguments.length < 3 ? e : i) : o.value 5607 5608 } 5609 5610 }, J.apply(this, arguments) 5611 5612 } 5613 5614 5615 5616 function $(e, t) { 5617 5618 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 5619 5620 } 5621 5622 5623 5624 function ee(e, t) { 5625 5626 for (var i = 0; i < t.length; i++) { 5627 5628 var n = t[i]; 5629 5630 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 5631 5632 if ("object" !== Y(e) || null === e) return e; 5633 5634 var i = e[Symbol.toPrimitive]; 5635 5636 if (void 0 !== i) { 5637 5638 var n = i.call(e, t || "default"); 5639 5640 if ("object" !== Y(n)) return n; 5641 5642 throw new TypeError("@@toPrimitive must return a primitive value.") 5643 5644 } 5645 5646 return ("string" === t ? String : Number)(e) 5647 5648 }
5648(o, "string"), "symbol" === Y(a) ? a : String(a)), n) 5649 5650 } 5651 5652 var o, a 5653 5654 } 5655 5656 5657 5658 function te(e, t, i) { 5659 5660 return t && ee(e.prototype, t), i && ee(e, i), Object.defineProperty(e, "prototype", { 5661 5662 writable: !1 5663 5664 }), e 5665 5666 } 5667 5668 5669 5670 function ie(e, t) { 5671 5672 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 5673 5674 e.prototype = Object.create(t && t.prototype, { 5675 5676 constructor: { 5677 5678 value: e, 5679 5680 writable: !0, 5681 5682 configurable: !0 5683 5684 } 5685 5686 }), Object.defineProperty(e, "prototype", { 5687 5688 writable: !1 5689 5690 }), t && ne(e, t) 5691 5692 } 5693 5694 5695 5696 function ne(e, t) { 5697 5698 return ne = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 5699 5700 return e.__proto__ = t, e 5701 5702 }, ne(e, t) 5703 5704 } 5705 5706 5707 5708 function oe(e) { 5709 5710 var t = function () { 5711 5712 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 5713 5714 if (Reflect.construct.sham) return !1; 5715 5716 if ("function" == typeof Proxy) return !0; 5717 5718 try { 5719 5720 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 5721 5722 } catch (e) { 5723 5724 return !1 5725 5726 } 5727 5728 }(); 5729 5730 return function () { 5731 5732 var i, n = ae(e); 5733 5734 if (t) { 5735 5736 var o = ae(this).constructor; 5737 5738 i = Reflect.construct(n, arguments, o) 5739 5740 } else i = n.apply(this, arguments); 5741 5742 return function (e, t) { 5743 5744 if (t && ("object" === Y(t) || "function" == typeof t)) return t; 5745 5746 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 5747 5748 return function (e) { 5749 5750 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 5751 5752 return e 5753 5754 }(e) 5755 5756 }(this, i) 5757 5758 } 5759 5760 } 5761 5762 5763 5764 function ae(e) { 5765 5766 return ae = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 5767 5768 return e.__proto__ || Object.getPrototypeOf(e) 5769 5770 }, ae(e) 5771 5772 } 5773 5774 var re = e, 5775 5776 se = re.utils, 5777 5778 le = function (t) { 5779 5780 ie(n, t); 5781 5782 var i = oe(n); 5783 5784 5785 5786 function n(e) { 5787 5788 var t; 5789 5790 return $(this, n), (t = i.call(this, e)).init(), t 5791 5792 } 5793 5794 return te(n, [{ 5795 5796 key: "init", 5797 5798 value: function () { 5799 5800 var e = this, 5801 5802 t = "<div>", 5803 5804 i = e.element = jQuery(t, { 5805 5806 class: "pf-sheet" 5807 5808 }), 5809 5810 n = e.frontPage = new O; 5811 5812 n.element.addClass("pf-page-front"); 5813 5814 var o = e.backPage = new O; 5815 5816 o.element.addClass("pf-page-back"); 5817 5818 var a = e.wrapper = jQuery(t, { 5819 5820 class: "pf-sheet-wrapper" 5821 5822 }), 5823 5824 r = e.foldInnerShadow = jQuery(t, { 5825 5826 class: "pf-sheet-fold-inner-shadow" 5827 5828 }), 5829 5830 s = e.foldOuterShadow = jQuery(t, { 5831 5832 class: "pf-sheet-fold-outer-shadow" 5833 5834 }); 5835 5836 this.parentElement.append(i), i.append(a), i.append(s), a.append(n.element), a.append(o.element), a.append(r) 5837 5838 } 5839 5840 }, { 5841 5842 key: "updateCSS", 5843 5844 value: function (e) { 5845 5846 this.element.css(e) 5847 5848 } 5849 5850 }, { 5851 5852 key: "resetCSS", 5853 5854 value: function () { 5855 5856 var e = this; 5857
5858 e.wrapper.css({ 5859 5860 transform: "" 5861 5862 }), e.frontPage.resetCSS(), e.backPage.resetCSS() 5863 5864 } 5865 5866 }, { 5867 5868 key: "updateSize", 5869 5870 value: function (e, t, i) { 5871 5872 e = Math.floor(e), t = Math.floor(t), i = Math.floor(i), this.wrapper[0].style.height = this.wrapper[0].style.width = Math.ceil(se.distOrigin(e, t) * this.viewer.app.zoomValue) + "px", this.element[0].style.height = this.frontPage.element[0].style.height = this.backPage.element[0].style.height = this.foldInnerShadow[0].style.height = t + "px", this.element[0].style.width = this.frontPage.element[0].style.width = this.backPage.element[0].style.width = this.foldInnerShadow[0].style.width = e + "px", this.element[0].style.transform = "translateY(" + i + "px)" 5873 5874 } 5875 5876 }, { 5877 5878 key: "flip", 5879 5880 value: function (t) { 5881 5882 var i = this; 5883 5884 if (t = t || i.pendingPoint, null != i && null != i.viewer) { 5885 5886 i.isFlipping = !0, i.viewer.flipPage = i; 5887 5888 var n, o, a = i.viewer.isBooklet, 5889 5890 r = i.side === e.TURN_DIRECTION.RIGHT, 5891 5892 s = i.viewer.isRTL, 5893 5894 l = i.viewer.corner === e.TURN_CORNER.BL || i.viewer.corner === e.TURN_CORNER.BR ? i.element.height() : 0, 5895 5896 u = i.viewer.leftSheetWidth + i.viewer.rightSheetWidth, 5897 5898 h = 0; 5899 5900 o = i.end = i && !0 === i.animateToReset ? { 5901 5902 x: r ? u : 0, 5903 5904 y: l 5905 5906 } : { 5907 5908 x: r ? 0 : u, 5909 5910 y: l 5911 5912 }, i.flipEasing = i.isHard ? TWEEN.Easing.Quadratic.InOut : TWEEN.Easing.Linear.None; 5913 5914 var p = i.viewer.app.options.duration; 5915 5916 !0 === i.isHard ? (null != t && (h = se.angleByDistance(t.distance, t.fullWidth)), n = i.init = { 5917 5918 angle: h * (r ? -1 : 1) 5919 5920 }, o = i.end = i && !0 === i.animateToReset ? { 5921 5922 angle: r ? 0 : -0 5923 5924 } : { 5925 5926 angle: r ? -180 : 180 5927 5928 }) : null == t ? n = i.init = i && !0 === i.animateToReset ? { 5929 5930 x: r ? 0 : u, 5931 5932 y: 0 5933 5934 } : { 5935 5936 x: r ? u : 0, 5937 5938 y: 0 5939 5940 } : (n = i.init = { 5941 5942 x: t.x, 5943 5944 y: t.y, 5945 5946 opacity: 1 5947 5948 }, p = i.viewer.app.options.duration * se.distPoints(n.x, n.y, o.x, o.y) / i.viewer.fullWidth, p = se.limitAt(p, i.viewer.app.options.duration / 3, i.viewer.duration)), n.index = 0, o.index = 1, i.isFlipping = !0, a && (!r && !s || r && s) && (i.element[0].style.opacity = 0), !0 === i.isHard ? i.currentTween = new TWEEN.Tween(n).delay(0).to(o, i.viewer.app.options.duration).onUpdate((function () { 5949 5950 i.updateTween(this) 5951 5952 })).easing(i.flipEasing).onComplete(i.completeTween.bind(i)).start() : i.currentTween = null == t ? new TWEEN.Tween(n).delay(0).to(o, i.viewer.app.options.duration).onUpdate((function () { 5953 5954 i.updateTween(this) 5955 5956 })).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(i.completeTween.bind(i)).start() : new TWEEN.Tween(n).delay(0).to(o, p).onUpdate((function () { 5957 5958 i.updateTween(this) 5959 5960 })).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(i.completeTween.bind(i)).start() 5961 5962 } 5963 5964 } 5965 5966 }, { 5967 5968 key: "updatePoint", 5969 5970 value: function (t) { 5971 5972 var i = this; 5973 5974 if (null != t) { 5975 5976 var n = i.element.width(), 5977 5978 o = i.element.height(), 5979 5980 a = i.viewer.corner !== e.TURN_CORNER.NONE ? i.viewer.corner : t.corner, 5981 5982 r = e.TURN_CORNER, 5983 5984 s = i.side === e.TURN_DIRECTION.RIGHT, 5985 5986 l = a === r.BL || a === r.BR; 5987 5988 t.rx = !0 === s ? i.viewer.leftSheetWidth + n - t.x : t.x, t.ry = !0 === l ? o - t.y : t.y; 5989 5990 var u = Math.atan2(t.ry, t.rx); 5991 5992 u = Math.PI / 2 - se.limitAt(u, 0, se.toRad(90)); 5993 5994 var h = n - t.rx / 2, 5995 5996 p = t.ry / 2, 5997 5998 c = Math.max(0, Math.sin(u - Math.atan2(p, h)) * se.distOrigin(h, p)), 5999 6000 d = .5 * se.distOrigin(t.rx, t.ry), 6001
6002 f = Math.ceil(n - c * Math.sin(u)), 6003 6004 g = Math.ceil(c * Math.cos(u)), 6005 6006 v = se.toDeg(u), 6007 6008 m = l ? s ? 90 - v + 180 : 180 + v : s ? v : 90 - v, 6009 6010 y = l ? s ? 90 - v + 180 : v : s ? v + 180 : m, 6011 6012 b = l ? s ? 90 - v : v + 90 : s ? m - 90 : m + 180, 6013 6014 w = s ? n - f : f, 6015 6016 P = l ? o + g : -g, 6017 6018 S = s ? -f : f - n, 6019 6020 C = l ? -o - g : g, 6021 6022 T = se.limitAt(.5 * t.distance / n, 0, .5), 6023 6024 x = se.limitAt(.5 * (i.viewer.leftSheetWidth + n - t.rx) / n, .05, .3); 6025 6026 i.element.addClass("pf-folding"); 6027 6028 var k = s ? i.backPage.element : i.frontPage.element, 6029 6030 E = s ? i.frontPage.element : i.backPage.element, 6031 6032 O = i.foldOuterShadow, 6033 6034 R = i.foldInnerShadow; 6035 6036 i.wrapper.css({ 6037 6038 transform: se.translateStr(w, P) + se.rotateStr(m) 6039 6040 }), E.css({ 6041 6042 transform: se.rotateStr(-m) + se.translateStr(-w, -P) 6043 6044 }), k.css({ 6045 6046 transform: se.rotateStr(y) + se.translateStr(S, C), 6047 6048 boxShadow: "rgba(0, 0, 0, " + T + ") 0px 0px 20px" 6049 6050 }), R.css({ 6051 6052 transform: se.rotateStr(y) + se.translateStr(S, C), 6053 6054 opacity: x / 2, 6055 6056 backgroundImage: se.prefix.css + "linear-gradient( " + b + "deg, rgba(0, 0, 0, 0.25) , rgb(0, 0, 0) " + .7 * d + "px, rgb(255, 255, 255) " + d + "px)" 6057 6058 }), O.css({ 6059 6060 opacity: x / 2, 6061 6062 left: s ? "auto" : 0, 6063 6064 right: s ? 0 : "auto", 6065 6066 backgroundImage: se.prefix.css + "linear-gradient( " + (180 - b) + "deg, rgba(0, 0, 0,0) " + d / 3 + "px, rgb(0, 0, 0) " + d + "px)" 6067 6068 }) 6069 6070 } 6071 6072 } 6073 6074 }, { 6075 6076 key: "updateAngle", 6077 6078 value: function (e, t) { 6079 6080 var i = this, 6081 6082 n = 5 * i.element.width(); 6083 6084 i.wrapper.css({ 6085 6086 perspective: n, 6087 6088 perspectiveOrigin: !0 === t ? "0% 50%" : "100% 50%" 6089 6090 }), i.element.addClass("pf-folding"), i.backPage.updateCSS({ 6091 6092 display: !0 === t ? e <= -90 ? "block" : "none" : e < 90 ? "block" : "none", 6093 6094 transform: ("MfS" !== se.prefix.dom ? "" : "perspective(" + n + "px) ") + (!0 === t ? "translateX(-100%) " : "") + "rotateY(" + ((!0 === t ? 180 : 0) + e) + "deg)" 6095 6096 }), i.frontPage.updateCSS({ 6097 6098 display: !0 === t ? e > -90 ? "block" : "none" : e >= 90 ? "block" : "none", 6099 6100 transform: ("MSd" !== se.prefix.dom ? "" : "perspective(" + n + "px) ") + (!1 === t ? "translateX(100%) " : "") + "rotateY(" + ((!1 === t ? -180 : 0) + e) + "deg)" 6101 6102 }) 6103 6104 } 6105 6106 }, { 6107 6108 key: "updateTween", 6109 6110 value: function (t) { 6111 6112 var i = this, 6113 6114 n = i.viewer.isBooklet, 6115 6116 o = i.side === e.TURN_DIRECTION.RIGHT, 6117 6118 a = i.viewer.isRTL, 6119 6120 r = !0 === i.animateToReset; 6121 6122 !0 === i.isHard ? (i.updateAngle(t.angle, o), i.angle = t.angle) : (i.updatePoint({ 6123 6124 x: t.x, 6125 6126 y: t.y 6127 6128 }), i.x = t.x, i.y = t.y), n && !r && (i.element[0].style.opacity = o && !a || !o && a ? t.index > .5 ? 2 * (1 - t.index) : 1 : t.index < .5 ? 2 * t.index : 1) 6129 6130 } 6131 6132 }, { 6133 6134 key: "completeTween", 6135 6136 value: function () { 6137 6138 var e = this; 6139 6140 !0 === e.isHard ? (e.updateAngle(e.end.angle), e.backPage.element.css({ 6141 6142 display: "block" 6143 6144 }), e.frontPage.element.css({ 6145 6146 display: "block" 6147 6148 })) : e.updatePoint({ 6149 6150 x: e.end.x, 6151 6152 y: e.end.y 6153 6154 }), e.element[0].style.opacity = 1, !0 !== e.animateToReset && (e.side = e.targetSide), e.reset(), e.viewer.onFlip(), e.viewer.afterFlip(), e.viewer.requestRefresh() 6155 6156 } 6157 6158 }]), n 6159 6160 }(X), 6161 6162 ue = function (t) { 6163 6164 ie(n, t); 6165 6166 var i = oe(n); 6167 6168 6169 6170 function n(t, o) { 6171 6172 var a, r; 6173 6174 return $(this, n), t.viewerClass = null !== (a = t.viewerClass) && void 0 !== a ? a : "pf-flipbook-2d", t.skipViewerLoaded = !0, (r = i.call(this, t, o)).bookShadow = jQuery("<div>", { 6175 6176 class: "pf-book-shadow" 6177 6178 }), r.wrapper.append(r.bookShadow), r.corner = e.TURN_CORNER.NONE, o._viewerPrepared(), r 6179 6180 } 6181 6182 return te(n, [{ 6183 6184 key: "init", 6185 6186 value: function () { 6187 6188 J(ae(n.prototype), "init", this).call(this), this.initEvents(), this.initPages() 6189 6190 } 6191 6192 }, { 6193 6194 key: "initEvents", 6195 6196 value: function () { 6197 6198 this.stageDOM = this.element[0], J(ae(n.prototype), "initEvents", this).call(this) 6199 6200 } 6201 6202 }, { 6203 6204 key: "dispose", 6205 6206 value: function () { 6207 6208 J(ae(n.prototype), "dispose", this).call(this), this.element.remove() 6209 6210 } 6211 6212 }, { 6213 6214 key: "initPages", 6215 6216 value: function () { 6217 6218 for (var e = 0; e < this.stackCount; e++) { 6219 6220 var t = new le({ 6221 6222 parentElement: this.wrapper 6223 6224 }); 6225 6226 t.index = e, t.viewer = this, this.sheets.push(t), this.pages.push(t.frontPage), this.pages.push(t.backPage) 6227 6228 } 6229 6230 } 6231 6232 }, { 6233 6234 key: "resize", 6235 6236 value: function () { 6237 6238 J(ae(n.prototype), "resize", this).call(this); 6239 6240 var e = this, 6241 6242 t = e.app.dimensions, 6243 6244 i = t.padding, 6245 6246 o = this.availablePageHeight(), 6247 6248 a = this.availablePageWidth(), 6249 6250 r = e.fullWidth = 2 * a, 6251 6252 s = t.width, 6253 6254 l = t.height, 6255
6256 u = e.shiftHeight = Math.ceil(se.limitAt((o - l + i.height) / 2, 0, o)), 6257 6258 h = e.shiftWidth = Math.ceil(se.limitAt((r - s + i.width) / 2, 0, r)); 6259 6260 1 === e.app.zoomValue && (e.left = 0, e.top = 0), e.element.css({ 6261 6262 top: -u, 6263 6264 bottom: -u, 6265 6266 right: -h, 6267 6268 left: -h, 6269 6270 paddingTop: i.top, 6271 6272 paddingRight: i.right, 6273 6274 paddingBottom: i.bottom, 6275 6276 paddingLeft: i.left, 6277 6278 transform: "translate3d(" + e.left + "px," + e.top + "px,0)" 6279 6280 }), e.wrapper.css({ 6281 6282 marginTop: Math.max(t.height - o - i.height) / 2, 6283 6284 height: o, 6285 6286 width: r - r % 2 6287 6288 }), e.zoomViewer.resize(), e.centerNeedsUpdate = !0, e.checkCenter(!0), e.pagesReady() 6289 6290 } 6291 6292 }, { 6293 6294 key: "updateCenter", 6295 6296 value: function () { 6297 6298 var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], 6299 6300 t = this, 6301 6302 i = t.centerShift, 6303 6304 n = (t.isRTL, i * (this.isLeftPage() ? this.leftSheetWidth : this.rightSheetWidth) / 2); 6305 6306 t.seamPosition = (-t.app.dimensions.offset.width + t.app.dimensions.containerWidth) / 2 + n, t.wrapperShift = (t.isSingle ? -t.app.dimensions.stage.innerWidth / 2 : 0) + n, t.wrapper[0].style.left = t.wrapperShift + "px", t.wrapper[0].style.transition = e ? "none" : "", this.zoomViewer.updateCenter() 6307 6308 } 6309 6310 }, { 6311 6312 key: "refreshSheet", 6313 6314 value: function (e) { 6315 6316 var t = e.sheet, 6317 6318 i = e.sheetNumber; 6319 6320 !1 === t.isFlipping && (e.needsFlip ? (t.element.addClass("pf-flipping"), t.flip()) : (t.skipFlip = !1, t.element.removeClass("pf-flipping pf-quick-turn pf-folding pf-left-side pf-right-side"), t.element.addClass(t.targetSide === re.TURN_DIRECTION.LEFT ? "pf-left-side" : "pf-right-side"), t.side = t.targetSide, t.targetSide === re.TURN_DIRECTION.LEFT ? t.updateSize(this.leftSheetWidth, this.leftSheetHeight, this.leftSheetTop) : t.updateSize(this.rightSheetWidth, this.rightSheetHeight, this.rightSheetTop))), t.visible = e.visible, t.isHard ? t.element.addClass("pf-hard-sheet") : (t.element.removeClass("pf-hard-sheet"), t.frontPage.updateCSS({ 6321 6322 display: "block" 6323 6324 }), t.backPage.updateCSS({ 6325 6326 display: "block" 6327 6328 })), t.updateCSS({ 6329 6330 display: !0 === t.visible ? "block" : "none", 6331 6332 zIndex: e.zIndex 6333 6334 }), null == t.pendingPoint && !1 === t.isFlipping && t.resetCSS(), i !== t.pageNumber && (t.element.attr("number", i), t.backPage.element.attr("pagenumber", t.backPage.pageNumber), t.frontPage.element.attr("pagenumber", t.frontPage.pageNumber)) 6335 6336 } 6337 6338 }, { 6339 6340 key: "eventToPoint", 6341 6342 value: function (e) { 6343 6344 var t = this; 6345 6346 e = se.fixMouseEvent(e); 6347 6348 var i, n, o, a, r, s, l, u, h, p = t.wrapper[0].getBoundingClientRect(), 6349 6350 c = t.is3D, 6351 6352 d = t.sheets, 6353 6354 f = (t.app.dimensions, { 6355 6356 x: e.clientX, 6357 6358 y: e.clientY 6359 6360 }), 6361 6362 g = t.parentElement[0].getBoundingClientRect(); 6363 6364 f.x = f.x - g.left, f.y = f.y - g.top, i = (h = t.dragSheet ? t.dragSheet.side === re.TURN_DIRECTION.RIGHT : f.x > t.seamPosition) ? t.rightSheetWidth : t.leftSheetWidth, o = h ? t.rightSheetHeight : t.leftSheetHeight, n = t.rightSheetWidth + t.leftSheetWidth, r = h ? t.rightSheetTop : t.leftSheetTop, a = f.x - (t.seamPosition - t.leftSheetWidth), r = f.y - (p.top - g.top) - r, s = t.drag === re.TURN_DIRECTION.NONE ? a < i ? a : n - a : t.drag === re.TURN_DIRECTION.LEFT ? a : n - a, l = h ? d[t.stackCount / 2] : d[t.stackCount / 2 - 1], u = a < t.foldSense ? re.TURN_DIRECTION.LEFT : a > n - t.foldSense ? re.TURN_DIRECTION.RIGHT : re.TURN_DIRECTION.NONE; 6365 6366 var v, m = a, 6367 6368 y = r, 6369 6370 b = o, 6371 6372 w = n, 6373 6374 P = t.foldSense; 6375 6376 return { 6377 6378 isInsideSheet: m >= 0 && m <= w && y >= 0 && y <= b, 6379 6380 isInsideCorner: (v = m >= 0 && m < P ? y >= 0 && y <= P ? re.TURN_CORNER.TL : y >= b - P && y <= b ? re.TURN_CORNER.BL : y > P && y < b - P ? re.TURN_CORNER.L : re.TURN_CORNER.NONE : m >= w - P && m <= w ? y >= 0 && y <= P ? re.TURN_CORNER.TR : y >= b - P && y <= b ? re.TURN_CORNER.BR : y > P && y < b - P ? re.TURN_CORNER.R : re.TURN_CORNER.NONE : re.TURN_CORNER.NONE) !== re.TURN_CORNER.NONE && v !== re.TURN_CORNER.L && v !== re.TURN_CORNER.R, 6381 6382 x: c ? f.x : a, 6383 6384 y: c ? f.y : r, 6385 6386 fullWidth: n, 6387 6388 sheetWidth: i, 6389 6390 sheetHeight: o, 6391 6392 rawDistance: n - a, 6393 6394 distance: s, 6395 6396 sheet: l, 6397 6398 drag: u, 6399 6400 foldSense: t.foldSense, 6401 6402 event: e, 6403 6404 raw: f, 6405 6406 corner: v 6407 6408 } 6409 6410 } 6411 6412 }, { 6413 6414 key: "pan", 6415 6416 value: function (e) { 6417 6418 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; 6419 6420 se.pan(this, e, t) 6421 6422 } 6423 6424 }, { 6425 6426 key: "mouseMove", 6427 6428 value: function (e) { 6429 6430 var t = this, 6431 6432 i = t.eventToPoint(e); 6433 6434 if (null == e.touches || 2 != e.touches.length) { 6435 6436 1 !== t.app.zoomValue && null != t.startPoint && !0 === t.canSwipe && (t.pan(i), e.preventDefault()); 6437 6438 var n = t.dragSheet || i.sheet; 6439 6440 if (null == t.flipPage && (null != t.dragSheet || !0 === i.isInsideCorner)) { 6441 6442 null != t.dragSheet || (i.y = se.limitAt(i.y, 1, t.availablePageHeight() - 1), i.x = se.limitAt(i.x, 1, i.fullWidth - 1)); 6443 6444 var o = null != t.dragSheet ? t.corner : i.corner; 6445 6446 if (n.isHard) { 6447 6448 var a = o === re.TURN_CORNER.BR || o === re.TURN_CORNER.TR, 6449 6450 r = se.angleByDistance(i.distance, i.fullWidth);
6451 6452 n.updateAngle(r * (a ? -1 : 1), a) 6453 6454 } else n.updatePoint(i); 6455 6456 n.magnetic = !0, n.magneticCorner = i.corner, e.preventDefault() 6457 6458 } 6459 6460 null == t.dragSheet && null != n && !1 === i.isInsideCorner && !0 === n.magnetic && (n.pendingPoint = i, n.animateToReset = !0, n.magnetic = !1, t.corner = n.magneticCorner, n.flip(n.pendingPoint), n.pendingPoint = null), t.checkSwipe(i, e) 6461 6462 } else this.pinchMove(e) 6463 6464 } 6465 6466 }, { 6467 6468 key: "mouseUp", 6469 6470 value: function (t) { 6471 6472 var i = this; 6473 6474 if (null != i.startPoint && (t.touches || 0 === t.button)) 6475 6476 if (null != i.dragSheet || null == t.touches || 0 != t.touches.length) { 6477 6478 var n = i.eventToPoint(t), 6479 6480 o = t.target || t.originalTarget, 6481 6482 a = 1 === i.app.zoomValue && n.x === i.startPoint.x && n.y === i.startPoint.y && "A" !== o.nodeName; 6483 6484 if (!0 === t.ctrlKey && a) this.zoomOnPoint(n); 6485 6486 else if (i.dragSheet) { 6487 6488 t.preventDefault(); 6489 6490 var r = i.dragSheet; 6491 6492 if (r.pendingPoint = n, i.drag = n.drag, a && (!0 === n.isInsideCorner || n.isInsideSheet && i.clickAction === re.MOUSE_CLICK_ACTIONS.NAV)) n.corner.indexOf("l") > -1 ? i.app.openLeft() : i.app.openRight(); 6493 6494 else { 6495 6496 var s = this.getBasePage(); 6497 6498 n.distance > n.sheetWidth / 2 && (n.sheet.side === e.TURN_DIRECTION.LEFT ? i.app.openLeft() : i.app.openRight()), s === this.getBasePage() && (r.animateToReset = !0, r.flip(n)) 6499 6500 } 6501 6502 i.dragSheet = null, r.magnetic = !1 6503 6504 } else a && !n.sheet.isFlipping && n.isInsideSheet && i.clickAction === re.MOUSE_CLICK_ACTIONS.NAV && ("left" === n.sheet.side ? i.app.openLeft() : i.app.openRight()); 6505 6506 i.startPoint = null, i.canSwipe = !1, i.drag = re.TURN_DIRECTION.NONE 6507 6508 } else this.pinchUp(t) 6509 6510 } 6511 6512 }, { 6513 6514 key: "mouseDown", 6515 6516 value: function (e) { 6517 6518 if (e.touches || 0 === e.button) 6519 6520 if (null == e.touches || 2 != e.touches.length) { 6521 6522 var t = this, 6523 6524 i = t.eventToPoint(e); 6525 6526 t.startPoint = i, t.lastPosX = i.x, t.lastPosY = i.y, i.isInsideCorner && null == t.flipPage ? (t.dragSheet = i.sheet, t.drag = i.drag, t.corner = i.corner, 0 === i.sheet.pageNumber ? t.bookShadow.css({ 6527 6528 width: "50%", 6529 6530 left: t.app.isRTL ? 0 : "50%", 6531 6532 transitionDelay: "" 6533 6534 }) : i.sheet.pageNumber === Math.ceil(t.app.pageCount / 2) - 1 && t.bookShadow.css({ 6535 6536 width: "50%", 6537 6538 left: t.app.isRTL ? "50%" : 0, 6539 6540 transitionDelay: "" 6541 6542 })) : t.canSwipe = !0 6543 6544 } else this.pinchDown(e) 6545 6546 } 6547 6548 }, { 6549 6550 key: "onScroll", 6551 6552 value: function (e) { } 6553 6554 }, { 6555 6556 key: "resetPageTween", 6557 6558 value: function () { 6559 6560 for (var e = this, t = 0; t < e.stackCount; t++) { 6561 6562 var i = e.sheets[t]; 6563 6564 i.currentTween && i.currentTween.complete(!0) 6565 6566 } 6567 6568 e.requestRefresh() 6569 6570 } 6571 6572 }, { 6573 6574 key: "pagesReady", 6575 6576 value: function () { 6577 6578 if (!this.isFlipping()) { 6579 6580 if (!1 === this.app.options.flipbookFitPages) { 6581 6582 var e = this.app.viewer.getBasePage(), 6583
6584 t = this.leftViewport = this.getViewPort(e + (this.isBooklet ? 0 : this.isRTL ? 1 : 0)), 6585 6586 i = this.rightViewPort = this.getViewPort(e + (this.isBooklet || this.isRTL ? 0 : 1)); 6587 6588 if (t) { 6589 6590 var n = se.contain(t.width, t.height, this.availablePageWidth(), this.availablePageHeight()); 6591 6592 this.leftSheetWidth = Math.floor(n.width), this.leftSheetHeight = Math.floor(n.height), this.leftSheetTop = (this.availablePageHeight() - this.leftSheetHeight) / 2 6593 6594 } 6595 6596 if (i) { 6597 6598 var o = se.contain(i.width, i.height, this.availablePageWidth(), this.availablePageHeight()); 6599 6600 this.rightSheetWidth = Math.floor(o.width), this.rightSheetHeight = Math.floor(o.height), this.rightSheetTop = (this.availablePageHeight() - this.rightSheetHeight) / 2 6601 6602 } 6603 6604 this.totalSheetsWidth = this.leftSheetWidth + this.rightSheetWidth; 6605 6606 for (var a = 0; a < this.sheets.length; a++) { 6607 6608 var r = this.sheets[a]; 6609 6610 r.side === re.TURN_DIRECTION.LEFT ? r.updateSize(this.leftSheetWidth, this.leftSheetHeight, this.leftSheetTop) : r.updateSize(this.rightSheetWidth, this.rightSheetHeight, this.rightSheetTop) 6611 6612 } 6613 6614 } 6615 6616 this.updateCenter(), this.updatePendingStatusClass() 6617 6618 } 6619 6620 } 6621 6622 }, { 6623 6624 key: "textureLoadedCallback", 6625 6626 value: function (e) { 6627 6628 this.getPageByNumber(e.pageNumber); 6629 6630 this.pagesReady() 6631 6632 } 6633 6634 }]), n 6635 6636 }(K); 6637 6638 6639 6640 function he(e) { 6641 6642 return he = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 6643 6644 return typeof e 6645 6646 } : function (e) { 6647 6648 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 6649 6650 }, he(e) 6651 6652 } 6653 6654 6655 6656 function pe() { 6657 6658 return pe = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, i) { 6659 6660 var n = function (e, t) { 6661 6662 for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = ye(e));); 6663 6664 return e 6665 6666 }(e, t); 6667 6668 if (n) { 6669 6670 var o = Object.getOwnPropertyDescriptor(n, t); 6671 6672 return o.get ? o.get.call(arguments.length < 3 ? e : i) : o.value 6673 6674 } 6675 6676 }, pe.apply(this, arguments) 6677 6678 } 6679 6680 6681 6682 function ce(e, t) { 6683 6684 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 6685 6686 } 6687 6688 6689 6690 function de(e, t) { 6691 6692 for (var i = 0; i < t.length; i++) { 6693 6694 var n = t[i]; 6695 6696 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 6697 6698 if ("object" !== he(e) || null === e) return e; 6699 6700 var i = e[Symbol.toPrimitive]; 6701 6702 if (void 0 !== i) { 6703 6704 var n = i.call(e, t || "default"); 6705 6706 if ("object" !== he(n)) return n; 6707 6708 throw new TypeError("@@toPrimitive must return a primitive value.") 6709 6710 } 6711 6712 return ("string" === t ? String : Number)(e) 6713 6714 }(o, "string"), "symbol" === he(a) ? a : String(a)), n) 6715 6716 } 6717 6718 var o, a 6719 6720 } 6721 6722 6723 6724 function fe(e, t, i) { 6725 6726 return t && de(e.prototype, t), i && de(e, i), Object.defineProperty(e, "prototype", { 6727 6728 writable: !1 6729 6730 }), e 6731 6732 } 6733 6734 6735 6736 function ge(e, t) { 6737 6738 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 6739 6740 e.prototype = Object.create(t && t.prototype, { 6741 6742 constructor: { 6743 6744 value: e, 6745 6746 writable: !0, 6747 6748 configurable: !0 6749 6750 } 6751 6752 }), Object.defineProperty(e, "prototype", { 6753 6754 writable: !1 6755 6756 }), t && ve(e, t) 6757 6758 } 6759 6760 6761 6762 function ve(e, t) { 6763 6764 return ve = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 6765 6766 return e.__proto__ = t, e 6767 6768 }, ve(e, t) 6769 6770 } 6771 6772 6773 6774 function me(e) { 6775 6776 var t = function () { 6777 6778 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 6779 6780 if (Reflect.construct.sham) return !1; 6781 6782 if ("function" == typeof Proxy) return !0; 6783 6784 try { 6785 6786 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 6787 6788 } catch (e) { 6789 6790 return !1 6791 6792 } 6793 6794 }(); 6795 6796 return function () { 6797 6798 var i, n = ye(e); 6799 6800 if (t) { 6801 6802 var o = ye(this).constructor; 6803 6804 i = Reflect.construct(n, arguments, o) 6805 6806 } else i = n.apply(this, arguments); 6807 6808 return function (e, t) { 6809 6810 if (t && ("object" === he(t) || "function" == typeof t)) return t; 6811 6812 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 6813 6814 return function (e) { 6815 6816 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 6817 6818 return e 6819 6820 }(e) 6821 6822 }(this, i) 6823 6824 } 6825 6826 } 6827 6828 6829 6830 function ye(e) { 6831 6832 return ye = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 6833 6834 return e.__proto__ || Object.getPrototypeOf(e) 6835 6836 }, ye(e) 6837 6838 } 6839 6840 var be = e.utils, 6841 6842 we = function (e) { 6843 6844 ge(i, e); 6845 6846 var t = me(i); 6847 6848 6849 6850 function i() { 6851 6852 return ce(this, i), t.apply(this, arguments) 6853 6854 } 6855 6856 return fe(i, [{ 6857 6858 key: "init", 6859 6860 value: function () { 6861 6862 var e = this, 6863 6864 t = e.element = jQuery("<div>", { 6865 6866 class: "pf-sheet" 6867 6868 }); 6869 6870 (e.frontPage = new O).element.addClass("pf-page-front").appendTo(e.element), (e.backPage = new O).element.addClass("pf-page-back").appendTo(e.element), this.parentElement.append(t), this.frontPage.sheet = this.backPage.sheet = this 6871 6872 } 6873 6874 }, { 6875 6876 key: "completeTween", 6877 6878 value: function () { 6879 6880 var e = this; 6881 6882 e.isFlipping = !1, e.viewer.onFlip(), e.viewer.afterFlip(), e.viewer.requestRefresh(), e.element[0].style.opacity = 1 6883 6884 } 6885 6886 }, { 6887 6888 key: "flip", 6889 6890 value: function (e) { 6891 6892 this.side = this.targetSide, this.completeTween() 6893 6894 } 6895 6896 }, { 6897 6898 key: "updateSize", 6899 6900 value: function (e, t, i) { 6901 6902 e = Math.floor(e), t = Math.floor(t), i = Math.floor(i), this.element[0].style.height = this.frontPage.element[0].style.height = t + "px", this.element[0].style.width = this.frontPage.element[0].style.width = e + "px", this.element[0].style.transform = "translateX("
6902+ this.positionX + "px) translateY(" + i + "px)" 6903 6904 } 6905 6906 }]), i 6907 6908 }(le), 6909 6910 Pe = function (t) { 6911 6912 ge(n, t); 6913 6914 var i = me(n); 6915 6916 6917 6918 function n(t, o) { 6919 6920 var a; 6921 6922 return ce(this, n), t.viewerClass = "pf-slider", t.pageMode = e.FLIPBOOK_PAGE_MODE.SINGLE, t.singlePageMode = e.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET, t.pageSize = e.FLIPBOOK_PAGE_SIZE.SINGLE, (a = i.call(this, t, o)).stackCount = 10, a.soundOn = !1, a.foldSense = 0, o._viewerPrepared(), a 6923 6924 } 6925 6926 return fe(n, [{ 6927 6928 key: "initPages", 6929 6930 value: function () { 6931 6932 for (var e = 0; e < this.stackCount; e++) { 6933 6934 var t = new we({ 6935 6936 parentElement: this.wrapper 6937 6938 }); 6939 6940 t.index = e, t.viewer = this, this.sheets.push(t), this.pages.push(t.frontPage), this.pages.push(t.backPage) 6941 6942 } 6943 6944 } 6945 6946 }, { 6947 6948 key: "resize", 6949 6950 value: function () { 6951 6952 pe(ye(n.prototype), "resize", this).call(this), this.skipTransition = !0 6953 6954 } 6955 6956 }, { 6957 6958 key: "refreshSheet", 6959 6960 value: function (t) { 6961 6962 var i = t.sheet, 6963 6964 n = t.sheetNumber; 6965 6966 i.element.toggleClass("pf-no-transition", i.skipFlip || this.skipTransition), !1 === i.isFlipping && (t.needsFlip ? i.flip() : (i.skipFlip = !1, i.element.removeClass("pf-flipping pf-quick-turn pf-folding pf-left-side pf-right-side"), i.element.addClass(i.targetSide === e.TURN_DIRECTION.LEFT ? "pf-left-side" : "pf-right-side"), i.side = i.targetSide)), i.visible = t.visible, i.updateCSS({ 6967 6968 display: t.sheetNumber > 0 && t.sheetNumber <= this.app.pageCount ? "block" : "none", 6969 6970 zIndex: t.zIndex 6971 6972 }), n !== i.pageNumber && (i.element.attr("number", n), i.backPage.element.attr("pagenumber", i.backPage.pageNumber), i.frontPage.element.attr("pagenumber", i.frontPage.pageNumber)) 6973 6974 } 6975 6976 }, { 6977 6978 key: "refresh", 6979 6980 value: function () { 6981 6982 pe(ye(n.prototype), "refresh", this).call(this), this.skipTransition = !1 6983 6984 } 6985 6986 }, { 6987 6988 key: "eventToPoint", 6989 6990 value: function (e) { 6991 6992 var t = pe(ye(n.prototype), "eventToPoint", this).call(this, e); 6993 6994 return t.isInsideSheet = jQuery(e.srcElement).closest(".pf-page").length > 0, t.isInsideCorner = !1, t 6995 6996 } 6997 6998 }, { 6999 7000 key: "initCustomControls", 7001 7002 value: function () { 7003 7004 var e = this.app.ui.controls; 7005 7006 e.pageMode && e.pageMode.hide() 7007 7008 } 7009 7010 }, { 7011 7012 key: "setPageMode", 7013 7014 value: function (e) { 7015 7016 e.isSingle = !0, pe(ye(n.prototype), "setPageMode", this).call(this, e) 7017 7018 } 7019 7020 }, { 7021 7022 key: "pagesReady", 7023 7024 value: function () { 7025 7026 if (!this.isFlipping()) { 7027 7028 for (var e = 0, t = 0, i = this.app, n = (Math.floor(this.stackCount / 2), []), o = i.currentPageNumber, a = 0; a < this.stackCount / 2; a++) n.push(o + a), n.push(o - a - 1); 7029 7030 for (var r = 0; r < this.stackCount; r++) { 7031 7032 var s = n[r]; 7033 7034 if (this.getPageByNumber(s)) { 7035 7036 var l = this.getPageByNumber(s).sheet, 7037 7038 u = this.getViewPort(l.pageNumber, !0), 7039 h = be.contain(u.width, u.height, this.availablePageWidth(), this.availablePageHeight()); 7040 7041 i.currentPageNumber === l.pageNumber && (this.leftSheetWidth = this.rightSheetWidth = Math.floor(h.width)), i.currentPageNumber > l.pageNumber ? (e -= Math.floor(h.width) + 10, l.positionX = e) : (l.positionX = t, t += Math.floor(h.width) + 10);
7042 7043 var p = (this.availablePageHeight() - h.height) / 2; 7044 7045 l.updateSize(Math.floor(h.width * i.zoomValue), Math.floor(h.height * i.zoomValue), p) 7046 7047 } 7048 7049 } 7050 7051 this.updateCenter(), this.updatePendingStatusClass() 7052 7053 } 7054 7055 } 7056 7057 }]), n 7058 7059 }(ue); 7060 7061 7062 7063 function Se(e) { 7064 7065 return Se = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 7066 7067 return typeof e 7068 7069 } : function (e) { 7070 7071 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 7072 7073 }, Se(e) 7074 7075 } 7076 7077 7078 7079 function Ce() { 7080 7081 return Ce = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, i) { 7082 7083 var n = function (e, t) { 7084 7085 for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = Ne(e));); 7086 7087 return e 7088 7089 }(e, t); 7090 7091 if (n) { 7092 7093 var o = Object.getOwnPropertyDescriptor(n, t); 7094 7095 return o.get ? o.get.call(arguments.length < 3 ? e : i) : o.value 7096 7097 } 7098 7099 }, Ce.apply(this, arguments) 7100 7101 } 7102 7103 7104 7105 function Te(e, t) { 7106 7107 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 7108 7109 } 7110 7111 7112 7113 function xe(e, t) { 7114 7115 for (var i = 0; i < t.length; i++) { 7116 7117 var n = t[i]; 7118 7119 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 7120 7121 if ("object" !== Se(e) || null === e) return e; 7122 7123 var i = e[Symbol.toPrimitive]; 7124 7125 if (void 0 !== i) { 7126 7127 var n = i.call(e, t || "default"); 7128 7129 if ("object" !== Se(n)) return n; 7130 7131 throw new TypeError("@@toPrimitive must return a primitive value.") 7132 7133 } 7134 7135 return ("string" === t ? String : Number)(e) 7136 7137 }(o, "string"), "symbol" === Se(a) ? a : String(a)), n) 7138 7139 } 7140 7141 var o, a 7142 7143 } 7144 7145 7146 7147 function ke(e, t, i) { 7148 7149 return t && xe(e.prototype, t), i && xe(e, i), Object.defineProperty(e, "prototype", { 7150 7151 writable: !1 7152 7153 }), e 7154 7155 } 7156 7157 7158 7159 function Ee(e, t) { 7160 7161 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 7162 7163 e.prototype = Object.create(t && t.prototype, { 7164 7165 constructor: { 7166 7167 value: e, 7168 7169 writable: !0, 7170 7171 configurable: !0 7172 7173 } 7174 7175 }), Object.defineProperty(e, "prototype", { 7176 7177 writable: !1 7178 7179 }), t && Oe(e, t) 7180 7181 } 7182 7183 7184 7185 function Oe(e, t) { 7186 7187 return Oe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 7188 7189 return e.__proto__ = t, e 7190 7191 }, Oe(e, t) 7192 7193 } 7194 7195 7196 7197 function Re(e) { 7198 7199 var t = function () { 7200 7201 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 7202 7203 if (Reflect.construct.sham) return !1; 7204 7205 if ("function" == typeof Proxy) return !0; 7206 7207 try { 7208 7209 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 7210 7211 } catch (e) { 7212 7213 return !1 7214 7215 } 7216 7217 }(); 7218 7219 return function () { 7220 7221 var i, n = Ne(e); 7222 7223 if (t) { 7224 7225 var o = Ne(this).constructor; 7226 7227 i = Reflect.construct(n, arguments, o) 7228 7229 } else i = n.apply(this, arguments); 7230 7231 return function (e, t) { 7232 7233 if (t && ("object" === Se(t) || "function" == typeof t)) return t; 7234 7235 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 7236 7237 return Le(e) 7238 7239 }(this, i) 7240 7241 } 7242 7243 } 7244 7245 7246 7247 function Le(e) { 7248 7249 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 7250 7251 return e 7252 7253 } 7254 7255 7256 7257 function Ne(e) { 7258 7259 return Ne = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 7260 7261 return e.__proto__ || Object.getPrototypeOf(e) 7262 7263 }, Ne(e) 7264 7265 } 7266 7267 var Ie = e, 7268 7269 _e = Ie.utils, 7270 7271 Ae = function (e) { 7272 7273 Ee(i, e); 7274 7275 var t = Re(i); 7276 7277 7278 7279 function i(e) { 7280 7281 var n; 7282 7283 return Te(this, i), (n = t.call(this, e)).flexibility = e.flexibility, n.sheetAngle = 180, n.curveAngle = 0, n.parent3D = e.parent3D, n.segments = e.segments || 50, n.width = e.width || 100, n.height = e.height || 100, n.depth = e.depth || .5, n.matColor = "white", n.fallbackMatColor = Fe.WHITE_COLOR, n.init(), n.bumpScale = [0, 0, 0, 0, 1, 1], n 7284 7285 } 7286 7287 return ke(i, [{ 7288 7289 key: "init", 7290 7291 value: function () { 7292 7293 var e = this; 7294 7295 e.element = new Fe.Paper({ 7296 7297 parent3D: e.parent3D, 7298 7299 segments: e.segments, 7300 7301 depth: e.depth, 7302 7303 height: e.height, 7304 7305 width: e.width, 7306 7307 flatShading: 0 === e.flexibility 7308 7309 }), e.element.sheet = e, e.frontPage = new De({ 7310 7311 sheet: e, 7312 7313 face: 5 7314 7315 }), e.backPage = new De({ 7316 7317 sheet: e, 7318 7319 face: 4 7320 7321 }), e.reset(), e.updateAngle() 7322 7323 } 7324 7325 }, { 7326 7327 key: "setMatColor", 7328 7329 value: function (e, t) { 7330 7331 if (this.matColor = new THREE.Color(e), void 0 === t) 7332 7333 for (var i = 0; i < 6; i++) this.element.material[i].color = this.matColor; 7334 7335 else this.element.material[t].color = this.matColor 7336 7337 } 7338 7339 }, { 7340 7341 key: "getBumpScale",
7342 7343 value: function (e) { 7344 7345 return this.bumpScale[e] 7346 7347 } 7348 7349 }, { 7350 7351 key: "resetMatColor", 7352 7353 value: function (e, t) { 7354 7355 this.element.material[e].color = t ? this.matColor : this.fallbackMatColor 7356 7357 } 7358 7359 }, { 7360 7361 key: "frontImage", 7362 7363 value: function (e, t) { 7364 7365 this.element.frontImage(e, t) 7366 7367 } 7368 7369 }, { 7370 7371 key: "backImage", 7372 7373 value: function (e, t) { 7374 7375 this.element.backImage(e, t) 7376 7377 } 7378 7379 }, { 7380 7381 key: "updateAngle", 7382 7383 value: function () { 7384 7385 var e = this; 7386 7387 if (void 0 !== this.viewer && null !== this.viewer) { 7388 7389 var t = !0 === e.isHard ? 0 : e.flexibility, 7390 7391 i = ("vertical" === this.viewer.orientation ? this.height : this.width) * (1 - Math.sin(t / 2 * (t / 2)) / 2 - t / 20); 7392 7393 this.element.scale.y = ("vertical" === this.viewer.orientation ? this.width : this.height) / this.element.geometry.parameters.height; 7394 7395 var n = e.segments, 7396 7397 o = i / 1, 7398 7399 a = o * t, 7400 7401 r = o, 7402 7403 s = [], 7404 7405 l = [], 7406 7407 u = [], 7408 7409 h = [], 7410 7411 p = [], 7412 7413 c = [], 7414 7415 d = e.depth, 7416 7417 f = 0, 7418 7419 g = []; 7420 7421 g.push(f), p[0] = [], c[0] = []; 7422 7423 var v = e.sheetAngle * Math.PI / 180; 7424 7425 "vertical" !== this.viewer.orientation && (this.element.position.x = -Math.cos(v) * this.viewer.pageOffset), "vertical" === this.viewer.orientation && (this.element.position.y = Math.cos(v) * this.viewer.pageOffset); 7426 7427 var m = !0 === e.isHard ? v : e.curveAngle * Math.PI / 180, 7428 7429 y = e.sheetAngle * Math.PI / 180, 7430 7431 b = y - Math.PI / 2, 7432 7433 w = Math.sin(b) * d / 2; 7434 7435 p[0][0] = p[0][1] = new THREE.Vector3(-r * Math.cos(v), 0, Math.sin(v) * r - w), c[0][0] = c[0][1] = new THREE.Vector3(p[0][0].x - Math.cos(b) * d, 0, p[0][0].z + 2 * w), p[0][1] = new THREE.Vector3(-r / 2 * Math.cos(m), 0, r / 2 * Math.sin(m) - w), c[0][1] = new THREE.Vector3(p[0][1].x - Math.cos(b) * d, 0, p[0][1].z + 2 * w), y = (45 + e.sheetAngle / 2) * Math.PI / 180, p[0][2] = new THREE.Vector3(-Math.cos(y) * a / 2, 0, Math.sin(y) * a - w), c[0][2] = new THREE.Vector3(p[0][2].x + Math.cos(b) * d, 0, p[0][2].z + 2 * w), Math.abs(c[0][2].x - 0) < 5e-4 && (c[0][2].x = 0), p[0][3] = new THREE.Vector3(0, 0, -w), c[0][3] = new THREE.Vector3(p[0][3].x - Math.cos(b) * d, 0, p[0][3].z + 2 * w), Math.abs(c[0][3].x - 0) < 5e-4 && (c[0][3].x = 0); 7436 7437 for (var P = 0; P < 1; P++) { 7438 7439 var S = Math.max(e.segments - 1, 1); 7440 7441 s[P] = new THREE.CubicBezierCurve3(p[P][0], p[P][1], p[P][2], p[P][3]), u[P] = s[P].getPoints(S), S > 2 && u[P].push((new THREE.Vector3).copy(u[P][S])); 7442 7443 for (var C = void 0, T = u[P][0], x = 1; x < u[P].length; x++) f += (C = u[P][x]).distanceTo(T), g.push(f), T = C; 7444 7445 l[P] = new THREE.CubicBezierCurve3(c[P][0], c[P][1], c[P][2], c[P][3]), h[P] = l[P].getPoints(S), S > 2 && h[P].push((new THREE.Vector3).copy(h[P][S])) 7446 7447 } 7448 7449 var k = e.element.geometry; 7450 7451 if (void 0 !== k.attributes) { 7452 7453 var E = k.attributes.position, 7454 7455 O = k.attributes.uv, 7456 7457 R = n + 1; 7458 7459 E.setZ(0, u[0][n].z), E.setZ(2, u[0][n].z), E.setX(0, u[0][n].x), E.setX(2, u[0][n].x), E.setZ(1, h[0][n].z), E.setZ(3, h[0][n].z), E.setX(1, h[0][n].x), E.setX(3, h[0][n].x), E.setZ(5, u[0][0].z), E.setZ(7, u[0][0].z), E.setX(5, u[0][0].x), E.setX(7, u[0][0].x), E.setZ(4, h[0][0].z), E.setZ(6, h[0][0].z), E.setX(4, h[0][0].x), E.setX(6, h[0][0].x); 7460 7461 for (var L = 0; L < 1; L++) 7462 7463 for (var N = 0; N < R; N++) E.setZ(8 + 0 * R + N, u[0][N].z), E.setX(8 + 0 * R + N, u[0][N].x), E.setZ(8 + 1 * R + N, h[0][N].z), E.setX(8 + 1 * R + N, h[0][N].x), E.setZ(8 + 2 * R + N, u[0][N].z), E.setX(8 + 2 * R + N, u[0][N].x), E.setZ(8 + 3 * R + N, h[0][N].z), E.setX(8 + 3 * R + N, h[0][N].x), E.setZ(8 + 4 * R + N, u[0][N].z), E.setX(8 + 4 * R + N, u[0][N].x), E.setZ(8 + 5 * R + N, u[0][N].z), E.setX(8 + 5 * R + N, u[0][N].x), O.setX(8 + 4 * R + N, g[N] / f), O.setX(8 + 5 * R + N, g[N] / f), E.setZ(8 + 6 * R + N, h[0][n - N].z), E.setX(8 + 6 * R + N, h[0][n - N].x), E.setZ(8 + 7 * R + N, h[0][n - N].z), E.setX(8 + 7 * R + N, h[0][n - N].x), O.setX(8 + 6 * R + N, 1 - g[n - N] / f), O.setX(8 + 7 * R + N, 1 - g[n - N] / f); 7464 7465 k.computeBoundingBox(), e.element.scale.x = 1 * r / f, k.computeBoundingSphere(), E.needsUpdate = !0, O.needsUpdate = !0, k.computeVertexNormals() 7466 7467 } else { 7468 7469 var I = k.vertices, 7470 7471 _ = n - 1, 7472 7473 A = 8; 7474 7475 I[0].z = I[2].z = u[0][n].z, I[0].x = I[2].x = u[0][n].x, I[1].z = I[3].z = h[0][n].z, I[1].x = I[3].x = h[0][n].x, I[5].z = I[7].z = u[0][0].z, I[5].x = I[7].x = u[0][0].x, I[4].z = I[6].z = h[0][0].z, I[4].x = I[6].x = h[0][0].x; 7476 7477 for (var M = 0; M < 1; M++) 7478 7479 for (var D = 1; D < n; D++) I[A].z = I[A + 3 * _].z = h[0][D].z, I[A].x = I[A + 3 * _].x = h[0][D].x, I[A + _].z = I[A + 2 * _].z = u[0][D].z, I[A + _].x = I[A + 2 * _].x = u[0][D].x, A++; 7480 7481 for (var F = k.faceVertexUvs[0], z = k.faces, B = 0, H = 0; H < F.length; H++) 7482 7483 if (z[H].materialIndex === Fe.MATERIAL_FACE.BACK) { 7484 7485 var U = g[B] / f; 7486 7487 H % 2 == 0 ? (F[H][0].x = F[H][1].x = F[H + 1][0].x = U, B++) : F[H - 1][2].x = F[H][1].x = F[H][2].x = U 7488 7489 } else if (z[H].materialIndex === Fe.MATERIAL_FACE.FRONT) { 7490
7491 var j = 1 - g[B] / f; 7492 7493 H % 2 == 0 ? (F[H][0].x = F[H][1].x = F[H + 1][0].x = j, B--) : F[H - 1][2].x = F[H][1].x = F[H][2].x = j 7494 7495 } 7496 7497 k.computeBoundingBox(), e.element.scale.x = 1 * r / f, k.computeBoundingSphere(), k.verticesNeedUpdate = !0, k.computeFaceNormals(), k.computeVertexNormals(), k.uvsNeedUpdate = !0, k.normalsNeedUpdate = !0 7498 7499 } 7500 7501 s.forEach((function (e) { 7502 7503 null 7504 7505 })), l.forEach((function (e) { 7506 7507 null 7508 7509 })), h.forEach((function (e) { 7510 7511 null 7512 7513 })), u.forEach((function (e) { 7514 7515 null 7516 7517 })) 7518 7519 } 7520 7521 } 7522 7523 }, { 7524 7525 key: "flip", 7526 7527 value: function (e, t) { 7528 7529 var i = this, 7530 7531 n = i.viewer.isBooklet; 7532 7533 1 == i.isCover && (0 === e && (e = 2.5 * i.viewer.flexibility), 180 === e && (e -= 2.5 * i.viewer.flexibility)); 7534 7535 var o = t - e, 7536 7537 a = e > 90, 7538 7539 r = i.viewer.isRTL, 7540 7541 s = a ? i.backPage.pageNumber : i.frontPage.pageNumber, 7542 7543 l = this.viewer.getViewPort(s); 7544 7545 l && (l = _e.contain(l.width, l.height, i.viewer.availablePageWidth(), i.viewer.availablePageHeight())); 7546 7547 var u = -(i.viewer.has3DCover && i.viewer.isClosedPage() ? i.viewer.coverExtraWidth : 0), 7548 7549 h = -(i.viewer.has3DCover && i.viewer.isClosedPage() ? i.viewer.coverExtraHeight : 0); 7550 7551 i.init = { 7552 7553 angle: e, 7554 7555 angle2: a ? 180 : 0, 7556 7557 height: a ? i.viewer.rightSheetHeight : i.viewer.leftSheetHeight, 7558 7559 width: a ? i.viewer.rightSheetWidth : i.viewer.leftSheetWidth, 7560 7561 index: a && !r || !a && r ? 1 : 0, 7562 7563 _index: 0 7564 7565 }, i.first = { 7566 7567 angle: e + o / 4, 7568 7569 angle2: 90, 7570 7571 index: a && !r || !a && r ? 1 : .25 7572 7573 }, i.mid = { 7574 7575 angle: e + 2 * o / 4, 7576 7577 angle2: a ? 45 : 135, 7578 7579 index: .5 7580 7581 }, i.mid2 = { 7582 7583 angle: e + 3 * o / 4, 7584 7585 angle2: a ? 0 : 180, 7586 7587 index: a && !r || !a && r ? .25 : 1 7588 7589 }, i.end = { 7590 7591 angle: t, 7592 7593 angle2: a ? 0 : 180, 7594 7595 index: a && !r || !a && r ? 0 : 1, 7596 7597 height: h + (l ? l.height : i.height), 7598 7599 width: u + (l ? l.width : i.width) 7600 7601 }, i.isFlipping = !0; 7602 7603 n && (!a && !r || a && r) && (i.element.material[5].opacity = i.element.material[4].opacity = 0, i.element.castShadow = !1), i.currentTween = new TWEEN.Tween(i.init).to({ 7604 7605 angle: [i.first.angle, i.mid.angle, i.mid2.angle, i.end.angle], 7606 7607 angle2: [i.first.angle2, i.mid.angle2, i.mid2.angle2, i.end.angle2], 7608 7609 index: [i.first.index, i.mid.index, i.mid2.index, i.end.index], 7610 7611 _index: 1, 7612 7613 height: i.end.height, 7614 7615 width: i.end.width 7616 7617 }
7617, i.viewer.app.options.duration).onUpdate((function (e) { 7618 7619 ! function (e) { 7620 7621 i.sheetAngle = e.angle, i.curveAngle = i.isHard ? e.angle : e.angle2, !0 === i.isHard ? (i.flexibility = 0, i.isCover && i.viewer.flipCover(i)) : i.flexibility = e.angle < 90 ? i.leftFlexibility : i.rightFlexibility, i.element.position.z = (e.angle < 90 ? i.leftPos : i.rightPos) + i.depth, n && (i.element.material[5].opacity = i.element.material[4].opacity = e.index, i.element.castShadow = e.index > .5), i.height = e.height, i.width = e.width, i.updateAngle(!0) 7622 7623 }(this) 7624 7625 })).easing(TWEEN.Easing.Sinusoidal.Out).onStop((function () { 7626 7627 i.currentTween = null, i.isFlipping = !1, i.isCover && (i.viewer.leftCover.isFlipping = !1, i.viewer.rightCover.isFlipping = !1), i.element.material[5].opacity = i.element.material[4].opacity = 1 7628 7629 })).onComplete((function () { 7630 7631 i.updateAngle(), i.element.material[5].opacity = i.element.material[4].opacity = 1, i.element.castShadow = !0, i.isFlipping = !1, i.isCover && (i.viewer.leftCover.isFlipping = !1, i.viewer.rightCover.isFlipping = !1), i.side = i.targetSide, i.viewer.onFlip(), i.viewer.afterFlip(), i.currentTween = null, i.viewer && i.viewer.requestRefresh && i.viewer.requestRefresh() 7632 7633 })).start(), i.currentTween.update(window.performance.now()) 7634 7635 } 7636 7637 }]), i 7638 7639 }(X), 7640 7641 Me = function (t) { 7642 7643 Ee(n, t); 7644 7645 var i = Re(n); 7646 7647 7648 7649 function n(e, t) { 7650 7651 var o, a, r, s, l; 7652 7653 return Te(this, n), e.viewerClass = "pf-flipbook-3d", (l = i.call(this, e, t)).pageOffset = 5, l.spiralCount = 20, l.groundDistance = null !== (o = e.groundDistance) && void 0 !== o ? o : 2, l.hasSpiral = "true" === e.hasSpiral || !0 === e.hasSpiral, l.flexibility = _e.limitAt(null !== (a = e.flexibility) && void 0 !== a ? a : .9, 0, 10), l.hasSpiral && (l.flexibility = 0), 0 == l.flexibility && (e.sheetSegments = 8), l.drag3D = !1, l.texturePowerOfTwo = !_e.isMobile && (null === (r = e.texturePowerOfTwo) || void 0 === r || r), l.color3DSheets = null !== (s = l.app.options.color3DSheets) && void 0 !== s ? s : "white", l.midPosition = 0, l.initMOCKUP((function () { 7654 7655 t._viewerPrepared() 7656 7657 })), l 7658 7659 } 7660 7661 return ke(n, [{ 7662 7663 key: "initMOCKUP", 7664 7665 value: function (e) { 7666 7667 var t = this.app; 7668 7669 "undefined" == typeof THREE ? (t.updateInfo(t.options.text.loading + " WEBGL 3D ..."), "function" == typeof window.define && window.define.amd && window.requirejs ? (window.requirejs.config({ 7670 7671 paths: { 7672 7673 three: t.options.threejsSrc.replace(".js", "") 7674 7675 }, 7676 7677 shim: { 7678 7679 three: { 7680 7681 exports: "THREE" 7682 7683 } 7684 7685 } 7686 7687 }), window.require(["three"], (function (t) { 7688 7689 return window.THREE = t, Fe.init(), "function" == typeof e && e(), t 7690 7691 }))) : "function" == typeof window.define && window.define.amd ? window.require(["three", t.options.threejsSrc.replace(".js", "")], (function (t) { 7692 7693 t((function () { 7694 7695 Fe.init(), "function" == typeof e && e() 7696 7697 })) 7698 7699 })) : _e.getScript(t.options.threejsSrc + "?ver=" + Ie.version, (function () { 7700 7701 Fe.init(), "function" == typeof e && e() 7702 7703 }), (function () { 7704 7705 t.updateInfo("Unable to load THREE.js...") 7706 7707 }))) : (Fe.init(), "function" == typeof e && e()) 7708 7709 } 7710 7711 }, { 7712 7713 key: "init", 7714 7715 value: function () { 7716 7717 var e = this.app; 7718 7719 Ce(Ne(n.prototype), "init", this).call(this); 7720 7721 e.provider.defaultPage.pageRatio; 7722 7723 this.pageScaleX = 1, this.initDepth(), this.initStage(), this.initPages(), this.initEvents(), this.render() 7724 7725 } 7726 7727 }, { 7728 7729 key: "updatePageMode", 7730 7731 value: function () { 7732 7733 Ce(Ne(n.prototype), "updatePageMode", this).call(this); 7734 7735 var t = this.app; 7736 7737 this.has3DCover = t.options.cover3DType !== e.FLIPBOOK_COVER_TYPE.NONE && t.pageCount > 7 && !this.isBooklet, this.has3DCover && "none" === t.options.flipbookHardPages && (t.options.flipbookHardPages = "cover") 7738 7739 } 7740 7741 }, { 7742 7743 key: "initDepth", 7744 7745 value: function () { 7746 7747 var e, t; 7748 7749 this.sheetDepth = this.pageScaleX * (null !== (e = this.app.options.sheetDepth) && void 0 !== e ? e : .5), this.sheetSegments = null !== (t = this.app.options.sheetSegments) && void 0 !== t ? t : 20, this.coverDepth = 2 * this.sheetDepth, this.sheetsDepth = Math.min(10, this.app.pageCount / 4) * this.sheetDepth 7750 7751 } 7752 7753 }, { 7754 7755 key: "initStage", 7756 7757 value: function () { 7758 7759 var e = this, 7760 7761 t = e.stage = new Fe.Stage({ 7762 7763 pixelRatio: e.app.options.pixelRatio 7764 7765 }); 7766 7767 (t.canvas = jQuery(t.renderer.domElement).addClass("pf-3dcanvas")).appendTo(this.element), t.camera.position.set(0, 0, 600), t.camera.lookAt(new THREE.Vector3(0, 0, 0)), e.camera = t.camera, t.spotLight.position.set(-220, 220, 550), t.spotLight.castShadow = !_e.isMobile && e.app.options.has3DShadow, t.spotLight.shadow && (t.spotLight.shadow.bias = -.005), t.ambientLight.color = new THREE.Color("#fff"), t.ambientLight.intensity = .82; 7768 7769 var i = new THREE.ShadowMaterial; 7770 7771 i.opacity = e.app.options.shadowOpacity, t.ground.oldMaterial = t.ground.material, t.ground.material = i, t.ground.position.z = this.has3DCover ? -6 : -4, t.selectiveRendering = !0; 7772 7773 var n = t.cssRenderer = new THREE.CSS3DRenderer; 7774 7775 jQuery(n.domElement).css({ 7776 7777 position: "absolute",
7778 7779 top: 0, 7780 7781 pointerEvents: "none" 7782 7783 }).addClass("pf-3dcanvas pf-csscanvas"), e.element[0].appendChild(n.domElement), t.cssScene = new THREE.Scene, e.wrapper.remove(), e.wrapper = new THREE.Group, e.stage.add(e.wrapper), e.wrapper.add(t.ground), e.bookWrapper = new THREE.Group, e.bookWrapper.name = "bookwrapper", e.wrapper.add(e.bookWrapper), e.bookHelper = t.bookHelper = new THREE.BoxHelper(e.bookWrapper, 16776960), t.add(e.bookHelper), e.bookHelper.visible = !1, e.cameraWrapper = new THREE.Group, e.cameraWrapper.add(t.camera), t.add(e.cameraWrapper), e.app.renderRequestStatus = Ie.REQUEST_STATUS.ON 7784 7785 } 7786 7787 }, { 7788 7789 key: "initPages", 7790 7791 value: function () { 7792 7793 for (var e = { 7794 7795 parent3D: this.bookWrapper, 7796 7797 viewer: this, 7798 7799 segments: this.sheetSegments, 7800 7801 depth: this.sheetDepth, 7802 7803 flexibility: this.flexibility 7804 7805 }, t = 0; t < this.stackCount; t++) { 7806 7807 var i = new Ae(e); 7808 7809 i.index = t, i.viewer = this, this.sheets.push(i), i.setMatColor(this.color3DSheets), this.pages.push(i.frontPage), this.pages.push(i.backPage), this.stage.cssScene.add(i.frontPage.cssPage), this.stage.cssScene.add(i.backPage.cssPage) 7810 7811 } 7812 7813 e.depth = this.sheetsDepth, e.segments = 1, e.flexibility = 0, this.leftSheets = new Ae(e), this.rightSheets = new Ae(e), this.leftSheets.setMatColor(this.color3DSheets), this.rightSheets.setMatColor(this.color3DSheets), e.depth = this.coverDepth, this.leftCover = new Ae(e), this.rightCover = new Ae(e), this.leftCover.isHard = !0, this.rightCover.isHard = !0, this.set3DCoverNormal(), this.setcolor3DCover(this.app.options.color3DCover), this.stage.cssScene.add(this.leftCover.frontPage.cssPage), this.stage.cssScene.add(this.rightCover.backPage.cssPage), this.zoomViewer.leftPage.element.css({ 7814 7815 backgroundColor: this.color3DSheets 7816 7817 }), this.zoomViewer.rightPage.element.css({ 7818 7819 backgroundColor: this.color3DSheets 7820 7821 }), "vertical" === this.orientation && this.bookWrapper.children.forEach((function (e) { 7822 7823 e.rotateZ(THREE.MathUtils.degToRad(-90)), e.textureCenter = new THREE.Vector2(.5, .5), e.textureRotation = 90 7824 7825 })), this.initSpiral() 7826 7827 } 7828 7829 }, { 7830 7831 key: "initSpiral", 7832 7833 value: function () { 7834 7835 var e; 7836 7837 if (this.app.pageCount < 3 && (this.hasSpiral = !1), !0 === this.hasSpiral) { 7838 7839 this.spirals = new THREE.Group, this.leftHoles = new THREE.Group, this.rightHoles = new THREE.Group, this.spiralGroup = new THREE.Group; 7840 7841 var t = new THREE.TorusGeometry(30, 2, 6, 20), 7842 7843 i = new THREE.MeshPhongMaterial({ 7844 7845 color: null !== (e = this.app.options.spiralColor) && void 0 !== e ? e : 8947848 7846 7847 }), 7848 7849 n = new THREE.Mesh(t, i); 7850 7851 n.castShadow = !0, n.rotateX(-THREE.MathUtils.degToRad(-90)); 7852 7853 for (var o = new THREE.Mesh(new THREE.BoxGeometry(8, 15, 5, 1, 1, 1), new THREE.MeshBasicMaterial({ 7854 7855 color: 4473924 7856 7857 })), a = new THREE.Mesh(new THREE.BoxGeometry(8, 15, 5, 1, 1, 1), new THREE.MeshBasicMaterial({ 7858 7859 color: 4473924 7860 7861 })), r = 0; r < this.spiralCount; r++) { 7862 7863 var s = 935 * r / this.spiralCount - 467.5 + 935 / this.spiralCount / 2, 7864 7865 l = n.clone(); 7866 7867 l.position.y = s - 4, this.spirals.add(l), (l = n.clone()).position.y = s + 4, this.spirals.add(l), (l = o.clone()).position.y = s, l.position.x = -28, this.leftHoles.add(l), (l = a.clone()).position.y = s, l.position.x = 28, this.rightHoles.add(l) 7868 7869 } 7870 7871 this.spiralGroup.add(this.spirals), this.spiralGroup.add(this.leftHoles), this.spiralGroup.add(this.rightHoles), this.bookWrapper.add(this.spiralGroup), "vertical" === this.orientation && this.spiralGroup.rotateZ(THREE.MathUtils.degToRad(-90)), this.spiralGroup.scale.set(.1, .1, .1) 7872 7873 } 7874 7875 } 7876 7877 }, { 7878 7879 key: "set3DCoverNormal", 7880 7881 value: function () { 7882 7883 var t = this.app.options.cover3DType; 7884 7885 if (t !== e.FLIPBOOK_COVER_TYPE.PLAIN) { 7886 7887 var i, n = t == e.FLIPBOOK_COVER_TYPE.RIDGE; 7888
7889 this.hasSpiral && 1 == n && (n = !1), this.leftCover.fallbackMatColor = new THREE.Color("#f7f7f7"), this.rightCover.fallbackMatColor = new THREE.Color("#f7f7f7"), this.leftCover.setMatColor(this.color3DSheets, 5), this.rightCover.setMatColor(this.color3DSheets, 4); 7890 7891 var o = 128, 7892 7893 a = "rgb(127,127,255)", 7894 7895 r = document.createElement("canvas"); 7896 7897 r.height = o, r.width = o; 7898 7899 var s = r.getContext("2d"); 7900 7901 s.fillStyle = a, s.fillRect(0, 0, o, o); 7902 7903 var l = 1.92; 7904 7905 (i = s.createLinearGradient(0, 0, l, 0)).addColorStop(0, a), i.addColorStop(1, "rgb(127,255,255)"), s.fillStyle = i, s.beginPath(), s.moveTo(0, 0), s.lineTo(l, l), s.lineTo(l, 126.08), s.lineTo(0, 126.08), s.closePath(), s.fill(), n && ((i = s.createLinearGradient(l, 0, 7.68, 0)).addColorStop(0, "rgb(127,127,255)"), i.addColorStop(.25, "rgb(255,127,255)"), i.addColorStop(.5, "rgb(0,127,255)"), i.addColorStop(.75, "rgb(127,127,255)"), i.addColorStop(1, "rgb(127,127,255)"), s.fillStyle = i, s.fillRect(l, 0, 7.68, o)), (i = s.createLinearGradient(0, l, 0, 0)).addColorStop(0, a), i.addColorStop(1, "rgb(127,255,255)"), s.fillStyle = i, s.beginPath(), s.moveTo(n ? 5.76 : l, 0), s.lineTo(o, 0), s.lineTo(126.08, l), s.lineTo(n ? 7.68 : l, l), s.closePath(), s.fill(), (i = s.createLinearGradient(126.08, 0, o, 0)).addColorStop(0, a), i.addColorStop(1, "rgb(255,127,255)"), s.fillStyle = i, s.beginPath(), s.moveTo(126.08, l), s.lineTo(o, 0), s.lineTo(o, o), s.lineTo(126.08, 126.08), s.closePath(), s.fill(), (i = s.createLinearGradient(0, 126.08, 0, o)).addColorStop(0, a), i.addColorStop(1, "rgb(127,0,255)"), s.fillStyle = i, s.beginPath(), s.moveTo(n ? 7.68 : l, 126.08), s.lineTo(126.08, 126.08), s.lineTo(o, o), s.lineTo(n ? 5.76 : l, o), s.closePath(), s.fill(), this.leftCover.element.loadNormalMap(r, Fe.MATERIAL_FACE.FRONT); 7906 7907 var u = document.createElement("canvas"); 7908 7909 u.height = o, u.width = o; 7910 7911 var h = u.getContext("2d"); 7912 7913 h.fillStyle = a, h.fillRect(0, 0, o, o), (i = h.createLinearGradient(126.08, 0, o, 0)).addColorStop(0, a), i.addColorStop(1, "rgb(255,127,255)"), h.fillStyle = i, h.beginPath(), h.moveTo(126.08, l), h.lineTo(o, 0), h.lineTo(o, o), h.lineTo(126.08, 126.08), h.closePath(), h.fill(), n && ((i = h.createLinearGradient(120.32, 0, 126.08, 0)).addColorStop(0, "rgb(127,127,255)"), i.addColorStop(.25, "rgb(127,127,255)"), i.addColorStop(.5, "rgb(255,127,255)"), i.addColorStop(.75, "rgb(0,127,255)"), i.addColorStop(1, "rgb(127,127,255)"), h.fillStyle = i, h.fillRect(120.32, 0, 5.76, o)), (i = h.createLinearGradient(0, l, 0, 0)).addColorStop(0, a), i.addColorStop(1, "rgb(127,255,255)"), h.fillStyle = i, h.beginPath(), h.moveTo(0, 0), h.lineTo(o - l * (n ? 3 : 0), 0), h.lineTo(o - l * (n ? 4 : 1), l), h.lineTo(l, l), h.closePath(), h.fill(), (i = h.createLinearGradient(0, 0, l, 0)).addColorStop(0, a), i.addColorStop(1, "rgb(127,255,255)"), h.fillStyle = i, h.beginPath(), h.moveTo(0, 0), h.lineTo(l, l), h.lineTo(l, 126.08), h.lineTo(0, 126.08), h.closePath(), h.fill(), (i = h.createLinearGradient(0, 126.08, 0, o)).addColorStop(0, a), i.addColorStop(1, "rgb(127,0,255)"), h.fillStyle = i, h.beginPath(), h.moveTo(l, 126.08), h.lineTo(o - l * (n ? 4 : 1), 126.08), h.lineTo(o - l * (n ? 3 : 0), o), h.lineTo(0, o), h.closePath(), h.fill(), this.rightCover.element.loadNormalMap(u, Fe.MATERIAL_FACE.BACK) 7914 7915 } 7916 7917 } 7918 7919 }, { 7920 7921 key: "setcolor3DCover", 7922 7923 value: function () { 7924 7925 var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; 7926 7927 0 == (t = t.trim()).indexOf("#") && 4 === t.length && (t = t.split("").map((function (e) { 7928 7929 return "#" == e ? e : e + e 7930 7931 })).join("")); 7932 7933 var i = _e.color.getBrightness(t); 7934 7935 isNaN(i) && (console.log("Improper Color code value. Needs a hex value! Using default 0.25"), i = .25); 7936 7937 var n = (255 - i) / 255, 7938 7939 o = 1024, 7940 7941 a = document.createElement("canvas"); 7942 7943 a.height = o, a.width = o; 7944 7945 var r = a.getContext("2d"); 7946 7947 if (r.fillStyle = t, r.fillRect(0, 0, o, o), r.strokeStyle = "rgba(50,50,50," + (n / 2 + .4) + ")", r.strokeRect(.1 * o, .05 * o, o * (this.hasS
7947piral ? .9 : .85), .9 * o), r.beginPath(), r.strokeStyle = "rgba(50,50,50," + (n / 2 + .3) + ")", r.lineWidth = 2, r.moveTo(0, 0), r.lineTo(.1 * o, .05 * o), r.stroke(), r.beginPath(), r.strokeStyle = "rgba(50,50,50," + (n / 2 + .4) + ")", r.moveTo(0, o), r.lineTo(.1 * o, .95 * o), r.stroke(), r.beginPath(), r.strokeStyle = "rgba(255,255,255,0.5)", r.lineWidth = 4, r.moveTo(0, 0), r.lineTo(0, o), r.moveTo(0, 0), r.lineTo(o, 0), r.stroke(), r.beginPath(), r.strokeStyle = "rgba(50,50,50," + (n / 2 + .3) + ")", r.lineWidth = 4, r.moveTo(0, o), r.lineTo(o, o), r.stroke(), !1 === this.hasSpiral) { 7948 7949 r.beginPath(); 7950 7951 var s = r.createLinearGradient(.95 * o, 0, o, 0); 7952 7953 s.addColorStop(0, "rgba(30,30,30," + (n + .3) + ")"), s.addColorStop(1, "rgba(60,60,60," + (n + .3) + ")"), r.fillStyle = s, r.fillRect(.95 * o, 0, .05 * o, o), r.beginPath(), r.lineWidth = 1, r.strokeStyle = "rgba(40,40,40," + (n + .3) + ")"; 7954 7955 for (var l = 0; l < 17; l++) r.moveTo(o - 3 * l, 0), r.lineTo(o - 3 * l, o); 7956 7957 r.stroke() 7958 7959 } else r.beginPath(), r.strokeStyle = "rgba(50,50,50,0.2)", r.lineWidth = 4, r.moveTo(o, 0), r.lineTo(o, o), r.stroke(); 7960 7961 this.leftCover.backImage(a); 7962 7963 var u = document.createElement("canvas"); 7964 7965 u.height = o, u.width = o; 7966 7967 var h = u.getContext("2d"); 7968 7969 if (h.fillStyle = t, h.fillRect(0, 0, o, o), h.strokeStyle = "rgba(50,50,50," + (n / 2 + .5) + ")", h.strokeRect(o * (this.hasSpiral ? 0 : .05), .05 * o, o * (this.hasSpiral ? .9 : .85), .9 * o), h.beginPath(), h.strokeStyle = "rgba(50,50,50," + (n / 2 + .3) + ")", h.lineWidth = 2, h.moveTo(o, 0), h.lineTo(.9 * o, .05 * o), h.stroke(), h.beginPath(), h.strokeStyle = "rgba(50,50,50," + (n / 2 + .5) + ")", h.moveTo(o, o), h.lineTo(.9 * o, .95 * o), h.stroke(), h.beginPath(), h.strokeStyle = "rgba(255,255,255,0.5)", h.lineWidth = 4, h.moveTo(0, 0), h.lineTo(o, 0), h.stroke(), h.beginPath(), h.strokeStyle = "rgba(50,50,50," + (n / 2 + .3) + ")", h.lineWidth = 4, h.moveTo(o, 0), h.lineTo(o, o), h.moveTo(0, o), h.lineTo(o, o), h.stroke(), !1 === this.hasSpiral) { 7970 7971 h.beginPath(); 7972 7973 var p = h.createLinearGradient(0, 0, .05 * o, 0); 7974 7975 p.addColorStop(0, "rgba(0,0,0," + (n + .3) + ")"), p.addColorStop(.2, "rgba(10,10,10," + (n + .3) + ")"), p.addColorStop(1, "rgba(80,80,80," + (n + .3) + ")"), h.fillStyle = p, h.fillRect(0, 0, .05 * o, o), h.beginPath(), h.lineWidth = 1, h.strokeStyle = "rgba(40,40,40," + (n + .3) + ")"; 7976 7977 for (var c = 0; c < 17; c++) h.moveTo(3 * c, 0), h.lineTo(3 * c, o); 7978 7979 h.stroke() 7980 7981 } else h.beginPath(), h.strokeStyle = "rgba(255,255,255,0.2)", h.lineWidth = 4, h.moveTo(0, 0), h.lineTo(0, o), h.stroke(); 7982 7983 this.rightCover.frontImage(u); 7984 7985 var d = document.createElement("canvas"); 7986 7987 o = 128, d.height = o, d.width = o; 7988 7989 var f = d.getContext("2d"); 7990 7991 f.fillStyle = "#ffffff", f.fillRect(0, 0, o, o), f.strokeStyle = "#cccccc", f.lineWidth = 1; 7992 7993 for (var g = 0; g < o / 4; g++) f.moveTo(4 * g, 0), f.lineTo(4 * g, o); 7994 7995 f.stroke(), this.leftSheets.element.loadImage(d, 1, null), this.rightSheets.element.loadImage(d, 3, null), this.app.renderRequestStatus = e.REQUEST_STATUS.ON 7996 7997 } 7998 7999 }, { 8000 8001 key: "initEvents", 8002 8003 value: function () { 8004 8005 this.stageDOM = this.element[0], Ce(Ne(n.prototype), "initEvents", this).call(this) 8006 8007 } 8008 8009 }, { 8010 8011 key: "dispose", 8012 8013 value: function () { 8014 8015 Ce(Ne(n.prototype), "dispose", this).call(this); 8016 8017 var e = this; 8018 8019 e.stage && (e.stage.clearChild(), e.stage.cssRenderer.domElement.parentNode.removeChild(e.stage.cssRenderer.domElement), e.stage.cssRenderer = null, e.stage.orbitControl = _e.disposeObject(e.stage.orbitControl), e.stage.renderer = _e.disposeObject(e.stage.renderer), jQuery(e.stage.canvas).remove(), e.stage.canvas = null, e.stage = _e.disposeObject(e.stage)), e.centerTween && e.centerTween.stop && e.centerTween.stop() 8020 8021 } 8022 8023 }, { 8024 8025 key: "render", 8026 8027 value: function () { 8028 8029 this.stage.render(), this.stage.cssRenderer.render(this.stage.cssScene, this.stage.camera) 8030 8031 } 8032 8033 }, { 8034 8035 key: "resize", 8036 8037 value: function () { 8038 8039 Ce(Ne(n.prototype), "resize", this).call(this); 8040 8041 var e = this, 8042 8043 t = e.app, 8044 8045 i = e.stage, 8046 8047 o = t.dimensions, 8048 8049 a = (o.padding, e.isSingle, this.availablePageWidth()), 8050 8051 r = this.availablePageHeight(); 8052 8053 i.resizeCanvas(o.stage.width, o.stage.height), i.cssRenderer.setSize(o.stage.width, o.stage.height), this.pageScaleX = Math.max(Math.max(a, r) / 400, 1), this.initDepth(), this.sheets.forEac
8053h((function (t) { 8054 8055 t.depth = e.sheetDepth 8056 8057 })), t.refreshRequestStart(); 8058 8059 var s = this.refSize = Math.min(r, a); 8060 8061 this.coverExtraWidth = ("vertical" == e.orientation ? 2 : 1) * s * .025, this.coverExtraHeight = ("vertical" == e.orientation ? 1 : 2) * s * .025, !0 !== this.has3DCover && (this.coverExtraWidth = 0, this.coverExtraHeight = 0), e.zoomViewer.resize(), e.cameraPositionDirty = !0, e.centerNeedsUpdate = !0, e.checkCenter(!0), e.pagesReady(), this.pageOffset = (this.hasSpiral ? 6 : 0) * Math.min(this._defaultPageSize.width, this._defaultPageSize.height) / 1e3 8062 8063 } 8064 8065 }, { 8066 8067 key: "fitCameraToCenteredObject", 8068 8069 value: function (e, t, i, n) { 8070 8071 var o = new THREE.Box3; 8072 8073 o.setFromObject(t); 8074 8075 new THREE.Vector3; 8076 8077 var a = new THREE.Vector3; 8078 8079 o.getSize(a); 8080 8081 var r = this.coverExtraHeight, 8082 8083 s = 2 * this.coverExtraWidth; 8084 8085 this.isClosedPage() && (s = 0, r = 0), a.x = a.x - s + this.app.dimensions.padding.width, a.y = a.y - r + this.app.dimensions.padding.height; 8086 8087 var l = e.fov * (Math.PI / 180), 8088 8089 u = 2 * Math.atan(Math.tan(l / 2) * e.aspect), 8090 8091 h = a.z / 2 + Math.abs(a.x / 2 / Math.tan(u / 2)), 8092 8093 p = a.z / 2 + Math.abs(a.y / 2 / Math.tan(l / 2)), 8094 8095 c = Math.max(h, p); 8096 8097 void 0 !== i && 0 !== i && (c *= i), e.position.set(0, 0, c); 8098 8099 var d = o.min.z, 8100 8101 f = d < 0 ? -d + c : c - d; 8102 8103 e.far = 3 * f, e.updateProjectionMatrix(), void 0 !== n && (n.target = new THREE.Vector3(0, 0, 0), n.maxDistance = 2 * f) 8104 8105 } 8106 8107 }, { 8108 8109 key: "updateShadowSize", 8110 8111 value: function () { } 8112 8113 }, { 8114 8115 key: "refresh", 8116 8117 value: function () { 8118 8119 var e = this, 8120 8121 t = this.app, 8122 8123 i = e.getBasePage(); 8124 8125 this.refreshRequested = !0; 8126 8127 var o = 1 / t.pageCount * i, 8128 8129 a = this.isRTL ? 1 - o : o, 8130 8131 r = 1 - a, 8132 8133 s = Math.min(e.stackCount, e.totalSheets), 8134 8135 l = _e.limitAt(e.totalSheets, e.stackCount, 2 * e.stackCount), 8136 8137 u = (Math.max(a, r), this.isBooklet ? 0 : this.flexibility / l); 8138 8139 e.leftFlexibility = u * r, e.rightFlexibility = u * a, e.midPosition = .5 * s * e.sheetDepth, Ce(Ne(n.prototype), "refresh", this).call(this); 8140 8141 var h = !0 === this.has3DCover; 8142 8143 this.leftCover.element.visible = this.rightCover.element.visible = this.leftSheets.element.visible = this.rightSheets.element.visible = h, this.wrapper.position.z = -this.midPosition; 8144 8145 var p = 0, 8146 8147 c = 0, 8148 8149 d = e.isRTL, 8150 8151 f = this.isFirstPage(), 8152 8153 g = this.isLastPage(), 8154 8155 v = this.isLeftClosed = this.isClosedPage() && (d && g || !d && f), 8156 8157 m = this.isRightClosed = this.isClosedPage() && (!d && g || d && f); 8158 8159 if (h) { 8160 8161 e.leftSheets.depth = d ? e.sheetsDepth * (1 - e.getBasePage() / t.pageCount) : e.sheetsDepth * i / t.pageCount, e.leftSheets.element.visible = d ? t.pageCount - e.getBasePage() > 2 : i > 2, p -= e.leftSheets.depth / 2, e.leftSheets.element.position.z = p, p -= e.coverDepth + (e.leftSheets.element.visible ? e.leftSheets.depth / 2 : 0) + 3 * e.coverDepth, e.leftCover.depth = e.rightCover.depth = e.coverDepth; 8162 8163 var y = Math.max(this.leftSheetHeight, this.rightSheetHeight); 8164 8165 m && (y = this.leftSheetHeight), v && (y = this.rightSheetHeight), !0 !== e.leftCover.isFlipping && (e.leftCover.element.position.z = v ? e.midPosition + e.coverDepth : p + e.coverDepth / 2, e.leftCover.element.position.z = Math.max(e.leftCover.element.position.z, .05 * -e.refSize), e.leftCover.element.position.x = 0, e.leftSheets.sheetAngle = e.leftCover.sheetAngle = v ? 180 : 0, e.leftSheets.curveAngle = e.leftCover.curveAngle = v ? 180 : 0, !0 !== e.rightCover.isFlipping && (e.leftCover.height = y, e.leftCover.width = e.leftCover.sheetAngle < 90 ? this.leftSheetWidth : this.rightSheetWidth, this.isClosedPage() || (e.leftCover.width += this.coverExtraWidth, e.leftCover.height += this.coverExtraHeight)), e.leftSheets.updateAngle(), e.leftCover.updateAngle()), e.rightSheets.depth = e.sheetsDepth - e.leftSheets.depth, e.rightSheets.element.visible = d ? i > 2 : t.pageCount - e.getBasePage() >
8165 2, c -= e.rightSheets.depth / 2, e.rightSheets.element.position.z = c, c -= e.coverDepth + (e.rightSheets.element.visible ? e.rightSheets.depth / 2 : 0) + 3 * e.coverDepth, !0 !== e.rightCover.isFlipping && (e.rightCover.element.position.z = m ? e.midPosition + e.coverDepth : c + e.coverDepth / 2, e.rightCover.element.position.z = Math.max(e.rightCover.element.position.z, .05 * -e.refSize), e.rightCover.element.position.x = 0, e.rightSheets.sheetAngle = e.rightCover.sheetAngle = m ? 0 : 180, e.rightSheets.curveAngle = e.rightCover.curveAngle = m ? 0 : 180, !0 !== e.leftCover.isFlipping && (e.rightCover.height = y, e.rightCover.width = e.rightCover.sheetAngle < 90 ? this.leftSheetWidth : this.rightSheetWidth, this.isClosedPage() || (e.rightCover.width += this.coverExtraWidth, e.rightCover.height += this.coverExtraHeight)), e.rightSheets.updateAngle(), e.rightCover.updateAngle()), e.updateSheets(), e.stage.ground.position.z = Math.min(p, c) - e.refSize * e.groundDistance / 100, e.stage.ground.position.z = Math.max(e.stage.ground.position.z, .1 * -e.refSize) 8166 8167 } else e.stage.ground.position.z = -e.midPosition - 15 * e.sheetDepth; 8168 8169 !0 === e.cameraPositionDirty && e.updateCameraPosition(), e.spiralRefreshRequested = !0, this.refreshSpiral() 8170 8171 } 8172 8173 }, { 8174 8175 key: "refreshSpiral", 8176 8177 value: function () { 8178 8179 if (!0 === this.hasSpiral) { 8180 8181 var e = this.midPosition + this.sheetDepth; 8182 8183 this.bookWrapper.children.forEach((function (t) { 8184 8185 t && t.sheetAngle && t.position.z + t.depth / 2 > e && (e = t.position.z + t.depth / 2) 8186 8187 })), this.leftHoles.visible = this.isBooklet ? this.isRTL : 0 == this.isLeftClosed && 0 == this.leftCover.isFlipping, this.rightHoles.visible = this.isBooklet ? !this.isRTL : 0 == this.isRightClosed && 0 == this.rightCover.isFlipping; 8188 8189 var t = "vertical" === this.orientation ? Math.max(this.leftHoles.visible ? this.leftSheetWidth : 0, this.rightHoles.visible ? this.rightSheetWidth : 0) : Math.max(this.leftHoles.visible ? this.leftSheetHeight : 0, this.rightHoles.visible ? this.rightSheetHeight : 0); 8190 8191 t /= 1e3, this.leftHoles.position.z = this.rightHoles.position.z = e + 2 / t + (this.isClosedPage() ? 2 * this.leftCover.depth : 0) / t, this.spiralGroup.scale.set(t, t, t) 8192 8193 } 8194 8195 } 8196 8197 }, { 8198 8199 key: "updateCameraPosition", 8200 8201 value: function () { 8202 8203 var e = this, 8204 8205 t = e.app, 8206 8207 i = e.stage, 8208 8209 n = t.dimensions, 8210 8211 o = n.padding, 8212 8213 a = 1 / (2 * Math.tan(Math.PI * i.camera.fov * .5 / 180) / (n.stage.height / t.zoomValue)) + 2.2; 8214 8215 this.updateShadowSize(), this.stage.spotLight.position.x = 440 * -this.pageScaleX, this.stage.spotLight.position.y = 440 * this.pageScaleX, this.stage.spotLight.position.z = 660 * this.pageScaleX, this.stage.spotLight.shadow.camera.far = 1200 * this.pageScaleX, this.stage.spotLight.shadow.camera.updateProjectionMatrix(); 8216 8217 var r = (o.top - o.bottom) / t.zoomValue / 2, 8218 8219 s = -(o.left - o.right) / t.zoomValue / 2; 8220 8221 i.camera.position.z !== a && !0 === t.pendingZoom && (i.camera.position.z = a), 1 === t.zoomValue && (e.bookWrapper.rotation.set(0, 0, 0), e.bookHelper.rotation.set(0, 0, 0), e.cameraWrapper.rotation.set(0, 0, 0), 0 !== t.options.flipbook3DTiltAngleUp || 0 !== t.options.flipbook3DTiltAngleLeft ? (i.camera.aspect = n.stage.width / n.stage.height, i.camera.updateProjectionMatrix(), e.bookWrapper.rotateZ(THREE.Math.degToRad(-t.options.flipbook3DTiltAngleLeft)), e.bookWrapper.rotateX(THREE.Math.degToRad(-t.options.flipbook3DTiltAngleUp)), "vertical" == e.orientation ? e.bookWrapper.scale.y = 1 / (this.isSingle ? 2 : 1) : e.bookWrapper.scale.x = 1 / (this.isSingle ? 2 : 1), e.bookHelper.update(
8221), e.fitCameraToCenteredObject(i.camera, e.bookWrapper), e.bookWrapper.rotation.set(0, 0, 0), e.bookWrapper.scale.x = 1, e.bookWrapper.scale.y = 1, i.camera.position.set(s, r, i.camera.position.z + i.ground.position.z), this.camera.aspect = n.stage.width / n.stage.height, this.camera.updateProjectionMatrix(), e.cameraWrapper.rotateX(THREE.Math.degToRad(t.options.flipbook3DTiltAngleUp)), e.cameraWrapper.rotateZ(THREE.Math.degToRad(t.options.flipbook3DTiltAngleLeft))) : i.camera.position.set(s, r, a)), i.camera.updateProjectionMatrix(), e.app.renderRequestStatus = Ie.REQUEST_STATUS.ON, e.cameraPositionDirty = !1 8222 8223 } 8224 8225 }, { 8226 8227 key: "refreshSheet", 8228 8229 value: function (t) { 8230 8231 var i, n = this, 8232 8233 o = t.sheet, 8234 8235 a = t.index, 8236 8237 r = o.sheetAngle, 8238 8239 s = !(o.isHard || 0 === this.flexibility); 8240 8241 o.leftFlexibility = s ? n.leftFlexibility : 0, o.rightFlexibility = s ? n.rightFlexibility : 0, o.leftPos = n.midPosition + (a - t.midPoint + 1) * n.sheetDepth - n.sheetDepth / 2, o.rightPos = n.midPosition - (a - t.midPoint) * n.sheetDepth - n.sheetDepth / 2, i = o.targetSide === e.TURN_DIRECTION.LEFT ? 0 : 180, !1 === o.isFlipping && (t.needsFlip ? (o.isFlipping = !0, o.isCover && 0 === t.sheetNumber && (n.isRTL ? n.rightCover.isFlipping = !0 : n.leftCover.isFlipping = !0), o.isCover && n.totalSheets - t.sheetNumber == 1 && (n.isRTL ? n.leftCover.isFlipping = !0 : n.rightCover.isFlipping = !0), o.element.position.z = Math.max(r < 90 ? o.leftPos : o.rightPos, n.midPosition) + n.sheetDepth, o.flexibility = r < 90 ? o.leftFlexibility : o.rightFlexibility, o.flip(r, i)) : (o.skipFlip = !1, o.sheetAngle = o.curveAngle = i, o.flexibility = i < 90 ? o.leftFlexibility : o.rightFlexibility, o.element.position.z = i < 90 ? o.leftPos : o.rightPos, o.side = o.targetSide, o.height = i < 90 ? this.leftSheetHeight : this.rightSheetHeight, o.width = i < 90 ? this.leftSheetWidth : this.rightSheetWidth), o.updateAngle(), this.app.renderRequestStatus = Ie.REQUEST_STATUS.ON), o.element.visible = t.visible 8242 8243 } 8244 8245 }, { 8246 8247 key: "updateCenter", 8248 8249 value: function () { 8250 8251 var e = this, 8252 8253 t = this.app, 8254 8255 i = "vertical" == this.orientation ? e.wrapper.position.y : e.wrapper.position.x, 8256 8257 n = ("vertical" === this.orientation ? -1 : 1) * e.centerShift * (this.isLeftPage() ? "vertical" == this.orientation ? this.leftSheetHeight : this.leftSheetWidth : "vertical" == this.orientation ? this.rightSheetHeight : this.rightSheetWidth) / 2; 8258 8259 e.seamPosition = (-t.dimensions.offset.width + t.dimensions.containerWidth) / 2 + n, n !== e.centerEnd && (e.centerTween && e.centerTween.stop && e.centerTween.stop(), e.onCenterStartAnimation(this), e.centerTween = new TWEEN.Tween({ 8260 8261 x: i 8262 8263 }).delay(0).to({ 8264 8265 x: n 8266 8267 }, 1 === t.zoomValue && !0 !== e.skipCenterAnimation ? e.app.options.duration : 1).onStart((function () { })).onUpdate((function () { 8268 8269 e.onCenterUpdateAnimation(this) 8270 8271 })).onComplete((function () { 8272 8273 e.onCenterCompleteAnimation(this) 8274 8275 })).onStop((function () { 8276 8277 e.onCenterStopAnimation(this) 8278 8279 })).easing(TWEEN.Easing.Cubic.InOut).start(), this.updatePendingStatusClass(), e.skipCenterAnimation = !1, e.centerEnd = n), e.renderRequestStatus = Ie.REQUEST_STATUS.ON, this.zoomViewer.updateCenter() 8280 8281 } 8282 8283 }, { 8284 8285 key: "onCenterUpdateAnimation", 8286 8287 value: function (e) { 8288 8289 "vertical" == this.orientation ? (this.wrapper.position.y = e.x, this.stage && this.stage.cssScene && (this.stage.cssScene.position.y = e.x)) : (this.wrapper.position.x = e.x, this.stage && this.stage.cssScene && (this.stage.cssScene.position.x = e.x)) 8290 8291 } 8292 8293 }, { 8294 8295 key: "onCenterStartAnimation", 8296 8297 value: function (e) { } 8298 8299 }, { 8300 8301 key: "onCenterStopAnimation", 8302 8303 value: function (e) { } 8304 8305 }, { 8306 8307 key: "onCenterCompleteAnimation", 8308 8309 value: function (e) { } 8310 8311 }, { 8312 8313 key: "flipCover", 8314 8315 value: function (e) { 8316 8317 var t, i, n = null; 8318 8319 0 === e.pageNumber || this.isBooklet && 1 === e.pageNumber ? (n = this.isRTL ? this.rightCover : this.leftCover, t = this.isRTL ? 1 : -1) : e.pageNumber === this.totalSheets - 1 && (n = this.isRTL ? this.leftCover : this.rightCover, t = this.isRTL ? -1 : 1), null !== n && (i = n.depth + e.depth + 1, n.sheetAngle = e.sheetAngle, n.curveAngle = e.curveAngle, this.rightCover.height = this.leftCover.height = e.height + this.coverExtraHeight, this.rightCover.width = this.leftCover.width = e.width + this.coverExtraWidth, n.flexibility = e.flexibility, this.rightCover.updateAngle(), this.leftCover.updateAngle(), n.element.position.x = e.element.position.x + t * Math.sin(e.sheetAngle * Math.PI / 180) * i, n.element.position.z = e.element.position.z + t * Math.cos(e.sheetAngle * Math.PI / 180) * i) 8320 8321 } 8322 8323 }, { 8324 8325 key: "pagesReady", 8326 8327 value: function () { 8328 8329 if (!this.isAnimating() && !0 === this.refreshRequested) { 8330 8331 if (!1 === this.app.options.flipbookFitPages) { 8332 8333 var e = this.app.viewer.getBasePage(), 8334
8335 t = this.leftViewport = this.getViewPort(e + (this.isBooklet ? 0 : this.isRTL ? 1 : 0)), 8336 8337 i = this.rightViewPort = this.getViewPort(e + (this.isBooklet || this.isRTL ? 0 : 1)); 8338 8339 if (t) { 8340 8341 var n = _e.contain(t.width, t.height, this.availablePageWidth(), this.availablePageHeight()); 8342 8343 this.leftSheetWidth == Math.floor(n.width) && this.leftSheetHeight == Math.floor(n.height) || (this.cameraPositionDirty = !0), this.leftSheetWidth = Math.floor(n.width), this.leftSheetHeight = Math.floor(n.height) 8344 8345 } 8346 8347 if (i) { 8348 8349 var o = _e.contain(i.width, i.height, this.availablePageWidth(), this.availablePageHeight()); 8350 8351 this.rightSheetWidth == Math.floor(o.width) && this.rightSheetWidth == Math.floor(o.height) || (this.cameraPositionDirty = !0), this.rightSheetWidth = Math.floor(o.width), this.rightSheetHeight = Math.floor(o.height) 8352 8353 } 8354 8355 for (var a = 0; a < this.sheets.length; a++) { 8356 8357 var r = this.sheets[a]; 8358 8359 r.side === Ie.TURN_DIRECTION.LEFT ? (r.height = this.leftSheetHeight, r.width = this.leftSheetWidth, r.updateAngle()) : (r.height = this.rightSheetHeight, r.width = this.rightSheetWidth, r.updateAngle()) 8360 8361 } 8362 8363 if (this.isClosedPage()) { 8364 8365 var s = this.isRTL && this.isLastPage() || !this.isRTL && this.isFirstPage(); 8366 8367 this.leftCover.width = this.rightCover.width = s ? this.rightSheetWidth : this.leftSheetWidth, this.leftCover.height = this.rightCover.height = s ? this.rightSheetHeight : this.leftSheetHeight 8368 8369 } else this.leftCover.height = this.rightCover.height = this.coverExtraHeight + Math.max(this.leftSheetHeight, this.rightSheetHeight), this.leftCover.width = this.coverExtraWidth + this.leftSheetWidth, this.rightCover.width = this.coverExtraWidth + this.rightSheetWidth; 8370 8371 this.leftSheets.width = this.leftSheetWidth, this.leftSheets.height = this.leftSheetHeight, this.rightSheets.height = this.rightSheetHeight, this.rightSheets.width = this.rightSheetWidth, this.leftCover.updateAngle(), this.leftSheets.updateAngle(), this.rightCover.updateAngle(), this.rightSheets.updateAngle(), this.updateSheets(!0) 8372 8373 } 8374 8375 this.updateCenter(), this.updateCSSLayer(), this.updatePendingStatusClass(), this.refreshSpiral(), !0 === this.cameraPositionDirty && this.updateCameraPosition() 8376 8377 } 8378 8379 } 8380 8381 }, { 8382 8383 key: "updateSheets", 8384 8385 value: function (e) { 8386 8387 if (!0 !== this.isClosedPage()) { 8388 8389 var t = this.getPageByNumber(this.getRightPageNumber()); 8390 8391 if (!0 !== this.rightCover.isFlipping && t && t.sheet.element.geometry.attributes) { 8392 8393 var i = this.rightSheets.element.geometry.attributes.position, 8394 8395 n = e ? t.sheet.element.geometry.boundingBox.max.x * t.sheet.element.scale.x : this.rightSheets.lastSlopeX; 8396 8397 i.setX(21, n), i.setX(23, n), i.setX(4, n), i.setX(6, n), i.setX(10, n), i.setX(14, n), i.needsUpdate = !0, this.rightSheets.element.geometry.attributes.uv.needsUpdate = !0, this.rightSheets.element.geometry.computeVertexNormals(), e && (this.rightSheets.lastSlopeX = n) 8398 8399 } 8400 8401 var o = this.getPageByNumber(this.getLeftPageNumber()); 8402 8403 if (!0 !== this.leftCover.isFlipping && o && o.sheet.element.geometry.attributes) { 8404 8405 var a = this.leftSheets.element.geometry.attributes.position, 8406 8407 r = e ? o.sheet.element.geometry.boundingBox.min.x * o.sheet.element.scale.x : this.leftSheets.lastSlopeX; 8408 8409 a.setX(16, r), a.setX(18, r), a.setX(5, r), a.setX(7, r), a.setX(8, r), a.setX(12, r), a.needsUpdate = !0, this.leftSheets.element.geometry.attributes.uv.needsUpdate = !0, this.leftSheets.element.geometry.computeVertexNormals(), e && (this.leftSheets.lastSlopeX = r) 8410 8411 } 8412 8413 } 8414 8415 } 8416 8417 }, { 8418 8419 key: "updateCSSLayer", 8420 8421 value: function () { 8422 8423 var e, t, i = this, 8424 8425 n = i.getBasePage(), 8426 8427 o = n + (i.isBooklet ? 0 : i.isRTL ? 1 : 0), 8428 8429 a = n + (i.isBooklet || this.isRTL ? 0 : 1), 8430 8431 r = !this.isRTL && i.isBooklet ? void 0 : i.getPageByNumber(o), 8432 8433 s = this.isRTL && i.isBooklet ? void 0 : i.getPageByNumber(a); 8434 8435 jQuery(i.stage.cssRenderer.domElement).find(".pf-page-content").css({ 8436 8437 display: "none" 8438 8439 }); 8440 8441 var l = "vertical" == this.orientation; 8442
8443 if (this.leftViewport && null != r && r.sheet.element.visible) { 8444 8445 var u = r.cssPage; 8446 8447 if (null != u) { 8448 8449 var h = r.sheet.element.geometry.boundingBox; 8450 8451 e = Math.abs(h.max.x - h.min.x) * r.sheet.element.scale.x, t = Math.abs(h.max.y - h.min.y) * r.sheet.element.scale.y, u.rotation.y = 0, u.position.z = 0, u.position.x = 0, jQuery(u.element).css({ 8452 8453 width: l ? t : e, 8454 8455 height: l ? e : t, 8456 8457 top: l ? this.pageOffset + e / 2 : 0, 8458 8459 left: l ? 0 : -this.pageOffset - e / 2, 8460 8461 display: "block" 8462 8463 }), this.resizeAnnotations(o) 8464 8465 } 8466 8467 } 8468 8469 if (this.rightViewPort && null != s && s.sheet.element.visible) { 8470 8471 var p = s.cssPage; 8472 8473 if (null != p) { 8474 8475 var c = s.sheet.element.geometry.boundingBox; 8476 8477 e = Math.abs(c.max.x - c.min.x) * s.sheet.element.scale.x, t = Math.abs(c.max.y - c.min.y) * s.sheet.element.scale.y, p.rotation.y = 0, p.position.z = 0, p.position.x = 0, jQuery(p.element).css({ 8478 8479 width: l ? t : e, 8480 8481 height: l ? e : t, 8482 8483 top: l ? -this.pageOffset - e / 2 : 0, 8484 8485 left: l ? 0 : this.pageOffset + e / 2, 8486 8487 display: "block" 8488 8489 }), this.resizeAnnotations(a) 8490 8491 } 8492 8493 } 8494 8495 } 8496 8497 }, { 8498 8499 key: "mouseMove", 8500 8501 value: function (e) { 8502 8503 if (e = _e.fixMouseEvent(e), this.app.renderRequestStatus = Ie.REQUEST_STATUS.ON, null == e.touches || 2 != e.touches.length) { 8504 8505 var t = this, 8506 8507 i = t.eventToPoint(e); 8508 8509 if (null !== t.dragSheet && !1 !== t.drag3D) { 8510 8511 var n = 180 * Math.acos(_e.limitAt(1 - (i.x - i.left) / this.leftSheetWidth, -1, 1)) / Math.PI, 8512 8513 o = t.dragSheet, 8514 8515 a = t.drag === Ie.TURN_DIRECTION.LEFT; 8516 8517 o.sheetAngle = n; 8518 8519 var r = a ? _e.limitAt(o.sheetAngle + 45, 0, 180) : _e.limitAt(o.sheetAngle, 0, 180); 8520 8521 o.curveAngle = o.isHard ? o.sheetAngle : r * TWEEN.Easing.Sinusoidal.Out(.8 * r / 180), o.updateAngle() 8522 8523 } 8524 8525 t.checkSwipe(i, e) 8526 8527 } else this.pinchMove(e) 8528 8529 } 8530 8531 }, { 8532 8533 key: "mouseUp", 8534 8535 value: function (e) { 8536 8537 var t = this; 8538 8539 if ((e = _e.fixMouseEvent(e)).touches || 0 === e.button) 8540 8541 if (null != t.dragSheet || null == e.touches || 0 != e.touches.length) { 8542 8543 var i = t.eventToPoint(e); 8544 8545 if (1 === t.app.zoomValue) { 8546 8547 null !== t.dragSheet && (i.x > t.app.dimensions.width / 2 ? t.drag === Ie.TURN_DIRECTION.LEFT && t.app.openLeft() : t.drag === Ie.TURN_DIRECTION.RIGHT && t.app.openRight(), t.requestRefresh()); 8548 8549 var n = e.target || e.originalTarget, 8550 8551 o = t.startPoint && i.x === t.startPoint.x && i.y === t.startPoint.y && "A" !== n.nodeName; 8552 8553 !0 === e.ctrlKey && o ? this.zoomOnPoint(i) : o && t.clickAction === Ie.MOUSE_CLICK_ACTIONS.NAV && t.raycastCLick(e) 8554 8555 } 8556 8557 t.dragSheet = null, t.drag = null, t.startPoint = null, t.canSwipe = !1, t.app.renderRequestStatus = Ie.REQUEST_STATUS.ON 8558 8559 } else this.pinchUp(e) 8560 8561 } 8562 8563 }, { 8564 8565 key: "raycastCLick", 8566 8567 value: function (e) { 8568 8569 var t = this; 8570 8571 t.mouse = new THREE.Vector2, t.raycaster = new THREE.Raycaster, t.mouse.x = e.offsetX / t.app.dimensions.stage.width * 2 - 1, t.mouse.y = 1 - e.offsetY / t.app.dimensions.stage.height * 2, t.raycaster.setFromCamera(t.mouse, t.camera); 8572 8573 var i = t.raycaster.intersectObjects(t.bookWrapper.children, !0); 8574 8575 if (i.length > 0) { 8576 8577 var n, o = 0; 8578 8579 do { 8580 8581 if ((n = null != i[o] ? i[o].object : null).sheet && !0 !== n.sheet.isFlipping) { 8582 8583 n.sheet.sheetAngle > 90 ? t.app.openRight() : t.app.openLeft(); 8584 8585 break 8586 8587 } 8588 8589 o++ 8590 8591 } while (o < i.length) 8592 8593 } 8594 8595 } 8596 8597 }, { 8598 8599 key: "mouseDown", 8600 8601 value: function (e) { 8602
8603 if ((e = _e.fixMouseEvent(e)).touches || 0 === e.button) 8604 8605 if (null == e.touches || 2 != e.touches.length) { 8606 8607 e = _e.fixMouseEvent(e); 8608 8609 var t = this, 8610 8611 i = t.eventToPoint(e); 8612 8613 t.startPoint = i, t.lastPosX = i.x, t.lastPosY = i.y, i.isInsideDragZone && !1 !== t.drag3D ? (t.dragSheet = i.sheet, t.drag = i.sheet.sheetAngle < 90 ? Ie.TURN_DIRECTION.LEFT : Ie.TURN_DIRECTION.RIGHT) : t.canSwipe = !0 8614 8615 } else this.pinchDown(e) 8616 8617 } 8618 8619 }, { 8620 8621 key: "eventToPoint", 8622 8623 value: function (e) { 8624 8625 var t = this, 8626 8627 i = this.app.dimensions, 8628 8629 n = { 8630 8631 x: (e = _e.fixMouseEvent(e)).clientX, 8632 8633 y: e.clientY 8634 8635 }; 8636 8637 n.x = n.x - t.parentElement[0].getBoundingClientRect().left, n.y = n.y - t.parentElement[0].getBoundingClientRect().top; 8638 8639 var o = (-i.offset.width + i.containerWidth) / 2 - i.stage.width / 2, 8640 8641 a = (-i.offset.width + i.containerWidth) / 2 + i.stage.width / 2, 8642 8643 r = i.padding.top, 8644 8645 s = i.padding.top + t.availablePageHeight(), 8646 8647 l = n.x < t.seamPosition, 8648 8649 u = t.getBasePage() + (l ? 0 : 1), 8650 8651 h = this.getPageByNumber(u); 8652 8653 h && (h = h.sheet); 8654 8655 var p = n.x > o && n.x < a && n.y > r && n.y < s; 8656 8657 return { 8658 8659 isInsideSheet: p, 8660 8661 isInsideDragZone: p && n.x - o < t.foldSense || a - n.x < t.foldSense, 8662 8663 x: n.x, 8664 8665 y: n.y, 8666 8667 left: o, 8668 8669 top: r, 8670 8671 right: a, 8672 8673 bottom: s, 8674 8675 raw: n, 8676 8677 isLeftSheet: l, 8678 8679 sheet: h 8680 8681 } 8682 8683 } 8684 8685 }, { 8686 8687 key: "checkPageLoading", 8688 8689 value: function () { 8690 8691 for (var e = !0, t = this.getVisiblePages().main, i = 0; i < (this.isBooklet ? 1 : 2); i++) { 8692 8693 var n = this.getPageByNumber(t[i]); 8694 8695 n && (e = n.textureLoaded && e) 8696 8697 } 8698 8699 this.element.toggleClass("pf-loading", !e) 8700 8701 } 8702 8703 }, { 8704 8705 key: "textureLoadedCallback", 8706 8707 value: function (e) { 8708 8709 this.app.renderRequestStart(), this.pagesReady() 8710 8711 } 8712 8713 }, { 8714 8715 key: "getTextureSize", 8716 8717 value: function (e) { 8718 8719 var t = Ce(Ne(n.prototype), "getTextureSize", this).call(this, e); 8720 8721 if (1 !== this.app.zoomValue || !0 === e.isAnnotation) return t; 8722 8723 var i = _e.nearestPowerOfTwo(t.height), 8724 8725 o = t.width * i / t.height; 8726 8727 return this.texturePowerOfTwo ? { 8728 8729 height: i, 8730 8731 width: o 8732 8733 } : t 8734 8735 } 8736 8737 }, { 8738 8739 key: "getPageByNumber", 8740 8741 value: function (e) { 8742 8743 if (this.has3DCover) { 8744 8745 var t = !this.isBooklet && e === this.app.pageCount && e % 2 == 0, 8746 8747 i = 1 === e; 8748 8749 if (!this.isRTL && i || this.isRTL && t) return this.leftCover.frontPage; 8750 8751 if (!this.isRTL && t || this.isRTL && i) return this.rightCover.backPage 8752 8753 } 8754 8755 return Ce(Ne(n.prototype), "getPageByNumber", this).call(this, e) 8756 8757 } 8758 8759 }, { 8760 8761 key: "setPage", 8762 8763 value: function (e) { 8764 8765 return Ce(Ne(n.prototype), "setPage", this).call(this, e) 8766 8767 } 8768 8769 }, { 8770 8771 key: "beforeFlip", 8772 8773 value: function () { 8774 8775 Ce(Ne(n.prototype), "beforeFlip", this).call(this) 8776 8777 } 8778 8779 }, { 8780 8781 key: "resizeAnnotations", 8782 8783 value: function (e) { 8784 8785 var t = this.getAnnotationElement(e); 8786 8787 if ((!t || "" === t.style.width) && 1 === this.app.zoomValue) { 8788 8789 var i = this.getPageByNumber(e), 8790 8791 o = Ce(Ne(n.prototype), "getViewPort", this).call(this, e); 8792 8793 if (i && o) { 8794 8795 o = o.clone({ 8796 8797 dontFlip: !0 8798 8799 }); 8800 8801 var a = e + "|" + this.rightSheetHeight, 8802 8803 r = i.cssPage; 8804 8805 if (r.lastStamp != a) { 8806 8807 r.lastStamp = a; 8808 8809 var s = i.sheet.element.geometry.boundingBox, 8810 8811 l = Math.abs(s.max.x - s.min.x) * i.sheet.element.scale.x, 8812 8813 u = this.getDoublePageWidthFix(e) * l / o.width, 8814 8815 h = i.sheet.height / o.height, 8816 8817 p = r.element.querySelectorAll("section"); 8818 8819 p.length > 0 && p.forEach((function (e) { 8820 8821 e.style.transform = "matrix("
8821+ u + ", 0, 0, " + h + "," + o.transform[4] * u + "," + o.transform[5] * h + ")" 8822 8823 })), this.app.provider.processTextContent(e, this.getTextElement(e, !0)) 8824 8825 } 8826 8827 } 8828 8829 } 8830 8831 } 8832 8833 }, { 8834 8835 key: "finalizeAnnotations", 8836 8837 value: function (e, t) { 8838 8839 Ce(Ne(n.prototype), "finalizeAnnotations", this).call(this, e, t), this.resizeAnnotations(t) 8840 8841 } 8842 8843 }]), n 8844 8845 }(K), 8846 8847 De = function (e) { 8848 8849 Ee(i, e); 8850 8851 var t = Re(i); 8852 8853 8854 8855 function i(e) { 8856 8857 var n; 8858 8859 Te(this, i); 8860 8861 var o = Le(n = t.call(this, e)); 8862 8863 return o.element = null, o.face = e.face, o.parent3D = e.sheet, o.sheet = e.sheet, o.cssPage = new THREE.CSS3DObject(o.contentLayer[0]), n 8864 8865 } 8866 8867 return ke(i, [{ 8868 8869 key: "setLoading", 8870 8871 value: function () { 8872 8873 this.sheet.viewer.checkPageLoading() 8874 8875 } 8876 8877 }, { 8878 8879 key: "clearMap", 8880 8881 value: function () { 8882 8883 this.sheet.element.material[this.face].map = null, this.sheet.element.material[this.face].needsUpdate = !0 8884 8885 } 8886 8887 }, { 8888 8889 key: "loadTexture", 8890 8891 value: function (e) { 8892 8893 var t = this, 8894 8895 i = e.texture, 8896 8897 n = e.callback; 8898 8899 8900 8901 function o(i, o) { 8902 8903 t.updateTextureLoadStatus(!0), t.sheet.resetMatColor(t.face, e.texture === t.textureLoadFallback), "function" == typeof n && n(e) 8904 8905 } 8906 8907 t.textureSrc = i; 8908 8909 var a = !0 === Ie.defaults.mockupMode && "CANVAS" === i.nodeName && 0 !== t.parent3D.viewer.flexibility && !t.parent3D.isHard; 8910 8911 if (4 === this.face) { 8912 8913 if (a) { 8914 8915 var r = i.getContext("2d"); 8916 8917 r.fillStyle = "rgb(127,127,255)"; 8918 8919 var s = i.width * t.parent3D.viewer.leftFlexibility, 8920 8921 l = r.createLinearGradient(i.width, 0, i.width - s, 0); 8922 8923 l.addColorStop(0, "rgba(0,0,0,.2)"), l.addColorStop(.05, "rgba(100,100,100,.1)"), l.addColorStop(.25, "rgba(100,100,100,.1)"), l.addColorStop(1, "rgba(200,200,200,0)"), r.fillStyle = l, r.beginPath(), r.moveTo(i.width - s, 0), r.lineTo(i.width, 0), r.lineTo(i.width, i.height), r.lineTo(i.width - s, i.height), r.closePath(), r.fill() 8924 8925 } 8926 8927 this.sheet.backImage(i, o) 8928 8929 } else { 8930 8931 if (a) { 8932 8933 var u = i.getContext("2d"); 8934 8935 u.fillStyle = "rgb(127,127,255)"; 8936 8937 var h = i.width * t.parent3D.viewer.rightFlexibility / 2, 8938 8939 p = u.createLinearGradient(0, 0, h, 0); 8940 8941 p.addColorStop(0, "rgba(0,0,0,.4)"), p.addColorStop(0, "rgba(100,100,100,.1)"), p.addColorStop(.25, "rgba(100,100,100,.1)"), p.addColorStop(1, "rgba(200,200,200,0)"), u.fillStyle = p, u.beginPath(), u.moveTo(0, 0), u.lineTo(h, 0), u.lineTo(h, i.height), u.lineTo(0, i.height), u.closePath(), u.fill() 8942 8943 } 8944 8945 this.sheet.frontImage(i, o) 8946 8947 } 8948 8949 } 8950 8951 }]), i 8952 8953 }(O), 8954 8955 Fe = {}; 8956 8957 8958 8959 function ze(e) { 8960 8961 return ze = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 8962 8963 return typeof e 8964 8965 } : function (e) { 8966 8967 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 8968 8969 }, ze(e) 8970 8971 } 8972 8973 8974 8975 function Be(e, t) { 8976 8977 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 8978 8979 } 8980 8981 8982 function He(e, t) { 8983 8984 for (var i = 0; i < t.length; i++) { 8985 8986 var n = t[i]; 8987 8988 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 8989 8990 if ("object" !== ze(e) || null === e) return e; 8991 8992 var i = e[Symbol.toPrimitive]; 8993 8994 if (void 0 !== i) { 8995 8996 var n = i.call(e, t || "default"); 8997 8998 if ("object" !== ze(n)) return n; 8999 9000 throw new TypeError("@@toPrimitive must return a primitive value.") 9001 9002 } 9003 9004 return ("string" === t ? String : Number)(e) 9005 9006 }(o, "string"), "symbol" === ze(a) ? a : String(a)), n) 9007 9008 } 9009 9010 var o, a 9011 9012 } 9013 9014 9015 9016 function Ue(e, t, i) { 9017 9018 return t && He(e.prototype, t), i && He(e, i), Object.defineProperty(e, "prototype", { 9019 9020 writable: !1 9021 9022 }), e 9023 9024 } 9025 9026 9027 9028 function je() { 9029 9030 return je = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, i) { 9031 9032 var n = function (e, t) { 9033 9034 for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = qe(e));); 9035 9036 return e 9037 9038 }(e, t); 9039 9040 if (n) { 9041 9042 var o = Object.getOwnPropertyDescriptor(n, t); 9043 9044 return o.get ? o.get.call(arguments.length < 3 ? e : i) : o.value 9045 9046 } 9047 9048 }, je.apply(this, arguments) 9049 9050 } 9051 9052 9053 9054 function Ve(e, t) { 9055 9056 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 9057 9058 e.prototype = Object.create(t && t.prototype, { 9059 9060 constructor: { 9061 9062 value: e, 9063 9064 writable: !0, 9065 9066 configurable: !0 9067 9068 } 9069 9070 }), Object.defineProperty(e, "prototype", { 9071 9072 writable: !1 9073 9074 }), t && We(e, t) 9075 9076 } 9077 9078 9079 9080 function We(e, t) { 9081 9082 return We = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 9083 9084 return e.__proto__ = t, e 9085 9086 }, We(e, t) 9087 9088 } 9089 9090 9091 9092 function Ge(e) { 9093 9094 var t = function () { 9095 9096 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 9097 9098 if (Reflect.construct.sham) return !1; 9099 9100 if ("function" == typeof Proxy) return !0; 9101 9102 try { 9103 9104 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 9105 9106 } catch (e) { 9107 9108 return !1 9109 9110 } 9111 9112 }(); 9113 9114 return function () { 9115 9116 var i, n = qe(e); 9117 9118 if (t) { 9119 9120 var o = qe(this).constructor; 9121 9122 i = Reflect.construct(n, arguments, o) 9123 9124 } else i = n.apply(this, arguments); 9125 9126 return function (e, t) { 9127 9128 if (t && ("object" === ze(t) || "function" == typeof t)) return t; 9129 9130 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 9131 9132 return function (e) { 9133 9134 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 9135 9136 return e 9137 9138 }(e) 9139 9140 }(this, i) 9141 9142 } 9143 9144 } 9145 9146 9147 9148 function qe(e) { 9149 9150 return qe = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 9151 9152 return e.__proto__ || Object.getPrototypeOf(e) 9153 9154 }, qe(e) 9155 9156 } 9157 9158 Fe.init = function () { 9159 9160 if (!0 !== Fe.initialized) { 9161 9162 var e = window.THREE; 9163 9164 Fe = { 9165 9166 init: function () { }, 9167 9168 initialized: !0, 9169 9170 GEOMETRY_TYPE: { 9171 9172 PLANE: 0, 9173 9174 BOX: 1, 9175 9176 MODEL: 2 9177 9178 }, 9179 9180 MATERIAL_FACE: { 9181 9182 FRONT: 5, 9183 9184 BACK: 4 9185 9186 }, 9187 9188 WHITE_COLOR: new e.Color("white"), 9189 9190 defaults: { 9191 9192 anisotropy: 8, 9193 9194 maxTextureSize: 2048, 9195 9196 groundTexture: "blank", 9197 9198 color: 16777215, 9199 9200 shininess: 15, 9201 9202 width: 210, 9203 9204 height: 297, 9205 9206 depth: .2, 9207 9208 segments: 150, 9209 9210 textureLoadFallback: "blank" 9211 9212 }, 9213 9214 textureLoader: new e.TextureLoader, 9215 9216 clearChild: function (e) { 9217 9218 var t, i = e.material; 9219 9220 if (e.parent.remove(e), e = _e.disposeObject(e), null != i) { 9221 9222 if (null == i.length) i.map && (t = i.map, i.dispose(), t.dispose()), i.bumpMap && (t = i.bumpMap, i.dispose(), t.dispose()), i.normalMap && (t = i.normalMap, i.dispose(), t.dispose()); 9223 9224 else 9225 9226 for (var n = 0; n < i.length; n++) i[n] && (i[n].map && (t = i[n].map, i[n].dispose(), t.dispose()), i[n].bumpMap && (t = i[n].bumpMap, i[n].dispose(), t.dispose()), i[n].normalMap && (t = i[n].normalMap, i[n].dispose(), t.dispose())), i[n] = null; 9227 9228 i = null, t = null 9229 9230 } 9231 9232 }, 9233 9234 loadImage: function (t, i, n, o, a) { 9235 9236 if (null == i) { 9237 9238 var r = null == t.material[n] ? null : t.material[n][o] ? t.material[n][o].sourceFile : null; 9239 9240 return null == r || r.indexOf("data:image") > -1 ? null : r 9241 9242 } 9243 9244 var s = null; 9245 9246 return "CANVAS" === i.nodeName || "IMG" === i.nodeName ? ((s = new e.Texture(i)).needsUpdate = !0, Fe.loadTexture(s, t, o, n), "function" == typeof a && a(t, s)) : "blank" !== i ? (s = null == i ? null : Fe.textureLoader.load(i, (function (e) { 9247 9248 e.sourceFile = i, Fe.loadTexture(e, t, o, n), "function" == typeof a && a(t, e) 9249 9250 }), void 0, (function () { 9251 9252 null == s.image && Fe.loadImage(t, Fe.defaults.textureLoadFallback, n, o), Fe.loadTextureFailed() 9253 9254 }))) && (s.mapping = e.UVMapping) : (Fe.loadTexture(null, t, o, n), "function" == typeof a && a(t, s)), 0 9255 9256 }, 9257 9258 loadTexture: function (t, i, n, o) { 9259 9260 if (t) { 9261 9262 var a = t.image; 9263
9264 t.naturalWidth = a.naturalWidth, t.naturalHeight = a.naturalHeight, t.needsUpdate = !0, null != i.textureRotation && (t.rotation = e.MathUtils.degToRad(i.textureRotation), t.center = i.textureCenter) 9265 9266 } 9267 9268 null !== t && "map" === n && (t.anisotropy = 0, Fe.defaults.anisotropy > 0 && (t.anisotropy = Fe.defaults.anisotropy), !0 === e.skipPowerOfTwo && (t.minFilter = e.LinearFilter, t.magFilter = e.LinearFilter), t.name = (new Date).toTimeString()), Fe.clearTexture(i.material[o][n]), i.material[o][n] = t, "bumpMap" === n && (i.material[o].bumpScale = i.sheet.getBumpScale(o)), i.material[o].needsUpdate = !0 9269 9270 }, 9271 9272 loadTextureFailed: function () { 9273 9274 return null 9275 9276 }, 9277 9278 clearTexture: function (e) { 9279 9280 e && (e.image && "CANVAS" === e.image.nodeName && (e.image.remove && e.image.remove(), delete e.image), e = _e.disposeObject(e)) 9281 9282 } 9283 9284 }, e.skipPowerOfTwo = !0; 9285 9286 var t = function (t) { 9287 9288 Ee(n, t); 9289 9290 var i = Re(n); 9291 9292 9293 9294 function n(t) { 9295 9296 var o; 9297 9298 Te(this, n); 9299 9300 var a = t.width || Fe.defaults.width, 9301 9302 r = t.height || Fe.defaults.height, 9303 9304 s = t.color || Fe.defaults.color, 9305 9306 l = t.segments || Fe.defaults.segments, 9307 9308 u = t.depth || Fe.defaults.depth, 9309 9310 h = { 9311 9312 color: s, 9313 9314 flatShading: !1, 9315 9316 shininess: t.shininess || Fe.defaults.shininess 9317 9318 }, 9319 9320 p = new e.MeshPhongMaterial(h), 9321 9322 c = [p, p, p, p, new e.MeshPhongMaterial(h), new e.MeshPhongMaterial(h)]; 9323 9324 return (o = i.call(this, new e.BoxGeometry(a, r, u, l, 1, 1), c)).material[5].transparent = !0, o.material[4].transparent = !0, o.baseType = "Paper", o.type = "Paper", o.castShadow = !0, o.receiveShadow = !0, t.parent3D.add(Le(o)), o 9325 9326 } 9327 9328 return ke(n, [{ 9329 9330 key: "loadImage", 9331 9332 value: function (e, t, i) { 9333 9334 Fe.loadImage(this, e, t, "map", i) 9335 9336 } 9337 9338 }, { 9339 9340 key: "frontImage", 9341 9342 value: function (e, t) { 9343 9344 Fe.loadImage(this, e, Fe.MATERIAL_FACE.FRONT, "map", t) 9345 9346 } 9347 9348 }, { 9349 9350 key: "backImage", 9351 9352 value: function (e, t) { 9353 9354 Fe.loadImage(this, e, Fe.MATERIAL_FACE.BACK, "map", t) 9355 9356 } 9357 9358 }, { 9359 9360 key: "loadBump", 9361 9362 value: function (e) { 9363 9364 Fe.loadImage(this, e, Fe.MATERIAL_FACE.FRONT, "bumpMap", null), Fe.loadImage(this, e, Fe.MATERIAL_FACE.BACK, "bumpMap", null) 9365 9366 } 9367 9368 }, { 9369 9370 key: "loadNormalMap", 9371 9372 value: function (e, t) { 9373 9374 void 0 === t ? (Fe.loadImage(this, e, Fe.MATERIAL_FACE.FRONT, "normalMap", null), Fe.loadImage(this, e, Fe.MATERIAL_FACE.BACK, "normalMap", null)) : Fe.loadImage(this, e, t, "normalMap", null) 9375 9376 } 9377 9378 }]), n 9379 9380 }(e.Mesh), 9381 9382 i = function (e) { 9383 9384 Ee(i, e); 9385 9386 var t = Re(i); 9387 9388 9389 9390 function i(e) { 9391 9392 var n; 9393 9394 return Te(this, i), (n = t.call(this, e)).receiveShadow = !0, n.frontImage(Fe.defaults.groundTexture), n.backImage(Fe.defaults.groundTexture), n.type = "Ground", n 9395 9396 } 9397 9398 return ke(i) 9399 9400 }(t), 9401 9402 n = function (t) { 9403 9404 Ee(o, t); 9405 9406 var n = Re(o); 9407 9408 9409 9410 function o(t) { 9411 9412 var a; 9413 9414 Te(this, o); 9415 9416 var r = Le(a = n.call(this)); 9417 9418 r.canvas = t.canvas || document.createElement("canvas"), r.canvas = jQuery(a.canvas), r.camera = new e.PerspectiveCamera(20, r.width / r.height, 4, 5e4), r.renderer = new e.WebGLRenderer({ 9419 9420 canvas: r.canvas[0], 9421 9422 antialias: !0, 9423 9424 alpha: !0 9425 9426 }), r.renderer.setPixelRatio(t.pixelRatio), r.renderer.setSize(r.width, r.height), r.renderer.setClearColor(16777215, 0), r.renderer.shadowMap.enabled = !0, r.renderer.shadowMap.type = 1, r.ground = new i({ 9427 9428 color: 16777215, 9429 9430 height: r.camera.far / 10, 9431 9432 width: r.camera.far / 10, 9433 9434 segments: 2, 9435 9436 parent3D: r 9437 9438 }), r.ambientLight = new e.AmbientLight(4473924), r.add(r.ambientLight); 9439 9440 var s = r.spotLight = new e.DirectionalLight(16777215, .25); 9441 9442 return s.position.set(0, 1, 0), !1 !== t.castShadow && (s.castShadow = !0, s.shadow.camera.near = 200, s.shadow.camera.far = 2e3, s.shadow.camera.top = 1350, s.shadow.camera.bottom = -1350, s.shadow.camera.left = -1350, s.shadow.camera.right = 1350, s.shadow.radius = 2, s.shadow.mapSize.width = 1024, s.shadow.mapSize.height = 1024), r.add(s), r.animateCount = 0, r.renderCount = 0, r.camera.position.set(-300, 300, 300), r.camera.lookAt(new e.Vector3(0, 0, 0)), a 9443 9444 } 9445 9446 return ke(o, [{ 9447 9448 key: "resizeCanvas", 9449 9450 value: function (e, t) { 9451 9452 this.renderer.setSize(e, t), this.camera.aspect = e / t, this.camera.updateProjectionMatrix() 9453 9454 } 9455 9456 }, { 9457 9458 key: "render", 9459 9460 value: function () { 9461 9462 this.animateCount++, this.renderer.render(this, this.camera), null != this.stats && this.stats.update() 9463 9464 } 9465 9466 }, { 9467 9468 key: "clearMaterials", 9469 9470 value: function () { 9471 9472 for (var e = this.children.length - 1; e >= 0; e--) { 9473 9474 var t = this.children[e]; 9475 9476 if (t.baseType && "Paper" === t.baseType && t.material) 9477 9478 if (t.material.length) 9479 9480 for (var i = 0; i < t.material.length; i++) t.material[i].needsUpdate = !0; 9481 9482 else t.material.needsUpdate = !0 9483 9484 } 9485 9486 } 9487 9488 }, { 9489 9490 key: "clearChild", 9491 9492 value: function () { 9493 9494 this.spotLight.shadow.map = _e.disposeObject(this.spotLight.shadow.map), this.spotLight.castShadow = !1, this.clearMaterials(); 9495 9496 for (var e = this.children.length - 1; e >= 0; e--) { 9497 9498 var t = this.children[e]; 9499 9500 if (t.children && t.children.length > 0) 9501 9502 for (var i = t.children.length - 1; i >= 0; i--) Fe.clearChild(t.children[i]); 9503 9504 Fe.clearChild(t), t = null 9505 9506 } 9507 9508 this.render() 9509 9510 } 9511 9512 }]), o 9513 9514 }
9514(e.Scene); 9515 9516 Fe.Paper = t, Fe.Stage = n; 9517 9518 var o = function (e) { 9519 9520 Ee(i, e); 9521 9522 var t = Re(i); 9523 9524 9525 9526 function i(e) { 9527 9528 var n; 9529 9530 return Te(this, i), (n = t.call(this)).element = e, n.element.style.position = "absolute", n.addEventListener("removed", (function () { 9531 9532 null !== this.element.parentNode && this.element.parentNode.removeChild(this.element) 9533 9534 })), n 9535 9536 } 9537 9538 return ke(i) 9539 9540 }(e.Object3D); 9541 9542 e.CSS3DObject = o; 9543 9544 var a = function (e) { 9545 9546 Ee(i, e); 9547 9548 var t = Re(i); 9549 9550 9551 9552 function i(e) { 9553 9554 return Te(this, i), t.call(this, e) 9555 9556 } 9557 9558 return ke(i) 9559 9560 }(e.CSS3DObject); 9561 9562 e.CSS3DSprite = a, e.MathUtils && (e.Math = e.MathUtils), e.CSS3DRenderer = function () { 9563 9564 var t, i, n, o; 9565 9566 _e.log("THREE.CSS3DRenderer", e.REVISION); 9567 9568 var a = new e.Matrix4, 9569 9570 r = { 9571 9572 camera: { 9573 9574 fov: 0, 9575 9576 style: "" 9577 9578 }, 9579 9580 objects: {} 9581 9582 }, 9583 9584 s = document.createElement("div"); 9585 9586 s.style.overflow = "hidden", s.style.WebkitTransformStyle = "preserve-3d", s.style.MozTransformStyle = "preserve-3d", s.style.oTransformStyle = "preserve-3d", s.style.transformStyle = "preserve-3d", this.domElement = s; 9587 9588 var l = document.createElement("div"); 9589 9590 l.style.WebkitTransformStyle = "preserve-3d", l.style.MozTransformStyle = "preserve-3d", l.style.oTransformStyle = "preserve-3d", l.style.transformStyle = "preserve-3d", s.appendChild(l), this.setClearColor = function () { }, this.getSize = function () { 9591 9592 return { 9593 9594 width: t, 9595 9596 height: i 9597 9598 } 9599 9600 }, this.setSize = function (e, a) { 9601 9602 n = (t = e) / 2, o = (i = a) / 2, s.style.width = e + "px", s.style.height = a + "px", l.style.width = e + "px", l.style.height = a + "px" 9603 9604 }; 9605 9606 var u = function (e) { 9607 9608 return Math.abs(e) < Number.EPSILON ? 0 : e 9609 9610 }, 9611 9612 h = function (e) { 9613 9614 var t = e.elements; 9615 9616 return "matrix3d(" + u(t[0]) + "," + u(-t[1]) + "," + u(t[2]) + "," + u(t[3]) + "," + u(t[4]) + "," + u(-t[5]) + "," + u(t[6]) + "," + u(t[7]) + "," + u(t[8]) + "," + u(-t[9]) + "," + u(t[10]) + "," + u(t[11]) + "," + u(t[12]) + "," + u(-t[13]) + "," + u(t[14]) + "," + u(t[15]) + ")" 9617 9618 }, 9619 9620 p = function (e) { 9621 9622 var t = e.elements; 9623 9624 return "translate3d(-50%,-50%,0) matrix3d(" + u(t[0]) + "," + u(t[1]) + "," + u(t[2]) + "," + u(t[3]) + "," + u(-t[4]) + "," + u(-t[5]) + "," + u(-t[6]) + "," + u(-t[7]) + "," + u(t[8]) + "," + u(t[9]) + "," + u(t[10]) + "," + u(t[11]) + "," + u(t[12]) + "," + u(t[13]) + "," + u(t[14]) + "," + u(t[15]) + ")" 9625 9626 }, 9627 9628 c = function t(i, n) { 9629 9630 if (i instanceof e.CSS3DObject) { 9631 9632 var o; 9633 9634 i instanceof e.CSS3DSprite ? (a.copy(n.matrixWorldInverse), a.transpose(), a.copyPosition(i.matrixWorld), a.scale(i.scale), a.elements[3] = 0, a.elements[7] = 0, a.elements[11] = 0, a.elements[15] = 1, o = p(a)) : o = p(i.matrixWorld); 9635 9636 var s = i.element, 9637 9638 u = r.objects[i.id]; 9639 9640 void 0 !== u && u === o || (s.style.WebkitTransform = o, s.style.MozTransform = o, s.style.oTransform = o, s.style.transform = o, r.objects[i.id] = o), s.parentNode !== l && l.appendChild(s) 9641 9642 } 9643 9644 for (var h = 0, c = i.children.length; h < c; h++) t(i.children[h], n) 9645 9646 }; 9647 9648 this.render = function (t, a) { 9649 9650 var u = .5 / Math.tan(e.Math.degToRad(.5 * a.fov)) * i; 9651 9652 r.camera.fov !== u && (s.style.WebkitPerspective = u + "px", s.style.MozPerspective = u + "px", s.style.oPerspective = u + "px", s.style.perspective = u + "px", r.camera.fov = u), t.updateMatrixWorld(), null === a.parent && a.updateMatrixWorld(), a.matrixWorldInverse.invert ? a.matrixWorldInverse.copy(a.matrixWorld).invert() : a.matrixWorldInverse.getInverse(a.matrixWorld); 9653
9654 var p = "translate3d(0,0," + u + "px)" + h(a.matrixWorldInverse) + " translate3d(" + n + "px," + o + "px, 0)"; 9655 9656 r.camera.style !== p && (l.style.WebkitTransform = p, l.style.MozTransform = p, l.style.oTransform = p, l.style.transform = p, r.camera.style = p), c(t, a) 9657 9658 } 9659 9660 } 9661 9662 } 9663 9664 }; 9665 9666 var Ze = e.utils; 9667 9668 y.prototype.pinchDown = function (e) { 9669 9670 null != e.touches && 2 == e.touches.length && null == this.startTouches && (this.startTouches = Ze.getTouches(e), this.app.viewer.zoomCenter = Ze.getVectorAvg(Ze.getTouches(e, this.parentElement.offset())), this.lastScale = 1) 9671 9672 }, y.prototype.pinchUp = function (e) { 9673 9674 null != e.touches && e.touches.length < 2 && 1 == this.pinchZoomDirty && (this.app.viewer.lastScale = this.lastScale, this.app.container.removeClass("pf-pinch-zoom"), this.updateTemporaryScale(!0), this.app.zoom(), this.lastScale = null, this.app.viewer.canSwipe = !1, this.pinchZoomDirty = !1, this.app.viewer._pinchZoomLastScale = null, this.startTouches = null) 9675 9676 }, y.prototype.pinchMove = function (t) { 9677 9678 if (null != t.touches && 2 == t.touches.length && null != this.startTouches) { 9679 9680 this.pinchZoomDirty = !0, this.app.container.addClass("pf-pinch-zoom"); 9681 9682 var i = Ze.calculateScale(this.startTouches, Ze.getTouches(t)); 9683 9684 this.lastScale; 9685 9686 return this.lastScale = i, this.app.viewer.pinchZoomUpdateScale = Ze.limitAt(i, this.app.viewer.minZoom / this.app.zoomValue, this.app.viewer.maxZoom / this.app.zoomValue), this.app.viewer._pinchZoomLastScale != this.app.viewer.pinchZoomUpdateScale && (this.app.viewer.pinchZoomRequestStatus = e.REQUEST_STATUS.ON, this.app.viewer._pinchZoomLastScale = this.app.viewer.pinchZoomUpdateScale), void t.preventDefault() 9687 9688 } 9689 9690 }; 9691 9692 var Ke = function (t) { 9693 9694 Ve(n, t); 9695 9696 var i = Ge(n); 9697 9698 9699 9700 function n(t, o) { 9701 9702 return Be(this, n), t.flipbook3DTiltAngleUp = 0, t.flipbook3DTiltAngleLeft = 0, t.hasSpiral = !1, t.flexibility = 0, t.cover3DType !== e.FLIPBOOK_COVER_TYPE.RIDGE && t.cover3DType !== e.FLIPBOOK_COVER_TYPE.BASIC || (t.cover3DType = e.FLIPBOOK_COVER_TYPE.PLAIN), i.call(this, t, o) 9703 9704 } 9705 9706 return Ue(n, [{ 9707 9708 key: "init", 9709 9710 value: function () { 9711 9712 je(qe(n.prototype), "init", this).call(this), this.texturePowerOfTwo = !1, this.app.container.addClass("pf-hybrid-viewer pf-pending") 9713 9714 } 9715 9716 }, { 9717 9718 key: "getAnnotationElement", 9719 9720 value: function (e) { 9721 9722 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; 9723 9724 return je(qe(n.prototype), "getAnnotationElement", this).call(this, e, t, !0) 9725 9726 } 9727 9728 }, { 9729 9730 key: "getTextElement", 9731 9732 value: function (e) { 9733 9734 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; 9735 9736 return je(qe(n.prototype), "getTextElement", this).call(this, e, t, !0) 9737 9738 } 9739 9740 }, { 9741 9742 key: "isAnimating", 9743 9744 value: function () { 9745 9746 return this.isFlipping() 9747 9748 } 9749 9750 }, { 9751 9752 key: "onCenterStartAnimation", 9753 9754 value: function (e) { 9755 9756 this.app.container.addClass("pf-hide-zoomview") 9757 9758 } 9759 9760 }, { 9761 9762 key: "onCenterStopAnimation", 9763 9764 value: function (e) { 9765 9766 this.finalizeCenterAnimation() 9767 9768 } 9769 9770 }, { 9771 9772 key: "onCenterCompleteAnimation", 9773 9774 value: function (e) { 9775 9776 this.zoomViewer.updateCenter(), this.finalizeCenterAnimation() 9777 9778 } 9779 9780 }, { 9781 9782 key: "finalizeCenterAnimation", 9783 9784 value: function () { 9785 9786 this.app.container.removeClass("pf-hide-zoomview") 9787 9788 } 9789 9790 }, { 9791 9792 key: "afterFlip", 9793 9794 value: function () { 9795 9796 !0 !== this.isAnimating() && (this.pagesReady(), this.updatePendingStatusClass(), this.updateZoomViewerTexture({ 9797 9798 pageNumber: this.getBasePage() 9799 9800 }), this.updateZoomViewerTexture({ 9801 9802 pageNumber: this.getBasePage() + 1 9803 9804 })) 9805 9806 } 9807 9808 }, { 9809 9810 key: "exchangeTexture", 9811 9812 value: function (e, t) { 9813 9814 this.skipCenterAnimation = !0, je(qe(n.prototype), "exchangeTexture", this).call(this, e, t), this.updateZoomViewerTextContent({ 9815 9816 pageNumber: this.getBasePage() 9817 9818 }), this.updateZoomViewerTextContent({ 9819 9820 pageNumber: this.getBasePage() + 1 9821 9822 }) 9823 9824 } 9825 9826 }, { 9827 9828 key: "updateZoomViewerTexture", 9829 9830 value: function (e) { 9831 9832 var t = this.zoomViewer.getPageByNumber(e.pageNumber); 9833 9834 t && "-1" === t.textureStamp && (this.zoomViewer.setPage({ 9835 9836 pageNumber: t.pageNumber, 9837 9838 texture: this.getPageByNumber(t.pageNumber).getTexture() 9839 9840 }) && this.updateZoomViewerTextContent(e)) 9841 9842 } 9843 9844 }, { 9845 9846 key: "updateZoomViewerTextContent", 9847 9848 value: function (e) { 9849 9850 this.app.provider.processAnnotations(e.pageNumber, this.app.viewer.getAnnotationElement(e.pageNumber, !0)), this.app.provider.processTextContent(e.pageNumber, this.app.viewer.getTextElement(e.pageNumber, !0)) 9851 9852 } 9853 9854 }, { 9855 9856 key: "textureLoadedCallback", 9857 9858 value: function (e) { 9859 9860 this.app.renderRequestStart(), this.updateZoomViewerTexture(e), this.pagesReady() 9861 9862 } 9863 9864 }, { 9865 9866 key: "resizeAnnotations", 9867 9868 value: function (e) { } 9869 9870 }]), n 9871 9872 }(Me), 9873 9874 Qe = function (e) { 9875 9876 Ve(i, e); 9877 9878 var t = Ge(i); 9879 9880 9881 9882 function i(e, n) { 9883 9884 var o; 9885 9886 return Be(this, i), (o = t.call(this, e, n)).orientation = "vertical", o 9887 9888 } 9889 9890 return Ue(i) 9891 9892 }(Me), 9893 9894 Xe = Ue((function t(i, n) { 9895 9896 return Be(this, t), 0 != e.utils.canSupport3D() && void 0 !== i.is3D || (i.is3D = !1), "flat3D" === i.is3D ? (i.flexibility = 0, new Ke(i, n)) : "calendar3D" === i.is3D ? new Qe(i, n) : Ze.isTrue(i.is3D) ? new Me(i, n) : new ue(i, n) 9897 9898 })); 9899 9900 9901 9902 function Ye(e, t) { 9903 9904 return Ye = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 9905 9906 return e.__proto__ = t, e 9907 9908 }, Ye(e, t) 9909 9910 } 9911 9912 9913 9914 function Je(e) { 9915 9916 var t = function () { 9917 9918 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 9919 9920 if (Reflect.construct.sham) return !1; 9921 9922 if ("function" == typeof Proxy) return !0; 9923 9924 try { 9925 9926 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 9927 9928 } catch (e) { 9929 9930 return !1 9931 9932 } 9933 9934 }(); 9935 9936 return function () { 9937 9938 var i, n = et(e); 9939 9940 if (t) { 9941 9942 var o = et(this).constructor; 9943 9944 i = Reflect.construct(n, arguments, o) 9945 9946 } else i = n.apply(this, arguments); 9947 9948 return function (e, t) { 9949 9950 if (t && ("object" === tt(t) || "function" == typeof t)) return t; 9951 9952 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 9953 9954 return $e(e) 9955 9956 }(this, i) 9957 9958 } 9959 9960 } 9961 9962 9963 9964 function $e(e) { 9965 9966 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 9967 9968 return e 9969 9970 } 9971 9972 9973 9974 function et(e) { 9975 9976 return et = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { 9977 9978 return e.__proto__ || Object.getPrototypeOf(e) 9979 9980 }, et(e) 9981 9982 } 9983 9984 9985 9986 function tt(e) { 9987 9988 return tt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 9989 9990 return typeof e 9991 9992 } : function (e) { 9993 9994 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 9995 9996 }, tt(e) 9997 9998 } 9999 10000 10001 10002 function it(e, t) { 10003 10004 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 10005 10006 } 10007 10008 10009 10010 function nt(e, t) { 10011 10012 for (var i = 0; i < t.length; i++) { 10013 10014 var n = t[i]; 10015 10016 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 10017 10018 if ("object" !== tt(e) || null === e) return e; 10019 10020 var i = e[Symbol.toPrimitive]; 10021 10022 if (void 0 !== i) { 10023 10024 var n = i.call(e, t || "default"); 10025 10026 if ("object" !== tt(n)) return n; 10027 10028 throw new TypeError("@@toPrimitive must return a primitive value.") 10029 10030 } 10031 10032 return ("string" === t ? String : Number)(e) 10033 10034 }(o, "string"), "symbol" === tt(a) ? a : String(a)), n) 10035 10036 } 10037 10038 var o, a 10039 10040 } 10041 10042 10043 10044 function ot(e, t, i) { 10045
10046 return t && nt(e.prototype, t), i && nt(e, i), Object.defineProperty(e, "prototype", { 10047 10048 writable: !1 10049 10050 }), e 10051 10052 } 10053 10054 e.viewers = e.viewers || {}, e.viewers.flipbook = Xe, e.viewers.default = e.viewers.reader = F, e.viewers.slider = Pe; 10055 10056 var at = e.utils, 10057 10058 rt = function () { 10059 10060 function t() { 10061 10062 it(this, t), this.baseUrl = null, this.pdfDocument = null, this.pdfApp = null, this.pdfHistory = null, this.externalLinkRel = null, this.externalLinkEnabled = !0, this._pagesRefCache = null 10063 10064 } 10065 10066 return ot(t, [{ 10067 10068 key: "dispose", 10069 10070 value: function () { 10071 10072 this.baseUrl = null, this.pdfDocument = null, this.pdfApp = null, this.pdfHistory = null, this._pagesRefCache = null 10073 10074 } 10075 10076 }, { 10077 10078 key: "setDocument", 10079 10080 value: function (e, t) { 10081 10082 this.baseUrl = t, this.pdfDocument = e, this._pagesRefCache = Object.create(null) 10083 10084 } 10085 10086 }, { 10087 10088 key: "setViewer", 10089 10090 value: function (e) { 10091 10092 this.pdfApp = e, this.externalLinkTarget = e.options.linkTarget 10093 10094 } 10095 10096 }, { 10097 10098 key: "setHistory", 10099 10100 value: function (e) { 10101 10102 this.pdfHistory = e 10103 10104 } 10105 10106 }, { 10107 10108 key: "pagesCount", 10109 10110 get: function () { 10111 10112 return this.pdfDocument.numPages 10113 10114 } 10115 10116 }, { 10117 10118 key: "page", 10119 10120 get: function () { 10121 10122 return this.pdfApp.currentPageNumber 10123 10124 }, 10125 10126 set: function (e) { 10127 10128 this.pdfApp.gotoPage(e) 10129 10130 } 10131 10132 }, { 10133 10134 key: "navigateTo", 10135 10136 value: function (e) { 10137 10138 this.goToDestination(e) 10139 10140 } 10141 10142 }, { 10143 10144 key: "addLinkAttributes", 10145 10146 value: function (t, i) { 10147 10148 var n = this.externalLinkTarget, 10149 10150 o = this.externalLinkRel, 10151 10152 a = this.externalLinkEnabled; 10153 10154 if (!i || "string" != typeof i) throw new Error('A valid "url" parameter must provided.'); 10155 10156 var r = (0, at.removeNullCharacters)(i); 10157 10158 a ? t.href = t.title = r : (t.href = "", t.title = "Disabled: ".concat(r), t.onclick = function () { 10159 10160 return !1 10161 10162 }); 10163 10164 var s = ""; 10165 10166 switch (n) { 10167 10168 case e.LINK_TARGET.NONE: 10169 10170 break; 10171 10172 case e.LINK_TARGET.SELF: 10173 10174 s = "_self"; 10175 10176 break; 10177 10178 case e.LINK_TARGET.BLANK: 10179 10180 s = "_blank"; 10181 10182 break; 10183 10184 case e.LINK_TARGET.PARENT: 10185 10186 s = "_parent"; 10187 10188 break; 10189 10190 case e.LINK_TARGET.TOP: 10191 10192 s = "_top" 10193 10194 } 10195 10196 t.target = s, t.rel = "string" == typeof o ? o : "noopener noreferrer nofollow" 10197 10198 } 10199 10200 }, { 10201 10202 key: "goToDestination", 10203 10204 value: function (e) { 10205 10206 var t, i = "", 10207 10208 n = this, 10209 10210 o = function t(o) { 10211 10212 at.log("Requested: ", o); 10213 10214 var a = o instanceof Object ? n._pagesRefCache[o.num + " " + o.gen + " R"] : o + 1; 10215 10216 a ? ((a = n.pdfApp.viewer.getViewerPageNumber(a)) > n.pdfApp.pageCount && (a = n.pdfApp.pageCount), at.log("Loading for:", o, " at page ", a), n.pdfApp.requestDestRefKey === o.num + " " + o.gen + " R" ? (n.pdfAp
10216p.gotoPage(a), n.pdfHistory && n.pdfHistory.push({ 10217 10218 dest: e, 10219 10220 hash: i, 10221 10222 page: a 10223 10224 })) : at.log("Expired Request for ", a, " with ", o)) : (n.pdfApp.container.addClass("pf-fetch-pdf"), n.pdfDocument.getPageIndex(o).then((function (e) { 10225 10226 var i = e + 1, 10227 10228 a = o.num + " " + o.gen + " R"; 10229 10230 n._pagesRefCache[a] = i, t(o) 10231 10232 }))) 10233 10234 }; 10235 10236 "string" == typeof e ? (i = e, t = this.pdfDocument.getDestination(e)) : t = Promise.resolve(e), t.then((function (t) { 10237 10238 at.log("Started:", t), e = t, t instanceof Array && (n.pdfApp.requestDestRefKey = t[0].num + " " + t[0].gen + " R", o(t[0])) 10239 10240 })) 10241 10242 } 10243 10244 }, { 10245 10246 key: "customNavigateTo", 10247 10248 value: function (t) { 10249 10250 if ("" !== t && null != t && "null" !== t) { 10251 10252 var i = null; 10253 10254 if (isNaN(Math.floor(t))) { 10255 10256 if ("string" == typeof t && (i = parseInt(t.replace("#", ""), 10), isNaN(i))) return void window.open(t, this.pdfApp.options.linkTarget === e.LINK_TARGET.SELF ? "_self" : "_blank") 10257 10258 } else i = t; 10259 10260 null != i && this.pdfApp.gotoPage(i) 10261 10262 } 10263 10264 } 10265 10266 }, { 10267 10268 key: "getDestinationHash", 10269 10270 value: function (e) { 10271 10272 if ("string" == typeof e) return this.getAnchorUrl("#" + escape(e)); 10273 10274 if (e instanceof Array) { 10275 10276 var t = e[0], 10277 10278 i = t instanceof Object ? this._pagesRefCache[t.num + " " + t.gen + " R"] : t + 1; 10279 10280 if (i) { 10281 10282 var n = this.getAnchorUrl("#page=" + i), 10283 10284 o = e[1]; 10285 10286 if ("object" === tt(o) && "name" in o && "XYZ" === o.name) { 10287 10288 var a = e[4] || this.pdfApp.pageScaleValue, 10289 10290 r = parseFloat(a); 10291 10292 r && (a = 100 * r), n += "&zoom=" + a, (e[2] || e[3]) && (n += "," + (e[2] || 0) + "," + (e[3] || 0)) 10293 10294 } 10295 10296 return n 10297 10298 } 10299 10300 } 10301 10302 return this.getAnchorUrl("") 10303 10304 } 10305 10306 }, { 10307 10308 key: "getCustomDestinationHash", 10309 10310 value: function (e) { 10311 10312 return "#" + escape(e) 10313 10314 } 10315 10316 }, { 10317 10318 key: "getAnchorUrl", 10319 10320 value: function (e) { 10321 10322 return (this.baseUrl || "") + e 10323 10324 } 10325 10326 }, { 10327 10328 key: "executeNamedAction", 10329 10330 value: function (e) { 10331 10332 switch (e) { 10333 10334 case "GoBack": 10335 10336 this.pdfHistory && this.pdfHistory.back(); 10337 10338 break; 10339 10340 case "GoForward": 10341 10342 this.pdfHistory && this.pdfHistory.forward(); 10343 10344 break; 10345 10346 case "NextPage": 10347 10348 this.page++; 10349 10350 break; 10351 10352 case "PrevPage": 10353 10354 this.page--; 10355 10356 break; 10357 10358 case "LastPage": 10359 10360 this.page = this.pagesCount; 10361 10362 break; 10363 10364 case "FirstPage": 10365 10366 this.page = 1 10367 10368 } 10369 10370 var t = document.createEvent("CustomEvent"); 10371 10372 t.initCustomEvent("namedaction", !0, !0, { 10373 10374 action: e 10375 10376 }
10376), this.pdfApp.container.dispatchEvent(t) 10377 10378 } 10379 }, { 10380 10381 key: "cachePageRef", 10382 10383 value: function (e, t) { 10384 10385 var i = t.num + " " + t.gen + " R"; 10386 10387 this._pagesRefCache[i] = e 10388 10389 } 10390 10391 }]), t 10392 10393 }(), 10394 10395 st = function () { 10396 10397 function e(t, i) { 10398 10399 it(this, e), this.props = t, this.app = i, this.textureCache = [], this.pageCount = 0, this.numPages = 0, this.outline = [], this.viewPorts = [], this.requestedPages = "", this.requestIndex = 0, this.pagesToClean = [], this.defaultPage = void 0, this.pageSize = this.app.options.pageSize, this._page1Pass = !1, this._page2Pass = !1, this.pageLabels = void 0, this.textSearchLength = 0, this.textSearch = "", this.textContentSearch = [], this.textContentJoinedSearch = [], this.textOffsetSearch = [], this.textContent = [], this.textContentJoined = [], this.textOffset = [], this.autoLinkItemsCache = [], this.autoLinkHitsCache = [], this.searchHitItemsCache = [], this.searchHits = [], this.PDFLinkItemsCache = [], this.canPrint = !0, this.textPostion = [] 10400 10401 } 10402 10403 return ot(e, [{ 10404 10405 key: "finalize", 10406 10407 value: function () { } 10408 10409 }, { 10410 10411 key: "dispose", 10412 10413 value: function () { } 10414 10415 }, { 10416 10417 key: "softDispose", 10418 10419 value: function () { } 10420 10421 }, { 10422 10423 key: "setCache", 10424 10425 value: function (e, t, i) { 10426 10427 var n = this, 10428 10429 o = i; 10430 10431 i && (void 0 === n.textureCache[o] && (n.textureCache[o] = []), n.textureCache[o][e] = t) 10432 10433 } 10434 10435 }, { 10436 10437 key: "getCache", 10438 10439 value: function (e, t) { 10440 10441 return void 0 === this.textureCache[t] ? void 0 : this.textureCache[t][e] 10442 10443 } 10444 10445 }, { 10446 10447 key: "_isValidPage", 10448 10449 value: function (e) { 10450 10451 return e > 0 && e <= this.pageCount 10452 10453 } 10454 10455 }, { 10456 10457 key: "getLabelforPage", 10458 10459 value: function (e) { 10460 10461 return this.pageLabels && void 0 !== this.pageLabels[e - 1] ? this.pageLabels[e - 1] : e 10462 10463 } 10464 10465 }, { 10466 10467 key: "getThumbLabel", 10468 10469 value: function (e) { 10470 10471 var t = this.getLabelforPage(e); 10472 10473 return t !== e ? t + " (" + e + ")" : e 10474 10475 } 10476 10477 }, { 10478 10479 key: "getPageNumberForLabel", 10480 10481 value: function (e) { 10482 10483 if (!this.pageLabels) return e; 10484 10485 var t = this.pageLabels.indexOf(e); 10486 10487 return t < 0 ? null : t + 1 10488 10489 } 10490 10491 }, { 10492 10493 key: "processPage", 10494 10495 value: function (e) { } 10496 10497 }, { 10498 10499 key: "cleanUpPages", 10500 10501 value: function () { } 10502 10503 }, { 10504 10505 key: "checkRequestQueue", 10506 10507 value: function () { } 10508 10509 }, { 10510 10511 key: "processAnnotations", 10512 10513 value: function () { } 10514 10515 }, { 10516 10517 key: "processTextContent", 10518 10519 value: function () { } 10520 10521 }, { 10522 10523 key: "loadDocument", 10524 10525 value: function () { } 10526 10527 }, { 10528 10529 key: "pagesLoaded", 10530 10531 value: function () { 10532 10533 var e = this; 10534 10535 e._page1Pass && e._page2Pass && (e.app.viewer.checkDocumentPageSizes(), e.finalize()) 10536 10537 } 10538 10539 }, { 10540 10541 key: "_documentLoaded", 10542 10543 value: function () { 10544 10545 this.finalizeOutLine(), this.app && this.app.dimensions && void 0 === this.app.dimensions.pageFit && at.log("Provider needs to initialize page properties for the app"), this.app._documentLoaded() 10546 10547 } 10548 10549 }, { 10550 10551 key: "finalizeOutLine", 10552 10553 value: function () { 10554 10555 if (null !== this.app && null !== this.app.options) { 10556 10557 var e = this.app.options.outline; 10558 10559 if (e) 10560 10561 for (var t = 0; t < e.length; t++) e[t].custom = !0, this.outline.push(e[t]) 10562 10563 } 10564 10565 } 10566 10567 }, { 10568 10569 key: "search", 10570 10571 value: function () { } 10572 10573 }]), e 10574 10575 }(), 10576 10577 lt = function (t) { 10578 10579 ! function (e, t) { 10580 10581 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 10582 10583 e.prototype = Object.create(t && t.prototype, { 10584 10585 constructor: { 10586 10587 value: e, 10588 10589 writable: !0, 10590 10591 configurable: !0 10592 10593 } 10594 10595 }), Object.defineProperty(e, "prototype", { 10596 10597 writable: !1 10598 10599 }), t && Ye(e, t) 10600 10601 }(o, t); 10602 10603 var n = Je(o); 10604 10605 10606 10607 function o(t, a) { 10608 10609 var r; 10610 10611 it(this, o); 10612 10613 var s, l = (r = n.call(this, t, a)).app, 10614 10615 u = $e(r); 10616 10617 10618 10619 function h(t) { 10620 10621 l.updateInfo(l.options.text.loading + " PDF Worker ..."); 10622 10623 var i = document.createElement("a"); 10624 10625 i.href = l.options.pdfjsWorkerSrc + u.cacheBustParameters, i.hostname !== window.location.hostname && !0 === e.loadCorsPdfjsWorker ? (l.updateInfo(l.options.text.loading + " PDF Worker CORS ..."), jQuery.ajax({ 10626 10627 url: l.options.pdfjsWorkerSrc + u.cacheBustParameters, 10628 10629 cache: !0, 10630 10631 success: function (e) { 10632 10633 l.options.pdfjsWorkerSrc = at.createObjectURL(e, "text/javascript"), "function" == typeof t && t() 10634 10635 } 10636 10637 })) : "function" == typeof t && t() 10638 10639 } 10640 10641 return u.pdfDocument = void 0, u._page2Ratio = void 0, u.cacheBustParameters = "?ver=" + e.version + "&pdfver=" + l.options.pdfVersion, s = function () { 10642 10643 pdfjsLib.GlobalWorkerOptions.workerSrc = l.options.pdfjsWorkerSrc + u.cacheBustParameters, pdfjsLib.canvasWillReadFrequently = e.defaults.canvasWillReadFrequently, u.loadDocument() 10644 10645 }, "undefined" == typeof pdfjsLib ? (l.updateInfo(l.options.text.loading + " PDF Service ..."), at.getScript(l.options.pdfjsSrc + u.cacheBustParameters, (function () { 10646 10647 "function" == typeof define && i.amdO && window.requirejs && window.require && window.require.config ? (l.updateInfo(l.options.text.loading + " PDF Service (require) ..."), window.require.config({ 10648 10649 paths: { 10650 10651 "pdfjs-dist/build/pdf.worker": l.options.pdfjsWorkerSrc.replace(".js", "") 10652 10653 } 10654 10655 }), window.require(["pdfjs-dist/build/pdf"], (function (e) { 10656 10657 window.pdfjsLib = e, h(s) 10658 10659 }))) : h(s) 10660 10661 }), (function () { 10662 10663 l.updateInfo("Unable to load PDF service.."), u.dispose() 10664 10665 }), l.options.pdfjsSrc.indexOf("pdfjs-4") > 1)) : "function" == typeof s && s(), r 10666 10667 } 10668 10669 return ot(o, [{ 10670 10671 key: "dispose", 10672 10673 value: function () { 10674 10675 this.pdfDocument && this.pdfDocument.destroy(), this.linkService = at.disposeObject(this.linkService), this.pdfLoadProgress && this.pdfLoadProgress.destroy(), this.pdfLoadProgress = null, this.pdfDocument = null 10676 10677 } 10678 10679 }, { 10680 10681 key: "loadDocument", 10682 10683 value: function () { 10684 10685 var e = this.app, 10686 10687 t = this.app.options, 10688 10689 i = this, 10690 10691 n = t.pdfParameters || {}; 10692 10693 if (n.url = at.httpsCorrection(n.url || t.source), n.rangeChunkSize = t.rangeChunkSize, n.cMapPacked = !0, n.disableAutoFetch = t.disableAutoFetch, n.disableStream = t.disableStream, n.disableRange = !0 === t.disableRange, n.disableFontFace = t.disableFontFace, n.cMapUrl = t.cMapUrl, n.imagesLocation = t.imagesLocation, n.imageResourcesPath = t.imageResourcesPath, n.url || n.data || n.range) { 10694 10695 var o = i.pdfLoadProgress = pdfjsLib.getDocument(n); 10696 10697 o._worker.promise.then((function (t) { 10698 10699 e.updateInfo(e.options.text.loading + " PDF ...") 10700 10701 })), o.onPassword = function (e, t) { 10702 10703 switch (t) { 10704 10705 case pdfjsLib.PasswordResponses.NEED_PASSWORD: 10706 10707 if (null === (i = prompt("Enter the password to open the PDF file."))) throw new Error("No password givsen."); 10708 10709 e(i); 10710 10711 break; 10712 10713 case pdfjsLib.PasswordResponses.INCORRECT_PASSWORD: 10714 10715 var i; 10716 10717 if (!(i = prompt("Invalid password. Please try again."))) throw new Error("No password givaen."); 10718 10719 e(i) 10720 10721 } 10722 10723 }, o.promise.then((function (n) { 10724 10725 i.pdfDocument = n, n.getPage(1).then((function (o) { 10726 10727 var a; 10728 10729 i.defaultPage = o; 10730 10731 var r = i.defaultPage.viewPort = o.getViewport({ 10732 10733 scale: 1, 10734 10735 rotation: o._pageInfo.rotate + e.options.pageRotation 10736 10737 }), 10738 10739 s = i.defaultPage.pageRatio = r.width / r.height, 10740 10741 l = s > 1;
10742 10743 i.viewPorts[1] = r, e.dimensions.defaultPage = { 10744 10745 ratio: s, 10746 10747 viewPort: r, 10748 10749 width: r.width, 10750 10751 height: r.height 10752 10753 }, e.dimensions.maxTextureHeight = (null !== (a = t.maxTextureSize) && void 0 !== a ? a : 3200) / (l ? s : 1), e.dimensions.maxTextureWidth = e.dimensions.maxTextureHeight * s, e.dimensions.autoHeightRatio = 1 / s, i.pageCount = n.numPages, i.numPages = n.numPages, i._page1Pass = !0, i.pagesLoaded() 10754 10755 })), n.numPages > 1 && !0 === e.checkSecondPage ? n.getPage(2).then((function (t) { 10756 10757 var n = t.getViewport({ 10758 10759 scale: 1, 10760 10761 rotation: t._pageInfo.rotate + e.options.pageRotation 10762 10763 }); 10764 10765 i._page2Ratio = n.width / n.height, i.viewPorts[2] = n, i._page2Pass = !0, i.pagesLoaded() 10766 10767 })) : (i._page2Pass = !0, i.pagesLoaded()) 10768 10769 })).catch((function (t) { 10770 10771 if (null !== e && null != e.options) { 10772 10773 var n, o = "", 10774 10775 a = document.createElement("a"); 10776 10777 a.href = e.options.source, a.hostname === window.location.hostname || -1 !== a.href.indexOf("file://") || at.isChromeExtension() || -1 !== a.href.indexOf("blob:") || (o = "<strong>CROSS ORIGIN!! </strong>"); 10778 10779 var r = (null === (n = e.options) || void 0 === n ? void 0 : n.fileName) || a.href; 10780 10781 e.updateInfo(o + "<strong>Error: Cannot access file! </strong>" + unescape(r) + "<br><br>" + t.message, "pf-error"), console.log(t), e.container.removeClass("pf-loading").addClass("pf-error"), i.dispose() 10782 10783 } 10784 10785 })), o.getTotalLength = function () { 10786 10787 return i.pdfLoadProgress._transport._networkStream._fullRequestReader.contentLength 10788 10789 }, o.onProgress = function (t) { 10790 10791 if (null !== e) { 10792 10793 var i = 100 * t.loaded / o.getTotalLength(); 10794 10795 isNaN(i) ? t && t.loaded ? (void 0 === o.lastLoaded || o.lastLoaded + 25e4 < t.loaded) && (o.lastLoaded = t.loaded, e.updateInfo(e.options.text.loading + " PDF " + (Math.ceil(t.loaded / 1e4) / 100).toFixed(2).toString() + "MB ...")) : e.updateInfo(e.options.text.loading + " PDF ...") : e.updateInfo(e.options.text.loading + " PDF " + Math.ceil(Math.min(100, i)).toString().split(".")[0] + "% ...") 10796 10797 } 10798 10799 } 10800 10801 } else e.updateInfo("ERROR : No PDF File provided! ", "pf-error") 10802 10803 } 10804 10805 }, { 10806 10807 key: "pdfFetchStarted", 10808 10809 value: function () { 10810 10811 this.pdfFetchStatusCount = 0, this.app.container.addClass("pf-fetch-pdf"), this.pdfFetchStatus = e.REQUEST_STATUS.COUNT 10812 10813 } 10814 10815 }, { 10816 10817 key: "checkRequestQueue", 10818 10819 value: function () { } 10820 10821 }, { 10822 10823 key: "finalize", 10824 10825 value: function () { 10826 10827 var e = this.app, 10828 10829 t = this; 10830 10831 null !== e && null !== e.options && (t.linkService = new rt, t.linkService.setDocument(t.pdfDocument, null), t.linkService.setViewer(e), t.pdfDocument.getOutline().then((function (i) { 10832 10833 !0 === e.options.overwritePDFOutline && (i = []), i = i || [], t.outline = i 10834 10835 })).finally((function () { 10836 10837 t._getLabels() 10838 10839 }))) 10840 10841 } 10842 10843 }, { 10844 10845 key: "_getLabels", 10846 10847 value: function () { 10848 10849 var e = this.app, 10850 10851 t = this; 10852 10853 t.pdfDocument.getPageLabels().then((function (i) { 10854 10855 if (i && !0 !== e.options.disablePageLabels) { 10856 10857 for (var n = i.length, o = 0, a = 0, r = 0; r < n; r++) { 10858 10859 var s = i[r]; 10860 10861 if (s === (r + 1).toString()) o++; 10862 10863 else { 10864 10865 if ("" !== s) break; 10866 10867 a++ 10868 10869 } 10870 10871 } 10872 10873 o >= n || a >= n || (t.pageLabels = i) 10874 10875 } 10876 10877 })).finally((function () { 10878 10879 t._getPermissions() 10880 10881 })) 10882 10883 } 10884 10885 }, { 10886 10887 key: "_getPermissions", 10888 10889 value: function () { 10890 10891 var e = this.app, 10892 10893 t = this; 10894 10895 t.pdfDocument.getPermissions().then((function (i) { 10896 10897 null !== i && Array.isArray(i) && (t.canPrint = i.indexOf(pdfjsLib.PermissionFlag.PRINT) > -1, 0 == t.canPrint && (console.log("PDF printing is disabled."), e.options.showPrintControl = e.options.showPrintControl && t.canPrint)) 10898 10899 })).finally((function () { 10900 10901 t._documentLoaded() 10902 10903 })) 10904 10905 } 10906 10907 }, { 10908 10909 key: "processPage", 10910 10911 value: function (e) { 10912 10913 var t = this.app, 10914 10915 i = this, 10916 10917 n = e.pageNumber, 10918 10919 o = performance.now(), 10920 10921 a = t.viewer.getDocumentPageNumber(n); 10922 10923 at.log("Requesting PDF Page:" + a), i.pdfDocument.getPage(a).then((function (r) { 10924 10925 i.viewPorts[n] || (e.isFreshPage = !0, i.viewPorts[n] = r.getViewport({ 10926 10927 scale: 1, 10928 10929 rotation: r._pageInfo.rotate + t.options.pageRotation 10930 10931 })); 10932 10933 var s, l = t.viewer.getRenderContext(r, e); 10934 10935 e.isFreshPage && (null === (s = t.viewer.getPageByNumber(e.pageNumber)) || void 0 === s || s.changeTexture(e.pageNumber, l.canvas.height)); 10936 10937 at.log("Page " + n + " rendering - " + l.canvas.width + "x" + l.canvas.height), e.trace = i.requestIndex++, i.requestedPages += "," + e.trace + "[" + a + "|" + l.canvas.height + "]", r.cleanupAfterRender = !1, r.render(l).promise.then((function () { 10938 10939 if (t.applyTexture(l.canvas, e), !0 === t.options.cleanupAfterRender) { 10940 10941 var s = "," + e.trace + "[" + a + "|" + l.canvas.height + "]"; 10942 10943 at.log("CleanUp Requesting for (" + n + ") actual " + a), i.requestedPages.indexOf(s) > -1 && (i.requestedPages = i.requestedPages.replace(s, ""), -1 == i.requestedPages.indexOf("[" + a + "|") ? (at.log("CleanUp Passed for (" + n + ") actual " + a), i.pagesToClean.push(r), i.pagesToClean.length > 0 && i.cleanUpPages()) : at.log("CleanUp Cancelled waiting for (" + n + ") actual " + a + " : " + i.requestedPages)) 10944 10945 } 10946 10947 l = null, at.log("Rendered " + n + " in " + (performance.now() - o) + " milliseconds") 10948 10949 })).catch((function (e) { 10950 10951 console.log(e) 10952 10953 })) 10954 10955 })).catch((function (e) { 10956 10957 console.log(e) 10958 10959 })) 10960 10961 } 10962 10963 }, { 10964 10965 key: "cleanUpPages", 10966 10967 value: function () { 10968 10969 for (; this.pagesToClean.length > 0;) { 10970 10971 var e = this.pagesToClean.splice(-1)[0]; 10972 10973 at.log("Cleanup Completed for PDF page: " + (e._pageIndex + 1)), e.cleanup() 10974 10975 } 10976 10977 } 10978 10979 }, { 10980 10981 key: "clearSearch", 10982 10983 value: function () { 10984 10985 var e = this; 10986 10987 e.searchHits = [], e.searchHitItemsCache = [], e.totalHits = 0, e.app.searchResults.html(""), e.app.container.removeClass("pf-search-open"), e.textSearch = "", e.app.container.find(".pf-search-hits").remove() 10988 10989 } 10990 10991 }, { 10992 10993 key: "search", 10994 10995 value: function (e) { 10996 10997 var t = this; 10998 10999 t.textSearch !== e && (t.clearSearch(), e.length < 3 && "" != e ? t.app.updateSearchInfo("Minimum 3 letters required.") : (t.textSearch = e, t.textSearchLength = e.length, t.app.searchContainer.addClass("pf-searching"), t.app.container.addClass("pf-fetch-pdf"), t._search(e, 1))) 11000 11001 } 11002 11003 }, { 11004 11005 key: "_search", 11006 11007 value: function (e) { 11008 11009 var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, 11010 11011 i = this; 11012 11013 i.app.updateSearchInfo("Searching Page: " + t), i.searchPage(t).then((function (n) { 11014 11015 for (var o, a = n, r = new RegExp(e, "gi"), s = []; o = r.exec(a);) s.push({ 11016 11017 index: o.index, 11018 11019 length: i.textSearchLength 11020 11021 }); 11022 11023 if (i.searchHits[t] = s, s.length > 0) { 11024 11025 var l = i.app.viewer.searchPage(t); 11026 11027 !0 === l.include && (i.totalHits += s.length, i.app.searchResults.append('<div class="pf-search-result ' + (i.app.currentPageNumber === t ? "pf-active" : "") + '" data-pf-page="' + t + '"><span>Page ' + l.label + "</span><span>" + s.length + " " + (s.length > 1 ? "results" : "result") + "</span></div>")) 11028 11029 } 11030 11031 i.app.viewer.isActivePage(t) && (i.processTextContent(t, i.app.viewer.getTextElement(t, !0)), i.app.ui.update()), i._search(e, t + 1) 11032 11033 })).catch((function () { })).finally((function () { 11034 11035 0 == i.totalHits ? i.app.updateSearchInfo("No results Found!") : i.app.updateSearchInfo(i.totalHits + " results found"), i.app.searchContainer.removeClass("pf-searching"), i.app.container.removeClass("pf-fetch-pdf") 11036 11037 })) 11038 11039 } 11040 11041 }, { 11042 11043 key: "prepareTextContent", 11044 11045 value: function (e, t) { 11046 11047 var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; 11048 11049 if (null == (n = this).textContentJoinedSearch[t] || i) { 11050 11051 var n, o, a = 0, 11052 11053 r = 0, 11054 11055 s = 0; 11056 11057 (n = this).textContentSearch[t] = [], n.textContent[t] = [], n.textOffsetSearch[t] = [], n.textOffset[t] = [], n.textContentJoinedSearch[t] = [], n.textContentJoined[t] = []; 11058 11059 for (var l = 0; l < e.items.length; l++) o = e.items[l], n.textContentSearch[t].push(!0 === o.hasEOL ? o.str + " " : o.str), n.textContent[t].push(o.str + " "), r += s = (o.str.length || 0) + (!0 === o.hasEOL ? 1 : 0), n.textOffsetSearch[t].push({ 11060 11061 length: s, 11062 11063 offset: r - s 11064 11065 }), a += s = (o.str.length || 0) + 1, n.textOffset[t].push({ 11066 11067 length: s, 11068 11069 offset: a - s 11070 11071 }); 11072 11073 n.textContentJoinedSearch[t] = n.textContentSearch[t].join(""), n.textContentJoined[t] = n.textContent[t].join("") 11074 11075 } 11076 11077 } 11078 11079 }, { 11080 11081 key: "searchPage", 11082 11083 value: function (e) { 11084 11085 var t = this; 11086 11087 return new Promise((function (i, n) { 11088 11089 if (t._isValidPage(e)) try { 11090 11091 var o = t.app.viewer.getDocumentPageNumber(e); 11092 11093 null == t.textContentJoinedSearch[o] ? t.pdfDocument.getPage(o).then((function (e) { 11094 11095 e.getTextContent().then((function (e) { 11096 11097 t.prepareTextContent(e, o), i(t.textContentJoinedSearch[o]) 11098 11099 })) 11100 11101 })) : i(t.textContentJoinedSearch[o]) 11102 11103 } catch (e) { 11104 11105 at.log(e), n(e) 11106 11107 } else n() 11108 11109 })) 11110 11111 } 11112 11113 }]), o 11114 11115 }(st); 11116 11117 11118 11119 function ut(e, t) { 11120 11121 return ut = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { 11122 11123 return e.__proto__ = t, e 11124 11125 }, ut(e, t) 11126 11127 } 11128 11129 11130 11131 function ht(e) { 11132 11133 var t = function () { 11134 11135 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 11136 11137 if (Reflect.construct.sham) return !1; 11138 11139 if ("function" == typeof Proxy) return !0; 11140 11141 try { 11142 11143 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0 11144 11145 } catch (e) { 11146 11147 return !1 11148 11149 } 11150 11151 }(); 11152 11153 return function () { 11154 11155 var i, n = ct(e); 11156 11157 if (t) { 11158 11159 var o = ct(this).constructor; 11160 11161 i = Reflect.construct(n, arguments, o) 11162 11163 } else i = n.apply(this, arguments); 11164 11165 return function (e, t) { 11166 11167 if (t && ("object" === dt(t) || "function" == typeof t)) return t; 11168 11169 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 11170 11171 return pt(e) 11172 11173 }(this, i) 11174 11175 } 11176 11177 } 11178 11179 11180 11181 function pt(e) { 11182 11183 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 11184 11185 return e 11186 11187 } 11188 11189 11190 11191 function ct(e) { 11192 11193 return ct = Object.setPr
11193ototypeOf ? Object.getPrototypeOf.bind() : function (e) { 11194 11195 return e.__proto__ || Object.getPrototypeOf(e) 11196 11197 }, ct(e) 11198 11199 } 11200 11201 11202 11203 function dt(e) { 11204 11205 return dt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 11206 11207 return typeof e 11208 11209 } : function (e) { 11210 11211 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 11212 11213 }, dt(e) 11214 11215 } 11216 11217 11218 11219 function ft(e, t) { 11220 11221 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 11222 11223 } 11224 11225 11226 11227 function gt(e, t) { 11228 11229 for (var i = 0; i < t.length; i++) { 11230 11231 var n = t[i]; 11232 11233 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 11234 11235 if ("object" !== dt(e) || null === e) return e; 11236 11237 var i = e[Symbol.toPrimitive]; 11238 11239 if (void 0 !== i) { 11240 11241 var n = i.call(e, t || "default"); 11242 11243 if ("object" !== dt(n)) return n; 11244 11245 throw new TypeError("@@toPrimitive must return a primitive value.") 11246 11247 } 11248 11249 return ("string" === t ? String : Number)(e) 11250 11251 }(o, "string"), "symbol" === dt(a) ? a : String(a)), n) 11252 11253 } 11254 11255 var o, a 11256 11257 } 11258 11259 11260 11261 function vt(e, t, i) { 11262 11263 return t && gt(e.prototype, t), i && gt(e, i), Object.defineProperty(e, "prototype", { 11264 11265 writable: !1 11266 11267 }), e 11268 11269 } 11270 11271 e.providers.pdf = lt; 11272 11273 var mt = e.utils, 11274 11275 yt = function () { 11276 11277 function e(t) { 11278 11279 ft(this, e), this._viewPort = new wt(0, 0), this._pageInfo = { 11280 11281 rotate: 0 11282 11283 }, this.src = t.src 11284 11285 } 11286 11287 return vt(e, [{ 11288 11289 key: "getViewport", 11290 11291 value: function () { 11292 11293 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { 11294 11295 scale: 1 11296 11297 }; 11298 11299 return new wt(this._viewPort.height * e.scale, this._viewPort.width * e.scale, e.scale) 11300 11301 } 11302 11303 }]), e 11304 11305 }(), 11306 11307 bt = function () { 11308 11309 function e(t) { 11310 11311 ft(this, e), this.source = [], this.pages = [], this.numPages = t.length; 11312 11313 for (var i = 0; i < t.length; i++) this.source[i] = mt.httpsCorrection(t[i].toString()), this.pages.push(new yt({ 11314 11315 src: this.source[i] 11316 11317 })) 11318 11319 } 11320 11321 return vt(e, [{ 11322 11323 key: "getPage", 11324 11325 value: function (e) { 11326 11327 var t = this; 11328 11329 return new Promise((function (i, n) { 11330 11331 try { 11332 11333 jQuery("<img/>").attr("src", t.source[e - 1]).prop("crossOrigin", "Anonymous").on("load", (function () { 11334 11335 jQuery(this).off(); 11336 11337 var e = new yt({ 11338 11339 src: this.src 11340 11341 }); 11342 11343 e._viewPort.height = this.height, e._viewPort.width = this.width, e._viewPort.scale = 1, e.image = this, i(e) 11344 11345 })) 11346 11347 } catch (e) { 11348 11349 n(e) 11350 11351 } 11352 11353 })) 11354 11355 } 11356 11357 }]), e 11358 11359 }(), 11360 11361 wt = function () { 11362 11363 function e(t, i) { 11364 11365 var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1; 11366 11367 ft(this, e), this.scale = n, this.height = t, this.width = i, this.scale = n, this.transform = [0, 0, 0, 0, 0, this.height] 11368 11369 } 11370 11371 return vt(e, [{ 11372 11373 key: "clone", 11374 11375 value: function () { 11376 11377 return new e(this.height, this.width, this.scale) 11378 11379 } 11380 11381 }]), e 11382 11383 }(), 11384 11385 Pt = function (e) { 11386 11387 ! function (e, t) { 11388 11389 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 11390 11391 e.prototype = Object.create(t && t.prototype, { 11392 11393 constructor: { 11394 11395 value: e, 11396 11397 writable: !0, 11398 11399 configurable: !0 11400 11401 } 11402 11403 }), Object.defineProperty(e, "prototype", { 11404 11405 writable: !1 11406 11407 }), t && ut(e, t) 11408 11409 }(i, e); 11410 11411 var t = ht(i); 11412 11413 11414 11415 function i(e, n) { 11416 11417 var o; 11418 11419 ft(this, i); 11420 11421 var a = (o = t.call(this, e, n)).app, 11422 11423 r = pt(o); 11424 11425 return r.document = new bt(a.options.source), r.pageCount = r.document.numPages, r.numPages = r.document.numPages, r.loadDocument(), o 11426 11427 } 11428 11429 return vt(i, [{ 11430 11431 key: "dispose", 11432 11433 value: function () { } 11434 11435 }, { 11436 11437 key: "loadDocument", 11438 11439 value: function () { 11440 11441 var e = this.app, 11442 11443 t = this.app.options, 11444 11445 i = this; 11446 11447 i.document.getPage(1).then((function (n) { 11448 11449 var o; 11450 11451 i.defaultPage = n; 11452 11453 var a = i.defaultPage.viewPort = n._viewPort, 11454 11455 r = i.defaultPage.pageRatio = a.width / a.height, 11456 11457 s = r > 1; 11458 11459 i.viewPorts[1] = a, e.dimensions.defaultPage = { 11460 11461 ratio: r, 11462 11463 viewPort: a, 11464 11465 width: a.width, 11466 11467 height: a.height 11468 11469 }, e.dimensions.maxTextureHeight = (null !== (o = t.maxTextureSize) && void 0 !== o ? o : 3200) / (s ? r : 1), e.dimensions.maxTextureWidth = e.dimensions.maxTextureHeight * r, e.dimensions.autoHeightRatio = 1 / r, i._page1Pass = !0, i.pagesLoaded() 11470 11471 })), i.pageCount > 1 && !0 === e.checkSecondPage ? i.document.getPage(2).then((function (e) { 11472 11473 var t = e._viewPort; 11474 11475 i._page2Ratio = t.width / t.height, i.viewPorts[2] = t, i._page2Pass = !0, i.pagesLoaded() 11476 11477 })) : (i._page2Pass = !0, i.pagesLoaded()) 11478 11479 } 11480 11481 }, { 11482 11483 key: "finalize", 11484 11485 value: function () { 11486 11487 var e = this.app, 11488 11489 t = this; 11490 11491 null !== e && null !== e.options && (t.linkService = new rt, t.linkService.setViewer(e), t._documentLoaded()) 11492 11493 } 11494 11495 }, { 11496 11497 key: "processPage", 11498 11499 value: function (e) { 11500 11501 var t = this.app, 11502 11503 i = this, 11504 11505 n = e.pageNumber, 11506 11507 o = performance.now(), 11508 11509 a = t.viewer.getDocumentPageNumber(n); 11510 11511 mt.log("Requesting PDF Page:" + a), i.document.getPage(a).then((function (a) { 11512 11513 i.viewPorts[n] || (e.isFreshPage = !0, i.viewPorts[n] = a._viewPort); 11514 11515 var r, s, l = t.viewer.getRenderContext(a, e); 11516 11517 e.isFreshPage && (null === (r = t.viewer.getPageByNumber(e.pageNumber)) || void 0 === r || r.changeTexture(e.pageNumber, l.canvas.height)); 11518 11519 (e.preferCanvas = !0, !0 === e.preferCanvas) ? (l.canvas.getContext("2d").drawImage(a.image, l.viewport.transform[4], 0, l.canvas.width * (null !== (s = l.viewport.widthFix) && void 0 !== s ? s : 1), l.canvas.height), t.applyTexture(l.canvas, e)) : t.applyTexture({ 11520 11521 src: a.src, 11522 11523 height: l.canvas.height, 11524 11525 width: l.canvas.width 11526 11527 }, e); 11528 11529 mt.log("Rendered " + n + " in " + (performance.now() - o) + " milliseconds") 11530 11531 })) 11532 11533 } 11534 11535 }]), i 11536 11537 }(st); 11538 11539 e.providers.image = Pt; 11540 11541 i(745); 11542 11543 11544 11545 function St(e) { 11546 11547 return St = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 11548 11549 return typeof e 11550 11551 } : function (e) { 11552 11553 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 11554 11555 }, St(e) 11556 11557 } 11558 11559 11560 11561 function Ct(e, t) { 11562 11563 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 11564 11565 } 11566 11567 11568 11569 function Tt(e, t) { 11570 11571 for (var i = 0; i < t.length; i++) { 11572 11573 var n = t[i]; 11574 11575 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 11576 11577 if ("object" !== St(e) || null === e) return e; 11578 11579 var i = e[Symbol.toPrimitive]; 11580 11581 if (void 0 !== i) { 11582 11583 var n = i.call(e, t || "default"); 11584 11585 if ("object" !== St(n)) return n; 11586 11587 throw new TypeError("@@toPrimitive must return a primitive value.") 11588 11589 } 11590 11591 return ("string" === t ? String : Number)(e) 11592 11593 }(o, "string"), "symbol" === St(a) ? a : String(a)), n) 11594 11595 } 11596 11597 var o, a 11598 11599 } 11600 11601 11602 11603 function xt(e, t, i) { 11604 11605 return t && Tt(e.prototype, t), i && Tt(e, i), Object.defineProperty(e, "prototype", { 11606 11607 writable: !1 11608 11609 }), e 11610 11611 } 11612 11613 var kt = e.jQuery, 11614 11615 Et = e.utils, 11616 11617 Ot = e.REQUEST_STATUS, 11618 11619 Rt = function () { 11620 11621 function t(e, i) { 11622 11623 Ct(this, t), this.options = e, this.app = i, this.parentElement = this.app.container, this.element = kt("<div>", { 11624 11625 class: "pf-ui" 11626 11627 }), this.leftElement = kt("<div>", { 11628 11629 class: "pf-ui-left" 11630 11631 }).appendTo(this.element), this.centerElement = kt("<div>", { 11632 11633 class: "pf-ui-center" 11634 11635 }).appendTo(this.element), this.rightElement = kt("<div>", { 11636 11637 class: "pf-ui-right" 11638 11639 }).appendTo(this.element), this.parentElement.append(this.element), this.events = {}, this.controls = {} 11640 11641 } 11642 11643 return xt(t, [{ 11644 11645 key: "init", 11646 11647 value: function () { 11648 11649 var t = this, 11650 11651 i = "<div>", 11652 11653 n = this.app, 11654 11655 o = this.controls, 11656 11657 a = n.options.text, 11658 11659 r = n.options.icons; 11660 11661 t.createLogo(), this.openRight = o.openRight = kt(i, { 11662 11663 class: "pf-ui-nav pf-ui-next", 11664 11665 title: n.isRTL ? a.previousPage : a.nextPage, 11666 11667 html: '<div class="pf-ui-btn ' + r.next + '"</div>' 11668 11669 }).on("click", (function () { 11670 11671 n.openRight() 11672 11673 })), this.openLeft = o.openLeft = kt(i, { 11674 11675 class: "pf-ui-nav pf-ui-prev", 11676 11677 title: n.isRTL ? a.nextPage : a.previousPage, 11678 11679 html: '<div class="pf-ui-btn ' + r.prev + '"</div>' 11680 11681 }).on("click", (function () { 11682 11683 n.openLeft() 11684 11685 })), 1 == n.options.autoPlay && (this.play = o.play = Et.createBtn("play", r.play, a.play).on("click", (function () { 11686
11687 var e = kt(this); 11688 11689 n.setAutoPlay(!e.hasClass(n.options.icons.pause)) 11690 11691 })), n.setAutoPlay(n.options.autoPlayStart)), this.pageNumber = o.pageNumber = Et.createBtn("page").on("change", (function () { 11692 11693 n.gotoPageLabel(o.pageInput.val()) 11694 11695 })).on("keyup", (function (e) { 11696 11697 13 === e.keyCode && n.gotoPageLabel(o.pageInput.val()) 11698 11699 })); 11700 11701 var s = "df_book_page_number_" + Math.ceil(performance.now() / 10); 11702 11703 this.pageInput = o.pageInput = kt('<input id="' + s + '" type="text"/>').appendTo(o.pageNumber), this.pageLabel = o.pageLabel = kt('<label for="' + s + '"></label>').appendTo(o.pageNumber), this.thumbnail = o.thumbnail = Et.createBtn("thumbnail", r.thumbnail, a.toggleThumbnails), o.thumbnail.on("click", (function () { 11704 11705 var e = kt(this); 11706 11707 null == n.thumblist && n.initThumbs(), n.thumbContainer.toggleClass("pf-sidemenu-visible"), e.toggleClass("pf-active"), e.hasClass("pf-active") && (e.siblings(".pf-active").trigger("click"), n.thumbRequestStatus = Ot.ON), t.update(), !1 === n.options.sideMenuOverlay && n.resizeRequestStart() 11708 11709 })).addClass("pf-sidemenu-trigger"), n.hasOutline() && (this.outline = o.outline = Et.createBtn("outline", r.outline, a.toggleOutline), o.outline.on("click", (function () { 11710 11711 var e = kt(this); 11712 11713 if (null == n.outlineViewer && n.initOutline(), n.outlineContainer) { 11714 11715 var i = n.outlineContainer; 11716 11717 e.toggleClass("pf-active"), i.toggleClass("pf-sidemenu-visible"), e.hasClass("pf-active") && e.siblings(".pf-active").trigger("click"), t.update(), !1 === n.options.sideMenuOverlay && n.resizeRequestStart() 11718 11719 } 11720 11721 })).addClass("pf-sidemenu-trigger")), !0 === n.options.showSearchControl && !0 !== Et.isMobile && "string" == typeof n.options.source && (o.search = Et.createBtn("search", r.search, a.search), o.search.on("click", (function () { 11722 11723 var e = kt(this); 11724 11725 if (null == n.searchContainer && n.initSearch(), n.searchContainer) { 11726 11727 var i = n.searchContainer; 11728 11729 e.toggleClass("pf-active"), i.toggleClass("pf-sidemenu-visible"), e.hasClass("pf-active") && (e.siblings(".pf-active").trigger("click"), n.searchBox.focus()), t.update(), !1 === n.options.sideMenuOverlay && n.resizeRequestStart() 11730 11731 } 11732 11733 })).addClass("pf-sidemenu-trigger")); 11734 11735 var l = t.element; 11736 11737 if (this.zoomIn = o.zoomIn = Et.createBtn("zoomin", r.zoomin, a.zoomIn).on("click", (function () { 11738 11739 n.zoom(1), t.update() 11740 11741 })), this.zoomOut = o.zoomOut = Et.createBtn("zoomout", r.zoomout, a.zoomOut).on("click", (function () { 11742 11743 n.zoom(-1), t.update() 11744 11745 })), this.resetZoom = o.resetZoom = Et.createBtn("resetzoom", r.resetzoom, a.resetZoom).on("click", (function () { 11746 11747 n.resetZoom(-1), t.update() 11748 11749 })), n.viewer.isFlipBook) { 11750 11751 if (n.pageCount > 2) { 11752 11753 var u = n.viewer.pageMode === e.FLIPBOOK_PAGE_MODE.SINGLE; 11754 11755 this.pageMode = o.pageMode = Et.createBtn("pagemode", r[u ? "doublepage" : "singlepage"], u ? a.doublePageMode : a.singlePageMode).on("click", (function () { 11756 11757 var e = kt(this); 11758 11759 n.viewer.setPageMode({ 11760 11761 isSingle: !e.hasClass(r.doublepage) 11762 11763 }), n.viewer.pageModeChangedManually = !0 11764 11765 })) 11766 11767 } 11768 11769 } else this.pageFit = o.pageFit = Et.createBtn("pagefit", r.pagefit, a.pageFit).on("click", (function () { 11770 11771 var e = o.pageFit; 11772 11773 !0 === !e.hasClass(r.widthfit) ? (e.addClass(r.widthfit), e.html("<span>" + a.widthFit + "</span>"), e.attr("title", a.widthFit)) : (e.removeClass(r.widthfit), e.html("<span>" + a.pageFit + "</span>"), e.attr("title", a.pageFit)) 11774 11775 })); 11776 11777 if (t.shareBox = new Lt(n.container, n.options), this.share = o.share = Et.createBtn("share", r.share, a.share).on("click", (function () { 11778 11779 !0 === t.shareBox.isOpen ? t.shareBox.close() : (t.shareBox.update(n.getURLHash()), t.shareBox.show()) 11780 11781 })), this.more = o.more = Et.createBtn("more", r.more).on("click", (function (e) { 11782 11783 !0 !== t.moreContainerOpen && (kt(this).addClass("pf-active"), t.moreContainerOpen = !0, e.stopPropagation()) 11784 11785 })), this.startPage = o.startPage = Et.createBtn("start", r.start, a.gotoFirstPage).on("click", (function () { 11786 11787 n.start() 11788 11789 })), this.endPage = o.endPage = Et.createBtn("end", r.end, a.gotoLastPage).on("click", (function () { 11790 11791 n.end() 11792 11793 })), !0 === n.options.showPrintControl && !0 !== Et.isMobile && "string" == typeof n.options.source && (this.print = o.print = Et.createBtn("print", r.print, a.print).on("click", (function () { 11794 11795 e.printHandler = e.printHandler || new It, e.printHandler.printPDF(n.options.source) 11796 11797 }))), !0 === n.options.showDownloadControl && "string" == typeof n.options.source) { 11798 11799 var h = "pf-ui-btn pf-ui-download " + r.download; 11800 11801 this.download = o.download = kt('<a download target="_blank" class="' + h + '" rel="noopener"><span>' + a.downloadPDFFile + "</span></a>"), o.download.attr("href", Et.httpsCorrection(n.options.source)).attr("title", a.downloadPDFFile) 11802 11803 } 11804 11805 t.moreContainer = kt(i, { 11806 11807 class: "pf-more-container" 11808 11809 }), o.more.append(t.moreContainer), !0 === n.options.isLightBox && !0 !== n.fullscreenSupported || (this.fullScreen = o.fullScreen = Et.createBtn("fullscreen", r.fullscreen, a.toggleFullscreen).on("click", n.switchFullscreen.bind(n))), n.viewer.initCustomControls(); 11810 11811 var p = n.options.allControls.replace(/ /g, "").split(","), 11812 11813 c = "," + n.options.moreControls.replace(/ /g, "") + ",", 11814 11815 d = "," + n.options.hideControls.replace(/ /g, "") + ","; 11816 11817 n.options.leftControls.replace(/ /g, ""), n.options.rightControls.replace(/ /g, ""); 11818 11819 d += ","; 11820 11821 for (var f = 0; f < p.length; f++) { 11822 11823 var g = p[f]; 11824 11825 if (d.indexOf("," + g + ",") < 0) { 11826 11827 var v = o[g]; 11828 11829 null != v && "object" == St(v) && (c.indexOf("," + g + ",") > -1 && "more" !== g && "pageNumber" !== g ? t.moreContainer.append(v) : 1 == n.options.controlsFloating ? l.append(v) : this.centerElement.append(v)) 11830 11831 } 11832 11833 } 11834 11835 0 == t.moreContainer.children().length && this.more.addClass("pf-hidden"), n.container.append(l), n.container.append(o.openLeft), n.container.append(this.controls.openRight), window.addEventListener("click", t.events.closePanels = t.closePanels.bind(t), !1), window.addEventListener("keyup", t.events.keyup = t.keyUp.bind(t), !1), document.addEventListener("fullscreenchange", t.events.fullscreenChange = t.fullscreenChange.bind(t), !1), !0 === n.options.autoOpenThumbnail && t.controls.thumbnail.trigger("click"), n.hasOutline() && !0 === n.options.autoOpenOutline && t.controls.outline.trigger("click"), n.executeCallback("onCreateUI") 11836 11837 } 11838 11839 }, { 11840 11841 key: "closePanels", 11842 11843 value: function (e) { 11844 11845 var t; 11846 11847 !0 === this.moreContainerOpen && (null === (t = this.controls.more) || void 0 === t || t.removeClass("pf-active"), this.moreContainerOpen = !1) 11848 11849 } 11850 11851 }, { 11852 11853 key: "fullscreenChange", 11854 11855 value: function (e) { 11856 11857 void 0 === Et.getFullscreenElement() && !0 === this.app.isFullscreen && this.app.switchFullscreen() 11858 11859 } 11860 11861 }, { 11862 11863 key: "keyUp", 11864 11865 value: function (t) { 11866 11867 var i = this.app; 11868 11869 if ("INPUT" !== t.target.nodeName) { 11870 11871 var n = !0 === i.isFullscreen || !0 === i.options.isLightBox || i.options.arrowKeysAction === e.ARROW_KEYS_ACTIONS.NAV; 11872 11873 switch (t.keyCode) { 11874 11875 case 27: 11876 11877 e.activeLightBox && e.activeLightBox.app && !Et.isChromeExtension() && e.activeLightBox.closeButton.trigger("click"); 11878 11879 break; 11880 11881 case 37: 11882 11883 n && i.openLeft(); 11884 11885 break; 11886 11887 case 39: 11888 11889 n && i.openRight() 11890 11891 } 11892 11893 } 11894 11895 } 11896 11897 }, { 11898 11899 key: "createLogo", 11900 11901 value: function () { 11902 11903 var e = this.app, 11904 11905 t = null; 11906 11907 e.options.logo.indexOf("<") > -1 ? t = kt(e.options.logo).addClass("pf-logo pf-logo-html") : e.options.logo.trim().length > 2 && (t = kt('<a class="pf-logo pf-logo-img" target="_blank" href="' + e.options.logoUrl + '" rel="noopener"><img alt="" src="' + e.options.logo + '"/>')), this.element.append(t) 11908 11909 } 11910 11911 }, { 11912 11913 key: "dispose", 11914 11915 value: function () { 11916 11917 var e = this; 11918 11919 for (var t in this.controls) 11920 11921 if (this.controls.hasOwnProperty(t)) { 11922 11923 var i = this.controls[t]; 11924 11925 null !== i && "object" == St(i) && i.off().remove() 11926 11927 } e.element.remove(), e.shareBox = Et.disposeObject(e.shareBox), window.removeEventListener("click", e.events.closePanels, !1), window.removeEventListener("keyup", e.events.keyup, !1), document.removeEventListener("fullscreenchange", e.events.fullscreenChange, !1) 11928 11929 } 11930 11931 }, { 11932 11933 key: "update", 11934 11935 value: function () { 11936 11937 var e = this.app, 11938 11939 t = this.controls; 11940 11941 !0 !== this._pageLabelWidthSet && (this.pageLabel.width(""), e.provider.pageLabels ? this.pageLabel.html("88888888888888888".substring(0, 3 * e.pageCount.toString().length + 4)) : this.pageLabel.html("88888888888".substring(0, 2 * e.pageCount.toString().length + 3)), this.pageNumber.width(this.pageLabel.width()), this.pageLabel.width(this.pageLabel.width()), this.pageLabel.html(""), this._pageLabelWidthSet = !0); 11942 11943 var i = e.getCurrentLabel(); 11944 11945 i.toString() !== e.currentPageNumber.toString() ? t.pageLabel.html(i + "(" + e.currentPageNumber + "/"
11945+ e.pageCount + ")") : t.pageLabel.html(i + "/" + e.pageCount), t.pageInput.val(i), e.container.toggleClass("pf-sidemenu-open", e.container.find(".pf-sidemenu-visible").length > 0); 11946 11947 var n = e.provider.totalHits > 0 && e.container.find(".pf-sidemenu-visible.pf-search-container").length > 0; 11948 11949 if (e.container.toggleClass("pf-search-open", n), n) { 11950 11951 var o = e.searchContainer.find(".pf-search-result[data-pf-page=" + e.currentPageNumber + "]"); 11952 11953 if (e.searchContainer.find(".pf-search-result.pf-active").removeClass("pf-active"), o.length > 0 && !o.hasClass(".pf-active")) { 11954 11955 o.addClass("pf-active"); 11956 11957 var a = e.searchResults[0], 11958 11959 r = a.scrollTop; 11960 11961 r + a.getBoundingClientRect().height < (o = o[0]).offsetTop + o.scrollHeight ? Et.scrollIntoView(o, null, !1) : r > o.offsetTop && Et.scrollIntoView(o) 11962 11963 } 11964 11965 } 11966 11967 t.zoomIn.toggleClass("disabled", e.zoomValue === e.viewer.maxZoom), t.zoomOut.toggleClass("disabled", e.zoomValue === e.viewer.minZoom); 11968 11969 var s = e.isRTL, 11970 11971 l = e.currentPageNumber === e.startPage, 11972 11973 u = e.currentPageNumber === e.endPage, 11974 11975 h = l && !s || u && s, 11976 11977 p = u && !s || l && s; 11978 11979 t.openRight.toggleClass("pf-hidden", p), t.openLeft.toggleClass("pf-hidden", h), e.viewer.afterControlUpdate() 11980 11981 } 11982 11983 }]), t 11984 11985 }(), 11986 11987 Lt = function () { 11988 11989 function e(t, i) { 11990 11991 Ct(this, e); 11992 11993 var n = this; 11994 11995 n.isOpen = !1, n.shareUrl = "", n.init(t, i) 11996 11997 } 11998 11999 return xt(e, [{ 12000 12001 key: "init", 12002 12003 value: function (e, t) { 12004 12005 var i = this; 12006 12007 i.wrapper = kt('<div class="pf-share-wrapper" style="display: none;">').on("click", (function () { 12008 12009 i.close() 12010 12011 })), i.box = kt('<div class="pf-share-box">'), i.box.on("click", (function (e) { 12012 12013 e.preventDefault(), e.stopPropagation() 12014 12015 })), i.box.appendTo(i.wrapper).html('<span class="pf-share-title">' + t.text.share + "</span>"), i.urlInput = kt('<textarea name="pf-share-url" class="pf-share-url">').on("click", (function () { 12016 12017 kt(this).select() 12018 12019 })), i.box.append(i.urlInput); 12020 12021 var n = function () { 12022 12023 if (t.share.hasOwnProperty(o) && t.hideShareControls.indexOf(o) < 0) { 12024 12025 var e = t.share[o]; 12026 12027 null !== e && (i[o] = kt("<div>", { 12028 12029 class: "pf-share-button pf-share-" + o + " " + t.icons[o] 12030 12031 }).on("click", (function (n) { 12032 12033 n.preventDefault(), window.open(e.replace("{{url}}", encodeURIComponent(i.shareUrl)).replace("{{mailsubject}}", t.text.mailSubject), "Sharer", "width=500,height=400"), n.stopPropagation() 12034 12035 })), i.box.append(i[o])) 12036 12037 } 12038 12039 }; 12040 12041 for (var o in t.share) n(); 12042 12043 kt(e).append(i.wrapper) 12044 12045 } 12046 12047 }, { 12048 12049 key: "show", 12050 12051 value: function () { 12052 12053 this.wrapper.fadeIn(300), this.urlInput.val(this.shareUrl), this.urlInput.trigger("click"), this.isOpen = !0 12054 12055 } 12056 12057 }, { 12058 12059 key: "dispose", 12060 12061 value: function () { 12062 12063 var e = this; 12064 12065 for (var t in e) e.hasOwnProperty(t) && e[t] && e[t].off && e[t].off(); 12066
12067 e.wrapper.remove() 12068 12069 } 12070 12071 }, { 12072 12073 key: "close", 12074 12075 value: function () { 12076 12077 this.wrapper.fadeOut(300), this.isOpen = !1 12078 12079 } 12080 12081 }, { 12082 12083 key: "update", 12084 12085 value: function (e) { 12086 12087 this.shareUrl = e 12088 12089 } 12090 12091 }]), e 12092 12093 }(), 12094 12095 Nt = function () { 12096 12097 function t(i) { 12098 12099 Ct(this, t), this.duration = 300; 12100 12101 var n = this; 12102 12103 return n.lightboxWrapper = kt("<div>").addClass("pf-lightbox-wrapper"), n.backGround = kt("<div>").addClass("pf-lightbox-bg").appendTo(n.lightboxWrapper), n.element = kt("<div>").addClass("pf-app").appendTo(n.lightboxWrapper), n.controls = kt("<div>").addClass("pf-lightbox-controls").appendTo(n.lightboxWrapper), n.closeButton = kt("<div>").addClass("pf-lightbox-close pf-ui-btn " + e.defaults.icons.close).on("click", (function () { 12104 12105 n.close(i) 12106 12107 })).appendTo(n.controls), n.lightboxWrapper.append(n.element), n 12108 12109 } 12110 12111 return xt(t, [{ 12112 12113 key: "show", 12114 12115 value: function (e) { 12116 12117 return 0 === this.lightboxWrapper.parent().length && kt("body").append(this.lightboxWrapper), kt("html,body").addClass("pf-lightbox-open"), this.lightboxWrapper.fadeIn(this.duration), "function" == typeof e && e(), this 12118 12119 } 12120 12121 }, { 12122 12123 key: "close", 12124 12125 value: function (t) { 12126 12127 return this.lightboxWrapper.fadeOut(this.duration), Array.prototype.forEach.call(e.utils.getSharePrefixes(), (function (e) { 12128 12129 0 === window.location.hash.indexOf("#" + e) && history.replaceState(void 0, void 0, "#_") 12130 12131 })), "function" == typeof t && setTimeout(t, this.duration), kt("html,body").removeClass("pf-lightbox-open"), this.element.attr("class", "pf-app").attr("style", ""), this.lightboxWrapper.attr("class", "pf-lightbox-wrapper").attr("style", ""), this.backGround.attr("style", ""), this 12132 12133 } 12134 12135 }]), t 12136 12137 }(), 12138 12139 It = function () { 12140 12141 function e() { 12142 12143 Ct(this, e); 12144 12145 var t = this; 12146 12147 return t.frame = kt('<iframe id="pf-print-frame" style="display:none">').appendTo(kt("body")), t.frame.on("load", (function () { 12148 12149 try { 12150 12151 t.frame[0].contentWindow.print() 12152 12153 } catch (e) { 12154 12155 console.log(e) 12156 12157 } 12158 12159 })), t 12160 12161 } 12162 12163 return xt(e, [{ 12164 12165 key: "printPDF", 12166 12167 value: function (e) { 12168 12169 this.frame[0].src = e 12170 12171 } 12172 12173 }]), e 12174 12175 }(), 12176 12177 _t = function () { 12178 12179 function e(t, i) { 12180 12181 Ct(this, e), this.options = t, this.app = i, this.parentElement = t.parentElement, this.element = kt("<div>", { 12182 12183 class: "pf-sidemenu-wrapper" 12184 12185 }), this.parentElement.append(this.element), this.buttons = kt("<div>", { 12186 12187 class: "pf-sidemenu-buttons pf-ui-wrapper" 12188 12189 }).appendTo(this.element), this.close = Et.createBtn("close", i.options.icons.close, i.options.text.close), this.buttons.append(this.close) 12190 12191 } 12192 12193 return xt(e, [{ 12194 12195 key: "dispose", 12196 12197 value: function () { 12198 12199 this.element.remove() 12200 12201 } 12202 12203 }]), e 12204 12205 }(), 12206 12207 At = function () { 12208 12209 function e(t) { 12210 12211 Ct(this, e), this.outline = null, this.lastToggleIsShow = !0, this.container = t.container, this.linkService = t.linkService, this.outlineItemClass = t.outlineItemClass || "outlineItem", this.outlineToggleClass = t.outlineToggleClass || "outlineItemToggler", this.outlineToggleHiddenClass = t.outlineToggleHiddenClass || "outlineItemsHidden" 12212 12213 } 12214 12215 return xt(e, [{ 12216 12217 key: "dispose", 12218 12219 value: function () { 12220 12221 this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.linkService = null 12222 12223 } 12224 12225 }, { 12226 12227 key: "reset", 12228 12229 value: function () { 12230 12231 this.outline = null, this.lastToggleIsShow = !0; 12232 12233 for (var e = this.container; e.firstChild;) e.removeChild(e.firstChild) 12234 12235 } 12236 12237 }, { 12238 12239 key: "_dispatchEvent", 12240 12241 value: function (e) { 12242 12243 var t = document.createEvent("CustomEvent"); 12244 12245 t.initCustomEvent("outlineloaded", !0, !0, { 12246 12247 outlineCount: e 12248 12249 }
12249), this.container.dispatchEvent(t) 12250 12251 } 12252 12253 }, { 12254 12255 key: "_bindLink", 12256 12257 value: function (e, t) { 12258 12259 var i = this.linkService; 12260 12261 if (!0 === t.custom) e.href = i.getCustomDestinationHash(t.dest), e.onclick = function () { 12262 12263 return i.customNavigateTo(t.dest), !1 12264 12265 }; 12266 12267 else { 12268 12269 if (t.url) return void pdfjsLib.addLinkAttributes(e, { 12270 12271 url: t.url 12272 12273 }); 12274 12275 e.href = i.getDestinationHash(t.dest), e.onclick = function () { 12276 12277 return i.navigateTo(t.dest), !1 12278 12279 } 12280 12281 } 12282 12283 } 12284 12285 }, { 12286 12287 key: "_addToggleButton", 12288 12289 value: function (e) { 12290 12291 var t = this, 12292 12293 i = document.createElement("div"); 12294 12295 i.className = this.outlineToggleClass + " " + this.outlineToggleHiddenClass, i.onclick = function (n) { 12296 12297 if (n.stopPropagation(), i.classList.toggle(this.outlineToggleHiddenClass), n.shiftKey) { 12298 12299 var o = !i.classList.contains(this.outlineToggleHiddenClass); 12300 12301 t._toggleOutlineItem(e, o) 12302 12303 } 12304 12305 }.bind(this), e.insertBefore(i, e.firstChild) 12306 12307 } 12308 12309 }, { 12310 12311 key: "_toggleOutlineItem", 12312 12313 value: function (e, t) { 12314 12315 this.lastToggleIsShow = t; 12316 12317 for (var i = e.querySelectorAll("." + this.outlineToggleClass), n = 0, o = i.length; n < o; ++n) i[n].classList[t ? "remove" : "add"](this.outlineToggleHiddenClass) 12318 12319 } 12320 12321 }, { 12322 12323 key: "render", 12324 12325 value: function (e) { 12326 12327 var t = e && e.outline || null, 12328 12329 i = 0; 12330 12331 if (this.outline && this.reset(), this.outline = t, t) { 12332 12333 for (var n = document.createDocumentFragment(), o = [{ 12334 12335 parent: n, 12336 12337 items: this.outline, 12338 12339 custom: !1 12340 12341 }], a = !1; o.length > 0;) 12342 12343 for (var r = o.shift(), s = r.custom, l = 0, u = r.items.length; l < u; l++) { 12344 12345 var h = r.items[l], 12346 12347 p = document.createElement("div"); 12348 12349 p.className = this.outlineItemClass; 12350 12351 var c = document.createElement("a"); 12352 12353 if (null == h.custom && null != s && (h.custom = s), this._bindLink(c, h), c.textContent = h.title.replace(/\x00/g, ""), p.appendChild(c), h.items && h.items.length > 0) { 12354 12355 a = !0, this._addToggleButton(p); 12356 12357 var d = document.createElement("div"); 12358 12359 d.className = this.outlineItemClass + "s", p.appendChild(d), o.push({ 12360 12361 parent: d, 12362 12363 custom: h.custom, 12364 12365 items: h.items 12366 12367 }) 12368 12369 } 12370 12371 r.parent.appendChild(p), i++ 12372 12373 } 12374 12375 a && (null != this.container.classList ? this.container.classList.add(this.outlineItemClass + "s") : null != this.container.className && (this.container.className += " picWindow")), this.container.appendChild(n), this._dispatchEvent(i) 12376 12377 } 12378 12379 } 12380 12381 }]), e 12382 12383 }(), 12384 12385 Mt = function () { 12386 12387 function t(e) { 12388 12389 Ct(this, t); 12390 12391 var i = this.itemHeight = e.itemHeight, 12392 12393 n = this.itemWidth = e.itemWidth, 12394 12395 o = this.app = e.app; 12396 12397 this.items = e.items, this.generatorFn = e.generatorFn, this.totalRows = e.totalRows || e.items && e.items.length, this.addFn = e.addFn, this.scrollFn = e.scrollFn, this.container = document.createElement("div"); 12398 12399 for (var a = this, r = 0; r < this.totalRows; r++) { 12400 12401 var s = document.createElement("div"), 12402 12403 l = r + 1; 12404 12405 s.id = "pf-thumb" + l; 12406 12407 var u = document.createElement("div"), 12408 12409 h = document.createElement("div"), 12410 12411 p = document.createElement("div"); 12412 12413 p.className = "pf-wrapper", h.className = "pf-thumb-number", s.className = "pf-thumb", u.className = "pf-bg-image", p.style.height = i + "px", p.style.width = n + "px", h.innerText = o.provider.getLabelforPage(l), s.appendChild(p), p.appendChild(h), p.appendChild(u), this.container.appendChild(s) 12414 12415 } 12416 12417 12418 12419 function c() { 12420 12421 o.thumbRequestCount = 0, o.thumbRequestStatus = Ot.COUNT 12422 12423 } 12424 12425 a.dispose = function () { 12426 12427 a.container && a.container.parentNode && a.container.parentNode.removeChild(a.container), a.container.removeEventListener("scroll", c) 12428 12429 }, a.container.addEventListener("scroll", c) 12430 12431 } 12432 12433 return xt(t, [{ 12434 12435 key: "processThumbRequest", 12436 12437 value: function () { 12438 12439 Et.log("Thumb Request Initiated"); 12440 12441 var t = this.app; 12442 12443 if ((t.thumbRequestStatus = Ot.OFF, t.activeThumb !== t.currentPageNumber) && (null != t.thumbContainer && t.thumbContainer.hasClass("pf-sidemenu-visible"))) { 12444 12445 var i = t.thumblist.container, 12446 12447 n = i.scrollTop, 12448 12449 o = i.getBoundingClientRect().height, 12450 12451 a = t.thumbContainer.find("#pf-thumb" + t.currentPageNumber); 12452 12453 a.length > 0 ? (t.thumbContainer.find(".pf-selected").removeClass("pf-selected"), a.addClass("pf-selected"), n + o < (a = a[0]).offsetTop + a.scrollHeight ? Et.scrollIntoView(a, null, !1) : n > a.offsetTop && Et.scrollIntoView(a), t.activeThumb = t.currentPageNumber) : (kt(i).scrollTop(124 * t.currentPageNumber), t.thumbRequestStatus = Ot.ON) 12454 12455 } 12456 12457 if (0 === t.thumblist.container.getElementsByClassName("pf-thumb-requested").length) { 12458 12459 var r = Et.getVisibleElements({ 12460 12461 container: t.thumblist.container, 12462 12463 elements: t.thumblist.container.children 12464 12465 }); 12466 12467 kt.inArray(r) && r.unshift(t.activeThumb); 12468 12469 for (var s = 0; s < r.length; s++) { 12470 12471 var l = t.thumblist.container.children[r[s] - 1]; 12472 12473 if (void 0 !== l && !1 === l.classList.contains("pf-thumb-loaded") && !1 === l.classList.contains("pf-thumb-requested")) return l.classList.add("pf-thumb-requested"), Et.log("Thumb Requested for " + r[s]), t.provider.processPage({ 12474 12475 pageNumber: r[s], 12476 12477 textureTarget: e.TEXTURE_TARGET.THUMB 12478 12479 }), !1 12480 12481 } 12482 12483 } 12484 12485 } 12486 12487 }, { 12488 12489 key: "setPage", 12490 12491 value: function (t) { 12492 12493 var i = this.app, 12494 12495 n = t.pageNumber, 12496 12497 o = t.texture; 12498 12499 if (t.textureTarget === e.TEXTURE_TARGET.THUMB) { 12500 12501 var a = i.container.find("#pf-thumb" + n); 12502 12503 a.find(".pf-wrapper").css({ 12504 12505 height: t.height, 12506 12507 width: t.width 12508 12509 }), a.find(".pf-bg-image").css({ 12510 12511 backgroundImage: Et.bgImage(o) 12512 12513 }), a.addClass("pf-thumb-loaded").removeClass("pf-thumb-requested") 12514 12515 } 12516
12517 Et.log("Thumbnail set for " + t.pageNumber), i.thumbRequestStatus = Ot.ON 12518 12519 } 12520 12521 }]), t 12522 12523 }(); 12524 12525 12526 12527 function Dt() { 12528 12529 if (void 0 === e.openLocalFileInput) { 12530 12531 var t = e.openLocalFileInput = kt('<input type="file" accept=".pdf" style="display:none">').appendTo(kt("body")).data("pf-option", e.openFileOptions); 12532 12533 t.change((function () { 12534 12535 var i, n = t[0].files; 12536 12537 n.length && (i = n[0], t.val(""), e.openFile(i)) 12538 12539 })) 12540 12541 } 12542 12543 } 12544 12545 12546 12547 function Ft(e) { 12548 12549 return Ft = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 12550 12551 return typeof e 12552 12553 } : function (e) { 12554 12555 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 12556 12557 }, Ft(e) 12558 12559 } 12560 12561 12562 12563 function zt(e, t) { 12564 12565 for (var i = 0; i < t.length; i++) { 12566 12567 var n = t[i]; 12568 12569 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, a = void 0, a = function (e, t) { 12570 12571 if ("object" !== Ft(e) || null === e) return e; 12572 12573 var i = e[Symbol.toPrimitive]; 12574 12575 if (void 0 !== i) { 12576 12577 var n = i.call(e, t || "default"); 12578 12579 if ("object" !== Ft(n)) return n; 12580 12581 throw new TypeError("@@toPrimitive must return a primitive value.") 12582 12583 } 12584 12585 return ("string" === t ? String : Number)(e) 12586 12587 }(o, "string"), "symbol" === Ft(a) ? a : String(a)), n) 12588 12589 } 12590 12591 var o, a 12592 12593 } 12594 12595 e.openLightBox = function (t) { 12596 12597 e.activeLightBox || (e.activeLightBox = new Nt((function () { 12598 12599 e.activeLightBox.app && (e.activeLightBox.app.closeRequested = !0, e.activeLightBox.app.analytics({ 12600 12601 eventAction: e.activeLightBox.app.options.analyticsViewerClose, 12602 12603 options: e.activeLightBox.app.options 12604 12605 })), e.activeLightBox.app = Et.disposeObject(e.activeLightBox.app) 12606 12607 }))), e.activeLightBox.duration = 300, void 0 !== e.activeLightBox.app && null !== e.activeLightBox.app && !0 !== e.activeLightBox.app.closeRequested && e.openLocalFileInput != t || (e.activeLightBox.app = Et.disposeObject(e.activeLightBox.app), null === e.activeLightBox.app && e.activeLightBox.show((function () { 12608 12609 e.activeLightBox.app = kt(e.activeLightBox.element).pdfflipinterface({ 12610 12611 transparent: !1, 12612 12613 isLightBox: !0, 12614 12615 hashNavigationEnabled: !0, 12616 12617 height: "100%", 12618 12619 dataElement: t 12620 12621 }), e.activeLightBox.lightboxWrapper.toggleClass("pf-lightbox-padded", !1 === e.activeLightBox.app.options.popupFullsize), e.activeLightBox.lightboxWrapper.toggleClass("pf-rtl", e.activeLightBox.app.options.readDirection === e.READ_DIRECTION.RTL), e.activeLightBox.backGround.css({ 12622 12623 backgroundColor: "transparent" === e.activeLightBox.app.options.backgroundColor ? e.defaults.popupBackGroundColor : e.activeLightBox.app.options.backgroundColor 12624 12625 }) 12626 12627 }))) 12628 12629 }, e.checkBrowserURLforDefaults = function () { 12630 12631 if (!Et.isIEUnsupported) { 12632 12633 var t = new URL(location.href).searchParams.get("viewer-type") || new URL(location.href).searchParams.get("viewertype"), 12634 12635 i = new URL(location.href).searchParams.get("is-3d") || new URL(location.href).searchParams.get("is3d"); 12636 12637 t && (e.defaults.viewerType = t), "true" !== i && "false" !== i || (e.defaults.is3D = "true" === i) 12638 12639 } 12640 12641 }, e.checkBrowserURLforPDF = function () { 12642 12643 var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; 12644 12645 if (!Et.isIEUnsupported) { 12646 12647 var i = new URL(location.href).searchParams.get("ppf-source"); 12648 12649 return i && (i = unescape(i), t && e.openURL(i)), i 12650 12651 } 12652 12653 }, e.fileDropHandler = function (t, i) { 12654 12655 var n = t[0]; 12656 12657 "application/pdf" === n.type && (i.preventDefault(), i.stopPropagation(), e.openFile(n)) 12658 12659 }, e.openFile = function (t) { 12660 12661 var i; 12662 12663 t ? (e.oldLocalFileObjectURL && window.URL.revokeObjectURL(e.oldLocalFileObjectURL), e.oldLocalFileObjectURL = window.URL.createObjectURL(t), null === (i = e.openFileSelected) || void 0 === i || i.call(e, { 12664 12665 url: e.oldLocalFileObjectURL, 12666 12667 file: t 12668 12669 }
12669), e.openURL(e.oldLocalFileObjectURL)) : e.openURL() 12670 12671 }, e.openURL = function (t) { 12672 12673 Dt(), t && (e.openFileOptions.source = t, e.openFileOptions.pdfParameters = null), e.openLightBox(e.openLocalFileInput) 12674 12675 }, e.openBase64 = function (t) { 12676 12677 e.openFileOptions.source = null, e.openFileOptions.pdfParameters = { 12678 12679 data: atob(t) 12680 12681 }, e.openURL() 12682 12683 }, e.openLocalFile = function () { 12684 12685 Dt(), e.openLocalFileInput.click() 12686 12687 }, e.initControls = function () { 12688 12689 var t = kt("body"); 12690 12691 if (!1 !== e.defaults.autoPDFLinktoViewer && t.on("click", 'a[href$=".pdf"]', (function (t) { 12692 12693 var i = kt(this); 12694 12695 void 0 !== i.attr("download") || "_blank" === i.attr("target") || i.hasClass("pf-ui-btn") || i.parents(".pf-app").length > 0 || (t.preventDefault(), i.data("pf-source", i.attr("href")), e.openLightBox(i)) 12696 12697 })), t.on("click", ".pf-open-local-file", (function (t) { 12698 12699 e.openLocalFile() 12700 12701 })), t.on("click", ".pf-sidemenu-buttons .pf-ui-close", (function () { 12702 12703 kt(this).closest(".pf-app").find(".pf-ui-btn.pf-active").trigger("click") 12704 12705 })), t.on("mouseout", ".pf-link-content section.squareAnnotation, .pf-link-content section.textAnnotation, .pf-link-content section.freeTextAnnotation", (function () { 12706 12707 var t = kt(this); 12708 12709 e.handlePopup(t, !1) 12710 12711 })), t.on("mouseover", ".pf-link-content section.squareAnnotation, .pf-link-content section.textAnnotation, .pf-link-content section.freeTextAnnotation", (function () { 12712 12713 var t = kt(this); 12714 12715 e.handlePopup(t, !0) 12716 12717 })), e.handlePopup = function (e) { 12718 12719 var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], 12720 12721 i = e.closest(".pf-container"), 12722 12723 n = i.find(".pf-comment-popup"); 12724 12725 if (n.toggleClass("pf-active", t), t) { 12726 12727 var o = e[0].getBoundingClientRect(), 12728 12729 a = i[0].getBoundingClientRect(), 12730 12731 r = e.find(".popupWrapper").first(); 12732 12733 n.html(r.html()); 12734 12735 var s = o.left - a.left; 12736 12737 s + 360 > a.width ? s = a.width - 360 - 10 : s < 10 && (s = 10); 12738 12739 var l = o.top - a.top + o.height + 5; 12740 12741 l + n.height() > a.height ? l = o.top - n.height() - o.height - 10 : l < 10 && (l = 10), n.css({ 12742 12743 left: s, 12744 12745 top: l 12746 12747 }) 12748 12749 } 12750 12751 }, null != e.fileDropElement) { 12752 12753 var i = kt(e.fileDropElement); 12754 12755 i.length > 0 && (i.on("dragover", (function (e) { 12756 12757 e.preventDefault(), e.stopPropagation(), kt(this).addClass("pf-dragging") 12758 12759 })), i.on("dragleave", (function (e) { 12760 12761 e.preventDefault(), e.stopPropagation(), kt(this).removeClass("pf-dragging") 12762 12763 })), i.on("drop", (function (t) { 12764 12765 var i = t.originalEvent.dataTransfer.files; 12766 12767 i.length && e.fileDropHandler(i, t) 12768 12769 }))) 12770 12771 } 12772 12773 }; 12774 12775 var Bt = e.jQuery, 12776 12777 Ht = e.REQUEST_STATUS, 12778 12779 Ut = e.utils, 12780 12781 jt = function () { 12782 12783 function t(i) { 12784 12785 var n, o; 12786 12787 ! function (e, t) { 12788 12789 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") 12790 12791 }(this, t), this.options = i, this.viewerType = this.options.viewerType, this.startPage = 1, this.endPage = 1, this.element = Bt(this.options.element), i.maxTextureSize = null !== (n = i.maxTextureSize) && void 0 !== n ? n : 2048, Ut.isMobile && (i.maxTextureSize = 4096 === i.maxTextureSize ? 3200 : i.maxTextureSize), this.dimensions = { 12792 12793 padding: {}, 12794 12795 offset: {}, 12796 12797 pageFit: {}, 12798 12799 stage: {}, 12800 12801 isAutoHeight: "auto" === i.height, 12802 12803 maxTextureSize: i.maxTextureSize 12804 12805 }, this.is3D = i.is3D, this.options.pixelRatio = Ut.limitAt(this.options.pixelRatio, 1, 2), this.events = {}, this.links = i.links, this.thumbSize = 128, this.pendingZoom = !0, this.currentPageNumber = this.options.openPage || this.startPage, this.hashNavigationEnabled = !0 === this.options.hashNavigationEnabled, this.pendingZoom = !0, this.zoomValue = 1, this.pageScaling = e.PAGE_SCALE.MANUA
12805L, this.isRTL = i.readDirection === e.READ_DIRECTION.RTL, this.jumpStep = 1, this.resizeRequestStatus = Ht.OFF, this.refreshRequestStatus = Ht.OFF, this.refreshRequestCount = 0, this.resizeRequestCount = 0, this.fullscreenSupported = Ut.hasFullscreenEnabled(), this.thumbRequestCount = 0, this.isExternalReady = null === (o = this.options.isExternalReady) || void 0 === o || o, this.init(), !0 === this.options.autoLightBoxFullscreen && !0 === this.options.isLightBox && this.switchFullscreen(), this.executeCallback("onCreate"), this.target = this 12806 12807 } 12808 12809 var i, n, o; 12810 12811 return i = t, n = [{ 12812 12813 key: "init", 12814 12815 value: function () { 12816 12817 var t = this.options, 12818 12819 i = this; 12820 12821 return i.initDOM(), i.initResourcesLocation(), i.initInfo(), null != t.source && 0 !== t.source.length || null != t.pdfParameters ? Ut.isIEUnsupported ? (i.updateInfo("Your browser (Internet Explorer) is out of date! <br><a href='https://browsehappy.com/'>Upgrade to a new browser.</a>", "pf-old-browser"), void i.container.removeClass("pf-loading").addClass("pf-error")) : (i.commentPopup = Bt('<div class="pf-comment-popup">').appendTo(i.container), i.viewer = new i.viewerType(t, this), i.sideMenu = new _t({ 12822 12823 parentElement: this.container 12824 12825 }, i), i.provider = new e.providers[t.providerType](t, i), i.state = "loading", void i.checkRequestQueue()) : (i.updateInfo("ERROR: Set a Valid Document Source.", e.INFO_TYPE.ERROR), void i.container.removeClass("pf-loading").addClass("pf-error")) 12826 12827 } 12828 12829 }, { 12830 12831 key: "initDOM", 12832 12833 value: function () { 12834 12835 this.element.addClass("pf-app").removeClass("pf-container pf-loading"), this.container = Bt("<div>").appendTo(this.element), this.container.addClass("pf-container pf-loading pf-init pf-controls-" + this.options.controlsPosition + (!0 === this.options.controlsFloating ? " pf-float" : " pf-float-off") + ("transparent" === this.options.backgroundColor ? " pf-transparent" : "") + (!0 === this.isRTL ? " pf-rtl" : "") + (!0 === Ut.isIOS || !0 === Ut.isIPad ? " pf-ios" : "")), this._offsetParent = this.container[0].offsetParent, this.backGround = Bt("<div class='pf-bg'>").appendTo(this.container).css({ 12836 12837 backgroundColor: this.options.backgroundColor, 12838 12839 backgroundImage: this.options.backgroundImage ? "url('" + this.options.backgroundImage + "')" : "" 12840 12841 }), this.viewerContainer = Bt("<div>").appendTo(this.container), this.viewerContainer.addClass("pf-viewer-container") 12842 12843 } 12844 12845 }, { 12846 12847 key: "initResourcesLocation", 12848 12849 value: function () { 12850 12851 var t = this.options; 12852 12853 if (void 0 !== window[e.locationVar]) { 12854 12855 if ( 12856 t.pdfjsSrc = window[e.locationVar] + "wp-content/themes/Avada-Child-Theme/js/pdf.min.js", 12857 t.threejsSrc = window[e.locationVar] + "wp-content/themes/Avada-Child-Theme/js/three.min.js", 12858 t.pdfjsWorkerSrc = window[e.locationVar] + "wp-content/themes/Avada-Child-Theme/js/pdf.worker.min.js", 12859 t.soundFile = window[e.locationVar] + t.soundFile, t.imagesLocation = window[e.locationVar] + t.imagesLocation, t.imageResourcesPath = window[e.locationVar] + t.imageResourcesPath, t.cMapUrl = window[e.locationVar] + t.cMapUrl, void 0 !== t.pdfVersion) { 12860 12861 var i = ""; 12862 12863 "latest" == t.pdfVersion || "beta" == t.pdfVersion ? i = "latest" : "stable" == t.pdfVersion && (i = "stable"), ("latest" == t.pdfVersion || "default" == t.pdfVersion) && (Array.prototype.at, void 0 === Array.prototype.at && (i = "stable", console.log("Proper Support for Latest version PDF.js 3.7 not available. Switching to PDF.js 2.5!"))), "default"
12863!== i && "" !== i && (t.pdfjsSrc = window[e.locationVar] + "wp-content/themes/Avada-Child-Theme/js/pdfjs/" + i + "/pdf.min.js", t.pdfjsWorkerSrc = window[e.locationVar] + "wp-content/themes/Avada-Child-Theme/js/pdfjs/" + i + "/pdf.worker.min.js") 12864 12865 } 12866 12867 } else console.warn("pdfflipinterface locationVar not found!"); 12868 12869 this.executeCallback("onInitResourcesLocation") 12870 12871 } 12872 12873 }, { 12874 12875 key: "initEvents", 12876 12877 value: function () { 12878 12879 var e = this, 12880 12881 t = this.container[0]; 12882 12883 window.addEventListener("resize", e.events.resize = e.resetResizeRequest.bind(e), !1), t.addEventListener("mousemove", e.events.mousemove = e.mouseMove.bind(e), !1), t.addEventListener("mousedown", e.events.mousedown = e.mouseDown.bind(e), !1), window.addEventListener("mouseup", e.events.mouseup = e.mouseUp.bind(e), !1), t.addEventListener("touchmove", e.events.touchmove = e.mouseMove.bind(e), !1), t.addEventListener("touchstart", e.events.touchstart = e.mouseDown.bind(e), !1), window.addEventListener("touchend", e.events.touchend = e.mouseUp.bind(e), !1) 12884 12885 } 12886 12887 }, { 12888 12889 key: "mouseMove", 12890 12891 value: function (e) { 12892 12893 e.touches && e.touches.length > 1 && e.preventDefault(), !0 === this.viewer.acceptAppMouseEvents && this.viewer.mouseMove(e) 12894 12895 } 12896 12897 }, { 12898 12899 key: "mouseDown", 12900 12901 value: function (e) { 12902 12903 this.userHasInteracted = !0, !0 === this.viewer.acceptAppMouseEvents && 0 === Bt(e.srcElement).closest(".pf-sidemenu").length && this.viewer.mouseDown(e) 12904 12905 } 12906 12907 }, { 12908 12909 key: "mouseUp", 12910 12911 value: function (e) { 12912 12913 this.viewer && !0 === this.viewer.acceptAppMouseEvents && this.viewer.mouseUp(e) 12914 12915 } 12916 12917 }, { 12918 12919 key: "softDispose", 12920 12921 value: function () { 12922 12923 var e = this; 12924 12925 e.softDisposed = !0, e.provider.dispose(), e.viewer.dispose() 12926 12927 } 12928 12929 }, { 12930 12931 key: "softInit", 12932 12933 value: function () { 12934 12935 var t = this; 12936 12937 t.viewer = new t.viewerType(t.options, this), t.provider = new e.providers[t.options.providerType](t.options, t), t.softDisposed = !1 12938 12939 } 12940 12941 }, { 12942 12943 key: "dispose", 12944 12945 value: function () { 12946 12947 var e, t, i, n, o, a = this, 12948 12949 r = this.container[0]; 12950 12951 clearInterval(this.autoPlayTimer), this.autoPlayTimer = null, this.autoPlayFunction = null, a.provider = Ut.disposeObject(a.provider), a.contentProvider = null, a.target = null, a.viewer = Ut.disposeObject(a.viewer), a.sideMenu = Ut.disposeObject(a.sideMenu), a.ui = Ut.disposeObject(a.ui), a.thumblist = Ut.disposeObject(a.thumblist), a.outlineViewer = Ut.disposeObject(a.outlineViewer), this.events && (window.removeEventListener("resize", a.events.resize, !1), r.removeEventListener("mousemove", a.events.mousemove, !1), r.removeEventListener("mousedown", a.events.mousedown, !1), window.removeEventListener("mouseup", a.events.mouseup, !1), r.removeEventListener("touchmove", a.events.touchmove, !1), r.removeEventListener("touchstart", a.events.touchstart, !1), window.removeEventListener("touchend", a.events.touchend, !1)), a.events = null, a.options = null, a.element.removeClass("pf-app"), a.viewerType = null, a.checkRequestQueue = null, null === (e = a.info) || void 0 === e || e.remove(), a.info = null, null === (t = a.loadingIcon) || void 0 === t || t.remove(), a.loadingIcon = null, null === (i = a.backGround) || void 0 === i || i.remove(), a.backGround = null, null === (n = a.outlineContainer) || void 0 === n || n.remove(), a.outlineContainer = null, null === (o = a.commentPopup) || void 0 === o || o.remove(), a.commentPopup = null, a.viewerContainer.off(), a.viewerContainer.remove(), a.viewerContainer = null, a.container.off(), a.container.remove(), a.container = null, a.element.off(), a.element.data("pf-app", null), a.element = null, a._offsetParent = null, a.dimensions = null 12952 12953 } 12954 12955 }, { 12956 12957 key: "resetResizeRequest", 12958 12959 value: function () { 12960 12961 this.resizeRequestStatus = Ht.COUNT, this.resizeRequestCount = 0, this.container.addClass("pf-pendingresize"), this.pendingResize = !0 12962 12963 } 12964 12965 }, { 12966 12967 key: "initInfo", 12968 12969 value: function () { 12970 12971 this.info = Bt("<div>", { 12972 12973 class: "pf-loading-info" 12974 12975 }), this.container.append(this.info), this.info.html(this.options.text.loading + "..."), this.loadingIcon = Bt("<div>", { 12976 12977 class: "pf-loading-icon" 12978 12979 }).appendTo(this.container) 12980 12981 } 12982 12983 }, { 12984 12985 key: "updateInfo", 12986 12987 value: function (e, t) { 12988 12989 Ut.log(e), void 0 !== this.info && this.info.html(e) 12990 12991 } 12992 12993 }, { 12994 12995 key: "_documentLoaded", 12996 12997 value: function () { 12998 12999 Ut.log("Document Loaded"), this.isDocumentReady = !0, this.contentProvider = this.provider, this.executeCallback("onDocumentLoad"), this.endPage = this.pageCount = this.provider.page
12999Count, this.currentPageNumber = this.getValidPage(this.currentPageNumber) 13000 13001 } 13002 13003 }, { 13004 13005 key: "_viewerPrepared", 13006 13007 value: function () { 13008 13009 Ut.log("Viewer Prepared"), this.isViewerPrepared = !0, this.executeCallback("onViewerLoad") 13010 13011 } 13012 13013 }, { 13014 13015 key: "requestFinalize", 13016 13017 value: function () { 13018 13019 !0 === this.isDocumentReady && !0 === this.isViewerPrepared && !0 === this.isExternalReady && !0 !== this.finalizeRequested && (this.finalizeRequested = !0, this.finalize()) 13020 13021 } 13022 13023 }, { 13024 13025 key: "finalizeComponents", 13026 13027 value: function () { 13028 13029 this.ui = new Rt({}, this), this.ui.init(), this.calculateLayout(), this.viewer.init() 13030 13031 } 13032 13033 }, { 13034 13035 key: "finalize", 13036 13037 value: function () { 13038 13039 this.resize(), this.ui.update(), this.initEvents(), 1 == this.options.isLightBox && this.analytics({ 13040 13041 eventAction: this.options.analyticsViewerOpen, 13042 13043 options: this.options 13044 13045 }), this.container.removeClass("pf-loading pf-init"), this.viewer.onReady(), this.analytics({ 13046 13047 eventAction: this.options.analyticsViewerReady, 13048 13049 options: this.options 13050 13051 }), this.executeCallback("onReady"), !0 === this.options.dataElement.hasClass("pf-hash-focused") && (Ut.focusHash(this.options.dataElement), this.options.dataElement.removeClass("pf-hash-focused")), Ut.log("App Finalized") 13052 13053 } 13054 13055 }, { 13056 13057 key: "initOutline", 13058 13059 value: function () { 13060 13061 var e = this, 13062 13063 t = Bt("<div>").addClass("pf-outline-container pf-sidemenu"); 13064 13065 t.append('<div class="pf-sidemenu-title">Table of Contents</div>'); 13066 13067 var i = Bt("<div>").addClass("pf-wrapper"); 13068 13069 t.append(i), e.sideMenu.element.append(t), e.outlineContainer = t, e.outlineViewer = new At({ 13070 13071 container: i[0], 13072 13073 linkService: e.provider.linkService, 13074 13075 outlineItemClass: "pf-outline-item", 13076 13077 outlineToggleClass: "pf-outline-toggle", 13078 13079 outlineToggleHiddenClass: "pf-outlines-hidden" 13080 13081 }), e.outlineViewer.render({ 13082 13083 outline: e.provider.outline 13084 13085 }) 13086 13087 } 13088 13089 }, { 13090 13091 key: "initThumbs", 13092 13093 value: function () { 13094 13095 var e = this; 13096 13097 e.thumblist = new Mt({ 13098 13099 app: e, 13100 13101 addFn: function (e) { }, 13102 13103 scrollFn: function () { 13104 13105 e.thumbRequestStatus = Ht.ON 13106 13107 }, 13108 13109 itemHeight: e.thumbSize, 13110 13111 itemWidth: Ut.limitAt(Math.floor(e.dimensions.defaultPage.ratio * e.thumbSize), 32, 180), 13112 13113 totalRows: e.pageCount 13114 13115 }), e.thumblist.lastScrolled = Date.now(), e.thumbRequestStatus = Ht.ON; 13116 13117 var t = Bt("<div>").addClass("pf-thumb-container pf-sidemenu"); 13118 13119 t.append('<div class="pf-sidemenu-title">Thumbnails</div>'), t.append(Bt(e.thumblist.container).addClass("pf-wrapper")), e.thumbContainer = t, e.sideMenu.element.append(t), e.container.on("click", ".pf-thumb-container .pf-thumb", (function (t) { 13120 13121 t.stopPropagation(); 13122 13123 var i = Bt(this).attr("id").replace("pf-thumb", ""); 13124 13125 e.gotoPage(parseInt(i, 10)) 13126 13127 })) 13128 13129 } 13130 13131 }, { 13132 13133 key: "initSearch", 13134 13135 value: function () { 13136 13137 var e = this, 13138 13139 t = Bt("<div>").addClass("pf-search-container pf-sidemenu"); 13140 13141 t.append('<div class="pf-sidemenu-title">Search</div>'), e.searchForm = Bt('<div class="pf-search-form">').appendTo(t), e.searchBox = Bt('<input type="text" class="pf-search-text" placeholder="Search">').on("keyup", (function (t) { 13142 13143 13 === t.keyCode && e.search() 13144 13145 })).appendTo(e.searchForm), e.searchButton = Bt('<div class="pf-ui-btn pf-search-btn pf-icon-search">').on("click", (function (t) { 13146 13147 e.search() 13148 13149 })).appendTo(e.searchForm), e.clearButton = Bt('<a class="pf-search-clear">Clear</a>').on("click", (function (t) { 13150 13151 e.clearSearch() 13152 13153 })).appendTo(e.searchForm), e.searchInfo = Bt('<div class="pf-search-info">').appendTo(t), e.searchResults = Bt('<div class="pf-wrapper pf-search-results">').appendTo(t), e.searchContainer = t, e.sideMenu.element.append(t), e.container.on("click", ".pf-search-result", (function (t) { 13154 13155 t.stopPropagation(); 13156 13157 var i = Bt(this).data("pf-page"); 13158 13159 e.gotoPage(parseInt(i, 10)) 13160 13161 })) 13162 13163 } 13164 13165 }, { 13166 13167 key: "search", 13168 13169 value: function (e) { 13170 13171 null == e && (e = this.searchBox.val()), this.provider.search(e.trim()) 13172 13173 } 13174 13175 }, { 13176 13177 key: "clearSearch", 13178 13179 value: function () { 13180 13181 this.searchBox.val(""), this.searchInfo.html(""), this.provider.clearSearch() 13182 13183 } 13184 13185 }, { 13186 13187 key: "updateSearchInfo", 13188 13189 value: function (e) { 13190 13191 Ut.log(e), void 0 !== this.searchInfo && this.searchInfo.html(e) 13192 13193 } 13194 13195 }, { 13196 13197 key: "checkRequestQueue", 13198 13199 value: function () { 13200 13201 var e = this; 13202 13203 if (e.checkRequestQueue && requestAnimationFrame((function () { 13204 13205 e && e.checkRequestQueue && e.checkRequestQueue() 13206 13207 })), !e.softDisposed) { 13208 13209 if ("ready" != e.state) return "loading" === e.state && !0 === this.isDocumentReady && !0 === this.isViewerPrepared && !0 === this.isExternalReady && (e.state = "finalizing", this.finalizeComponents()), void ("finalizing" === e.state && (e.state = "ready", e.finalize())); 13210 13211 e.container && e.container[0] && e._offsetParent !== e.container[0].offsetParent && (e._offsetParent = e.container[0].offsetParent, null !== e._offsetParent && (e.resize(), e.resizeRequestStatus = Ht.OFF), Ut.log("Visibility Resize Detected")), (null !== e._offsetParent || e.isFullscreen) && (TWEEN.getAll().length > 0 && (TWEEN.update(), e.renderRequestStatus = Ht.ON), e.resizeRequestStatus === Ht.ON ? (e.resizeRequestStatus = Ht.OFF, e.resize()) : e.resizeRequestStatus === Ht.COUNT && (e.resizeRequestCount++, e.resizeRequestCount > 10 && (e.resizeRequestCount = 0, e.resizeRequestStatus = Ht.ON)), e.refreshRequestStatus === Ht.ON ? (e.refreshRequestStatus = Ht.OFF, e.pendingResize = !1, e.viewer.refresh(), this.container.removeClass("pf-pendingresize")) : e.refreshRequestStatus === Ht.COUNT && (e.refreshRequestCount++, e.refreshRequestCount > 3 && (e.refreshRequestCount = 0, e.refreshRequestStatus = Ht.ON)), e.textureRequestStatus === Ht.ON && e.processTextureRequest(), e.thumbRequestStatus === Ht.ON ? e.processThumbRequest
13211() : e.thumbRequestStatus === Ht.COUNT && (e.thumbRequestCount++, e.thumbRequestCount > 3 && (e.thumbRequestCount = 0, e.thumbRequestStatus = Ht.ON)), e.renderRequestStatus === Ht.ON && (e.viewer.render(), e.renderRequestStatus = Ht.OFF), e.provider.checkRequestQueue(), e.viewer.checkRequestQueue()) 13212 13213 } 13214 13215 } 13216 13217 }, { 13218 13219 key: "processTextureRequest", 13220 13221 value: function () { 13222 13223 var t, i, n = this, 13224 13225 o = this.viewer, 13226 13227 a = this.provider, 13228 13229 r = o.getVisiblePages().main, 13230 13231 s = 0, 13232 13233 l = n.zoomValue > 1; 13234 13235 if (o.isAnimating()) n.textureRequestStatus = Ht.ON; 13236 13237 else { 13238 13239 Ut.log("Texture Request Working"); 13240 13241 for (var u = 0; u < r.length; u++) { 13242 13243 s = 0; 13244 13245 var h = r[u]; 13246 13247 if (h > 0 && h <= n.pageCount && ((t = l ? o.zoomViewer.getPageByNumber(h) : o.getPageByNumber(h)) && (i = o.getTextureSize({ 13248 13249 pageNumber: h 13250 13251 }), t.changeTexture(h, Math.floor(i.height)) && (a.processPage({ 13252 13253 pageNumber: h, 13254 13255 textureTarget: l ? e.TEXTURE_TARGET.ZOOM : e.TEXTURE_TARGET.VIEWER 13256 13257 }), s++, n.viewer.getAnnotationElement(h, !0))), s > 0)) break 13258 13259 } 13260 13261 0 === s && (n.textureRequestStatus = Ht.OFF) 13262 13263 } 13264 13265 } 13266 13267 }, { 13268 13269 key: "applyTexture", 13270 13271 value: function (t, i) { 13272 13273 var n = this, 13274 13275 o = void 0 !== t.toDataURL; 13276 13277 if (i.textureTarget === e.TEXTURE_TARGET.THUMB) { 13278 13279 if (i.height = t.height, i.width = t.width, o) { 13280 13281 var a = t.toDataURL("image/png"); 13282 13283 n.provider.setCache(i.pageNumber, a, n.thumbSize), i.texture = a 13284 13285 } else i.texture = t.src; 13286 13287 n.thumblist.setPage(i) 13288 13289 } else i.texture = o ? t : t.src, !0 === n.viewer.setPage(i) && (n.provider.processAnnotations(i.pageNumber, n.viewer.getAnnotationElement(i.pageNumber, !0)), n.provider.processTextContent(i.pageNumber, n.viewer.getTextElement(i.pageNumber, !0))) 13290 13291 } 13292 13293 }, { 13294 13295 key: "processThumbRequest", 13296 13297 value: function () { 13298 13299 null !== this.thumblist && void 0 !== this.thumblist && this.thumblist.processThumbRequest() 13300 13301 } 13302 13303 }, { 13304 13305 key: "refreshRequestStart", 13306 13307 value: function () { 13308 13309 this.refreshRequestStatus = Ht.COUNT, this.refreshRequestCount = 0 13310 13311 } 13312 13313 }, { 13314 13315 key: "renderRequestStart", 13316 13317 value: function () { 13318 13319 this.renderRequestStatus = Ht.ON 13320 13321 } 13322 13323 }, { 13324 13325 key: "resizeRequestStart", 13326 13327 value: function () { 13328 13329 this.resizeRequestStatus = Ht.ON 13330 13331 } 13332 13333 }, { 13334 13335 key: "zoom", 13336 13337 value: function (e) { 13338 13339 var t = this; 13340 13341 t.pendingZoom = !0, t.zoomDelta = e, t.resize() 13342 13343 } 13344 13345 }, { 13346 13347 key: "resetZoom", 13348 13349 value: function () { 13350 13351 1 !== this.zoomValue && (this.zoomValue = 1.001, this.zoom(-1)) 13352 13353 } 13354 13355 }, { 13356 13357 key: "calculateLayout", 13358 13359 value: function () { 13360 13361 var t, i, n = this, 13362 13363 o = n.isSideMenuOpen = n.container.hasClass("pf-sidemenu-open"), 13364 13365 a = n.dimensions, 13366 13367 r = n.dimensions.padding, 13368 13369 s = Bt(window).height(); 13370 13371 a.offset = { 13372 13373 top: 0, 13374 13375 left: n.options.sideMenuOverlay || !o || n.isRTL ? 0 : 220, 13376 13377 right: !n.options.sideMenuOverlay && o && n.isRTL ? 220 : 0, 13378 13379 bottom: 0, 13380 13381 width: !n.options.sideMenuOverlay && o ? 220 : 0 13382 13383 }, n.viewerContainer.css({ 13384 13385 left: a.offset.left, 13386 13387 right: a.offset.right 13388 13389 }); 13390 13391 var l = a.controlsHeight = n.container.find(".pf-ui").height(); 13392 13393 if (r.top = n.options.paddingTop + (n.options.controlsPosition === e.CONTROLS_POSITION.TOP ? l : 0), r.left = n.options.paddingLeft, r.right = n.options.paddingRight, r.bottom = n.options.paddingBottom + (n.options.controlsPosition === e.CONTROLS_POSITION.BOTTOM ? l : 0), r.height = r.top + r.bottom, r.width = r.left + r.right, r.heightDiff = r.top - r.bottom, r.widthDiff = r.left - r.right, a.isFullSize = !0 === n.isFullscreen, a.isFixedHeight = a.isFullSize || !a.isAutoHeight, a.containerWidth = a.isFullSize ? Bt(window).width() : this.element.width(), n.container.toggleClass("pf-xs", a.containerWidth < 400).toggleClass("pf-xss", a.containerWidth < 320), a.maxHeight = s
13393- (a.containerWidth > 600 && null !== (t = Bt(null !== (i = n.options.headerElementSelector) && void 0 !== i ? i : "#wpadminbar").height()) && void 0 !== t ? t : 0), a.isFixedHeight) 13394 13395 if (a.isFullSize) a.maxHeight = s; 13396 13397 else { 13398 13399 n.element.height(n.options.height); 13400 13401 var u = n.element.height(); 13402 13403 a.maxHeight = Math.min(u, a.maxHeight) 13404 13405 } a.width, a.stage.innerWidth = this.viewer._getInnerWidth(); 13406 13407 var h = a.stage.innerHeight = this.viewer._getInnerHeight(), 13408 13409 p = this.viewer._getOuterHeight(h + a.padding.height); 13410 13411 a.containerHeight = a.isFullSize ? s : p, n.element.height(a.containerHeight); 13412 13413 var c = n.element.height(); 13414 13415 a.isFullSize || c == a.containerHeight || (a.containerHeight = c, a.stage.innerHeight = c - a.padding.height, a.stage.height = c), a.origin = { 13416 13417 x: (r.widthDiff + a.containerWidth - a.offset.left - a.offset.right) / 2, 13418 13419 y: (r.heightDiff + a.containerHeight) / 2 13420 13421 }, n.viewer.determinePageMode() 13422 13423 } 13424 13425 }, { 13426 13427 key: "resize", 13428 13429 value: function () { 13430 13431 var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; 13432 13433 Ut.log("Resize Request Initiated"); 13434 13435 var t = this; 13436 13437 this.calculateLayout(), t.viewer.handleZoom(), t.viewer.resize(), !1 !== e && (t.pendingZoom ? (this.viewer.refresh(), Ut.log("Pending Zoom updated")) : this.refreshRequestStart(), this.ui.update(), this.renderRequestStatus = Ht.ON, t.zoomChanged = !1, t.pendingZoom = !1, this.executeCallback("afterResize")) 13438 13439 } 13440 13441 }, { 13442 13443 key: "hasOutline", 13444 13445 value: function () { 13446 13447 if (this.provider.outline.length > 0) return !0 13448 13449 } 13450 13451 }, { 13452 13453 key: "switchFullscreen", 13454 13455 value: function () { 13456 13457 var e, t = this, 13458 13459 i = t.container[0]; 13460 13461 if (t.container.toggleClass("pf-fullscreen", !0 !== t.isFullscreen), null != t && null !== (e = t.ui) && void 0 !== e && null !== (e = e.controls) && void 0 !== e && e.fullscreen && t.ui.controls.fullScreen.toggleClass(t.options.icons["fullscreen-off"], !0 !== t.isFullscreen), !0 !== t.isFullscreen) { 13462 13463 var n = null; 13464 13465 i.requestFullscreen ? n = i.requestFullscreen() : i.msRequestFullscreen ? n = i.msRequestFullscreen() : i.mozRequestFullScreen ? n = i.mozRequestFullScreen() : i.webkitRequestFullscreen && (n = i.webkitRequestFullscreen()), n && n.then && n.then((function () { 13466 13467 t.refreshRequestStatus, Ht.ON, t.resize() 13468 13469 })), t.isFullscreen = !0 13470 13471 } else t.isFullscreen = !1, document.exitFullscreen ? document.fullscreenElement && document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen(), Ut.hasFullscreenEnabled() || t.container[0].scrollIntoView(); 13472 13473 Ut.hasFullscreenEnabled() || (t.resizeRequestStatus = Ht.ON) 13474 13475 } 13476 13477 }, { 13478 13479 key: "next", 13480 13481 value: function () { 13482 13483 this.jumpBy(this.jumpStep) 13484 13485 } 13486 13487 }, { 13488 13489 key: "prev", 13490 13491 value: function () { 13492 13493 this.jumpBy(-this.jumpStep) 13494 13495 } 13496 13497 }, { 13498 13499 key: "jumpBy", 13500 13501 value: function (e) { 13502 13503 var t = this.currentPageNumber + e; 13504 13505 t = Ut.limitAt(t, this.startPage, this.endPage), 1 != this.anyFirstPageChanged && (this.analytics({ 13506 13507 eventAction: this.options.analyticsFirstPageChange, 13508 13509 options: this.options 13510 13511 }), this.anyFirstPageChanged = !0), this.gotoPage(t), this.ui.update() 13512 13513 } 13514 13515 }, { 13516 13517 key: "openRight", 13518 13519 value: function () { 13520 13521 this.isRTL ? this.prev() : this.next() 13522 13523 } 13524 13525 }, { 13526 13527 key: "openLeft", 13528 13529 value: function () { 13530 13531 this.isRTL ? this.next() : this.prev() 13532 13533 } 13534 13535 }, { 13536 13537 key: "start", 13538 13539 value: function () { 13540 13541 this.gotoPage(this.startPage) 13542 13543 } 13544 13545 }, { 13546 13547 key: "end", 13548 13549 value: function () { 13550 13551 this.gotoPage(this.endPage) 13552 13553 } 13554 13555 }, { 13556 13557 key: "gotoPage", 13558 13559 value: function (e) { 13560 13561 var t = this; 13562 13563 e = t.getValidPage(parseInt(e, 10)), null !== t.viewer && !1 !== t.viewer.validatePageChange(e) && (this.executeCallback("beforePageChanged"), t.requestDestRefKey = void 0, t.container.removeClass("pf-fetch-pdf"), t.oldPageNumber = t.currentPageNumber, t.currentPageNumber = e, t.thumbRequestStatus = Ht.ON, t.viewer.gotoPageCallBack && t.viewer.gotoPageCallBack(), t.ui.update(), 1 == this.autoPlay && this.setAutoPlay(this.autoPlay), !0 === this.hashNavigationEnabled && this.getURLHash(), this.executeCallback("onPageChanged")) 13564 13565 } 13566 13567 }, { 13568 13569 key: "gotoPageLabel", 13570 13571 value: function (e) { 13572 13573 this.gotoPage(this.provider.getPageNumberForLabel(e.toString().trim())) 13574 13575 } 13576 13577 }, { 13578 13579 key: "getCurrentLabel", 13580 13581 value: function () { 13582 13583 return this.provider.getLabelforPage(this.currentPageNumber) 13584 13585 } 13586 13587 }, { 13588 13589 key: "autoPlayFunction", 13590 13591 value: function () { 13592 13593 this && this.autoPlay && (Ut.limitAt(this.currentPageNumber + this.jumpStep, this.startPage, this.endPage) !== this.currentPageNumber ? this.next() : this.setAutoPlay(!1)) 13594 13595 } 13596 13597 }, { 13598 13599 key: "setAutoPlay", 13600 13601 value: function (e) { 13602 13603 if (this.options.autoPlay) { 13604 13605 var t = (e = 1 == e) ? this.options.text.pause : this.options.text.play; 13606 13607 this.ui.controls.play.toggleClass(this.options.icons.pause, e), this.ui.controls.play.html("<span>" + t + "</span>"), this.ui.controls.play.attr("title", t), clearInterval(this.autoPlayTimer), e && (this.autoPlayTimer = setInterval(this.autoPlayFunction.bind(this), this.options.autoPlayDuration)), this.autoPlay = e 13608 13609 } 13610 13611 } 13612 13613 }, { 13614 13615 key: "isValidPage", 13616 13617 value: function (e) { 13618 13619 return this.provider._isValidPage(e) 13620 13621 } 13622 13623 }, { 13624 13625 key: "getValidPage", 13626 13627 value: function (e) { 13628 13629 var t = this; 13630 13631 return isNaN(e) ? e = t.currentPageNumber : e < 1 ? e = 1 : e > t.pageCount && (e = t.pageCount), e 13632 13633 } 13634 13635 }, { 13636 13637 key: "getURLHash", 13638 13639 value: function () { 13640 13641 if (null != this.options.id) { 13642 13643 var e = Ut.getSharePrefix(this.options.sharePrefix) + (null != this.options.slug ? this.options.slug : this.options.id) + "/"; 13644 13645 null != this.currentPageNumber && (e += this.currentPageNumber + "/"), history.replaceState(void 0, void 0, "#" + e) 13646 13647 } 13648 13649 return window.location.href 13650 13651 } 13652 13653 }, { 13654 13655 key: "executeCallback", 13656 13657 value: function (e) { } 13658 13659 }, { 13660 13661 key: "analytics", 13662 13663 value: function (e) { } 13664 13665 }], n && zt(i.prototype, n), o && zt(i, o), Object.defineProperty(i, "prototype", { 13666 13667 writable: !1 13668 13669 }), t 13670 13671 }(); 13672 13673 13674 13675 function Vt(e) { 13676 13677 return Vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { 13678 13679 return typeof e 13680 13681 } : function (e) { 13682 13683 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e 13684 13685 }, Vt(e) 13686 13687 } 13688 13689 13690 13691 function Wt(e, t) { 13692 13693 var i = Object.keys(e); 13694 13695 if (Object.getOwnPropertySymbols) { 13696 13697 var n = Object.getOwnPropertySymbols(e); 13698 13699 t && (n = n.filter((function (t) { 13700 13701 return Object.getOwnPropertyDescriptor(e, t).enumerable 13702 13703 }))), i.push.apply(i, n) 13704 13705 } 13706 13707 return i 13708 13709 } 13710 13711 13712 13713 function Gt(e) { 13714 13715 for (var t = 1; t < arguments.length; t++) { 13716 13717 var i = null != arguments[t] ? arguments[t] : {}; 13718
13719 t % 2 ? Wt(Object(i), !0).forEach((function (t) { 13720 13721 qt(e, t, i[t]) 13722 13723 })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : Wt(Object(i)).forEach((function (t) { 13724 13725 Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t)) 13726 13727 })) 13728 13729 } 13730 13731 return e 13732 13733 } 13734 13735 13736 13737 function qt(e, t, i) { 13738 13739 return (t = function (e) { 13740 13741 var t = function (e, t) { 13742 13743 if ("object" !== Vt(e) || null === e) return e; 13744 13745 var i = e[Symbol.toPrimitive]; 13746 13747 if (void 0 !== i) { 13748 13749 var n = i.call(e, t || "default"); 13750 13751 if ("object" !== Vt(n)) return n; 13752 13753 throw new TypeError("@@toPrimitive must return a primitive value.") 13754 13755 } 13756 13757 return ("string" === t ? String : Number)(e) 13758 13759 }(e, "string"); 13760 13761 return "symbol" === Vt(t) ? t : String(t) 13762 13763 }(t)) in e ? Object.defineProperty(e, t, { 13764 13765 value: i, 13766 13767 enumerable: !0, 13768 13769 configurable: !0, 13770 13771 writable: !0 13772 13773 }) : e[t] = i, e 13774 13775 } 13776 13777 13778 13779 function Zt(e, t, i) { 13780 13781 for (var n = [], o = !1, a = 0, r = 0, s = 0, l = void 0, u = 0, h = 0; h < e.length; h++) { 13782 13783 var p, c, d = Gt({}, e[h]); 13784 13785 if (s = (r = t[h].offset) + t[h].length, 0 == o) l = null === (p = i[u]) || void 0 === p ? void 0 : p.index, a = null === (c = i[u]) || void 0 === c ? void 0 : c.length; 13786 13787 for (; l >= r && l < s;) { 13788 13789 var f, g; 13790 13791 if (d.searchHits || (d.searchHits = []), d.searchHits.push({ 13792 13793 start: l - r, 13794 13795 length: a, 13796 13797 text: i[u].text 13798 13799 }), 1 == d.searchHits.length && n.push(d), l + a > s) a = l + a - s, l = s, o = !0; 13800 13801 else o = !1, l = null === (f = i[++u]) || void 0 === f ? void 0 : f.index, a = null === (g = i[u]) || void 0 === g ? void 0 : g.length 13802 13803 } 13804 13805 } 13806 13807 return n 13808 13809 } 13810 13811 e.prepareOptions = function (t) { 13812 13813 t.element instanceof Bt || (t.element = Bt(t.element)); 13814 13815 var i = t.element; 13816 13817 null == t.dataElement && (t.dataElement = i); 13818 13819 var n = t.dataElement, 13820 13821 o = e.utils.getOptions(n), 13822 13823 a = Bt.extend(!0, {}, e.defaults, t, o); 13824 13825 a = Ut.fallbackOptions(a), Ut.log(a); 13826 13827 var r = Bt.extend(!0, {}, e._defaults, a); 13828 13829 return Ut.isMobile && "function" == typeof e.viewers[r.mobileViewerType] && (r.viewerType = r.mobileViewerType), "function" != typeof e.viewers[r.viewerType] ? (console.warn("Invalid Viewer Type! " + r.viewerType + " | Using default Viewer!"), r.viewerType = e.viewers.default) : r.viewerType = e.viewers[r.viewerType], r = Ut.finalizeOptions(Ut.sanitizeOptions(r)) 13830 13831 }, e.Application = function (t) { 13832 13833 var i = e.prepareOptions(t), 13834 13835 n = new jt(i); 13836 13837 return t.element.data("pf-app", n), null != i.id && !0 !== i.isLightBox && (window[i.id.toString()] = n), n 13838 13839 }, Bt.fn.extend({ 13840 13841 pdfflipinterface_options: function (t) { 13842 13843 return null == t && (t = {}), t.element = Bt(this), new e.prepareOptions(t) 13844 13845 }, 13846 13847 pdfflipinterface: function (t) { 13848 13849 return null == t && (t = {}), t.element = Bt(this), new e.Application(t) 13850 13851 } 13852 13853 }), e.defaults.search = !0, jt.prototype.executeCallback = function (e) { 13854 13855 this.options && "function" == typeof this.options[e] && this.options[e](this) 13856 13857 }
13857, jt.prototype.analytics = function (e) { 13858 13859 if (1 == this.options.enableAnalytics) try { 13860 13861 var t = e.options, 13862 13863 i = void 0; 13864 13865 t && (i = t.bookTitle || t.slug || t.id); 13866 13867 var n = window.gtag; 13868 13869 if (n) n("event", e.eventAction, { 13870 13871 event_category: t.analyticsEventCategory, 13872 13873 event_label: i 13874 13875 }); 13876 13877 else (window.ga || window.__gaTracker)("send", { 13878 13879 hitType: "event", 13880 13881 eventCategory: t.analyticsEventCategory, 13882 13883 eventAction: e.eventAction, 13884 13885 eventLabel: i 13886 13887 }) 13888 13889 } catch (e) { } 13890 13891 }, e.executeCallback = function (e) { 13892 13893 var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : window; 13894 13895 "function" == typeof t[e] && t[e]() 13896 13897 }, e.openAttachmentLightBoxes = function () { 13898 13899 var t = jQuery("body .pf-auto-open-lightbox"); 13900 13901 t.length > 0 && jQuery(t[0]).trigger("click"), jQuery(window).on("hashchange", (function (t) { 13902 13903 var i = location.hash; 13904 13905 i && i.length > 5 && (e.hashFocusBookFound = !1, u.detectHash()) 13906 13907 })) 13908 13909 }, st.prototype.processCustomLinks = function (e, t) { 13910 13911 var i = this, 13912 13913 n = this.app; 13914 13915 if (!1 !== n.options.enableAnnotation && i._isValidPage(e) && null != t) { 13916 13917 var o = n.viewer.getDocumentPageNumber(e), 13918 13919 a = n.options.links; 13920 13921 if (null != a && null != a[o]) 13922 13923 for (var r = a[o], s = 0; s < r.length; s++) { 13924 13925 var l = r[s], 13926 13927 u = void 0; 13928 13929 l.dest && l.dest.indexOf && 0 == l.dest.indexOf("[html]") ? ((u = document.createElement("div")).innerHTML = l.dest.substr(6), u.className = "customHtmlAnnotation") : ((u = document.createElement("a")).setAttribute("dest", l.dest), u.className = "customLinkAnnotation", u.href = "#" + l.dest, u.onclick = function () { 13930 13931 var e = this.getAttribute("dest"); 13932 13933 return e && i.linkService.customNavigateTo(e), !1 13934 13935 }), u.style.left = l.x + "%", u.style.top = l.y + "%", u.style.width = l.w + "%", u.style.height = l.h + "%", t.appendChild(u) 13936 13937 } 13938 13939 } 13940 13941 }, lt.prototype.processTextContent = function (e, t) { 13942 13943 var i = this, 13944 13945 n = this.app; 13946 13947 if (i._isValidPage(e) && null != t) { 13948 13949 var o = !0 === n.options.enableAnnotation && !0 === n.options.enableAutoLinks; 13950 13951 if (o || !1 !== n.options.showSearchControl) { 13952 13953 var a = n.viewer.getDocumentPageNumber(e); 13954 13955 t.innerHTML = "", i.pdfDocument.getPage(a).then((function (r) { 13956 13957 var s = r.getViewport({ 13958 13959 scale: 1, 13960 13961 rotation: r._pageInfo.rotate + n.options.pageRotation 13962 13963 }); 13964 13965 s = r.getViewport({ 13966 13967 scale: n.viewer.getTextureSize({ 13968 13969 pageNumber: e, 13970 13971 isAnnotation: !0 13972 13973 }).height / (s.height * n.options.pixelRatio), 13974 13975 rotation: r._pageInfo.rotate + n.options.pageRotation 13976 13977 }), t.parentNode.style.setProperty("--scale-factor", s.scale), r.getTextContent().then((function (r) { 13978 13979 var l; 13980 13981 i.prepareTextContent(r, a); 13982 13983 var h = i.autoLinkItemsCache[a], 13984 13985 p = i.autoLinkHitsCache[a], 13986 13987 c = i.searchHitItemsCache[a], 13988 13989 d = i.searchHits[e], 13990 13991 f = i.textOffset[a]; 13992 13993 if (!0 === o && null == h) { 13994
13995 h = [], p = u.urlify(i.textContentJoined[a].toLowerCase()); 13996 13997 var g = i.PDFLinkItemsCache[a]; 13998 13999 g && g.length < 5 && (g = void 0), h = Zt(r.items, f, p), i.autoLinkItemsCache[a] = h, i.autoLinkHitsCache[a] = p 14000 14001 } 14002 14003 if (null == c && null != i.textOffsetSearch[a] && d && d.length > 0 && (c = Zt(r.items, i.textOffsetSearch[a], d), i.searchHitItemsCache[a] = c), h && h.length > 0) { 14004 14005 var v = jQuery(t).siblings(".pf-auto-link-content"); 14006 14007 0 == v.length && (v = jQuery('<div class="pf-auto-link-content">'), jQuery(t).parent().prepend(v)), v.html(""), r.items = h; 14008 14009 var m = pdfjsLib.renderTextLayer({ 14010 14011 textContentSource: r, 14012 14013 textContent: r, 14014 14015 container: v[0], 14016 14017 viewport: s, 14018 14019 textDivs: [] 14020 14021 }), 14022 14023 y = 0; 14024 14025 m._textDivs.forEach((function (e) { 14026 14027 var t = r.items[y], 14028 14029 i = "", 14030 14031 n = 0, 14032 14033 o = 0, 14034 14035 a = 0, 14036 14037 s = "", 14038 14039 l = ""; 14040 14041 for (a = 0; a < t.searchHits.length; a++) i += t.str.substring(n, t.searchHits[a].start), n = t.searchHits[a].start, o = t.searchHits[a].length, s = t.str.substring(n, n + o), l = t.searchHits[a].text, s.indexOf("@") > 0 ? ((l = l.toLowerCase()).indexOf(!1) && (l = "mailto:" + s), i += '<a href="' + l + '" class="pf-autolink" target="_blank" rel="noopener">' + s + "</a>") : (0 === l.indexOf("www.") && (l = "http://" + l), i += '<a href="' + l + '" class="pf-autolink" target="_blank" rel="noopener">' + s + "</a>"), u.log("AutoLink: " + l + " for " + s), n += o; 14042 14043 i += t.str.substring(n, t.str.length), y++, e.innerHTML = i 14044 14045 })) 14046 14047 } 14048 14049 if (c && c.length > 0) { 14050 14051 r.items = c; 14052 14053 m = pdfjsLib.renderTextLayer({ 14054 14055 textContentSource: r, 14056 14057 textContent: r, 14058 14059 container: t, 14060 14061 viewport: s, 14062 14063 textDivs: [] 14064 14065 }); 14066 14067 var b = 0; 14068 14069 m._textDivs.forEach((function (e) { 14070 14071 var t = r.items[b], 14072 14073 i = "", 14074 14075 n = 0, 14076 14077 o = 0, 14078 14079 a = 0; 14080 14081 for (a = 0; a < t.searchHits.length; a++) i += t.str.substring(n, t.searchHits[a].start), n = t.searchHits[a].start, o = t.searchHits[a].length, i += '<span class="pf-search-highlight">' + t.str.substring(n, n + o) + "</span>", n += o; 14082 14083 i += t.str.substring(n, t.str.length), b++, e.innerHTML = i, e.classList += " pf-search-hits" 14084 14085 })) 14086 14087 } 14088 14089 null == n || null === (l = n.viewer) || void 0 === l || l.finalizeTextContent(t, e) 14090 14091 })) 14092 14093 })) 14094 14095 } 14096 14097 } 14098 14099 }, lt.prototype.processAnnotations = function (e, t) { 14100 14101 var i = this, 14102 14103 n = this.app; 14104 14105 if (!1 !== n.options.enableAnnotation && i._isValidPage(e) && null != t) { 14106 14107 var o = n.viewer.getDocumentPageNumber(e); 14108 14109 i.pdfDocument.getPage(o).then((function (a) { 14110 14111 var r = a.getViewport({ 14112 14113 scale: 1, 14114 14115 rotation: a._pageInfo.rotate + n.options.pageRotation 14116 14117 }); 14118 14119 r = a.getViewport({ 14120 14121 scale: n.viewer.getTextureSize({ 14122 14123 pageNumber: e, 14124 14125 isAnnotation: !0 14126 14127 }).height / (r.height * n.options.pixelRatio), 14128 14129 rotation: a._pageInfo.rotate + n.options.pageRotation 14130 14131 }), a.getAnnotations().then((function (s) { 14132 14133 if (null !== n.options && null !== n.viewer && 0 != s.length) { 14134 14135 r = r.clone({ 14136 14137 dontFlip: !0 14138 14139 }); 14140 14141 var l = { 14142 14143 annotations: s, 14144 14145 div: t, 14146 14147 page: a, 14148 14149 viewport: r, 14150 14151 imageResourcesPath: n.options.imageResourcesPath, 14152 14153 linkService: i.linkService 14154 14155 }; 14156 14157 if (pdfjsLib.AnnotationLayer.hasOwnProperty("render")) pdfjsLib.AnnotationLayer.render(l); 14158 14159 else new pdfjsLib.AnnotationLayer(l).render(l); 14160 14161 if (n.options.annotationClass && "" !== n.options.annotationClass && jQuery(t).find(" > section").addClass(n.options.annotationClass), null == i.PDFLinkItemsCache[o]) jQuery(t).find("a:not([href^='#'])").map((function () { 14162 14163 return jQuery(this).attr("href") 14164 14165 })).get().join(","); 14166 14167 i.processCustomLinks(e, t), n.viewer.finalizeAnnotations(t, e) 14168 14169 } 14170 14171 })) 14172 14173 })) 14174 14175 } 14176 14177 }, e.getPDFThumb = function (t) { 14178 14179 var i = {}; 14180 14181 i.url = u.httpsCorrection(t.pdfURL), i.rangeChunkSize = 524288, i.cMapPacked = !0, i.disableAutoFetch = !0, i.disableStream = !0, i.disableFontFace = e.defaults.disableFontFace, i.cMapUrl = e.defaults.cMapUrl, i.imagesLocation = e.defaults.imagesLocation, i.imageResourcesPath = e.defaults.imageResourcesPath; 14182 14183 var n = pdfjsLib.getDocument(i), 14184 14185 o = n.promise.then((function (e) { 14186 14187 e.getPage(1).then((function (e) { 14188 14189 var i = 1, 14190 14191 a = document.createElement("canvas"), 14192 14193 r = e.getViewport({ 14194 14195 scale: i 14196 14197 }); 14198 14199 i = r.width > r.height ? 400 * i / r.width : 400 * i / r.height, r = e.getViewport({ 14200 14201 scale: i 14202 14203 }), a.height = Math.floor(r.height), a.width = Math.floor(r.width), e.render({ 14204 14205 canvas: a, 14206 14207 canvasContext: a.getContext("2d"), 14208 14209 viewport: r 14210 14211 }).promise.then((function () { 14212 14213 var e, i = a.toDataURL("image/jpeg", .9); 14214 14215 null === (e = t.callback) || void 0 === e || e.call(t, i), o.destroy && o.destroy(), n.destroy && n.destroy(), o = null, n = null 14216 14217 })) 14218 14219 })) 14220 14221 })); 14222 14223 n.onProgress = function (e) { 14224 14225 var i = 100 * e.loaded / e.total; 14226
14227 isNaN(i) ? e && e.loaded ? t.updateInfo("Loading PDF " + (Math.ceil(e.loaded / 1e4) / 100).toFixed(2).toString() + "MB ...") : t.updateInfo("Loading PDF ...") : t.updateInfo("Loading PDF " + Math.ceil(i).toString().split(".")[0] + "% ...") 14228 14229 } 14230 14231 }; 14232 14233 var Kt = e.jQuery, 14234 14235 Qt = window.TPDFFLIP = window.ThePdfFlip = e; 14236 14237 Qt.defaults.viewerType = "flipbook", Qt.defaults.analyticsEventCategory = "Flipbook", Qt.defaults.analyticsViewerReady = "Book Ready", Qt.defaults.analyticsViewerOpen = "Open Book", Qt.defaults.analyticsViewerClose = "Book Closed", Qt.defaults.analyticsFirstPageChange = "First Page Flip", Qt.slug = "TPDFFLIP", Qt.locationVar = "TPDFFLIPLocation", Qt.locationFile = "flipbook", Qt.PAGE_MODE = { 14238 14239 SINGLE: 1, 14240 14241 DOUBLE: 2, 14242 14243 AUTO: null 14244 14245 }, Qt.SINGLE_PAGE_MODE = { 14246 14247 ZOOM: 1, 14248 14249 BOOKLET: 2, 14250 14251 AUTO: null 14252 14253 }, Qt.CONTROLSPOSITION = { 14254 14255 HIDDEN: "hide", 14256 14257 TOP: "top", 14258 14259 BOTTOM: "bottom" 14260 14261 }, Qt.DIRECTION = { 14262 14263 LTR: 1, 14264 14265 RTL: 2 14266 14267 }, Qt.PAGE_SIZE = { 14268 14269 AUTO: 0, 14270 14271 SINGLE: 1, 14272 14273 DOUBLEINTERNAL: 2 14274 14275 }, Qt.ConvertPageLinks = function () { 14276 14277 for (var e, t = arguments[0] / 100, i = arguments[1] / 100, n = function (e, n, o, a, r) { 14278 14279 return { 14280 14281 x: e / t, 14282 14283 y: n / i, 14284 14285 w: o / t, 14286 14287 h: a / i, 14288 14289 dest: r 14290 14291 } 14292 14293 }, o = [], a = 2; a < arguments.length; a++) e = arguments[a], o[a - 2] = n.apply(this, e); 14294 14295 return o 14296 14297 }, Qt.parseLinks = function (e) { 14298 14299 var t; 14300 14301 if (null != e && e.length > 0) 14302 14303 for (var i = 0; i < e.length; i++) null != (t = e[i]) && null != t[0] && null == t[0].dest && (t = Qt.ConvertPageLinks.apply(this, t), e[i] = t); 14304 14305 return e 14306 14307 }, Qt.parseFallBack = function () { 14308 14309 Kt(".pf-posts").addClass("pdfflip-books"), Kt(".pdfflip-books").addClass("pf-posts"), Kt("._pdfflip_button, ._pdfflip_thumb, ._df_custom, ._pdfflip_book, ._df_hidden").each((function () { 14310 14311 var e = Kt(this); 14312 14313 "true" !== e.data("pf-parsed") && (e.addClass("pf-element"), e.hasClass("_pdfflip_book") || (e.hasClass("_pdfflip_thumb") ? (e.attr("data-pf-lightbox", "thumb"), void 0 !== e.attr("thumb") && e.data("pf-thumb", e.attr("thumb"))) : e.hasClass("_pdfflip_button") ? e.attr("data-pf-lightbox", "button") : e.hasClass("_df_hidden") ? e.attr("data-pf-lightbox", "hidden") : e.attr("data-pf-lightbox", "custom"))) 14314 14315 })) 14316 14317 }, Qt.parseBooks = function () { 14318 14319 Qt.parseFallBack(), Qt.parseElements() 14320 14321 }; 14322 14323 var Xt = function (e) { 14324 14325 if (null != e.source && (Array === e.source.constructor || Array.isArray(e.source) || e.source instanceof Array) && (e.providerType = "image"), null != e.cover3DType && (1 == e.cover3DType || "true" == e.cover3DType ? e.cover3DType = Qt.FLIPBOOK_COVER_TYPE.BASIC : 0 != e.cover3DType && "false" != e.cover3DType || (e.cover3DType = Qt.FLIPBOOK_COVER_TYPE.NONE)), void 0 !== e.pageSize && ("1" === e.pageSize || 1 === e.pageSize || e.pageSize === Qt.FLIPBOOK_PAGE_SIZE.SINGLE ? e.pageSize = Qt.FLIPBOOK_PAGE_SIZE.SINGLE : "2" === e.pageSize || 2 === e.pageSize || e.pageSize === Qt.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL ? e.pageSize = Qt.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL : e.pageSize = Qt.FLIPBOOK_PAGE_SIZE.AUTO), void 0 !== e.pageMode && ("1" === e.pageMode || 1 === e.pageMode || e.pageMode === Qt.FLIPBOOK_PAGE_MODE.SINGLE ? e.pageMode = Qt.FLIPBOOK_PAGE_MODE.SINGLE : "2" === e.pageMode || 2 === e.pageMode || e.pageMode === Qt.FLIPBOOK_PAGE_MODE.DOUBLE ? e.pageMode = Qt.FLIPBOOK_PAGE_MODE.DOUBLE : e.pageMode = Qt.FLIPBOOK_PAGE_MODE.AUTO), void 0 !== e.singlePageMode && ("1" === e.singlePageMode || 1 === e.singlePageMode || e.singlePageMode === Qt.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM ? e.singlePageMode = Qt.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM : "2" === e.singlePageMode || 2 === e.singlePageMode || e.singlePageMode === Qt.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET ? e.singlePageMode = Qt.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET : e.singlePageMode = Qt.FLIPBOOK_SINGLE_PAGE_MODE.AUTO), void 0 !== e.controlsPosition && "hide" === e.controlsPosition && (e.controlsPosition = Qt.CONTROLS_POSITION.HIDDEN), void 0 !== e.overwritePDFOutline && (e.overwritePDFOutline = u.isTrue(e.overwritePDFOutline)), void 0 !== e.webgl && (e.is3D = e.webgl = e.webgl, delete e.webgl), void 0 !== e.webglShadow && (e.has3DShadow = u.isTrue(e.webglShadow), delete e.webglShadow), void 0 !== e.scrollWheel && (u.isTrue(e.scrollWheel) && (e.mouseScrollAction = Qt.MOUSE_SCROLL_ACTIONS.ZOOM), delete e.scrollWheel), void 0 !== e.stiffness && delete e.stiffness, void 0 !== e.soundEnable && (e.enableSound = u.isTrue(e.soundEnable), delete e.soundEnable), void 0 !== e.enableDownload && (e.showDownloadControl = u.isTrue(e.enableDownload), delete e.enableDownload), void 0 !== e.autoEnableOutline && (e.autoOpenOutline = u.isTrue(e.autoEnableOutline), delete e.autoEnableOutline), void 0 !== e.autoEnableThumbnail && (e.autoOpenThumbnail = u.isTrue(e.autoEnableThumbnail), delete e.autoEnableThumbnail), void 0 !== e.direction && ("2" === e.direction || 2 === e.direction || e.direction === Qt.READ_DIRECTION.RTL ? e.readDirection = Qt.READ_DIRECTION.RTL : e.readDirection = Qt.READ_DIRECTION.LTR, delete e.direction), void 0 !== e.hard && (e.flipbookHardPages = e.hard, "hard" === e.flipbookHardPages && (e.flipbookHardPages = "all"), delete e.hard), void 0 !== e.forceFit && delete e.forceFit, "undefined" != typeof TPDFFLIPWPGlobal && "true" === e.wpOptions) { 14326 14327 if (!0 !== e.linksparsed) { 14328 14329 e.linksparsed = !0; 14330 14331 var t = []; 14332 14333 try { 14334 14335 for (var i in e.links) { 14336 14337 for (var n = e.links[i], o = [100, 100], a = 0; a < n.length; a++) { 14338 14339 for (var r = n[a].substr(1).slice(0, -1).split(","), s = [], l = 0; l < 5; l++) s[l] = r[l]; 14340 14341 o.push(s) 14342 14343 } 14344 14345 t[parseInt(i, 10) + 1] = o 14346 14347 } 14348 14349 } catch (e) { 14350 14351 console.error(e.stack) 14352 14353 } 14354 14355 e.links = Qt.parseLinks(t) 14356 14357 } 14358 14359 } else e.links = Qt.parseLinks(e.links); 14360 14361 return u.sanitizeOptions(e) 14362 14363 }; 14364 14365 Kt.fn.extend({ 14366 14367 flipBook: function (t, i) { 14368 14369 return null == i && (i = {}), i.source = t, i.element = Kt(this), new e.Application(i) 14370 14371 } 14372 14373 }), Kt(document).ready((function () { 14374 14375 var e = Kt("body"); 14376 14377 Qt.executeCallback("beforeThePdfFlipInit"), void 0 !== window.TPDFFLIPWPGlobal && Kt.extend(!0, Qt.defaults, Xt(window.TPDFFLIPWPGlobal)), Qt.initUtils(), Qt.initControls(), e.on("click", ".pf-element[data-pf-lightbox],.pf-element[data-lightbox]", (function (e) { 14378 14379 var t = Kt(e.target || e.originalTarget); 14380 14381 if (!t || !t.hasClass("pf-edit-link")) { 14382 14383 var i = Kt(this), 14384 14385 n = i.attr("target"), 14386 14387 o = i.attr("href"), 14388 14389 a = !1; 14390 14391 "#" === o || void 0 === o || i.hasClass("pf-hash-focused") ? a = !0 : "_self" === n || "_blank" === n || (null == n && "_self" === Qt.defaults.targetWindow ? i.attr("target", "_self") : null == n && "_blank" === Qt.defaults.targetWindow ? i.attr("target", "_blank") : a = !0), a && (e.preventDefault(), e.stopPropagation(), Qt.openLightBox(i)) 14392 14393 } 14394 14395 })), e.on("click", ".pf-trigger", (function (e) { 14396 14397 var t = Kt(this).attr("pf-trigger"); 14398 14399 Kt("[pf-trigger-id=" + t + "]").trigger("click") 14400 14401 })), Qt.checkBrowserURLforDefaults(), Qt.parseCSSElements(), Qt.parseFallBack(), u.detectHash(), Qt.parseNormalElements(), Qt.checkBrowserURLforPDF(!0), Qt.openAttachmentLightBoxes(), Qt.executeCallback("afterThePdfFlipInit") 14402 14403 })), u.finalizeOptions = function (e) { 14404 14405 return Xt(e) 14406 14407 }, Pt.prototype.processAnnotations = function (e, t) { 14408 14409 this.processCustomLinks(e, t), this.app.viewer.finalizeAnnotations(t, e) 14410 14411 }, Qt.executeCallback("onThePdfFlipLoad") 14412 14413 }() 14414 14415}();
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.