1! ( function ( t, e ) { 2 'object' === typeof exports && 'undefined' !== typeof module 3 ? e( exports ) 4 : 'function' === typeof define && define.amd 5 ? define( [ 'exports' ], e ) 6 : e( 7 ( ( t = 8 'undefined' !== typeof globalThis 9 ? globalThis 10 : t || self ).window = t.window || {} ) 11 ); 12} )( this, function ( t ) { 13 'use strict'; 14 const e = ( t, e = 1e4 ) => ( 15 ( t = parseFloat( t + '' ) || 0 ), 16 Math.round( ( t + Number.EPSILON ) * e ) / e 17 ), 18 i = function ( t, e = void 0 ) { 19 return ( 20 ! ( ! t || t === document.body || ( e && t === e ) ) && 21 ( ( function ( t ) { 22 if ( ! ( t && t instanceof Element && t.offsetParent ) ) { 23 return ! 1; 24 } 25 const e = t.scrollHeight > t.clientHeight, 26 i = window.getComputedStyle( t ).overflowY, 27 n = -1 !== i.indexOf( 'hidden' ), 28 s = -1 !== i.indexOf( 'visible' ); 29 return e && ! n && ! s; 30 } )( t ) 31 ? t 32 : i( t.parentElement, e ) ) 33 ); 34 }, 35 n = function ( t ) { 36 const e = new DOMParser().parseFromString( t, 'text/html' ).body; 37 if ( e.childElementCount > 1 ) { 38 for ( 39 var i = document.createElement( 'div' ); 40 e.firstChild; 41 42 ) { 43 i.appendChild( e.firstChild ); 44 } 45 return i; 46 } 47 return e.firstChild; 48 }, 49 s = ( t ) => `${ t || '' }`.split( ' ' ).filter( ( t ) => !! t ), 50 o = ( t, e, i ) => { 51 t && 52 s( e ).forEach( ( e ) => { 53 t.classList.toggle( e, i || ! 1 ); 54 } ); 55 }; 56 class a { 57 constructor( t ) { 58 Object.defineProperty( this, 'pageX', { 59 enumerable: ! 0, 60 configurable: ! 0, 61 writable: ! 0, 62 value: void 0, 63 } ), 64 Object.defineProperty( this, 'pageY', { 65 enumerable: ! 0, 66 configurable: ! 0, 67 writable: ! 0, 68 value: void 0, 69 } ), 70 Object.defineProperty( this, 'clientX', { 71 enumerable: ! 0, 72 configurable: ! 0, 73 writable: ! 0, 74 value: void 0, 75 } ), 76 Object.defineProperty( this, 'clientY', { 77 enumerable: ! 0, 78 configurable: ! 0, 79 writable: ! 0, 80 value: void 0, 81 } ), 82 Object.defineProperty( this, 'id', { 83 enumerable: ! 0, 84 configurable: ! 0, 85 writable: ! 0, 86 value: void 0, 87 } ), 88 Object.defineProperty( this, 'time', { 89 enumerable: ! 0, 90 configurable: ! 0, 91 writable: ! 0, 92 value: void 0, 93 } ), 94 Object.defineProperty( this, 'nativePointer', { 95 enumerable: ! 0, 96 configurable: ! 0, 97 writable: ! 0, 98 value: void 0, 99 } ), 100 ( this.nativePointer = t ), 101 ( this.pageX = t.pageX ), 102 ( this.pageY = t.pageY ), 103 ( this.clientX = t.clientX ), 104 ( this.clientY = t.clientY ), 105 ( this.id = 106 self.Touch && t instanceof Touch ? t.identifier : -1 ), 107 ( this.time = Date.now() ); 108 } 109 } 110 const r = { passive: ! 1 }; 111 class l { 112 constructor( 113 t, 114 { start: e = () => ! 0, move: i = () => {}, end: n = () => {} } 115 ) { 116 Object.defineProperty( this, 'element', { 117 enumerable: ! 0, 118 configurable: ! 0, 119 writable: ! 0, 120 value: void 0, 121 } ), 122 Object.defineProperty( this, 'startCallback', { 123 enumerable: ! 0, 124 configurable: ! 0, 125 writable: ! 0, 126 value: void 0, 127 } ), 128 Object.defineProperty( this, 'moveCallback', { 129 enumerable: ! 0, 130 configurable: ! 0, 131 writable: ! 0, 132 value: void 0, 133 } ), 134 Object.defineProperty( this, 'endCallback', { 135 enumerable: ! 0, 136 configurable: ! 0, 137 writable: ! 0, 138 value: void 0, 139 } ), 140 Object.defineProperty( this, 'currentPointers', { 141 enumerable: ! 0, 142 configurable: ! 0, 143 writable: ! 0, 144 value: [], 145 } ), 146 Object.defineProperty( this, 'startPointers', { 147 enumerable: ! 0, 148 configurable: ! 0, 149 writable: ! 0, 150 value: [], 151 } ), 152 ( this.element = t ), 153 ( this.startCallback = e ), 154 ( this.moveCallback = i ), 155 ( this.endCallback = n ); 156 for ( const t of [ 157 'onPointerStart', 158 'onTouchStart', 159 'onMove', 160 'onTouchEnd', 161 'onPointerEnd', 162 'onWindowBlur', 163 ] ) { 164 this[ t ] = this[ t ].bind( this ); 165 } 166 this.element.addEventListener( 167 'mousedown', 168 this.onPointerStart, 169 r 170 ), 171 this.element.addEventListener( 172 'touchstart', 173 this.onTouchStart, 174 r 175 ), 176 this.element.addEventListener( 'touchmove', this.onMove, r ), 177 this.element.addEventListener( 'touchend', this.onTouchEnd ), 178 this.element.addEventListener( 'touchcancel', this.onTouchEnd ); 179 } 180 onPointerStart( t ) { 181 if ( ! t.buttons || 0 !== t.button ) { 182 return; 183 } 184 const e = new a( t ); 185 this.currentPointers.some( ( t ) => t.id === e.id ) || 186 ( this.triggerPointerStart( e, t ) && 187 ( window.addEventListener( 'mousemove', this.onMove ), 188 window.addEventListener( 'mouseup', this.onPointerEnd ), 189 window.addEventListener( 'blur', this.onWindowBlur ) ) ); 190 } 191 onTouchStart( t ) { 192 for ( const e of Array.from( t.changedTouches || [] ) ) { 193 this.triggerPointerStart( new a( e ), t ); 194 } 195 window.addEventListener( 'blur', this.onWindowBlur ); 196 } 197 onMove( t ) { 198 const e = this.currentPointers.slice(), 199 i = 200 'changedTouches' in t 201 ? Array.from( t.changedTouches || [] ).map( 202 ( t ) => new a( t ) 203 ) 204 : [ new a( t ) ], 205 n = []; 206 for ( const t of i ) { 207 const e = this.currentPointers.findIndex( 208 ( e ) => e.id === t.id 209 ); 210 e < 0 || ( n.push( t ), ( this.currentPointers[ e ] = t ) ); 211 } 212 n.length && this.moveCallback( t, this.currentPointers.slice(), e ); 213 } 214 onPointerEnd( t ) { 215 ( t.buttons > 0 && 0 !== t.button ) || 216 ( this.triggerPointerEnd( t, new a( t ) ), 217 window.removeEventListener( 'mousemove', this.onMove ), 218 window.removeEventListener( 'mouseup', this.onPointerEnd ), 219 window.removeEventListener( 'blur', this.onWindowBlur ) ); 220 } 221 onTouchEnd( t ) { 222 for ( const e of Array.from( t.changedTouches || [] ) ) { 223 this.triggerPointerEnd( t, new a( e ) ); 224 } 225 } 226 triggerPointerStart( t, e ) { 227 return ( 228 !! this.startCallback( e, t, this.currentPointers.slice() ) && 229 ( this.currentPointers.push( t ), 230 this.startPointers.push( t ), 231 ! 0 ) 232 ); 233 } 234 triggerPointerEnd( t, e ) { 235 const i = this.currentPointers.findIndex( ( t ) => t.id === e.id ); 236 i < 0 || 237 ( this.currentPointers.splice( i, 1 ), 238 this.startPointers.splice( i, 1 ), 239 this.endCallback( t, e, this.currentPointers.slice() ) ); 240 } 241 onWindowBlur() { 242 this.clear(); 243 } 244 clear() { 245 for ( ; this.currentPointers.length; ) { 246 const t = 247 this.currentPointers[ this.currentPointers.length - 1 ]; 248 this.currentPointers.splice( 249 this.currentPointers.length - 1, 250 1 251 ), 252 this.startPointers.splice( 253 this.currentPointers.length - 1, 254 1 255 ), 256 this.endCallback( 257 new Event( 'touchend', { 258 bubbles: ! 0, 259 cancelable: ! 0, 260 clientX: t.clientX, 261 clientY: t.clientY, 262 } ), 263 t, 264 this.currentPointers.slice() 265 ); 266 } 267 } 268 stop() { 269 this.element.removeEventListener( 270 'mousedown', 271 this.onPointerStart, 272 r 273 ), 274 this.element.removeEventListener( 275 'touchstart', 276 this.onTouchStart, 277 r 278 ), 279 this.element.removeEventListener( 'touchmove', this.onMove, r ), 280 this.element.removeEventListener( 'touchend', this.onTouchEnd ), 281 this.element.removeEventListener( 282 'touchcancel', 283 this.onTouchEnd 284 ), 285 window.removeEventListener( 'mousemove', this.onMove ), 286 window.removeEventListener( 'mouseup', this.onPointerEnd ), 287 window.removeEventListener( 'blur', this.onWindowBlur ); 288 } 289 } 290 function h( t, e ) { 291 return e 292 ? Math.sqrt( 293 Math.pow( e.clientX - t.clientX, 2 ) + 294 Math.pow( e.clientY - t.clientY, 2 ) 295 ) 296 : 0; 297 } 298 function c( t, e ) { 299 return e 300 ? { 301 clientX: ( t.clientX + e.clientX ) / 2, 302 clientY: ( t.clientY + e.clientY ) / 2, 303 } 304 : t; 305 } 306 const d = ( t ) => 307 'object' === typeof t && 308 null !== t && 309 t.constructor === Object && 310 '[object Object]' === Object.prototype.toString.call( t ), 311 u = ( t, ...e ) => { 312 const i = e.length; 313 for ( let n = 0; n < i; n++ ) { 314 const i = e[ n ] || {}; 315 Object.entries( i ).forEach( ( [ e, i ] ) => { 316 const n = Array.isArray( i ) ? [] : {}; 317 t[ e ] || Object.assign( t, { [ e ]: n } ), 318 d( i ) 319 ? Object.assign( t[ e ], u( n, i ) ) 320 : Array.isArray( i ) 321 ? Object.assign( t, { [ e ]: [ ...i ] } ) 322 : Object.assign( t, { [ e ]: i } ); 323 } ); 324 } 325 return t; 326 }, 327 g = function ( t, e ) { 328 return t 329 .split( '.' ) 330 .reduce( 331 ( t, e ) => ( 'object' === typeof t ? t[ e ] : void 0 ), 332 e 333 ); 334 }; 335 class f { 336 constructor( t = {} ) { 337 Object.defineProperty( this, 'options', { 338 enumerable: ! 0, 339 configurable: ! 0, 340 writable: ! 0, 341 value: t, 342 } ), 343 Object.defineProperty( this, 'events', { 344 enumerable: ! 0, 345 configurable: ! 0, 346 writable: ! 0, 347 value: new Map(), 348 } ), 349 this.setOptions( t ); 350 for ( const t of Object.getOwnPropertyNames( 351 Object.getPrototypeOf( this ) 352 ) ) { 353 t.startsWith( 'on' ) && 354 'function' === typeof this[ t ] && 355 ( this[ t ] = this[ t ].bind( this ) ); 356 } 357 } 358 setOptions( t ) { 359 this.options = t ? u( {}, this.constructor.defaults, t ) : {}; 360 for ( const [ t, e ] of Object.entries( 361 this.option( 'on' ) || {} 362 ) ) { 363 this.on( t, e ); 364 } 365 } 366 option( t, ...e ) { 367 let i = g( t, this.options ); 368 return ( 369 i && 370 'function' === typeof i && 371 ( i = i.call( this, this, ...e ) ), 372 i 373 ); 374 } 375 optionFor( t, e, i, ...n ) { 376 let s = g( e, t ); 377 let o; 378 'string' !== typeof ( o = s ) || 379 isNaN( o ) || 380 isNaN( parseFloat( o ) ) || 381 ( s = parseFloat( s ) ), 382 'true' === s && ( s = ! 0 ), 383 'false' === s && ( s = ! 1 ), 384 s && 385 'function' === typeof s && 386 ( s = s.call( this, this, t, ...n ) ); 387 const a = g( e, this.options ); 388 return ( 389 a && 'function' === typeof a 390 ? ( s = a.call( this, this, t, ...n, s ) ) 391 : void 0 === s && ( s = a ), 392 void 0 === s ? i : s 393 ); 394 } 395 cn( t ) { 396 const e = this.options.classes; 397 return ( e && e[ t ] ) || ''; 398 } 399 localize( t, e = [] ) { 400 t = String( t ).replace( /\{\{(\w+).?(\w+)?\}\}/g, ( t, e, i ) => { 401 let n = ''; 402 return ( 403 i 404 ? ( n = this.option( 405 `${ 406 e[ 0 ] + e.toLowerCase().substring( 1 ) 407 }.l10n.${ i }` 408 ) ) 409 : e && ( n = this.option( `l10n.${ e }` ) ), 410 n || ( n = t ), 411 n 412 ); 413 } ); 414 for ( let i = 0; i < e.length; i++ ) { 415 t = t.split( e[ i ][ 0 ] ).join( e[ i ][ 1 ] ); 416 } 417 return ( t = t.replace( /\{\{(.*?)\}\}/g, ( t, e ) => e ) ); 418 } 419 on( t, e ) { 420 let i = []; 421 'string' === typeof t 422 ? ( i = t.split( ' ' ) ) 423 : Array.isArray( t ) && ( i = t ), 424 this.events || ( this.events = new Map() ),
425 i.forEach( ( t ) => { 426 let i = this.events.get( t ); 427 i || ( this.events.set( t, [] ), ( i = [] ) ), 428 i.includes( e ) || i.push( e ), 429 this.events.set( t, i ); 430 } ); 431 } 432 off( t, e ) { 433 let i = []; 434 'string' === typeof t 435 ? ( i = t.split( ' ' ) ) 436 : Array.isArray( t ) && ( i = t ), 437 i.forEach( ( t ) => { 438 const i = this.events.get( t ); 439 if ( Array.isArray( i ) ) { 440 const t = i.indexOf( e ); 441 t > -1 && i.splice( t, 1 ); 442 } 443 } ); 444 } 445 emit( t, ...e ) { 446 [ ...( this.events.get( t ) || [] ) ].forEach( ( t ) => 447 t( this, ...e ) 448 ), 449 '*' !== t && this.emit( '*', t, ...e ); 450 } 451 } 452 Object.defineProperty( f, 'version', { 453 enumerable: ! 0, 454 configurable: ! 0, 455 writable: ! 0, 456 value: '5.0.36', 457 } ), 458 Object.defineProperty( f, 'defaults', { 459 enumerable: ! 0, 460 configurable: ! 0, 461 writable: ! 0, 462 value: {}, 463 } ); 464 class p extends f { 465 constructor( t = {} ) { 466 super( t ), 467 Object.defineProperty( this, 'plugins', { 468 enumerable: ! 0, 469 configurable: ! 0, 470 writable: ! 0, 471 value: {}, 472 } ); 473 } 474 attachPlugins( t = {} ) { 475 const e = new Map(); 476 for ( const [ i, n ] of Object.entries( t ) ) { 477 const t = this.option( i ), 478 s = this.plugins[ i ]; 479 s || ! 1 === t 480 ? s && ! 1 === t && ( s.detach(), delete this.plugins[ i ] ) 481 : e.set( i, new n( this, t || {} ) ); 482 } 483 for ( const [ t, i ] of e ) { 484 ( this.plugins[ t ] = i ), i.attach(); 485 } 486 } 487 detachPlugins( t ) { 488 t = t || Object.keys( this.plugins ); 489 for ( const e of t ) { 490 const t = this.plugins[ e ]; 491 t && t.detach(), delete this.plugins[ e ]; 492 } 493 return this.emit( 'detachPlugins' ), this; 494 } 495 } 496 let m; 497 ! ( function ( t ) { 498 ( t[ ( t.Init = 0 ) ] = 'Init' ), 499 ( t[ ( t.Error = 1 ) ] = 'Error' ), 500 ( t[ ( t.Ready = 2 ) ] = 'Ready' ), 501 ( t[ ( t.Panning = 3 ) ] = 'Panning' ), 502 ( t[ ( t.Mousemove = 4 ) ] = 'Mousemove' ), 503 ( t[ ( t.Destroy = 5 ) ] = 'Destroy' ); 504 } )( m || ( m = {} ) ); 505 const b = [ 'a', 'b', 'c', 'd', 'e', 'f' ], 506 v = { 507 content: null, 508 width: 'auto', 509 height: 'auto', 510 panMode: 'drag', 511 touch: ! 0, 512 dragMinThreshold: 3, 513 lockAxis: ! 1, 514 mouseMoveFactor: 1, 515 mouseMoveFriction: 0.12, 516 zoom: ! 0, 517 pinchToZoom: ! 0, 518 panOnlyZoomed: 'auto', 519 minScale: 1, 520 maxScale: 2, 521 friction: 0.25, 522 dragFriction: 0.35, 523 decelFriction: 0.05, 524 click: 'toggleZoom', 525 dblClick: ! 1, 526 wheel: 'zoom', 527 wheelLimit: 7, 528 spinner: ! 0, 529 bounds: 'auto', 530 infinite: ! 1, 531 rubberband: ! 0, 532 bounce: ! 0, 533 maxVelocity: 75, 534 transformParent: ! 1, 535 classes: { 536 content: 'f-panzoom__content', 537 isLoading: 'is-loading', 538 canZoomIn: 'can-zoom_in', 539 canZoomOut: 'can-zoom_out', 540 isDraggable: 'is-draggable', 541 isDragging: 'is-dragging', 542 inFullscreen: 'in-fullscreen', 543 htmlHasFullscreen: 'with-panzoom-in-fullscreen', 544 }, 545 l10n: { 546 PANUP: 'Move up', 547 PANDOWN: 'Move down', 548 PANLEFT: 'Move left', 549 PANRIGHT: 'Move right', 550 ZOOMIN: 'Zoom in', 551 ZOOMOUT: 'Zoom out', 552 TOGGLEZOOM: 'Toggle zoom level', 553 TOGGLE1TO1: 'Toggle zoom level', 554 ITERATEZOOM: 'Toggle zoom level', 555 ROTATECCW: 'Rotate counterclockwise', 556 ROTATECW: 'Rotate clockwise', 557 FLIPX: 'Flip horizontally', 558 FLIPY: 'Flip vertically', 559 FITX: 'Fit horizontally', 560 FITY: 'Fit vertically', 561 RESET: 'Reset', 562 TOGGLEFS: 'Toggle fullscreen', 563 }, 564 }, 565 y = '<circle cx="25" cy="25" r="20"></circle>', 566 w = 567 '<div class="f-spinner"><svg viewBox="0 0 50 50">' + 568 y + 569 y + 570 '</svg></div>', 571 x = ( t ) => { 572 if ( 573 ! t || 574 t === null || 575 typeof t !== 'object' || 576 ! ( 'nodeType' in t ) || 577 ( ! ( t instanceof Element ) && 578 ! ( t instanceof HTMLDivElement ) && 579 t.nodeType !== 1 ) 580 ) { 581 return false; 582 } 583 return true; 584 }, 585 P = ( t, e ) => { 586 t && 587 s( e ).forEach( ( e ) => { 588 t.classList.remove( e ); 589 } ); 590 }, 591 T = ( t, e ) => { 592 t && 593 s( e ).forEach( ( e ) => { 594 t.classList.add( e ); 595 } ); 596 }, 597 S = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 }, 598 M = 1e5, 599 O = 1e4, 600 E = 'mousemove', 601 k = 'drag', 602 z = 'content', 603 L = 'auto'; 604 let D = null, 605 C = null; 606 class R extends p { 607 get fits() { 608 return ( 609 this.contentRect.width - this.contentRect.fitWidth < 1 && 610 this.contentRect.height - this.contentRect.fitHeight < 1 611 ); 612 } 613 get isTouchDevice() { 614 return ( 615 null === C && 616 ( C = window.matchMedia( '(hover: none)' ).matches ), 617 C 618 ); 619 } 620 get isMobile() { 621 return ( 622 null === D && 623 ( D = /iPhone|iPad|iPod|Android/i.test( 624 navigator.userAgent 625 ) ), 626 D 627 ); 628 } 629 get panMode() { 630 return this.options.panMode !== E || this.isTouchDevice ? k : E; 631 } 632 get panOnlyZoomed() { 633 const t = this.options.panOnlyZoomed; 634 return t === L ? this.isTouchDevice : t; 635 } 636 get isInfinite() { 637 return this.option( 'infinite' ); 638 } 639 get angle() { 640 return ( 641 ( 180 * Math.atan2( this.current.b, this.current.a ) ) / 642 Math.PI || 0 643 ); 644 } 645 get targetAngle() { 646 return ( 647 ( 180 * Math.atan2( this.target.b, this.target.a ) ) / 648 Math.PI || 0 649 ); 650 } 651 get scale() { 652 const { a: t, b: e } = this.current; 653 return Math.sqrt( t * t + e * e ) || 1; 654 } 655 get targetScale() { 656 const { a: t, b: e } = this.target; 657 return Math.sqrt( t * t + e * e ) || 1; 658 } 659 get minScale() { 660 return this.option( 'minScale' ) || 1; 661 } 662 get fullScale() { 663 const { contentRect: t } = this; 664 return t.fullWidth / t.fitWidth || 1; 665 } 666 get maxScale() { 667 return this.fullScale * ( this.option( 'maxScale' ) || 1 ) || 1; 668 } 669 get coverScale() { 670 const { containerRect: t, contentRect: e } = this, 671 i = 672 Math.max( t.height / e.fitHeight, t.width / e.fitWidth ) || 673 1; 674 return Math.min( this.fullScale, i ); 675 } 676 get isScaling() { 677 return ( 678 Math.abs( this.targetScale - this.scale ) > 1e-5 && 679 ! this.isResting 680 ); 681 } 682 get isContentLoading() { 683 const t = this.content; 684 return !! ( t && t instanceof HTMLImageElement ) && ! t.complete; 685 } 686 get isResting() { 687 if ( this.isBouncingX || this.isBouncingY ) { 688 return ! 1; 689 } 690 for ( const t of b ) { 691 const e = 'e' == t || 'f' === t ? 1e-4 : 1e-5; 692 if ( Math.abs( this.target[ t ] - this.current[ t ] ) > e ) { 693 return ! 1; 694 } 695 } 696 return ! ( ! this.ignoreBounds && ! this.checkBounds().inBounds ); 697 } 698 constructor( t, e = {}, i = {} ) { 699 let s; 700 if ( 701 ( super( e ),
702 Object.defineProperty( this, 'pointerTracker', { 703 enumerable: ! 0, 704 configurable: ! 0, 705 writable: ! 0, 706 value: null, 707 } ), 708 Object.defineProperty( this, 'resizeObserver', { 709 enumerable: ! 0, 710 configurable: ! 0, 711 writable: ! 0, 712 value: null, 713 } ), 714 Object.defineProperty( this, 'updateTimer', { 715 enumerable: ! 0, 716 configurable: ! 0, 717 writable: ! 0, 718 value: null, 719 } ), 720 Object.defineProperty( this, 'clickTimer', { 721 enumerable: ! 0, 722 configurable: ! 0, 723 writable: ! 0, 724 value: null, 725 } ), 726 Object.defineProperty( this, 'rAF', { 727 enumerable: ! 0, 728 configurable: ! 0, 729 writable: ! 0, 730 value: null, 731 } ), 732 Object.defineProperty( this, 'isTicking', { 733 enumerable: ! 0, 734 configurable: ! 0, 735 writable: ! 0, 736 value: ! 1, 737 } ), 738 Object.defineProperty( this, 'ignoreBounds', { 739 enumerable: ! 0, 740 configurable: ! 0, 741 writable: ! 0, 742 value: ! 1, 743 } ), 744 Object.defineProperty( this, 'isBouncingX', { 745 enumerable: ! 0, 746 configurable: ! 0, 747 writable: ! 0, 748 value: ! 1, 749 } ), 750 Object.defineProperty( this, 'isBouncingY', { 751 enumerable: ! 0, 752 configurable: ! 0, 753 writable: ! 0, 754 value: ! 1, 755 } ), 756 Object.defineProperty( this, 'clicks', { 757 enumerable: ! 0, 758 configurable: ! 0, 759 writable: ! 0, 760 value: 0, 761 } ), 762 Object.defineProperty( this, 'trackingPoints', { 763 enumerable: ! 0, 764 configurable: ! 0, 765 writable: ! 0, 766 value: [], 767 } ), 768 Object.defineProperty( this, 'pwt', { 769 enumerable: ! 0, 770 configurable: ! 0, 771 writable: ! 0, 772 value: 0, 773 } ), 774 Object.defineProperty( this, 'cwd', { 775 enumerable: ! 0, 776 configurable: ! 0, 777 writable: ! 0, 778 value: 0, 779 } ), 780 Object.defineProperty( this, 'pmme', { 781 enumerable: ! 0, 782 configurable: ! 0, 783 writable: ! 0, 784 value: void 0, 785 } ), 786 Object.defineProperty( this, 'friction', { 787 enumerable: ! 0, 788 configurable: ! 0, 789 writable: ! 0, 790 value: 0, 791 } ), 792 Object.defineProperty( this, 'state', { 793 enumerable: ! 0, 794 configurable: ! 0, 795 writable: ! 0, 796 value: m.Init, 797 } ), 798 Object.defineProperty( this, 'isDragging', { 799 enumerable: ! 0, 800 configurable: ! 0, 801 writable: ! 0, 802 value: ! 1, 803 } ), 804 Object.defineProperty( this, 'container', { 805 enumerable: ! 0, 806 configurable: ! 0, 807 writable: ! 0, 808 value: void 0, 809 } ), 810 Object.defineProperty( this, 'content', { 811 enumerable: ! 0, 812 configurable: ! 0, 813 writable: ! 0, 814 value: void 0, 815 } ), 816 Object.defineProperty( this, 'spinner', { 817 enumerable: ! 0, 818 configurable: ! 0, 819 writable: ! 0, 820 value: null, 821 } ), 822 Object.defineProperty( this, 'containerRect', { 823 enumerable: ! 0, 824 configurable: ! 0, 825 writable: ! 0, 826 value: { 827 width: 0, 828 height: 0, 829 innerWidth: 0, 830 innerHeight: 0, 831 }, 832 } ), 833 Object.defineProperty( this, 'contentRect', { 834 enumerable: ! 0, 835 configurable: ! 0, 836 writable: ! 0, 837 value: { 838 top: 0, 839 right: 0, 840 bottom: 0, 841 left: 0, 842 fullWidth: 0, 843 fullHeight: 0, 844 fitWidth: 0, 845 fitHeight: 0, 846 width: 0, 847 height: 0, 848 }, 849 } ), 850 Object.defineProperty( this, 'dragStart', { 851 enumerable: ! 0, 852 configurable: ! 0, 853 writable: ! 0, 854 value: { x: 0, y: 0, top: 0, left: 0, time: 0 }, 855 } ), 856 Object.defineProperty( this, 'dragOffset', { 857 enumerable: ! 0, 858 configurable: ! 0, 859 writable: ! 0, 860 value: { x: 0, y: 0, time: 0 }, 861 } ), 862 Object.defineProperty( this, 'current', { 863 enumerable: ! 0, 864 configurable: ! 0, 865 writable: ! 0, 866 value: Object.assign( {}, S ), 867 } ), 868 Object.defineProperty( this, 'target', { 869 enumerable: ! 0, 870 configurable: ! 0, 871 writable: ! 0, 872 value: Object.assign( {}, S ), 873 } ), 874 Object.defineProperty( this, 'velocity', { 875 enumerable: ! 0, 876 configurable: ! 0, 877 writable: ! 0, 878 value: { a: 0, b: 0, c: 0, d: 0, e: 0, f: 0 }, 879 } ), 880 Object.defineProperty( this, 'lockedAxis', { 881 enumerable: ! 0, 882 configurable: ! 0, 883 writable: ! 0, 884 value: ! 1, 885 } ), 886 ! t ) 887 ) { 888 throw new Error( 'Container Element Not Found' ); 889 } 890 ( this.container = t ), 891 this.initContent(), 892 this.attachPlugins(
893 Object.assign( Object.assign( {}, R.Plugins ), i ) 894 ), 895 this.emit( 'attachPlugins' ), 896 this.emit( 'init' ); 897 const o = this.content; 898 if ( 899 ( o.addEventListener( 'load', this.onLoad ), 900 o.addEventListener( 'error', this.onError ), 901 this.isContentLoading ) 902 ) { 903 if ( this.option( 'spinner' ) ) { 904 t.classList.add( this.cn( 'isLoading' ) ); 905 const e = n( w ); 906 ! t.contains( o ) || 907 o.parentElement instanceof HTMLPictureElement 908 ? ( this.spinner = t.appendChild( e ) ) 909 : ( this.spinner = 910 ( null === ( s = o.parentElement ) || 911 void 0 === s 912 ? void 0 913 : s.insertBefore( e, o ) ) || null ); 914 } 915 this.emit( 'beforeLoad' ); 916 } else { 917 queueMicrotask( () => { 918 this.enable(); 919 } ); 920 } 921 } 922 initContent() { 923 const { container: t } = this, 924 e = this.cn( z ); 925 let i = this.option( z ) || t.querySelector( `.${ e }` ); 926 if ( 927 ( i || 928 ( ( i = 929 t.querySelector( 'img,picture' ) || 930 t.firstElementChild ), 931 i && T( i, e ) ), 932 i instanceof HTMLPictureElement && 933 ( i = i.querySelector( 'img' ) ), 934 ! i ) 935 ) { 936 throw new Error( 'No content found' ); 937 } 938 this.content = i; 939 } 940 onLoad() { 941 const { spinner: t, container: e, state: i } = this; 942 t && ( t.remove(), ( this.spinner = null ) ), 943 this.option( 'spinner' ) && 944 e.classList.remove( this.cn( 'isLoading' ) ), 945 this.emit( 'afterLoad' ), 946 i === m.Init ? this.enable() : this.updateMetrics(); 947 } 948 onError() { 949 this.state !== m.Destroy && 950 ( this.spinner && 951 ( this.spinner.remove(), ( this.spinner = null ) ), 952 this.stop(), 953 this.detachEvents(), 954 ( this.state = m.Error ), 955 this.emit( 'error' ) ); 956 } 957 getNextScale( t ) { 958 const { 959 fullScale: e, 960 targetScale: i, 961 coverScale: n, 962 maxScale: s, 963 minScale: o, 964 } = this; 965 let a = o; 966 switch ( t ) { 967 case 'toggleMax': 968 a = i - o < 0.5 * ( s - o ) ? s : o; 969 break; 970 case 'toggleCover': 971 a = i - o < 0.5 * ( n - o ) ? n : o; 972 break; 973 case 'toggleZoom': 974 a = i - o < 0.5 * ( e - o ) ? e : o; 975 break; 976 case 'iterateZoom': 977 const t = [ 1, e, s ].sort( ( t, e ) => t - e ), 978 r = t.findIndex( ( t ) => t > i + 1e-5 ); 979 a = t[ r ] || 1; 980 } 981 return a; 982 } 983 attachObserver() { 984 let t; 985 const e = () => { 986 const { container: t, containerRect: e } = this; 987 return ( 988 Math.abs( e.width - t.getBoundingClientRect().width ) > 989 0.1 || 990 Math.abs( e.height - t.getBoundingClientRect().height ) > 991 0.1 992 ); 993 }; 994 this.resizeObserver || 995 void 0 === window.ResizeObserver || 996 ( this.resizeObserver = new ResizeObserver( () => { 997 this.updateTimer || 998 ( e() 999 ? ( this.onResize(), 1000 this.isMobile && 1001 ( this.updateTimer = setTimeout( () => { 1002 e() && this.onResize(), 1003 ( this.updateTimer = null ); 1004 }, 500 ) ) ) 1005 : this.updateTimer && 1006 ( clearTimeout( this.updateTimer ), 1007 ( this.updateTimer = null ) ) ); 1008 } ) ), 1009 null === ( t = this.resizeObserver ) || 1010 void 0 === t || 1011 t.observe( this.container ); 1012 } 1013 detachObserver() { 1014 let t; 1015 null === ( t = this.resizeObserver ) || 1016 void 0 === t || 1017 t.disconnect(); 1018 } 1019 attachEvents() { 1020 const { container: t } = this; 1021 t.addEventListener( 'click', this.onClick, { 1022 passive: ! 1, 1023 capture: ! 1, 1024 } ), 1025 t.addEventListener( 'wheel', this.onWheel, { passive: ! 1 } ), 1026 ( this.pointerTracker = new l( t, { 1027 start: this.onPointerDown, 1028 move: this.onPointerMove, 1029 end: this.onPointerUp, 1030 } ) ), 1031 document.addEventListener( E, this.onMouseMove ); 1032 } 1033 detachEvents() { 1034 let t; 1035 const { container: e } = this; 1036 e.removeEventListener( 'click', this.onClick, { 1037 passive: ! 1, 1038 capture: ! 1, 1039 } ), 1040 e.removeEventListener( 'wheel', this.onWheel, { 1041 passive: ! 1, 1042 } ), 1043 null === ( t = this.pointerTracker ) || 1044 void 0 === t || 1045 t.stop(), 1046 ( this.pointerTracker = null ), 1047 document.removeEventListener( E, this.onMouseMove ), 1048 document.removeEventListener( 'keydown', this.onKeydown, ! 0 ), 1049 this.clickTimer && 1050 ( clearTimeout( this.clickTimer ), 1051 ( this.clickTimer = null ) ), 1052 this.updateTimer && 1053 ( clearTimeout( this.updateTimer ), 1054 ( this.updateTimer = null ) ); 1055 } 1056 animate() { 1057 this.setTargetForce(); 1058 const t = this.friction, 1059 e = this.option( 'maxVelocity' ); 1060 for ( const i of b ) { 1061 t 1062 ? ( ( this.velocity[ i ] *= 1 - t ), 1063 e && 1064 ! this.isScaling && 1065 ( this.velocity[ i ] = Math.max( 1066 Math.min( this.velocity[ i ], e ), 1067 -1 * e 1068 ) ), 1069 ( this.current[ i ] += this.velocity[ i ] ) ) 1070 : ( this.current[ i ] = this.target[ i ] ); 1071 } 1072 this.setTransform(), 1073 this.setEdgeForce(), 1074 ! this.isResting || this.isDragging 1075 ? ( this.rAF = requestAnimationFrame( () => 1076 this.animate() 1077 ) ) 1078 : this.stop( 'current' ); 1079 } 1080 setTargetForce() { 1081 for ( const t of b ) { 1082 ( 'e' === t && this.isBouncingX ) || 1083 ( 'f' === t && this.isBouncingY ) || 1084 ( this.velocity[ t ] = 1085 ( 1 / ( 1 - this.friction ) - 1 ) * 1086 ( this.target[ t ] - this.current[ t ] ) ); 1087 } 1088 } 1089 checkBounds( t = 0, e = 0 ) { 1090 const { current: i } = this, 1091 n = i.e + t, 1092 s = i.f + e, 1093 o = this.getBounds(), 1094 { x: a, y: r } = o, 1095 l = a.min, 1096 h = a.max, 1097 c = r.min, 1098 d = r.max; 1099 let u = 0, 1100 g = 0; 1101 return ( 1102 l !== 1 / 0 && n < l 1103 ? ( u = l - n ) 1104 : h !== 1 / 0 && n > h && ( u = h - n ), 1105 c !== 1 / 0 && s < c 1106 ? ( g = c - s ) 1107 : d !== 1 / 0 && s > d && ( g = d - s ), 1108 Math.abs( u ) < 1e-4 && ( u = 0 ), 1109 Math.abs( g ) < 1e-4 && ( g = 0 ), 1110 Object.assign( Object.assign( {}, o ), { 1111 xDiff: u, 1112 yDiff: g, 1113 inBounds: ! u && ! g, 1114 } ) 1115 ); 1116 } 1117 clampTargetBounds() { 1118 const { target: t } = this, 1119 { x: e, y: i } = this.getBounds(); 1120 e.min !== 1 / 0 && ( t.e = Math.max( t.e, e.min ) ), 1121 e.max !== 1 / 0 && ( t.e = Math.min( t.e, e.max ) ), 1122 i.min !== 1 / 0 && ( t.f = Math.max( t.f, i.min ) ), 1123 i.max !== 1 / 0 && ( t.f = Math.min( t.f, i.max ) ); 1124 } 1125 calculateContentDim( t = this.current ) { 1126 const { content: e, contentRect: i } = this, 1127 { fitWidth: n, fitHeight: s, fullWidth: o, fullHeight: a } = i; 1128 let r = o, 1129 l = a; 1130 if ( this.option( 'zoom' ) || 0 !== this.angle ) { 1131 const i = 1132 ! ( e instanceof HTMLImageElement ) && 1133 ( 'none' === window.getComputedStyle( e ).maxWidth || 1134 'none' === window.getComputedStyle( e ).maxHeight ), 1135 h = i ? o : n, 1136 c = i ? a : s, 1137 d = this.getMatrix( t ), 1138 u = new DOMPoint( 0, 0 ).matrixTransform( d ), 1139 g = new DOMPoint( 0 + h, 0 ).matrixTransform( d ), 1140 f = new DOMPoint( 0 + h, 0 + c ).matrixTransform( d ), 1141 p = new DOMPoint( 0, 0 + c ).matrixTransform( d ), 1142 m = Math.abs( f.x - u.x ), 1143 b = Math.abs( f.y - u.y ), 1144 v = Math.abs( p.x - g.x ), 1145 y = Math.abs( p.y - g.y ); 1146 ( r = Math.max( m, v ) ), ( l = Math.max( b, y ) ); 1147 } 1148 return { contentWidth: r, contentHeight: l }; 1149 } 1150 setEdgeForce() { 1151 if ( 1152 this.ignoreBounds || 1153 this.isDragging || 1154 this.panMode === E || 1155 this.targetScale < this.scale 1156 ) { 1157 return ( 1158 ( this.isBouncingX = ! 1 ), void ( this.isBouncingY = ! 1 ) 1159 ); 1160 } 1161 const { target: t } = this, 1162 { x: e, y: i, xDiff: n, yDiff: s } = this.checkBounds(); 1163 const o = this.option( 'maxVelocity' ); 1164 let a = this.velocity.e, 1165 r = this.velocity.f; 1166 0 !== n 1167 ? ( ( this.isBouncingX = ! 0 ), 1168 n * a <= 0 1169 ? ( a += 0.14 * n ) 1170 : ( ( a = 0.14 * n ), 1171 e.min !== 1 / 0 && 1172 ( this.target.e = Math.max( t.e, e.min ) ), 1173 e.max !== 1 / 0 && 1174 ( this.target.e = Math.min( t.e, e.max ) ) ), 1175 o && ( a = Math.max( Math.min( a, o ), -1 * o ) ) ) 1176 : ( this.isBouncingX = ! 1 ), 1177 0 !== s 1178 ? ( ( this.isBouncingY = ! 0 ), 1179 s * r <= 0 1180 ? ( r += 0.14 * s ) 1181 : ( ( r = 0.14 * s ), 1182 i.min !== 1 / 0 && 1183 ( this.target.f = Math.max( t.f, i.min ) ), 1184 i.max !== 1 / 0 && 1185 ( this.target.f = Math.min( 1186 t.f, 1187 i.max 1188 ) ) ), 1189 o && ( r = Math.max( Math.min( r, o ), -1 * o ) ) ) 1190 : ( this.isBouncingY = ! 1 ), 1191 this.isBouncingX && ( this.velocity.e = a ), 1192 this.isBouncingY && ( this.velocity.f = r ); 1193 } 1194 enable() { 1195 const { content: t } = this, 1196 e = new DOMMatrixReadOnly( 1197 window.getComputedStyle( t ).transform 1198 ); 1199 for ( const t of b ) { 1200 this.current[ t ] = this.target[ t ] = e[ t ]; 1201 } 1202 this.updateMetrics(), 1203 this.attachObserver(), 1204 this.attachEvents(), 1205 ( this.state = m.Ready ),
1206 this.emit( 'ready' ); 1207 } 1208 onClick( t ) { 1209 let e; 1210 'click' === t.type && 1211 0 === t.detail && 1212 ( ( this.dragOffset.x = 0 ), ( this.dragOffset.y = 0 ) ), 1213 this.isDragging && 1214 ( null === ( e = this.pointerTracker ) || 1215 void 0 === e || 1216 e.clear(), 1217 ( this.trackingPoints = [] ), 1218 this.startDecelAnim() ); 1219 const i = t.target; 1220 if ( ! i || t.defaultPrevented ) { 1221 return; 1222 } 1223 if ( i.hasAttribute( 'disabled' ) ) { 1224 return t.preventDefault(), void t.stopPropagation(); 1225 } 1226 if ( 1227 ( () => { 1228 const t = window.getSelection(); 1229 return t && 'Range' === t.type; 1230 } )() && 1231 ! i.closest( 'button' ) 1232 ) { 1233 return; 1234 } 1235 const n = i.closest( '[data-panzoom-action]' ), 1236 s = i.closest( '[data-panzoom-change]' ), 1237 o = n || s, 1238 a = o && x( o ) ? o.dataset : null; 1239 if ( a ) { 1240 const e = a.panzoomChange, 1241 i = a.panzoomAction; 1242 if ( ( ( e || i ) && t.preventDefault(), e ) ) { 1243 let t = {}; 1244 try { 1245 t = JSON.parse( e ); 1246 } catch ( t ) { 1247 console && 1248 console.warn( 'The given data was not valid JSON' ); 1249 } 1250 return void this.applyChange( t ); 1251 } 1252 if ( i ) { 1253 return void ( this[ i ] && this[ i ]() ); 1254 } 1255 } 1256 if ( 1257 Math.abs( this.dragOffset.x ) > 3 || 1258 Math.abs( this.dragOffset.y ) > 3 1259 ) { 1260 return t.preventDefault(), void t.stopPropagation(); 1261 } 1262 if ( i.closest( '[data-fancybox]' ) ) { 1263 return; 1264 } 1265 const r = this.content.getBoundingClientRect(), 1266 l = this.dragStart; 1267 if ( 1268 l.time && 1269 ! this.canZoomOut() && 1270 ( Math.abs( r.x - l.x ) > 2 || Math.abs( r.y - l.y ) > 2 ) 1271 ) { 1272 return; 1273 } 1274 this.dragStart.time = 0; 1275 const h = ( e ) => { 1276 this.option( 'zoom', t ) && 1277 e && 1278 'string' === typeof e && 1279 /(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test( 1280 e 1281 ) && 1282 'function' === typeof this[ e ] && 1283 ( t.preventDefault(), this[ e ]( { event: t } ) ); 1284 }, 1285 c = this.option( 'click', t ), 1286 d = this.option( 'dblClick', t ); 1287 d 1288 ? ( this.clicks++, 1289 1 == this.clicks && 1290 ( this.clickTimer = setTimeout( () => { 1291 1 === this.clicks 1292 ? ( this.emit( 'click', t ), 1293 ! t.defaultPrevented && c && h( c ) ) 1294 : ( this.emit( 'dblClick', t ), 1295 t.defaultPrevented || h( d ) ), 1296 ( this.clicks = 0 ), 1297 ( this.clickTimer = null ); 1298 }, 350 ) ) ) 1299 : ( this.emit( 'click', t ), 1300 ! t.defaultPrevented && c && h( c ) ); 1301 } 1302 addTrackingPoint( t ) { 1303 const e = this.trackingPoints.filter( 1304 ( t ) => t.time > Date.now() - 100 1305 ); 1306 e.push( t ), ( this.trackingPoints = e ); 1307 } 1308 onPointerDown( t, e, i ) { 1309 let n; 1310 if ( ! 1 === this.option( 'touch', t ) ) { 1311 return ! 1; 1312 } 1313 ( this.pwt = 0 ), 1314 ( this.dragOffset = { x: 0, y: 0, time: 0 } ), 1315 ( this.trackingPoints = [] ); 1316 const s = this.content.getBoundingClientRect(); 1317 if ( 1318 ( ( this.dragStart = { 1319 x: s.x, 1320 y: s.y, 1321 top: s.top, 1322 left: s.left, 1323 time: Date.now(), 1324 } ), 1325 this.clickTimer ) 1326 ) { 1327 return ! 1; 1328 } 1329 if ( this.panMode === E && this.targetScale > 1 ) { 1330 return t.preventDefault(), t.stopPropagation(), ! 1; 1331 } 1332 const o = t.composedPath()[ 0 ]; 1333 if ( ! i.length ) { 1334 if ( 1335 [ 1336 'TEXTAREA', 1337 'OPTION', 1338 'INPUT', 1339 'SELECT', 1340 'VIDEO', 1341 'IFRAME', 1342 ].includes( o.nodeName ) || 1343 o.closest( 1344 '[contenteditable],[data-selectable],[data-draggable],[data-clickable],[data-panzoom-change],[data-panzoom-action]' 1345 ) 1346 ) { 1347 return ! 1; 1348 } 1349 null === ( n = window.getSelection() ) || 1350 void 0 === n || 1351 n.removeAllRanges(); 1352 } 1353 if ( 'mousedown' === t.type ) { 1354 [ 'A', 'BUTTON' ].includes( o.nodeName ) || t.preventDefault(); 1355 } else if ( Math.abs( this.velocity.a ) > 0.3 ) { 1356 return ! 1; 1357 } 1358 return ( 1359 ( this.target.e = this.current.e ), 1360 ( this.target.f = this.current.f ), 1361 this.stop(), 1362 this.isDragging || 1363 ( ( this.isDragging = ! 0 ), 1364 this.addTrackingPoint( e ),
1365 this.emit( 'touchStart', t ) ), 1366 ! 0 1367 ); 1368 } 1369 onPointerMove( t, n, s ) { 1370 if ( ! 1 === this.option( 'touch', t ) ) { 1371 return; 1372 } 1373 if ( ! this.isDragging ) { 1374 return; 1375 } 1376 if ( 1377 n.length < 2 && 1378 this.panOnlyZoomed && 1379 e( this.targetScale ) <= e( this.minScale ) 1380 ) { 1381 return; 1382 } 1383 if ( ( this.emit( 'touchMove', t ), t.defaultPrevented ) ) { 1384 return; 1385 } 1386 this.addTrackingPoint( n[ 0 ] ); 1387 const { content: o } = this, 1388 a = c( s[ 0 ], s[ 1 ] ), 1389 r = c( n[ 0 ], n[ 1 ] ); 1390 let l = 0, 1391 d = 0; 1392 if ( n.length > 1 ) { 1393 const t = o.getBoundingClientRect(); 1394 ( l = a.clientX - t.left - 0.5 * t.width ), 1395 ( d = a.clientY - t.top - 0.5 * t.height ); 1396 } 1397 const u = h( s[ 0 ], s[ 1 ] ), 1398 g = h( n[ 0 ], n[ 1 ] ); 1399 let f = u ? g / u : 1, 1400 p = r.clientX - a.clientX, 1401 m = r.clientY - a.clientY; 1402 ( this.dragOffset.x += p ), 1403 ( this.dragOffset.y += m ), 1404 ( this.dragOffset.time = Date.now() - this.dragStart.time ); 1405 let b = 1406 e( this.targetScale ) === e( this.minScale ) && 1407 this.option( 'lockAxis' ); 1408 if ( b && ! this.lockedAxis ) { 1409 if ( 'xy' === b || 'y' === b || 'touchmove' === t.type ) { 1410 if ( 1411 Math.abs( this.dragOffset.x ) < 6 && 1412 Math.abs( this.dragOffset.y ) < 6 1413 ) { 1414 return void t.preventDefault(); 1415 } 1416 const e = Math.abs( 1417 ( 180 * 1418 Math.atan2( 1419 this.dragOffset.y, 1420 this.dragOffset.x 1421 ) ) / 1422 Math.PI 1423 ); 1424 ( this.lockedAxis = e > 45 && e < 135 ? 'y' : 'x' ), 1425 ( this.dragOffset.x = 0 ), 1426 ( this.dragOffset.y = 0 ), 1427 ( p = 0 ), 1428 ( m = 0 ); 1429 } else { 1430 this.lockedAxis = b; 1431 } 1432 } 1433 if ( 1434 ( i( t.target, this.content ) && 1435 ( ( b = 'x' ), ( this.dragOffset.y = 0 ) ), 1436 b && 1437 'xy' !== b && 1438 this.lockedAxis !== b && 1439 e( this.targetScale ) === e( this.minScale ) ) 1440 ) { 1441 return; 1442 } 1443 t.cancelable && t.preventDefault(), 1444 this.container.classList.add( this.cn( 'isDragging' ) ); 1445 const v = this.checkBounds( p, m ); 1446 this.option( 'rubberband' ) 1447 ? ( 'x' !== this.isInfinite && 1448 ( ( v.xDiff > 0 && p < 0 ) || 1449 ( v.xDiff < 0 && p > 0 ) ) && 1450 ( p *= Math.max( 1451 0, 1452 0.5 - 1453 Math.abs( 1454 ( 0.75 / this.contentRect.fitWidth ) * 1455 v.xDiff 1456 ) 1457 ) ), 1458 'y' !== this.isInfinite && 1459 ( ( v.yDiff > 0 && m < 0 ) || 1460 ( v.yDiff < 0 && m > 0 ) ) && 1461 ( m *= Math.max( 1462 0, 1463 0.5 - 1464 Math.abs( 1465 ( 0.75 / this.contentRect.fitHeight ) * 1466 v.yDiff 1467 ) 1468 ) ) ) 1469 : ( v.xDiff && ( p = 0 ), v.yDiff && ( m = 0 ) ); 1470 const y = this.targetScale, 1471 w = this.minScale, 1472 x = this.maxScale; 1473 y < 0.5 * w && ( f = Math.max( f, w ) ), 1474 y > 1.5 * x && ( f = Math.min( f, x ) ), 1475 'y' === this.lockedAxis && e( y ) === e( w ) && ( p = 0 ), 1476 'x' === this.lockedAxis && e( y ) === e( w ) && ( m = 0 ), 1477 this.applyChange( { 1478 originX: l, 1479 originY: d, 1480 panX: p, 1481 panY: m, 1482 scale: f, 1483 friction: this.option( 'dragFriction' ), 1484 ignoreBounds: ! 0, 1485 } ); 1486 } 1487 onPointerUp( t, e, n ) { 1488 if ( n.length ) { 1489 return ( 1490 ( this.dragOffset.x = 0 ), 1491 ( this.dragOffset.y = 0 ), 1492 void ( this.trackingPoints = [] ) 1493 ); 1494 } 1495 this.container.classList.remove( this.cn( 'isDragging' ) ), 1496 this.isDragging && 1497 ( this.addTrackingPoint( e ), 1498 this.panOnlyZoomed && 1499 this.contentRect.width - this.contentRect.fitWidth < 1500 1 && 1501 this.contentRect.height - this.contentRect.fitHeight < 1502 1 && 1503 ( this.trackingPoints = [] ), 1504 i( t.target, this.content ) && 1505 'y' === this.lockedAxis && 1506 ( this.trackingPoints = [] ), 1507 this.emit( 'touchEnd', t ), 1508 ( this.isDragging = ! 1 ), 1509 ( this.lockedAxis = ! 1 ), 1510 this.state !== m.Destroy && 1511 ( t.defaultPrevented || this.startDecelAnim() ) ); 1512 } 1513 startDecelAnim() { 1514 let t; 1515 const i = this.isScaling; 1516 this.rAF && 1517 ( cancelAnimationFrame( this.rAF ), ( this.rAF = null ) ), 1518 ( this.isBouncingX = ! 1 ), 1519 ( this.isBouncingY = ! 1 ); 1520 for ( const t of b ) { 1521 this.velocity[ t ] = 0; 1522 } 1523 ( this.target.e = this.current.e ), 1524 ( this.target.f = this.current.f ), 1525 P( this.container, 'is-scaling' ), 1526 P( this.container, 'is-animating' ), 1527 ( this.isTicking = ! 1 ); 1528 const { trackingPoints: n } = this, 1529 s = n[ 0 ], 1530 o = n[ n.length - 1 ]; 1531 let a = 0, 1532 r = 0, 1533 l = 0; 1534 o && 1535 s && 1536 ( ( a = o.clientX - s.clientX ), 1537 ( r = o.clientY - s.clientY ), 1538 ( l = o.time - s.time ) ); 1539 const h =
1540 ( null === ( t = window.visualViewport ) || void 0 === t 1541 ? void 0 1542 : t.scale ) || 1; 1543 1 !== h && ( ( a *= h ), ( r *= h ) ); 1544 let c = 0, 1545 d = 0, 1546 u = 0, 1547 g = 0, 1548 f = this.option( 'decelFriction' ); 1549 const p = this.targetScale; 1550 if ( l > 0 ) { 1551 ( u = Math.abs( a ) > 3 ? a / ( l / 30 ) : 0 ), 1552 ( g = Math.abs( r ) > 3 ? r / ( l / 30 ) : 0 ); 1553 const t = this.option( 'maxVelocity' ); 1554 t && 1555 ( ( u = Math.max( Math.min( u, t ), -1 * t ) ), 1556 ( g = Math.max( Math.min( g, t ), -1 * t ) ) ); 1557 } 1558 u && ( c = u / ( 1 / ( 1 - f ) - 1 ) ), 1559 g && ( d = g / ( 1 / ( 1 - f ) - 1 ) ), 1560 ( 'y' === this.option( 'lockAxis' ) || 1561 ( 'xy' === this.option( 'lockAxis' ) && 1562 'y' === this.lockedAxis && 1563 e( p ) === this.minScale ) ) && 1564 ( c = u = 0 ), 1565 ( 'x' === this.option( 'lockAxis' ) || 1566 ( 'xy' === this.option( 'lockAxis' ) && 1567 'x' === this.lockedAxis && 1568 e( p ) === this.minScale ) ) && 1569 ( d = g = 0 ); 1570 const m = this.dragOffset.x, 1571 v = this.dragOffset.y, 1572 y = this.option( 'dragMinThreshold' ) || 0; 1573 Math.abs( m ) < y && 1574 Math.abs( v ) < y && 1575 ( ( c = d = 0 ), ( u = g = 0 ) ), 1576 ( ( this.option( 'zoom' ) && 1577 ( p < this.minScale - 1e-5 || 1578 p > this.maxScale + 1e-5 ) ) || 1579 ( i && ! c && ! d ) ) && 1580 ( f = 0.35 ), 1581 this.applyChange( { panX: c, panY: d, friction: f } ), 1582 this.emit( 'decel', u, g, m, v ); 1583 } 1584 onWheel( t ) { 1585 const e = [ -t.deltaX || 0, -t.deltaY || 0, -t.detail || 0 ].reduce( 1586 function ( t, e ) { 1587 return Math.abs( e ) > Math.abs( t ) ? e : t; 1588 } 1589 ); 1590 const i = Math.max( -1, Math.min( 1, e ) ); 1591 if ( ( this.emit( 'wheel', t, i ), this.panMode === E ) ) { 1592 return; 1593 } 1594 if ( t.defaultPrevented ) { 1595 return; 1596 } 1597 const n = this.option( 'wheel' ); 1598 'pan' === n 1599 ? ( t.preventDefault(), 1600 ( this.panOnlyZoomed && ! this.canZoomOut() ) || 1601 this.applyChange( { 1602 panX: 2 * -t.deltaX, 1603 panY: 2 * -t.deltaY, 1604 bounce: ! 1, 1605 } ) ) 1606 : 'zoom' === n && 1607 ! 1 !== this.option( 'zoom' ) && 1608 this.zoomWithWheel( t ); 1609 } 1610 onMouseMove( t ) { 1611 this.panWithMouse( t ); 1612 } 1613 onKeydown( t ) { 1614 'Escape' === t.key && this.toggleFS(); 1615 } 1616 onResize() { 1617 this.updateMetrics(), 1618 this.checkBounds().inBounds || this.requestTick(); 1619 } 1620 setTransform() { 1621 this.emit( 'beforeTransform' ); 1622 const { current: t, target: i, content: n, contentRect: s } = this, 1623 o = Object.assign( {}, S ); 1624 for ( const n of b ) { 1625 const s = 'e' == n || 'f' === n ? O : M; 1626 ( o[ n ] = e( t[ n ], s ) ), 1627 Math.abs( i[ n ] - t[ n ] ) < 1628 ( 'e' == n || 'f' === n ? 0.51 : 0.001 ) && 1629 ( t[ n ] = i[ n ] ); 1630 } 1631 let { a: a, b: r, c: l, d: h, e: c, f: d } = o, 1632 u = `matrix(${ a }, ${ r }, ${ l }, ${ h }, ${ c }, ${ d })`, 1633 g = 1634 n.parentElement instanceof HTMLPictureElement 1635 ? n.parentElement 1636 : n; 1637 if ( 1638 ( this.option( 'transformParent' ) && 1639 ( g = g.parentElement || g ), 1640 g.style.transform === u ) 1641 ) { 1642 return; 1643 } 1644 g.style.transform = u; 1645 const { contentWidth: f, contentHeight: p } = 1646 this.calculateContentDim(); 1647 ( s.width = f ), ( s.height = p ), this.emit( 'afterTransform' ); 1648 } 1649 updateMetrics( t = ! 1 ) { 1650 let i; 1651 if ( ! this || this.state === m.Destroy ) { 1652 return; 1653 } 1654 if ( this.isContentLoading ) { 1655 return; 1656 } 1657 const n = Math.max( 1658 1, 1659 ( null === ( i = window.visualViewport ) || void 0 === i 1660 ? void 0 1661 : i.scale ) || 1 1662 ), 1663 { container: s, content: o } = this, 1664 a = o instanceof HTMLImageElement, 1665 r = s.getBoundingClientRect(), 1666 l = getComputedStyle( this.container ); 1667 const h = r.width * n, 1668 c = r.height * n; 1669 const d = 1670 parseFloat( l.paddingTop ) + parseFloat( l.paddingBottom ), 1671 u = 1672 h - 1673 ( parseFloat( l.paddingLeft ) + 1674 parseFloat( l.paddingRight ) ), 1675 g = c - d; 1676 this.containerRect = { 1677 width: h, 1678 height: c, 1679 innerWidth: u, 1680 innerHeight: g, 1681 }; 1682 const f = 1683 parseFloat( o.dataset.width || '' ) || 1684 ( ( t ) => { 1685 let e = 0; 1686 return ( 1687 ( e = 1688 t instanceof HTMLImageElement
1689 ? t.naturalWidth 1690 : t instanceof SVGElement 1691 ? t.width.baseVal.value 1692 : Math.max( 1693 t.offsetWidth, 1694 t.scrollWidth 1695 ) ), 1696 e || 0 1697 ); 1698 } )( o ), 1699 p = 1700 parseFloat( o.dataset.height || '' ) || 1701 ( ( t ) => { 1702 let e = 0; 1703 return ( 1704 ( e = 1705 t instanceof HTMLImageElement 1706 ? t.naturalHeight 1707 : t instanceof SVGElement 1708 ? t.height.baseVal.value 1709 : Math.max( 1710 t.offsetHeight, 1711 t.scrollHeight 1712 ) ), 1713 e || 0 1714 ); 1715 } )( o ); 1716 let b = this.option( 'width', f ) || L, 1717 v = this.option( 'height', p ) || L; 1718 const y = b === L, 1719 w = v === L; 1720 'number' !== typeof b && ( b = f ), 1721 'number' !== typeof v && ( v = p ), 1722 y && ( b = f * ( v / p ) ), 1723 w && ( v = p / ( f / b ) ); 1724 let x = 1725 o.parentElement instanceof HTMLPictureElement 1726 ? o.parentElement 1727 : o; 1728 this.option( 'transformParent' ) && ( x = x.parentElement || x ); 1729 const P = x.getAttribute( 'style' ) || ''; 1730 x.style.setProperty( 'transform', 'none', 'important' ), 1731 a && ( ( x.style.width = '' ), ( x.style.height = '' ) ), 1732 x.offsetHeight; 1733 const T = o.getBoundingClientRect(); 1734 let S = T.width * n, 1735 M = T.height * n, 1736 O = S, 1737 E = M; 1738 ( S = Math.min( S, b ) ), 1739 ( M = Math.min( M, v ) ), 1740 a 1741 ? ( { width: S, height: M } = ( ( t, e, i, n ) => { 1742 const s = i / t, 1743 o = n / e, 1744 a = Math.min( s, o ); 1745 return { width: ( t *= a ), height: ( e *= a ) }; 1746 } )( b, v, S, M ) ) 1747 : ( ( S = Math.min( S, b ) ), ( M = Math.min( M, v ) ) ); 1748 const k = 0.5 * ( E - M ), 1749 z = 0.5 * ( O - S ); 1750 ( this.contentRect = Object.assign( 1751 Object.assign( {}, this.contentRect ), 1752 { 1753 top: T.top - r.top + k, 1754 bottom: r.bottom - T.bottom + k, 1755 left: T.left - r.left + z, 1756 right: r.right - T.right + z, 1757 fitWidth: S, 1758 fitHeight: M, 1759 width: S, 1760 height: M, 1761 fullWidth: b, 1762 fullHeight: v, 1763 } 1764 ) ), 1765 ( x.style.cssText = P ), 1766 a && 1767 ( ( x.style.width = `${ S }px` ), 1768 ( x.style.height = `${ M }px` ) ), 1769 this.setTransform(), 1770 ! 0 !== t && this.emit( 'refresh' ), 1771 this.ignoreBounds || 1772 ( e( this.targetScale ) < e( this.minScale ) 1773 ? this.zoomTo( this.minScale, { friction: 0 } ) 1774 : this.targetScale > this.maxScale 1775 ? this.zoomTo( this.maxScale, { friction: 0 } ) 1776 : this.state === m.Init || 1777 this.checkBounds().inBounds || 1778 this.requestTick() ), 1779 this.updateControls(); 1780 } 1781 calculateBounds() { 1782 const { contentWidth: t, contentHeight: i } = 1783 this.calculateContentDim( this.target ), 1784 { targetScale: n, lockedAxis: s } = this, 1785 { fitWidth: o, fitHeight: a } = this.contentRect; 1786 let r = 0, 1787 l = 0, 1788 h = 0, 1789 c = 0; 1790 const d = this.option( 'infinite' ); 1791 if ( ! 0 === d || ( s && d === s ) ) { 1792 ( r = -1 / 0 ), ( h = 1 / 0 ), ( l = -1 / 0 ), ( c = 1 / 0 ); 1793 } else { 1794 let { containerRect: s, contentRect: d } = this, 1795 u = e( o * n, O ), 1796 g = e( a * n, O ), 1797 { innerWidth: f, innerHeight: p } = s; 1798 if ( 1799 ( s.width === u && ( f = s.width ), 1800 s.width === g && ( p = s.height ), 1801 t > f ) 1802 ) { 1803 ( h = 0.5 * ( t - f ) ), ( r = -1 * h ); 1804 const e = 0.5 * ( d.right - d.left ); 1805 ( r += e ), ( h += e ); 1806 } 1807 if ( 1808 ( o > f && 1809 t < f && 1810 ( ( r -= 0.5 * ( o - f ) ), ( h -= 0.5 * ( o - f ) ) ), 1811 i > p ) 1812 ) { 1813 ( c = 0.5 * ( i - p ) ), ( l = -1 * c ); 1814 const t = 0.5 * ( d.bottom - d.top ); 1815 ( l += t ), ( c += t ); 1816 } 1817 a > p && 1818 i < p && 1819 ( ( r -= 0.5 * ( a - p ) ), ( h -= 0.5 * ( a - p ) ) ); 1820 } 1821 return { x: { min: r, max: h }, y: { min: l, max: c } }; 1822 } 1823 getBounds() { 1824 const t = this.option( 'bounds' ); 1825 return t !== L ? t : this.calculateBounds(); 1826 } 1827 updateControls() { 1828 const t = this, 1829 i = t.container, 1830 { panMode: n, contentRect: s, targetScale: a, minScale: r } = t; 1831 let l = r, 1832 h = t.option( 'click' ) || ! 1; 1833 h && ( l = t.getNextScale( h ) ); 1834 let c = t.canZoomIn(), 1835 d = t.canZoomOut(), 1836 u = n === k && !! this.option( 'touch' ), 1837 g = d && u; 1838 if ( 1839 ( u && 1840 ( e( a ) < e( r ) && ! this.panOnlyZoomed && ( g = ! 0 ), 1841 ( e( s.width, 1 ) > e( s.fitWidth, 1 ) || 1842 e( s.height, 1 ) > e( s.fitHeight, 1 ) ) && 1843 ( g = ! 0 ) ), 1844 e( s.width * a, 1 ) < e( s.fitWidth, 1 ) && ( g = ! 1 ), 1845 n === E && ( g = ! 1 ), 1846 o( i, this.cn( 'isDraggable' ), g ), 1847 ! this.option( 'zoom' ) ) 1848 ) { 1849 return; 1850 } 1851 const f = c && e( l ) > e( a ), 1852 p = ! f && ! g && d && e( l ) < e( a ); 1853 o( i, this.cn( 'canZoomIn' ), f ), 1854 o( i, this.cn( 'canZoomOut' ), p ); 1855 for ( const t of i.querySelectorAll( '[data-panzoom-action]' ) ) { 1856 let e = ! 1, 1857 i = ! 1; 1858 switch ( t.dataset.panzoomAction ) { 1859 case 'zoomIn': 1860 c ? ( e = ! 0 ) : ( i = ! 0 ); 1861 break; 1862 case 'zoomOut': 1863 d ? ( e = ! 0 ) : ( i = ! 0 ); 1864 break; 1865 case 'toggleZoom': 1866 case 'iterateZoom': 1867 c || d ? ( e = ! 0 ) : ( i = ! 0 ); 1868 const n = t.querySelector( 'g' ); 1869 n && ( n.style.display = c ? '' : 'none' ); 1870 } 1871 e 1872 ? ( t.removeAttribute( 'disabled' ), 1873 t.removeAttribute( 'tabindex' ) ) 1874 : i && 1875 ( t.setAttribute( 'disabled', '' ), 1876 t.setAttribute( 'tabindex', '-1' ) ); 1877 } 1878 } 1879 panTo( { 1880 x: t = this.target.e, 1881 y: e = this.target.f, 1882 scale: i = this.targetScale, 1883 friction: n = this.option( 'friction' ), 1884 angle: s = 0, 1885 originX: o = 0, 1886 originY: a = 0, 1887 flipX: r = ! 1, 1888 flipY: l = ! 1, 1889 ignoreBounds: h = ! 1, 1890 } ) { 1891 this.state !== m.Destroy && 1892 this.applyChange( { 1893 panX: t - this.target.e, 1894 panY: e - this.target.f, 1895 scale: i / this.targetScale, 1896 angle: s, 1897 originX: o, 1898 originY: a, 1899 friction: n, 1900 flipX: r, 1901 flipY: l, 1902 ignoreBounds: h, 1903 } ); 1904 } 1905 applyChange( { 1906 panX: t = 0, 1907 panY: i = 0, 1908 scale: n = 1, 1909 angle: s = 0, 1910 originX: o = -this.current.e, 1911 originY: a = -this.current.f, 1912 friction: r = this.option( 'friction' ), 1913 flipX: l = ! 1, 1914 flipY: h = ! 1, 1915 ignoreBounds: c = ! 1, 1916 bounce: d = this.option( 'bounce' ), 1917 } ) { 1918 const u = this.state; 1919 if ( u === m.Destroy ) { 1920 return; 1921 } 1922 this.rAF && 1923 ( cancelAnimationFrame( this.rAF ), ( this.rAF = null ) ), 1924 ( this.friction = r || 0 ), 1925 ( this.ignoreBounds = c ); 1926 const { current: g } = this, 1927 f = g.e, 1928 p = g.f, 1929 v = this.getMatrix( this.target ); 1930 let y = new DOMMatrix() 1931 .translate( f, p ) 1932 .translate( o, a ) 1933 .translate( t, i ); 1934 if ( this.option( 'zoom' ) ) { 1935 if ( ! c ) { 1936 const t = this.targetScale, 1937 e = this.minScale, 1938 i = this.maxScale; 1939 t * n < e && ( n = e / t ), t * n > i && ( n = i / t ); 1940 } 1941 y = y.scale( n ); 1942 } 1943 ( y = y.translate( -o, -a ).translate( -f, -p ).multiply( v ) ), 1944 s && ( y = y.rotate( s ) ), 1945 l && ( y = y.scale( -1, 1 ) ), 1946 h && ( y = y.scale( 1, -1 ) ); 1947 for ( const t of b ) { 1948 'e' !== t && 1949 'f' !== t && 1950 ( y[ t ] > this.minScale + 1e-5 || 1951 y[ t ] < this.minScale - 1e-5 ) 1952 ? ( this.target[ t ] = y[ t ] ) 1953 : ( this.target[ t ] = e( y[ t ], O ) ); 1954 } 1955 ( this.targetScale < this.scale || 1956 Math.abs( n - 1 ) > 0.1 || 1957 this.panMode === E || 1958 ! 1 === d ) && 1959 ! c && 1960 this.clampTargetBounds(), 1961 u === m.Init 1962 ? this.animate() 1963 : this.isResting || 1964 ( ( this.state = m.Panning ), this.requestTick() ); 1965 } 1966 stop( t = ! 1 ) { 1967 if ( this.state === m.Init || this.state === m.Destroy ) { 1968 return; 1969 } 1970 const e = this.isTicking; 1971 this.rAF && 1972 ( cancelAnimationFrame( this.rAF ), ( this.rAF = null ) ), 1973 ( this.isBouncingX = ! 1 ), 1974 ( this.isBouncingY = ! 1 ); 1975 for ( const e of b ) { 1976 ( this.velocity[ e ] = 0 ), 1977 'current' === t 1978 ? ( this.current[ e ] = this.target[ e ] ) 1979 : 'target' === t && 1980 ( this.target[ e ] = this.current[ e ] ); 1981 } 1982 this.setTransform(), 1983 P( this.container, 'is-scaling' ), 1984 P( this.container, 'is-animating' ), 1985 ( this.isTicking = ! 1 ), 1986 ( this.state = m.Ready ),
1987 e && ( this.emit( 'endAnimation' ), this.updateControls() ); 1988 } 1989 requestTick() { 1990 this.isTicking || 1991 ( this.emit( 'startAnimation' ), 1992 this.updateControls(), 1993 T( this.container, 'is-animating' ), 1994 this.isScaling && T( this.container, 'is-scaling' ) ), 1995 ( this.isTicking = ! 0 ), 1996 this.rAF || 1997 ( this.rAF = requestAnimationFrame( () => 1998 this.animate() 1999 ) ); 2000 } 2001 panWithMouse( t, i = this.option( 'mouseMoveFriction' ) ) { 2002 if ( ( ( this.pmme = t ), this.panMode !== E || ! t ) ) { 2003 return; 2004 } 2005 if ( e( this.targetScale ) <= e( this.minScale ) ) { 2006 return; 2007 } 2008 this.emit( 'mouseMove', t ); 2009 const { container: n, containerRect: s, contentRect: o } = this, 2010 a = s.width, 2011 r = s.height, 2012 l = n.getBoundingClientRect(), 2013 h = ( t.clientX || 0 ) - l.left, 2014 c = ( t.clientY || 0 ) - l.top; 2015 let { contentWidth: d, contentHeight: u } = 2016 this.calculateContentDim( this.target ); 2017 const g = this.option( 'mouseMoveFactor' ); 2018 g > 1 && ( d !== a && ( d *= g ), u !== r && ( u *= g ) ); 2019 let f = 0.5 * ( d - a ) - ( ( ( h / a ) * 100 ) / 100 ) * ( d - a ); 2020 f += 0.5 * ( o.right - o.left ); 2021 let p = 0.5 * ( u - r ) - ( ( ( c / r ) * 100 ) / 100 ) * ( u - r ); 2022 ( p += 0.5 * ( o.bottom - o.top ) ), 2023 this.applyChange( { 2024 panX: f - this.target.e, 2025 panY: p - this.target.f, 2026 friction: i, 2027 } ); 2028 } 2029 zoomWithWheel( t ) { 2030 if ( this.state === m.Destroy || this.state === m.Init ) { 2031 return; 2032 } 2033 const i = Date.now(); 2034 if ( i - this.pwt < 45 ) { 2035 return void t.preventDefault(); 2036 } 2037 this.pwt = i; 2038 const n = [ -t.deltaX || 0, -t.deltaY || 0, -t.detail || 0 ].reduce( 2039 function ( t, e ) { 2040 return Math.abs( e ) > Math.abs( t ) ? e : t; 2041 } 2042 ); 2043 const s = Math.max( -1, Math.min( 1, n ) ), 2044 { targetScale: o, maxScale: a, minScale: r } = this; 2045 let l = ( o * ( 100 + 45 * s ) ) / 100; 2046 e( l ) < e( r ) && e( o ) <= e( r ) 2047 ? ( ( this.cwd += Math.abs( s ) ), ( l = r ) ) 2048 : e( l ) > e( a ) && e( o ) >= e( a ) 2049 ? ( ( this.cwd += Math.abs( s ) ), ( l = a ) ) 2050 : ( ( this.cwd = 0 ), ( l = Math.max( Math.min( l, a ), r ) ) ), 2051 this.cwd > this.option( 'wheelLimit' ) || 2052 ( t.preventDefault(), 2053 e( l ) !== e( o ) && this.zoomTo( l, { event: t } ) ); 2054 } 2055 canZoomIn() { 2056 return ( 2057 this.option( 'zoom' ) && 2058 ( e( this.contentRect.width, 1 ) < 2059 e( this.contentRect.fitWidth, 1 ) || 2060 e( this.targetScale ) < e( this.maxScale ) ) 2061 ); 2062 } 2063 canZoomOut() { 2064 return ( 2065 this.option( 'zoom' ) && 2066 e( this.targetScale ) > e( this.minScale ) 2067 ); 2068 } 2069 zoomIn( t = 1.25, e ) { 2070 this.zoomTo( this.targetScale * t, e ); 2071 } 2072 zoomOut( t = 0.8, e ) { 2073 this.zoomTo( this.targetScale * t, e ); 2074 } 2075 zoomToFit( t ) { 2076 this.zoomTo( 'fit', t ); 2077 } 2078 zoomToCover( t ) { 2079 this.zoomTo( 'cover', t ); 2080 } 2081 zoomToFull( t ) { 2082 this.zoomTo( 'full', t ); 2083 } 2084 zoomToMax( t ) { 2085 this.zoomTo( 'max', t ); 2086 } 2087 toggleZoom( t ) { 2088 this.zoomTo( this.getNextScale( 'toggleZoom' ), t ); 2089 } 2090 toggleMax( t ) { 2091 this.zoomTo( this.getNextScale( 'toggleMax' ), t ); 2092 } 2093 toggleCover( t ) { 2094 this.zoomTo( this.getNextScale( 'toggleCover' ), t ); 2095 } 2096 iterateZoom( t ) { 2097 this.zoomTo( 'next', t ); 2098 } 2099 zoomTo( 2100 t = 1, 2101 { friction: e = L, originX: i = L, originY: n = L, event: s } = {} 2102 ) { 2103 if ( this.isContentLoading || this.state === m.Destroy ) { 2104 return; 2105 } 2106 const { 2107 targetScale: o, 2108 fullScale: a, 2109 maxScale: r, 2110 coverScale: l, 2111 } = this; 2112 if ( 2113 ( this.stop(), 2114 this.panMode === E && ( s = this.pmme || s ), 2115 s || i === L || n === L ) 2116 ) { 2117 const t = this.content.getBoundingClientRect(), 2118 e = this.container.getBoundingClientRect(), 2119 o = s ? s.clientX : e.left + 0.5 * e.width, 2120 a = s ? s.clientY : e.top + 0.5 * e.height; 2121 ( i = o - t.left - 0.5 * t.width ), 2122 ( n = a - t.top - 0.5 * t.height ); 2123 } 2124 let h = 1; 2125 'number' === typeof t 2126 ? ( h = t ) 2127 : 'full' === t 2128 ? ( h = a ) 2129 : 'cover' === t 2130 ? ( h = l ) 2131 : 'max' === t 2132 ? ( h = r ) 2133 : 'fit' === t 2134 ? ( h = 1 ) 2135 : 'next' === t && ( h = this.getNextScale( 'iterateZoom' ) ), 2136 ( h = h / o || 1 ), 2137 ( e = e === L ? ( h > 1 ? 0.15 : 0.25 ) : e ), 2138 this.applyChange( { 2139 scale: h, 2140 originX: i, 2141 originY: n, 2142 friction: e, 2143 } ), 2144 s && this.panMode === E && this.panWithMouse( s, e ); 2145 } 2146 rotateCCW() { 2147 this.applyChange( { angle: -90 } ); 2148 } 2149 rotateCW() { 2150 this.applyChange( { angle: 90 } ); 2151 } 2152 flipX() { 2153 this.applyChange( { flipX: ! 0 } ); 2154 } 2155 flipY() { 2156 this.applyChange( { flipY: ! 0 } ); 2157 } 2158 fitX() { 2159 this.stop( 'target' ); 2160 const { containerRect: t, contentRect: e, target: i } = this; 2161 this.applyChange( { 2162 panX: 0.5 * t.width - ( e.left + 0.5 * e.fitWidth ) - i.e, 2163 panY: 0.5 * t.height - ( e.top + 0.5 * e.fitHeight ) - i.f, 2164 scale: t.width / e.fitWidth / this.targetScale, 2165 originX: 0, 2166 originY: 0, 2167 ignoreBounds: ! 0, 2168 } ); 2169 } 2170 fitY() { 2171 this.stop( 'target' ); 2172 const { containerRect: t, contentRect: e, target: i } = this; 2173 this.applyChange( { 2174 panX: 0.5 * t.width - ( e.left + 0.5 * e.fitWidth ) - i.e,
2175 panY: 0.5 * t.innerHeight - ( e.top + 0.5 * e.fitHeight ) - i.f, 2176 scale: t.height / e.fitHeight / this.targetScale, 2177 originX: 0, 2178 originY: 0, 2179 ignoreBounds: ! 0, 2180 } ); 2181 } 2182 toggleFS() { 2183 const { container: t } = this, 2184 e = this.cn( 'inFullscreen' ), 2185 i = this.cn( 'htmlHasFullscreen' ); 2186 t.classList.toggle( e ); 2187 const n = t.classList.contains( e ); 2188 n 2189 ? ( document.documentElement.classList.add( i ), 2190 document.addEventListener( 'keydown', this.onKeydown, ! 0 ) ) 2191 : ( document.documentElement.classList.remove( i ), 2192 document.removeEventListener( 2193 'keydown', 2194 this.onKeydown, 2195 ! 0 2196 ) ), 2197 this.updateMetrics(), 2198 this.emit( n ? 'enterFS' : 'exitFS' ); 2199 } 2200 getMatrix( t = this.current ) { 2201 const { a: e, b: i, c: n, d: s, e: o, f: a } = t; 2202 return new DOMMatrix( [ e, i, n, s, o, a ] ); 2203 } 2204 reset( t ) { 2205 if ( this.state !== m.Init && this.state !== m.Destroy ) { 2206 this.stop( 'current' ); 2207 for ( const t of b ) { 2208 this.target[ t ] = S[ t ]; 2209 } 2210 ( this.target.a = this.minScale ), 2211 ( this.target.d = this.minScale ), 2212 this.clampTargetBounds(), 2213 this.isResting || 2214 ( ( this.friction = 2215 void 0 === t ? this.option( 'friction' ) : t ), 2216 ( this.state = m.Panning ), 2217 this.requestTick() ); 2218 } 2219 } 2220 destroy() { 2221 this.stop(), 2222 ( this.state = m.Destroy ), 2223 this.detachEvents(), 2224 this.detachObserver(); 2225 const { container: t, content: e } = this, 2226 i = this.option( 'classes' ) || {}; 2227 for ( const e of Object.values( i ) ) { 2228 t.classList.remove( e + '' ); 2229 } 2230 e && 2231 ( e.removeEventListener( 'load', this.onLoad ), 2232 e.removeEventListener( 'error', this.onError ) ), 2233 this.detachPlugins(); 2234 } 2235 } 2236 Object.defineProperty( R, 'defaults', { 2237 enumerable: ! 0, 2238 configurable: ! 0, 2239 writable: ! 0, 2240 value: v, 2241 } ), 2242 Object.defineProperty( R, 'Plugins', { 2243 enumerable: ! 0, 2244 configurable: ! 0, 2245 writable: ! 0, 2246 value: {}, 2247 } ); 2248 const A = function ( t, e ) { 2249 let i = ! 0; 2250 return ( ...n ) => { 2251 i && 2252 ( ( i = ! 1 ), 2253 t( ...n ), 2254 setTimeout( () => { 2255 i = ! 0; 2256 }, e ) ); 2257 }; 2258 }, 2259 j = ( t, e ) => { 2260 const i = []; 2261 return ( 2262 t.childNodes.forEach( ( t ) => { 2263 t.nodeType !== Node.ELEMENT_NODE || 2264 ( e && ! t.matches( e ) ) || 2265 i.push( t ); 2266 } ), 2267 i 2268 ); 2269 }, 2270 F = { 2271 viewport: null, 2272 track: null, 2273 enabled: ! 0, 2274 slides: [], 2275 axis: 'x', 2276 transition: 'fade', 2277 preload: 1, 2278 slidesPerPage: 2, 2279 initialPage: 0, 2280 friction: 0.12, 2281 Panzoom: { decelFriction: 0.12 }, 2282 center: ! 0, 2283 infinite: ! 0, 2284 fill: ! 0, 2285 dragFree: ! 1, 2286 adaptiveHeight: ! 1, 2287 direction: 'ltr', 2288 classes: { 2289 container: 'f-carousel', 2290 viewport: 'f-carousel__viewport', 2291 track: 'f-carousel__track', 2292 slide: 'f-carousel__slide', 2293 isLTR: 'is-ltr', 2294 isRTL: 'is-rtl', 2295 isHorizontal: 'is-horizontal', 2296 isVertical: 'is-vertical', 2297 inTransition: 'in-transition', 2298 isSelected: 'is-selected', 2299 }, 2300 l10n: { 2301 NEXT: 'Next slide', 2302 PREV: 'Previous slide', 2303 GOTO: 'Go to slide #%d', 2304 }, 2305 }; 2306 let I; 2307 ! ( function ( t ) { 2308 ( t[ ( t.Init = 0 ) ] = 'Init' ), 2309 ( t[ ( t.Ready = 1 ) ] = 'Ready' ), 2310 ( t[ ( t.Destroy = 2 ) ] = 'Destroy' ); 2311 } )( I || ( I = {} ) ); 2312 const B = ( t ) => { 2313 if ( 'string' === typeof t || t instanceof HTMLElement ) { 2314 t = { html: t }; 2315 } else { 2316 const e = t.thumb; 2317 void 0 !== e && 2318 ( 'string' === typeof e && ( t.thumbSrc = e ), 2319 e instanceof HTMLImageElement && 2320 ( ( t.thumbEl = e ), 2321 ( t.thumbElSrc = e.src ), 2322 ( t.thumbSrc = e.src ) ), 2323 delete t.thumb ); 2324 } 2325 return Object.assign( 2326 { 2327 html: '', 2328 el: null, 2329 isDom: ! 1, 2330 class: '', 2331 customClass: '', 2332 index: -1, 2333 dim: 0, 2334 gap: 0, 2335 pos: 0, 2336 transition: ! 1, 2337 }, 2338 t 2339 ); 2340 }, 2341 H = ( t = {} ) => 2342 Object.assign( { index: -1, slides: [], dim: 0, pos: -1 }, t ); 2343 class N extends f { 2344 constructor( t, e ) { 2345 super( e ), 2346 Object.defineProperty( this, 'instance', { 2347 enumerable: ! 0, 2348 configurable: ! 0, 2349 writable: ! 0, 2350 value: t, 2351 } ); 2352 } 2353 attach() {} 2354 detach() {} 2355 } 2356 const X = { 2357 classes: { 2358 list: 'f-carousel__dots', 2359 isDynamic: 'is-dynamic', 2360 hasDots: 'has-dots', 2361 dot: 'f-carousel__dot', 2362 isBeforePrev: 'is-before-prev', 2363 isPrev: 'is-prev', 2364 isCurrent: 'is-current', 2365 isNext: 'is-next', 2366 isAfterNext: 'is-after-next', 2367 }, 2368 dotTpl: '<button type="button" data-carousel-page="%i" aria-label="{{GOTO}}"><span class="f-carousel__dot" aria-hidden="true"></span></button>', 2369 dynamicFrom: 11, 2370 maxCount: 1 / 0, 2371 minCount: 2, 2372 }; 2373 class W extends N { 2374 constructor() { 2375 super( ...arguments ), 2376 Object.defineProperty( this, 'isDynamic', { 2377 enumerable: ! 0, 2378 configurable: ! 0, 2379 writable: ! 0, 2380 value: ! 1, 2381 } ), 2382 Object.defineProperty( this, 'list', { 2383 enumerable: ! 0, 2384 configurable: ! 0, 2385 writable: ! 0, 2386 value: null, 2387 } ); 2388 } 2389 onRefresh() { 2390 this.refresh(); 2391 } 2392 build() { 2393 let t = this.list; 2394 if ( ! t ) { 2395 ( t = document.createElement( 'ul' ) ), 2396 T( t, this.cn( 'list' ) ), 2397 t.setAttribute( 'role', 'tablist' ); 2398 const e = this.instance.container; 2399 e.appendChild( t ), 2400 T( e, this.cn( 'hasDots' ) ), 2401 ( this.list = t ); 2402 } 2403 return t; 2404 } 2405 refresh() { 2406 let t; 2407 const e = this.instance.pages.length, 2408 i = Math.min( 2, this.option( 'minCount' ) ), 2409 n = Math.max( 2e3, this.option( 'maxCount' ) ), 2410 s = this.option( 'dynamicFrom' ); 2411 if ( e < i || e > n ) { 2412 return void this.cleanup(); 2413 } 2414 const a = 'number' === typeof s && e > 5 && e >= s, 2415 r = 2416 ! this.list || 2417 this.isDynamic !== a || 2418 this.list.children.length !== e; 2419 r && this.cleanup(); 2420 const l = this.build(); 2421 if ( ( o( l, this.cn( 'isDynamic' ), !! a ), r ) ) { 2422 for ( let t = 0; t < e; t++ ) { 2423 l.append( this.createItem( t ) ); 2424 } 2425 } 2426 let h, 2427 c = 0; 2428 for ( const e of [ ...l.children ] ) { 2429 const i = c === this.instance.page; 2430 i && ( h = e ), 2431 o( e, this.cn( 'isCurrent' ), i ), 2432 null === ( t = e.children[ 0 ] ) || 2433 void 0 === t || 2434 t.setAttribute( 'aria-selected', i ? 'true' : 'false' ); 2435 for ( const t of [ 2436 'isBeforePrev', 2437 'isPrev', 2438 'isNext', 2439 'isAfterNext', 2440 ] ) { 2441 P( e, this.cn( t ) ); 2442 } 2443 c++; 2444 } 2445 if ( ( ( h = h || l.firstChild ), a && h ) ) { 2446 const t = h.previousElementSibling, 2447 e = t && t.previousElementSibling; 2448 T( t, this.cn( 'isPrev' ) ), T( e, this.cn( 'isBeforePrev' ) ); 2449 const i = h.nextElementSibling, 2450 n = i && i.nextElementSibling; 2451 T( i, this.cn( 'isNext' ) ), T( n, this.cn( 'isAfterNext' ) ); 2452 } 2453 this.isDynamic = a; 2454 } 2455 createItem( t = 0 ) { 2456 let e; 2457 const i = document.createElement( 'li' ); 2458 i.setAttribute( 'role', 'presentation' ); 2459 const s = n( 2460 this.instance 2461 .localize( this.option( 'dotTpl' ), [ [ '%d', t + 1 ] ] ) 2462 .replace( /\%i/g, t + '' ) 2463 ); 2464 return ( 2465 i.appendChild( s ), 2466 null === ( e = i.children[ 0 ] ) || 2467 void 0 === e || 2468 e.setAttribute( 'role', 'tab' ), 2469 i 2470 ); 2471 } 2472 cleanup() { 2473 this.list && ( this.list.remove(), ( this.list = null ) ), 2474 ( this.isDynamic = ! 1 ), 2475 P( this.instance.container, this.cn( 'hasDots' ) ); 2476 } 2477 attach() { 2478 this.instance.on( [ 'refresh', 'change' ], this.onRefresh ); 2479 } 2480 detach() { 2481 this.instance.off( [ 'refresh', 'change' ], this.onRefresh ), 2482 this.cleanup(); 2483 } 2484 } 2485 Object.defineProperty( W, 'defaults', { 2486 enumerable: ! 0, 2487 configurable: ! 0, 2488 writable: ! 0, 2489 value: X, 2490 } ); 2491 const Y = 'disabled', 2492 $ = 'next', 2493 Z = 'prev'; 2494 class V extends N { 2495 constructor() { 2496 super( ...arguments ), 2497 Object.defineProperty( this, 'container', { 2498 enumerable: ! 0, 2499 configurable: ! 0, 2500 writable: ! 0, 2501 value: null, 2502 } ), 2503 Object.defineProperty( this, 'prev', { 2504 enumerable: ! 0, 2505 configurable: ! 0, 2506 writable: ! 0, 2507 value: null, 2508 } ), 2509 Object.defineProperty( this, 'next', { 2510 enumerable: ! 0, 2511 configurable: ! 0, 2512 writable: ! 0, 2513 value: null, 2514 } ), 2515 Object.defineProperty( this, 'isDom', { 2516 enumerable: ! 0, 2517 configurable: ! 0, 2518 writable: ! 0, 2519 value: ! 1, 2520 } ); 2521 } 2522 onRefresh() { 2523 const t = this.instance, 2524 e = t.pages.length, 2525 i = t.page; 2526 if ( e < 2 ) { 2527 return void this.cleanup(); 2528 } 2529 this.build(); 2530 const n = this.prev, 2531 s = this.next; 2532 n && 2533 s && 2534 ( n.removeAttribute( Y ), 2535 s.removeAttribute( Y ), 2536 t.isInfinite || 2537 ( i <= 0 && n.setAttribute( Y, '' ), 2538 i >= e - 1 && s.setAttribute( Y, '' ) ) ); 2539 } 2540 addBtn( t ) { 2541 let e; 2542 const i = this.instance, 2543 n = document.createElement( 'button' ); 2544 n.setAttribute( 'tabindex', '0' ), 2545 n.setAttribute( 2546 'title', 2547 i.localize( `{{${ t.toUpperCase() }}}` ) 2548 ), 2549 T( 2550 n, 2551 this.cn( 'button' ) + 2552 ' ' + 2553 this.cn( t === $ ? 'isNext' : 'isPrev' ) 2554 ); 2555 const s = i.isRTL ? ( t === $ ? Z : $ ) : t; 2556 let o; 2557 return ( 2558 ( n.innerHTML = i.localize( this.option( `${ s }Tpl` ) ) ), 2559 ( n.dataset[ 2560 `carousel${ 2561 ( ( o = t ), 2562 o 2563 ? o.match( '^[a-z]' ) 2564 ? o.charAt( 0 ).toUpperCase() + o.substring( 1 ) 2565 : o 2566 : '' ) 2567 }` 2568 ] = 'true' ), 2569 null === ( e = this.container ) || 2570 void 0 === e || 2571 e.appendChild( n ), 2572 n 2573 ); 2574 } 2575 build() { 2576 const t = this.instance.container, 2577 e = this.cn( 'container' ); 2578 let { container: i, prev: n, next: s } = this; 2579 i || ( ( i = t.querySelector( '.' + e ) ), ( this.isDom = !! i ) ), 2580 i || 2581 ( ( i = document.createElement( 'div' ) ), 2582 T( i, e ), 2583 t.appendChild( i ) ), 2584 ( this.container = i ), 2585 s || ( s = i.querySelector( '[data-carousel-next]' ) ), 2586 s || ( s = this.addBtn( $ ) ), 2587 ( this.next = s ), 2588 n || ( n = i.querySelector( '[data-carousel-prev]' ) ), 2589 n || ( n = this.addBtn( Z ) ), 2590 ( this.prev = n ); 2591 } 2592 cleanup() { 2593 this.isDom || 2594 ( this.prev && this.prev.remove(), 2595 this.next && this.next.remove(), 2596 this.container && this.container.remove() ), 2597 ( this.prev = null ), 2598 ( this.next = null ), 2599 ( this.container = null ), 2600 ( this.isDom = ! 1 ); 2601 } 2602 attach() { 2603 this.instance.on( [ 'refresh', 'change' ], this.onRefresh ); 2604 } 2605 detach() { 2606 this.instance.off( [ 'refresh', 'change' ], this.onRefresh ), 2607 this.cleanup(); 2608 } 2609 } 2610 Object.defineProperty( V, 'defaults', { 2611 enumerable: ! 0, 2612 configurable: ! 0, 2613 writable: ! 0, 2614 value: { 2615 classes: { 2616 container: 'f-carousel__nav', 2617 button: 'f-button', 2618 isNext: 'is-next', 2619 isPrev: 'is-prev', 2620 }, 2621 nextTpl: 2622 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>', 2623 prevTpl: 2624 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>', 2625 }, 2626 } ); 2627 class q extends N { 2628 constructor() { 2629 super( ...arguments ), 2630 Object.defineProperty( this, 'selectedIndex', { 2631 enumerable: ! 0, 2632 configurable: ! 0, 2633 writable: ! 0, 2634 value: null, 2635 } ), 2636 Object.defineProperty( this, 'target', { 2637 enumerable: ! 0, 2638 configurable: ! 0, 2639 writable: ! 0, 2640 value: null, 2641 } ), 2642 Object.defineProperty( this, 'nav', { 2643 enumerable: ! 0, 2644 configurable: ! 0, 2645 writable: ! 0, 2646 value: null, 2647 } ); 2648 } 2649 addAsTargetFor( t ) { 2650 ( this.target = this.instance ), 2651 ( this.nav = t ), 2652 this.attachEvents(); 2653 } 2654 addAsNavFor( t ) { 2655 ( this.nav = this.instance ), 2656 ( this.target = t ), 2657 this.attachEvents(); 2658 } 2659 attachEvents() { 2660 const { nav: t, target: e } = this; 2661 t && 2662 e && 2663 ( ( t.options.initialSlide = e.options.initialPage ), 2664 t.state === I.Ready 2665 ? this.onNavReady( t ) 2666 : t.on( 'ready', this.onNavReady ), 2667 e.state === I.Ready 2668 ? this.onTargetReady( e ) 2669 : e.on( 'ready', this.onTargetReady ) ); 2670 } 2671 onNavReady( t ) { 2672 t.on( 'createSlide', this.onNavCreateSlide ), 2673 t.on( 'Panzoom.click', this.onNavClick ), 2674 t.on( 'Panzoom.touchEnd', this.onNavTouch ), 2675 this.onTargetChange(); 2676 } 2677 onTargetReady( t ) { 2678 t.on( 'change', this.onTargetChange ), 2679 t.on( 'Panzoom.refresh', this.onTargetChange ), 2680 this.onTargetChange(); 2681 } 2682 onNavClick( t, e, i ) { 2683 this.onNavTouch( t, t.panzoom, i ); 2684 } 2685 onNavTouch( t, e, i ) { 2686 let n, s; 2687 if ( 2688 Math.abs( e.dragOffset.x ) > 3 || 2689 Math.abs( e.dragOffset.y ) > 3 2690 ) { 2691 return; 2692 } 2693 const o = i.target, 2694 { nav: a, target: r } = this; 2695 if ( ! a || ! r || ! o ) { 2696 return; 2697 } 2698 const l = o.closest( '[data-index]' ); 2699 if ( ( i.stopPropagation(), i.preventDefault(), ! l ) ) { 2700 return; 2701 }
2702 const h = parseInt( l.dataset.index || '', 10 ) || 0, 2703 c = r.getPageForSlide( h ), 2704 d = a.getPageForSlide( h ); 2705 a.slideTo( d ), 2706 r.slideTo( c, { 2707 friction: 2708 ( null === 2709 ( s = 2710 null === ( n = this.nav ) || void 0 === n 2711 ? void 0 2712 : n.plugins ) || void 0 === s 2713 ? void 0 2714 : s.Sync.option( 'friction' ) ) || 0, 2715 } ), 2716 this.markSelectedSlide( h ); 2717 } 2718 onNavCreateSlide( t, e ) { 2719 e.index === this.selectedIndex && this.markSelectedSlide( e.index ); 2720 } 2721 onTargetChange() { 2722 let t, e; 2723 const { target: i, nav: n } = this; 2724 if ( ! i || ! n ) { 2725 return; 2726 } 2727 if ( n.state !== I.Ready || i.state !== I.Ready ) { 2728 return; 2729 } 2730 const s = 2731 null === 2732 ( e = 2733 null === ( t = i.pages[ i.page ] ) || void 0 === t 2734 ? void 0 2735 : t.slides[ 0 ] ) || void 0 === e 2736 ? void 0 2737 : e.index, 2738 o = n.getPageForSlide( s ); 2739 this.markSelectedSlide( s ), 2740 n.slideTo( 2741 o, 2742 null === n.prevPage && null === i.prevPage 2743 ? { friction: 0 } 2744 : void 0 2745 ); 2746 } 2747 markSelectedSlide( t ) { 2748 const e = this.nav; 2749 e && 2750 e.state === I.Ready && 2751 ( ( this.selectedIndex = t ), 2752 [ ...e.slides ].map( ( e ) => { 2753 e.el && 2754 e.el.classList[ e.index === t ? 'add' : 'remove' ]( 2755 'is-nav-selected' 2756 ); 2757 } ) ); 2758 } 2759 attach() { 2760 const t = this; 2761 const e = t.options.target, 2762 i = t.options.nav; 2763 e ? t.addAsNavFor( e ) : i && t.addAsTargetFor( i ); 2764 } 2765 detach() { 2766 const t = this, 2767 e = t.nav, 2768 i = t.target; 2769 e && 2770 ( e.off( 'ready', t.onNavReady ), 2771 e.off( 'createSlide', t.onNavCreateSlide ), 2772 e.off( 'Panzoom.click', t.onNavClick ), 2773 e.off( 'Panzoom.touchEnd', t.onNavTouch ) ), 2774 ( t.nav = null ), 2775 i && 2776 ( i.off( 'ready', t.onTargetReady ), 2777 i.off( 'refresh', t.onTargetChange ), 2778 i.off( 'change', t.onTargetChange ) ), 2779 ( t.target = null ); 2780 } 2781 } 2782 Object.defineProperty( q, 'defaults', { 2783 enumerable: ! 0, 2784 configurable: ! 0, 2785 writable: ! 0, 2786 value: { friction: 0.35 }, 2787 } ); 2788 const _ = { Navigation: V, Dots: W, Sync: q }, 2789 G = 'animationend', 2790 U = 'isSelected', 2791 K = 'slide'; 2792 class J extends p { 2793 get axis() { 2794 return this.isHorizontal ? 'e' : 'f'; 2795 } 2796 get isEnabled() { 2797 return this.state === I.Ready; 2798 } 2799 get isInfinite() { 2800 let t = ! 1; 2801 const { contentDim: e, viewportDim: i, pages: n, slides: s } = this, 2802 o = s[ 0 ]; 2803 return ( 2804 n.length >= 2 && 2805 o && 2806 e + o.dim >= i && 2807 ( t = this.option( 'infinite' ) ), 2808 t 2809 ); 2810 } 2811 get isRTL() { 2812 return 'rtl' === this.option( 'direction' ); 2813 } 2814 get isHorizontal() { 2815 return 'x' === this.option( 'axis' ); 2816 } 2817 constructor( t, e = {}, i = {} ) { 2818 if ( 2819 ( super(), 2820 Object.defineProperty( this, 'bp', { 2821 enumerable: ! 0, 2822 configurable: ! 0, 2823 writable: ! 0, 2824 value: '', 2825 } ), 2826 Object.defineProperty( this, 'lp', { 2827 enumerable: ! 0, 2828 configurable: ! 0, 2829 writable: ! 0, 2830 value: 0, 2831 } ), 2832 Object.defineProperty( this, 'userOptions', { 2833 enumerable: ! 0, 2834 configurable: ! 0, 2835 writable: ! 0, 2836 value: {}, 2837 } ), 2838 Object.defineProperty( this, 'userPlugins', { 2839 enumerable: ! 0, 2840 configurable: ! 0, 2841 writable: ! 0, 2842 value: {}, 2843 } ), 2844 Object.defineProperty( this, 'state', { 2845 enumerable: ! 0, 2846 configurable: ! 0, 2847 writable: ! 0, 2848 value: I.Init, 2849 } ), 2850 Object.defineProperty( this, 'page', { 2851 enumerable: ! 0, 2852 configurable: ! 0, 2853 writable: ! 0, 2854 value: 0, 2855 } ), 2856 Object.defineProperty( this, 'prevPage', { 2857 enumerable: ! 0, 2858 configurable: ! 0, 2859 writable: ! 0, 2860 value: null, 2861 } ), 2862 Object.defineProperty( this, 'container', { 2863 enumerable: ! 0, 2864 configurable: ! 0, 2865 writable: ! 0, 2866 value: void 0, 2867 } ), 2868 Object.defineProperty( this, 'viewport', { 2869 enumerable: ! 0, 2870 configurable: ! 0, 2871 writable: ! 0, 2872 value: null, 2873 } ), 2874 Object.defineProperty( this, 'track', { 2875 enumerable: ! 0, 2876 configurable: ! 0, 2877 writable: ! 0, 2878 value: null, 2879 } ), 2880 Object.defineProperty( this, 'slides', { 2881 enumerable: ! 0, 2882 configurable: ! 0, 2883 writable: ! 0, 2884 value: [], 2885 } ), 2886 Object.defineProperty( this, 'pages', { 2887 enumerable: ! 0, 2888 configurable: ! 0, 2889 writable: ! 0, 2890 value: [], 2891 } ), 2892 Object.defineProperty( this, 'panzoom', { 2893 enumerable: ! 0, 2894 configurable: ! 0, 2895 writable: ! 0, 2896 value: null, 2897 } ), 2898 Object.defineProperty( this, 'inTransition', { 2899 enumerable: ! 0, 2900 configurable: ! 0, 2901 writable: ! 0, 2902 value: new Set(), 2903 } ), 2904 Object.defineProperty( this, 'contentDim', { 2905 enumerable: ! 0, 2906 configurable: ! 0, 2907 writable: ! 0, 2908 value: 0, 2909 } ), 2910 Object.defineProperty( this, 'viewportDim', { 2911 enumerable: ! 0, 2912 configurable: ! 0, 2913 writable: ! 0, 2914 value: 0, 2915 } ), 2916 'string' === typeof t && ( t = document.querySelector( t ) ), 2917 ! t || ! x( t ) ) 2918 ) { 2919 throw new Error( 'No Element found' ); 2920 } 2921 ( this.container = t ), 2922 ( this.slideNext = A( this.slideNext.bind( this ), 150 ) ), 2923 ( this.slidePrev = A( this.slidePrev.bind( this ), 150 ) ), 2924 ( this.userOptions = e ), 2925 ( this.userPlugins = i ), 2926 queueMicrotask( () => { 2927 this.processOptions(); 2928 } ); 2929 } 2930 processOptions() { 2931 let t, e; 2932 const i = u( {}, J.defaults, this.userOptions ); 2933 let n = '';
2934 const s = i.breakpoints; 2935 if ( s && d( s ) ) { 2936 for ( const [ t, e ] of Object.entries( s ) ) { 2937 window.matchMedia( t ).matches && 2938 d( e ) && 2939 ( ( n += t ), u( i, e ) ); 2940 } 2941 } 2942 ( n === this.bp && this.state !== I.Init ) || 2943 ( ( this.bp = n ), 2944 this.state === I.Ready && 2945 ( i.initialSlide = 2946 ( null === 2947 ( e = 2948 null === ( t = this.pages[ this.page ] ) || 2949 void 0 === t 2950 ? void 0 2951 : t.slides[ 0 ] ) || void 0 === e 2952 ? void 0 2953 : e.index ) || 0 ), 2954 this.state !== I.Init && this.destroy(), 2955 super.setOptions( i ), 2956 ! 1 === this.option( 'enabled' ) 2957 ? this.attachEvents() 2958 : setTimeout( () => { 2959 this.init(); 2960 }, 0 ) ); 2961 } 2962 init() { 2963 ( this.state = I.Init ), 2964 this.emit( 'init' ), 2965 this.attachPlugins( 2966 Object.assign( 2967 Object.assign( {}, J.Plugins ), 2968 this.userPlugins 2969 ) 2970 ), 2971 this.emit( 'attachPlugins' ), 2972 this.initLayout(), 2973 this.initSlides(), 2974 this.updateMetrics(), 2975 this.setInitialPosition(), 2976 this.initPanzoom(), 2977 this.attachEvents(), 2978 ( this.state = I.Ready ), 2979 this.emit( 'ready' ); 2980 } 2981 initLayout() { 2982 const { container: t } = this, 2983 e = this.option( 'classes' ); 2984 T( t, this.cn( 'container' ) ), 2985 o( t, e.isLTR, ! this.isRTL ), 2986 o( t, e.isRTL, this.isRTL ), 2987 o( t, e.isVertical, ! this.isHorizontal ), 2988 o( t, e.isHorizontal, this.isHorizontal ); 2989 let i = 2990 this.option( 'viewport' ) || 2991 t.querySelector( `.${ e.viewport }` ); 2992 i || 2993 ( ( i = document.createElement( 'div' ) ), 2994 T( i, e.viewport ), 2995 i.append( ...j( t, `.${ e.slide }` ) ), 2996 t.prepend( i ) ), 2997 i.addEventListener( 'scroll', this.onScroll ); 2998 let n = 2999 this.option( 'track' ) || t.querySelector( `.${ e.track }` ); 3000 n || 3001 ( ( n = document.createElement( 'div' ) ), 3002 T( n, e.track ), 3003 n.append( ...Array.from( i.childNodes ) ) ), 3004 n.setAttribute( 'aria-live', 'polite' ), 3005 i.contains( n ) || i.prepend( n ), 3006 ( this.viewport = i ), 3007 ( this.track = n ), 3008 this.emit( 'initLayout' ); 3009 } 3010 initSlides() { 3011 const { track: t } = this; 3012 if ( ! t ) { 3013 return; 3014 } 3015 const e = [ ...this.slides ], 3016 i = []; 3017 [ ...j( t, `.${ this.cn( K ) }` ) ].forEach( ( t ) => { 3018 if ( x( t ) ) { 3019 const e = B( { 3020 el: t, 3021 isDom: ! 0, 3022 index: this.slides.length, 3023 } ); 3024 i.push( e ); 3025 } 3026 } ); 3027 for ( const t of [ 3028 ...( this.option( 'slides', [] ) || [] ), 3029 ...e, 3030 ] ) { 3031 i.push( B( t ) ); 3032 } 3033 this.slides = i; 3034 for ( let t = 0; t < this.slides.length; t++ ) { 3035 this.slides[ t ].index = t; 3036 } 3037 for ( const t of i ) { 3038 this.emit( 'beforeInitSlide', t, t.index ), 3039 this.emit( 'initSlide', t, t.index ); 3040 } 3041 this.emit( 'initSlides' ); 3042 } 3043 setInitialPage() { 3044 const t = this.option( 'initialSlide' ); 3045 this.page = 3046 'number' === typeof t 3047 ? this.getPageForSlide( t ) 3048 : parseInt( this.option( 'initialPage', 0 ) + '', 10 ) || 0; 3049 } 3050 setInitialPosition() { 3051 const { track: t, pages: e, isHorizontal: i } = this; 3052 if ( ! t || ! e.length ) { 3053 return; 3054 } 3055 let n = this.page; 3056 e[ n ] || ( this.page = n = 0 ); 3057 const s = ( e[ n ].pos || 0 ) * ( this.isRTL && i ? 1 : -1 ), 3058 o = i ? `${ s }px` : '0', 3059 a = i ? '0' : `${ s }px`; 3060 ( t.style.transform = `translate3d(${ o }, ${ a }, 0) scale(1)` ), 3061 this.option( 'adaptiveHeight' ) && this.setViewportHeight(); 3062 } 3063 initPanzoom() { 3064 this.panzoom && ( this.panzoom.destroy(), ( this.panzoom = null ) ); 3065 const t = this.option( 'Panzoom' ) || {}; 3066 ( this.panzoom = new R( 3067 this.viewport, 3068 u( 3069 {}, 3070 { 3071 content: this.track, 3072 zoom: ! 1, 3073 panOnlyZoomed: ! 1, 3074 lockAxis: this.isHorizontal ? 'x' : 'y', 3075 infinite: this.isInfinite, 3076 click: ! 1, 3077 dblClick: ! 1, 3078 touch: ( t ) => 3079 ! ( this.pages.length < 2 && ! t.options.infinite ), 3080 bounds: () => this.getBounds(), 3081 maxVelocity: ( t ) => 3082 Math.abs( 3083 t.target[ this.axis ] - t.current[ this.axis ] 3084 ) < 3085 2 * this.viewportDim 3086 ? 100 3087 : 0, 3088 }, 3089 t 3090 ) 3091 ) ), 3092 this.panzoom.on( '*', ( t, e, ...i ) => {
3093 this.emit( `Panzoom.${ e }`, t, ...i ); 3094 } ), 3095 this.panzoom.on( 'decel', this.onDecel ), 3096 this.panzoom.on( 'refresh', this.onRefresh ), 3097 this.panzoom.on( 'beforeTransform', this.onBeforeTransform ), 3098 this.panzoom.on( 'endAnimation', this.onEndAnimation ); 3099 } 3100 attachEvents() { 3101 const t = this.container; 3102 t && 3103 ( t.addEventListener( 'click', this.onClick, { 3104 passive: ! 1, 3105 capture: ! 1, 3106 } ), 3107 t.addEventListener( 'slideTo', this.onSlideTo ) ), 3108 window.addEventListener( 'resize', this.onResize ); 3109 } 3110 createPages() { 3111 const t = []; 3112 const { contentDim: e, viewportDim: i } = this; 3113 let n = this.option( 'slidesPerPage' ); 3114 n = 3115 ( 'auto' === n || e <= i ) && ! 1 !== this.option( 'fill' ) 3116 ? 1 / 0 3117 : parseFloat( n + '' ); 3118 let s = 0, 3119 o = 0, 3120 a = 0; 3121 for ( const e of this.slides ) { 3122 ( ! t.length || o + e.dim - i > 0.05 || a >= n ) && 3123 ( t.push( H() ), 3124 ( s = t.length - 1 ), 3125 ( o = 0 ), 3126 ( a = 0 ) ), 3127 t[ s ].slides.push( e ), 3128 ( o += e.dim + e.gap ), 3129 a++; 3130 } 3131 return t; 3132 } 3133 processPages() { 3134 const t = this.pages, 3135 { contentDim: i, viewportDim: n, isInfinite: s } = this, 3136 o = this.option( 'center' ), 3137 a = this.option( 'fill' ), 3138 r = a && o && i > n && ! s; 3139 if ( 3140 ( t.forEach( ( t, e ) => { 3141 let s; 3142 ( t.index = e ), 3143 ( t.pos = 3144 ( null === ( s = t.slides[ 0 ] ) || void 0 === s 3145 ? void 0 3146 : s.pos ) || 0 ), 3147 ( t.dim = 0 ); 3148 for ( const [ e, i ] of t.slides.entries() ) { 3149 ( t.dim += i.dim ), 3150 e < t.slides.length - 1 && ( t.dim += i.gap ); 3151 } 3152 r && t.pos + 0.5 * t.dim < 0.5 * n 3153 ? ( t.pos = 0 ) 3154 : r && t.pos + 0.5 * t.dim >= i - 0.5 * n 3155 ? ( t.pos = i - n ) 3156 : o && ( t.pos += -0.5 * ( n - t.dim ) ); 3157 } ), 3158 t.forEach( ( t ) => { 3159 a && 3160 ! s && 3161 i > n && 3162 ( ( t.pos = Math.max( t.pos, 0 ) ), 3163 ( t.pos = Math.min( t.pos, i - n ) ) ), 3164 ( t.pos = e( t.pos, 1e3 ) ), 3165 ( t.dim = e( t.dim, 1e3 ) ), 3166 Math.abs( t.pos ) <= 0.1 && ( t.pos = 0 ); 3167 } ), 3168 s ) 3169 ) { 3170 return t; 3171 } 3172 const l = []; 3173 let h; 3174 return ( 3175 t.forEach( ( t ) => { 3176 const e = Object.assign( {}, t ); 3177 h && e.pos === h.pos 3178 ? ( ( h.dim += e.dim ), 3179 ( h.slides = [ ...h.slides, ...e.slides ] ) ) 3180 : ( ( e.index = l.length ), ( h = e ), l.push( e ) ); 3181 } ), 3182 l 3183 ); 3184 } 3185 getPageFromIndex( t = 0 ) { 3186 const e = this.pages.length; 3187 let i; 3188 return ( 3189 ( t = parseInt( ( t || 0 ).toString() ) || 0 ), 3190 ( i = this.isInfinite 3191 ? ( ( t % e ) + e ) % e 3192 : Math.max( Math.min( t, e - 1 ), 0 ) ), 3193 i 3194 ); 3195 } 3196 getSlideMetrics( t ) { 3197 let i, n; 3198 const s = this.isHorizontal ? 'width' : 'height'; 3199 let o = 0, 3200 a = 0, 3201 r = t.el; 3202 const l = ! ( ! r || r.parentNode ); 3203 if ( 3204 ( r 3205 ? ( o = parseFloat( r.dataset[ s ] || '' ) || 0 ) 3206 : ( ( r = document.createElement( 'div' ) ), 3207 ( r.style.visibility = 'hidden' ), 3208 ( this.track || document.body ).prepend( r ) ), 3209 T( r, this.cn( K ) + ' ' + t.class + ' ' + t.customClass ), 3210 o ) 3211 ) { 3212 ( r.style[ s ] = `${ o }px` ), 3213 ( r.style[ 'width' === s ? 'height' : 'width' ] = '' ); 3214 } else { 3215 l && ( this.track || document.body ).prepend( r ), 3216 ( o = 3217 r.getBoundingClientRect()[ s ] * 3218 Math.max( 3219 1, 3220 ( null === ( i = window.visualViewport ) || 3221 void 0 === i 3222 ? void 0 3223 : i.scale ) || 1 3224 ) ); 3225 const t = 3226 r[ this.isHorizontal ? 'offsetWidth' : 'offsetHeight' ]; 3227 t - 1 > o && ( o = t ); 3228 } 3229 const h = getComputedStyle( r ); 3230 return ( 3231 'content-box' === h.boxSizing && 3232 ( this.isHorizontal 3233 ? ( ( o += parseFloat( h.paddingLeft ) || 0 ), 3234 ( o += parseFloat( h.paddingRight ) || 0 ) ) 3235 : ( ( o += parseFloat( h.paddingTop ) || 0 ), 3236 ( o += parseFloat( h.paddingBottom ) || 0 ) ) ), 3237 ( a = 3238 parseFloat( 3239 h[ this.isHorizontal ? 'marginRight' : 'marginBottom' ] 3240 ) || 0 ), 3241 l 3242 ? null === ( n = r.parentElement ) || 3243 void 0 === n || 3244 n.removeChild( r ) 3245 : t.el || r.remove(), 3246 { dim: e( o, 1e3 ), gap: e( a, 1e3 ) } 3247 ); 3248 } 3249 getBounds() { 3250 const { isInfinite: t, isRTL: e, isHorizontal: i, pages: n } = this; 3251 let s = { min: 0, max: 0 }; 3252 if ( t ) { 3253 s = { min: -1 / 0, max: 1 / 0 }; 3254 } else if ( n.length ) { 3255 const t = n[ 0 ].pos, 3256 o = n[ n.length - 1 ].pos; 3257 s = e && i ? { min: t, max: o } : { min: -1 * o, max: -1 * t }; 3258 } 3259 return { 3260 x: i ? s : { min: 0, max: 0 }, 3261 y: i ? { min: 0, max: 0 } : s, 3262 }; 3263 } 3264 repositionSlides() { 3265 let t, 3266 { 3267 isHorizontal: i, 3268 isRTL: n, 3269 isInfinite: s, 3270 viewport: o, 3271 viewportDim: a, 3272 contentDim: r, 3273 page: l, 3274 pages: h, 3275 slides: c, 3276 panzoom: d, 3277 } = this, 3278 u = 0, 3279 g = 0, 3280 f = 0, 3281 p = 0; 3282 d 3283 ? ( p = -1 * d.current[ this.axis ] ) 3284 : h[ l ] && ( p = h[ l ].pos || 0 ), 3285 ( t = i ? ( n ? 'right' : 'left' ) : 'top' ),
3286 n && i && ( p *= -1 ); 3287 for ( const i of c ) { 3288 const n = i.el; 3289 n 3290 ? ( 'top' === t 3291 ? ( ( n.style.right = '' ), ( n.style.left = '' ) ) 3292 : ( n.style.top = '' ), 3293 i.index !== u 3294 ? ( n.style[ t ] = 3295 0 === g ? '' : `${ e( g, 1e3 ) }px` ) 3296 : ( n.style[ t ] = '' ), 3297 ( f += i.dim + i.gap ), 3298 u++ ) 3299 : ( g += i.dim + i.gap ); 3300 } 3301 if ( s && f && o ) { 3302 const n = getComputedStyle( o ), 3303 s = 'padding', 3304 l = i ? 'Right' : 'Bottom', 3305 h = parseFloat( n[ s + ( i ? 'Left' : 'Top' ) ] ); 3306 ( p -= h ), ( a += h ), ( a += parseFloat( n[ s + l ] ) ); 3307 for ( const i of c ) { 3308 i.el && 3309 ( e( i.pos ) < e( a ) && 3310 e( i.pos + i.dim + i.gap ) < e( p ) && 3311 e( p ) > e( r - a ) && 3312 ( i.el.style[ t ] = `${ e( g + f, 1e3 ) }px` ), 3313 e( i.pos + i.gap ) >= e( r - a ) && 3314 e( i.pos ) > e( p + a ) && 3315 e( p ) < e( a ) && 3316 ( i.el.style[ t ] = `-${ e( f, 1e3 ) }px` ) ); 3317 } 3318 } 3319 let m, 3320 b, 3321 v = [ ...this.inTransition ]; 3322 if ( 3323 ( v.length > 1 && ( ( m = h[ v[ 0 ] ] ), ( b = h[ v[ 1 ] ] ) ), 3324 m && b ) 3325 ) { 3326 let i = 0; 3327 for ( const n of c ) { 3328 n.el 3329 ? this.inTransition.has( n.index ) && 3330 m.slides.indexOf( n ) < 0 && 3331 ( n.el.style[ t ] = `${ e( 3332 i + ( m.pos - b.pos ), 3333 1e3 3334 ) }px` ) 3335 : ( i += n.dim + n.gap ); 3336 } 3337 } 3338 } 3339 createSlideEl( t ) { 3340 const { track: e, slides: i } = this; 3341 if ( ! e || ! t ) { 3342 return; 3343 } 3344 if ( t.el && t.el.parentNode ) { 3345 return; 3346 } 3347 const n = t.el || document.createElement( 'div' ); 3348 T( n, this.cn( K ) ), T( n, t.class ), T( n, t.customClass ); 3349 const s = t.html; 3350 s && 3351 ( s instanceof HTMLElement 3352 ? n.appendChild( s ) 3353 : ( n.innerHTML = t.html + '' ) ); 3354 const o = [];
3355 i.forEach( ( t, e ) => { 3356 t.el && o.push( e ); 3357 } ); 3358 const a = t.index; 3359 let r = null; 3360 if ( o.length ) { 3361 r = 3362 i[ 3363 o.reduce( ( t, e ) => 3364 Math.abs( e - a ) < Math.abs( t - a ) ? e : t 3365 ) 3366 ]; 3367 } 3368 const l = 3369 r && r.el && r.el.parentNode 3370 ? r.index < t.index 3371 ? r.el.nextSibling 3372 : r.el 3373 : null; 3374 e.insertBefore( n, e.contains( l ) ? l : null ), 3375 ( t.el = n ), 3376 this.emit( 'createSlide', t ); 3377 } 3378 removeSlideEl( t, e = ! 1 ) { 3379 const i = null == t ? void 0 : t.el; 3380 if ( ! i || ! i.parentNode ) { 3381 return; 3382 } 3383 const n = this.cn( U ); 3384 if ( 3385 ( i.classList.contains( n ) && 3386 ( P( i, n ), this.emit( 'unselectSlide', t ) ), 3387 t.isDom && ! e ) 3388 ) { 3389 return ( 3390 i.removeAttribute( 'aria-hidden' ), 3391 i.removeAttribute( 'data-index' ), 3392 void ( i.style.left = '' ) 3393 ); 3394 } 3395 this.emit( 'removeSlide', t ); 3396 const s = new CustomEvent( G ); 3397 i.dispatchEvent( s ), t.el && ( t.el.remove(), ( t.el = null ) ); 3398 } 3399 transitionTo( t = 0, e = this.option( 'transition' ) ) { 3400 let i, n, s, o; 3401 if ( ! e ) { 3402 return ! 1; 3403 } 3404 const a = this.page, 3405 { pages: r, panzoom: l } = this; 3406 t = parseInt( ( t || 0 ).toString() ) || 0; 3407 const h = this.getPageFromIndex( t ); 3408 if ( 3409 ! l || 3410 ! r[ h ] || 3411 r.length < 2 || 3412 Math.abs( 3413 ( ( null === 3414 ( n = 3415 null === ( i = r[ a ] ) || void 0 === i 3416 ? void 0 3417 : i.slides[ 0 ] ) || void 0 === n 3418 ? void 0 3419 : n.dim ) || 0 ) - this.viewportDim 3420 ) > 1 3421 ) { 3422 return ! 1; 3423 } 3424 let c = t > a ? 1 : -1; 3425 this.isInfinite && 3426 ( 0 === a && t === r.length - 1 && ( c = -1 ), 3427 a === r.length - 1 && 0 === t && ( c = 1 ) ); 3428 const d = r[ h ].pos * ( this.isRTL ? 1 : -1 ); 3429 if ( a === h && Math.abs( d - l.target[ this.axis ] ) < 1 ) { 3430 return ! 1; 3431 } 3432 this.clearTransitions(); 3433 const u = l.isResting; 3434 T( this.container, this.cn( 'inTransition' ) ); 3435 const g = 3436 ( null === ( s = r[ a ] ) || void 0 === s 3437 ? void 0 3438 : s.slides[ 0 ] ) || null, 3439 f = 3440 ( null === ( o = r[ h ] ) || void 0 === o 3441 ? void 0 3442 : o.slides[ 0 ] ) || null; 3443 this.inTransition.add( f.index ), this.createSlideEl( f ); 3444 let p = g.el, 3445 m = f.el; 3446 u || e === K || ( ( e = 'fadeFast' ), ( p = null ) ); 3447 const b = this.isRTL ? 'next' : 'prev', 3448 v = this.isRTL ? 'prev' : 'next'; 3449 return ( 3450 p && 3451 ( this.inTransition.add( g.index ), 3452 ( g.transition = e ), 3453 p.addEventListener( G, this.onAnimationEnd ), 3454 p.classList.add( `f-${ e }Out`, `to-${ c > 0 ? v : b }` ) ), 3455 m && 3456 ( ( f.transition = e ), 3457 m.addEventListener( G, this.onAnimationEnd ), 3458 m.classList.add( 3459 `f-${ e }In`, 3460 `from-${ c > 0 ? b : v }` 3461 ) ), 3462 ( l.current[ this.axis ] = d ), 3463 ( l.target[ this.axis ] = d ), 3464 l.requestTick(), 3465 this.onChange( h ), 3466 ! 0 3467 ); 3468 } 3469 manageSlideVisiblity() { 3470 const t = new Set(), 3471 e = new Set(), 3472 i = this.getVisibleSlides( 3473 parseFloat( this.option( 'preload', 0 ) + '' ) || 0 3474 ); 3475 for ( const n of this.slides ) { 3476 i.has( n ) ? t.add( n ) : e.add( n ); 3477 } 3478 for ( const e of this.inTransition ) { 3479 t.add( this.slides[ e ] ); 3480 } 3481 for ( const e of t ) { 3482 this.createSlideEl( e ), this.lazyLoadSlide( e ); 3483 } 3484 for ( const i of e ) { 3485 t.has( i ) || this.removeSlideEl( i ); 3486 } 3487 this.markSelectedSlides(), this.repositionSlides(); 3488 } 3489 markSelectedSlides() { 3490 if ( 3491 ! this.pages[ this.page ] || 3492 ! this.pages[ this.page ].slides 3493 ) { 3494 return; 3495 } 3496 const t = 'aria-hidden'; 3497 const e = this.cn( U ); 3498 if ( e ) { 3499 for ( const i of this.slides ) { 3500 const n = i.el; 3501 n && 3502 ( ( n.dataset.index = `${ i.index }` ), 3503 n.classList.contains( 'f-thumbs__slide' ) 3504 ? this.getVisibleSlides( 0 ).has( i ) 3505 ? n.removeAttribute( t ) 3506 : n.setAttribute( t, 'true' ) 3507 : this.pages[ this.page ].slides.includes( i ) 3508 ? ( n.classList.contains( e ) || 3509 ( T( n, e ), 3510 this.emit( 'selectSlide', i ) ), 3511 n.removeAttribute( t ) ) 3512 : ( n.classList.contains( e ) && 3513 ( P( n, e ),
3514 this.emit( 'unselectSlide', i ) ), 3515 n.setAttribute( t, 'true' ) ) ); 3516 } 3517 } 3518 } 3519 flipInfiniteTrack() { 3520 const { 3521 axis: t, 3522 isHorizontal: e, 3523 isInfinite: i, 3524 isRTL: n, 3525 viewportDim: s, 3526 contentDim: o, 3527 } = this, 3528 a = this.panzoom; 3529 if ( ! a || ! i ) { 3530 return; 3531 } 3532 let r = a.current[ t ], 3533 l = a.target[ t ] - r, 3534 h = 0, 3535 c = 0.5 * s; 3536 n && e 3537 ? ( r < -c && ( ( h = -1 ), ( r += o ) ), 3538 r > o - c && ( ( h = 1 ), ( r -= o ) ) ) 3539 : ( r > c && ( ( h = 1 ), ( r -= o ) ), 3540 r < -o + c && ( ( h = -1 ), ( r += o ) ) ), 3541 h && ( ( a.current[ t ] = r ), ( a.target[ t ] = r + l ) ); 3542 } 3543 lazyLoadImg( t, e ) { 3544 const i = this, 3545 s = 'f-fadeIn', 3546 o = 'is-preloading'; 3547 let a = ! 1, 3548 r = null; 3549 const l = () => { 3550 a || 3551 ( ( a = ! 0 ), 3552 r && ( r.remove(), ( r = null ) ), 3553 P( e, o ), 3554 e.complete && 3555 ( T( e, s ), 3556 setTimeout( () => { 3557 P( e, s ); 3558 }, 350 ) ), 3559 this.option( 'adaptiveHeight' ) && 3560 t.el && 3561 this.pages[ this.page ].slides.indexOf( t ) > -1 && 3562 ( i.updateMetrics(), i.setViewportHeight() ), 3563 this.emit( 'load', t ) ); 3564 }; 3565 T( e, o ), 3566 ( e.src = e.dataset.lazySrcset || e.dataset.lazySrc || '' ), 3567 delete e.dataset.lazySrc, 3568 delete e.dataset.lazySrcset, 3569 e.addEventListener( 'error', () => { 3570 l(); 3571 } ), 3572 e.addEventListener( 'load', () => { 3573 l(); 3574 } ), 3575 setTimeout( () => { 3576 const i = e.parentNode; 3577 i && 3578 t.el && 3579 ( e.complete 3580 ? l() 3581 : a || ( ( r = n( w ) ), i.insertBefore( r, e ) ) ); 3582 }, 300 ); 3583 } 3584 lazyLoadSlide( t ) { 3585 const e = t && t.el; 3586 if ( ! e ) { 3587 return; 3588 } 3589 const i = new Set(); 3590 const n = Array.from( 3591 e.querySelectorAll( '[data-lazy-src],[data-lazy-srcset]' ) 3592 ); 3593 e.dataset.lazySrc && n.push( e ), 3594 n.map( ( t ) => { 3595 t instanceof HTMLImageElement 3596 ? i.add( t ) 3597 : t instanceof HTMLElement && 3598 t.dataset.lazySrc && 3599 ( ( t.style.backgroundImage = `url('${ t.dataset.lazySrc }')` ), 3600 delete t.dataset.lazySrc ); 3601 } ); 3602 for ( const e of i ) { 3603 this.lazyLoadImg( t, e ); 3604 } 3605 } 3606 onAnimationEnd( t ) { 3607 let e; 3608 const i = t.target, 3609 n = i ? parseInt( i.dataset.index || '', 10 ) || 0 : -1, 3610 s = this.slides[ n ], 3611 o = t.animationName; 3612 if ( ! i || ! s || ! o ) { 3613 return; 3614 } 3615 const a = !! this.inTransition.has( n ) && s.transition; 3616 a && 3617 o.substring( 0, a.length + 2 ) === `f-${ a }` && 3618 this.inTransition.delete( n ), 3619 this.inTransition.size || this.clearTransitions(), 3620 n === this.page && 3621 ( null === ( e = this.panzoom ) || void 0 === e 3622 ? void 0 3623 : e.isResting ) && 3624 this.emit( 'settle' ); 3625 } 3626 onDecel( t, e = 0, i = 0, n = 0, s = 0 ) { 3627 if ( this.option( 'dragFree' ) ) { 3628 return void this.setPageFromPosition(); 3629 } 3630 const { isRTL: o, isHorizontal: a, axis: r, pages: l } = this, 3631 h = l.length, 3632 c = Math.abs( Math.atan2( i, e ) / ( Math.PI / 180 ) ); 3633 let d = 0; 3634 if ( 3635 ( ( d = c > 45 && c < 135 ? ( a ? 0 : i ) : a ? e : 0 ), ! h ) 3636 ) { 3637 return; 3638 } 3639 let u = this.page, 3640 g = o && a ? 1 : -1; 3641 const f = t.current[ r ] * g; 3642 const { pageIndex: p } = this.getPageFromPosition( f ); 3643 Math.abs( d ) > 5 3644 ? ( l[ u ].dim < 3645 document.documentElement[ 3646 'client' + 3647 ( this.isHorizontal ? 'Width' : 'Height' ) 3648 ] - 3649 1 && ( u = p ), 3650 ( u = 3651 o && a 3652 ? d < 0 3653 ? u - 1 3654 : u + 1 3655 : d < 0 3656 ? u + 1 3657 : u - 1 ) ) 3658 : ( u = 0 === n && 0 === s ? u : p ), 3659 this.slideTo( u, { 3660 transition: ! 1, 3661 friction: t.option( 'decelFriction' ), 3662 } ); 3663 } 3664 onClick( t ) { 3665 const e = t.target, 3666 i = e && x( e ) ? e.dataset : null; 3667 let n, s; 3668 i && 3669 ( void 0 !== i.carouselPage 3670 ? ( ( s = 'slideTo' ), ( n = i.carouselPage ) ) 3671 : void 0 !== i.carouselNext 3672 ? ( s = 'slideNext' ) 3673 : void 0 !== i.carouselPrev && ( s = 'slidePrev' ) ), 3674 s 3675 ? ( t.preventDefault(), 3676 t.stopPropagation(), 3677 e && ! e.hasAttribute( 'disabled' ) && this[ s ]( n ) )
3678 : this.emit( 'click', t ); 3679 } 3680 onSlideTo( t ) { 3681 const e = t.detail || 0; 3682 this.slideTo( this.getPageForSlide( e ), { friction: 0 } ); 3683 } 3684 onChange( t, e = 0 ) { 3685 const i = this.page; 3686 ( this.prevPage = i ), 3687 ( this.page = t ), 3688 this.option( 'adaptiveHeight' ) && this.setViewportHeight(), 3689 t !== i && 3690 ( this.markSelectedSlides(), 3691 this.emit( 'change', t, i, e ) ); 3692 } 3693 onRefresh() { 3694 const t = this.contentDim, 3695 e = this.viewportDim; 3696 this.updateMetrics(), 3697 ( this.contentDim === t && this.viewportDim === e ) || 3698 this.slideTo( this.page, { friction: 0, transition: ! 1 } ); 3699 } 3700 onScroll() { 3701 let t; 3702 null === ( t = this.viewport ) || void 0 === t || t.scroll( 0, 0 ); 3703 } 3704 onResize() { 3705 this.option( 'breakpoints' ) && this.processOptions(); 3706 } 3707 onBeforeTransform( t ) { 3708 this.lp !== t.current[ this.axis ] && 3709 ( this.flipInfiniteTrack(), this.manageSlideVisiblity() ), 3710 ( this.lp = t.current.e ); 3711 } 3712 onEndAnimation() { 3713 this.inTransition.size || this.emit( 'settle' ); 3714 } 3715 reInit( t = null, e = null ) { 3716 this.destroy(), 3717 ( this.state = I.Init ), 3718 ( this.prevPage = null ), 3719 ( this.userOptions = t || this.userOptions ), 3720 ( this.userPlugins = e || this.userPlugins ), 3721 this.processOptions(); 3722 } 3723 slideTo( 3724 t = 0, 3725 { 3726 friction: e = this.option( 'friction' ), 3727 transition: i = this.option( 'transition' ), 3728 } = {} 3729 ) { 3730 if ( this.state === I.Destroy ) { 3731 return; 3732 } 3733 t = parseInt( ( t || 0 ).toString() ) || 0; 3734 const n = this.getPageFromIndex( t ), 3735 { 3736 axis: s, 3737 isHorizontal: o, 3738 isRTL: a, 3739 pages: r, 3740 panzoom: l, 3741 } = this, 3742 h = r.length, 3743 c = a && o ? 1 : -1; 3744 if ( ! l || ! h ) { 3745 return; 3746 } 3747 if ( this.page !== n ) { 3748 const e = new Event( 'beforeChange', { 3749 bubbles: ! 0, 3750 cancelable: ! 0, 3751 } ); 3752 if ( 3753 ( this.emit( 'beforeChange', e, t ), e.defaultPrevented ) 3754 ) { 3755 return; 3756 } 3757 } 3758 if ( this.transitionTo( t, i ) ) { 3759 return; 3760 } 3761 let d = r[ n ].pos; 3762 if ( this.isInfinite ) { 3763 const e = this.contentDim, 3764 i = l.target[ s ] * c; 3765 if ( 2 === h ) { 3766 d += e * Math.floor( parseFloat( t + '' ) / 2 ); 3767 } else { 3768 d = [ d, d - e, d + e ].reduce( function ( t, e ) { 3769 return Math.abs( e - i ) < Math.abs( t - i ) ? e : t; 3770 } ); 3771 } 3772 } 3773 ( d *= c ), 3774 Math.abs( l.target[ s ] - d ) < 1 || 3775 ( l.panTo( { x: o ? d : 0, y: o ? 0 : d, friction: e } ), 3776 this.onChange( n ) ); 3777 } 3778 slideToClosest( t ) { 3779 if ( this.panzoom ) { 3780 const { pageIndex: e } = this.getPageFromPosition(); 3781 this.slideTo( e, t ); 3782 } 3783 } 3784 slideNext() { 3785 this.slideTo( this.page + 1 ); 3786 } 3787 slidePrev() { 3788 this.slideTo( this.page - 1 ); 3789 } 3790 clearTransitions() { 3791 this.inTransition.clear(), 3792 P( this.container, this.cn( 'inTransition' ) ); 3793 const t = [ 'to-prev', 'to-next', 'from-prev', 'from-next' ]; 3794 for ( const e of this.slides ) { 3795 const i = e.el; 3796 if ( i ) { 3797 i.removeEventListener( G, this.onAnimationEnd ), 3798 i.classList.remove( ...t ); 3799 const n = e.transition; 3800 n && i.classList.remove( `f-${ n }Out`, `f-${ n }In` ); 3801 } 3802 } 3803 this.manageSlideVisiblity(); 3804 } 3805 addSlide( t, e ) { 3806 let i, n, s, o; 3807 const a = this.panzoom, 3808 r = 3809 ( null === ( i = this.pages[ this.page ] ) || void 0 === i 3810 ? void 0 3811 : i.pos ) || 0, 3812 l = 3813 ( null === ( n = this.pages[ this.page ] ) || void 0 === n 3814 ? void 0 3815 : n.dim ) || 0, 3816 h = this.contentDim < this.viewportDim; 3817 const c = Array.isArray( e ) ? e : [ e ]; 3818 const d = []; 3819 for ( const t of c ) { 3820 d.push( B( t ) ); 3821 } 3822 this.slides.splice( t, 0, ...d ); 3823 for ( let t = 0; t < this.slides.length; t++ ) { 3824 this.slides[ t ].index = t; 3825 } 3826 for ( const t of d ) { 3827 this.emit( 'beforeInitSlide', t, t.index ); 3828 } 3829 if ( 3830 ( this.page >= t && ( this.page += d.length ), 3831 this.updateMetrics(), 3832 a ) 3833 ) { 3834 const e = 3835 ( null === ( s = this.pages[ this.page ] ) || 3836 void 0 === s 3837 ? void 0 3838 : s.pos ) || 0, 3839 i = 3840 ( null === ( o = this.pages[ this.page ] ) || 3841 void 0 === o 3842 ? void 0 3843 : o.dim ) || 0, 3844 n = this.pages.length || 1, 3845 c = this.isRTL ? l - i : i - l, 3846 d = this.isRTL ? r - e : e - r; 3847 h && 1 === n 3848 ? ( t <= this.page && 3849 ( ( a.current[ this.axis ] -= c ), 3850 ( a.target[ this.axis ] -= c ) ), 3851 a.panTo( { [ this.isHorizontal ? 'x' : 'y' ]: -1 * e } ) ) 3852 : d && 3853 t <= this.page && 3854 ( ( a.target[ this.axis ] -= d ), 3855 ( a.current[ this.axis ] -= d ), 3856 a.requestTick() ); 3857 } 3858 for ( const t of d ) {
3859 this.emit( 'initSlide', t, t.index ); 3860 } 3861 } 3862 prependSlide( t ) { 3863 this.addSlide( 0, t ); 3864 } 3865 appendSlide( t ) { 3866 this.addSlide( this.slides.length, t ); 3867 } 3868 removeSlide( t ) { 3869 const e = this.slides.length; 3870 t = ( ( t % e ) + e ) % e; 3871 const i = this.slides[ t ]; 3872 if ( i ) { 3873 this.removeSlideEl( i, ! 0 ), this.slides.splice( t, 1 ); 3874 for ( let t = 0; t < this.slides.length; t++ ) { 3875 this.slides[ t ].index = t; 3876 } 3877 this.updateMetrics(), 3878 this.slideTo( this.page, { friction: 0, transition: ! 1 } ), 3879 this.emit( 'destroySlide', i ); 3880 } 3881 } 3882 updateMetrics() { 3883 const { 3884 panzoom: t, 3885 viewport: i, 3886 track: n, 3887 slides: s, 3888 isHorizontal: o, 3889 isInfinite: a, 3890 } = this; 3891 if ( ! n ) { 3892 return; 3893 } 3894 const r = o ? 'width' : 'height', 3895 l = o ? 'offsetWidth' : 'offsetHeight'; 3896 if ( i ) { 3897 let t = Math.max( 3898 i[ l ], 3899 e( i.getBoundingClientRect()[ r ], 1e3 ) 3900 ), 3901 n = getComputedStyle( i ), 3902 s = 'padding', 3903 a = o ? 'Right' : 'Bottom'; 3904 ( t -= 3905 parseFloat( n[ s + ( o ? 'Left' : 'Top' ) ] ) + 3906 parseFloat( n[ s + a ] ) ), 3907 ( this.viewportDim = t ); 3908 } 3909 let h, 3910 c = 0; 3911 for ( const [ t, i ] of s.entries() ) { 3912 let n = 0, 3913 o = 0; 3914 ! i.el && h 3915 ? ( ( n = h.dim ), ( o = h.gap ) ) 3916 : ( ( { dim: n, gap: o } = this.getSlideMetrics( i ) ), 3917 ( h = i ) ), 3918 ( n = e( n, 1e3 ) ), 3919 ( o = e( o, 1e3 ) ), 3920 ( i.dim = n ), 3921 ( i.gap = o ), 3922 ( i.pos = c ), 3923 ( c += n ), 3924 ( a || t < s.length - 1 ) && ( c += o ); 3925 } 3926 ( c = e( c, 1e3 ) ), 3927 ( this.contentDim = c ), 3928 t && 3929 ( ( t.contentRect[ r ] = c ), 3930 ( t.contentRect[ o ? 'fullWidth' : 'fullHeight' ] = c ) ), 3931 ( this.pages = this.createPages() ), 3932 ( this.pages = this.processPages() ), 3933 this.state === I.Init && this.setInitialPage(), 3934 ( this.page = Math.max( 3935 0, 3936 Math.min( this.page, this.pages.length - 1 ) 3937 ) ), 3938 this.manageSlideVisiblity(), 3939 this.emit( 'refresh' ); 3940 } 3941 getProgress( t, i = ! 1, n = ! 1 ) { 3942 void 0 === t && ( t = this.page ); 3943 const s = this, 3944 o = s.panzoom, 3945 a = s.contentDim, 3946 r = s.pages[ t ] || 0; 3947 if ( ! r || ! o ) { 3948 return t > this.page ? -1 : 1; 3949 } 3950 let l = -1 * o.current.e, 3951 h = e( ( l - r.pos ) / ( 1 * r.dim ), 1e3 ), 3952 c = h, 3953 d = h; 3954 this.isInfinite && 3955 ! 0 !== n && 3956 ( ( c = e( ( l - r.pos + a ) / ( 1 * r.dim ), 1e3 ) ), 3957 ( d = e( ( l - r.pos - a ) / ( 1 * r.dim ), 1e3 ) ) ); 3958 const u = [ h, c, d ].reduce( function ( t, e ) { 3959 return Math.abs( e ) < Math.abs( t ) ? e : t; 3960 } ); 3961 return i ? u : u > 1 ? 1 : u < -1 ? -1 : u; 3962 } 3963 setViewportHeight() { 3964 const { page: t, pages: e, viewport: i, isHorizontal: n } = this; 3965 if ( ! i || ! e[ t ] ) { 3966 return; 3967 } 3968 let s = 0; 3969 n && 3970 this.track && 3971 ( ( this.track.style.height = 'auto' ), 3972 e[ t ].slides.forEach( ( t ) => { 3973 t.el && ( s = Math.max( s, t.el.offsetHeight ) ); 3974 } ) ), 3975 ( i.style.height = s ? `${ s }px` : '' ); 3976 } 3977 getPageForSlide( t ) { 3978 for ( const e of this.pages ) { 3979 for ( const i of e.slides ) { 3980 if ( i.index === t ) { 3981 return e.index; 3982 } 3983 } 3984 } 3985 return -1; 3986 } 3987 getVisibleSlides( t = 0 ) { 3988 let e; 3989 const i = new Set(); 3990 let { 3991 panzoom: n, 3992 contentDim: s, 3993 viewportDim: o, 3994 pages: a, 3995 page: r, 3996 } = this; 3997 if ( o ) { 3998 s = 3999 s + 4000 ( null === 4001 ( e = this.slides[ this.slides.length - 1 ] ) || 4002 void 0 === e 4003 ? void 0 4004 : e.gap ) || 0; 4005 let l = 0; 4006 ( l = 4007 n && n.state !== m.Init && n.state !== m.Destroy 4008 ? -1 * n.current[ this.axis ] 4009 : ( a[ r ] && a[ r ].pos ) || 0 ), 4010 this.isInfinite && ( l -= Math.floor( l / s ) * s ), 4011 this.isRTL && this.isHorizontal && ( l *= -1 ); 4012 const h = l - o * t, 4013 c = l + o * ( t + 1 ), 4014 d = this.isInfinite ? [ -1, 0, 1 ] : [ 0 ]; 4015 for ( const t of this.slides ) { 4016 for ( const e of d ) { 4017 const n = t.pos + e * s, 4018 o = n + t.dim + t.gap; 4019 n < c && o > h && i.add( t ); 4020 } 4021 } 4022 } 4023 return i; 4024 } 4025 getPageFromPosition( t ) { 4026 const { 4027 viewportDim: e, 4028 contentDim: i, 4029 slides: n, 4030 pages: s, 4031 panzoom: o, 4032 } = this, 4033 a = s.length, 4034 r = n.length, 4035 l = n[ 0 ], 4036 h = n[ r - 1 ], 4037 c = this.option( 'center' ); 4038 let d = 0, 4039 u = 0, 4040 g = 0, 4041 f = 4042 void 0 === t 4043 ? -1 * 4044 ( ( null == o ? void 0 : o.target[ this.axis ] ) || 4045 0 ) 4046 : t; 4047 c && ( f += 0.5 * e ), 4048 this.isInfinite 4049 ? ( f < l.pos - 0.5 * h.gap && ( ( f -= i ), ( g = -1 ) ), 4050 f > h.pos + h.dim + 0.5 * h.gap && 4051 ( ( f -= i ), ( g = 1 ) ) ) 4052 : ( f = Math.max( l.pos || 0, Math.min( f, h.pos ) ) ); 4053 let p = h, 4054 m = n.find( ( t ) => { 4055 const e = t.pos - 0.5 * p.gap, 4056 i = t.pos + t.dim + 0.5 * t.gap; 4057 return ( p = t ), f >= e && f < i; 4058 } ); 4059 return ( 4060 m || ( m = h ), 4061 ( u = this.getPageForSlide( m.index ) ), 4062 ( d = u + g * a ), 4063 { page: d, pageIndex: u } 4064 ); 4065 } 4066 setPageFromPosition() { 4067 const { pageIndex: t } = this.getPageFromPosition(); 4068 this.onChange( t ); 4069 } 4070 destroy() { 4071 if ( [ I.Destroy ].includes( this.state ) ) { 4072 return; 4073 } 4074 this.state = I.Destroy; 4075 const { 4076 container: t, 4077 viewport: e, 4078 track: i, 4079 slides: n, 4080 panzoom: s, 4081 } = this, 4082 o = this.option( 'classes' ); 4083 t.removeEventListener( 'click', this.onClick, { 4084 passive: ! 1, 4085 capture: ! 1, 4086 } ), 4087 t.removeEventListener( 'slideTo', this.onSlideTo ), 4088 window.removeEventListener( 'resize', this.onResize ), 4089 s && ( s.destroy(), ( this.panzoom = null ) ), 4090 n &&
4091 n.forEach( ( t ) => { 4092 this.removeSlideEl( t ); 4093 } ), 4094 this.detachPlugins(), 4095 e && 4096 ( e.removeEventListener( 'scroll', this.onScroll ), 4097 e.offsetParent && 4098 i && 4099 i.offsetParent && 4100 e.replaceWith( ...i.childNodes ) ); 4101 for ( const [ e, i ] of Object.entries( o ) ) { 4102 'container' !== e && i && t.classList.remove( i ); 4103 } 4104 ( this.track = null ), 4105 ( this.viewport = null ), 4106 ( this.page = 0 ), 4107 ( this.slides = [] ); 4108 const a = this.events.get( 'ready' ); 4109 ( this.events = new Map() ), a && this.events.set( 'ready', a ); 4110 } 4111 } 4112 Object.defineProperty( J, 'Panzoom', { 4113 enumerable: ! 0, 4114 configurable: ! 0, 4115 writable: ! 0, 4116 value: R, 4117 } ), 4118 Object.defineProperty( J, 'defaults', { 4119 enumerable: ! 0, 4120 configurable: ! 0, 4121 writable: ! 0, 4122 value: F, 4123 } ), 4124 Object.defineProperty( J, 'Plugins', { 4125 enumerable: ! 0, 4126 configurable: ! 0, 4127 writable: ! 0, 4128 value: _, 4129 } ), 4130 ( t.ModulaCarousel = J ), 4131 ( t.Panzoom = R ); 4132} );
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.