1/*! 2 * perfect-scrollbar v1.4.0 3 * (c) 2018 Hyunje Jun 4 * @license MIT 5 */ 6!(function(t, e) { 7 'object' == typeof exports && 'undefined' != typeof module 8 ? (module.exports = e()) 9 : 'function' == typeof define && define.amd 10 ? define(e) 11 : (t.PerfectScrollbar = e()); 12})(this, function() { 13 'use strict'; 14 function t(t) { 15 return getComputedStyle(t); 16 } 17 function e(t, e) { 18 for (var i in e) { 19 var r = e[i]; 20 'number' == typeof r && (r += 'px'), (t.style[i] = r); 21 } 22 return t; 23 } 24 function i(t) { 25 var e = document.createElement('div'); 26 return (e.className = t), e; 27 } 28 function r(t, e) { 29 if (!v) throw new Error('No element matching method supported'); 30 return v.call(t, e); 31 } 32 function l(t) { 33 t.remove ? t.remove() : t.parentNode && t.parentNode.removeChild(t); 34 } 35 function n(t, e) { 36 return Array.prototype.filter.call(t.children, function(t) { 37 return r(t, e); 38 }); 39 } 40 function o(t, e) { 41 var i = t.element.classList, 42 r = m.state.scrolling(e); 43 i.contains(r) ? clearTimeout(Y[e]) : i.add(r); 44 } 45 function s(t, e) { 46 Y[e] = setTimeout(function() { 47 return t.isAlive && t.element.classList.remove(m.state.scrolling(e)); 48 }, t.settings.scrollingThreshold); 49 } 50 function a(t, e) { 51 o(t, e), s(t, e); 52 } 53 function c(t) { 54 if ('function' == typeof window.CustomEvent) return new CustomEvent(t); 55 var e = document.createEvent('CustomEvent'); 56 return e.initCustomEvent(t, !1, !1, void 0), e; 57 } 58 function h(t, e, i, r, l) { 59 var n = i[0], 60 o = i[1], 61 s = i[2], 62 h = i[3], 63 u = i[4], 64 d = i[5]; 65 void 0 === r && (r = !0), void 0 === l && (l = !1); 66 var f = t.element; 67 (t.reach[h] = null), 68 f[s] < 1 && (t.reach[h] = 'start'), 69 f[s] > t[n] - t[o] - 1 && (t.reach[h] = 'end'), 70 e && 71 (f.dispatchEvent(c('ps-scroll-' + h)), 72 e < 0 73 ? f.dispatchEvent(c('ps-scroll-' + u)) 74 : e > 0 && f.dispatchEvent(c('ps-scroll-' + d)), 75 r && a(t, h)), 76 t.reach[h] && 77 (e || l) && 78 f.dispatchEvent(c('ps-' + h + '-reach-' + t.reach[h])); 79 } 80 function u(t) { 81 return parseInt(t, 10) || 0; 82 } 83 function d(t) { 84 return ( 85 r(t, 'input,[contenteditable]') || 86 r(t, 'select,[contenteditable]') || 87 r(t, 'textarea,[contenteditable]') || 88 r(t, 'button,[contenteditable]') 89 ); 90 } 91 function f(e) { 92 var i = t(e); 93 return ( 94 u(i.width) + 95 u(i.paddingLeft) + 96 u(i.paddingRight) + 97 u(i.borderLeftWidth) + 98 u(i.borderRightWidth) 99 ); 100 } 101 function p(t, e) { 102 return ( 103 t.settings.minScrollbarLength && 104 (e = Math.max(e, t.settings.minScrollbarLength)), 105 t.settings.maxScrollbarLength && 106 (e = Math.min(e, t.settings.maxScrollbarLength)), 107 e 108 ); 109 } 110 function b(t, i) { 111 var r = { width: i.railXWidth }, 112 l = Math.floor(t.scrollTop); 113 i.isRtl 114 ? (r.left = 115 i.negativeScrollAdjustment + 116 t.scrollLeft + 117 i.containerWidth - 118 i.contentWidth) 119 : (r.left = t.scrollLeft), 120 i.isScrollbarXUsingBottom 121 ? (r.bottom = i.scrollbarXBottom - l) 122 : (r.top = i.scrollbarXTop + l), 123 e(i.scrollbarXRail, r); 124 var n = { top: l, height: i.railYHeight }; 125 i.isScrollbarYUsingRight 126 ? i.isRtl 127 ? (n.right = 128 i.contentWidth - 129 (i.negativeScrollAdjustment + t.scrollLeft) - 130 i.scrollbarYRight - 131 i.scrollbarYOuterWidth) 132 : (n.right = i.scrollbarYRight - t.scrollLeft) 133 : i.isRtl 134 ? (n.left = 135 i.negativeScrollAdjustment + 136 t.scrollLeft + 137 2 * i.containerWidth - 138 i.contentWidth - 139 i.scrollbarYLeft - 140 i.scrollbarYOuterWidth) 141 : (n.left = i.scrollbarYLeft + t.scrollLeft), 142 e(i.scrollbarYRail, n), 143 e(i.scrollbarX, { 144 left: i.scrollbarXLeft, 145 width: i.scrollbarXWidth - i.railBorderXWidth 146 }), 147 e(i.scrollbarY, { 148 top: i.scrollbarYTop, 149 height: i.scrollbarYHeight - i.railBorderYWidth 150 }); 151 } 152 function g(t, e) { 153 function i(e) { 154 (b[d] = g + Y * (e[a] - v)), 155 o(t, f), 156 R(t), 157 e.stopPropagation(), 158 e.preventDefault(); 159 } 160 function r() { 161 s(t, f), 162 t[p].classList.remove(m.state.clicking), 163 t.event.unbind(t.ownerDocument, 'mousemove', i); 164 } 165 var l = e[0], 166 n = e[1], 167 a = e[2], 168 c = e[3], 169 h = e[4], 170 u = e[5], 171 d = e[6], 172 f = e[7], 173 p = e[8], 174 b = t.element, 175 g = null, 176 v = null, 177 Y = null; 178 t.event.bind(t[h], 'mousedown', function(e) { 179 (g = b[d]), 180 (v = e[a]), 181 (Y = (t[n] - t[l]) / (t[c] - t[u])), 182 t.event.bind(t.ownerDocument, 'mousemove', i), 183 t.event.once(t.ownerDocument, 'mouseup', r), 184 t[p].classList.add(m.state.clicking), 185 e.stopPropagation(), 186 e.preventDefault(); 187 }); 188 } 189 var v = 190 'undefined' != typeof Element && 191 (Element.prototype.matches || 192 Element.prototype.webkitMatchesSelector || 193 Element.prototype.mozMatchesSelector || 194 Element.prototype.msMatchesSelector), 195 m = { 196 main: 'ps', 197 element: { 198 thumb: function(t) { 199 return 'ps__thumb-' + t; 200 }, 201 rail: function(t) { 202 return 'ps__rail-' + t; 203 }, 204 consuming: 'ps__child--consume' 205 }, 206 state: { 207 focus: 'ps--focus', 208 clicking: 'ps--clicking', 209 active: function(t) { 210 return 'ps--active-' + t; 211 }, 212 scrolling: function(t) { 213 return 'ps--scrolling-' + t; 214 } 215 } 216 }, 217 Y = { x: null, y: null }, 218 X = function(t) { 219 (this.element = t), (this.handlers = {}); 220 }, 221 w = { isEmpty: { configurable: !0 } }; 222 (X.prototype.bind = function(t, e) { 223 void 0 === this.handlers[t] && (this.handlers[t] = []), 224 this.handlers[t].push(e), 225 this.element.addEventListener(t, e, !1); 226 }), 227 (X.prototype.unbind = function(t, e) { 228 var i = this; 229 this.handlers[t] = this.handlers[t].filter(function(r) { 230 return ( 231 !(!e || r === e) || (i.element.removeEventListener(t, r, !1), !1) 232 ); 233 }); 234 }), 235 (X.prototype.unbindAll = function() { 236 var t = this; 237 for (var e in t.handlers) t.unbind(e); 238 }), 239 (w.isEmpty.get = function() { 240 var t = this; 241 return Object.keys(this.handlers).every(function(e) { 242 return 0 === t.handlers[e].length; 243 }); 244 }), 245 Object.defineProperties(X.prototype, w); 246 var y = function() { 247 this.eventElements = []; 248 }; 249 (y.prototype.eventElement = function(t) { 250 var e = this.eventElements.filter(function(e) { 251 return e.element === t; 252 })[0]; 253 return e || ((e = new X(t)), this.eventElements.push(e)), e; 254 }), 255 (y.prototype.bind = function(t, e, i) { 256 this.eventElement(t).bind(e, i); 257 }), 258 (y.prototype.unbind = function(t, e, i) { 259 var r = this.eventElement(t); 260 r.unbind(e, i), 261 r.isEmpty && 262 this.eventElements.splice(this.eventElements.indexOf(r), 1); 263 }), 264 (y.prototype.unbindAll = function() {
265 this.eventElements.forEach(function(t) { 266 return t.unbindAll(); 267 }), 268 (this.eventElements = []); 269 }), 270 (y.prototype.once = function(t, e, i) { 271 var r = this.eventElement(t), 272 l = function(t) { 273 r.unbind(e, l), i(t); 274 }; 275 r.bind(e, l); 276 }); 277 var W = function(t, e, i, r, l) { 278 void 0 === r && (r = !0), void 0 === l && (l = !1); 279 var n; 280 if ('top' === e) 281 n = [ 282 'contentHeight', 283 'containerHeight', 284 'scrollTop', 285 'y', 286 'up', 287 'down' 288 ]; 289 else { 290 if ('left' !== e) throw new Error('A proper axis should be provided'); 291 n = [ 292 'contentWidth', 293 'containerWidth', 294 'scrollLeft', 295 'x', 296 'left', 297 'right' 298 ]; 299 } 300 h(t, i, n, r, l); 301 }, 302 L = { 303 isWebKit: 304 'undefined' != typeof document && 305 'WebkitAppearance' in document.documentElement.style, 306 supportsTouch: 307 'undefined' != typeof window && 308 ('ontouchstart' in window || 309 (window.DocumentTouch && document instanceof window.DocumentTouch)), 310 supportsIePointer: 311 'undefined' != typeof navigator && navigator.msMaxTouchPoints, 312 isChrome: 313 'undefined' != typeof navigator && 314 /Chrome/i.test(navigator && navigator.userAgent) 315 }, 316 R = function(t) { 317 var e = t.element, 318 i = Math.floor(e.scrollTop); 319 (t.containerWidth = e.clientWidth), 320 (t.containerHeight = e.clientHeight), 321 (t.contentWidth = e.scrollWidth), 322 (t.contentHeight = e.scrollHeight), 323 e.contains(t.scrollbarXRail) || 324 (n(e, m.element.rail('x')).forEach(function(t) { 325 return l(t); 326 }), 327 e.appendChild(t.scrollbarXRail)), 328 e.contains(t.scrollbarYRail) || 329 (n(e, m.element.rail('y')).forEach(function(t) { 330 return l(t); 331 }), 332 e.appendChild(t.scrollbarYRail)), 333 !t.settings.suppressScrollX && 334 t.containerWidth + t.settings.scrollXMarginOffset < t.contentWidth 335 ? ((t.scrollbarXActive = !0), 336 (t.railXWidth = t.containerWidth - t.railXMarginWidth), 337 (t.railXRatio = t.containerWidth / t.railXWidth), 338 (t.scrollbarXWidth = p( 339 t, 340 u((t.railXWidth * t.containerWidth) / t.contentWidth) 341 )), 342 (t.scrollbarXLeft = u( 343 ((t.negativeScrollAdjustment + e.scrollLeft) * 344 (t.railXWidth - t.scrollbarXWidth)) / 345 (t.contentWidth - t.containerWidth) 346 ))) 347 : (t.scrollbarXActive = !1), 348 !t.settings.suppressScrollY && 349 t.containerHeight + t.settings.scrollYMarginOffset < t.contentHeight 350 ? ((t.scrollbarYActive = !0), 351 (t.railYHeight = t.containerHeight - t.railYMarginHeight), 352 (t.railYRatio = t.containerHeight / t.railYHeight), 353 (t.scrollbarYHeight = p( 354 t, 355 u((t.railYHeight * t.containerHeight) / t.contentHeight) 356 )), 357 (t.scrollbarYTop = u( 358 (i * (t.railYHeight - t.scrollbarYHeight)) / 359 (t.contentHeight - t.containerHeight) 360 ))) 361 : (t.scrollbarYActive = !1), 362 t.scrollbarXLeft >= t.railXWidth - t.scrollbarXWidth && 363 (t.scrollbarXLeft = t.railXWidth - t.scrollbarXWidth), 364 t.scrollbarYTop >= t.railYHeight - t.scrollbarYHeight && 365 (t.scrollbarYTop = t.railYHeight - t.scrollbarYHeight), 366 b(e, t), 367 t.scrollbarXActive 368 ? e.classList.add(m.state.active('x')) 369 : (e.classList.remove(m.state.active('x')), 370 (t.scrollbarXWidth = 0), 371 (t.scrollbarXLeft = 0), 372 (e.scrollLeft = 0)), 373 t.scrollbarYActive 374 ? e.classList.add(m.state.active('y')) 375 : (e.classList.remove(m.state.active('y')), 376 (t.scrollbarYHeight = 0), 377 (t.scrollbarYTop = 0), 378 (e.scrollTop = 0)); 379 }, 380 T = { 381 'click-rail': function(t) { 382 t.event.bind(t.scrollbarY, 'mousedown', function(t) { 383 return t.stopPropagation(); 384 }), 385 t.event.bind(t.scrollbarYRail, 'mousedown', function(e) { 386 var i = 387 e.pageY - 388 window.pageYOffset - 389 t.scrollbarYRail.getBoundingClientRect().top > 390 t.scrollbarYTop 391 ? 1 392 : -1; 393 (t.element.scrollTop += i * t.containerHeight), 394 R(t), 395 e.stopPropagation(); 396 }), 397 t.event.bind(t.scrollbarX, 'mousedown', function(t) { 398 return t.stopPropagation(); 399 }), 400 t.event.bind(t.scrollbarXRail, 'mousedown', function(e) { 401 var i = 402 e.pageX - 403 window.pageXOffset - 404 t.scrollbarXRail.getBoundingClientRect().left > 405 t.scrollbarXLeft 406 ? 1 407 : -1; 408 (t.element.scrollLeft += i * t.containerWidth), 409 R(t), 410 e.stopPropagation(); 411 }); 412 }, 413 'drag-thumb': function(t) { 414 g(t, [ 415 'containerWidth', 416 'contentWidth', 417 'pageX', 418 'railXWidth', 419 'scrollbarX', 420 'scrollbarXWidth', 421 'scrollLeft', 422 'x', 423 'scrollbarXRail' 424 ]), 425 g(t, [ 426 'containerHeight', 427 'contentHeight', 428 'pageY', 429 'railYHeight', 430 'scrollbarY', 431 'scrollbarYHeight', 432 'scrollTop', 433 'y', 434 'scrollbarYRail' 435 ]); 436 }, 437 keyboard: function(t) { 438 function e(e, r) { 439 var l = Math.floor(i.scrollTop); 440 if (0 === e) { 441 if (!t.scrollbarYActive) return !1; 442 if ( 443 (0 === l && r > 0) || 444 (l >= t.contentHeight - t.containerHeight && r < 0) 445 ) 446 return !t.settings.wheelPropagation; 447 } 448 var n = i.scrollLeft; 449 if (0 === r) { 450 if (!t.scrollbarXActive) return !1; 451 if ( 452 (0 === n && e < 0) || 453 (n >= t.contentWidth - t.containerWidth && e > 0) 454 ) 455 return !t.settings.wheelPropagation; 456 } 457 return !0; 458 } 459 var i = t.element, 460 l = function() { 461 return r(i, ':hover'); 462 }, 463 n = function() { 464 return r(t.scrollbarX, ':focus') || r(t.scrollbarY, ':focus'); 465 }; 466 t.event.bind(t.ownerDocument, 'keydown', function(r) { 467 if ( 468 !( 469 (r.isDefaultPrevented && r.isDefaultPrevented()) || 470 r.defaultPrevented 471 ) && 472 (l() || n()) 473 ) { 474 var o = document.activeElement 475 ? document.activeElement 476 : t.ownerDocument.activeElement; 477 if (o) { 478 if ('IFRAME' === o.tagName) o = o.contentDocument.activeElement; 479 else for (; o.shadowRoot; ) o = o.shadowRoot.activeElement; 480 if (d(o)) return; 481 } 482 var s = 0, 483 a = 0; 484 switch (r.which) { 485 case 37: 486 s = r.metaKey 487 ? -t.contentWidth 488 : r.altKey 489 ? -t.containerWidth 490 : -30; 491 break; 492 case 38: 493 a = r.metaKey 494 ? t.contentHeight 495 : r.altKey 496 ? t.containerHeight 497 : 30; 498 break; 499 case 39: 500 s = r.metaKey 501 ? t.contentWidth 502 : r.altKey 503 ? t.containerWidth 504 : 30; 505 break; 506 case 40: 507 a = r.metaKey 508 ? -t.contentHeight 509 : r.altKey 510 ? -t.containerHeight 511 : -30; 512 break; 513 case 32: 514 a = r.shiftKey ? t.containerHeight : -t.containerHeight; 515 break; 516 case 33: 517 a = t.containerHeight; 518 break; 519 case 34: 520 a = -t.containerHeight; 521 break; 522 case 36: 523 a = t.contentHeight; 524 break; 525 case 35: 526 a = -t.contentHeight; 527 break; 528 default: 529 return; 530 } 531 (t.settings.suppressScrollX && 0 !== s) || 532 (t.settings.suppressScrollY && 0 !== a) || 533 ((i.scrollTop -= a), 534 (i.scrollLeft += s), 535 R(t), 536 e(s, a) && r.preventDefault()); 537 } 538 }); 539 }, 540 wheel: function(e) { 541 function i(t, i) { 542 var r = Math.floor(o.scrollTop), 543 l = 0 === o.scrollTop, 544 n = r + o.offsetHeight === o.scrollHeight, 545 s = 0 === o.scrollLeft, 546 a = o.scrollLeft + o.offsetWidth === o.scrollWidth; 547 return ( 548 !(Math.abs(i) > Math.abs(t) ? l || n : s || a) || 549 !e.settings.wheelPropagation 550 ); 551 } 552 function r(t) { 553 var e = t.deltaX, 554 i = -1 * t.deltaY; 555 return ( 556 (void 0 !== e && void 0 !== i) || 557 ((e = (-1 * t.wheelDeltaX) / 6), (i = t.wheelDeltaY / 6)), 558 t.deltaMode && 1 === t.deltaMode && ((e *= 10), (i *= 10)), 559 e !== e && i !== i && ((e = 0), (i = t.wheelDelta)), 560 t.shiftKey ? [-i, -e] : [e, i] 561 ); 562 } 563 function l(e, i, r) { 564 if (!L.isWebKit && o.querySelector('select:focus')) return !0; 565 if (!o.contains(e)) return !1; 566 for (var l = e; l && l !== o; ) { 567 if (l.classList.contains(m.element.consuming)) return !0; 568 var n = t(l); 569 if ( 570 [n.overflow, n.overflowX, n.overflowY] 571 .join('') 572 .match(/(scroll|auto)/) 573 ) { 574 var s = l.scrollHeight - l.clientHeight; 575 if ( 576 s > 0 && 577 !((0 === l.scrollTop && r > 0) || (l.scrollTop === s && r < 0)) 578 ) 579 return !0; 580 var a = l.scrollWidth - l.clientWidth; 581 if ( 582 a > 0 && 583 !( 584 (0 === l.scrollLeft && i < 0) || 585 (l.scrollLeft === a && i > 0) 586 ) 587 ) 588 return !0; 589 } 590 l = l.parentNode; 591 } 592 return !1; 593 } 594 function n(t) { 595 var n = r(t), 596 s = n[0], 597 a = n[1]; 598 if (!l(t.target, s, a)) { 599 var c = !1; 600 e.settings.useBothWheelAxes 601 ? e.scrollbarYActive && !e.scrollbarXActive 602 ? (a 603 ? (o.scrollTop -= a * e.settings.wheelSpeed) 604 : (o.scrollTop += s * e.settings.wheelSpeed), 605 (c = !0)) 606 : e.scrollbarXActive && 607 !e.scrollbarYActive && 608 (s 609 ? (o.scrollLeft += s * e.settings.wheelSpeed) 610 : (o.scrollLeft -= a * e.settings.wheelSpeed), 611 (c = !0)) 612 : ((o.scrollTop -= a * e.settings.wheelSpeed), 613 (o.scrollLeft += s * e.settings.wheelSpeed)), 614 R(e), 615 (c = c || i(s, a)) && 616 !t.ctrlKey && 617 (t.stopPropagation(), t.preventDefault()); 618 } 619 } 620 var o = e.element; 621 void 0 !== window.onwheel 622 ? e.event.bind(o, 'wheel', n) 623 : void 0 !== window.onmousewheel && e.event.bind(o, 'mousewheel', n); 624 }, 625 touch: function(e) { 626 function i(t, i) { 627 var r = Math.floor(h.scrollTop), 628 l = h.scrollLeft, 629 n = Math.abs(t), 630 o = Math.abs(i); 631 if (o > n) { 632 if ( 633 (i < 0 && r === e.contentHeight - e.containerHeight) || 634 (i > 0 && 0 === r) 635 ) 636 return 0 === window.scrollY && i > 0 && L.isChrome; 637 } else if ( 638 n > o && 639 ((t < 0 && l === e.contentWidth - e.containerWidth) || 640 (t > 0 && 0 === l)) 641 ) 642 return !0; 643 return !0; 644 } 645 function r(t, i) { 646 (h.scrollTop -= i), (h.scrollLeft -= t), R(e); 647 } 648 function l(t) { 649 return t.targetTouches ? t.targetTouches[0] : t; 650 } 651 function n(t) { 652 return !( 653 (t.pointerType && 'pen' === t.pointerType && 0 === t.buttons) || 654 ((!t.targetTouches || 1 !== t.targetTouches.length) && 655 (!t.pointerType || 656 'mouse' === t.pointerType || 657 t.pointerType === t.MSPOINTER_TYPE_MOUSE)) 658 ); 659 } 660 function o(t) { 661 if (n(t)) { 662 var e = l(t); 663 (u.pageX = e.pageX), 664 (u.pageY = e.pageY), 665 (d = new Date().getTime()), 666 null !== p && clearInterval(p); 667 } 668 } 669 function s(e, i, r) { 670 if (!h.contains(e)) return !1; 671 for (var l = e; l && l !== h; ) { 672 if (l.classList.contains(m.element.consuming)) return !0; 673 var n = t(l); 674 if ( 675 [n.overflow, n.overflowX, n.overflowY] 676 .join('') 677 .match(/(scroll|auto)/) 678 ) { 679 var o = l.scrollHeight - l.clientHeight; 680 if ( 681 o > 0 && 682 !((0 === l.scrollTop && r > 0) || (l.scrollTop === o && r < 0)) 683 ) 684 return !0; 685 var s = l.scrollLeft - l.clientWidth; 686 if ( 687 s > 0 && 688 !( 689 (0 === l.scrollLeft && i < 0) || 690 (l.scrollLeft === s && i > 0) 691 ) 692 ) 693 return !0; 694 } 695 l = l.parentNode; 696 } 697 return !1; 698 } 699 function a(t) { 700 if (n(t)) { 701 var e = l(t), 702 o = { pageX: e.pageX, pageY: e.pageY },
703 a = o.pageX - u.pageX, 704 c = o.pageY - u.pageY; 705 if (s(t.target, a, c)) return; 706 r(a, c), (u = o); 707 var h = new Date().getTime(), 708 p = h - d; 709 p > 0 && ((f.x = a / p), (f.y = c / p), (d = h)), 710 i(a, c) && t.preventDefault(); 711 } 712 } 713 function c() { 714 e.settings.swipeEasing && 715 (clearInterval(p), 716 (p = setInterval(function() { 717 e.isInitialized 718 ? clearInterval(p) 719 : f.x || f.y 720 ? Math.abs(f.x) < 0.01 && Math.abs(f.y) < 0.01 721 ? clearInterval(p) 722 : (r(30 * f.x, 30 * f.y), (f.x *= 0.8), (f.y *= 0.8)) 723 : clearInterval(p); 724 }, 10))); 725 } 726 if (L.supportsTouch || L.supportsIePointer) { 727 var h = e.element, 728 u = {}, 729 d = 0, 730 f = {}, 731 p = null; 732 L.supportsTouch 733 ? (e.event.bind(h, 'touchstart', o), 734 e.event.bind(h, 'touchmove', a), 735 e.event.bind(h, 'touchend', c)) 736 : L.supportsIePointer && 737 (window.PointerEvent 738 ? (e.event.bind(h, 'pointerdown', o), 739 e.event.bind(h, 'pointermove', a), 740 e.event.bind(h, 'pointerup', c)) 741 : window.MSPointerEvent && 742 (e.event.bind(h, 'MSPointerDown', o), 743 e.event.bind(h, 'MSPointerMove', a), 744 e.event.bind(h, 'MSPointerUp', c))); 745 } 746 } 747 }, 748 H = function(r, l) { 749 var n = this; 750 if ( 751 (void 0 === l && (l = {}), 752 'string' == typeof r && (r = document.querySelector(r)), 753 !r || !r.nodeName) 754 ) 755 throw new Error( 756 'no element is specified to initialize PerfectScrollbar' 757 ); 758 (this.element = r), 759 r.classList.add(m.main), 760 (this.settings = { 761 handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'], 762 maxScrollbarLength: null, 763 minScrollbarLength: null, 764 scrollingThreshold: 1e3, 765 scrollXMarginOffset: 0, 766 scrollYMarginOffset: 0, 767 suppressScrollX: !1, 768 suppressScrollY: !1, 769 swipeEasing: !0, 770 useBothWheelAxes: !1, 771 wheelPropagation: !0, 772 wheelSpeed: 1 773 }); 774 for (var o in l) n.settings[o] = l[o]; 775 (this.containerWidth = null),
776 (this.containerHeight = null), 777 (this.contentWidth = null), 778 (this.contentHeight = null); 779 var s = function() { 780 return r.classList.add(m.state.focus); 781 }, 782 a = function() { 783 return r.classList.remove(m.state.focus); 784 }; 785 (this.isRtl = 'rtl' === t(r).direction), 786 (this.isNegativeScroll = (function() { 787 var t = r.scrollLeft, 788 e = null; 789 return ( 790 (r.scrollLeft = -1), (e = r.scrollLeft < 0), (r.scrollLeft = t), e 791 ); 792 })()), 793 (this.negativeScrollAdjustment = this.isNegativeScroll 794 ? r.scrollWidth - r.clientWidth 795 : 0), 796 (this.event = new y()), 797 (this.ownerDocument = r.ownerDocument || document), 798 (this.scrollbarXRail = i(m.element.rail('x'))), 799 r.appendChild(this.scrollbarXRail), 800 (this.scrollbarX = i(m.element.thumb('x'))), 801 this.scrollbarXRail.appendChild(this.scrollbarX), 802 this.scrollbarX.setAttribute('tabindex', 0), 803 this.event.bind(this.scrollbarX, 'focus', s), 804 this.event.bind(this.scrollbarX, 'blur', a), 805 (this.scrollbarXActive = null), 806 (this.scrollbarXWidth = null),
807 (this.scrollbarXLeft = null); 808 var c = t(this.scrollbarXRail); 809 (this.scrollbarXBottom = parseInt(c.bottom, 10)), 810 isNaN(this.scrollbarXBottom) 811 ? ((this.isScrollbarXUsingBottom = !1), 812 (this.scrollbarXTop = u(c.top))) 813 : (this.isScrollbarXUsingBottom = !0), 814 (this.railBorderXWidth = u(c.borderLeftWidth) + u(c.borderRightWidth)), 815 e(this.scrollbarXRail, { display: 'block' }), 816 (this.railXMarginWidth = u(c.marginLeft) + u(c.marginRight)), 817 e(this.scrollbarXRail, { display: '' }), 818 (this.railXWidth = null), 819 (this.railXRatio = null), 820 (this.scrollbarYRail = i(m.element.rail('y'))), 821 r.appendChild(this.scrollbarYRail), 822 (this.scrollbarY = i(m.element.thumb('y'))), 823 this.scrollbarYRail.appendChild(this.scrollbarY), 824 this.scrollbarY.setAttribute('tabindex', 0), 825 this.event.bind(this.scrollbarY, 'focus', s), 826 this.event.bind(this.scrollbarY, 'blur', a), 827 (this.scrollbarYActive = null), 828 (this.scrollbarYHeight = null), 829 (this.scrollbarYTop = null); 830 var h = t(this.scrollbarYRail); 831 (this.scrollbarYRight = parseInt(h.right, 10)), 832 isNaN(this.scrollbarYRight) 833 ? ((this.isScrollbarYUsingRight = !1), 834 (this.scrollbarYLeft = u(h.left))) 835 : (this.isScrollbarYUsingRight = !0), 836 (this.scrollbarYOuterWidth = this.isRtl ? f(this.scrollbarY) : null), 837 (this.railBorderYWidth = u(h.borderTopWidth) + u(h.borderBottomWidth)), 838 e(this.scrollbarYRail, { display: 'block' }), 839 (this.railYMarginHeight = u(h.marginTop) + u(h.marginBottom)), 840 e(this.scrollbarYRail, { display: '' }), 841 (this.railYHeight = null), 842 (this.railYRatio = null), 843 (this.reach = { 844 x: 845 r.scrollLeft <= 0 846 ? 'start' 847 : r.scrollLeft >= this.contentWidth - this.containerWidth 848 ? 'end' 849 : null, 850 y: 851 r.scrollTop <= 0 852 ? 'start' 853 : r.scrollTop >= this.contentHeight - this.containerHeight 854 ? 'end' 855 : null 856 }), 857 (this.isAlive = !0), 858 this.settings.handlers.forEach(function(t) { 859 return T[t](n); 860 }), 861 (this.lastScrollTop = Math.floor(r.scrollTop)), 862 (this.lastScrollLeft = r.scrollLeft), 863 this.event.bind(this.element, 'scroll', function(t) { 864 return n.onScroll(t); 865 }), 866 R(this); 867 }; 868 return ( 869 (H.prototype.update = function() { 870 this.isAlive && 871 ((this.negativeScrollAdjustment = this.isNegativeScroll 872 ? this.element.scrollWidth - this.element.clientWidth 873 : 0), 874 e(this.scrollbarXRail, { display: 'block' }), 875 e(this.scrollbarYRail, { display: 'block' }), 876 (this.railXMarginWidth = 877 u(t(this.scrollbarXRail).marginLeft) + 878 u(t(this.scrollbarXRail).marginRight)), 879 (this.railYMarginHeight = 880 u(t(this.scrollbarYRail).marginTop) + 881 u(t(this.scrollbarYRail).marginBottom)), 882 e(this.scrollbarXRail, { display: 'none' }), 883 e(this.scrollbarYRail, { display: 'none' }), 884 R(this), 885 W(this, 'top', 0, !1, !0), 886 W(this, 'left', 0, !1, !0), 887 e(this.scrollbarXRail, { display: '' }), 888 e(this.scrollbarYRail, { display: '' })); 889 }), 890 (H.prototype.onScroll = function(t) { 891 this.isAlive && 892 (R(this), 893 W(this, 'top', this.element.scrollTop - this.lastScrollTop), 894 W(this, 'left', this.element.scrollLeft - this.lastScrollLeft), 895 (this.lastScrollTop = Math.floor(this.element.scrollTop)), 896 (this.lastScrollLeft = this.element.scrollLeft)); 897 }), 898 (H.prototype.destroy = function() { 899 this.isAlive && 900 (this.event.unbindAll(), 901 l(this.scrollbarX), 902 l(this.scrollbarY), 903 l(this.scrollbarXRail), 904 l(this.scrollbarYRail), 905 this.removePsClasses(), 906 (this.element = null), 907 (this.scrollbarX = null),
908 (this.scrollbarY = null), 909 (this.scrollbarXRail = null), 910 (this.scrollbarYRail = null), 911 (this.isAlive = !1)); 912 }), 913 (H.prototype.removePsClasses = function() { 914 this.element.className = this.element.className 915 .split(' ') 916 .filter(function(t) { 917 return !t.match(/^ps([-_].+|)$/); 918 }) 919 .join(' '); 920 }), 921 H 922 ); 923});
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.