1((() => { 2 var t = 0; 3 function s() { 4 var i = 5 window.channelHtml18pro && 6 window.channelHtml18pro.productViewer && 7 window.channelHtml18pro.productViewer.instances, 8 e = (i ? Object.keys(i) : []).filter(function (e) { 9 e = i[e] && i[e].productViewerCore; 10 return e && e.cachedControls && 0 < e.cachedControls.length; 11 }); 12 if (!e.length) return 100 < ++t ? void 0 : void setTimeout(s, 100); 13 e.forEach(function (e) { 14 var t, 15 e = i[e].productViewerCore; 16 ("function" != 17 typeof (t = e)._setAccessibilityContainersFallbackAriaLabels || 18 t.__ariaLabelEnhancementFix || 19 ((t._setAccessibilityContainersFallbackAriaLabels = function (i) { 20 var e = this.productViewer || {}, 21 t = e.channelContainer, 22 s = !!t && t.classList.contains("enhanced"), 23 r = !!e.isSmall; 24 (this.cachedControls || []).forEach(function (e) { 25 var t = e.accessibilityContainer && e.accessibilityContainer.media; 26 if (t && e.el) { 27 if (i) { 28 if (e.el.dataset.mtype !== i) return; 29 } else if ("color-selector" === e.el.dataset.type) return; 30 ((e = t.dataset), 31 (e = s 32 ? (r && e.ariaLabelSmall) || e.ariaLabel 33 : (r && e.ariaLabelSmallFallback) || e.ariaLabelFallback)); 34 e && t.setAttribute("aria-label", e); 35 } 36 }); 37 }), 38 (t.__ariaLabelEnhancementFix = !0)), 39 e._setAccessibilityContainersFallbackAriaLabels()); 40 }); 41 } 42 "loading" === document.readyState 43 ? document.addEventListener("DOMContentLoaded", s) 44 : s(); 45})(), 46 (() => { 47 function e(e) { 48 var t; 49 return function () { 50 return (t = "u" < typeof t ? e.apply(this, arguments) : t); 51 }; 52 } 53 function t() { 54 var e = R.getDocument().createElement("canvas"); 55 return !("function" != typeof e.getContext || !e.getContext("2d")); 56 } 57 var R = (L = { 58 getWindow: function () { 59 return window; 60 }, 61 getDocument: function () { 62 return document; 63 }, 64 getNavigator: function () { 65 return navigator; 66 }, 67 }), 68 i = e, 69 i = 70 (((s = { exports: {} }).exports = i(t)), 71 (s.exports.original = t), 72 s.exports), 73 s = { exports: {} }; 74 let N = function (e) { 75 var t, 76 i = {}; 77 for (t in e) 78 i[t] = e[t].reduce( 79 function (e, t) { 80 return ((e[t.name] = !1), e); 81 }, 82 { 83 version: { 84 string: "", 85 major: 0, 86 minor: 0, 87 patch: 0, 88 documentMode: !1, 89 }, 90 }, 91 ); 92 return i; 93 }, 94 r = { 95 browser: [ 96 { 97 name: "edge", 98 userAgent: "Edge", 99 version: ["rv", "Edge"], 100 test: function (e) { 101 return ( 102 -1 < e.ua.indexOf("Edge") || 103 "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" === e.ua 104 ); 105 }, 106 }, 107 { 108 name: "edgeChromium", 109 userAgent: "Edge", 110 version: ["rv", "Edg"], 111 test: function (e) { 112 return -1 < e.ua.indexOf("Edg") && -1 === e.ua.indexOf("Edge"); 113 }, 114 }, 115 { name: "headlessChrome", userAgent: "HeadlessChrome" }, 116 { name: "chrome", userAgent: "Chrome" }, 117 { 118 name: "firefox", 119 test: function (e) { 120 return ( 121 -1 < e.ua.indexOf("Firefox") && -1 === e.ua.indexOf("Opera") 122 ); 123 }, 124 version: "Firefox", 125 }, 126 { name: "android", userAgent: "Android" }, 127 { 128 name: "safari", 129 test: function (e) { 130 return ( 131 -1 < e.ua.indexOf("Safari") && -1 < e.vendor.indexOf("Apple") 132 ); 133 }, 134 version: "Version", 135 }, 136 { 137 name: "ie", 138 test: function (e) { 139 return -1 < e.ua.indexOf("IE") || -1 < e.ua.indexOf("Trident"); 140 }, 141 version: ["MSIE", "rv"], 142 parseDocumentMode: function () { 143 let e = !1; 144 return (e = document.documentMode 145 ? parseInt(document.documentMode, 10) 146 : e); 147 }, 148 }, 149 { name: "opera", userAgent: "Opera", version: ["Version", "Opera"] }, 150 { name: "samsung", userAgent: "SamsungBrowser" }, 151 ], 152 os: [ 153 {
154 name: "windows", 155 test: function (e) { 156 return -1 < e.ua.indexOf("Windows"); 157 }, 158 version: "Windows NT", 159 }, 160 { 161 name: "osx", 162 userAgent: "Mac", 163 test: function (e) { 164 return -1 < e.ua.indexOf("Macintosh"); 165 }, 166 }, 167 { 168 name: "ios", 169 test: function (e) { 170 return -1 < e.ua.indexOf("iPhone") || -1 < e.ua.indexOf("iPad"); 171 }, 172 version: ["iPhone OS", "CPU OS"], 173 }, 174 { 175 name: "linux", 176 userAgent: "Linux", 177 test: function (e) { 178 return ( 179 (-1 < e.ua.indexOf("Linux") || 180 -1 < e.platform.indexOf("Linux")) && 181 -1 === e.ua.indexOf("Android") 182 ); 183 }, 184 }, 185 { 186 name: "fireos", 187 test: function (e) { 188 return ( 189 -1 < e.ua.indexOf("Firefox") && -1 < e.ua.indexOf("Mobile") 190 ); 191 }, 192 version: "rv", 193 }, 194 { 195 name: "android", 196 userAgent: "Android", 197 test: function (e) { 198 return -1 < e.ua.indexOf("Android"); 199 }, 200 }, 201 { name: "chromeos", userAgent: "CrOS" }, 202 ], 203 }; 204 function F(e, i) { 205 if ("function" == typeof e.parseVersion) return e.parseVersion(i); 206 { 207 let t = e.version || e.userAgent; 208 var s = (t = "string" == typeof t ? [t] : t).length; 209 for (let e = 0; e < s; e++) 210 if ( 211 (r = i.match( 212 ((r = t[e]), new RegExp(r + "[a-zA-Z\\s/:]+([0-9_.]+)", "i")), 213 )) && 214 1 < r.length 215 ) 216 return r[1].replace(/_/g, "."); 217 } 218 var r; 219 return !1; 220 } 221 function n(t, i, s) { 222 var r, 223 n = t.length; 224 let o, a; 225 for (let e = 0; e < n; e++) 226 if ( 227 ("function" == typeof t[e].test 228 ? !0 === t[e].test(s) && (o = t[e].name) 229 : -1 < s.ua.indexOf(t[e].userAgent) && (o = t[e].name), 230 o) 231 ) 232 return ( 233 (i[o] = !0), 234 "string" == typeof (a = F(t[e], s.ua)) 235 ? ((r = a.split(".")), 236 (i.version.string = a), 237 r && 238 0 < r.length && 239 ((i.version.major = parseInt(r[0] || 0)), 240 (i.version.minor = parseInt(r[1] || 0)), 241 (i.version.patch = parseInt(r[2] || 0)))) 242 : "edge" === o && 243 ((i.version.string = "12.0.0"), 244 (i.version.major = "12"), 245 (i.version.minor = "0"), 246 (i.version.patch = "0")), 247 "function" == typeof t[e].parseDocumentMode && 248 (i.version.documentMode = t[e].parseDocumentMode()), 249 i 250 ); 251 return i; 252 } 253 var o = function (e) { 254 var t = {}, 255 i = N(r); 256 return ( 257 (t.browser = n(r.browser, i.browser, e)), 258 (t.os = n(r.os, i.os, e)), 259 t 260 ); 261 }, 262 a = 263 typeof window < "u" 264 ? window.navigator 265 : { userAgent: "", platform: "", vendor: "" }, 266 o = o({ ua: a.userAgent, platform: a.platform, vendor: a.vendor }), 267 a = 268 (a = o) && 269 a.__esModule && 270 Object.prototype.hasOwnProperty.call(a, "default") 271 ? a.default 272 : a, 273 l = L, 274 h = e; 275 function c() { 276 var e = l.getWindow(), 277 t = l.getDocument(), 278 i = l.getNavigator(); 279 return !!( 280 "ontouchstart" in e || 281 (e.DocumentTouch && t instanceof e.DocumentTouch) || 282 0 < i.maxTouchPoints || 283 0 < i.msMaxTouchPoints 284 ); 285 } 286 (((u = { exports: {} }).exports = h(c)), (u.exports.original = c)); 287 var d = o, 288 B = (h = u.exports).original, 289 u = e; 290 function p() { 291 return !B() || (d.os.ios && 8 <= d.os.version.major) || d.browser.chrome; 292 } 293 ((s.exports = u(p)), (s.exports.original = p)); 294 var u = s.exports, 295 m = L, 296 g = e; 297 function f() { 298 var e = !1, 299 t = m.getDocument(), 300 i = m.getNavigator();
301 try { 302 "cookie" in t && 303 i.cookieEnabled && 304 ((t.cookie = "ac_feature_cookie=1"), 305 (e = -1 !== t.cookie.indexOf("ac_feature_cookie")), 306 (t.cookie = 307 "ac_feature_cookie=; expires=Thu, 01 Jan 1970 00:00:01 GMT;")); 308 } catch {} 309 return e; 310 } 311 function U() { 312 this.initialize(); 313 } 314 function G(e, t) { 315 var i = Z(e), 316 s = !1 !== t && Z(t); 317 return ((C[e] = C[t] = C[i] = C[s] = { dom: t, css: s }), t); 318 } 319 function K(e) { 320 var t, i, s, r; 321 if ((e += "") in C) return C[e].dom; 322 for ( 323 s = X(), 324 i = (e = Q(e)).charAt(0).toUpperCase() + e.substring(1), 325 t = 326 "filter" === e 327 ? ["WebkitFilter", "filter"] 328 : (e + " " + $.dom.join(i + " ") + i).split(" "), 329 r = 0; 330 r < t.length; 331 r++ 332 ) 333 if (typeof s.style[t[r]] < "u") 334 return (0 !== r && $.reduce(r - 1), G(e, t[r])); 335 return G(e, !1); 336 } 337 (((s = { exports: {} }).exports = g(f)), (s.exports.original = f)); 338 var v, 339 H, 340 y, 341 g = s.exports, 342 s = { exports: {} }, 343 w = {}, 344 _ = 345 (((_ = { exports: {} }).exports = function () { 346 return ( 347 v 348 ? ((v.style.cssText = ""), v.removeAttribute("style")) 349 : (v = document.createElement("_")), 350 v 351 ); 352 }), 353 (_.exports.resetElement = function () { 354 v = null; 355 }), 356 _.exports), 357 W = /^(webkit|moz|ms)/gi, 358 z = /-([a-z])/g, 359 q = ["-webkit-", "-moz-", "-ms-"], 360 Y = ["Webkit", "Moz", "ms"], 361 j = ["webkit", "moz", "ms"], 362 A = 363 (((A = U.prototype).initialize = function () { 364 ((this.reduced = !1), (this.css = q), (this.dom = Y), (this.evt = j)); 365 }), 366 (A.reduce = function (e) { 367 this.reduced || 368 ((this.reduced = !0), 369 (this.css = [this.css[e]]), 370 (this.dom = [this.dom[e]]), 371 (this.evt = [this.evt[e]])); 372 }), 373 new U()), 374 C = w, 375 X = _, 376 Z = function (e) { 377 return "cssfloat" === e.toLowerCase() 378 ? "float" 379 : (e = W.test(e) ? "-" + e : e) 380 .replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2") 381 .replace(/([a-z\d])([A-Z])/g, "$1-$2") 382 .toLowerCase(); 383 }, 384 Q = function (e) { 385 return "float" === e.toLowerCase() 386 ? "cssFloat" 387 : (e = 388 "Ms" === 389 (e = e.replace(z, function (e, t) { 390 return t.toUpperCase(); 391 })).substr(0, 2) 392 ? "ms" + e.substring(2) 393 : e); 394 }, 395 $ = A, 396 J = w, 397 ee = _, 398 E = !1; 399 function b(n, e) { 400 var o; 401 return ( 402 (e += ""), 403 !!(n = te(n)) && 404 (ie(n, e) || 405 ((o = re[n].css), 406 "" !== 407 (e = (e = e.replace(oe, function (t) { 408 var e, i, s, r; 409 if ("#" === t[0] || !isNaN(t[0])) return t; 410 if (((i = t.replace(ne, "")), (s = o + ":" + i) in x)) 411 return !1 === x[s] ? "" : t.replace(i, x[s]); 412 for ( 413 e = se.css.map(function (e) { 414 return e + t; 415 }), 416 e = [t].concat(e), 417 r = 0; 418 r < e.length; 419 r++ 420 ) 421 if (ie(n, e[r])) 422 return ( 423 0 !== r && se.reduce(r - 1), 424 (x[s] = e[r].replace(ne, "")), 425 e[r] 426 ); 427 return ((x[s] = !1), ""); 428 })).trim()))) && 429 e 430 ); 431 } 432 (((M = { exports: {} }).exports = function (e, t) { 433 var i, s; 434 if (!E) { 435 ((E = !0), 436 (H = "CSS" in window && "supports" in window.CSS), 437 (y = !1), 438 (s = ee())); 439 try {
440 s.style.width = "invalid"; 441 } catch { 442 y = !0; 443 } 444 } 445 if (H) return ((e = J[e].css), CSS.supports(e, t)); 446 if (((i = (s = ee()).style[e]), y)) 447 try { 448 s.style[e] = t; 449 } catch { 450 return !1; 451 } 452 else s.style[e] = t; 453 return s.style[e] && s.style[e] !== i; 454 }), 455 (M.exports.resetFlags = function () { 456 E = !1; 457 })); 458 var te = K, 459 ie = M.exports, 460 se = A, 461 re = w, 462 x = {}, 463 ne = /(\([^\)]+\))/gi, 464 oe = /([^ ,;\(]+(\([^\)]+\))?)/gi, 465 ae = b, 466 _ = e; 467 function le() { 468 return [ 469 "linear-gradient(to bottom right, #9f9, white)", 470 "linear-gradient(top left, #9f9, white)", 471 "gradient(linear, left top, right bottom, from(#9f9), to(white))", 472 ].some(function (e) { 473 return !!ae("background-image", e); 474 }); 475 } 476 function he() { 477 for (var e = "", t = 0; t < arguments.length; t++) 478 (0 < t && (e += ","), (e += arguments[t])); 479 return e; 480 } 481 function S(i, s) { 482 function r() { 483 var e = arguments, 484 t = s.apply(this, e); 485 return (t in r.cache || (r.cache[t] = i.apply(this, e)), r.cache[t]); 486 } 487 return ((s = s || he), (r.cache = {}), r); 488 } 489 ((s.exports = _(le)), (s.exports.original = le)); 490 var M = s.exports, 491 ce = b, 492 de = K, 493 _ = S; 494 function ue(e, t) { 495 return typeof t < "u" ? !!ce(e, t) : !!de(e); 496 } 497 (((w = { exports: {} }).exports = _(ue)), (w.exports.original = ue)); 498 var s = w.exports, 499 pe = b, 500 w = e; 501 function me() { 502 return !!pe("margin", "1vw 1vh"); 503 } 504 (((_ = { exports: {} }).exports = w(me)), (_.exports.original = me)); 505 var w = _.exports, 506 ge = L, 507 fe = S; 508 function ve(e, t) { 509 return e in ge.getDocument().createElement((t = t || "div")); 510 } 511 (((_ = { exports: {} }).exports = fe(ve)), (_.exports.original = ve)); 512 var fe = _.exports, 513 _ = { exports: {} }, 514 T = { window: window, document: document }, 515 I = function (e, t) { 516 return ( 517 (e = "on" + e), 518 t in T || (T[t] = document.createElement(t)), 519 e in (t = T[t]) || 520 ("setAttribute" in t && 521 (t.setAttribute(e, "return;"), "function" == typeof t[e])) 522 ); 523 }, 524 O = { 525 transitionend: ["webkitTransitionEnd", "MSTransitionEnd"], 526 animationstart: ["webkitAnimationStart", "MSAnimationStart"], 527 animationend: ["webkitAnimationEnd", "MSAnimationEnd"], 528 animationiteration: [ 529 "webkitAnimationIteration", 530 "MSAnimationIteration", 531 ], 532 fullscreenchange: ["MSFullscreenChange"], 533 fullscreenerror: ["MSFullscreenError"], 534 }, 535 ye = [ 536 "transitionend", 537 "animationstart", 538 "animationend", 539 "animationiteration", 540 ], 541 P = A, 542 D = {}, 543 we = function e(t, i) { 544 var s, r, n; 545 if ( 546 ((i = i || "div"), 547 (t = t.toLowerCase()), 548 i in D || (D[i] = {}), 549 t in (r = D[i])) 550 ) 551 return r[t]; 552 if (I(t, i)) return (r[t] = t); 553 if (t in O) 554 for (n = 0; n < O[t].length; n++) 555 if (((s = O[t][n]), I(s.toLowerCase(), i))) return (r[t] = s); 556 for (n = 0; n < P.evt.length; n++) 557 if (((s = P.evt[n] + t), I(s, i))) return (P.reduce(n), (r[t] = s)); 558 return "window" !== i && ye.indexOf(t) 559 ? (r[t] = e(t, "window")) 560 : (r[t] = !1); 561 }, 562 A = S; 563 function _e(e, t) { 564 return !!we(e, t); 565 } 566 ((_.exports = A(_e)), (_.exports.original = _e)); 567 var A = _.exports, 568 _ = { exports: {} }, 569 Ae = o.os, 570 Ce = h.original, 571 Ee = L, 572 o = e; 573 function be() { 574 var e = Ee.getWindow(); 575 return (!Ce() && !e.orientation) || Ae.windows; 576 } 577 ((_.exports = o(be)), (_.exports.original = be)); 578 var o = _.exports, 579 _ = { exports: {} }, 580 V = { exports: {} }, 581 xe = o.original, 582 Se = L, 583 k = e; 584 function Me() { 585 var e = Se.getWindow(), 586 t = e.screen.width; 587 return ( 588 e.orientation && e.screen.height < t && (t = e.screen.height), 589 !xe() && 600 <= t 590 ); 591 } 592 ((V.exports = k(Me)), (V.exports.original = Me)); 593 var k = V.exports, 594 Te = o.original, 595 Ie = k.original, 596 V = e; 597 function Oe() { 598 return !Te() && !Ie(); 599 } 600 ((_.exports = V(Oe)), (_.exports.original = Oe)); 601 var V = _.exports, 602 Pe = L, 603 De = L, 604 Ve = e; 605 function ke() { 606 var e = De.getWindow(), 607 t = !1;
608 try { 609 t = !(!e.localStorage || null === e.localStorage.non_existent); 610 } catch {} 611 return t; 612 } 613 (((_ = { exports: {} }).exports = Ve(ke)), (_.exports.original = ke)); 614 var Ve = _.exports, 615 Le = L, 616 Re = e; 617 function Ne() { 618 return "HTMLMediaElement" in Le.getWindow(); 619 } 620 (((_ = { exports: {} }).exports = Re(Ne)), (_.exports.original = Ne)); 621 var Re = _.exports, 622 Fe = L, 623 Be = e; 624 function Ue() { 625 var e = Fe.getWindow().matchMedia("only all"); 626 return !(!e || !e.matches); 627 } 628 (((_ = { exports: {} }).exports = Be(Ue)), (_.exports.original = Ue)); 629 var Be = _.exports, 630 Ge = L; 631 function Ke() { 632 var e = Ge.getWindow().matchMedia("(prefers-reduced-motion)"); 633 return !(!e || !e.matches); 634 } 635 var He = L, 636 We = e; 637 function ze() { 638 var e = He.getWindow(), 639 t = !1; 640 try { 641 "sessionStorage" in e && 642 "function" == typeof e.sessionStorage.setItem && 643 (e.sessionStorage.setItem("ac_feature", "test"), 644 (t = !0), 645 e.sessionStorage.removeItem("ac_feature", "test")); 646 } catch {} 647 return t; 648 } 649 (((_ = { exports: {} }).exports = We(ze)), (_.exports.original = ze)); 650 var We = _.exports, 651 qe = L, 652 Ye = e; 653 function je() { 654 return !!qe 655 .getDocument() 656 .implementation.hasFeature( 657 "http://www.w3.org/TR/SVG11/feature#Image", 658 "1.1", 659 ); 660 } 661 (((_ = { exports: {} }).exports = Ye(je)), (_.exports.original = je)); 662 var Ye = _.exports, 663 Xe = b, 664 Ze = e; 665 function Qe() { 666 return !(!Xe("perspective", "1px") || !Xe("transform", "translateZ(0)")); 667 } 668 (((_ = { exports: {} }).exports = Ze(Qe)), (_.exports.original = Qe)); 669 var Ze = _.exports, 670 $e = L, 671 L = e; 672 function Je() { 673 var e = $e.getDocument().createElement("canvas"); 674 return ( 675 "function" == typeof e.getContext && 676 !(!e.getContext("webgl") && !e.getContext("experimental-webgl")) 677 ); 678 } 679 (((_ = { exports: {} }).exports = L(Je)), 680 (_.exports.original = Je), 681 (L = { 682 canvasAvailable: i, 683 continuousScrollEventsAvailable: u, 684 cookiesAvailable: g, 685 cssLinearGradientAvailable: M, 686 cssPropertyAvailable: s, 687 cssViewportUnitsAvailable: w, 688 elementAttributeAvailable: fe, 689 eventTypeAvailable: A, 690 isDesktop: o, 691 isHandheld: V, 692 isRetina: function () { 693 var e = Pe.getWindow(); 694 return "devicePixelRatio" in e && 1.5 <= e.devicePixelRatio; 695 }, 696 isTablet: k, 697 localStorageAvailable: Ve, 698 mediaElementsAvailable: Re, 699 mediaQueriesAvailable: Be, 700 prefersReducedMotion: Ke, 701 sessionStorageAvailable: We, 702 svgAvailable: Ye, 703 threeDTransformsAvailable: Ze, 704 touchAvailable: h, 705 webGLAvailable: _.exports, 706 }), 707 (window.channelHtml18pro = { 708 ...(window.channelHtml18pro || {}), 709 helpers: { 710 registerComponent: (r, n) => { 711 var e; 712 (window.channelHtml18pro || (window.channelHtml18pro = {}), 713 (window.channelHtml18pro[r] = { 714 ...(window.channelHtml18pro[r] || {}), 715 instances: { 716 ...((null == (e = window.channelHtml18pro[r]) 717 ? void 0 718 : e.instances) || {}), 719 }, 720 create: 721 (null == (e = window.channelHtml18pro[r]) 722 ? void 0 723 : e.create) || 724 ((e) => { 725 let { id: t, ...i } = e.detail, 726 s = window.channelHtml18pro[r].instances[t]; 727 if (s) 728 try { 729 s.destroy(); 730 } catch (e) { 731 console.error(e); 732 } 733 window.channelHtml18pro[r].instances[t] = new n(t, i); 734 }), 735 }), 736 document.removeEventListener( 737 `channel:${r}:create`, 738 window.channelHtml18pro[r].create, 739 ), 740 document.addEventListener( 741 `channel:${r}:create`, 742 window.channelHtml18pro[r].create, 743 )); 744 },
745 stringToId: (e) => 746 e 747 ? e 748 .toLowerCase() 749 .replace(/[()]/g, "") 750 .replace(/\s/g, "-") 751 .replace(/\./g, "") 752 .replace(/,/g, "") 753 : "", 754 touchAvailable: L.touchAvailable, 755 prefersReducedMotion: L.prefersReducedMotion, 756 isDesktop: L.isDesktop, 757 uaDetect: a, 758 }, 759 })); 760 })(), 761 (() => { 762 var e = { exports: {} }; 763 { 764 class Ei { 765 constructor() { 766 this._events = {}; 767 } 768 on(e, t) { 769 return ( 770 (this._events[e] = this._events[e] || []), 771 this._events[e].unshift(t), 772 t 773 ); 774 } 775 once(t, i) { 776 let s = (e) => { 777 (this.off(t, s), void 0 !== e ? i(e) : i()); 778 }; 779 return this.on(t, s); 780 } 781 off(e, t) { 782 this.has(e) && 783 (t 784 ? -1 !== (t = this._events[e].indexOf(t)) && 785 this._events[e].splice(t, 1) 786 : delete this._events[e]); 787 } 788 trigger(t, i) { 789 if (this.has(t)) 790 for (let e = this._events[t].length - 1; 0 <= e; e--) 791 void 0 !== i ? this._events[t][e](i) : this._events[t][e](); 792 } 793 has(e) { 794 return e in this._events && 0 !== this._events[e].length; 795 } 796 destroy() { 797 this._events = null; 798 } 799 } 800 e.exports = Ei.EventEmitterMicro = Ei; 801 } 802 function R(e) { 803 return e.startsWith("--") 804 ? e 805 : e.replace(/[A-Z]/g, (e) => "-" + e.toLowerCase()); 806 } 807 let N = e.exports, 808 F = { 809 GUI_INSTANCE: null, 810 ANIM_INSTANCE: null, 811 cssDimensionsTracker: null, 812 LOCAL_STORAGE_KEYS: { 813 GuiPosition: "anim-ui.position", 814 GroupCollapsedStates: "anim-ui.group-collapsed-states", 815 scrollY: "anim-ui.scrollY-position", 816 path: "anim-ui.path", 817 }, 818 RESIZE_TIMEOUT: -1, 819 BREAKPOINTS: [ 820 { name: "S", mediaQuery: "only screen and (max-width: 734px)" }, 821 { name: "M", mediaQuery: "only screen and (max-width: 1068px)" }, 822 { name: "L", mediaQuery: "only screen and (min-width: 1069px)" }, 823 ], 824 getBreakpoint: function () { 825 for (let e = 0; e < F.BREAKPOINTS.length; e++) { 826 var t = F.BREAKPOINTS[e]; 827 if (window.matchMedia(t.mediaQuery).matches) return t.name; 828 } 829 return this.BREAKPOINTS[0].name; 830 }, 831 KeyframeDefaults: { 832 ease: 1, 833 epsilon: 0.05, 834 preserveState: !1, 835 easeFunctionString: "linear", 836 easeFunction: "linear", 837 hold: !1, 838 snapAtCreation: !1, 839 toggle: !1, 840 breakpointMask: "SMLX", 841 event: "", 842 disabledWhen: [], 843 cssClass: "", 844 }, 845 KeyframeTypes: { 846 Interpolation: 0, 847 InterpolationForward: 1, 848 CSSClass: 2, 849 Event: 3, 850 }, 851 EVENTS: { 852 ON_DOM_KEYFRAMES_CREATED: "ON_DOM_KEYFRAMES_CREATED", 853 ON_DOM_GROUPS_CREATED: "ON_DOM_GROUPS_CREATED", 854 ON_GROUP_CREATED: "ON_GROUP_CREATED", 855 ON_KEYFRAME_UPDATED: "ON_KEYFRAME_UPDATED", 856 ON_TIMELINE_START: "ON_TIMELINE_START", 857 ON_TIMELINE_UPDATE: "ON_TIMELINE_UPDATE", 858 ON_TIMELINE_COMPLETE: "ON_TIMELINE_COMPLETE", 859 ON_CHAPTER_INITIATED: "ON_CHAPTER_INITIATED", 860 ON_CHAPTER_OCCURRED: "ON_CHAPTER_OCCURRED", 861 ON_CHAPTER_COMPLETED: "ON_CHAPTER_COMPLETED", 862 }, 863 PageEvents: { 864 ON_SCROLL: "ON_SCROLL", 865 ON_RESIZE_IMMEDIATE: "ON_RESIZE_IMMEDIATE", 866 ON_RESIZE_DEBOUNCED: "ON_RESIZE_DEBOUNCED", 867 ON_BREAKPOINT_CHANGE: "ON_BREAKPOINT_CHANGE", 868 }, 869 KeyframeJSONReservedWords: [ 870 "event", 871 "cssClass", 872 "style", 873 "anchors", 874 "start", 875 "end", 876 "epsilon", 877 "easeFunction", 878 "ease", 879 "breakpointMask",
880 "disabledWhen", 881 ], 882 pageMetrics: { 883 scrollX: 0, 884 scrollY: 0, 885 windowWidth: 0, 886 windowHeight: 0, 887 documentOffsetX: 0, 888 documentOffsetY: 0, 889 previousBreakpoint: "", 890 breakpoint: "", 891 }, 892 KeyframeComparison: function (e, t) { 893 return e.start < t.start ? -1 : e.start > t.start ? 1 : 0; 894 }, 895 }, 896 t = F, 897 i = class { 898 constructor(e, t, i, s, r = !1, n = void 0) { 899 ((this.epsilon = parseFloat(t)), 900 (this.snapAtCreation = i), 901 (this.initialValue = e), 902 (this.target = e), 903 (this.current = e), 904 (this.previousValue = e), 905 (this.isActive = !1), 906 (this.key = s), 907 (this.round = r), 908 (this.suffix = n)); 909 } 910 update(e, t, i) { 911 ((this.target = e[0] + t * (e[1] - e[0])), 912 (this.previousValue = this.current), 913 (this.current += (this.target - this.current) * i)); 914 let s = this.delta(this.current, this.target); 915 return ( 916 s < this.epsilon && ((this.current = this.target), (s = 0)), 917 s > this.epsilon || (0 === s && this.previousValue !== this.current) 918 ); 919 } 920 reconcile(e, t) { 921 return ((this.initialValue = e[0]), this.update(e, t, 1)); 922 } 923 needsUpdate() { 924 return this.delta(this.current, this.target) > this.epsilon; 925 } 926 delta(e, t) { 927 return Math.abs(e - t); 928 } 929 calculateEpsilon(e, t) { 930 e 931 ? (this.epsilon = e) 932 : ((e = this.delta(t[0], t[1])), 933 (t = Math.min(0.001 * e, this.epsilon, 0.05)), 934 (this.epsilon = Math.max(t, 0.001))); 935 } 936 set(e) { 937 let t = this.current; 938 (this.round && (t = Math.round(t)), 939 this.suffix && (t += this.suffix), 940 (e[this.key] = t)); 941 } 942 unset(e) {} 943 }, 944 B = i, 945 U = R, 946 G = class extends B { 947 constructor(e, t, i, s, r = !1, n = void 0) { 948 super(e, t, i, (s = U(s)), r, n); 949 } 950 set(e) { 951 let t = this.current; 952 (this.round && (t = Math.round(t)), 953 this.suffix && (t = "" + t + this.suffix), 954 e.setProperty(this.key, t.toString())); 955 } 956 unset(e) { 957 e.removeProperty(this.key); 958 } 959 }, 960 s = { 961 lerp: function (e, t, i) { 962 return t + (i - t) * e; 963 }, 964 map: function (e, t, i, s, r) { 965 return s + ((r - s) * (e - t)) / (i - t); 966 }, 967 mapClamp: function (e, t, i, s, r) { 968 return Math.max(s, Math.min(r, s + ((r - s) * (e - t)) / (i - t))); 969 }, 970 norm: function (e, t, i) { 971 return (e - t) / (i - t); 972 }, 973 clamp: function (e, t, i) { 974 return Math.max(t, Math.min(i, e)); 975 }, 976 randFloat: function (e, t) { 977 return Math.random() * (t - e) + e; 978 }, 979 randInt: function (e, t) { 980 return Math.floor(Math.random() * (t - e) + e); 981 }, 982 }, 983 K = 984 ((e = new (class { 985 constructor() { 986 ((this.linear = function (e) { 987 return e; 988 }), 989 (this.easeInQuad = function (e) { 990 return e * e; 991 }), 992 (this.easeOutQuad = function (e) { 993 return e * (2 - e); 994 }), 995 (this.easeInOutQuad = function (e) { 996 return e < 0.5 ? 2 * e * e : (4 - 2 * e) * e - 1; 997 }), 998 (this.easeInSin = function (e) { 999 return 1 + Math.sin((Math.PI / 2) * e - Math.PI / 2); 1000 }), 1001 (this.easeOutSin = function (e) { 1002 return Math.sin((Math.PI / 2) * e); 1003 }), 1004 (this.easeInOutSin = function (e) { 1005 return (1 + Math.sin(Math.PI * e - Math.PI / 2)) / 2; 1006 }), 1007 (this.easeInElastic = function (e) { 1008 return 0 === e ? e : (0.04 - 0.04 / e) * Math.sin(25 * e) + 1; 1009 }), 1010 (this.easeOutElastic = function (e) { 1011 return ((0.04 * e) / --e) * Math.sin(25 * e); 1012 }), 1013 (this.easeInOutElastic = function (e) { 1014 return (e -= 0.5) < 0 1015 ? (0.02 + 0.01 / e) * Math.sin(50 * e) 1016 : (0.02 - 0.01 / e) * Math.sin(50 * e) + 1; 1017 }), 1018 (this.easeOutBack = function (e) { 1019 return (e -= 1) * e * (2.70158 * e + 1.70158) + 1; 1020 }), 1021 (this.easeInCubic = function (e) { 1022 return e * e * e; 1023 }), 1024 (this.easeOutCubic = function (e) { 1025 return --e * e * e + 1; 1026 }), 1027 (this.easeInOutCubic = function (e) { 1028 return e < 0.5 1029 ? 4 * e * e * e 1030 : (e - 1) * (2 * e - 2) * (2 * e - 2) + 1; 1031 }), 1032 (this.easeInQuart = function (e) { 1033 return e * e * e * e; 1034 }), 1035 (this.easeOutQuart = function (e) { 1036 return 1 - --e * e * e * e; 1037 }), 1038 (this.easeInOutQuart = function (e) { 1039 return e < 0.5 ? 8 * e * e * e * e : 1 - 8 * --e * e * e * e; 1040 }), 1041 (this.easeInQuint = function (e) { 1042 return e * e * e * e * e; 1043 }), 1044 (this.easeOutQuint = function (e) { 1045 return 1 + --e * e * e * e * e; 1046 }), 1047 (this.easeInOutQuint = function (e) { 1048 return e < 0.5 1049 ? 16 * e * e * e * e * e 1050 : 1 + 16 * --e * e * e * e * e; 1051 })); 1052 } 1053 })()), 1054 Math.abs), 1055 H = class { 1056 constructor(e, t, i, s) { 1057 ((this.cp = new Float32Array(6)), 1058 (this.cp[0] = 3 * e), 1059 (this.cp[1] = 3 * (i - e) - this.cp[0]), 1060 (this.cp[2] = 1 - this.cp[0] - this.cp[1]), 1061 (this.cp[3] = 3 * t), 1062 (this.cp[4] = 3 * (s - t) - this.cp[3]), 1063 (this.cp[5] = 1 - this.cp[3] - this.cp[4])); 1064 } 1065 sampleCurveX(e) { 1066 return ((this.cp[2] * e + this.cp[1]) * e + this.cp[0]) * e; 1067 } 1068 sampleCurveY(e) { 1069 return ((this.cp[5] * e + this.cp[4]) * e + this.cp[3]) * e; 1070 } 1071 sampleCurveDerivativeX(e) { 1072 return (3 * this.cp[2] * e + 2 * this.cp[1]) * e + this.cp[0]; 1073 } 1074 solveCurveX(e) { 1075 let t, i, s, r, n, o; 1076 for (s = e, o = 0; o < 5; o++) { 1077 if (((r = this.sampleCurveX(s) - e), K(r) < 1e-5)) return s; 1078 if (((n = this.sampleCurveDerivativeX(s)), K(n) < 1e-5)) break; 1079 s -= r / n; 1080 } 1081 if (((t = 0), (i = 1), (s = e) < t)) return t; 1082 if (s > i) return i; 1083 for (; t < i; ) { 1084 if (((r = this.sampleCurveX(s)), K(r - e) < 1e-5)) return s; 1085 (e > r ? (t = s) : (i = s), (s = 0.5 * (i - t) + t)); 1086 } 1087 return s; 1088 } 1089 solve(e) {
1090 return this.sampleCurveY(this.solveCurveX(e)); 1091 } 1092 }, 1093 W = /\d*\.?\d+/g, 1094 z = 1095 ((H.fromCSSString = function (e) { 1096 var t = e.match(W); 1097 if (4 !== t.length) 1098 throw `UnitBezier could not convert ${e} to cubic-bezier`; 1099 ((e = t.map((e) => parseFloat(e))), 1100 (t = new H(e[0], e[1], e[2], e[3]))); 1101 return t.solve.bind(t); 1102 }), 1103 H), 1104 q = s.map, 1105 Y = {}, 1106 j = class { 1107 constructor(e, t, i, s) { 1108 ((this.mass = e), 1109 (this.stiffness = t), 1110 (this.damping = i), 1111 (this.initialVelocity = s), 1112 (this.m_w0 = Math.sqrt(this.stiffness / this.mass)), 1113 (this.m_zeta = 1114 this.damping / (2 * Math.sqrt(this.stiffness * this.mass))), 1115 this.m_zeta < 1 1116 ? ((this.m_wd = 1117 this.m_w0 * Math.sqrt(1 - this.m_zeta * this.m_zeta)), 1118 (this.m_A = 1), 1119 (this.m_B = 1120 (this.m_zeta * this.m_w0 - this.initialVelocity) / this.m_wd)) 1121 : ((this.m_wd = 0), 1122 (this.m_A = 1), 1123 (this.m_B = -this.initialVelocity + this.m_w0))); 1124 } 1125 solve(e) { 1126 return ( 1127 1 - 1128 (e = 1129 this.m_zeta < 1 1130 ? Math.exp(-e * this.m_zeta * this.m_w0) * 1131 (this.m_A * Math.cos(this.m_wd * e) + 1132 this.m_B * Math.sin(this.m_wd * e)) 1133 : (this.m_A + this.m_B * e) * Math.exp(-e * this.m_w0)) 1134 ); 1135 } 1136 }, 1137 X = /\d*\.?\d+/g; 1138 function Z(e) { 1139 return e.reduce((e, t) => ((e[t] = t), e), {}); 1140 } 1141 j.fromCSSString = function (i) { 1142 var e = i.match(X); 1143 if (4 !== e.length) 1144 throw `SpringEasing could not convert ${i} to spring params`; 1145 ((e = e.map(Number)), (e = new j(...e))); 1146 let s = e.solve.bind(e), 1147 r = 0; 1148 let t = (() => { 1149 if (!Y[i]) { 1150 let e = 0, 1151 t; 1152 for (;;) 1153 if (((r += 1 / 6), 1 === s(r))) { 1154 if (16 <= ++e) { 1155 t = r * (1 / 6); 1156 break; 1157 } 1158 } else e = 0; 1159 Y[i] = t; 1160 } 1161 return Y[i]; 1162 })(); 1163 return function (e) { 1164 return 0 === e || 1 === e ? e : s(q(e, 0, 1, 0, t)); 1165 }; 1166 }; 1167 var r = j, 1168 o = () => Math.random().toString(16).slice(-2), 1169 a = 1170 ((a = [ 1171 "borderRadius", 1172 "bottom", 1173 "fontSize", 1174 "fontWeight", 1175 "height", 1176 "left", 1177 "lineHeight", 1178 "marginBottom", 1179 "marginLeft", 1180 "marginRight", 1181 "marginTop", 1182 "maxHeight", 1183 "maxWidth", 1184 "opacity", 1185 "paddingBottom", 1186 "paddingLeft", 1187 "paddingRight", 1188 "paddingTop", 1189 "right", 1190 "top", 1191 "width", 1192 "zIndex", 1193 "strokeDashoffset", 1194 ]).push( 1195 ...a.map((e) => e.replace(/[A-Z]/g, (e) => "-" + e.toLowerCase())), 1196 ), 1197 { 1198 transformAttributes: [ 1199 "x", 1200 "y", 1201 "z", 1202 "scale", 1203 "scaleX", 1204 "scaleY", 1205 "rotation", 1206 "rotationX", 1207 "rotationY", 1208 "rotationZ", 1209 ], 1210 cssAttributes: a, 1211 domAttributes: [ 1212 "scrollLeft", 1213 "scrollTop", 1214 "scrollBy", 1215 "scrollTo", 1216 "currentTime", 1217 ], 1218 suffixFreeAttributes: [ 1219 "opacity", 1220 "z-index", 1221 "font-weight", 1222 "zIndex", 1223 "fontWeight", 1224 "scrollLeft", 1225 "scrollTop", 1226 "scrollBy", 1227 "scrollTo", 1228 "currentTime", 1229 ], 1230 }); 1231 let h = t, 1232 Q = i, 1233 $ = G, 1234 J = s, 1235 ee = e, 1236 te = z, 1237 ie = r, 1238 se = Z, 1239 re = function (e, t) { 1240 if ("string" != typeof e) return e; 1241 try { 1242 return (t || document).querySelector(e) || document.querySelector(e); 1243 } catch { 1244 return !1; 1245 } 1246 }, 1247 ne = R, 1248 oe = o, 1249 { cssAttributes: ae, suffixFreeAttributes: le, domAttributes: he } = a, 1250 ce = 1251 (((r = class { 1252 constructor(t, e) { 1253 ((this.controller = t), 1254 (this.anchors = []), 1255 (this.jsonProps = e), 1256 (this.ease = t.group.defaultEase), 1257 (this.easeFunction = ee.linear), 1258 (this.start = 0), 1259 (this.end = 0), 1260 (this.localT = 0), 1261 (this.curvedT = 0), 1262 (this.id = 0), 1263 (this.event = ""), 1264 (this.needsEventDispatch = !1), 1265 (this.snapAtCreation = !1), 1266 (this.isEnabled = !1), 1267 (this.animValues = {}), 1268 (this.breakpointMask = h.KeyframeDefaults.breakpointMask),
1269 (this.disabledWhen = []), 1270 (this.keyframeType = h.KeyframeTypes.Interpolation), 1271 (this.hold = !1), 1272 (this.preserveState = !1), 1273 (this.markedForRemoval = !1), 1274 this.hidden); 1275 let i = !1; 1276 (Object.defineProperty(this, "hidden", { 1277 get() { 1278 return i; 1279 }, 1280 set(e) { 1281 ((i = e), (t.group.keyframesDirty = !0)); 1282 }, 1283 }), 1284 (this.uuid = oe()), 1285 (this.destroyed = !1)); 1286 } 1287 destroy() { 1288 ((this.destroyed = !0), 1289 (this.controller = null), 1290 (this.disabledWhen = null), 1291 (this.anchors = null), 1292 (this.jsonProps = null), 1293 (this.easeFunction = null), 1294 (this.animValues = null)); 1295 } 1296 remove() { 1297 return this.controller && this.controller.removeKeyframe(this); 1298 } 1299 parseOptions(r) { 1300 ((this.jsonProps = r).relativeTo && 1301 console.error( 1302 `KeyframeError: relativeTo has been removed. Use 'anchors' property instead. Found 'relativeTo':"${r.relativeTo}"`, 1303 ), 1304 void 0 === r.end && void 0 === r.duration && (r.end = r.start), 1305 "" !== r.anchors && r.anchors 1306 ? ((this.anchors = []), 1307 (r.anchors = Array.isArray(r.anchors) 1308 ? r.anchors 1309 : [r.anchors]), 1310 r.anchors.forEach((t, i) => { 1311 var e = re(t, this.controller.group.element); 1312 if (e) 1313 (this.anchors.push(e), 1314 this.controller.group.metrics.add(e)); 1315 else { 1316 let e = 1317 "string" == typeof t 1318 ? " Provided value was a string, so a failed attempt was made to find anchor with the provided querystring in group.element, or in the document." 1319 : ""; 1320 void console.warn( 1321 "Keyframe on", 1322 this.controller.element, 1323 ` failed to find anchor at index ${i} in array`, 1324 r.anchors, 1325 ". Anchors must be JS Object references, Elements references, or valid query selector strings. " + 1326 e, 1327 ); 1328 } 1329 })) 1330 : ((this.anchors = []), (r.anchors = [])), 1331 r.ease ? (this.ease = parseFloat(r.ease)) : (r.ease = this.ease), 1332 r.hasOwnProperty("snapAtCreation") 1333 ? (this.snapAtCreation = r.snapAtCreation) 1334 : (r.snapAtCreation = this.snapAtCreation), 1335 r.easeFunction || 1336 (r.easeFunction = h.KeyframeDefaults.easeFunctionString), 1337 r.breakpointMask 1338 ? (this.breakpointMask = r.breakpointMask) 1339 : (r.breakpointMask = this.breakpointMask), 1340 r.disabledWhen 1341 ? (this.disabledWhen = Array.isArray(r.disabledWhen) 1342 ? r.disabledWhen 1343 : [r.disabledWhen]) 1344 : (r.disabledWhen = this.disabledWhen), 1345 r.hasOwnProperty("hold") 1346 ? (this.hold = r.hold) 1347 : (r.hold = this.hold), 1348 r.hasOwnProperty("preserveState") 1349 ? (this.preserveState = r.preserveState) 1350 : (r.preserveState = h.KeyframeDefaults.preserveState), 1351 (this.easeFunction = ee[r.easeFunction]), 1352 ee.hasOwnProperty(r.easeFunction) || 1353 (r.easeFunction.includes("bezier") 1354 ? (this.easeFunction = te.fromCSSString(r.easeFunction)) 1355 : r.easeFunction.includes("spring") 1356 ? (this.easeFunction = ie.fromCSSString(r.easeFunction)) 1357 : console.error( 1358 "Keyframe parseOptions cannot find 'easeFu
1358nction' named '" + 1359 r.easeFunction + 1360 "'", 1361 ))); 1362 for (let s in r) 1363 if (-1 === h.KeyframeJSONReservedWords.indexOf(s)) { 1364 var n = r[s]; 1365 if (Array.isArray(n)) { 1366 if ( 1367 (1 === n.length && ((n[1] = n[0]), (n[0] = null)), 1368 void 0 === this.controller.tweenProps[s] || 1369 !this.controller._ownerIsElement) 1370 ) { 1371 let e = 0; 1372 this.controller._ownerIsElement || 1373 (e = this.controller.element[s] || 0); 1374 var o, 1375 a, 1376 l = s.startsWith("--"); 1377 let t = n[2] || (l || le.includes(s) ? void 0 : "px"), 1378 i = this.controller.group.anim.plugins.keyframe.reduce( 1379 (e, t) => e || t.parseProp.call(this, r, s), 1380 null, 1381 ); 1382 (!i && 1383 this.controller._ownerIsElement && 1384 (l || ae.includes(s) 1385 ? ((l = ne(s)), 1386 (o = r.round || ["z-index"].includes(l)), 1387 (a = this.controller.getTargetComputedStyle()), 1388 (e = parseFloat(a.getPropertyValue(l))), 1389 isNaN(e) && (e = 0), 1390 (i = new $( 1391 e, 1392 h.KeyframeDefaults.epsilon, 1393 this.snapAtCreation, 1394 s, 1395 o, 1396 t, 1397 )), 1398 this.controller.cssAttributes.push(i)) 1399 : he.includes(s) && 1400 ((i = new Q( 1401 e, 1402 h.KeyframeDefaults.epsilon, 1403 this.snapAtCreation, 1404 s, 1405 r.round, 1406 t, 1407 )), 1408 this.controller.domAttributes.push(i))), 1409 (i = 1410 i || 1411 new Q( 1412 e, 1413 h.KeyframeDefaults.epsilon, 1414 this.snapAtCreation, 1415 s, 1416 r.round, 1417 t, 1418 )), 1419 (this.controller.tweenProps[s] = i)); 1420 } 1421 ((this.animValues[s] = 1422 this.controller.group.expressionParser.parseArray(this, n)), 1423 this.controller.tweenProps[s].calculateEpsilon( 1424 r.epsilon, 1425 this.animValues[s], 1426 )); 1427 } 1428 } 1429 ((this.keyframeType = this.hold 1430 ? h.KeyframeTypes.InterpolationForward 1431 : h.KeyframeTypes.Interpolation), 1432 r.event && (this.event = r.event)); 1433 } 1434 overwriteProps(e) { 1435 this.animValues = {}; 1436 e = Object.assign({}, this.jsonProps, e); 1437 this.controller.updateKeyframe(this, e); 1438 } 1439 updateLocalProgress(e) { 1440 var t; 1441 (this.start === this.end || e < this.start || e > this.end 1442 ? (this.localT = 1443 e < this.start 1444 ? this.hold 1445 ? this.localT 1446 : 0 1447 : e > this.end 1448 ? 1 1449 : 0) 1450 : ((e = (e - this.start) / (this.end - this.start)), 1451 (t = this.hold ? this.localT : 0), 1452 (this.localT = J.clamp(e, t, 1))), 1453 (this.curvedT = this.easeFunction(this.localT))); 1454 } 1455 reconcile(e) { 1456 !this.controller.tweenProps[e].reconcile( 1457 this.animValues[e], 1458 this.curvedT, 1459 ) || 1460 this.needsEventDispatch || 1461 ((this.needsEventDispatch = !0),
1462 this.controller.keyframesRequiringDispatch.push(this)); 1463 } 1464 reset(e) { 1465 this.localT = e || 0; 1466 var t, 1467 e = this.ease; 1468 for (t in ((this.ease = 1), this.animValues)) this.reconcile(t); 1469 this.ease = e; 1470 } 1471 onDOMRead(e) { 1472 e = this.controller.tweenProps[e].update( 1473 this.animValues[e], 1474 this.curvedT, 1475 this.ease, 1476 ); 1477 return ( 1478 "" === this.event || 1479 this.needsEventDispatch || 1480 (e && 1481 ((this.needsEventDispatch = !0), 1482 this.controller.keyframesRequiringDispatch.push(this))), 1483 e 1484 ); 1485 } 1486 isInRange(e) { 1487 return e >= this.start && e <= this.end; 1488 } 1489 setEnabled(t) { 1490 t = t || se(Array.from(document.documentElement.classList)); 1491 let e = 1492 -1 !== this.breakpointMask.indexOf(h.pageMetrics.breakpoint), 1493 i = !1; 1494 return ( 1495 0 < this.disabledWhen.length && 1496 (i = this.disabledWhen.some((e) => 1497 "function" == typeof e ? e(this, t) : typeof t[e] < "u", 1498 )), 1499 (this.isEnabled = e && !i), 1500 this.isEnabled 1501 ); 1502 } 1503 evaluateConstraints() { 1504 ((this.start = 1505 this.controller.group.expressionParser.parseTimeValue( 1506 this, 1507 this.jsonProps.start, 1508 )), 1509 (this.end = this.controller.group.expressionParser.parseTimeValue( 1510 this, 1511 this.jsonProps.end || 0, 1512 )), 1513 this.evaluateInterpolationConstraints()); 1514 } 1515 evaluateInterpolationConstraints() { 1516 for (var e in this.animValues) { 1517 var t = this.jsonProps[e]; 1518 this.animValues[e] = 1519 this.controller.group.expressionParser.parseArray(this, t); 1520 } 1521 } 1522 }).DATA_ATTRIBUTE = "data-anim-tween"), 1523 r), 1524 de = t, 1525 ue = i; 1526 var n = class L extends ce { 1527 constructor(e, t) { 1528 (super(e, t), 1529 (this.keyframeType = de.KeyframeTypes.CSSClass), 1530 (this._triggerType = L.TRIGGER_TYPE_CSS_CLASS), 1531 (this.cssClass = ""), 1532 (this.friendlyName = ""), 1533 (this.style = { on: null, off: null }), 1534 (this.toggle = de.KeyframeDefaults.toggle), 1535 (this.isApplied = !1)); 1536 } 1537 parseOptions(e) { 1538 if (!this.controller._ownerIsElement) 1539 throw new TypeError("CSS Keyframes cannot be applied to JS Objects"); 1540 if ( 1541 ((e.x = void 0), 1542 (e.y = void 0), 1543 (e.z = void 0), 1544 (e.scale = void 0), 1545 (e.scaleX = void 0), 1546 (e.scaleY = void 0), 1547 (e.rotationX = void 0), 1548 (e.rotationY = void 0), 1549 (e.rotationZ = void 0), 1550 (e.rotation = void 0), 1551 (e.opacity = void 0), 1552 (e.hold = void 0) !== e.toggle && (this.toggle = e.toggle), 1553 void 0 !== e.cssClass) 1554 ) 1555 ((this._triggerType = L.TRIGGER_TYPE_CSS_CLASS), 1556 (this.cssClass = e.cssClass), 1557 (this.friendlyName = "." + this.cssClass), 1558 void 0 === this.controller.tweenProps.targetClasses && 1559 (this.controller.tweenProps.targetClasses = { 1560 add: [], 1561 remove: [], 1562 })); 1563 else { 1564 if (void 0 === e.style || !this.isValidStyleProperty(e.style)) 1565 throw new TypeError( 1566 "KeyframeCSSClass no 'cssClass` property found. If using `style` property its also missing or invalid", 1567 ); 1568 if ( 1569 ((this._triggerType = L.TRIGGER_TYPE_STYLE_PROPERTY), 1570 (this.style = e.style), 1571 (this.friendlyName = "style"), 1572 (this.toggle = void 0 !== this.style.off || this.toggle), 1573 this.toggle && void 0 === this.style.off) 1574 ) 1575 for (var t in ((this.style.off = {}), this.style.on)) 1576 this.style.off[t] = ""; 1577 void 0 === this.controller.tweenProps.targetStyles && 1578 (this.controller.tweenProps.targetStyles = {}); 1579 } 1580 if ( 1581 (void 0 === e.end && (e.end = e.start), 1582 (e.toggle = this.toggle), 1583 this._triggerType === L.TRIGGER_TYPE_CSS_CLASS) 1584 ) 1585 this.isApplied = this.controller.element.classList.contains( 1586 this.cssClass, 1587 ); 1588 else { 1589 var i, 1590 s = getComputedStyle(this.controller.element); 1591 for (i in ((this.isApplied = !0), this.style.on)) 1592 if (s[i] !== this.style.on[i]) { 1593 this.isApplied = !1; 1594 break; 1595 } 1596 } 1597 (super.parseOptions(e), 1598 (this.animValues[this.friendlyName] = [0, 0]), 1599 void 0 === this.controller.tweenProps[this.friendlyName] && 1600 (this.controller.tweenProps[this.friendlyName] = new ue( 1601 0, 1602 1, 1603 !1, 1604 this.friendlyName, 1605 )), 1606 (this.keyframeType = de.KeyframeTypes.CSSClass)); 1607 } 1608 updateLocalProgress(e) { 1609 (this.isApplied && !this.toggle) || 1610 (this.start !== this.end 1611 ? !this.isApplied && e >= this.start && e <= this.end 1612 ? this._apply() 1613 : this.isApplied && 1614 this.toggle && 1615 (e < this.start || e > this.end) && 1616 this._unapply() 1617 : !this.isApplied && e >= this.start 1618 ? this._apply() 1619 : this.isApplied && 1620 this.toggle && 1621 e < this.start && 1622 this._unapply()); 1623 } 1624 _apply() { 1625 if (this._triggerType === L.TRIGGER_TYPE_CSS_CLASS) 1626 (this.controller.tweenProps.targetClasses.add.push(this.cssClass), 1627 (this.controller.needsClassUpdate = !0)); 1628 else { 1629 for (var e in this.style.on) 1630 this.controller.tweenProps.targetStyles[e] = this.style.on[e]; 1631 this.controller.needsStyleUpdate = !0; 1632 } 1633 this.isApplied = !0; 1634 } 1635 _unapply() { 1636 if (this._triggerType === L.TRIGGER_TYPE_CSS_CLASS) 1637 (this.controller.tweenProps.targetClasses.remove.push(this.cssClass), 1638 (this.controller.needsClassUpdate = !0)); 1639 else { 1640 for (var e in this.style.off) 1641 this.controller.tweenProps.targetStyles[e] = this.style.off[e]; 1642 this.controller.needsStyleUpdate = !0; 1643 } 1644 this.isApplied = !1; 1645 } 1646 isValidStyleProperty(e) { 1647 if (!e.hasOwnProperty("on")) return !1; 1648 if ("object" != typeof e.on) 1649 throw new TypeError( 1650 "KeyframeCSSClass `style` property should be in the form of: {on:{visibility:'hidden', otherProperty: 'value'}}", 1651 ); 1652 if (this.toggle && e.hasOwnProperty("off") && "object" != typeof e.off) 1653 throw new TypeError( 1654 "KeyframeCSSClass `style` property should be in the form of: {on:{visibility:'hidden', otherProperty: 'value'}}", 1655 ); 1656 return !0; 1657 } 1658 reconcile(e) {} 1659 onDOMRead(e) { 1660 return !1; 1661 } 1662 evaluateInterpolationConstraints() {} 1663 }; 1664 ((n.TRIGGER_TYPE_CSS_CLASS = 0), 1665 (n.TRIGGER_TYPE_STYLE_PROPERTY = 1), 1666 (n.DATA_ATTRIBUTE = "data-anim-classname")); 1667 let pe = r, 1668 me = t, 1669 ge = i; 1670 var fe = class extends pe { 1671 constructor(e, t) { 1672 (super(e, t), 1673 (this.keyframeType = me.KeyframeTypes.Event), 1674 (this.isApplied = !1), 1675 (this.hasDuration = !1), 1676 (this.isCurrentlyInRange = !1)); 1677 } 1678 parseOptions(e) { 1679 ((e.x = void 0), 1680 (e.y = void 0), 1681 (e.scale = void 0), 1682 (e.scaleX = void 0), 1683 (e.scaleY = void 0), 1684 (e.rotation = void 0), 1685 (e.style = void 0), 1686 (e.cssClass = void 0), 1687 (e.rotation = void 0), 1688 (e.opacity = void 0), 1689 (e.hold = void 0), 1690 (this.event = e.event), 1691 (this.animValues[this.event] = [0, 0]), 1692 "u" < typeof this.controller.tweenProps[this.event] && 1693 (this.controller.tweenProps[this.event] = new ge( 1694 0, 1695 1, 1696 !1, 1697 this.event, 1698 )), 1699 super.parseOptions(e), 1700 (this.keyframeType = me.KeyframeTypes.Event)); 1701 } 1702 updateLocalProgress(e) { 1703 var t, i; 1704 if (this.hasDuration) 1705 return (t = this.isCurrentlyInRange) === 1706 (i = e >= this.start && e <= this.end) 1707 ? void 0 1708 : void ((this.isCurrentlyInRange = i) && !t 1709 ? this._trigger(this.event + ":enter") 1710 : t && !i && this._trigger(this.event + ":exit")); 1711 !this.isApplied && e >= this.start 1712 ? ((this.isApplied = !0), this._trigger(this.event)) 1713 : this.isApplied && 1714 e < this.start && 1715 ((this.isApplied = !1), this._trigger(this.event + ":reverse")); 1716 } 1717 _trigger(e) { 1718 ((this.controller.eventObject.event = e), 1719 (this.controller.eventObject.keyframe = this).controller.trigger( 1720 e, 1721 this.controller.eventObject, 1722 )); 1723 } 1724 evaluateConstraints() { 1725 (super.evaluateConstraints(), 1726 (this.hasDuration = this.start !== this.end)); 1727 } 1728 reset(e) { 1729 ((this.isApplied = !1), 1730 (this.isCurrentlyInRange = !1), 1731 super.reset(e)); 1732 } 1733 onDOMRead(e) { 1734 return !1; 1735 } 1736 reconcile(e) {} 1737 evaluateInterpolationConstraints() {} 1738 }, 1739 ve = 1740 ((fe.DATA_ATTRIBUTE = "data-anim-event"), 1741 class { 1742 constructor(e, t, i = !1) { 1743 ((this.isGroup = i), 1744 (this.group = e), 1745 (this.controller = t), 1746 (this.controllers = []), 1747 (this.tweenProps = { 1748 targetStyles: {}, 1749 targetClasses: { add: [], remove: [] }, 1750 })); 1751 } 1752 }); 1753 function l(e, t, i, s = 0) { 1754 throw ( 1755 (i = t.slice(Math.max(i, 0), Math.min(t.length, i + 3))), 1756 (e = new Error( 1757 `Expression Error. ${e} in expression "${t}", near "${i}"`, 1758 )), 1759 console.error(e.message, u ? u.keyframe || u.target : ""), 1760 e 1761 ); 1762 }
1763 let c = t, 1764 ye = class { 1765 constructor(e) { 1766 ((this.top = 0), 1767 (this.bottom = 0), 1768 (this.left = 0), 1769 (this.right = 0), 1770 (this.height = 0), 1771 (this.width = 0)); 1772 } 1773 toString() { 1774 return ( 1775 `top:${this.top}, bottom:${this.bottom}, left:${this.left}, right:${this.right}, height:${this.height}, width:` + 1776 this.width 1777 ); 1778 } 1779 toObject() { 1780 return { 1781 top: this.top, 1782 bottom: this.bottom, 1783 left: this.left, 1784 right: this.right, 1785 height: this.height, 1786 width: this.width, 1787 }; 1788 } 1789 }, 1790 we = (e, t) => e ?? t, 1791 _e = class { 1792 constructor() { 1793 (this.clear(), (this._metrics = new WeakMap())); 1794 } 1795 clear() { 1796 this._metrics = new WeakMap(); 1797 } 1798 destroy() { 1799 this.clear(); 1800 } 1801 add(e) { 1802 var t = this._metrics.get(e); 1803 return ( 1804 t || 1805 ((t = new ye(e)), 1806 this._metrics.set(e, t), 1807 this._refreshMetrics(e, t)) 1808 ); 1809 } 1810 get(e) { 1811 return this._metrics.get(e); 1812 } 1813 refreshCollection(e) { 1814 e.forEach((e) => this._refreshMetrics(e, void 0)); 1815 } 1816 refreshMetrics(e) { 1817 return this._refreshMetrics(e); 1818 } 1819 _refreshMetrics(t, i) { 1820 if (((i = i || this._metrics.get(t)), t instanceof HTMLElement)) { 1821 ((i.width = t.offsetWidth), 1822 (i.height = t.offsetHeight), 1823 (i.top = c.pageMetrics.documentOffsetY), 1824 (i.left = c.pageMetrics.documentOffsetX)); 1825 let e = t; 1826 for (; e; ) 1827 ((i.top += e.offsetTop), 1828 (i.left += e.offsetLeft), 1829 (e = e.offsetParent)); 1830 } else { 1831 var e; 1832 t instanceof SVGElement 1833 ? ((e = t.getBoundingClientRect()), 1834 (i.width = e.width), 1835 (i.height = e.height), 1836 (i.top = c.pageMetrics.scrollY + e.top), 1837 (i.left = c.pageMetrics.scrollX + e.left)) 1838 : ((i.width = we(t.width, 0)), 1839 (i.height = t.height ?? 0), 1840 (i.top = t.top ?? t.y ?? 0), 1841 (i.left = t.left ?? t.x ?? 0)); 1842 } 1843 return ( 1844 (i.right = i.left + i.width), 1845 (i.bottom = i.top + i.height), 1846 i 1847 ); 1848 } 1849 }, 1850 Ae = t, 1851 Ce = s, 1852 Ee = e, 1853 be = {}, 1854 d = { 1855 smoothstep: (e, t, i) => 1856 (i = d.clamp((i - e) / (t - e), 0, 1)) * i * (3 - 2 * i), 1857 deg: (e) => (180 * e) / Math.PI, 1858 rad: (e) => (e * Math.PI) / 180, 1859 random: (e, t) => Math.random() * (t - e) + e, 1860 parseInt: (e, t) => parseInt(e, t), 1861 parseFloat: (e) => parseFloat(e), 1862 atan: Math.atan2, 1863 }, 1864 u =
1865 (Object.getOwnPropertyNames(Math).forEach((e) => 1866 d[e] ? null : (d[e.toLowerCase()] = Math[e]), 1867 ), 1868 Object.getOwnPropertyNames(Ce).forEach((e) => 1869 d[e] ? null : (d[e.toLowerCase()] = Ce[e]), 1870 ), 1871 Object.getOwnPropertyNames(Ee).forEach((e) => (d[e] = Ee[e])), 1872 null), 1873 p = { 1874 ANCHOR_CONST: "a", 1875 STRING_CONST: "STRING_CONST", 1876 ALPHA: "ALPHA", 1877 LPAREN: "(", 1878 RPAREN: ")", 1879 PLUS: "PLUS", 1880 MINUS: "MINUS", 1881 MUL: "MUL", 1882 DIV: "DIV", 1883 INTEGER_CONST: "INTEGER_CONST", 1884 FLOAT_CONST: "FLOAT_CONST", 1885 COMMA: ",", 1886 EOF: "EOF", 1887 COALESCE: "COALESCE", 1888 BOOL: "BOOL", 1889 L_NOT: "L_NOT", 1890 L_OR: "L_OR", 1891 L_AND: "L_AND", 1892 QUESTION_MARK: "QUESTION_MARK", 1893 COMPARISON: "COMPARISON", 1894 COLON: "COLON", 1895 }, 1896 m = { 1897 DIGIT: /\d/, 1898 MATH_OPERATOR: /[-+*/]/, 1899 PAREN: /[()]/, 1900 QUOTE: /['"`]/, 1901 WHITE_SPACE: /\s/, 1902 ALPHA: /[a-zA-Z]|%/, 1903 OBJECT_UNIT: /^(t|l|b|r|%w|%h|%|h|w)$/, 1904 ANY_UNIT: /^(t|l|b|r|%w|%h|%|h|w|px|vh|vw|rad|deg)$/, 1905 MATH_FUNCTION: new RegExp(`\\b(${Object.keys(d).join("|")})\\b`, "i"), 1906 EQUALITY_OPERATOR: /==/, 1907 INEQUALITY_OPERATOR: /!=/, 1908 L_AND: /&&/, 1909 L_OR: /\|\|/, 1910 }, 1911 xe = { 1912 round: 1, 1913 clamp: 3, 1914 lerp: 3, 1915 random: 2, 1916 atan: 2, 1917 floor: 1, 1918 ceil: 1, 1919 abs: 1, 1920 cos: 1, 1921 sin: 1, 1922 smoothstep: 3, 1923 rad: 1, 1924 deg: 1, 1925 pow: 2, 1926 calc: 1, 1927 }; 1928 class g { 1929 constructor(e, t) { 1930 ((this.type = e), (this.value = t)); 1931 } 1932 } 1933 ((g.ONE = new g("100", 100)), (g.EOF = new g(p.EOF, null))); 1934 class f { 1935 constructor(e) { 1936 this.type = e; 1937 } 1938 } 1939 class Se extends f { 1940 constructor(e, t) { 1941 (super("UnaryOp"), (this.token = e), (this.expr = t)); 1942 } 1943 } 1944 class v extends f { 1945 constructor(e, t, i) { 1946 (super("BinOp"), (this.left = e), (this.op = t), (this.right = i)); 1947 } 1948 } 1949 class Me extends f { 1950 constructor(e, t, i) { 1951 (super("TernaryOp"), 1952 (this.condition = e), 1953 (this.left = t), 1954 (this.right = i)); 1955 } 1956 } 1957 class Te extends f { 1958 constructor(e, t) { 1959 if ( 1960 (super("MathOp"), 1961 (this.op = e), 1962 (this.list = t), 1963 xe[e.value] && t.length !== xe[e.value]) 1964 ) 1965 throw new Error( 1966 `Incorrect number of arguments for '${e.value}'. Received ${t.length}, expected ` + 1967 xe[e.value], 1968 ); 1969 } 1970 } 1971 class Ie extends f { 1972 constructor(e) { 1973 (super("Str"), (this.token = e), (this.value = e.value)); 1974 } 1975 } 1976 class y extends f { 1977 constructor(e) { 1978 (super("Num"), (this.token = e), (this.value = e.value)); 1979 } 1980 } 1981 class Oe extends f { 1982 constructor(e) { 1983 (super("Bool"), (this.token = e), (this.value = e.value)); 1984 } 1985 } 1986 class w extends f { 1987 constructor(e, t, i) { 1988 (super("RefValue"), (this.num = e), (this.ref = t), (this.unit = i)); 1989 } 1990 } 1991 class Pe extends f { 1992 constructor(e, t, i = !0) { 1993 (super("CSSValue"), 1994 (this.ref = e), 1995 (this.propertyName = t), 1996 (this.evaluate = i)); 1997 } 1998 } 1999 class De extends f { 2000 constructor(e, t) { 2001 (super("PropValue"), (this.ref = e), (this.propertyName = t)); 2002 } 2003 } 2004 class Ve { 2005 constructor(e) { 2006 ((this.text = e), 2007 (this.pos = 0), 2008 (this.char = this.text[this.pos]), 2009 (this.tokens = [])); 2010 let t; 2011 for (; (t = this.getNextToken()) && t !== g.EOF; ) this.tokens.push(t); 2012 this.tokens.push(t); 2013 } 2014 advance() { 2015 this.char = this.text[++this.pos] ?? null; 2016 } 2017 skipWhiteSpace() { 2018 for (; null != this.char && m.WHITE_SPACE.test(this.char); ) 2019 this.advance(); 2020 } 2021 name() { 2022 let e = ""; 2023 for (; null != this.char && m.ALPHA.test(this.char); ) 2024 ((e += this.char), this.advance()); 2025 return "true" === e || "false" === e 2026 ? new g(p.BOOL, "true" === e) 2027 : new g(p.ALPHA, e); 2028 } 2029 number() { 2030 let e = ""; 2031 for ( 2032 "." === this.char && ((e += this.char), this.advance()); 2033 null != this.char && m.DIGIT.test(this.char); 2034 ) 2035 ((e += this.char), this.advance()); 2036 if (null != this.char && "." === this.char) 2037 for ( 2038 e.includes(".") && 2039 l( 2040 "Number appears to contain 2 decimal points", 2041 this.text, 2042 this.pos, 2043 ), 2044 e += this.char, 2045 this.advance(); 2046 null != this.char && m.DIGIT.test(this.char); 2047 ) 2048 ((e += this.char), this.advance()); 2049 return ( 2050 "." === e && 2051 l( 2052 "Attempted to parse a number, but found only a decimal point", 2053 this.text, 2054 this.pos, 2055 ), 2056 e.includes(".") 2057 ? new g(p.FLOAT_CONST, parseFloat(e)) 2058 : new g(p.INTEGER_CONST, parseInt(e)) 2059 ); 2060 }
2061 string(e) { 2062 let t = ""; 2063 for (this.advance(); null !== this.char && this.char !== e; ) 2064 ((t += this.char), this.advance()); 2065 if (this.char === e) return (this.advance(), new g(p.STRING_CONST, t)); 2066 throw new Error( 2067 "Unterminated string literal in expression " + this.text, 2068 ); 2069 } 2070 getNextToken() { 2071 for (; null != this.char; ) 2072 if (m.WHITE_SPACE.test(this.char)) this.skipWhiteSpace(); 2073 else { 2074 if ("." === this.char || m.DIGIT.test(this.char)) 2075 return this.number(); 2076 if ("," === this.char) return (this.advance(), new g(p.COMMA, ",")); 2077 if (":" === this.char) return (this.advance(), new g(p.COLON, ":")); 2078 if (m.MATH_OPERATOR.test(this.char)) { 2079 let e = "", 2080 t = this.char; 2081 switch (t) { 2082 case "+": 2083 e = p.PLUS; 2084 break; 2085 case "-": 2086 e = p.MINUS; 2087 break; 2088 case "*": 2089 e = p.MUL; 2090 break; 2091 case "/": 2092 e = p.DIV; 2093 } 2094 return (this.advance(), new g(e, t)); 2095 } 2096 if (m.PAREN.test(this.char)) { 2097 let e = "", 2098 t = this.char; 2099 switch (t) { 2100 case "(": 2101 e = p.LPAREN; 2102 break; 2103 case ")": 2104 e = p.RPAREN; 2105 } 2106 return (this.advance(), new g(e, t)); 2107 } 2108 if (m.QUOTE.test(this.char)) return this.string(this.char); 2109 if (m.ALPHA.test(this.char)) return this.name(); 2110 if ("?" === this.char) 2111 return ( 2112 this.advance(), 2113 "?" === this.char 2114 ? (this.advance(), new g(p.COALESCE, "??")) 2115 : new g(p.QUESTION_MARK, "?") 2116 ); 2117 if ("<" === this.char) 2118 return ( 2119 this.advance(), 2120 "=" === this.char 2121 ? (this.advance(), new g(p.COMPARISON, "<=")) 2122 : new g(p.COMPARISON, "<") 2123 ); 2124 if (">" === this.char) 2125 return ( 2126 this.advance(), 2127 "=" === this.char 2128 ? (this.advance(), new g(p.COMPARISON, ">=")) 2129 : new g(p.COMPARISON, ">") 2130 ); 2131 if ( 2132 m.EQUALITY_OPERATOR.test( 2133 this.text.substring(this.pos, this.pos + 2), 2134 ) 2135 ) 2136 return ( 2137 this.advance(), 2138 this.advance(), 2139 "=" === this.char 2140 ? (this.advance(), new g(p.COMPARISON, "===")) 2141 : new g(p.COMPARISON, "==") 2142 ); 2143 if ( 2144 m.INEQUALITY_OPERATOR.test( 2145 this.text.substring(this.pos, this.pos + 2), 2146 ) 2147 ) 2148 return ( 2149 this.advance(), 2150 this.advance(), 2151 "=" === this.char 2152 ? (this.advance(), new g(p.COMPARISON, "!==")) 2153 : new g(p.COMPARISON, "!=") 2154 ); 2155 if (m.L_OR.test(this.text.substring(this.pos, this.pos + 2))) 2156 return (this.advance(), this.advance(), new g(p.L_OR, "||")); 2157 if (m.L_AND.test(this.text.substring(this.pos, this.pos + 2))) 2158 return (this.advance(), this.advance(), new g(p.L_AND, "&&")); 2159 if ("!" === this.char) return (this.advance(), new g(p.L_NOT, "!")); 2160 l(`Unexpected character "${this.char}"`, this.text, this.pos); 2161 } 2162 return g.EOF; 2163 } 2164 } 2165 class ke { 2166 constructor(e) { 2167 ((this.lexer = e), (this.pos = 0)); 2168 } 2169 get currentToken() { 2170 return this.lexer.tokens[this.pos]; 2171 } 2172 error(e, t = "") { 2173 l(e + t, this.lexer.text, this.pos); 2174 } 2175 consume(e) { 2176 var t = this.currentToken; 2177 return ( 2178 t.type === e 2179 ? (this.pos += 1) 2180 : this.error( 2181 `Invalid token ${this.currentToken.value}, expected ` + e, 2182 ), 2183 t 2184 ); 2185 } 2186 consumeList(e) { 2187 e.includes(this.currentToken) 2188 ? (this.pos += 1) 2189 : this.error( 2190 `Invalid token ${this.currentToken.value}, expected ` + e, 2191 ); 2192 } 2193 expr() { 2194 return this.conditionalExpr(); 2195 } 2196 conditionalExpr() { 2197 let e = this.logicalExpr(); 2198 for (; this.currentToken.type === p.QUESTION_MARK; ) { 2199 this.consume(p.QUESTION_MARK); 2200 var t = this.expr(), 2201 i = (this.consume(p.COLON), this.expr()); 2202 e = new Me(e, t, i); 2203 } 2204 return e; 2205 } 2206 logicalExpr() { 2207 let e = this.coalesceExpr(); 2208 for (;;) 2209 if (this.currentToken.type === p.L_AND) 2210 e = new v( 2211 e, 2212 this.consume(this.currentToken.type), 2213 this.coalesceExpr(), 2214 ); 2215 else { 2216 if (this.currentToken.type !== p.L_OR) break; 2217 e = new v( 2218 e, 2219 this.consume(this.currentToken.type), 2220 this.logicalExpr(), 2221 ); 2222 } 2223 return e; 2224 } 2225 coalesceExpr() { 2226 let e = this.comparisonExpr(); 2227 for (; this.currentToken.type === p.COALESCE; ) { 2228 var t = this.consume(p.COALESCE); 2229 e = new v(e, t, this.comparisonExpr()); 2230 } 2231 return e; 2232 } 2233 comparisonExpr() { 2234 let e = this.additiveExpr(); 2235 for (; this.currentToken.type === p.COMPARISON; ) { 2236 var t = this.consume(p.COMPARISON); 2237 e = new v(e, t, this.additiveExpr()); 2238 } 2239 return e; 2240 } 2241 additiveExpr() { 2242 let e = this.term(); 2243 for ( 2244 ; 2245 this.currentToken.type === p.PLUS || 2246 this.currentToken.type === p.MINUS; 2247 ) { 2248 var t = this.currentToken; 2249 (this.consume(t.type), (e = new v(e, t, this.term()))); 2250 } 2251 return e; 2252 } 2253 term() { 2254 let e = this.unaryExpr(); 2255 for ( 2256 ; 2257 this.currentToken.type === p.MUL || this.currentToken.type === p.DIV; 2258 ) { 2259 var t = this.currentToken; 2260 (this.consume(t.type), (e = new v(e, t, this.unaryExpr()))); 2261 } 2262 return e; 2263 } 2264 unaryExpr() { 2265 return this.currentToken.type === p.L_NOT || 2266 this.currentToken.type === p.PLUS || 2267 this.currentToken.type === p.MINUS 2268 ? new Se(this.consume(this.currentToken.type), this.unaryExpr()) 2269 : this.factor(); 2270 } 2271 factor() { 2272 if (this.currentToken.type === p.BOOL) 2273 return new Oe(this.consume(p.BOOL)); 2274 if (this.currentToken.type === p.STRING_CONST) 2275 return new Ie(this.consume(this.currentToken.type)); 2276 if ( 2277 this.currentToken.type === p.INTEGER_CONST || 2278 this.currentToken.type === p.FLOAT_CONST 2279 ) 2280 return ( 2281 (t = new y(this.currentToken)), 2282 (this.pos += 1), 2283 m.MATH_OPERATOR.test(this.currentToken.value) || 2284 this.currentToken.type === p.RPAREN || 2285 this.currentToken.type === p.COMMA || 2286 this.currentToken.type === p.EOF 2287 ? t 2288 : this.currentToken.type === p.ALPHA && 2289 this.currentToken.value === p.ANCHOR_CONST 2290 ? (this.consume(p.ALPHA), 2291 new w(t, this.anchorIndex(), this.unit(m.ANY_UNIT))) 2292 : this.currentToken.type === p.ALPHA 2293 ? ("%a" === this.currentToken.value &&
2294 this.error("%a is invalid, try removing the %"), 2295 new w(t, null, this.unit())) 2296 : t 2297 ); 2298 if (m.OBJECT_UNIT.test(this.currentToken.value)) 2299 return new w(new y(g.ONE), null, this.unit()); 2300 if (this.currentToken.value === p.ANCHOR_CONST) { 2301 this.consume(p.ALPHA); 2302 var t = this.anchorIndex(); 2303 if (m.OBJECT_UNIT.test(this.currentToken.value)) 2304 return new w(new y(g.ONE), t, this.unit()); 2305 } else if (this.currentToken.type === p.ALPHA) { 2306 if ("calc" === this.currentToken.value) 2307 return (this.consume(p.ALPHA), this.expr()); 2308 if ( 2309 "css" === this.currentToken.value || 2310 "cssStr" === this.currentToken.value || 2311 "var" === this.currentToken.value || 2312 "prop" === this.currentToken.value 2313 ) { 2314 var t = "prop" !== this.currentToken.value ? Pe : De, 2315 i = !this.currentToken.value.endsWith("Str"), 2316 s = 2317 (this.consume(p.ALPHA), 2318 this.consume(p.LPAREN), 2319 this.propertyName()); 2320 let e = null; 2321 return ( 2322 this.currentToken.type === p.COMMA && 2323 (this.consume(p.COMMA), 2324 this.consume(p.ALPHA), 2325 (e = this.anchorIndex())), 2326 this.consume(p.RPAREN), 2327 new t(e, s, i) 2328 ); 2329 } 2330 if (m.MATH_FUNCTION.test(this.currentToken.value)) { 2331 var t = this.currentToken.value, 2332 s = t.toLowerCase(); 2333 if ("number" == typeof d[s]) 2334 return (this.consume(p.ALPHA), new y(new g(p.ALPHA, d[s]))); 2335 var e, 2336 i = g[t] || new g(t, t), 2337 r = []; 2338 for ( 2339 this.consume(p.ALPHA), this.consume(p.LPAREN); 2340 this.currentToken.value === p.COMMA && this.consume(p.COMMA), 2341 (e = this.expr()), 2342 r.push(e), 2343 this.currentToken.value === p.COMMA; 2344 ); 2345 return (this.consume(p.RPAREN), new Te(i, r)); 2346 } 2347 } else if (this.currentToken.type === p.LPAREN) 2348 return ( 2349 this.consume(p.LPAREN), 2350 (s = this.expr()), 2351 this.consume(p.RPAREN), 2352 s 2353 ); 2354 this.error(`Unexpected token '${this.currentToken.value}'`); 2355 } 2356 propertyName() { 2357 let e = ""; 2358 for ( 2359 ; 2360 this.currentToken.type === p.ALPHA || 2361 this.currentToken.type === p.MINUS || 2362 this.currentToken.type === p.INTEGER_CONST; 2363 ) 2364 ((e += this.currentToken.value), (this.pos += 1)); 2365 return e; 2366 } 2367 unit(e = m.ANY_UNIT) { 2368 var t = this.currentToken; 2369 if (t.type === p.ALPHA && e.test(t.value)) 2370 return ( 2371 this.consume(p.ALPHA), 2372 new g( 2373 p.ALPHA, 2374 (t.value = t.value.replace(/%(h|w)/, "$1").replace("%", "h")), 2375 ) 2376 ); 2377 this.error("Expected unit type"); 2378 } 2379 anchorIndex() { 2380 var e = this.currentToken; 2381 if (e.type === p.INTEGER_CONST) 2382 return (this.consume(p.INTEGER_CONST), new y(e)); 2383 this.error( 2384 "Invalid anchor reference", 2385 ". Should be something like a0, a1, a2", 2386 ); 2387 } 2388 parse() { 2389 var e = this.expr(); 2390 return ( 2391 this.currentToken !== g.EOF && 2392 this.error("Unexpected token " + this.currentToken.value), 2393 e 2394 ); 2395 } 2396 } 2397 (e = class bi { 2398 constructor(e) { 2399 ((this.parser = e), (this.root = e.parse())); 2400 } 2401 visit(e) { 2402 var t = this[e.type]; 2403 if (t) return t.call(this, e); 2404 throw new Error("No visit method named, " + t); 2405 } 2406 BinOp(e) { 2407 switch (e.op.type) { 2408 case p.PLUS: 2409 return this.visit(e.left) + this.visit(e.right); 2410 case p.MINUS: 2411 return this.visit(e.left) - this.visit(e.right); 2412 case p.MUL: 2413 return this.visit(e.left) * this.visit(e.right); 2414 case p.DIV: 2415 return this.visit(e.left) / this.visit(e.right); 2416 case p.COMPARISON: 2417 return this.comparisonOp(e); 2418 case p.L_OR: 2419 return this.visit(e.left) || this.visit(e.right); 2420 case p.L_AND: 2421 return this.visit(e.left) && this.visit(e.right); 2422 case p.COALESCE: 2423 return this.visit(e.left) ?? this.visit(e.right); 2424 default: 2425 throw new Error("Unhandled binary operation: " + e.op.type); 2426 } 2427 } 2428 comparisonOp(e) { 2429 switch (e.op.value) { 2430 case "==": 2431 return this.visit(e.left) == this.visit(e.right); 2432 case "===": 2433 return this.visit(e.left) === this.visit(e.right); 2434 case "!=": 2435 return this.visit(e.left) != this.visit(e.right); 2436 case "!==": 2437 return this.visit(e.left) !== this.visit(e.right); 2438 case "<": 2439 return this.visit(e.left) < this.visit(e.right); 2440 case "<=": 2441 return this.visit(e.left) <= this.visit(e.right); 2442 case ">": 2443 return this.visit(e.left) > this.visit(e.right); 2444 case ">=": 2445 return this.visit(e.left) >= this.visit(e.right); 2446 default: 2447 throw new Error("Unhandled comparison operation: " + e.op.value); 2448 } 2449 } 2450 TernaryOp(e) { 2451 return this.visit(e.condition) 2452 ? this.visit(e.left) 2453 : this.visit(e.right); 2454 } 2455 RefValue(e) { 2456 var t = this.unwrapReference(e), 2457 i = e.unit.value, 2458 s = e.num.value, 2459 r = u.metrics.get(t); 2460 switch (i) { 2461 case "h": 2462 return 0.01 * s * r.height; 2463 case "t": 2464 return 0.01 * s * r.top; 2465 case "vh": 2466 return 0.01 * s * Ae.pageMetrics.windowHeight; 2467 case "vw": 2468 return 0.01 * s * Ae.pageMetrics.windowWidth; 2469 case "px": 2470 return s; 2471 case "w": 2472 return 0.01 * s * r.width; 2473 case "b": 2474 return 0.01 * s * r.bottom; 2475 case "l": 2476 return 0.01 * s * r.left; 2477 case "r": 2478 return 0.01 * s * r.right; 2479 case "rad": 2480 return (180 * s) / Math.PI; 2481 case "deg": 2482 return s; 2483 } 2484 } 2485 PropValue(e) { 2486 return (null === e.ref ? u.target : u.anchors[e.ref.value])[ 2487 e.propertyName 2488 ]; 2489 } 2490 CSSValue(e) { 2491 var t = this.unwrapReference(e), 2492 t = getComputedStyle(t).getPropertyValue(e.propertyName); 2493 return e.evaluate 2494 ? "" === t 2495 ? void 0 2496 : bi.Parse(t).execute(u) 2497 : t.trimStart(); 2498 }
2499 Num(e) { 2500 return e.value; 2501 } 2502 Bool(e) { 2503 return e.value; 2504 } 2505 Str(e) { 2506 return e.value; 2507 } 2508 UnaryOp(e) { 2509 switch (e.token.type) { 2510 case p.L_NOT: 2511 return !this.visit(e.expr); 2512 case p.PLUS: 2513 return +this.visit(e.expr); 2514 case p.MINUS: 2515 return -this.visit(e.expr); 2516 } 2517 } 2518 MathOp(e) { 2519 var t = e.list.map((e) => this.visit(e)); 2520 return d[e.op.value].apply(null, t); 2521 } 2522 unwrapReference(e) { 2523 return null === e.ref 2524 ? u.target 2525 : (e.ref.value >= u.anchors.length && 2526 console.error( 2527 "Not enough anchors supplied for expression " + 2528 this.parser.lexer.text, 2529 u.target, 2530 ), 2531 u.anchors[e.ref.value]); 2532 } 2533 execute(e) { 2534 return ((u = e), this.visit(this.root)); 2535 } 2536 static Parse(e) { 2537 return be[e] || (be[e] = new bi(new ke(new Ve(e)))); 2538 } 2539 }).programs = be; 2540 let Le = e, 2541 _ = new _e(), 2542 Re = 2543 (((e = class xi { 2544 constructor(e) { 2545 ((this.group = e), 2546 (this.data = { 2547 anchors: null, 2548 keyframe: null, 2549 metrics: this.group.metrics, 2550 target: null, 2551 })); 2552 } 2553 parseArray(e, t) { 2554 return [ 2555 this.parseExpression(e, t[0]), 2556 this.parseExpression(e, t[1]), 2557 ]; 2558 } 2559 parseExpression(i, s) { 2560 if (!s) return null; 2561 if ("number" == typeof s) return s; 2562 if ("string" != typeof s) 2563 throw `Expression must be a string, received ${typeof s}: ` + s; 2564 return ( 2565 (this.data.target = i.controller.element), 2566 (this.data.anchors = i.anchors), 2567 (this.data.keyframe = i), 2568 this.group.anim.plugins.parser.reduce( 2569 (e, t) => e || t.parseExpression.call(this, i, s), 2570 null, 2571 ) || xi._parse(s, this.data) 2572 ); 2573 } 2574 parseTimeValue(e, t) { 2575 return "number" == typeof t 2576 ? t 2577 : ((e = this.group.expressionParser.parseExpression(e, t)), 2578 this.group.convertScrollPositionToTValue(e || 0)); 2579 } 2580 destroy() { 2581 this.group = null; 2582 } 2583 static parse(e, t) { 2584 var i; 2585 return ( 2586 null != (t = t ?? { target: null }) && 2587 t.target && 2588 (_.clear(), _.add(t.target)), 2589 null != (i = t.anchors) && i.forEach((e) => _.add(e)), 2590 (t.metrics = _), 2591 xi._parse(e, t) 2592 ); 2593 } 2594 static _parse(e, t) { 2595 return Le.Parse(e).execute(t); 2596 } 2597 }).programs = Le.programs), 2598 typeof window < "u" && (window.ExpressionParser = e), 2599 t), 2600 Ne = r, 2601 Fe = fe, 2602 Be = n, 2603 Ue = [ 2604 "onEnter", 2605 "onExit", 2606 "onEvent", 2607 "onEventReverse", 2608 "onEnterOnce", 2609 "onExitOnce", 2610 "onEventOnce", 2611 "onEventReverseOnce", 2612 ], 2613 A = 2614 (typeof window < "u" && 2615 (window.DOMMatrix = 2616 window.DOMMatrix || 2617 window.WebKitCSSMatrix || 2618 window.CSSMatrix || 2619 window.MSCSSMatrix), 2620 180 / Math.PI), 2621 C = (e) => Math.round(1e6 * e) / 1e6; 2622 function Ge(e) { 2623 return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]); 2624 } 2625 function Ke(e, t) { 2626 return 0 === t ? Array.from(e) : [e[0] / t, e[1] / t, e[2] / t]; 2627 } 2628 function E(e, t) { 2629 return e[0] * t[0] + e[1] * t[1] + e[2] * t[2]; 2630 } 2631 function He(e, t, i, s) { 2632 return [e[0] * i + t[0] * s, e[1] * i + t[1] * s, e[2] * i + t[2] * s]; 2633 } 2634 let We = function (e) { 2635 var [e, t, i, s] = e, 2636 r = e * e, 2637 n = t * t, 2638 o = i * i, 2639 a = e * t + i * s, 2640 l = s * s + r + n + o; 2641 return 0.49999 * l < a 2642 ? [0, 2 * Math.atan2(e, s) * A, 90] 2643 : a < -0.49999 * l 2644 ? [0, -2 * Math.atan2(e, s) * A, -90] 2645 : [ 2646 C(Math.atan2(2 * e * s - 2 * t * i, 1 - 2 * r - 2 * o) * A), 2647 C(Math.atan2(2 * t * s - 2 * e * i, 1 - 2 * n - 2 * o) * A), 2648 C(Math.asin(2 * e * t + 2 * i * s) * A), 2649 ]; 2650 }; 2651 var b = i, 2652 x = (b = class extends b { 2653 constructor(e, t, i, s, r, n) { 2654 (super(e, t, i, s), 2655 (this.key = s), 2656 (this.initialValue = new Float32Array(e)), 2657 (this.target = new Float32Array(e)), 2658 (this.current = new Float32Array(e)), 2659 (this.previousValue = new Float32Array(e))); 2660 } 2661 update(i, s, r) { 2662 for (let e = 0, t = this.target.length; e < t; e++) 2663 ((this.target[e] = i[0][e] + s * (i[1][e] - i[0][e])), 2664 (this.previousValue[e] = this.current[e]), 2665 (this.current[e] += (this.target[e] - this.current[e]) * r)); 2666 let e = this.delta(this.current, this.target); 2667 return ( 2668 e < this.epsilon && 2669 ((this.current = new Float32Array(this.target)), (e = 0)), 2670 e > this.epsilon || 2671 (0 === e && 2672 this.previousValue.some((e, t) => e !== this.current[t])) 2673 ); 2674 } 2675 reconcile(i, e) { 2676 return ( 2677 this.initialValue.forEach( 2678 (e, t) => (this.initialValue[t] = i[0][t]), 2679 ), 2680 this.update(i, e, 1) 2681 ); 2682 } 2683 needsUpdate() { 2684 return this.delta(this.current, this.target) > this.epsilon; 2685 } 2686 delta(i, s) { 2687 let r = 0; 2688 for (let e = 0, t = i.length; e < t; e++) r += Math.abs(i[e] - s[e]); 2689 return r; 2690 } 2691 calculateEpsilon(e, t) { 2692 this.epsilon = e || 0.05; 2693 } 2694 set(e) { 2695 throw "ArrayTargetValue does not implement a `set` method. Subclasses must over
2695write"; 2696 } 2697 unset(e) { 2698 throw "ArrayTargetValue does not implement an `unset` method. Subclasses must overwrite"; 2699 } 2700 }), 2701 x = class extends x { 2702 set(e) { 2703 var t = `rgba(${Math.round(this.current[0])},${Math.round(this.current[1])},${Math.round(this.current[2])},${this.current[3]})`; 2704 e.setProperty(this.key, t); 2705 } 2706 unset(e) { 2707 e.removeProperty(this.key); 2708 } 2709 }; 2710 function ze() { 2711 var e = new Float32Array(16); 2712 return ( 2713 (e[0] = 1), 2714 (e[1] = 0), 2715 (e[2] = 0), 2716 (e[3] = 0), 2717 (e[4] = 0), 2718 (e[5] = 1), 2719 (e[6] = 0), 2720 (e[7] = 0), 2721 (e[8] = 0), 2722 (e[9] = 0), 2723 (e[10] = 1), 2724 (e[11] = 0), 2725 (e[12] = 0), 2726 (e[13] = 0), 2727 (e[14] = 0), 2728 (e[15] = 1), 2729 e 2730 ); 2731 } 2732 let qe = /-?\d*\.?\d+/gm, 2733 Ye = { 2734 getStringNumbers(e) { 2735 return e.match(qe).map((e) => parseFloat(e)); 2736 }, 2737 getStringNonNumbers(e) { 2738 return e.split(qe); 2739 }, 2740 reconstructStringWithNumbers(i, s) { 2741 let r = ""; 2742 for (let e = 0, t = i.length; e < t; e++) r += s[e] + i[e]; 2743 return (r += s[i.length]); 2744 }, 2745 trim(e) { 2746 return null === e ? e : e.replace(/\s+/gm, " ").trim(); 2747 }, 2748 }, 2749 { 2750 trim: je, 2751 getStringNumbers: Xe, 2752 getStringNonNumbers: Ze, 2753 reconstructStringWithNumbers: Qe, 2754 } = Ye, 2755 $e = /^\s*?M[(-?\d)|\s]/, 2756 Je = /^(inset|circle|ellipse|polygon|path)\(/, 2757 et = { pathString: (e) => $e.test(e), clipPath: (e) => Je.test(e) }, 2758 tt = { 2759 install(e, t) { 2760 e.plugins.parser.includes(this) || e.plugins.parser.push(this); 2761 }, 2762 parseExpression(e, t) { 2763 return "string" == typeof t && (et.pathString(t) || et.clipPath(t)) 2764 ? Xe(t) 2765 : null; 2766 }, 2767 scalePath(e, i) { 2768 var s = this.parseExpression(null, e); 2769 if (!s) throw Error("Could not parse expression"); 2770 e = Ze(e); 2771 for (let e = 0, t = s.length; e < t; e++) s[e] = s[e] * i; 2772 return this.reconstructPath(s, e); 2773 }, 2774 trim: je, 2775 getPathStrings: Ze, 2776 getPathNumbers: Xe, 2777 reconstructPath: Qe, 2778 }, 2779 it = b, 2780 S = tt, 2781 st = class extends it { 2782 constructor(e, t, i, s, r, n, o) { 2783 (super(S.parseExpression(null, e), t, i, s, r, n), 2784 (this.applyToStyle = o), 2785 (this.pathStrings = S.getPathStrings(e))); 2786 } 2787 update(e, t, i) { 2788 if (e[0].length !== e[1].length) 2789 throw new Error( 2790 "Path length mismatch. Start/end paths must must contain the same number of points. Start value: \r " + 2791 S.reconstructPath(e[0], this.pathStrings), 2792 ); 2793 return super.update(e, t, i); 2794 } 2795 set(e) { 2796 var t = S.reconstructPath(this.current, this.pathStrings); 2797 this.applyToStyle 2798 ? e.setProperty(this.key, t) 2799 : e.setAttribute("d", t); 2800 } 2801 unset(e) { 2802 var t; 2803 this.applyToStyle 2804 ? e.removeProperty(this.key) 2805 : ((t = S.reconstructPath(this.initialValue, this.pathStrings)), 2806 e.setAttribute("d", t)); 2807 } 2808 }, 2809 M = t, 2810 T = i, 2811 rt = class { 2812 constructor(e) { 2813 ((this.controller = e), 2814 (this.element = this.controller.element), 2815 (this.keyframe = null), 2816 (this.event = ""), 2817 this.pageMetrics, 2818 (this.tweenProps = this.controller.tweenProps)); 2819 } 2820 }, 2821 nt = ve, 2822 ot = n, 2823 at = function (t) { 2824 var e = ((e) => { 2825 for (var t in e) { 2826 var i = e[t]; 2827 if ( 2828 -1 === Re.KeyframeJSONReservedWords.indexOf(t) && 2829 Array.isArray(i) 2830 ) 2831 return !0; 2832 } 2833 return !1; 2834 })(t), 2835 i = Ue.filter((e) => e in t); 2836 if (void 0 !== t.cssClass || void 0 !== t.style) { 2837 if (e) 2838 throw new Error( 2839 "CSS Keyframes cannot tween values, please use multiple keyframes instead", 2840 ); 2841 if (0 < i.length) 2842 throw new Error( 2843 "CSS Keyframes cannot dispatch events, please use multiple keyframes instead", 2844 ); 2845 return Be; 2846 } 2847 if (e && 0 === i.length) return Ne; 2848 if (t.event || 0 < i.length) { 2849 if (e) 2850 throw new Error( 2851 `Events such as '${i.join(", ")}' do not fire when tweening values, please use multiple keyframes instead`, 2852 ); 2853 return Fe; 2854 } 2855 throw ( 2856 delete t.anchors, 2857 new Error( 2858 "Could not determine tween type based on " + JSON.stringify(t), 2859 ) 2860 ); 2861 }, 2862 lt = Z,
2863 ht = o, 2864 ct = function (t) { 2865 var i = 2866 (t = 2867 t instanceof Element 2868 ? String(getComputedStyle(t).transform).trim() 2869 : t) instanceof DOMMatrix 2870 ? t 2871 : new DOMMatrix(t), 2872 s = new Array(4); 2873 for (let t = 1; t < 5; t++) { 2874 var r = (s[t - 1] = new Float32Array(4)); 2875 for (let e = 1; e < 5; e++) r[e - 1] = i["m" + t + e]; 2876 } 2877 { 2878 var n = s, 2879 t = new Float32Array(4), 2880 o = new Float32Array(3), 2881 a = new Float32Array(3), 2882 l = new Float32Array(3), 2883 h = 2884 ((l[0] = n[3][0]), 2885 (l[1] = n[3][1]), 2886 (l[2] = n[3][2]), 2887 new Array(3)); 2888 for (let e = 0; e < 3; e++) h[e] = n[e].slice(0, 3); 2889 ((o[0] = Ge(h[0])), 2890 (h[0] = Ke(h[0], o[0])), 2891 (a[0] = E(h[0], h[1])), 2892 (h[1] = He(h[1], h[0], 1, -a[0])), 2893 (o[1] = Ge(h[1])), 2894 (h[1] = Ke(h[1], o[1])), 2895 (a[0] /= o[1]), 2896 (a[1] = E(h[0], h[2])), 2897 (h[2] = He(h[2], h[0], 1, -a[1])), 2898 (a[2] = E(h[1], h[2])), 2899 (h[2] = He(h[2], h[1], 1, -a[2])), 2900 (o[2] = Ge(h[2])), 2901 (h[2] = Ke(h[2], o[2])), 2902 (a[1] /= o[2]), 2903 (a[2] /= o[2]), 2904 (a = h[2])); 2905 var c = [ 2906 (c = h[1])[1] * a[2] - c[2] * a[1], 2907 c[2] * a[0] - c[0] * a[2], 2908 c[0] * a[1] - c[1] * a[0], 2909 ]; 2910 if (E(h[0], c) < 0) 2911 for (let e = 0; e < 3; e++) 2912 ((o[e] *= -1), (h[e][0] *= -1), (h[e][1] *= -1), (h[e][2] *= -1)); 2913 ((t[0] = 2914 0.5 * Math.sqrt(Math.max(1 + h[0][0] - h[1][1] - h[2][2], 0))), 2915 (t[1] = 2916 0.5 * Math.sqrt(Math.max(1 - h[0][0] + h[1][1] - h[2][2], 0))), 2917 (t[2] = 2918 0.5 * Math.sqrt(Math.max(1 - h[0][0] - h[1][1] + h[2][2], 0))), 2919 (t[3] = 2920 0.5 * Math.sqrt(Math.max(1 + h[0][0] + h[1][1] + h[2][2], 0))), 2921 h[2][1] > h[1][2] && (t[0] = -t[0]), 2922 h[0][2] > h[2][0] && (t[1] = -t[1]), 2923 h[1][0] > h[0][1] && (t[2] = -t[2])); 2924 let e; 2925 return { 2926 translation: l, 2927 rotation: (e = 2928 t[0] < 0.001 && 0 <= t[0] && t[1] < 0.001 && 0 <= t[1] 2929 ? [0, 0, C((180 * Math.atan2(h[0][1], h[0][0])) / Math.PI)] 2930 : We(t)), 2931 eulerRotation: e, 2932 scale: [C(o[0]), C(o[1]), C(o[2])], 2933 }; 2934 } 2935 }, 2936 { transformAttributes: dt, cssAttributes: ut, domAttributes: pt } = a, 2937 mt = x, 2938 gt = G, 2939 ft = st, 2940 I = Math.PI / 180, 2941 O = { 2942 create: ze, 2943 rotateX: function (e, t, i) { 2944 var s = Math.sin(i), 2945 i = Math.cos(i), 2946 r = t[4], 2947 n = t[5], 2948 o = t[6], 2949 a = t[7], 2950 l = t[8], 2951 h = t[9], 2952 c = t[10], 2953 d = t[11]; 2954 return ( 2955 t !== e && 2956 ((e[0] = t[0]), 2957 (e[1] = t[1]), 2958 (e[2] = t[2]), 2959 (e[3] = t[3]), 2960 (e[12] = t[12]), 2961 (e[13] = t[13]), 2962 (e[14] = t[14]), 2963 (e[15] = t[15])), 2964 (e[4] = r * i + l * s), 2965 (e[5] = n * i + h * s), 2966 (e[6] = o * i + c * s), 2967 (e[7] = a * i + d * s), 2968 (e[8] = l * i - r * s), 2969 (e[9] = h * i - n * s), 2970 (e[10] = c * i - o * s), 2971 (e[11] = d * i - a * s), 2972 e 2973 ); 2974 }, 2975 rotateY: function (e, t, i) { 2976 var s = Math.sin(i), 2977 i = Math.cos(i), 2978 r = t[0], 2979 n = t[1], 2980 o = t[2], 2981 a = t[3], 2982 l = t[8], 2983 h = t[9], 2984 c = t[10], 2985 d = t[11]; 2986 return ( 2987 t !== e && 2988 ((e[4] = t[4]), 2989 (e[5] = t[5]), 2990 (e[6] = t[6]), 2991 (e[7] = t[7]), 2992 (e[12] = t[12]), 2993 (e[13] = t[13]), 2994 (e[14] = t[14]), 2995 (e[15] = t[15])), 2996 (e[0] = r * i - l * s), 2997 (e[1] = n * i - h * s), 2998 (e[2] = o * i - c * s), 2999 (e[3] = a * i - d * s), 3000 (e[8] = r * s + l * i), 3001 (e[9] = n * s + h * i), 3002 (e[10] = o * s + c * i), 3003 (e[11] = a * s + d * i), 3004 e 3005 ); 3006 }, 3007 rotateZ: function (e, t, i) { 3008 var s = Math.sin(i), 3009 i = Math.cos(i), 3010 r = t[0], 3011 n = t[1], 3012 o = t[2], 3013 a = t[3], 3014 l = t[4], 3015 h = t[5], 3016 c = t[6], 3017 d = t[7]; 3018 return ( 3019 t !== e && 3020 ((e[8] = t[8]), 3021 (e[9] = t[9]), 3022 (e[10] = t[10]), 3023 (e[11] = t[11]), 3024 (e[12] = t[12]), 3025 (e[13] = t[13]), 3026 (e[14] = t[14]), 3027 (e[15] = t[15])), 3028 (e[0] = r * i + l * s), 3029 (e[1] = n * i + h * s), 3030 (e[2] = o * i + c * s), 3031 (e[3] = a * i + d * s), 3032 (e[4] = l * i - r * s), 3033 (e[5] = h * i - n * s), 3034 (e[6] = c * i - o * s), 3035 (e[7] = d * i - a * s), 3036 e 3037 ); 3038 }, 3039 scale: function (e, t, i) { 3040 var s = i[0],
3041 r = i[1], 3042 i = i[2]; 3043 return ( 3044 (e[0] = t[0] * s), 3045 (e[1] = t[1] * s), 3046 (e[2] = t[2] * s), 3047 (e[3] = t[3] * s), 3048 (e[4] = t[4] * r), 3049 (e[5] = t[5] * r), 3050 (e[6] = t[6] * r), 3051 (e[7] = t[7] * r), 3052 (e[8] = t[8] * i), 3053 (e[9] = t[9] * i), 3054 (e[10] = t[10] * i), 3055 (e[11] = t[11] * i), 3056 (e[12] = t[12]), 3057 (e[13] = t[13]), 3058 (e[14] = t[14]), 3059 (e[15] = t[15]), 3060 e 3061 ); 3062 }, 3063 }, 3064 vt = N, 3065 yt = class extends vt { 3066 constructor(e, t) { 3067 (super(), 3068 (this._events.draw = []), 3069 (this.uuid = ht()), 3070 (this.group = e), 3071 (this.element = t), 3072 (this._ownerIsElement = this.element instanceof Element), 3073 this._ownerIsElement 3074 ? (this.friendlyName = 3075 this.element.tagName + 3076 "." + 3077 Array.from(this.element.classList).join(".")) 3078 : (this.friendlyName = this.element.friendlyName || this.uuid), 3079 (this.element._animInfo = 3080 this.element._animInfo || new nt(e, this)), 3081 ((this.element._animInfo.controller = 3082 this).element._animInfo.group = this.group), 3083 this.element._animInfo.controllers.push(this), 3084 (this.tweenProps = this.element._animInfo.tweenProps), 3085 (this.eventObject = new rt(this)), 3086 (this.needsStyleUpdate = !1), 3087 (this.needsClassUpdate = !1), 3088 (this.elementMetrics = this.group.metrics.add(this.element)), 3089 (this.attributes = []), 3090 (this.cssAttributes = []), 3091 (this.domAttributes = []), 3092 (this.keyframes = {}), 3093 (this._allKeyframes = []), 3094 (this._activeKeyframes = []), 3095 (this.keyframesRequiringDispatch = []), 3096 this.updateCachedValuesFromElement(), 3097 (this.boundsMin = 0), 3098 (this.boundsMax = 0), 3099 (this.mat2d = new Float32Array(6)), 3100 (this.mat4 = O.create()), 3101 (this.needsWrite = !0), 3102 (this.onDOMWriteImp = this._ownerIsElement 3103 ? this.onDOMWriteForElement 3104 : this.onDOMWriteForObject)); 3105 } 3106 on(e, t) { 3107 return super.on(e, t); 3108 } 3109 destroy() { 3110 var e; 3111 (this.element._animInfo && 3112 (this.element._animInfo.controller === this && 3113 (this.element._animInfo.controller = null), 3114 -1 !== (e = this.element._animInfo.controllers.indexOf(this)) && 3115 this.element._animInfo.controllers.splice(e, 1), 3116 0 === this.element._animInfo.controllers.length 3117 ? (this.element._animInfo = null) 3118 : (e = this.element._animInfo.controllers.find( 3119 (e) => e.group !== e.group.anim.tweenGroup, 3120 )) && 3121 ((this.element._animInfo.controller = e), 3122 (this.element._animInfo.group = e.group))), 3123 (this.eventObject.controller = null), 3124 (this.eventObject.element = null), 3125 (this.eventObject.keyframe = null), 3126 (this.eventObject.tweenProps = null), 3127 (this.eventObject = null), 3128 (this.elementMetrics = null), 3129 (this.group = null), 3130 (this.keyframesRequiringDispatch = null)); 3131 for (let e = 0; e < this._allKeyframes.length; e++) 3132 this._allKeyframes[e].destroy(); 3133 ((this._allKeyframes = null), 3134 (this._activeKeyframes = null), 3135 (this.attributes = null), 3136 (this.keyframes = null), 3137 (this.element = null), 3138 (this.tweenProps = null), 3139 (this.destroyed = !0), 3140 super.destroy()); 3141 } 3142 remove() { 3143 return this.group && this.group.removeKeyframeController(this); 3144 } 3145 updateCachedValuesFromElement() { 3146 if (this._ownerIsElement) { 3147 var t = this.getTargetComputedStyle(!0); 3148 if (null === t) 3149 throw Error("Could not retrieve computed style for target"); 3150 let e = new DOMMatrix(t.getPropertyValue("transform")), 3151 i = ct(e), 3152 s = M.KeyframeDefaults.epsilon; 3153 (["x", "y", "z"].forEach((e, t) => { 3154 this.tweenProps[e] = new T(i.translation[t], s, !1, e); 3155 }), 3156 (this.tweenProps.rotation = new T( 3157 i.rotation[2], 3158 s, 3159 !1, 3160 "rotation", 3161 )), 3162 ["rotationX", "rotationY", "rotationZ"].forEach((e, t) => { 3163 this.tweenProps[e] = new T(i.rotation[t], s, !1, e); 3164 }), 3165 (this.tweenProps.scale = new T(i.scale[0], s, !1, "scale")), 3166 ["scaleX", "scaleY", "scaleZ"].forEach((e, t) => { 3167 this.tweenProps[e] = new T(i.scale[t], s, !1, e); 3168 })); 3169 } 3170 } 3171 addKeyframe(e) { 3172 var t = at(e); 3173 if (t) 3174 return ( 3175 (t = new t(this, e)).parseOptions(e), 3176 (t.id = this._allKeyframes.length), 3177 this._allKeyframes.push(t), 3178 t 3179 ); 3180 throw new Error( 3181 "AnimSystem Cannot create keyframe for from options `" + e + "`", 3182 ); 3183 } 3184 needsUpdate() { 3185 for (let e = 0, t = this.attributes.length; e < t; e++) { 3186 var i = this.attributes[e]; 3187 if (this.tweenProps[i].needsUpdate()) return !0; 3188 } 3189 return !1; 3190 } 3191 updateLocalProgress(i) { 3192 for (let e = 0, t = this.attributes.length; e < t; e++) { 3193 var s = this.attributes[e], 3194 r = this.keyframes[this.attributes[e]]; 3195 1 === r.length 3196 ? r[0].updateLocalProgress(i) 3197 : (r = this.getNearestKeyframeForAttribute(s, i)) && 3198 r.updateLocalProgress(i); 3199 } 3200 } 3201 reconcile() { 3202 for (let e = 0, t = this.attributes.length; e < t; e++) { 3203 var i = this.attributes[e], 3204 s = this.getNearestKeyframeForAttribute( 3205 i, 3206 this.group.position.local, 3207 ); 3208 null !== s && 3209 (s.updateLocalProgress(this.group.position.local), 3210 s.snapAtCreation) && 3211 s.reconcile(i); 3212 } 3213 } 3214 determineActiveKeyframes(t) { 3215 t = t || lt(Array.from(document.documentElement.classList)); 3216 let e = this._activeKeyframes, 3217 i = this.attributes, 3218 o = {}; 3219 ((this._activeKeyframes = []), 3220 (this.attributes = []), 3221 (this.keyframes = {})); 3222 for (let e = 0; e < this._allKeyframes.length; e++) { 3223 var s = this._allKeyframes[e]; 3224 if (s.markedForRemoval || s.hidden || !s.setEnabled(t)) 3225 for (var r in s.animValues) 3226 ((this.tweenProps[r].isActive = s.preserveState), 3227 s.preserveState && (o[r] = !0)); 3228 else 3229 for (var n in (this._activeKeyframes.push(s), s.animValues)) 3230 ((this.keyframes[n] = this.keyframes[n] || []), 3231 this.keyframes[n].push(s), 3232 -1 === this.attributes.indexOf(n) && 3233 ((o[n] = !0), 3234 this.attributes.push(n), 3235 (this.tweenProps[n].isActive = !0))); 3236 }
3237 (this.attributes.forEach((e) => (this.tweenProps[e].isActive = !0)), 3238 (this.cssAttributes = this.attributes 3239 .filter((e) => ut.includes(e) || e.startsWith("--")) 3240 .map((e) => this.tweenProps[e])), 3241 (this.domAttributes = this.attributes 3242 .filter((e) => pt.includes(e)) 3243 .map((e) => this.tweenProps[e]))); 3244 let a = e.filter((e) => -1 === this._activeKeyframes.indexOf(e)); 3245 if (0 !== a.length) { 3246 let n = i.filter( 3247 (e) => -1 === this.attributes.indexOf(e) && !o.hasOwnProperty(e), 3248 ); 3249 if (0 !== n.length) 3250 if (((this.needsWrite = !0), this._ownerIsElement)) 3251 this.group.rafEmitter.once( 3252 "before:draw", 3253 () => { 3254 var e = n.some((e) => dt.includes(e)), 3255 t = e && Object.keys(o).some((e) => dt.includes(e)); 3256 e && !t && this.element.style.removeProperty("transform"); 3257 for (let e = 0, t = n.length; e < t; ++e) { 3258 var i = n[e], 3259 s = this.tweenProps[i], 3260 i = s.isActive ? s.target : s.initialValue; 3261 if (((s.current = s.target = i), !s.isActive)) 3262 switch (!0) { 3263 case s instanceof mt: 3264 case s instanceof gt: 3265 s.unset(this.element.style); 3266 break; 3267 case s instanceof ft: 3268 s.unset( 3269 s.applyToStyle 3270 ? this.element.style 3271 : this.element, 3272 ); 3273 } 3274 } 3275 for (let e = 0, t = a.length; e < t; ++e) { 3276 var r = a[e]; 3277 r instanceof ot && !r.preserveState && r._unapply(); 3278 } 3279 }, 3280 !0, 3281 ); 3282 else 3283 for (let e = 0, t = n.length; e < t; ++e) { 3284 var l = this.tweenProps[n[e]]; 3285 ((l.current = l.target), (l.isActive = !1)); 3286 } 3287 } 3288 } 3289 onDOMRead(i) { 3290 for (let e = 0, t = this.attributes.length; e < t; e++) { 3291 var s = this.attributes[e], 3292 r = this.getNearestKeyframeForAttribute(s, i); 3293 r && r.onDOMRead(s) && (this.needsWrite = !0); 3294 } 3295 } 3296 onDOMWrite() { 3297 (this.needsWrite || this.needsClassUpdate || this.needsStyleUpdate) && 3298 ((this.needsWrite = !1), 3299 this.onDOMWriteImp(), 3300 this.handleEventDispatch()); 3301 } 3302 onDOMWriteForObject() { 3303 for (let e = 0, t = this.attributes.length; e < t; e++) { 3304 var i = this.attributes[e]; 3305 this.element[i] = this.tweenProps[i].current; 3306 } 3307 } 3308 onDOMWriteForElement(i = this.element.style) { 3309 this.handleStyleTransform(i); 3310 for (let e = 0, t = this.cssAttributes.length; e < t; e++) 3311 this.cssAttributes[e].set(i); 3312 for (let e = 0, t = this.domAttributes.length; e < t; e++) 3313 this.domAttributes[e].set(this.element); 3314 if (this.needsStyleUpdate) { 3315 for (var e in this.tweenProps.targetStyles) 3316 (null !== this.tweenProps.targetStyles[e] && 3317 (this.element.style[e] = this.tweenProps.targetStyles[e]), 3318 (this.tweenProps.targetStyles[e] = null)); 3319 this.needsStyleUpdate = !1; 3320 } 3321 this.needsClassUpdate && 3322 (0 < this.tweenProps.targetClasses.add.length && 3323 this.element.classList.add.apply( 3324 this.element.classList, 3325 this.tweenProps.targetClasses.add, 3326 ), 3327 0 < this.tweenProps.targetClasses.remove.length && 3328 this.element.classList.remove.apply( 3329 this.element.classList, 3330 this.tweenProps.targetClasses.remove, 3331 ), 3332 (this.tweenProps.targetClasses.add.length = 0), 3333 (this.tweenProps.targetClasses.remove.length = 0), 3334 (this.needsClassUpdate = !1)); 3335 } 3336 handleStyleTransform(e = this.element.style) { 3337 var t, 3338 i, 3339 s, 3340 r, 3341 n, 3342 o, 3343 a, 3344 l, 3345 h, 3346 c = this.tweenProps; 3347 c.z.isActive || c.rotationX.isActive || c.rotationY.isActive 3348 ? (((r = this.mat4)[0] = 1), 3349 (r[1] = 0), 3350 (r[2] = 0), 3351 (r[3] = 0), 3352 (r[4] = 0), 3353 (r[5] = 1), 3354 (r[6] = 0), 3355 (r[7] = 0), 3356 (r[8] = 0),
3357 (r[9] = 0), 3358 (r[10] = 1), 3359 (r[11] = 0), 3360 (r[12] = 0), 3361 (r[13] = 0), 3362 (r[14] = 0), 3363 (r[15] = 1), 3364 (t = c.x.current), 3365 (n = c.y.current), 3366 (a = c.z.current), 3367 (r[12] = r[0] * t + r[4] * n + r[8] * a + r[12]), 3368 (r[13] = r[1] * t + r[5] * n + r[9] * a + r[13]), 3369 (r[14] = r[2] * t + r[6] * n + r[10] * a + r[14]), 3370 (r[15] = r[3] * t + r[7] * n + r[11] * a + r[15]), 3371 (0 === c.rotation.current && 0 === c.rotationZ.current) || 3372 ((t = (c.rotation.current || c.rotationZ.current) * I), 3373 O.rotateZ(r, r, t)), 3374 0 !== c.rotationX.current && 3375 ((n = c.rotationX.current * I), O.rotateX(r, r, n)), 3376 0 !== c.rotationY.current && 3377 ((a = c.rotationY.current * I), O.rotateY(r, r, a)), 3378 (1 === c.scale.current && 3379 1 === c.scaleX.current && 3380 1 === c.scaleY.current) || 3381 O.scale(r, r, [c.scale.current, c.scale.current, 1]), 3382 (e.transform = 3383 "matrix3d(" + 3384 r[0] + 3385 "," + 3386 r[1] + 3387 "," + 3388 r[2] + 3389 "," + 3390 r[3] + 3391 "," + 3392 r[4] + 3393 "," + 3394 r[5] + 3395 "," + 3396 r[6] + 3397 "," + 3398 r[7] + 3399 "," + 3400 r[8] + 3401 "," + 3402 r[9] + 3403 "," + 3404 r[10] + 3405 "," + 3406 r[11] + 3407 "," + 3408 r[12] + 3409 "," + 3410 r[13] + 3411 "," + 3412 r[14] + 3413 "," + 3414 r[15] + 3415 ")")) 3416 : (c.x.isActive || 3417 c.y.isActive || 3418 c.rotation.isActive || 3419 c.rotationZ.isActive || 3420 c.scale.isActive || 3421 c.scaleX.isActive || 3422 c.scaleY.isActive) && 3423 (((t = this.mat2d)[0] = 1), 3424 (t[1] = 0), 3425 (t[2] = 0), 3426 (t[3] = 1), 3427 (t[4] = 0), 3428 (t[5] = 0), 3429 (n = c.x.current), 3430 (a = c.y.current), 3431 (r = t[1]), 3432 (i = t[2]), 3433 (o = t[3]), 3434 (s = t[4]), 3435 (l = t[5]), 3436 (t[0] = h = t[0]), 3437 (t[1] = r), 3438 (t[2] = i), 3439 (t[3] = o), 3440 (t[4] = h * n + i * a + s), 3441 (t[5] = r * n + o * a + l), 3442 (0 === c.rotation.current && 0 === c.rotationZ.current) || 3443 ((h = (c.rotation.current || c.rotationZ.current) * I), 3444 (i = t[0]), 3445 (s = t[1]), 3446 (r = t[2]), 3447 (n = t[3]), 3448 (o = t[4]), 3449 (a = t[5]), 3450 (l = Math.sin(h)), 3451 (h = Math.cos(h)), 3452 (t[0] = i * h + r * l), 3453 (t[1] = s * h + n * l), 3454 (t[2] = i * -l + r * h), 3455 (t[3] = s * -l + n * h), 3456 (t[4] = o), 3457 (t[5] = a)), 3458 c.scaleX.isActive || c.scaleY.isActive 3459 ? ((t[0] = t[0] * c.scaleX.current), 3460 (t[1] = t[1] * c.scaleX.current), 3461 (t[2] = t[2] * c.scaleY.current), 3462 (t[3] = t[3] * c.scaleY.current)) 3463 : ((t[0] = t[0] * c.scale.current), 3464 (t[1] = t[1] * c.scale.current), 3465 (t[2] = t[2] * c.scale.current), 3466 (t[3] = t[3] * c.scale.current)), 3467 (e.transform = 3468 "matrix(" + 3469 t[0] + 3470 ", " + 3471 t[1] + 3472 ", " + 3473 t[2] + 3474 ", " + 3475 t[3] + 3476 ", " + 3477 t[4] + 3478 ", " + 3479 t[5] + 3480 ")")); 3481 } 3482 handleEventDispatch() { 3483 if (0 !== this.keyframesRequiringDispatch.length) { 3484 for ( 3485 let e = 0, t = this.keyframesRequiringDispatch.length; 3486 e < t; 3487 e++ 3488 ) { 3489 var i = this.keyframesRequiringDispatch[e]; 3490 ((i.needsEventDispatch = !1), 3491 (this.eventObject.keyframe = i), 3492 (this.eventObject.pageMetrics = M.pageMetrics), 3493 (this.eventObject.event = i.event), 3494 this.trigger(i.event, this.eventObject)); 3495 } 3496 this.keyframesRequiringDispatch.length = 0; 3497 } 3498 if (0 !== this._events.draw.length) { 3499 ((this.eventObject.keyframe = null),
3500 (this.eventObject.event = "draw")); 3501 for (let e = this._events.draw.length - 1; 0 <= e; e--) 3502 this._events.draw[e](this.eventObject); 3503 } 3504 } 3505 updateAnimationConstraints() { 3506 for (let e = 0, t = this._activeKeyframes.length; e < t; e++) 3507 this._activeKeyframes[e].evaluateConstraints(); 3508 (this.attributes.forEach((e) => { 3509 1 !== this.keyframes[e].length && 3510 this.keyframes[e].sort(M.KeyframeComparison); 3511 }), 3512 this.updateDeferredPropertyValues()); 3513 } 3514 refreshMetrics() { 3515 let t = new Set([this.element]); 3516 (this._allKeyframes.forEach((e) => 3517 e.anchors.forEach((e) => t.add(e)), 3518 ), 3519 this.group.metrics.refreshCollection(t), 3520 (this.group.keyframesDirty = !0)); 3521 } 3522 getTargetComputedStyle(e = !1) { 3523 return this._ownerIsElement 3524 ? ((!e && void 0 !== this.group.computedStyleCache[this.uuid]) || 3525 (this.group.computedStyleCache[this.uuid] = getComputedStyle( 3526 this.element, 3527 )), 3528 this.group.computedStyleCache[this.uuid]) 3529 : null; 3530 } 3531 updateDeferredPropertyValues() { 3532 for (let e = 0, t = this.attributes.length; e < t; e++) { 3533 var i = this.attributes[e], 3534 s = this.keyframes[i]; 3535 if (!(s[0].keyframeType > M.KeyframeTypes.InterpolationForward)) 3536 for (let e = 0, t = s.length; e < t; e++) { 3537 var r = s[e]; 3538 (null === r.jsonProps[i][0] && 3539 (0 === e 3540 ? (r.jsonProps[i][0] = r.animValues[i][0] = 3541 this.tweenProps[i].current) 3542 : (r.animValues[i][0] = s[e - 1].animValues[i][1])), 3543 null === r.jsonProps[i][1] && 3544 (e === t - 1 3545 ? (r.animValues[i][1] = this.tweenProps[i].current) 3546 : (r.animValues[i][1] = s[e + 1].animValues[i][0]))); 3547 } 3548 } 3549 } 3550 getBounds(i) { 3551 ((this.boundsMin = Number.MAX_VALUE), 3552 (this.boundsMax = -Number.MAX_VALUE)); 3553 for (let e = 0, t = this.attributes.length; e < t; e++) { 3554 var s = this.keyframes[this.attributes[e]]; 3555 for (let e = 0; e < s.length; e++) { 3556 var r = s[e]; 3557 ((this.boundsMin = Math.min(r.start, this.boundsMin)), 3558 (this.boundsMax = Math.max(r.end, this.boundsMax)), 3559 (i.min = Math.min(r.start, i.min)), 3560 (i.max = Math.max(r.end, i.max))); 3561 } 3562 } 3563 } 3564 getNearestKeyframeForAttribute(e, t) { 3565 t = void 0 !== t ? t : this.group.position.local; 3566 let i = null, 3567 s = Number.POSITIVE_INFINITY, 3568 r = this.keyframes[e]; 3569 if (void 0 === r) return null; 3570 var n = r.length; 3571 if (0 === n) return null; 3572 if (1 === n) return r[0]; 3573 for (let e = 0; e < n; e++) { 3574 var o = r[e]; 3575 if (o.isInRange(t)) { 3576 i = o; 3577 break; 3578 } 3579 var a = Math.min(Math.abs(t - o.start), Math.abs(t - o.end)); 3580 a < s && ((s = a), (i = o)); 3581 } 3582 return i; 3583 } 3584 getAllKeyframesForAttribute(e) { 3585 return this.keyframes[e]; 3586 } 3587 updateKeyframe(e, t) { 3588 (e.parseOptions(t), 3589 e.evaluateConstraints(), 3590 (this.group.keyframesDirty = !0), 3591 this.group.rafEmitter.update(() => {
3592 (this.trigger(M.EVENTS.ON_KEYFRAME_UPDATED, e), 3593 this.group.trigger(M.EVENTS.ON_KEYFRAME_UPDATED, e)); 3594 })); 3595 } 3596 removeKeyframe(i) { 3597 return i.destroyed || i.controller !== this 3598 ? Promise.resolve(i) 3599 : ((i.markedForRemoval = !0), 3600 (this.group.keyframesDirty = !0), 3601 new Promise((t) => { 3602 this.group.rafEmitter.draw(() => { 3603 (t(i), i.destroy()); 3604 var e = this._allKeyframes.indexOf(i); 3605 -1 !== e && this._allKeyframes.splice(e, 1); 3606 }); 3607 })); 3608 } 3609 updateAnimation(e, t) { 3610 return ( 3611 this.group.gui && 3612 console.warn( 3613 "KeyframeController.updateAnimation(keyframe,props) has been deprecated. Please use updateKeyframe(keyframe,props)", 3614 ), 3615 this.updateKeyframe(e, t) 3616 ); 3617 } 3618 }, 3619 P = {}; 3620 { 3621 ((b = P), 3622 Object.defineProperty(b, Symbol.toStringTag, { value: "Module" })); 3623 var D, 3624 o = typeof window < "u" ? window : {}, 3625 a = "SharedInstance", 3626 x = o.AC, 3627 wt = 3628 ((D = {}), 3629 { 3630 get: function (e, t) { 3631 var i = null; 3632 return (i = D[e] && D[e][t] ? D[e][t] : i); 3633 }, 3634 set: function (e, t, i) { 3635 return ( 3636 D[e] || (D[e] = {}), 3637 (D[e][t] = "function" == typeof i ? new i() : i), 3638 D[e][t] 3639 ); 3640 }, 3641 share: function (e, t, i) { 3642 return this.get(e, t) || this.set(e, t, i); 3643 }, 3644 remove: function (e, t) { 3645 var i = typeof t; 3646 if ("string" == i || "number" == i) 3647 return D[e] && D[e][t] ? void (D[e][t] = null) : void 0; 3648 D[e] && (D[e] = null); 3649 }, 3650 }); 3651 (x = x || (o.AC = {}))[a] || (x[a] = wt); 3652 let e = x[a], 3653 t = { SharedInstance: e }, 3654 n = (e) => "" + (e[0].toUpperCase() + e.slice(1)), 3655 i = [ 3656 "before:update", 3657 "update", 3658 "after:update", 3659 "before:draw", 3660 "draw", 3661 "after:draw", 3662 ], 3663 s = (e, r, t) => { 3664 var i = n(t); 3665 ["before" + i, t, "after" + i].forEach((e) => { 3666 let s = e.replace(/[A-Z]/, (e) => ":" + e[0].toLowerCase()); 3667 ((r[e] = (e) => r.once(s, e, !0)), 3668 (r["next" + n(e)] = (e) => { 3669 let t = 0, 3670 i = () => { 3671 if (1 == t++) return (e(), r.off(s, i)); 3672 r.run(); 3673 }; 3674 return r.on(s, i, !0); 3675 }), 3676 (r["cancel" + n(e)] = r["cancelNext" + n(e)] = 3677 (e) => r.off(s, e))); 3678 }); 3679 }, 3680 r = null; 3681 var wt = (o = t.SharedInstance.share( 3682 "RAFEmitter", 3683 "2.x", 3684 new (class Si { 3685 constructor() { 3686 ((this.scheduled = !1), 3687 (this.e = {}), 3688 r || 3689 (((r = this).raf = 3690 typeof window < "u" 3691 ? window.requestAnimationFrame.bind(window) 3692 : () => {}), 3693 (this.emitters = new Set([this])), 3694 this._setExec(this), 3695 (this.cancel = this.destroy = () => {}), 3696 (this.create = () => new Si()._setExec(this)), 3697 (this.perform = () => { 3698 this.scheduled = !1; 3699 let e = this.emitters; 3700 ((this.emitters = new Set([this])), 3701 i.forEach((t) => { 3702 e.forEach((e) => { 3703 (t === i[0] && (e.scheduled = !1), e.trigger(t)); 3704 }); 3705 })); 3706 }), 3707 (this.schedule = (e) => { 3708 (this.emitters.add(e), 3709 this.scheduled || 3710 ((this.scheduled = !0), this.raf(this.perform))); 3711 }))); 3712 } 3713 _setExec(e) { 3714 return ( 3715 (this.exec = e), 3716 s(this.exec, this, "update"), 3717 s(this.exec, this, "draw"), 3718 this 3719 ); 3720 } 3721 run() { 3722 this.scheduled || 3723 (this.exec.schedule(this), (this.scheduled = !0)); 3724 } 3725 destroy() {
3726 (this.cancel(), Object.freeze((this.e = {}))); 3727 } 3728 cancel() { 3729 ((this.scheduled = !1), this.exec.emitters.delete(this)); 3730 } 3731 on(e, t, i) { 3732 return ( 3733 i && this.run(), 3734 (this.e[e] = this.e[e] || []), 3735 this.e[e].push(t), 3736 t 3737 ); 3738 } 3739 once(e, t, i) { 3740 let s = () => { 3741 (this.off(e, s), t()); 3742 }; 3743 return this.on(e, s, i); 3744 } 3745 has(e) { 3746 return e in this.e && 0 !== this.e[e].length; 3747 } 3748 off(e, t) { 3749 this.has(e) && 3750 (t 3751 ? -1 !== (t = this.e[e].indexOf(t)) && this.e[e].splice(t, 1) 3752 : delete this.e[e]); 3753 } 3754 trigger(t) { 3755 this.has(t) && 3756 this.e[t].slice().forEach((e) => { 3757 this.e[t].includes(e) && e(); 3758 }); 3759 } 3760 })(), 3761 )).create, 3762 x = o.beforeUpdate, 3763 a = o.update, 3764 _t = o.afterUpdate, 3765 At = o.beforeDraw, 3766 Ct = o.draw, 3767 Et = o.nextBeforeUpdate, 3768 bt = o.nextUpdate, 3769 xt = o.nextAfterUpdate, 3770 St = o.nextBeforeDraw, 3771 Mt = o.nextDraw, 3772 Tt = o.nextAfterDraw, 3773 It = o.cancelBeforeUpdate, 3774 Ot = o.cancelUpdate, 3775 Pt = o.cancelAfterUpdate, 3776 Dt = o.cancelBeforeDraw, 3777 Vt = o.cancelDraw, 3778 kt = o.cancelAfterDraw, 3779 Lt = o.cancelNextBeforeUpdate, 3780 Rt = o.cancelNextUpdate, 3781 Nt = o.cancelNextAfterUpdate, 3782 Ft = o.cancelNextBeforeDraw, 3783 Bt = o.cancelNextDraw, 3784 Ut = o.cancelNextAfterDraw; 3785 ((b.afterDraw = o.afterDraw), 3786 (b.afterUpdate = _t), 3787 (b.beforeDraw = At), 3788 (b.beforeUpdate = x), 3789 (b.cancelAfterDraw = kt), 3790 (b.cancelAfterUpdate = Pt), 3791 (b.cancelBeforeDraw = Dt), 3792 (b.cancelBeforeUpdate = It), 3793 (b.cancelDraw = Vt), 3794 (b.cancelNextAfterDraw = Ut), 3795 (b.cancelNextAfterUpdate = Nt), 3796 (b.cancelNextBeforeDraw = Ft), 3797 (b.cancelNextBeforeUpdate = Lt), 3798 (b.cancelNextDraw = Bt), 3799 (b.cancelNextUpdate = Rt), 3800 (b.cancelUpdate = Ot), 3801 (b.create = wt), 3802 (b.draw = Ct), 3803 (b.nextAfterDraw = Tt), 3804 (b.nextAfterUpdate = xt), 3805 (b.nextBeforeDraw = St), 3806 (b.nextBeforeUpdate = Et), 3807 (b.nextDraw = Mt), 3808 (b.nextUpdate = bt), 3809 (b.rafEmitter = o), 3810 (b.update = a)); 3811 } 3812 let Gt = N, 3813 Kt = s, 3814 Ht = Z, 3815 V = t, 3816 Wt = ve, 3817 zt = class { 3818 constructor() { 3819 ((this.local = 0), 3820 (this.localUnclamped = 0), 3821 (this.lastPosition = 0)); 3822 } 3823 }, 3824 qt = class { 3825 constructor(e, t) { 3826 ((this.a = e.top - t), 3827 this.a < 0 && (this.a = e.top), 3828 (this.d = e.bottom)); 3829 } 3830 }, 3831 Yt = _e, 3832 jt = e, 3833 Xt = yt, 3834 Zt = P.create, 3835 Qt = 0, 3836 $t = class extends Gt { 3837 constructor(e, t) { 3838 (super(), 3839 (this.anim = t), 3840 (this.element = e), 3841 (this.name = this.name || e.getAttribute("data-anim-scroll-group")), 3842 (this.isEnabled = !0), 3843 (this.position = new zt()), 3844 (this.metrics = new Yt()), 3845 this.metrics.add(this.element), 3846 (this.expressionParser = new jt(this)), 3847 (this.boundsMin = 0), 3848 (this.boundsMax = 0), 3849 (this.timelineUpdateRequired = !1), 3850 (this._keyframesDirty = !1), 3851 (this.viewableRange = this.createViewableRange()), 3852 (this.defaultEase = V.KeyframeDefaults.ease), 3853 (this.keyframeControllers = []), 3854 this.updateProgress(this.getPosition()), 3855 (this.onDOMRead = this.onDOMRead.bind(this)), 3856 (this.onDOMWrite = this.onDOMWrite.bind(this)), 3857 (this.gui = null), 3858 (this.computedStyleCache = {}), 3859 (this.destroyed = !1), 3860 this.rafEmitter, 3861 this.finalizeInit()); 3862 } 3863 finalizeInit() { 3864 ((this.element._animInfo = new Wt(this, null, !0)), 3865 this.setupRAFEmitter()); 3866 } 3867 destroy() { 3868 ((this.destroyed = !0), this.expressionParser.destroy()); 3869 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 3870 this.keyframeControllers[e].destroy(); 3871 ((this.keyframeControllers = []), 3872 this.gui && (this.gui.destroy(), (this.gui = null)), 3873 this.metrics.destroy(), 3874 this.rafEmitter.destroy(), 3875 (this.rafEmitter = null),
3876 (this.anim = null), 3877 this.element._animInfo && 3878 this.element._animInfo.group === this && 3879 ((this.element._animInfo.group = null), 3880 (this.element._animInfo = null)), 3881 (this.element = null), 3882 (this.isEnabled = !1), 3883 super.destroy()); 3884 } 3885 removeKeyframeController(i) { 3886 return i.destroyed || !this.keyframeControllers.includes(i) 3887 ? Promise.resolve() 3888 : (i._allKeyframes.forEach((e) => (e.markedForRemoval = !0)), 3889 (this.keyframesDirty = !0), 3890 new Promise((t) => { 3891 this.rafEmitter.afterDraw(() => { 3892 var e = this.keyframeControllers.indexOf(i); 3893 (-1 !== e && 3894 (this.keyframeControllers.splice(e, 1), 3895 i.onDOMWrite(), 3896 i.destroy(), 3897 this.gui) && 3898 this.gui.create(), 3899 t()); 3900 }); 3901 })); 3902 } 3903 remove() { 3904 return this.anim && this.anim.removeGroup(this); 3905 } 3906 clear() { 3907 return Promise.all( 3908 this.keyframeControllers.map((e) => 3909 this.removeKeyframeController(e), 3910 ), 3911 ); 3912 } 3913 setupRAFEmitter(e) { 3914 (this.rafEmitter && this.rafEmitter.destroy(), 3915 (this.rafEmitter = e || Zt()), 3916 this.rafEmitter.on("update", this.onDOMRead), 3917 this.rafEmitter.on("draw", this.onDOMWrite), 3918 this.rafEmitter.once("before:draw", () => this.reconcile())); 3919 } 3920 requestDOMChange() { 3921 return !!this.isEnabled && this.rafEmitter.run(); 3922 } 3923 onDOMRead() { 3924 this.keyframesDirty && this.onKeyframesDirty(); 3925 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 3926 this.keyframeControllers[e].onDOMRead(this.position.local); 3927 } 3928 onDOMWrite() { 3929 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 3930 this.keyframeControllers[e].onDOMWrite(); 3931 (this.needsUpdate() && this.requestDOMChange(), 3932 (this.computedStyleCache = {})); 3933 } 3934 needsUpdate() { 3935 if (this._keyframesDirty) return !0; 3936 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 3937 if (this.keyframeControllers[e].needsUpdate()) return !0; 3938 return !1; 3939 } 3940 addKeyframe(e, t) { 3941 let i = this.getControllerForTarget(e); 3942 return ( 3943 null === i && 3944 ((i = new Xt(this, e)), this.keyframeControllers.push(i)), 3945 (this.keyframesDirty = !0), 3946 i.addKeyframe(t) 3947 ); 3948 } 3949 addEvent(e, t) { 3950 t.event = t.event || "Generic-Event-Name-" + Qt++; 3951 var i = void 0 !== t.end && t.end !== t.start, 3952 e = this.addKeyframe(e, t); 3953 return ( 3954 i 3955 ? (t.onEnterOnce && 3956 e.controller.once(t.event + ":enter", t.onEnterOnce), 3957 t.onExitOnce && 3958 e.controller.once(t.event + ":exit", t.onExitOnce), 3959 t.onEnter && e.controller.on(t.event + ":enter", t.onEnter), 3960 t.onExit && e.controller.on(t.event + ":exit", t.onExit)) 3961 : (t.onEventOnce && e.controller.once(t.event, t.onEventOnce), 3962 t.onEventReverseOnce && 3963 e.controller.once(t.event + ":reverse", t.onEventReverseOnce), 3964 t.onEvent && e.controller.on(t.event, t.onEvent), 3965 t.onEventReverse && 3966 e.controller.on(t.event + ":reverse", t.onEventReverse)), 3967 e 3968 ); 3969 } 3970 forceUpdate({ waitForNextUpdate: e = !0, silent: t = !1 } = {}) { 3971 this.isEnabled && 3972 (this.refreshMetrics(), 3973 (this.timelineUpdateRequired = !0), 3974 e 3975 ? (this.keyframesDirty = !0) 3976 : this.onKeyframesDirty({ silent: t })); 3977 } 3978 onKeyframesDirty({ silent: e = !1 } = {}) { 3979 (this.determineActiveKeyframes(), 3980 (this.keyframesDirty = !1), 3981 this.metrics.refreshMetrics(this.element), 3982 (this.viewableRange = this.createViewableRange())); 3983 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 3984 this.keyframeControllers[e].updateAnimationConstraints(); 3985 (this.updateBounds(), 3986 this.updateProgress(this.getPosition()), 3987 e || this.updateTimeline(), 3988 this.gui && this.gui.create()); 3989 } 3990 refreshMetrics() { 3991 let t = new Set([this.element]);
3992 (this.keyframeControllers.forEach((e) => { 3993 (t.add(e.element), 3994 e._allKeyframes.forEach((e) => 3995 e.anchors.forEach((e) => t.add(e)), 3996 )); 3997 }), 3998 this.metrics.refreshCollection(t), 3999 (this.viewableRange = this.createViewableRange())); 4000 } 4001 reconcile() { 4002 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 4003 this.keyframeControllers[e].reconcile(); 4004 } 4005 determineActiveKeyframes(i) { 4006 i = i || Ht(Array.from(document.documentElement.classList)); 4007 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 4008 this.keyframeControllers[e].determineActiveKeyframes(i); 4009 } 4010 updateBounds() { 4011 if (0 === this.keyframeControllers.length) 4012 ((this.boundsMin = 0), (this.boundsMax = 0)); 4013 else { 4014 var i = { 4015 min: Number.POSITIVE_INFINITY, 4016 max: Number.NEGATIVE_INFINITY, 4017 }; 4018 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 4019 this.keyframeControllers[e].getBounds(i); 4020 var e = this.convertTValueToScrollPosition(i.min), 4021 t = this.convertTValueToScrollPosition(i.max); 4022 (t - e < V.pageMetrics.windowHeight 4023 ? ((i.min = this.convertScrollPositionToTValue( 4024 e - 0.5 * V.pageMetrics.windowHeight, 4025 )), 4026 (i.max = this.convertScrollPositionToTValue( 4027 t + 0.5 * V.pageMetrics.windowHeight, 4028 ))) 4029 : ((i.min -= 0.001), (i.max += 0.001)), 4030 (this.boundsMin = i.min), 4031 (this.boundsMax = i.max), 4032 (this.timelineUpdateRequired = !0)); 4033 } 4034 } 4035 createViewableRange() { 4036 return new qt( 4037 this.metrics.get(this.element), 4038 V.pageMetrics.windowHeight, 4039 ); 4040 } 4041 _onBreakpointChange(e, t) { 4042 ((this.keyframesDirty = !0), this.determineActiveKeyframes()); 4043 } 4044 updateProgress(e) { 4045 this.hasDuration() 4046 ? ((this.position.localUnclamped = 4047 (e - this.viewableRange.a) / 4048 (this.viewableRange.d - this.viewableRange.a)), 4049 (this.position.local = Kt.clamp( 4050 this.position.localUnclamped, 4051 this.boundsMin, 4052 this.boundsMax, 4053 ))) 4054 : (this.position.local = this.position.localUnclamped = 0); 4055 } 4056 performTimelineDispatch() { 4057 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 4058 this.keyframeControllers[e].updateLocalProgress( 4059 this.position.local, 4060 ); 4061 (this.trigger(V.EVENTS.ON_TIMELINE_UPDATE, this.position.local), 4062 this.trigger("update", this.position.local), 4063 (this.timelineUpdateRequired = !1), 4064 this.position.lastPosition !== this.position.local && 4065 (this.position.lastPosition <= this.boundsMin && 4066 this.position.localUnclamped > this.boundsMin 4067 ? (this.trigger(V.EVENTS.ON_TIMELINE_START, this), 4068 this.trigger("start", this)) 4069 : this.position.lastPosition >= this.boundsMin && 4070 this.position.localUnclamped < this.boundsMin 4071 ? (this.trigger( 4072 V.EVENTS.ON_TIMELINE_START + ":reverse", 4073 this, 4074 ), 4075 this.trigger("start:reverse", this)) 4076 : this.position.lastPosition <= this.boundsMax && 4077 this.position.localUnclamped >= this.boundsMax 4078 ? (this.trigger(V.EVENTS.ON_TIMELINE_COMPLETE, this), 4079 this.trigger("complete", this)) 4080 : this.position.lastPosition >= this.boundsMax && 4081 this.position.localUnclamped < this.boundsMax && 4082 (this.trigger( 4083 V.EVENTS.ON_TIMELINE_COMPLETE + ":reverse", 4084 this, 4085 ), 4086 this.trigger("complete:reverse", this))), 4087 null !== this.gui && this.gui.onScrollUpdate(this.position)); 4088 } 4089 updateTimeline(e) { 4090 if (!this.isEnabled) return !1; 4091 (void 0 === e && (e = this.getPosition()), this.updateProgress(e)); 4092 var t = 4093 this.position.lastPosition === this.boundsMin || 4094 this.position.lastPosition === this.boundsMax, 4095 i =
4096 this.position.localUnclamped === this.boundsMin || 4097 this.position.localUnclamped === this.boundsMax; 4098 !this.timelineUpdateRequired && 4099 t && 4100 i && 4101 this.position.lastPosition === e 4102 ? (this.position.local = this.position.localUnclamped) 4103 : this.timelineUpdateRequired || 4104 (this.position.localUnclamped > this.boundsMin && 4105 this.position.localUnclamped < this.boundsMax) || 4106 ((t = 4107 this.position.lastPosition > this.boundsMin && 4108 this.position.lastPosition < this.boundsMax), 4109 (i = 4110 this.position.localUnclamped <= this.boundsMin || 4111 this.position.localUnclamped >= this.boundsMax), 4112 t && i) 4113 ? (this.performTimelineDispatch(), 4114 this.requestDOMChange(), 4115 (this.position.lastPosition = this.position.localUnclamped)) 4116 : ((e = 4117 this.position.lastPosition < this.boundsMin && 4118 this.position.localUnclamped > this.boundsMax), 4119 (t = 4120 this.position.lastPosition > this.boundsMax && 4121 this.position.localUnclamped < this.boundsMax), 4122 (e || t) && 4123 (this.performTimelineDispatch(), 4124 this.requestDOMChange(), 4125 (this.position.lastPosition = this.position.localUnclamped)), 4126 null !== this.gui && this.gui.onScrollUpdate(this.position)); 4127 } 4128 _onScroll(e) { 4129 this.updateTimeline(e); 4130 } 4131 convertScrollPositionToTValue(e) { 4132 return this.hasDuration() 4133 ? Kt.map(e, this.viewableRange.a, this.viewableRange.d, 0, 1) 4134 : 0; 4135 } 4136 convertTValueToScrollPosition(e) { 4137 return this.hasDuration() 4138 ? Kt.map(e, 0, 1, this.viewableRange.a, this.viewableRange.d) 4139 : 0; 4140 } 4141 hasDuration() { 4142 return this.viewableRange.a !== this.viewableRange.d; 4143 } 4144 getPosition() { 4145 return V.pageMetrics.scrollY; 4146 } 4147 getControllerForTarget(e) { 4148 if (e._animInfo && e._animInfo.controllers) { 4149 if (e._animInfo.controller && e._animInfo.controller.group === this) 4150 return e._animInfo.controller; 4151 var i = e._animInfo.controllers; 4152 for (let e = 0, t = i.length; e < t; e++) 4153 if (i[e].group === this) return i[e]; 4154 } 4155 return null; 4156 } 4157 set keyframesDirty(e) { 4158 ((this._keyframesDirty = e), 4159 this._keyframesDirty && this.requestDOMChange()); 4160 } 4161 get keyframesDirty() { 4162 return this._keyframesDirty; 4163 } 4164 }, 4165 Jt = t; 4166 class ei { 4167 constructor(e, t) { 4168 ((this._index = 0), (this.keyframe = e), t && (this.name = t)); 4169 } 4170 get start() { 4171 return this.keyframe.jsonProps.start; 4172 } 4173 set index(e) { 4174 this._index = e; 4175 } 4176 get index() { 4177 return this._index; 4178 } 4179 } 4180 let ti = $t, 4181 ii = class { 4182 constructor(e) { 4183 ((this.timeGroup = e), 4184 (this.chapters = []), 4185 (this.chapterNames = {}), 4186 (this.currentChapter = null), 4187 (this.tween = null), 4188 (this.destroyed = !1)); 4189 } 4190 destroy() { 4191 ((this.destroyed = !0), 4192 this.tween && !this.tween.destroyed && this.tween.remove(), 4193 (this.tween = null)); 4194 } 4195 addChapter(e) { 4196 var { position: t, name: i } = e; 4197 if ("u" < typeof t) 4198 throw ReferenceError("Cannot add chapter without target position."); 4199 0 === this.chapters.length && 4200 0 !== e.position && 4201 this.addChapter({ position: 0 }); 4202 ((e = this.timeGroup.addKeyframe(this, { 4203 start: t, 4204 end: t, 4205 event: "Chapter", 4206 })), 4207 this.timeGroup.forceUpdate({ waitForNextFrame: !1, silent: !0 }), 4208 (t = new ei(e, i || ""))); 4209 if ((this.chapters.push(t), i)) { 4210 if (this.chapterNames.hasOwnProperty(i)) 4211 throw ReferenceError( 4212 `Duplicate chapter name assigned - "${i}" is already in use`, 4213 ); 4214 this.chapterNames[i] = t; 4215 } 4216 return ( 4217 this.chapters 4218 .sort((e, t) => e.start - t.start) 4219 .forEach((e, t) => (e.index = t)), 4220 (this.currentChapter = this.currentChapter || this.chapters[0]), 4221 t 4222 ); 4223 } 4224 playToChapter(e) { 4225 let i; 4226 if (e.hasOwnProperty("index")) i = this.chapters[e.index]; 4227 else { 4228 if (!e.hasOwnProperty("name")) 4229 throw ReferenceError( 4230 "Cannot play to chapter without target index or name", 4231 ); 4232 i = this.chapterNames[e.name]; 4233 } 4234 if (!i || (this.currentChapter === i && !0 !== e.force)) return null; 4235 let t = e.ease || "easeInOutCubic"; 4236 (this.tween && 4237 this.tween.controller && 4238 (this.tween.remove(), (t = e.ease || "easeOutQuint")), 4239 this.timeGroup.timeScale(e.timeScale || 1)); 4240 var e = 4241 void 0 !== e.duration ? e.duration : this.getDurationToChapter(i), 4242 s = this.timeGroup.time(), 4243 r = i.start; 4244 let n = !1; 4245 return ( 4246 (this.tween = this.timeGroup.anim.addTween( 4247 { time: s }, 4248 { 4249 easeFunction: t, 4250 duration: e, 4251 time: [s, r], 4252 onStart: () => { 4253 this.destroyed || 4254 this.timeGroup.trigger(Jt.EVENTS.ON_CHAPTER_INITIATED, { 4255 player: this, 4256 next: i, 4257 }); 4258 }, 4259 onDraw: (e) => { 4260 var t; 4261 this.destroyed || 4262 ((t = e.tweenProps.time.current), 4263 this.timeGroup.time(t), 4264 0.5 < e.keyframe.curvedT && 4265 !n && 4266 ((n = !0), 4267 (this.currentIndex = i.index), 4268 (this.currentChapter = i), 4269 this.timeGroup.trigger(Jt.EVENTS.ON_CHAPTER_OCCURRED, { 4270 player: this, 4271 current: i, 4272 }))); 4273 }, 4274 onComplete: (e) => { 4275 this.destroyed || 4276 (this.timeGroup.time(e.tweenProps.time.current), 4277 this.timeGroup.trigger(Jt.EVENTS.ON_CHAPTER_COMPLETED, { 4278 player: this, 4279 current: i, 4280 }), 4281 this.timeGroup.paused(!0), 4282 (this.tween = null)); 4283 }, 4284 }, 4285 )), 4286 this.tween 4287 ); 4288 } 4289 getDurationToChapter(e) { 4290 var t = this.chapters[e.index - 1] || this.chapters[e.index + 1]; 4291 return Math.abs(t.start - e.start); 4292 } 4293 }, 4294 si = s, 4295 ri = 0, 4296 ni = P.create, 4297 oi = 4298 (((_t = class Mi extends ti { 4299 constructor(e, t) { 4300 (e || 4301 ((e = document.createElement("div")).className = 4302 "TimeGroup-" + ri++), 4303 super(e, t), 4304 (this.name = this.name || e.getAttribute("data-anim-time-group")), 4305 (this._isPaused = !0), 4306 (this._repeats = 0), 4307 (this._isReversed = !1), 4308 (this._timeScale = 1), 4309 (this._chapterPlayer = new ii(this)), 4310 (this.now = performance.now()), 4311 this._playheadEmitter); 4312 } 4313 finalizeInit() { 4314 if (!this.anim) 4315 throw "TimeGroup not instantiated correctly. Please use `AnimSystem.createTimeGroup(el)`"; 4316 ((this.onPlayTimeUpdate = this.onPlayTimeUpdate.bind(this)), 4317 super.finalizeInit()); 4318 } 4319 progress(e) { 4320 var t; 4321 return void 0 === e 4322 ? 0 === this.boundsMax 4323 ? 0 4324 : this.position.local / this.boundsMax 4325 : ((t = e * this.boundsMax), 4326 (this.timelineUpdateRequired = !0), 4327 this.updateTimeline(t), 4328 e); 4329 } 4330 time(e) { 4331 return void 0 === e 4332 ? this.position.local 4333 : ((e = si.clamp(e, this.boundsMin, this.duration)), 4334 (this.timelineUpdateRequired = !0), 4335 this.updateTimeline(e), 4336 e); 4337 } 4338 play(e) { 4339 (this.reversed(!1), 4340 (this.isEnabled = !0), 4341 (this._isPaused = !1), 4342 this.time(e), 4343 (this.now = performance.now()), 4344 this._playheadEmitter.run()); 4345 } 4346 reverse(e) { 4347 (this.reversed(!0), 4348 (this.isEnabled = !0), 4349 (this._isPaused = !1), 4350 this.time(e), 4351 (this.now = performance.now()), 4352 this._playheadEmitter.run()); 4353 } 4354 reversed(e) { 4355 if (void 0 === e) return this._isReversed; 4356 this._isReversed = e; 4357 } 4358 restart() { 4359 this._isReversed 4360 ? (this.progress(1), this.reverse(this.time())) 4361 : (this.progress(0), this.play(this.time())); 4362 } 4363 pause(e) { 4364 (this.time(e), (this._isPaused = !0)); 4365 } 4366 paused(e) { 4367 return void 0 === e 4368 ? this._isPaused 4369 : ((this._isPaused = e), this._isPaused || this.play(), this); 4370 } 4371 onPlayTimeUpdate() { 4372 if (!this._isPaused) { 4373 let e = performance.now(), 4374 t = (e - this.now) / 1e3, 4375 i = 4376 ((this.now = e), 4377 this._isReversed && (t = -t), 4378 this.time() + t * this._timeScale); 4379 if (this._repeats === Mi.REPEAT_FOREVER || 0 < this._repeats) { 4380 let e = !1; 4381 (!this._isReversed && i > this.boundsMax 4382 ? ((i -= this.boundsMax), (e = !0)) 4383 : this._isReversed && 4384 i < 0 && 4385 ((i = this.boundsMax + i), (e = !0)), 4386 e && 4387 (this._repeats = 4388 this._repeats === Mi.REPEAT_FOREVER 4389 ? Mi.REPEAT_FOREVER 4390 : this._repeats - 1)); 4391 } 4392 this.time(i); 4393 var s = 4394 !this._isReversed && this.position.local !== this.duration, 4395 r = this._isReversed && 0 !== this.position.local; 4396 s || r ? this._playheadEmitter.run() : this.paused(!0); 4397 } 4398 } 4399 updateProgress(e) { 4400 this.hasDuration()
4401 ? ((this.position.localUnclamped = e), 4402 (this.position.local = si.clamp( 4403 this.position.localUnclamped, 4404 this.boundsMin, 4405 this.boundsMax, 4406 ))) 4407 : (this.position.local = this.position.localUnclamped = 0); 4408 } 4409 updateBounds() { 4410 if (0 === this.keyframeControllers.length) 4411 ((this.boundsMin = 0), (this.boundsMax = 0)); 4412 else { 4413 var i = { 4414 min: Number.POSITIVE_INFINITY, 4415 max: Number.NEGATIVE_INFINITY, 4416 }; 4417 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) 4418 this.keyframeControllers[e].getBounds(i); 4419 ((this.boundsMin = 0), 4420 (this.boundsMax = i.max), 4421 (this.viewableRange.a = 0), 4422 (this.viewableRange.d = this.boundsMax), 4423 (this.timelineUpdateRequired = !0)); 4424 } 4425 } 4426 setupRAFEmitter(e) { 4427 ((this._playheadEmitter = ni()), 4428 this._playheadEmitter.on("update", this.onPlayTimeUpdate), 4429 super.setupRAFEmitter(e)); 4430 } 4431 get duration() { 4432 return ( 4433 this.keyframesDirty && this.onKeyframesDirty({ silent: !0 }), 4434 this.boundsMax 4435 ); 4436 } 4437 timeScale(e) { 4438 return void 0 === e 4439 ? this._timeScale 4440 : ((this._timeScale = e), this); 4441 } 4442 repeats(e) { 4443 return void 0 === e ? this._repeats : (this._repeats = e); 4444 } 4445 getPosition() { 4446 return this.position.local; 4447 } 4448 addChapter(e) { 4449 return this._chapterPlayer.addChapter(e); 4450 } 4451 playToChapter(e) { 4452 return this._chapterPlayer.playToChapter(e); 4453 } 4454 convertScrollPositionToTValue(e) { 4455 return e; 4456 } 4457 convertTValueToScrollPosition(e) { 4458 return e; 4459 } 4460 hasDuration() { 4461 return 0 < this.duration; 4462 } 4463 destroy() { 4464 (this._chapterPlayer.destroy(), 4465 this._playheadEmitter.destroy(), 4466 (this._playheadEmitter = null), 4467 super.destroy()); 4468 } 4469 get timelineProgress() { 4470 return this.progress(); 4471 } 4472 set timelineProgress(e) { 4473 this.progress(e); 4474 } 4475 get progressValue() { 4476 return this.progress(); 4477 } 4478 set progressValue(e) { 4479 this.progress(e); 4480 } 4481 get timeValue() { 4482 return this.time(); 4483 } 4484 set timeValue(e) { 4485 this.time(e); 4486 } 4487 }).REPEAT_FOREVER = -1), 4488 $t), 4489 ai = s, 4490 li = 0, 4491 hi = P.create, 4492 ci = class extends oi { 4493 constructor(e, t) { 4494 (e || 4495 ((e = document.createElement("div")).className = 4496 "TweenGroup-" + li++), 4497 super(e, t), 4498 (this.name = "Tweens"), 4499 (this.keyframes = []), 4500 (this._isPaused = !1), 4501 (this.now = performance.now()), 4502 this._timeEmitter); 4503 } 4504 finalizeInit() { 4505 ((this.onTimeEmitterUpdate = this.onTimeEmitterUpdate.bind(this)), 4506 (this.removeExpiredKeyframeControllers = 4507 this.removeExpiredKeyframeControllers.bind(this)), 4508 super.finalizeInit()); 4509 } 4510 destroy() { 4511 (this._timeEmitter.destroy(), 4512 (this._timeEmitter = null), 4513 (this._keyframes = []), 4514 super.destroy()); 4515 } 4516 setupRAFEmitter(e) { 4517 ((this.now = performance.now()), 4518 (this._timeEmitter = hi()), 4519 this._timeEmitter.on("after:update", this.onTimeEmitterUpdate, !0), 4520 super.setupRAFEmitter(e)); 4521 } 4522 addTween(e, r) { 4523 if (void 0 !== r.start || void 0 !== r.end) 4524 throw Error( 4525 "Tweens do not have a start or end, they can only have a duration. Consider using a TimeGroup instead", 4526 ); 4527 if ("number" != typeof r.duration) 4528 throw Error( 4529 "Tween options.duration is undefined, or is not a number", 4530 ); 4531 ((r.start = (r.delay || 0) + this.position.localUnclamped), 4532 (r.end = r.start + r.duration), 4533 (r.preserveState = !0), 4534 (r.snapAtCreation = !0)); 4535 let t, 4536 i, 4537 s = 4538 (e._animInfo && 4539 ((t = e._animInfo.group), (i = e._animInfo.controller)), 4540 Object.assign({}, r)), 4541 n = super.addKeyframe(e, s); 4542 return ( 4543 (e._animInfo.group = t), 4544 (e._animInfo.controller = i), 4545 [ 4546 ["onStart", "once"], 4547 ["onDraw", "on"], 4548 ].forEach(([i, s]) => { 4549 if (r[i]) { 4550 let t = r[i], 4551 e = n.controller; 4552 r[i] = e[s]("draw", (e) => { 4553 n.markedForRemoval || 4554 ((e.keyframe = n), t(e), (e.keyframe = null)); 4555 }); 4556 } 4557 }), 4558 this.removeOverlappingProps(n), 4559 this.keyframes.push(n), 4560 this._timeEmitter.scheduled || 4561 ((this.now = performance.now()), this._timeEmitter.run()), 4562 n 4563 ); 4564 } 4565 removeOverlappingProps(r) { 4566 if (!(r.controller._allKeyframes.length <= 1)) { 4567 let i = Object.keys(r.animValues), 4568 s = r.controller; 4569 for (let e = 0, t = s._allKeyframes.length; e < t; e++) { 4570 let t = s._allKeyframes[e]; 4571 var n, o; 4572 t === r || 4573 t.markedForRemoval || 4574 ((o = (n = Object.keys(t.animValues)).filter((e) => 4575 i.includes(e), 4576 )).length === n.length 4577 ? ((t.markedForRemoval = !0), 4578 t.jsonProps.onDraw && 4579 t.controller.off("draw", t.jsonProps.onDraw)) 4580 : o.forEach((e) => delete t.animValues[e])); 4581 } 4582 } 4583 } 4584 onTimeEmitterUpdate(e) { 4585 var t, i; 4586 this._isPaused || 4587 0 === this.keyframeControllers.length || 4588 ((t = ((i = performance.now()) - this.now) / 1e3), 4589 (this.now = i), 4590 (i = this.position.local + t), 4591 (this.position.local = this.position.localUnclamped
4591= i), 4592 this.onTimeUpdate()); 4593 } 4594 onTimeUpdate() { 4595 for (let e = 0, t = this.keyframes.length; e < t; e++) 4596 this.keyframes[e].markedForRemoval || 4597 this.keyframes[e].updateLocalProgress( 4598 this.position.localUnclamped, 4599 ); 4600 (this.requestDOMChange(), 4601 this._timeEmitter.run(), 4602 null !== this.gui && this.gui.onScrollUpdate(this.position)); 4603 } 4604 onDOMRead() { 4605 if ( 4606 (this.keyframesDirty && this.onKeyframesDirty(), 4607 0 !== this.keyframes.length) 4608 ) 4609 for (let e = 0, t = this.keyframes.length; e < t; e++) 4610 for (var i in ((this.keyframes[e].controller.needsWrite = !0), 4611 this.keyframes[e].animValues)) 4612 this.keyframes[e].onDOMRead(i); 4613 } 4614 onDOMWrite() { 4615 (super.onDOMWrite(), this.removeExpiredKeyframes()); 4616 } 4617 removeExpiredKeyframes() { 4618 let e = this.keyframes.length, 4619 t = e; 4620 for (; e--; ) { 4621 var i = this.keyframes[e]; 4622 i.destroyed 4623 ? this.keyframes.splice(e, 1) 4624 : (i.markedForRemoval && 4625 (i.jsonProps.onComplete && 4626 1 === i.localT && 4627 ((i.controller.eventObject.keyframe = 4628 i).jsonProps.onComplete(i.controller.eventObject), 4629 (i.jsonProps.onComplete = null)), 4630 (null !== this.gui && this.gui.isDraggingPlayhead) || 4631 (i.remove(), this.keyframes.splice(e, 1)), 4632 i.jsonProps.onStart && 4633 i.controller.off("draw", i.jsonProps.onStart), 4634 i.jsonProps.onDraw) && 4635 i.controller.off("draw", i.jsonProps.onDraw), 4636 1 === i.localT && (i.markedForRemoval = !0)); 4637 } 4638 (this.keyframes.length === t && 0 !== this.keyframes.length) || 4639 this._timeEmitter.afterUpdate( 4640 this.removeExpiredKeyframeControllers, 4641 ); 4642 } 4643 removeExpiredKeyframeControllers() { 4644 for (let e = 0, t = this.keyframeControllers.length; e < t; e++) { 4645 let i = !0, 4646 s = this.keyframeControllers[e]; 4647 for (let e = 0, t = s._allKeyframes.length; e < t; e++) 4648 if (!s._allKeyframes[e].destroyed) { 4649 i = !1; 4650 break; 4651 } 4652 i && s.remove(); 4653 } 4654 } 4655 updateBounds() { 4656 ((this.boundsMin = Math.min(...this.keyframes.map((e) => e.start))), 4657 (this.boundsMax = Math.max(...this.keyframes.map((e) => e.end)))); 4658 } 4659 play() { 4660 ((this.isEnabled = !0), 4661 (this._isPaused = !1), 4662 (this.now = performance.now()), 4663 this._timeEmitter.run()); 4664 } 4665 pause() { 4666 this._isPaused = !0; 4667 } 4668 paused() { 4669 return this._isPaused; 4670 } 4671 time(e) { 4672 if (void 0 === e) return this.position.local; 4673 ((this.position.local = this.position.localUnclamped = 4674 ai.clamp(e, this.boundsMin, this.boundsMax)), 4675 this.onTimeUpdate()); 4676 } 4677 performTimelineDispatch() {} 4678 hasDuration() { 4679 return !0; 4680 } 4681 getPosition() { 4682 return this.position.local; 4683 } 4684 updateProgress(e) {} 4685 get duration() { 4686 return this.boundsMax; 4687 } 4688 }, 4689 di = N, 4690 k = t, 4691 ui = r, 4692 pi = n, 4693 mi = fe, 4694 gi = $t, 4695 fi = _t, 4696 vi = ci, 4697 yi = { version: "4.4.3", major: "4.x" }, 4698 { update: wi, cancelUpdate: _i } = P, 4699 Ai = null; 4700 class Ci extends di { 4701 constructor() { 4702 if ((super(), Ai)) 4703 throw "You cannot create multiple AnimSystems. You probably want to create multiple groups instead. You can have unlimited groups on a page"; 4704 (((Ai = this).groups = []), 4705 (this.scrollSystems = []), 4706 (this.timeSystems = []), 4707 (this.tweenGroup = null),
4708 (this._forceUpdateRAFId = null), 4709 (this.initialized = !1), 4710 (this.model = k), 4711 (this.plugins = { keyframe: [], parser: [] }), 4712 (this.version = yi.version), 4713 (this._resolveReady = () => {}), 4714 (this.ready = new Promise((e) => (this._resolveReady = e))), 4715 (this.onScroll = this.onScroll.bind(this)), 4716 (this.onResizedDebounced = this.onResizedDebounced.bind(this)), 4717 (this.onResizeImmediate = this.onResizeImmediate.bind(this))); 4718 } 4719 initialize() { 4720 return ( 4721 this.initialized || 4722 "u" < typeof window || 4723 ((this.initialized = !0), 4724 (this.timeSystems = []), 4725 (this.scrollSystems = []), 4726 (this.groups = []), 4727 this.setupEvents(), 4728 this.initializeResizeFilter(), 4729 this.initializeModel(), 4730 this.createDOMGroups(), 4731 this.createDOMKeyframes(), 4732 (this.tweenGroup = new vi(null, this)), 4733 this.groups.unshift(this.tweenGroup), 4734 this._resolveReady()), 4735 this.ready 4736 ); 4737 } 4738 use(e, t) { 4739 e.install(this, t); 4740 } 4741 remove() { 4742 return this.initialized 4743 ? Promise.all(this.groups.map((e) => e.remove())).then(() => { 4744 ((this.groups = []), 4745 (this.scrollSystems = []), 4746 (this.timeSystems = []), 4747 window.clearTimeout(k.RESIZE_TIMEOUT), 4748 window.removeEventListener("scroll", this.onScroll), 4749 window.removeEventListener("resize", this.onResizeImmediate), 4750 (this._events = {}), 4751 (this.initialized = !1), 4752 (this.ready = new Promise((e) => (this._resolveReady = e)))); 4753 }) 4754 : ((this.ready = new Promise((e) => (this._resolveReady = e))), 4755 Promise.resolve()); 4756 } 4757 destroy() { 4758 return this.remove(); 4759 } 4760 createTimeGroup(e, t) { 4761 e instanceof HTMLElement || (e = (t = e || {}).el); 4762 e = new fi(e, this); 4763 return ( 4764 t && t.name && (e.name = t.name), 4765 this.groups.push(e), 4766 this.timeSystems.push(e), 4767 this.trigger(k.EVENTS.ON_GROUP_CREATED, e), 4768 e 4769 ); 4770 } 4771 createScrollGroup(e, t) { 4772 if (!e) 4773 throw "AnimSystem scroll based groups must supply an HTMLElement"; 4774 let i = new gi(e, this), 4775 s = t || {}; 4776 return ( 4777 s.name && (i.name = s.name), 4778 s.getPosition && 4779 s.getMaxPosition && 4780 ((i.getPosition = s.getPosition), 4781 (i.createViewableRange = () => ({ a: 0, d: s.getMaxPosition() }))), 4782 (i.getPosition = s.getPosition || i.getPosition), 4783 (i.getPosition = s.getPosition || i.getPosition), 4784 this.groups.push(i), 4785 this.scrollSystems.push(i), 4786 this.trigger(k.EVENTS.ON_GROUP_CREATED, i), 4787 i 4788 ); 4789 } 4790 removeGroup(t) { 4791 return t.destroyed || t.anim !== this 4792 ? Promise.resolve() 4793 : Promise.all( 4794 t.keyframeControllers.map((e) => t.removeKeyframeController(e)), 4795 ).then(() => { 4796 var e = this.groups.indexOf(t); 4797 (-1 !== e && this.groups.splice(e, 1), 4798 -1 !== (e = this.scrollSystems.indexOf(t)) && 4799 this.scrollSystems.splice(e, 1), 4800 -1 !== (e = this.timeSystems.indexOf(t)) && 4801 this.timeSystems.splice(e, 1), 4802 t.destroyed || t.destroy()); 4803 }); 4804 } 4805 createDOMGroups() { 4806 (document.body.setAttribute("data-anim-scroll-group", "body"), 4807 document 4808 .querySelectorAll("[data-anim-scroll-group]") 4809 .forEach((e) => this.createScrollGroup(e)), 4810 document 4811 .querySelectorAll("[data-anim-time-group]") 4812 .forEach((e) => this.createTimeGroup(e)), 4813 this.trigger(k.EVENTS.ON_DOM_GROUPS_CREATED, this.groups)); 4814 } 4815 createDOMKeyframes() { 4816 let i = []; 4817 [ 4818 "data-anim-keyframe", 4819 ui.DATA_ATTRIBUTE, 4820 pi.DATA_ATTRIBUTE, 4821 mi.DATA_ATTRIBUTE, 4822 ].forEach(function (t) { 4823 for (let e = 0; e < 12;
4823 e++) 4824 i.push(t + (0 === e ? "" : "-" + (e - 1))); 4825 }); 4826 for (let e = 0; e < i.length; e++) { 4827 var t = i[e], 4828 s = document.querySelectorAll("[" + t + "]"); 4829 for (let e = 0; e < s.length; e++) { 4830 var r = s[e], 4831 n = JSON.parse(r.getAttribute(t)); 4832 this.addKeyframe(r, n); 4833 } 4834 } 4835 wi(() => { 4836 null !== this.groups && 4837 (this.groups.forEach((e) => e.onKeyframesDirty({ silent: !0 })), 4838 this.groups.forEach((e) => 4839 e.trigger(k.EVENTS.ON_DOM_KEYFRAMES_CREATED, e), 4840 ), 4841 this.trigger(k.EVENTS.ON_DOM_KEYFRAMES_CREATED, this), 4842 this.groups.forEach((e) => { 4843 (e.forceUpdate({ waitForNextUpdate: !1, silent: !0 }), 4844 e.reconcile()); 4845 }), 4846 this.onScroll()); 4847 }); 4848 } 4849 initializeResizeFilter() { 4850 var e; 4851 k.cssDimensionsTracker || 4852 ((e = 4853 document.querySelector(".cssDimensionsTracker") || 4854 document.createElement("div")).setAttribute( 4855 "cssDimensionsTracker", 4856 "true", 4857 ), 4858 (e.style.position = "fixed"), 4859 (e.style.top = "0"), 4860 (e.style.width = "100%"), 4861 (e.style.height = "100vh"), 4862 (e.style.pointerEvents = "none"), 4863 (e.style.visibility = "hidden"), 4864 (e.style.zIndex = "-1"), 4865 document.documentElement.appendChild(e), 4866 (k.cssDimensionsTracker = e)); 4867 } 4868 initializeModel() { 4869 ((k.pageMetrics.windowHeight = k.cssDimensionsTracker.clientHeight), 4870 (k.pageMetrics.windowWidth = k.cssDimensionsTracker.clientWidth), 4871 (k.pageMetrics.scrollY = window.scrollY || window.pageYOffset), 4872 (k.pageMetrics.scrollX = window.scrollX || window.pageXOffset), 4873 (k.pageMetrics.breakpoint = k.getBreakpoint())); 4874 var e = document.documentElement.getBoundingClientRect(); 4875 ((k.pageMetrics.documentOffsetX = e.left + k.pageMetrics.scrollX), 4876 (k.pageMetrics.documentOffsetY = e.top + k.pageMetrics.scrollY)); 4877 } 4878 setupEvents() { 4879 (window.removeEventListener("scroll", this.onScroll), 4880 window.addEventListener("scroll", this.onScroll), 4881 window.removeEventListener("resize", this.onResizeImmediate), 4882 window.addEventListener("resize", this.onResizeImmediate)); 4883 } 4884 onScroll() { 4885 ((k.pageMetrics.scrollY = window.scrollY || window.pageYOffset), 4886 (k.pageMetrics.scrollX = window.scrollX || window.pageXOffset)); 4887 for (let e = 0, t = this.scrollSystems.length; e < t; e++) 4888 this.scrollSystems[e].updateTimeline(); 4889 this.trigger(k.PageEvents.ON_SCROLL, k.pageMetrics); 4890 } 4891 updatePageMetrics() { 4892 ((k.pageMetrics.windowWidth = k.cssDimensionsTracker.clientWidth), 4893 (k.pageMetrics.windowHeight = k.cssDimensionsTracker.clientHeight), 4894 (k.pageMetrics.scrollY = window.scrollY || window.pageYOffset), 4895 (k.pageMetrics.scrollX = window.scrollX || window.pageXOffset)); 4896 var e = document.documentElement.getBoundingClientRect(); 4897 ((k.pageMetrics.documentOffsetX = e.left + k.pageMetrics.scrollX), 4898 (k.pageMetrics.documentOffsetY = e.top + k.pageMetrics.scrollY)); 4899 } 4900 onResizeImmediate() { 4901 var e = k.cssDimensionsTracker.clientWidth, 4902 t = k.cssDimensionsTracker.clientHeight; 4903 (e === k.pageMetrics.windowWidth && t === k.pageMetrics.windowHeight) || 4904 (this.updatePageMetrics(), 4905 window.clearTimeout(k.RESIZE_TIMEOUT), 4906 (k.RESIZE_TIMEOUT = window.setTimeout(this.onResizedDebounced, 250)), 4907 this.trigger(k.PageEvents.ON_RESIZE_IMMEDIATE, k.pageMetrics)); 4908 } 4909 onResizedDebounced() { 4910 wi(() => { 4911 var e = k.pageMetrics.breakpoint, 4912 t = k.getBreakpoint(); 4913 if (t !== e) { 4914 ((k.pageMetrics.previousBreakpoint = e), 4915 (k.pageMetrics.breakpoint = t)); 4916 for (let e = 0, t = this.groups.length; e < t; e++) 4917 this.groups[e]._onBreakpointChange(); 4918 this.trigger(k.PageEvents.ON_BREAKPOINT_CHANGE, k.pageMetrics); 4919 } 4920 for (let e = 0, t = this.groups.length; e < t; e++) 4921 this.groups[e].forceUpdate({ waitForNextUpdate: !1 }); 4922 this.trigger(k.PageEvents.ON_RESIZE_DEBOUNCED, k.pageMetrics); 4923 }); 4924 }
4925 forceUpdate({ waitForNextUpdate: e = !0, silent: i = !1 } = {}) { 4926 (this.updatePageMetrics(), 4927 this._forceUpdateRAFId && 4928 (_i(this._forceUpdateRAFId), (this._forceUpdateRAFId = null))); 4929 var t = () => { 4930 for (let e = 0, t = this.groups.length; e < t; e++) 4931 this.groups[e].forceUpdate({ waitForNextUpdate: !1, silent: i }); 4932 return null; 4933 }; 4934 this._forceUpdateRAFId = e ? wi(t) : t(); 4935 } 4936 addKeyframe(e, t) { 4937 return ( 4938 this.getGroupForTarget(e) || this.getGroupForTarget(document.body) 4939 ).addKeyframe(e, t); 4940 } 4941 addEvent(e, t) { 4942 return ( 4943 this.getGroupForTarget(e) || this.getGroupForTarget(document.body) 4944 ).addEvent(e, t); 4945 } 4946 getTimeGroupForTarget(e) { 4947 return this._getGroupForTarget(e, (e) => e instanceof fi); 4948 } 4949 getScrollGroupForTarget(e) { 4950 return this._getGroupForTarget(e, (e) => !(e instanceof fi)); 4951 } 4952 getGroupForTarget(e) { 4953 return this._getGroupForTarget(e, () => !0); 4954 } 4955 getGroupByName(t) { 4956 return this.groups.find((e) => e.name === t) || null; 4957 } 4958 _getGroupForTarget(e, t) { 4959 if (e._animInfo && e._animInfo.group && t(e._animInfo.group)) 4960 return e._animInfo.group; 4961 let i = e; 4962 for (; i; ) { 4963 if (i._animInfo && i._animInfo.isGroup && t(i._animInfo.group)) 4964 return i._animInfo.group; 4965 i = i.parentElement; 4966 } 4967 return null; 4968 } 4969 getControllerForTarget(e) { 4970 return e._animInfo && e._animInfo.controller 4971 ? e._animInfo.controller 4972 : null; 4973 } 4974 addTween(e, t) { 4975 if (null == this.tweenGroup) throw new Error("TweenGroup not found"); 4976 return this.tweenGroup.addTween(e, t); 4977 } 4978 } 4979 ((At = 4980 "u" < typeof window 4981 ? new Ci() 4982 : window.AC.SharedInstance.share("AnimSystem", yi.major, Ci)), 4983 (kt = 4984 (x = At) && 4985 x.__esModule && 4986 Object.prototype.hasOwnProperty.call(x, "default") 4987 ? x.default 4988 : x), 4989 typeof window < "u" && 4990 ((window.channelHtml18pro = window.channelHtml18pro || {}), 4991 (window.channelHtml18pro.Anim = kt))); 4992 })()); 4993var Y = Object.defineProperty, 4994 D = (e, t, i) => 4995 t in e 4996 ? Y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) 4997 : (e[t] = i), 4998 h = (e, t, i) => D(e, "symbol" != typeof t ? t + "" : t, i), 4999 InlineMedia = 5000 ((() => { 5001 function e() { 5002 var e = 5003 null == 5004 (e = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 5005 ? void 0 5006 : e.uaDetect; 5007 return ( 5008 (null == (e = null == e ? void 0 : e.os) ? void 0 : e.android) || !1 5009 ); 5010 } 5011 function t() { 5012 var e = 5013 null == 5014 (e = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 5015 ? void 0 5016 : e.touchAvailable, 5017 t = document.querySelector(".channel-html-18-pro"); 5018 return !(!e || !t || e()) && t.clientWidth <= 734; 5019 } 5020 function i() { 5021 var e, 5022 t = { 5023 smallWide: "(min-width: 481px) and (max-width: 734px)", 5024 smallShort: "(max-width: 734px) and (max-height: 500px)", 5025 smallTall: "(max-width: 734px) and (min-height: 927px)", 5026 mediumShort: 5027 "(min-width: 735px) and (max-width: 1068px) and (max-height: 520px)", 5028 largeShort: "(min-width: 1069px) and (max-height: 620px)", 5029 }; 5030 for (e in t) if (window.matchMedia(t[e]).matches) return !0; 5031 return !1; 5032 } 5033 function s() { 5034 return new Promise((i) => { 5035 let s = document.querySelector(".channel-html-18-pro"); 5036 if (s) { 5037 let e = document.createElement("div"), 5038 t = 5039 ((e.style.display = "none"), 5040 (e.innerHTML = 5041 '<video playsinline preload autoplay muted src="data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAtltZGF0AAACrgYF//+q3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2NCByMzEwOCAzMWUxOWY5IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMyAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTEgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAD2WIhAAr//72c3wKa+cHgQAAAAhBmiFsQn/+wAAAAzNtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAAQwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACXnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAQwAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAEAAAABAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAEMAAAAAAAEAAAAAAdZtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAADwAAAAEAFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAGBbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABQXN0YmwAAADBc3RzZAAAAAAAAAABAAAAsWF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAEAAQAEgAAABIAAAAAAAAAAEUTGF2YzYxLjMuMTAwIGxpYngyNjQAAAAAAAAAAAAAAAAY//8AAAA3YXZjQwFkAAr/4QAaZ2QACqzZXsBbgQEC0oAAAAMAgAAAHgeJEssBAAZo6+PLIsD9+PgAAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAABUfgAAVH4AAAAGHN0dHMAAAAAAAAAAQAAAAIAAAIAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAALFAAAADAAAABRzdGNvAAAAAAAAAAEAAAAwAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MS4xLjEwMA=="></video>'), 5042 e.querySelector("video")); 5043 requestAnimationFrame(() => { 5044 (s.appendChild(e), 5045 (async () => { 5046 try { 5047 (await t.play(), i(!1)); 5048 } catch (e) { 5049 e instanceof Error && "NotAllowedError" === e.name 5050 ? i(!0) 5051 : i(!1); 5052 } 5053 e.remove(); 5054 })()); 5055 }); 5056 } else 5057 (console.warn( 5058 "ChannelFeatureDetect: .channel-html-18-pro not found for low power mode test", 5059 ), 5060 i(!1)); 5061 }); 5062 } 5063 let r = [e, t, i, s], 5064 n = [ 5065 e, 5066 function () { 5067 var e = 5068 null == 5069 (e = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 5070 ? void 0 5071 : e.prefersReducedMotion; 5072 return !!e && e(); 5073 }, 5074 t, 5075 i, 5076 s, 5077 ], 5078 o = [ 5079 function () { 5080 var e = 5081 null == 5082 (e = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 5083 ? void 0 5084 : e.uaDetect; 5085 return ( 5086 (null == (e = null == e ? void 0 : e.os) ? void 0 : e.ios) || !1 5087 ); 5088 }, 5089 function () { 5090 var e = 5091 null == 5092 (e = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 5093 ? void 0 5094 : e.uaDetect; 5095 return ( 5096 (null == (e = null == e ? void 0 : e.os) ? void 0 : e.ipados) || 5097 !1 5098 ); 5099 }, 5100 function () { 5101 var e = 5102 null == 5103 (e = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 5104 ? void 0 5105 : e.uaDetect; 5106 return ( 5107 (null == (e = null == e ? void 0 : e.os) ? void 0 : e.android) || 5108 !1 5109 ); 5110 }, 5111 ], 5112 a = null == (d = window.channelHtml18pro) ? void 0 : d.Anim, 5113 l = new (class { 5114 constructor() { 5115 h(this, "ready", null); 5116 } 5117 async run(e) { 5118 return ((this.ready = this._runTests(e)), this.ready); 5119 } 5120 async _runTests(e) { 5121 for (var [t, i] of Object.entries(e)) 5122 "boolean" == typeof i 5123 ? this.setFeatureClass(t, i) 5124 : ((i = await this._runFeatureTests(t, i)), 5125 this.setFeatureClass(t, i)); 5126 } 5127 async _runFeatureTests(t, e) { 5128 for (var i of e) 5129 try { 5130 if (await i()) return !1; 5131 } catch (e) { 5132 return ( 5133 console.error( 5134 `ChannelFeatureDetect: ${t} - test error:`, 5135 i.name, 5136 e, 5137 ), 5138 !1 5139 ); 5140 } 5141 return !0; 5142 } 5143 setFeatureClass(e, t) { 5144 var i = document.querySelector(".channel-html-18-pro"); 5145 i 5146 ? t 5147 ? (i.classList.add(e), i.classList.remove("no-" + e)) 5148 : (i.classList.remove(e), i.classList.add("no-" + e)) 5149 : console.warn( 5150 "ChannelFeatureDetect: .channel-html-18-pro element not found", 5151 ); 5152 } 5153 })(), 5154 c = 5155 (l.run({ 5156 js: !0, 5157 safari: 5158 (null == 5159 (d = 5160 null == 5161 (d = 5162 null == 5163 (d = 5164 null == (d = window.channelHtml18pro) ? void 0 : d.helpers) 5165 ? void 0 5166 : d.uaDetect) 5167 ? void 0 5168 : d.browser) 5169 ? void 0 5170 : d.safari) || !1, 5171 touch: 5172 (null == 5173 (u = 5174 null == 5175 (d = null == (d = window.channelHtml18pro) ? void 0 : d.helpers) 5176 ? void 0 5177 : d.touchAvailable) 5178 ? void 0 5179 : u.call(d)) || !1, 5180 "reduced-motion": 5181 (null == 5182 (u = 5183 null == 5184 (d = null == (u = window.channelHtml18pro) ? void 0 : u.helpers) 5185 ? void 0 5186 : d.prefersReducedMotion) 5187 ? void 0 5188 : u.call(d)) || !1, 5189 "inline-media": r, 5190 enhanced: n, 5191 desktop: o, 5192 }), 5193 document.querySelector(".channel-html-18-pro")); 5194 if (null != a && a.model) { 5195 ((a.model.BREAKPOINTS = [ 5196 { name: "xsmall", mediaQuery: "only screen and (max-width: 480px)" }, 5197 { name: "small", mediaQuery: "only screen and (max-width: 734px)" }, 5198 { name: "medium", mediaQuery: "only screen and (max-width: 1068px)" }, 5199 { name: "large", mediaQuery: "only screen and (max-width: 1440px)" }, 5200 { name: "xlarge", mediaQuery: "only screen and (min-width: 1441px)" }, 5201 ]), 5202 (a.model.KeyframeDefaults.breakpointMask = [ 5203 "xsmall", 5204 "small", 5205 "medium", 5206 "large", 5207 "xlarge", 5208 ]));
5209 let i = a.model.getBreakpoint; 5210 a.model.getBreakpoint = function () { 5211 if (!c) return i.call(this); 5212 var e, 5213 t = c.offsetWidth; 5214 for (e of this.BREAKPOINTS) 5215 if (e.mediaQuery.includes("max-width")) 5216 if ( 5217 t <= 5218 parseInt(e.mediaQuery.split("max-width: ")[1].split("px")[0]) 5219 ) 5220 return e.name; 5221 return "xlarge"; 5222 }; 5223 var d, 5224 u = a.model.cssDimensionsTracker; 5225 c && 5226 u && 5227 (((d = document.createElement("div")).style.position = "relative"), 5228 (d.style.width = "100%"), 5229 (d.style.height = "0"), 5230 (d.style.overflow = "hidden"), 5231 (d.style.pointerEvents = "none"), 5232 (u.style.position = "absolute"), 5233 d.appendChild(u), 5234 c.appendChild(d)); 5235 } 5236 ((window.channelHtml18pro = window.channelHtml18pro || {}), 5237 (window.channelHtml18pro.ChannelBase = class { 5238 constructor() { 5239 (h(this, "isDestroyed"), 5240 h(this, "channelContainer"), 5241 (this.isDestroyed = !1), 5242 (this.channelContainer = c), 5243 this.anim ? this._waitForAnimReady() : this.mounted()); 5244 } 5245 get anim() { 5246 var e; 5247 return null == (e = window.channelHtml18pro) ? void 0 : e.Anim; 5248 } 5249 _waitForAnimReady() { 5250 (this.anim.initialized || this.anim.initialize(), 5251 Promise.all([this.anim.ready, l.ready]).finally(() => { 5252 this.isDestroyed || this.mounted(); 5253 })); 5254 } 5255 mounted() {} 5256 destroy() { 5257 this.isDestroyed = !0; 5258 } 5259 })); 5260 })(), 5261 ((e) => { 5262 function t(e) { 5263 return e && 5264 e.__esModule && 5265 Object.prototype.hasOwnProperty.call(e, "default") 5266 ? e.default 5267 : e; 5268 } 5269 let R = class { 5270 constructor() { 5271 this._events = {}; 5272 } 5273 on(e, t) { 5274 return ( 5275 (this._events[e] = this._events[e] || []), 5276 this._events[e].unshift(t), 5277 t 5278 ); 5279 } 5280 once(t, i) { 5281 let s = (e) => { 5282 (this.off(t, s), void 0 !== e ? i(e) : i()); 5283 }; 5284 return this.on(t, s); 5285 } 5286 off(e, t) { 5287 this.has(e) && 5288 (t 5289 ? -1 !== (t = this._events[e].indexOf(t)) && 5290 this._events[e].splice(t, 1) 5291 : delete this._events[e]); 5292 } 5293 trigger(t, i) { 5294 if (this.has(t)) 5295 for (let e = this._events[t].length - 1; 0 <= e; e--) 5296 void 0 !== i ? this._events[t][e](i) : this._events[t][e](); 5297 } 5298 has(e) { 5299 return e in this._events && 0 !== this._events[e].length; 5300 } 5301 destroy() { 5302 this._events = null; 5303 } 5304 }, 5305 N = t(R), 5306 o = { 5307 AnimLoad: async () => Promise.resolve().then(() => ie), 5308 AnimPlay: async () => Promise.resolve().then(() => ne), 5309 FeatureObserver: async () => Promise.resolve().then(() => Ee), 5310 LoadTimeout: async () => Promise.resolve().then(() => Se), 5311 PlayPauseButton: async () => Promise.resolve().then(() => ue), 5312 ViewportSource: async () => Promise.resolve().then(() => he), 5313 }, 5314 a = { 5315 MOUNTED: "MOUNTED", 5316 MEDIA_LOAD_START: "MEDIA_LOAD_START", 5317 MEDIA_LOAD_COMPLETE: "MEDIA_LOAD_COMPLETE", 5318 MEDIA_LOAD_ERROR: "MEDIA_LOAD_ERROR", 5319 PLAYBACK_STATE_CHANGE: "PLAYBACK_STATE_CHANGE", 5320 LOADING_STATE_CHANGE: "LOADING_STATE_CHANGE", 5321 }, 5322 i = { 5323 EMPTY: "loading-empty", 5324 LOADING: "loading", 5325 LOADED: "loaded", 5326 ERROR: "loading-error", 5327 DISABLED: "loading-disabled", 5328 }, 5329 s = { 5330 LOAD_START: "loadstart", 5331 LOADED_DATA: "loadeddata", 5332 CAN_PLAY: "canplay", 5333 CAN_PLAY_THROUGH: "canplaythrough", 5334 PLAY: "play", 5335 PLAYING: "playing", 5336 PAUSE: "pause", 5337 WAITING: "waiting", 5338 SEEKING: "seeking", 5339 SEEKED: "seeked", 5340 ERROR: "error", 5341 ENDED: "ended", 5342 ABORT: "abort", 5343 }, 5344 r = { 5345 IDLE: "idle", 5346 PLAYING: "playing", 5347 PAUSED: "paused", 5348 ENDED: "ended", 5349 }; 5350 class n { 5351 constructor(e) { 5352 ((this.options = e), 5353 (this.media = e.media), 5354 (this.mounted = this.mounted.bind(this)), 5355 this.media.on(a.MOUNTED, this.mounted)); 5356 } 5357 mounted() {} 5358 static get isSupported() { 5359 return !0; 5360 } 5361 destroy() {} 5362 } 5363 let l = [ 5364 s.LOADED_DATA, 5365 s.LOAD_START, 5366 s.CAN_PLAY, 5367 s.CAN_PLAY_THROUGH, 5368 s.PLAY, 5369 s.PLAYING, 5370 s.PAUSE, 5371 s.WAITING, 5372 s.SEEKING, 5373 s.SEEKED, 5374 s.ERROR, 5375 s.ENDED, 5376 ]; 5377 class F extends n { 5378 constructor(e) { 5379 (super(e), 5380 (this._container = e.container || this.media.el.parentElement), 5381 (this._playbackState = r.IDLE), 5382 (this._loadingState = i.EMPTY), 5383 (this._elementsToDecorate = []), 5384 this._container && this._elementsToDecorate.push(this._container), 5385 this.media.id && 5386 this._elementsToDecorate.push( 5387 ...Array.from( 5388 document.querySelectorAll( 5389 "[data-inline-media-controller={id}]".replace( 5390 "{id}", 5391 this.media.id, 5392 ), 5393 ), 5394 ), 5395 )); 5396 for (var t of this._elementsToDecorate) 5397 (t.classList.add(this._playbackState), 5398 t.classList.add(this._loadingState)); 5399 ((this.updateState = this.updateState.bind(this)), 5400 this._addEventListeners()); 5401 } 5402 _addEventListeners() { 5403 for (var e of l) this.media.el.addEventListener(e, this.updateState); 5404 (this.media.on(a.LOADING_STATE_CHANGE, this.updateState), 5405 this.media.on(a.PLAYBACK_STATE_CHANGE, this.updateState)); 5406 } 5407 _removeEventListeners() { 5408 for (var e of l) 5409 this.media.el.removeEventListener(e, this.updateState); 5410 (this.media.off(a.LOADING_STATE_CHANGE, this.updateState), 5411 this.media.off(a.PLAYBACK_STATE_CHANGE, this.updateState)); 5412 } 5413 updateState(e) { 5414 var t = this.media.playbackState, 5415 i = this._playbackState, 5416 s = this.media.loadingState, 5417 r = this._loadingState; 5418 if (((this._playbackState = t), (this._loadingState = s), t !== i)) { 5419 for (var n of this._elementsToDecorate) 5420 (n.classList.add(t), n.classList.remove(i)); 5421 this.media.trigger(a.PLAYBACK_STATE_CHANGE); 5422 } 5423 if (s !== r) { 5424 for (var o of this._elementsToDecorate) 5425 (o.classList.add(s), o.classList.remove(r)); 5426 this.media.trigger(a.LOADING_STATE_CHANGE); 5427 } 5428 } 5429 destroy() { 5430 for (var e of this._elementsToDecorate) 5431 (e.classList.remove(this._playbackState), 5432 e.classList.remove(this._loadingState)); 5433 (this._removeEventListeners(), super.destroy()); 5434 } 5435 } 5436 var h = !1, 5437 c = {}; 5438 typeof window < "u" && (c = window || self);
5439 try { 5440 h = !!c.localStorage.getItem("f7c9180f-5c45-47b4-8de4-428015f096c0"); 5441 } catch {} 5442 var d, 5443 B = h; 5444 d = "warn"; 5445 let u = t(function () { 5446 if ( 5447 B && 5448 "object" == typeof window.console && 5449 "function" == typeof console[d] 5450 ) 5451 return console[d].apply( 5452 console, 5453 Array.prototype.slice.call(arguments, 0), 5454 ); 5455 }), 5456 U = { 5457 browser: [ 5458 { 5459 name: "edge", 5460 userAgent: "Edge", 5461 version: ["rv", "Edge"], 5462 test: function (e) { 5463 return ( 5464 -1 < e.ua.indexOf("Edge") || 5465 "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" === e.ua 5466 ); 5467 }, 5468 }, 5469 { 5470 name: "edgeChromium", 5471 userAgent: "Edge", 5472 version: ["rv", "Edg"], 5473 test: function (e) { 5474 return -1 < e.ua.indexOf("Edg") && -1 === e.ua.indexOf("Edge"); 5475 }, 5476 }, 5477 { name: "headlessChrome", userAgent: "HeadlessChrome" }, 5478 { name: "chrome", userAgent: "Chrome" }, 5479 { 5480 name: "firefox", 5481 test: function (e) { 5482 return ( 5483 -1 < e.ua.indexOf("Firefox") && -1 === e.ua.indexOf("Opera") 5484 ); 5485 }, 5486 version: "Firefox", 5487 }, 5488 { name: "android", userAgent: "Android" }, 5489 { 5490 name: "safari", 5491 test: function (e) { 5492 return ( 5493 -1 < e.ua.indexOf("Safari") && -1 < e.vendor.indexOf("Apple") 5494 ); 5495 }, 5496 version: "Version", 5497 }, 5498 { 5499 name: "ie", 5500 test: function (e) { 5501 return -1 < e.ua.indexOf("IE") || -1 < e.ua.indexOf("Trident"); 5502 }, 5503 version: ["MSIE", "rv"], 5504 parseDocumentMode: function () { 5505 let e = !1; 5506 return (e = document.documentMode 5507 ? parseInt(document.documentMode, 10) 5508 : e); 5509 }, 5510 }, 5511 { 5512 name: "opera", 5513 userAgent: "Opera", 5514 version: ["Version", "Opera"], 5515 }, 5516 { name: "samsung", userAgent: "SamsungBrowser" }, 5517 ], 5518 os: [ 5519 { 5520 name: "windows", 5521 test: function (e) { 5522 return -1 < e.ua.indexOf("Windows"); 5523 }, 5524 version: "Windows NT", 5525 }, 5526 { 5527 name: "osx", 5528 userAgent: "Mac", 5529 test: function (e) { 5530 return -1 < e.ua.indexOf("Macintosh"); 5531 }, 5532 }, 5533 { 5534 name: "ios", 5535 test: function (e) { 5536 return -1 < e.ua.indexOf("iPhone") || -1 < e.ua.indexOf("iPad"); 5537 }, 5538 version: ["iPhone OS", "CPU OS"], 5539 }, 5540 { 5541 name: "linux", 5542 userAgent: "Linux", 5543 test: function (e) { 5544 return ( 5545 (-1 < e.ua.indexOf("Linux") || 5546 -1 < e.platform.indexOf("Linux")) && 5547 -1 === e.ua.indexOf("Android") 5548 ); 5549 }, 5550 }, 5551 { 5552 name: "fireos", 5553 test: function (e) { 5554 return ( 5555 -1 < e.ua.indexOf("Firefox") && -1 < e.ua.indexOf("Mobile") 5556 ); 5557 }, 5558 version: "rv", 5559 }, 5560 { 5561 name: "android", 5562 userAgent: "Android", 5563 test: function (e) { 5564 return -1 < e.ua.indexOf("Android"); 5565 }, 5566 }, 5567 { name: "chromeos", userAgent: "CrOS" }, 5568 ], 5569 }, 5570 G = function (e) { 5571 var t, 5572 i = {}; 5573 for (t in e) 5574 i[t] = e[t].reduce( 5575 function (e, t) { 5576 return ((e[t.name] = !1), e); 5577 }, 5578 { 5579 version: {
5580 string: "", 5581 major: 0, 5582 minor: 0, 5583 patch: 0, 5584 documentMode: !1, 5585 }, 5586 }, 5587 ); 5588 return i; 5589 }, 5590 p = U; 5591 function K(e, i) { 5592 if ("function" == typeof e.parseVersion) return e.parseVersion(i); 5593 { 5594 let t = e.version || e.userAgent; 5595 var s = (t = "string" == typeof t ? [t] : t).length; 5596 for (let e = 0; e < s; e++) 5597 if ( 5598 (r = i.match( 5599 ((r = t[e]), new RegExp(r + "[a-zA-Z\\s/:]+([0-9_.]+)", "i")), 5600 )) && 5601 1 < r.length 5602 ) 5603 return r[1].replace(/_/g, "."); 5604 } 5605 var r; 5606 return !1; 5607 } 5608 function m(t, i, s) { 5609 var r, 5610 n = t.length; 5611 let o, a; 5612 for (let e = 0; e < n; e++) 5613 if ( 5614 ("function" == typeof t[e].test 5615 ? !0 === t[e].test(s) && (o = t[e].name) 5616 : -1 < s.ua.indexOf(t[e].userAgent) && (o = t[e].name), 5617 o) 5618 ) 5619 return ( 5620 (i[o] = !0), 5621 "string" == typeof (a = K(t[e], s.ua)) 5622 ? ((r = a.split(".")), 5623 (i.version.string = a), 5624 r && 5625 0 < r.length && 5626 ((i.version.major = parseInt(r[0] || 0)), 5627 (i.version.minor = parseInt(r[1] || 0)), 5628 (i.version.patch = parseInt(r[2] || 0)))) 5629 : "edge" === o && 5630 ((i.version.string = "12.0.0"), 5631 (i.version.major = "12"), 5632 (i.version.minor = "0"), 5633 (i.version.patch = "0")), 5634 "function" == typeof t[e].parseDocumentMode && 5635 (i.version.documentMode = t[e].parseDocumentMode()), 5636 i 5637 ); 5638 return i; 5639 } 5640 var c = function (e) { 5641 var t = {}, 5642 i = G(p); 5643 return ( 5644 (t.browser = m(p.browser, i.browser, e)), 5645 (t.os = m(p.os, i.os, e)), 5646 t 5647 ); 5648 }, 5649 h = 5650 typeof window < "u" 5651 ? window.navigator 5652 : { userAgent: "", platform: "", vendor: "" }; 5653 let H = t(c({ ua: h.userAgent, platform: h.platform, vendor: h.vendor })), 5654 W = s.CAN_PLAY_THROUGH; 5655 class g extends n { 5656 constructor(e) { 5657 (super(e), 5658 (this._loadCompleteEvent = e.loadCompleteEvent || W), 5659 (this._onLoaded = this._onLoaded.bind(this)), 5660 (this._onError = this._onError.bind(this))); 5661 } 5662 mounted() { 5663 "none" !== this.media.el.preload && 5664 this.media.src && 5665 (async () => { 5666 try { 5667 await this.media.load(this.media.src); 5668 } catch (e) { 5669 u( 5670 `auto load of ${this.media.src} failed or was aborted with err:` + 5671 e, 5672 ); 5673 } 5674 })(); 5675 } 5676 async load(i) { 5677 if ((i = void 0 === i && this.media.src ? this.media.src : i)) 5678 return ( 5679 i !== this._currentLoadUrl && 5680 (this.media.trigger(a.MEDIA_LOAD_START), 5681 (this._currentLoadUrl = i), 5682 (this._pendingPromise = new Promise((e, t) => { 5683 ((this._resolvePendingPromise = () => { 5684 ((this._resolvePendingPromise = null), 5685 (this._rejectPendingPromise = null), 5686 e()); 5687 }), 5688 (this._rejectPendingPromise = () => { 5689 ((this._resolvePendingPromise = null), 5690 (this._rejectPendingPromise = null), 5691 t()); 5692 }), 5693 this.media.el.addEventListener( 5694 this._loadCompleteEvent, 5695 this._onLoaded, 5696 ), 5697 H.browser.firefox && 5698 this._loadCompleteEvent === s.CAN_PLAY_THROUGH && 5699 this.media.el.addEventListener( 5700 s.CAN_PLAY, 5701 this._onLoaded, 5702 ), 5703 this.media.el.addEventListener(s.ERROR, this._onError), 5704 this.media.el.addEventListener(s.ABORT, this._onError), 5705 (this.media.el.src = i), 5706 this.media.el.load()); 5707 }))), 5708 this._pendingPromise 5709 ); 5710 throw new Error( 5711 "No Media src was specified, can not fullfill load() request", 5712 ); 5713 } 5714 _clearLoadListeners() { 5715 (this.media.el.removeEventListener( 5716 this._loadCompleteEvent, 5717 this._onLoaded, 5718 ), 5719 this.media.el.removeEventListener(s.CAN_PLAY, this._onLoaded), 5720 this.media.el.removeEventListener(s.ERROR, this._onError), 5721 this.media.el.removeEventListener(s.ABORT, this._onError)); 5722 } 5723 _onLoaded() { 5724 (this._clearLoadListeners(), 5725 this.media.trigger(a.LOADING_STATE_CHANGE), 5726 this.media.trigger(a.MEDIA_LOAD_COMPLETE), 5727 this._resolvePendingPromise()); 5728 } 5729 _onError() { 5730 (this._clearLoadListeners(), 5731 this.media.trigger(a.MEDIA_LOAD_ERROR), 5732 this.media.trigger(a.LOADING_STATE_CHANGE), 5733 this._rejectPendingPromise()); 5734 } 5735 abortLoad() { 5736 this._rejectPendingPromise && this._rejectPendingPromise(); 5737 } 5738 get loadingState() { 5739 return this.media.el.error 5740 ? i.ERROR 5741 : this.media.el.networkState === HTMLMediaElement.NETWORK_EMPTY && 5742 this.media.el.readyState === HTMLMediaElement.HAVE_NOTHING 5743 ? i.EMPTY 5744 : !( 5745 this.media.el.readyState < 5746 HTMLMediaElement.HAVE_CURRENT_DATA 5747 ) || 5748 (this.media.el.buffered.length && 5749 0 === this.media.el.buffered.start(0) && 5750 this.media.el.buffered.end(0) === this.media.el.duration) 5751 ? i.LOADED 5752 : i.LOADING; 5753 } 5754 destroy() { 5755 (this._clearLoadListeners(), super.destroy()); 5756 } 5757 } 5758 class z extends n { 5759 constructor(e) { 5760 (super(e), this._initialize()); 5761 } 5762 _initialize() {
5763 ((this.media.el.playsInline = !0), 5764 this.media.el.autoplay && 5765 (this._autoPlayTimer = setTimeout(() => this.media.play()))); 5766 } 5767 async play() { 5768 (this.media.el.readyState < HTMLVideoElement.HAVE_METADATA && 5769 (await this.media.load()), 5770 await this.media.el.play()); 5771 } 5772 get playbackState() { 5773 return this.media.el.ended 5774 ? r.ENDED 5775 : this.media.el.paused 5776 ? r.PAUSED 5777 : r.PLAYING; 5778 } 5779 destroy() { 5780 (clearTimeout(this._autoPlayTimer), super.destroy()); 5781 } 5782 } 5783 class q extends n { 5784 get src() { 5785 if (!this.media.el.currentSrc && !this.media.el.src) 5786 for (var e of this.media.el.querySelectorAll("source")) 5787 if (this.media.el.canPlayType(e.type)) return e.src; 5788 return this.media.el.currentSrc || this.media.el.src; 5789 } 5790 } 5791 let Y = [q, g, z, F], 5792 f = {}, 5793 v = [], 5794 j = 1; 5795 class y extends N { 5796 constructor(e = {}) { 5797 (super(), 5798 (this.el = e.el || document.createElement("video")), 5799 (this.id = 5800 e.id || 5801 this.el.id || 5802 this.el.dataset.inlineMediaId || 5803 "inlineMedia-" + j++)); 5804 var t = (e.plugins || []).concat(Y); 5805 (this._initPlugins(t, e), v.push(this)); 5806 } 5807 async load(e) { 5808 for (var t of this.plugins) 5809 if ("function" == typeof t.load) return t.load(e); 5810 } 5811 abortLoad() { 5812 for (var e of this.plugins) 5813 if ("function" == typeof e.abortLoad) { 5814 e.abortLoad(); 5815 break; 5816 } 5817 } 5818 async play() { 5819 for (var e of this.plugins) 5820 if ("function" == typeof e.play) return e.play(); 5821 } 5822 get src() { 5823 for (var e of this.plugins) if (e.src) return e.src; 5824 return ""; 5825 } 5826 get playbackState() { 5827 for (var e of this.plugins) { 5828 e = e.playbackState; 5829 if (typeof e < "u") return e; 5830 } 5831 } 5832 get loadingState() { 5833 for (var e of this.plugins) { 5834 e = e.loadingState; 5835 if (typeof e < "u") return e; 5836 } 5837 } 5838 _initPlugins(e, t) { 5839 ((this.plugins = []), (this.pluginMap = new Map())); 5840 for (var i of e) { 5841 if ("string" == typeof i) { 5842 if (!f[i]) 5843 throw new Error( 5844 `Trying to use undefined Plugin named: ${i} . Ensure you call Media.addPlugin() first!`, 5845 ); 5846 i = f[i]; 5847 } 5848 var s; 5849 !1 !== i.isSupported && 5850 ((s = new i(Object.assign({ media: this }, t))), 5851 this.plugins.push(s), 5852 this.pluginMap.set(i, s)); 5853 } 5854 this.trigger(a.MOUNTED); 5855 } 5856 destroy() { 5857 if (!this._destroyed) { 5858 for (var e of this.plugins) 5859 "function" == typeof e.destroy && e.destroy(); 5860 (super.destroy(), 5861 v.splice(v.indexOf(this), 1), 5862 (this._destroyed = !0)); 5863 } 5864 } 5865 static get medias() { 5866 return v; 5867 } 5868 static addPlugin(e, t) { 5869 f[e] = t; 5870 } 5871 static async autoInitialize(e = document, t = {}) { 5872 return (async (e = document, t = {}) => { 5873 var i, 5874 s = []; 5875 for (i of (e = e || document).querySelectorAll( 5876 "[data-inline-media]", 5877 )) { 5878 var r = i.dataset, 5879 r = r.inlineMediaPlugins 5880 ? r.inlineMediaPlugins.split(",").map((e) => e.trim()) 5881 : [], 5882 n = []; 5883 for (let t of r) 5884 if (!f[t]) { 5885 if (!o[t]) 5886 throw new Error( 5887 `Error Trying to use undefined Plugin named: ${t} . Ensure you call Media.addPlugin() first to register this custom plugin!`, 5888 ); 5889 n.push(async () => { 5890 var e = (await o[t]()).default; 5891 y.addPlugin(t, e); 5892 }); 5893 } 5894 (await Promise.all(n.map(async (e) => e())), 5895 s.push( 5896 new y( 5897 Object.assign({ el: i, plugins: r.map((e) => f[e]) }, t), 5898 ), 5899 )); 5900 } 5901 return s; 5902 })(e, t); 5903 } 5904 } 5905 let { 5906 HAVE_NOTHING: X, 5907 HAVE_CURRENT_DATA: Z, 5908 NETWORK_EMPTY: Q, 5909 NETWORK_NO_SOURCE: $, 5910 } = HTMLMediaElement, 5911 J = MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED; 5912 class ee extends g { 5913 async load(e) { 5914 return ((this.media.unloaded = !1), super.load(e)); 5915 } 5916 unload() { 5917 return ( 5918 (this._currentLoadUrl = ""), 5919 this.media.el.setAttribute("src", ""), 5920 (this.media.unloaded = !0), 5921 this.media.el.load() 5922 ); 5923 } 5924 get loadingState() { 5925 return this.media.el.error 5926 ? "" === this.media.el.getAttribute("src") && 5927 this.media.el.error.code === J 5928 ? i.LOADED 5929 : i.ERROR 5930 : [Q, $].includes(this.media.el.networkState) && 5931 this.media.el.readyState === X 5932 ? i.EMPTY 5933 : !(this.media.el.readyState < Z) || 5934 (this.media.el.buffered.length && 5935 0 === this.media.el.buffered.start(0) && 5936 this.media.el.buffered.end(0) === this.media.el.duration) 5937 ? i.LOADED 5938 : i.LOADING; 5939 } 5940 } 5941 function w(e, t, i, s) { 5942 var r = e["inlineMedia" + (i[0].toUpperCase() + i.slice(1))]; 5943 if (void 0 !== r) 5944 switch (typeof s) { 5945 case "boolean": 5946 return "false" !== r; 5947 case "object": 5948 return JSON.parse(r); 5949 case "number": 5950 return Number(r); 5951 default: 5952 return r; 5953 } 5954 else if (void 0 !== t[i]) 5955 return ( 5956 (e = t[i]), 5957 "boolean" != typeof s || ("false" !== e && "true" !== e) 5958 ? e 5959 : "false" !== e 5960 ); 5961 return s; 5962 } 5963 let te = { start: "t - 200vh", end: "b + 100vh" }; 5964 var c = class extends n { 5965 constructor(e) { 5966 (super(e), 5967 (this._anim = e.anim), 5968 (this._container = e.container || this.media.el.parentElement), 5969 (this._scrollGroup = 5970 this.options.scrollGroup || 5971 this._anim.getScrollGroupForTarget( 5972 this._container || this.media.el, 5973 )), 5974 this._initialize()); 5975 } 5976 _initialize() { 5977 ((this._onLoadKeyframeEnter = this._onLoadKeyframeEnter.bind(this)), 5978 (this._onLoadKeyframeExit = this._onLoadKeyframeExit.bind(this))); 5979 var e = w(this.media.el.dataset, this.options, "loadKeyframe", te); 5980 (e.event || (e.event = "inline-media-load-kf"), 5981 (this._loadKeyframe = this._scrollGroup.addKeyframe( 5982 this.media.el, 5983 e, 5984 )), 5985 this._loadKeyframe.controller.on( 5986 this._loadKeyframe.event + ":enter", 5987 this._onLoadKeyframeEnter, 5988 ), 5989 this._loadKeyframe.controller.on( 5990 this._loadKeyframe.event + ":exit", 5991 this._onLoadKeyframeExit, 5992 )); 5993 } 5994 get loadKeyframe() { 5995 return this._loadKeyframe; 5996 } 5997 async _onLoadKeyframeEnter(e) { 5998 try { 5999 (await this.media.load(), (this._loaded = !0)); 6000 } catch { 6001 u("AnimLoad: Load error occured"); 6002 } 6003 } 6004 _onLoadKeyframeExit(e) {} 6005 destroy() { 6006 (this._loadKeyframe.controller.off( 6007 this._loadKeyframe.event + ":enter", 6008 this._onLoadKeyframeEnter, 6009 ), 6010 this._loadKeyframe.controller.off( 6011 this._loadKeyframe.event + ":exit", 6012 this._onLoadKeyframeExit, 6013 ), 6014 super.destroy()); 6015 } 6016 }; 6017 let ie = Object.freeze( 6018 Object.defineProperty( 6019 { __proto__: null, default: c }, 6020 Symbol.toStringTag, 6021 { value: "Module" }, 6022 ), 6023 ); 6024 class se extends c { 6025 constructor(e) { 6026 (super(e), 6027 (this._component = e.component), 6028 (this._playPauseBtn = this._component.componentEl.querySelector(
6029 '[data-inline-media-control="PlayPause"]', 6030 ))); 6031 } 6032 destroy() { 6033 this._loadKeyframe && 6034 !this.loadKeyframe.destroyed && 6035 (this._loadKeyframe.controller.off( 6036 this._loadKeyframe.event + ":enter", 6037 this._onLoadKeyframeEnter, 6038 ), 6039 this._loadKeyframe.controller.off( 6040 this._loadKeyframe.event + ":exit", 6041 this._onLoadKeyframeExit, 6042 )); 6043 } 6044 async _initialize() { 6045 ((this._unloadSetting = w( 6046 this.media.el.dataset, 6047 this.options, 6048 "unload", 6049 !1, 6050 )), 6051 (this._reloadSetting = w( 6052 this.media.el.dataset, 6053 this.options, 6054 "reload", 6055 !1, 6056 )), 6057 (this._unloadAtEnd = w( 6058 this.media.el.dataset, 6059 this.options, 6060 "unloadAtEnd", 6061 !1, 6062 )), 6063 (this._endFrame = this._container.querySelector(".end-frame")), 6064 (this._onEndframeTransitionEnd = 6065 this._onEndframeTransitionEnd.bind(this)), 6066 (this._onPlaybackStateChange = 6067 this._onPlaybackStateChange.bind(this)), 6068 await super._initialize(), 6069 this._unloadAtEnd && 6070 (this.media.on( 6071 a.PLAYBACK_STATE_CHANGE, 6072 this._onPlaybackStateChange, 6073 ), 6074 this._endFrame.addEventListener( 6075 "transitionend", 6076 this._onEndframeTransitionEnd, 6077 ))); 6078 } 6079 async _onLoadKeyframeEnter() { 6080 try { 6081 (this._unloaded 6082 ? this._reloadSetting && 6083 (await this._component.reload(), (this._unloaded = !1)) 6084 : await this.media.load(), 6085 (this._loaded = !0)); 6086 } catch { 6087 console.warn( 6088 "AnimLoad: Load error occurred:", 6089 this.media.el.error, 6090 this.media.loadingState, 6091 ); 6092 } 6093 } 6094 async _onLoadKeyframeExit() { 6095 this._unloadSetting && 6096 (await this._component.unload(), 6097 (this._unloaded = !0), 6098 this._reloadSetting || this.media.destroy()); 6099 } 6100 async _onEndframeTransitionEnd() { 6101 this.media.playbackState === r.ENDED && 6102 this._unloadAtEnd && 6103 (await this._component.unload(), 6104 (this._unloaded = !0), 6105 this._endFrame.removeEventListener( 6106 "transitionend", 6107 this._onEndframeTransitionEnd, 6108 ), 6109 this.media.destroy()); 6110 } 6111 _onPlaybackStateChange() { 6112 this.media.playbackState === r.ENDED && 6113 (this.media.off( 6114 a.PLAYBACK_STATE_CHANGE, 6115 this._onPlaybackStateChange, 6116 ), 6117 this._handleLostPlayPauseFocus(), 6118 this._component.componentEl.classList.add("hide-ui")); 6119 } 6120 _handleLostPlayPauseFocus() { 6121 this._playPauseBtn && 6122 this._playPauseBtn === document.activeElement && 6123 this._component.el.focus(); 6124 } 6125 } 6126 let re = { start: "t - 100vh", end: "b" }, 6127 ne = 6128 ((h = class Me extends n { 6129 constructor(e) { 6130 (super(e), 6131 (this._anim = e.anim), 6132 (this._container = e.container || this.media.el.parentElement), 6133 (this._scrollGroup = 6134 this.options.scrollGroup || 6135 this._anim.getScrollGroupForTarget( 6136 this._container || this.media.el, 6137 )), 6138 this._initialize()); 6139 } 6140 _initialize() { 6141 ((this._onPlayKeyframeEnter = 6142 this._onPlayKeyframeEnter.bind(this)), 6143 (this._onPlayKeyframeExit = 6144 this._onPlayKeyframeExit.bind(this))); 6145 var e = this.media.el.dataset; 6146 ((this._autoPlayWithReducedMotion = w( 6147 e, 6148 this.options, 6149 "autoPlayWithReducedMotion", 6150 !1, 6151 )), 6152 (!this._autoPlayWithReducedMotion && Me.prefersReducedMotion) || 6153 ((this._pauseOnExit = w(e, this.options, "pauseOnExit", !1)), 6154 (this._resetOnExit = w(e, this.options, "resetOnExit", !1)), 6155 (e = w(e, this.options, "playKeyframe", re)).event || 6156 (e.event = "inline-media-play-kf"), 6157 (this._playKeyframe = this._scrollGroup.addKeyframe( 6158 this.media.el, 6159 e, 6160 )), 6161 this._playKeyframe.controller.on( 6162 this._playKeyframe.event + ":enter", 6163 this._onPlayKeyframeEnter, 6164 ), 6165 this._playKeyframe.controller.on( 6166 this._playKeyframe.event + ":exit", 6167 this._onPlayKeyframeExit, 6168 ), 6169 (this._onLoadStart = this._onLoadStart.bind(this)), 6170 this.media.on(a.MEDIA_LOAD_START, this._onLoadStart))); 6171 } 6172 _onLoadStart() { 6173 this._loaded = !1; 6174 } 6175 async _onPlayKeyframeEnter(e) { 6176 if ( 6177 ((this._inFrame = !0), 6178 !this._paused && 6179 (this._loaded || 6180 (await this.media.load(), (this._loaded = !0)), 6181 this._inFrame)) 6182 ) 6183 try { 6184 await this.media.play(); 6185 } catch {} 6186 } 6187 _onPlayKeyframeExit(e) { 6188 ((this._inFrame = !1), 6189 this._loaded && this.media.el.paused && !this.media.el.ended 6190 ? (this._paused = !0) 6191 : this._pauseOnExit && 6192 ((this._paused = !1), this.media.el.pause()), 6193 this._loaded && 6194 this._resetOnExit && 6195 (this.media.el.currentTime = 0)); 6196 } 6197 get playKeyframe() { 6198 return this._playKeyframe; 6199 } 6200 destroy() { 6201 (this._playKeyframe.controller.off( 6202 this._playKeyframe.event + ":enter", 6203 this._onPlayKeyframeEnter, 6204 ), 6205 this._playKeyframe.controller.off( 6206 this._playKeyframe.event + ":exit", 6207 this._onPlayKeyframeExit, 6208 ), 6209 this.media.off(a.MEDIA_LOAD_START, this._onLoadStart), 6210 super.destroy()); 6211 } 6212 static get prefersReducedMotion() { 6213 return window.matchMedia("(prefers-reduced-motion: reduce)") 6214 .matches; 6215 } 6216 }), 6217 Object.freeze( 6218 Object.defineProperty( 6219 { __proto__: null, default: h }, 6220 Symbol.toStringTag, 6221 { value: "Module" }, 6222 ), 6223 )), 6224 _ = "fallback", 6225 A = "media-unloaded", 6226 C = "data-user-paused", 6227 E = "inline-media-timeout", 6228 b = { start: "t - 100vh", end: "b" }; 6229 class x extends h { 6230 constructor(e) { 6231 (super(e), 6232 (this._hasPlayed = !1), 6233 (this.componentEl = e.componentEl)); 6234 } 6235 destroy() { 6236 (this._playKeyframe && 6237 !this._playKeyframe.destroyed && 6238 this._playKeyframe.remove(), 6239 this._pauseKeyframe && 6240 !this._pauseKeyframe.destroyed && 6241 this._pauseKeyframe.remove(), 6242 this._resetKeyframe && 6243 !this._resetKeyframe.destroyed && 6244 this._resetKeyframe.remove(), 6245 this.media.off(a.MEDIA_LOAD_START, this._onLoadStart)); 6246 } 6247 _initialize() { 6248 ((this._onPlayKeyframeEnter = this._onPlayKeyframeEnter.bind(this)), 6249 (this._onPlayKeyframeExit = this._onPlayKeyframeExit.bind(this)), 6250 (this._onPauseKeyframeExit = this._onPauseKeyframeExit.bind(this)), 6251 (this._onResetKeyframe = this._onResetKeyframe.bind(this))); 6252 var e = this.media.el.dataset, 6253 t = 6254 ((this._autoPlayWithReducedMotion = w( 6255 e, 6256 this.options, 6257 "autoPlayWithReducedMotion", 6258 !1, 6259 )), 6260 (this._resetByKeyframe = !0), 6261 (this._pauseOnExit = w(e, this.options, "pauseOnExit", !0)), 6262 (this._resetOnExit = w(e, this.options, "resetOnExit", !1)), 6263 w(e, this.options, "playKeyframe", b)), 6264 i = w(e, this.options, "pauseKeyframe", { ...t }); 6265 (t.event || (t.event = "inline-media-play-kf"), 6266 i.event || (i.event = "inline-media-pause-kf"), 6267 (this._playKeyframe = this._scrollGroup.addKeyframe( 6268 this.media.el, 6269 t, 6270 )), 6271 (this._pauseKeyframe = this._scrollGroup.addKeyframe( 6272 this.media.el, 6273 i, 6274 )), 6275 this._playKeyframe.controller.on( 6276 this._playKeyframe.event + ":enter", 6277 this._onPlayKeyframeEnter, 6278 ), 6279 this._playKeyframe.controller.on( 6280 this._playKeyframe.event + ":exit", 6281 this._onPlayKeyframeExit, 6282 ), 6283 this._pauseKeyframe.controller.on( 6284 this._pauseKeyframe.event + ":exit", 6285 this._onPauseKeyframeExit, 6286 ), 6287 this._resetOnExit && 6288 ((t = w(e, this.options, "resetKeyframe", b)).event || 6289 (t.event = "inline-media-reset-kf"), 6290 (this._resetKeyframe = this._scrollGroup.addKeyframe( 6291 this.media.el, 6292 t, 6293 )), 6294 this._resetKeyframe.controller.on( 6295 this._resetKeyframe.event + ":exit", 6296 this._onResetKeyframe, 6297 ), 6298 this._pauseKeyframe) && 6299 !this._pauseKeyframe.destroyed && 6300 this._pauseKeyframe.remove(), 6301 (this._onLoadStart = this._onLoadStart.bind(this)), 6302 this.media.on(a.MEDIA_LOAD_START, this._onLoadStart)); 6303 } 6304 _onLoadStart() { 6305 ((this._loaded = !1), (this._paused = !1)); 6306 } 6307 _onPauseKeyframeExit() { 6308 (this._loaded && this.media.el.paused && !this.media.el.ended 6309 ? (this._paused = !0) 6310 : this._pauseOnExit && ((this._paused = !1), this.media.el.pause()), 6311 this._loaded && 6312 this._resetOnExit && 6313 (this.media.el.currentTime = 0)); 6314 } 6315 _onPlayKeyframeExit() { 6316 this._inFrame = !1; 6317 } 6318 async _onPlayKeyframeEnter() { 6319 if ( 6320 ((this._inFrame = !0), 6321 !this._paused && !this.media.el.hasAttribute(C)) 6322 ) { 6323 if (!this._loaded) 6324 try { 6325 (await this.media.load(), (this._loaded = !0)); 6326 } catch {} 6327 var e = "" === this.media.el.getAttribute("src"); 6328 if (this._inFrame && !e) { 6329 try { 6330 (this._resetKeyframe && !this._resetByKeyframe) || 6331 (x.prefersReducedMotion && 6332 (x, !this._autoPlayWithReducedMotion)) || 6333 (await this.media.play(), (this._resetByKeyframe = !1)); 6334 } catch { 6335 this.media.el.error || 6336 this.media.el.readyState === HTMLMediaElement.HAVE_NOTHING || 6337 (this.componentEl.classList.add(_), this.destroy()); 6338 } 6339 this._hasPlayed || 6340 ((this._hasPlayed = !0), 6341 this.media.el.classList.add("play-initiated")); 6342 } 6343 } 6344 } 6345 _onResetKeyframe() { 6346 this._loaded && 6347 this._resetOnExit && 6348 ((this._resetByKeyframe = !0), 6349 (this._paused = !1), 6350 this.media.el.pause(), 6351 (this.media.el.currentTime = 0), 6352 this.media.el.removeAttribute(C)); 6353 } 6354 } 6355 let oe = { small: 0, medium: 570, large: 780, xlarge: 1280 }; 6356 class S { 6357 constructor(e) { 6358 ((this._breakpoints = e.breakpoints || oe), 6359 (this.options = e), 6360 this._initialize()); 6361 } 6362 _initialize() { 6363 ((this._updateBreakpoint = this._updateBreakpoint.bind(this)), 6364 (this._callback = this.options.callback), 6365 (this._mediaQueries = Object.keys(this._breakpoints).map((e) => 6366 window.matchMedia(`(min-width: ${this._breakpoints[e]}px)`), 6367 )), 6368 this._addEventListeners(), 6369 this._updateBreakpoint()); 6370 } 6371 _addEventListeners() { 6372 for (var e of this._mediaQueries) 6373 e.addListener(this._updateBreakpoint); 6374 } 6375 _removeEventListeners() { 6376 for (var e of this._mediaQueries) 6377 e.removeListener(this._updateBreakpoint); 6378 } 6379 _updateBreakpoint() { 6380 var t = Object.keys(this._breakpoints); 6381 let i = t[0]; 6382 for (let e = 1; e < t.length && this._mediaQueries[e].matches; e++) 6383 i = t[e]; 6384 let e = !1; 6385 (this._currentBreakpoint && this._currentBreakpoint !== i && (e = !0), 6386 (this._currentBreakpoint = i), 6387 e && this._callback()); 6388 } 6389 get breakpoint() { 6390 return this._currentBreakpoint; 6391 } 6392 destroy() { 6393 this._removeEventListeners(); 6394 } 6395 } 6396 let ae = { S: "small", M: "medium", L: "large", X: "xlarge" }; 6397 class le extends S { 6398 constructor(e) { 6399 super(e); 6400 } 6401 _initialize() { 6402 ((this._anim = this.options.anim), 6403 (this._bpMap = this.options.animBreakpointMap || ae), 6404 (this._updateBreakpoint = this._updateBreakpoint.bind(this)), 6405 (this._callback = this.options.callback), 6406 this._addEventListeners(), 6407 this._updateBreakpoint()); 6408 } 6409 _addEventListeners() { 6410 this._anim.on("ON_BREAKPOINT_CHANGE", this._updateBreakpoint); 6411 } 6412 _removeEventListeners() { 6413 this._anim.off("ON_BREAKPOINT_CHANGE", this._updateBreakpoint); 6414 } 6415 _updateBreakpoint() { 6416 var e = this._bpMap[this._anim.model.pageMetrics.breakpoint]; 6417 let t = !1; 6418 (this._currentBreakpoint && this._currentBreakpoint !== e && (t = !0), 6419 (this._currentBreakpoint = e), 6420 t && this._callback()); 6421 } 6422 destroy() { 6423 super.destroy(); 6424 } 6425 } 6426 class M extends n { 6427 constructor(e) { 6428 (super(e), (this._cachedPlaying = null), this._initialize()); 6429 } 6430 _initialize() { 6431 this._onBreakpointChange = this._onBreakpointChange.bind(this); 6432 var e = Object.assign( 6433 { callback: this._onBreakpointChange }, 6434 this.options, 6435 ), 6436 e = 6437 ((this._breakpointDetect = new (e.anim ? le : S)(e)), 6438 (this._currentTime = 0), 6439 this.media.el.dataset); 6440 ((this._basePath = 6441 this.options.basePath || e.inlineMediaBasepath || "./"), 6442 this._onBreakpointChange()); 6443 } 6444 _onBreakpointChange() { 6445 this._currentBreakpoint = this._breakpointDetect.breakpoint; 6446 var e = 6447 1 < window.devicePixelRatio 6448 ? this._currentBreakpoint + "_2x" 6449 : this._currentBreakpoint, 6450 e = "" + this._basePath + e + ".mp4"; 6451 this._swapSrc(e); 6452 } 6453 get src() { 6454 return this._src; 6455 } 6456 async _swapSrc(e) { 6457 var t; 6458 if (((this._src = e), this.media.loadingState !== i.EMPTY)) 6459 return ( 6460 (t = 6461 null !== this._cachedPlaying 6462 ? this._cachedPlaying 6463 : !this.media.el.paused), 6464 this.media.loadingState === i.LOADED && 6465 (this._currentTime = this.media.el.currentTime), 6466 (this._cachedPlaying = t), 6467 await this.media.load(e + "#t="
6467+ this._currentTime), 6468 (this._cachedPlaying = null), 6469 t ? this.media.play() : Promise.resolve() 6470 ); 6471 } 6472 destroy() { 6473 (this._breakpointDetect.destroy(), super.destroy()); 6474 } 6475 } 6476 let he = Object.freeze( 6477 Object.defineProperty( 6478 { __proto__: null, default: M }, 6479 Symbol.toStringTag, 6480 { value: "Module" }, 6481 ), 6482 ), 6483 T = () => 1 < window.devicePixelRatio; 6484 class ce extends M { 6485 _initialize() { 6486 ((this._mimeTypes = ["mp4"]), 6487 (this._anim = this.options.anim), 6488 (this._container = document.querySelector(".channel-html-18-pro")), 6489 (this._componentEl = 6490 this.options.componentEl || 6491 this.media.el.closest(".inline-media-component-container"))); 6492 var e = this.media.el.dataset.inlineMediaSources; 6493 if (e) 6494 try { 6495 this._sources = JSON.parse(e); 6496 } catch (e) { 6497 (console.error( 6498 "ViewportSourceOnce: Invalid JSON in data-inline-media-sources", 6499 e, 6500 ), 6501 (this._sources = null)); 6502 } 6503 (super._initialize(), 6504 this._anim.once("PAGE_XP_UNENHANCE", () => { 6505 this._onBreakpointChange(); 6506 })); 6507 } 6508 _getCurrentViewport() { 6509 var e; 6510 return !this._container || (e = this._container.clientWidth) <= 734 6511 ? "small" 6512 : e <= 1068 6513 ? "medium" 6514 : "large"; 6515 } 6516 _onBreakpointChange() { 6517 if (this._currentBreakpoint) 6518 (this._breakpointDetect && this._breakpointDetect.destroy(), 6519 this._applyFallback()); 6520 else if (this._sources) { 6521 this._currentBreakpoint = this._getCurrentViewport(); 6522 var t = T() 6523 ? this._currentBreakpoint + "2x" 6524 : this._currentBreakpoint; 6525 let e = this._sources[t]; 6526 (e = 6527 (e = !e && T() ? this._sources[this._currentBreakpoint] : e) || 6528 this._sources.large || 6529 this._sources.medium || 6530 this._sources.small || 6531 Object.values(this._sources)[0]) 6532 ? this._swapSrc(e) 6533 : console.warn( 6534 "ViewportSourceOnce: No video source found for", 6535 this._currentBreakpoint, 6536 ); 6537 } else super._onBreakpointChange(); 6538 } 6539 _applyFallback() { 6540 this.options.component.destroy(); 6541 } 6542 } 6543 let I = '[data-inline-media-control="PlayPause"]', 6544 O = { playing: "Pause", paused: "Play", ended: "Replay" }, 6545 de = { CLICK: "data-analytics-click", TITLE: "data-analytics-title" }, 6546 ue = 6547 ((c = class extends n { 6548 constructor(e) { 6549 (super(e), 6550 (this._container = e.container || this.media.el.parentElement), 6551 (this._button = this._findButton()), 6552 (this._onClick = this._onClick.bind(this)), 6553 (this._onPlaybackStateChange = 6554 this._onPlaybackStateChange.bind(this))); 6555 var t = this._button.dataset; 6556 ((this._ariaLabels = { 6557 playing: t.ariaPlaying || e.ariaPlaying || O.playing, 6558 paused: t.ariaPaused || e.ariaPaused || O.paused, 6559 ended: t.ariaEnded || e.ariaEnded || O.ended, 6560 }), 6561 this._button.addEventListener("click", this._onClick), 6562 this.media.on( 6563 a.PLAYBACK_STATE_CHANGE, 6564 this._onPlaybackStateChange, 6565 ), 6566 (this._activeAnalytics = Object.values(de).filter( 6567 (e) => 6568 (this._button.hasAttribute(e + "-play") && 6569 this._button.hasAttribute(e + "-pause")) || 6570 this._button.hasAttribute(e + "-replay"), 6571 ))); 6572 } 6573 _findButton() { 6574 if (this.options.playPauseButton) 6575 return this.options.playPauseButton; 6576 let e = this._container.querySelector(I); 6577 var t; 6578 if (!e) 6579 for (t of document.querySelectorAll( 6580 "[data-inline-media-controller='{id}']".replace( 6581 "{id}", 6582 this.media.id, 6583 ), 6584 )) 6585 e = 6586 "PlayPause" === t.getAttribute("data-inline-media-control") 6587 ? t 6588 : t.querySelector(I); 6589 return e; 6590 } 6591 _onPlaybackStateChange() { 6592 switch (this.media.playbackState) { 6593 case r.PLAYING: 6594 this._button.setAttribute( 6595 "aria-label", 6596 this._ariaLabels.playing, 6597 ); 6598 break; 6599 case r.ENDED: 6600 this._button.setAttribute( 6601 "aria-label", 6602 this._ariaLabels.ended, 6603 ); 6604 break; 6605 default: 6606 this._button.setAttribute( 6607 "aria-label", 6608 this._ariaLabels.paused, 6609 ); 6610 } 6611 this._setAnalyticsState(); 6612 } 6613 _setAnalyticsState() { 6614 let t; 6615 switch (this.media.playbackState) { 6616 case r.PLAYING: 6617 t = "pause"; 6618 break; 6619 case r.ENDED: 6620 t = "replay"; 6621 break; 6622 default: 6623 t = "play"; 6624 } 6625 for (var i of this._activeAnalytics) { 6626 let e = t; 6627 ("replay" !== t || 6628 this._button.hasAttribute(i + "-" + e) || 6629 (e = "play"), 6630 this._button.setAttribute( 6631 i, 6632 this._button.getAttribute(i + "-" + e), 6633 )); 6634 } 6635 } 6636 _onClick(e) { 6637 (e.preventDefault(), 6638 this.media.el.paused 6639 ? this.media.play() 6640 : this.media.el.pause()); 6641 } 6642 destroy() { 6643 (this._button.removeEventListener("click", this._onClick), 6644 this.media.off( 6645 a.PLAYBACK_STATE_CHANGE, 6646 this._onPlaybackStateChange, 6647 )); 6648 } 6649 }), 6650 Object.freeze( 6651 Object.defineProperty( 6652 { __proto__: null, default: c }, 6653 Symbol.toStringTag, 6654 { value: "Module" }, 6655 ), 6656 )); 6657 class P extends c { 6658 mounted() { 6659 var e; 6660 null != (e = this._button) && e.removeAttribute("aria-hidden"); 6661 } 6662 destroy() { 6663 var e; 6664 (super.destroy(), 6665 null != (e = this._button) && 6666 e.setAttribute("aria-hidden", "true")); 6667 } 6668 _onClick(e) { 6669 (e.preventDefault(), 6670 null != (e = this.media) && e.el.paused 6671 ? (this.media.el.toggleAttribute(C, !1), this.media.play()) 6672 : (this.media.el.toggleAttribute(C, !0), this.media.el.pause())); 6673 } 6674 } 6675 h = navigator.userAgent; 6676 let D = 6677 /Safari/.test(h) && 6678 !/Chrome/.test(h) && 6679 (h = h.match(/Version\/(\d+)\.(\d+)/)) 6680 ? { major: parseInt(h[1], 10), minor: parseInt(h[2], 10) } 6681 : null, 6682 pe = D && ((15 === D.major && 5 <= D.minor) || 16 === D.major), 6683 V = D && 17 === D.major && D.minor <= 3; 6684 class me extends n { 6685 constructor(e) { 6686 (super(e), 6687 (this._anim = e.anim), 6688 (this._onResizeImmediate = this._onResizeImmediate.bind(this)), 6689 (this._onResizeDebounced = this._onResizeDebounced.bind(this))); 6690 } 6691 mounted() { 6692 (pe || V) && 6693 (this._anim.on("ON_RESIZE_DEBOUNCED", this._onResizeDebounced), 6694 this.applyObjectFitFix()); 6695 } 6696 destroy() { 6697 (this.removeObjectFitFix(), 6698 this._anim && 6699 (this._anim.off("ON_RESIZE_IMMEDIATE", this._onResizeImmediate), 6700 this._anim.off("ON_RESIZE_DEBOUNCED", this._onResizeDebounced))); 6701 } 6702 applyObjectFitFix(e = !1) { 6703 (this._anim.on("ON_RESIZE_IMMEDIATE", this._onResizeImmediate), 6704 (e && V) || 6705 ((this.media.el.style.minHeight = "0"), 6706 (this.media.el.style.objectFit = "fill"))); 6707 var { offsetWidth: e, offsetHeight: t } = this.media.el.parentElement; 6708 ((this.media.el.style.width = e + "px"), 6709 (this.media.el.style.height = t + "px")); 6710 } 6711 removeObjectFitFix() { 6712 (this.media.el.style.removeProperty("min-height"), 6713 this.media.el.style.removeProperty("object-fit"), 6714 this.media.el.style.removeProperty("width"), 6715 this.media.el.style.removeProperty("height")); 6716 } 6717 _onResizeImmediate() { 6718 (!V && "loading-empty" === this.media.loadingState) || 6719 (!V && "loading-error" === this.media.loadingState) || 6720 (this._anim.off("ON_RESIZE_IMMEDIATE", this._onResizeImmediate), 6721 this.removeObjectFitFix()); 6722 } 6723 _onResizeDebounced() { 6724 ((!V && "loading-empty" === this.media.loadingState) || 6725 (!V && "loading-error" === this.media.loadingState)) && 6726 (this._anim.off("ON_RESIZE_IMMEDIATE", this._onResizeImmediate), 6727 this.applyObjectFitFix(!0)); 6728 } 6729 } 6730 class ge extends n { 6731 constructor(e) { 6732 (super(e), 6733 (this._container = e.container || this.media.el.parentElement), 6734 (this._uiContainer = 6735 null == (e = e.componentEl) 6736 ? void 0 6737 : e.querySelector(".inline-media-ui")), 6738 (this._uiButton = 6739 null == (e = this._uiContainer) 6740 ? void 0 6741 : e.querySelector(".play-pause-button")), 6742 (this._onReplayClicked = this._onReplayClicked.bind(this))); 6743 } 6744 mounted() { 6745 var e; 6746 this._uiContainer && 6747 !document.documentElement.classList.contains("reduced-motion") && 6748 null != (e = this._uiContainer) && 6749 e.classList.contains("inline-media-ui-replay-only") && 6750 null != (e = this._uiButton) && 6751 e.addEventListener("click", this._onReplayClicked); 6752 } 6753 destroy() { 6754 var e; 6755 (null != (e = this._uiButton) && 6756 e.removeEventListener("click", this._onReplayClicked), 6757 super.destroy()); 6758 } 6759 _onReplayClicked() { 6760 this._uiButton.dataset.focusMethod && 6761 "mouse" !== this._uiButton.dataset.focusMethod && 6762 (this._uiButton.blur(), 6763 this.media.el.setAttribute("tabindex", "-1"), 6764 this.media.el.style.setProperty("outline", "none"), 6765 this.media.el.focus(), 6766 setTimeout(() => { 6767 (this.media.el.focus(), 6768 this.media.el.removeAttribute("tabindex")); 6769 }, 300)); 6770 } 6771 } 6772 if ( 6773 ((h = null == (c = window.channelHtml18pro) ? void 0 : c.ChannelBase), 6774 (c = ( 6775 (null == (c = window.channelHtml18pro) ? void 0 : c.helpers) || {} 6776 ).registerComponent), 6777 !h) 6778 ) 6779 throw new Error( 6780 "InlineMedia: ChannelBase not found. Make sure ChannelBase.js is loaded before InlineMedia.js", 6781 ); 6782 let fe = { 6783 xsmall: "xsmall", 6784 small: "small", 6785 medium: "medium", 6786 large: "large", 6787 xlarge: "xlarge", 6788 }, 6789 ve = { PlayPauseButton: P }; 6790 class ye extends h { 6791 constructor(e, t = {}) { 6792 (super(), 6793 (this.componentEl = document.querySelector( 6794 `.${e}.inline-media-component-container`, 6795 )), 6796 (this.el = this.componentEl.querySelector(".video-wrapper")), 6797 (this.isInsideModal = !( 6798 null == (e = this.componentEl) || 6799 !e.closest(".channel-modal-content") 6800 )), 6801 (this.pluginOptions = {}), 6802 (this.breakpointSubstitutionMap = {}), 6803 (this.customPlugins = t.plugins || []), 6804 (this.videoEl = this.el.querySelector( 6805 "#" + this.el.dataset.videoId, 6806 )), 6807 (this.frames = { 6808 fallbackFrame: this.componentEl.querySelector(".fallback-frame"), 6809 startFrame: this.componentEl.querySelector(".start-frame"), 6810 endFrame: this.componentEl.querySelector(".end-frame"), 6811 }), 6812 (this.mediaControllerElements = document.querySelectorAll( 6813 `[data-inline-media-controller="${this.el.dataset.videoId}"]`, 6814 ))); 6815 } 6816 addCustomPlugins() { 6817 if (0 < this.customPlugins.length) { 6818 let t = {}, 6819 i = { 6820 AnimLoad: se, 6821 AnimPlay: x, 6822 ViewportSourceOnce: ce, 6823 PlayPauseButton: P, 6824 }; 6825 (this.customPlugins.forEach((e) => { 6826 i[e] 6827 ? (t[e] = i[e]) 6828 : console.warn(`InlineMedia: Unknown plugin "${e}"`); 6829 }), 6830 0 < Object.keys(t).length && this.injectPlugins(t)); 6831 } 6832 } 6833 addBreakpointSubstitutionMap() { 6834 this.breakpointSubstitutionMap = { xlarge: "large", xsmall: "small" }; 6835 } 6836 async mounted() { 6837 if ( 6838 this.channelContainer && 6839 this.channelContainer.classList.contains("inline-media") 6840 ) { 6841 let t = { 6842 ...(this.videoEl.hasAttribute( 6843 "data-inline-media-no-object-fit-fix", 6844 ) 6845 ? {}
6846 : { ObjectFitFix: me }), 6847 ReplayOnlyAX: ge, 6848 UnloadVideo: ee, 6849 }; 6850 var e = ((this.commonPlugins = Object.assign(o, ve)), 6851 Object.keys(t).forEach((e) => { 6852 this.commonPlugins[e] = t[e]; 6853 }), 6854 this.injectPlugins(t), 6855 this.addCustomPlugins(), 6856 this.addBreakpointSubstitutionMap(), 6857 this.isInsideModal && 6858 (i = 6859 null == (i = this.componentEl.closest(".channel-modal")) 6860 ? void 0 6861 : i.dataset.shortid) && 6862 (this.modal = 6863 null == 6864 (e = 6865 null == 6866 (e = 6867 null == (e = window.channelHtml18pro) 6868 ? void 0 6869 : e.channelModal) 6870 ? void 0 6871 : e.instances) 6872 ? void 0 6873 : e[i]), 6874 this.channelContainer).classList, 6875 i = 6876 e.contains("reduced-motion") && 6877 !this.videoEl.hasAttribute("data-inline-media-has-ui"), 6878 s = this.videoEl.hasAttribute("data-inline-media-alpha"), 6879 e = e.contains("no-inline-media-alpha") && s; 6880 i || e 6881 ? this.addFallbackClassname() 6882 : ((this.mediaInstance = await y.autoInitialize(this.el, { 6883 anim: this.anim, 6884 animBreakpointMap: fe, 6885 component: this, 6886 componentEl: this.componentEl, 6887 container: this.componentEl, 6888 breakpointSubstitutionMap: this.breakpointSubstitutionMap, 6889 ...(this.modal && { 6890 modalReference: this.modal, 6891 scrollGroup: this.modal.animScrollGroup, 6892 }), 6893 ...this.pluginOptions, 6894 })), 6895 (this.mediaItem = this.mediaInstance[0]), 6896 (this.mediaItem.unload = this.unload.bind(this)), 6897 this.modal && this.setupModalController(), 6898 (this.mediaLoadError = this.mediaLoadError.bind(this)), 6899 this.mediaItem.on(a.MEDIA_LOAD_ERROR, this.mediaLoadError), 6900 (this.mediaTimeout = this.mediaTimeout.bind(this)), 6901 this.mediaItem.on(E, this.mediaTimeout), 6902 (this.mediaCanPlay = this.mediaCanPlay.bind(this)), 6903 this.mediaInstance[0].once( 6904 a.MEDIA_LOAD_COMPLETE, 6905 this.mediaCanPlay, 6906 ), 6907 (this.mediaUnloaded = this.mediaUnloaded.bind(this)), 6908 this.mediaItem.on("inline-media-unload", this.mediaUnloaded), 6909 this.anim.once("PAGE_XP_UNENHANCE", (e) => { 6910 "text zoom" === e && this.destroy(); 6911 })); 6912 } else 6913 console.log("InlineMedia: Not supported, skipping initialization"); 6914 } 6915 injectPlugins(e) { 6916 var t, 6917 i = this.videoEl.getAttribute("data-inline-media-plugins"), 6918 s = new Set(i ? i.split(",").map((e) => e.trim()) : []); 6919 for (t in e) (s.add(t), y.addPlugin(t, e[t])); 6920 this.videoEl.setAttribute( 6921 "data-inline-media-plugins", 6922 [...s].join(","), 6923 ); 6924 } 6925 mediaCanPlay() { 6926 this.componentEl.classList.add("ready"); 6927 } 6928 setupModalController() { 6929 ((this._mediaPlayingOnModalOpen = !1), 6930 this.modal.modal.on("open", () => { 6931 "playing" === this.mediaItem.playbackState && 6932 ((this._mediaPlayingOnModalOpen = !0), 6933 this.mediaItem.el.pause()); 6934 }), 6935 this.modal.modal.on("close", () => { 6936 this._mediaPlayingOnModalOpen && this.mediaItem.play(); 6937 })); 6938 } 6939 mediaLoadError() { 6940 this.componentEl.classList.contains(A) || this.addFallbackClassname(); 6941 } 6942 mediaTimeout() { 6943 (this.componentEl.classList.add("media-timeout"), 6944 this.addFallbackClassname()); 6945 } 6946 mediaUnloaded() { 6947 (this.mediaItem && this.mediaItem._destroyed) || 6948 (this.videoEl.hasAttribute("data-inline-media-reload") || 6949 this.videoEl.hasAttribute("data-inline-media-unload-at-end") 6950 ? this.componentEl.classList.add(A) 6951 : this.addFallbackClassname()); 6952 } 6953 unload() { 6954 for (var e of this.mediaItem.plugins) 6955 "function" == typeof e.unload && e.unload(); 6956 } 6957 async reload() { 6958 var e; 6959 (this.componentEl.classList.remove(A), 6960 null != (e = this.frames.endFrame) && 6961 e.setAttribute("aria-hidden", "true"), 6962 this.mediaItem.unloaded && (await this.mediaItem.load())); 6963 } 6964 addFallbackClassname() { 6965 this.componentEl.classList.contains(_) || 6966 (this.componentEl.classList.add(_),
6967 this.mediaControllerElements.forEach((e) => e.classList.add(_)), 6968 this.anim && 6969 "function" == typeof this.anim.forceUpdate && 6970 requestAnimationFrame(() => this.anim.forceUpdate())); 6971 } 6972 destroy() { 6973 (this.mediaItem && 6974 !this.mediaItem._destroyed && 6975 (this.unload(), 6976 this.mediaItem.off(E, this.mediaTimeout), 6977 this.mediaItem.destroy()), 6978 this.addFallbackClassname(), 6979 super.destroy()); 6980 } 6981 } 6982 c 6983 ? c("inlineMedia", ye) 6984 : console.warn("make sure ChannelHelpers.js is included"); 6985 class we { 6986 constructor(e) { 6987 ((this.featureClass = e.featureClass), 6988 (this._callback = e.callback), 6989 (this._isPresent = !1), 6990 (this._wasPresent = !1)); 6991 } 6992 get presenceChanged() { 6993 return this._isPresent !== this._wasPresent; 6994 } 6995 get isPresent() { 6996 return this._isPresent; 6997 } 6998 updatePresence(e) { 6999 ((this._wasPresent = this._isPresent), 7000 (this._isPresent = e.contains(this.featureClass))); 7001 } 7002 triggerCallback(e) { 7003 return this._callback(e); 7004 } 7005 } 7006 let _e = () => {}; 7007 class k { 7008 constructor(e) { 7009 var t; 7010 ((this._features = new Set( 7011 ((t = e.features), Array.isArray(t) ? t : t ? [t] : []), 7012 )), 7013 (this._isDetected = !1), 7014 (this._wasDetected = !1), 7015 (this._onActivate = e.onActivate || _e), 7016 (this._onDeactivate = e.onDeactivate || _e)); 7017 } 7018 get detectionChanged() { 7019 return this._isDetected !== this._wasDetected; 7020 } 7021 get isDetected() { 7022 return this._isDetected; 7023 } 7024 updateFeatureState(e) { 7025 this._wasDetected = this._isDetected; 7026 for (var t of e) 7027 if (this._features.has(t)) return void (this._isDetected = !0); 7028 this._isDetected = !1; 7029 } 7030 applyEffect() { 7031 this._isDetected ? this._onActivate() : this._onDeactivate(); 7032 } 7033 } 7034 let Ae = (e) => e, 7035 L = (e) => (e ? e.split(",").map((e) => e.trim()) : null); 7036 class Ce extends n { 7037 constructor(r) { 7038 super(r); 7039 var e = (e, t, i) => { 7040 var s = "inlineMedia" + e[0].toUpperCase() + e.slice(1); 7041 return t(this.media.el.dataset[s]) || r[e] || i; 7042 }, 7043 t = 7044 ((this._disabledStates = new k({ 7045 features: e("disabledWhen", L, []), 7046 onActivate: this.disable.bind(this), 7047 onDeactivate: this.enable.bind(this), 7048 })), 7049 (this._destroyStates = new k({ 7050 features: e("destroyWhen", L, []), 7051 onActivate: this.destroyMedia.bind(this), 7052 })), 7053 (this._pausedStates = new k({ 7054 features: e("pausedWhen", L, []), 7055 onActivate: this.pauseMedia.bind(this), 7056 })), 7057 (this._autoplayStates = new k({ 7058 features: e("autoplayWhen", L, []), 7059 onActivate: this.autoplayMedia.bind(this), 7060 onDeactivate: this.disableAutoplay.bind(this), 7061 })), 7062 r.featureDetect || {}); 7063 ((this.featureCallbacks = Object.entries(t).map( 7064 ([e, t]) => new we({ featureClass: e, callback: t }), 7065 )), 7066 (this._featureElement = 7067 (t = e("featureElement", Ae, document.documentElement)) instanceof 7068 HTMLElement 7069 ? t 7070 : document.querySelector(t)), 7071 (this.featureSets = [ 7072 this._autoplayStates, 7073 this._pausedStates, 7074 this._disabledStates, 7075 this._destroyStates, 7076 ]), 7077 (this._featuresUpdated = this._featuresUpdated.bind(this)), 7078 (this.play = !1), 7079 (this._observer = new MutationObserver(this._featuresUpdated)), 7080 this._observer.observe(this._featureElement, { 7081 attributes: !0, 7082 attributeFilter: ["class"], 7083 }), 7084 this._featuresUpdated()); 7085 } 7086 get loadingState() { 7087 return this._disabledStates.isDetected ? i.DISABLED : void 0; 7088 } 7089 get playbackState() { 7090 return this._disabledStates.isDetected ? r.PAUSED : void 0; 7091 } 7092 _featuresUpdated() { 7093 let t = this._featureElement.classList; 7094 (this.featureSets 7095 .filter((e) => (e.updateFeatureState(t), e.detectionChanged)) 7096 .forEach((e) => e.applyEffect()), 7097 this.featureCallbacks.forEach((e) => { 7098 (e.updatePresence(t), 7099 e.isPresent && 7100 e.presenceChanged && 7101 e.triggerCallback(this.media)); 7102 })); 7103 } 7104 autoplayMedia() { 7105 (this.media.el.setAttribute("autoplay", !0), this.media.play()); 7106 } 7107 disableAutoplay() { 7108 this.media.el.setAttribute("autoplay", !1); 7109 } 7110 pauseMedia() { 7111 this.media.el.pause(); 7112 } 7113 destroyMedia() { 7114 this.media.destroy(); 7115 } 7116 destroy() { 7117 this._observer.disconnect(); 7118 } 7119 disable() { 7120 (this.media.abortLoad(), 7121 this.media.el.pause(), 7122 (this.play = Ae), 7123 this.media.trigger(a.LOADING_STATE_CHANGE), 7124 this.media.trigger(a.PLAYBACK_STATE_CHANGE)); 7125 } 7126 enable() { 7127 ((this.play = !1), 7128 this.media.trigger(a.LOADING_STATE_CHANGE), 7129 this.media.trigger(a.PLAYBACK_STATE_CHANGE)); 7130 } 7131 } 7132 let Ee = Object.freeze( 7133 Object.defineProperty( 7134 { __proto__: null, default: Ce }, 7135 Symbol.toStringTag, 7136 { value: "Module" }, 7137 ), 7138 ), 7139 be = "inline-media-timeout"; 7140 class xe extends n { 7141 static get LOAD_TIMEOUT_EVENT() { 7142 return be; 7143 } 7144 constructor(e) { 7145 super(e); 7146 var t = this.media.el.dataset; 7147 ((this._timeoutDelay = t.loadTimeout || e.loadTimeout || 3e4), 7148 (this._onLoadStart = this._onLoadStart.bind(this)), 7149 (this._onLoadComplete = this._onLoadComplete.bind(this)), 7150 (this._onTimerComplete = this._onTimerComplete.bind(this)), 7151 this.media.on(a.MEDIA_LOAD_START, this._onLoadStart), 7152 this.media.on(a.MEDIA_LOAD_COMPLETE, this._onLoadComplete)); 7153 } 7154 _onLoadStart() { 7155 (clearTimeout(this._timer), 7156 (this._timer = setTimeout( 7157 this._onTimerComplete, 7158 this._timeoutDelay, 7159 ))); 7160 } 7161 _onLoadComplete() { 7162 clearTimeout(this._timer); 7163 } 7164 _onTimerComplete() { 7165 (this.media.trigger(be), 7166 this.media.destroy(), 7167 this.media.el.parentElement && 7168 this.media.el.parentElement.removeChild(this.media.el)); 7169 } 7170 destroy() { 7171 (clearTimeout(this._timer), 7172 this.media.off(a.MEDIA_LOAD_START, this._onLoadStart)); 7173 } 7174 } 7175 let Se = Object.freeze( 7176 Object.defineProperty( 7177 { __proto__: null, default: xe }, 7178 Symbol.toStringTag, 7179 { value: "Module" }, 7180 ), 7181 ); 7182 return ( 7183 (e.DEFAULT_BREAKPOINT_MAP = fe), 7184 Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), 7185 e 7186 ); 7187 })({})); 7188(document.dispatchEvent( 7189 new CustomEvent("channel:inlineMedia:create", { 7190 detail: { id: "q4BFD08", plugins: ["ViewportSourceOnce"] }, 7191 }), 7192), 7193 document.dispatchEvent( 7194 new CustomEvent("channel:inlineMedia:create", { 7195 detail: { id: "i018BE7", plugins: ["ViewportSourceOnce"] }, 7196 }), 7197 ), 7198 document.dispatchEvent( 7199 new CustomEvent("channel:inlineMedia:create", { 7200 detail: { id: "m8D90CA", plugins: ["ViewportSourceOnce"] }, 7201 }), 7202 ), 7203 (() => { 7204 function e() { 7205 (this._createElements(), this._bindEvents()); 7206 } 7207 var t = e.prototype; 7208 ((t._bindEvents = function () { 7209 this._onResize = this._resize.bind(this); 7210 }), 7211 (t._createElements = function () { 7212 var e; 7213 typeof document < "u" && 7214 !this.span && 7215 ((this.span = document.createElement("span")), 7216 ((e = this.span.style).visibility = "hidden"), 7217 (e.position = "absolute"), 7218 (e.top = "0"), 7219 (e.zIndex = "-1"), 7220 (this.span.innerHTML = " "), 7221 window.ResizeObserver || 7222 ((this.iframe = document.createElement("iframe")), 7223 ((e = this.iframe.style).position = "absolute"), 7224 (e.top = "0"), 7225 (e.left = "0"), 7226 (e.width = "100%"), 7227 (e.height = "100%"), 7228 this.span.appendChild(this.iframe)), 7229 document.body.appendChild(this.span)); 7230 }), 7231 (t.detect = function (e) { 7232 (this._createElements(), 7233 (this.originalSize = e || 16), 7234 (this.currentSize = parseFloat( 7235 window.getComputedStyle(this.span)["font-size"], 7236 )), 7237 this.currentSize > this.originalSize && this._onResize(), 7238 this.isDetecting || 7239 (window.ResizeObserver 7240 ? ((this.resizeObserver = new ResizeObserver(this._onResize)), 7241 this.resizeObserver.observe(this.span)) 7242 : this.iframe.contentWindow.addEventListener( 7243 "resize", 7244 this._onResize, 7245 ), 7246 (this.isDetecting = !0))); 7247 }), 7248 (t._resize = function () { 7249 ((this.currentSize = parseFloat( 7250 window.getComputedStyle(this.span)["font-size"], 7251 )), 7252 this.originalSize < this.currentSize 7253 ? document.documentElement.classList.add("text-zoom") 7254 : document.documentElement.classList.remove("text-zoom"), 7255 window.dispatchEvent(new Event("resize")), 7256 window.dispatchEvent( 7257 new CustomEvent("resize:text-zoom", { detail: this }), 7258 )); 7259 }), 7260 (t.getScale = function () { 7261 return this.currentSize / this.originalSize; 7262 }), 7263 (t.remove = function () { 7264 this.isDetecting && 7265 (this.resizeObserver && this.resizeObserver.unobserve(this.span), 7266 this.iframe && 7267 this.iframe.contentWindow.removeEventListener( 7268 "resize", 7269 this._onResize, 7270 ), 7271 (this.isDetecting = !1)); 7272 }), 7273 (t.destroy = function () { 7274 (this.remove(), 7275 this.span && 7276 this.span.parentElement && 7277 this.span.parentElement.removeChild(this.span), 7278 (this.span = null),
7279 (this.iframe = null), 7280 (this.resizeObserver = null)); 7281 }), 7282 (t.addListener = function (e, t) { 7283 ((this.callbacks[e] = t), 7284 window.addEventListener("resize:text-zoom", t)); 7285 }), 7286 (t.removeListener = function (e) { 7287 this.callbacks[e] && 7288 (window.removeEventListener("resize:text-zoom", this.callbacks[e]), 7289 delete this.callbacks[e]); 7290 }), 7291 (t.callbacks = {}), 7292 (window.textZoom = new e()), 7293 window.textZoom.detect()); 7294 })(), 7295 (() => { 7296 var n, 7297 o, 7298 a, 7299 l, 7300 h, 7301 c, 7302 e = { exports: {} }; 7303 { 7304 class L { 7305 constructor() { 7306 this._events = {}; 7307 } 7308 on(e, t) { 7309 return ( 7310 (this._events[e] = this._events[e] || []), 7311 this._events[e].unshift(t), 7312 t 7313 ); 7314 } 7315 once(t, i) { 7316 let s = (e) => { 7317 (this.off(t, s), void 0 !== e ? i(e) : i()); 7318 }; 7319 return this.on(t, s); 7320 } 7321 off(e, t) { 7322 this.has(e) && 7323 (t 7324 ? -1 !== (t = this._events[e].indexOf(t)) && 7325 this._events[e].splice(t, 1) 7326 : delete this._events[e]); 7327 } 7328 trigger(t, i) { 7329 if (this.has(t)) 7330 for (let e = this._events[t].length - 1; 0 <= e; e--) 7331 void 0 !== i ? this._events[t][e](i) : this._events[t][e](); 7332 } 7333 has(e) { 7334 return e in this._events && 0 !== this._events[e].length; 7335 } 7336 destroy() { 7337 this._events = null; 7338 } 7339 } 7340 e.exports = L.EventEmitterMicro = L; 7341 } 7342 function d() { 7343 return ( 7344 l || 7345 ((l = 1), 7346 (a = { 7347 SharedInstance: 7348 (o || 7349 ((o = 1), 7350 (t = "SharedInstance"), 7351 (r = (e = typeof window < "u" ? window : {}).AC), 7352 (s = {}), 7353 (i = { 7354 get: function (e, t) { 7355 var i = null; 7356 return (i = s[e] && s[e][t] ? s[e][t] : i); 7357 }, 7358 set: function (e, t, i) { 7359 return ( 7360 s[e] || (s[e] = {}), 7361 (s[e][t] = "function" == typeof i ? new i() : i), 7362 s[e][t] 7363 ); 7364 }, 7365 share: function (e, t, i) { 7366 return this.get(e, t) || this.set(e, t, i); 7367 }, 7368 remove: function (e, t) { 7369 var i = typeof t; 7370 if ("string" == i || "number" == i) 7371 return s[e] && s[e][t] ? void (s[e][t] = null) : void 0; 7372 s[e] && (s[e] = null); 7373 }, 7374 }), 7375 (r = r || (e.AC = {}))[t] || (r[t] = i), 7376 (n = r[t])), 7377 n), 7378 })), 7379 a 7380 ); 7381 var e, t, i, s, r; 7382 } 7383 function t() { 7384 if (!c) { 7385 c = 1; 7386 let e = d().SharedInstance, 7387 n = (e) => "" + (e[0].toUpperCase() + e.slice(1)), 7388 i = [ 7389 "before:update", 7390 "update", 7391 "after:update", 7392 "before:draw", 7393 "draw", 7394 "after:draw", 7395 ], 7396 t = (e, r, t) => { 7397 var i = n(t); 7398 ["before" + i, t, "after" + i].forEach((e) => { 7399 let s = e.replace(/[A-Z]/, (e) => ":" + e[0].toLowerCase()); 7400 ((r[e] = (e) => r.once(s, e, !0)), 7401 (r["next" + n(e)] = (e) => { 7402 let t = 0, 7403 i = () => { 7404 if (1 == t++) return (e(), r.off(s, i)); 7405 r.run(); 7406 }; 7407 return r.on(s, i, !0); 7408 }), 7409 (r["cancel" + n(e)] = r["cancelNext" + n(e)] = 7410 (e) => r.off(s, e))); 7411 }); 7412 }; 7413 class r { 7414 constructor() { 7415 ((this.scheduled = !1), (this.e = {})); 7416 } 7417 setExec(e) { 7418 return ( 7419 (this.exec = e), 7420 t(this.exec, this, "update"), 7421 t(this.exec, this, "draw"), 7422 this 7423 ); 7424 } 7425 run() { 7426 this.scheduled || (this.exec.schedule(this), (this.scheduled = !0)); 7427 } 7428 destroy() {
7429 (this.cancel(), Object.freeze((this.e = {}))); 7430 } 7431 cancel() { 7432 ((this.scheduled = !1), this.exec.emitters.delete(this)); 7433 } 7434 on(e, t, i) { 7435 return ( 7436 i && this.run(), 7437 (this.e[e] = this.e[e] || []), 7438 this.e[e].push(t), 7439 t 7440 ); 7441 } 7442 once(e, t, i) { 7443 let s = () => { 7444 (this.off(e, s), t()); 7445 }; 7446 return this.on(e, s, i); 7447 } 7448 has(e) { 7449 return e in this.e && 0 !== this.e[e].size; 7450 } 7451 off(e, t) { 7452 this.has(e) && 7453 (t 7454 ? -1 !== (t = this.e[e].indexOf(t)) && this.e[e].splice(t, 1) 7455 : delete this.e[e]); 7456 } 7457 trigger(t) { 7458 this.has(t) && 7459 this.e[t].slice().forEach((e) => { 7460 this.e[t].includes(e) && e(); 7461 }); 7462 } 7463 } 7464 class o extends r { 7465 constructor() { 7466 (super(), 7467 (this.raf = 7468 typeof window < "u" 7469 ? window.requestAnimationFrame.bind(window) 7470 : () => {}), 7471 (this.emitters = new Set([this])), 7472 this.setExec(this)); 7473 } 7474 cancel() {} 7475 destroy() {} 7476 create() { 7477 return new r().setExec(this); 7478 } 7479 schedule(e) { 7480 (this.emitters.add(e), 7481 this.scheduled || 7482 ((this.scheduled = !0), this.raf(this.perform.bind(this)))); 7483 } 7484 perform() { 7485 this.scheduled = !1; 7486 let e = this.emitters; 7487 ((this.emitters = new Set([this])), 7488 i.forEach((t) => { 7489 e.forEach((e) => { 7490 (t === i[0] && (e.scheduled = !1), e.trigger(t)); 7491 }); 7492 })); 7493 } 7494 } 7495 var s = e.share("RAFEmitter", "1.x", new o()); 7496 h = { 7497 RAFExecutor: s, 7498 beforeUpdate: s.beforeUpdate, 7499 update: s.update, 7500 afterUpdate: s.afterUpdate, 7501 beforeDraw: s.beforeDraw, 7502 draw: s.draw, 7503 afterDraw: s.afterDraw, 7504 nextBeforeUpdate: s.nextBeforeUpdate, 7505 nextUpdate: s.nextUpdate, 7506 nextAfterUpdate: s.nextAfterUpdate, 7507 nextBeforeDraw: s.nextBeforeDraw, 7508 nextDraw: s.nextDraw, 7509 nextAfterDraw: s.nextAfterDraw, 7510 cancelBeforeUpdate: s.cancelBeforeUpdate, 7511 cancelUpdate: s.cancelUpdate, 7512 cancelAfterUpdate: s.cancelAfterUpdate, 7513 cancelBeforeDraw: s.cancelBeforeDraw, 7514 cancelDraw: s.cancelDraw, 7515 cancelAfterDraw: s.cancelAfterDraw, 7516 cancelNextBeforeUpdate: s.cancelNextBeforeUpdate, 7517 cancelNextUpdate: s.cancelNextUpdate, 7518 cancelNextAfterUpdate: s.cancelNextAfterUpdate, 7519 cancelNextBeforeDraw: s.cancelNextBeforeDraw, 7520 cancelNextDraw: s.cancelNextDraw, 7521 cancelNextAfterDraw: s.cancelNextAfterDraw, 7522 }; 7523 } 7524 return h; 7525 } 7526 let i = (e = e.exports).EventEmitterMicro, 7527 s = {}; 7528 typeof window < "u" && 7529 ((s.draw = t().draw), (s.cancelDraw = t().cancelDraw)); 7530 class r extends i { 7531 constructor(e) { 7532 (super(), 7533 (this.index = e.index), 7534 (this.el = e.el), 7535 (this._x = 0), 7536 (this._y = 0), 7537 (this._opacity = 0), 7538 (this._width = 0), 7539 (this._height = 0), 7540 (this._zIndex = 0), 7541 (this.id = this.el.getAttribute("id")), 7542 (this.analyticsId = 7543 this.el.getAttribute("data-analytics-gallery-item-id") || 7544 this.el.getAttribute("id")), 7545 (this.applyDraw = this.applyDraw.bind(this)), 7546 this.measure()); 7547 } 7548 measure() { 7549 var e = getComputedStyle(this.el); 7550 ((this._width = this.el.clientWidth), 7551 (this._height = this.el.clientHeight), 7552 (this._zIndex = parseInt(e.getPropertyValue("z-index"))), 7553 (this._opacity = parseFloat(e.getPropertyValue("opacity")))); 7554 } 7555 select() { 7556 (this.el.classList.add("current"), this.trigger("select", this)); 7557 } 7558 deselect() { 7559 (this.el.classList.remove("current"), this.trigger("deselect", this)); 7560 } 7561 progress(e) {} 7562 needsRedraw() { 7563 (s.cancelDraw(this.applyDraw), s.draw(this.applyDraw)); 7564 } 7565 applyDraw() { 7566 ((this.el.style.zIndex = this._zIndex), 7567 (this.el.style.opacity = this._opacity), 7568 (this.el.style.transform = `translate(${this._x}px, ${this._y}px)`)); 7569 } 7570 get height() { 7571 return this._height; 7572 } 7573 set height(e) { 7574 ((this._height = e), this.needsRedraw()); 7575 } 7576 get width() { 7577 return this._width; 7578 } 7579 set width(e) { 7580 ((this._width = e), this.needsRedraw()); 7581 } 7582 get x() { 7583 return this._x; 7584 } 7585 set x(e) { 7586 ((this._x = e), this.needsRedraw()); 7587 } 7588 get y() { 7589 return this._y; 7590 } 7591 set y(e) { 7592 ((this._y = e), this.needsRedraw()); 7593 } 7594 get opacity() { 7595 return this._opacity; 7596 }
7597 set opacity(e) { 7598 ((this._opacity = e), this.needsRedraw()); 7599 } 7600 get zIndex() { 7601 return this._zIndex; 7602 } 7603 set zIndex(e) { 7604 ((this._zIndex = e), this.needsRedraw()); 7605 } 7606 } 7607 function u() { 7608 this.focusableSelectors = _.selectors; 7609 } 7610 function p(e, t) { 7611 var i; 7612 e.getAttribute(b + t) || 7613 ((i = e.getAttribute(t) || ""), e.setAttribute(b + t, i)); 7614 } 7615 function m(e, t) { 7616 var i = e.getAttribute(M + t); 7617 null !== i && ("" === i ? S(e, t) : e.setAttribute(t, i), S(e, M + t)); 7618 } 7619 var g = { 7620 PrefersReducedMotion: !1, 7621 IsRTL: !1, 7622 IsTouch: !1, 7623 Slide: { Selector: ".item-container", duration: 1 }, 7624 Fade: { duration: 0.5 }, 7625 Item: { 7626 Selector: ".item-container .gallery-item", 7627 ConstructorFunction: r, 7628 }, 7629 DotNav: { Selector: ".dotnav" }, 7630 PaddleNav: { Selector: ".paddlenav" }, 7631 ChapterPlayer: { defaultEase: (e) => e }, 7632 FadeCaptionOnChange: { 7633 ItemSelector: ".captions-gallery [data-captions-gallery-item]", 7634 }, 7635 TabNav: { 7636 ItemSelector: ".tablist-wrapper li", 7637 RoamingTabIndexSelector: "a", 7638 }, 7639 SwipeDetect: { 7640 DesktopSwipe: !1, 7641 LimitIndexChange: !0, 7642 movementRateMultiplier: 1.5, 7643 velocityMultiplier: 8, 7644 }, 7645 SwipeDrag: { 7646 DesktopSwipe: !1, 7647 movementRateMultiplier: 1.5, 7648 velocityMultiplier: 8, 7649 }, 7650 InitialIndexFromHashLink: { Enabled: !1, ScrollReset: !1 }, 7651 Scroll: { ClientWidthCssVar: !1 }, 7652 Theme: { classPrefix: "theme" }, 7653 Events: { 7654 ITEM_CHANGE_INITIATED: "ITEM_CHANGE_INITIATED", 7655 ITEM_CHANGE_OCCURRED: "ITEM_CHANGE_OCCURRED", 7656 ITEM_CHANGE_COMPLETED: "ITEM_CHANGE_COMPLETED", 7657 }, 7658 }, 7659 f = { 7660 beforeCreate() { 7661 Object.defineProperties(this, { 7662 currentItem: { 7663 configurable: !0, 7664 get: () => this._items[this.wrappedIndex(this.currentIndex)], 7665 }, 7666 }); 7667 }, 7668 wrappedIndex(e) { 7669 return (e %= this._items.length) < 0 ? this._items.length + e : e; 7670 }, 7671 getItemForTrigger(t) { 7672 return this._items.find((e) => e.id === t); 7673 }, 7674 }, 7675 v = { 7676 itemsCreated(e) { 7677 this.model.options.gum || 7678 this._isVue || 7679 (this.anim.on("ON_RESIZE_IMMEDIATE", this.onResizeImmediate), 7680 this.anim.on("ON_RESIZE_DEBOUNCED", this.onResizeDebounced), 7681 this.anim.on("ON_BREAKPOINT_CHANGE", this.onBreakpointChange), 7682 requestAnimationFrame(this.mounted)); 7683 }, 7684 destroy() { 7685 this.model.options.gum || 7686 this._isVue || 7687 (this.anim.off("ON_RESIZE_IMMEDIATE", this.onResizeImmediate), 7688 this.anim.off("ON_RESIZE_DEBOUNCED", this.onResizeDebounced), 7689 this.anim.off("ON_BREAKPOINT_CHANGE", this.onBreakpointChange)); 7690 }, 7691 }, 7692 y = { 7693 beforeCreate() { 7694 document.body._animInfo && 7695 ((this.anim = document.body._animInfo.group.anim), 7696 (this.model.pageMetrics = this.anim.model.pageMetrics)); 7697 }, 7698 addKeyframe(e) { 7699 var t = e.el || this.el; 7700 return (e.group || this.anim).addKeyframe(t, e); 7701 }, 7702 addDiscreteEvent(e) { 7703 e.event = e.event || "Generic-Event-Name-" + tmpUUID++; 7704 var t = void 0 !== e.end && e.end !== e.start, 7705 i = this.addKeyframe(e); 7706 return ( 7707 t 7708 ? (e.onEnterOnce && 7709 i.controller.once(e.event + ":enter", e.onEnterOnce), 7710 e.onExitOnce && 7711 i.controller.once(e.event + ":exit", e.onExitOnce), 7712 e.onEnter && i.controller.on(e.event + ":enter", e.onEnter), 7713 e.onExit && i.controller.on(e.event + ":exit", e.onExit)) 7714 : (e.onEventOnce && i.controller.once(e.event, e.onEventOnce), 7715 e.onEventReverseOnce && 7716 i.controller.once(e.event + ":reverse", e.onEventReverseOnce), 7717 e.onEvent && i.controller.on(e.event, e.onEvent), 7718 e.onEventReverse && 7719 i.controller.on(e.event + ":reverse", e.onEventReverse)), 7720 i 7721 ); 7722 }, 7723 addRAFLoop(s) { 7724 var e = ["start", "end"]; 7725 if (e.every((e) => s.hasOwnProperty(e))) { 7726 let e = new RAFEmitter.create(), 7727 { onEnter: t, onExit: i } =
7728 (e.on("update", s.onUpdate || noop), 7729 e.on("draw", s.onDraw || noop), 7730 e.on("draw", () => e.run()), 7731 s); 7732 return ( 7733 (s.onEnter = () => { 7734 (e.run(), t && t()); 7735 }), 7736 (s.onExit = () => { 7737 (e.cancel(), i && i()); 7738 }), 7739 this.addDiscreteEvent(s) 7740 ); 7741 } 7742 console.log( 7743 "BubbleGum.BaseComponent::addRAFLoop required options are missing: " + 7744 e.join(" "), 7745 ); 7746 }, 7747 addContinuousEvent(e) { 7748 (e.onDraw || 7749 console.log( 7750 "BubbleGum.BaseComponent::addContinuousEvent required option `onDraw` is missing. Consider using a regular keyframe if you do not need a callback", 7751 ), 7752 (e.event = e.event || "Generic-Event-Name-" + tmpUUID++)); 7753 var t = this.addKeyframe(e); 7754 return (t.controller.on(e.event, e.onDraw), t); 7755 }, 7756 }, 7757 R = { 7758 createItems(e) { 7759 if (!this._items.length) { 7760 if (!this.model.Item.ConstructorFunction) 7761 throw new ReferenceError( 7762 "MixinGallery::AutoCreateItems - this.model.Item.ConstructorFunction is null", 7763 ); 7764 if (0 === this._items.length) { 7765 ((this._items = []), 7766 Array.from( 7767 this.el.querySelectorAll(this.model.Item.Selector), 7768 ).forEach((e, t) => { 7769 e = new this.model.Item.ConstructorFunction({ 7770 el: e, 7771 index: t, 7772 }); 7773 this._items.push(e); 7774 })); 7775 let t = this._items[this._items.length - 1]; 7776 for (let e = 0; e < this._items.length; e++) { 7777 var i = this._items[e]; 7778 ((i.prev = t), (i.next = this._items[e + 1]), (t = i)); 7779 } 7780 t.next = this._items[0]; 7781 } 7782 } 7783 this.itemsCreated(e); 7784 }, 7785 }, 7786 w = { HIDDEN: "aria-hidden" }, 7787 _ = { 7788 selectors: [ 7789 "input", 7790 "select", 7791 "textarea", 7792 "button", 7793 "optgroup", 7794 "option", 7795 "menuitem", 7796 "fieldset", 7797 "object", 7798 "a[href]", 7799 "[tabindex]", 7800 "[contenteditable]", 7801 ].join(","), 7802 nodeName: { 7803 INPUT: "input", 7804 SELECT: "select", 7805 TEXTAREA: "textarea", 7806 BUTTON: "button", 7807 OPTGROUP: "optgroup", 7808 OPTION: "option", 7809 MENUITEM: "menuitem", 7810 FIELDSET: "fieldset", 7811 OBJECT: "object", 7812 A: "a", 7813 }, 7814 }, 7815 A = 7816 (((A = u.prototype).isFocusableElement = function (e, t, i) { 7817 return !( 7818 (t && !this._isDisplayed(e)) || 7819 (_.nodeName[e.nodeName] 7820 ? e.disabled 7821 : e.contentEditable && 7822 ((i = i || parseFloat(e.getAttribute("tabindex"))), isNaN(i))) 7823 ); 7824 }), 7825 (A.isTabbableElement = function (e, t) { 7826 var i; 7827 return ( 7828 !(t && !this._isDisplayed(e)) && 7829 ((i = e.getAttribute("tabindex")), 7830 (i = parseFloat(i)), 7831 isNaN(i) ? this.isFocusableElement(e, t, i) : 0 <= i) 7832 ); 7833 }), 7834 (A._isDisplayed = function (e) { 7835 var t = e.getBoundingClientRect(); 7836 return ( 7837 (0 !== t.top || 0 !== t.left || 0 !== t.width || 0 !== t.height) && 7838 "hidden" !== window.getComputedStyle(e).visibility 7839 ); 7840 }), 7841 (A.getTabbableElements = function (e, t) { 7842 for ( 7843 var i = e.querySelectorAll(this.focusableSelectors), 7844 s = i.length, 7845 r = [], 7846 n = 0; 7847 n < s; 7848 n++ 7849 ) 7850 this.isTabbableElement(i[n], t) && r.push(i[n]); 7851 return r; 7852 }), 7853 (A.getFocusableElements = function (e, t) { 7854 for ( 7855 var i = e.querySelectorAll(this.focusableSelectors), 7856 s = i.length, 7857 r = [], 7858 n = 0; 7859 n < s; 7860 n++ 7861 ) 7862 this.isFocusableElement(i[n], t) && r.push(i[n]); 7863 return r; 7864 }), 7865 new u()), 7866 C = w, 7867 E = A, 7868 b = "data-original-", 7869 x = "tabindex", 7870 S = function (e, i) { 7871 let t; 7872 ((t = e instanceof NodeList ? e : [].concat(e)), 7873 (i = Array.isArray(i) ? i : [].concat(i)), 7874 t.forEach((t) => {
7875 i.forEach((e) => { 7876 t.removeAttribute(e); 7877 }); 7878 })); 7879 }, 7880 N = w, 7881 M = "data-original-", 7882 T = "tabindex"; 7883 let I = function (e, t) { 7884 if (E.isFocusableElement(e, t)) (p(e, x), e.setAttribute(x, "-1")); 7885 else 7886 for (var i = E.getTabbableElements(e, t), s = i.length; s--; ) 7887 (p(i[s], x), i[s].setAttribute(x, "-1")); 7888 (p(e, C.HIDDEN), e.setAttribute(C.HIDDEN, "true")); 7889 }, 7890 O = function (e) { 7891 (m(e, T), m(e, N.HIDDEN)); 7892 for (var t = e.querySelectorAll(`[${M + T}]`), i = t.length; i--; ) 7893 m(t[i], T); 7894 }, 7895 F = { 7896 itemsCreated(e) { 7897 this._items.forEach((e, t) => { 7898 (t === this.wrappedIndex(this.currentIndex) ? O : I)(e.el); 7899 }); 7900 }, 7901 onItemChangeCompleted(e) { 7902 var { previous: t, current: i } = this.selections.completed; 7903 (t && t !== i && I(t.el), O(i.el)); 7904 }, 7905 }, 7906 B = { 7907 itemsCreated() { 7908 if (this.model.InitialIndexFromHashLink.Enabled && this._items) { 7909 let t = location.hash.slice(1); 7910 var e; 7911 t && 7912 -1 < (e = this._items.findIndex(({ id: e }) => e === t)) && 7913 ((this.currentIndex = e), 7914 this.model.InitialIndexFromHashLink.ScrollReset) && 7915 this._resetHorizontalScrollPosition(); 7916 } 7917 }, 7918 _resetHorizontalScrollPosition(e) { 7919 e = e || this.el; 7920 0 !== e.scrollLeft 7921 ? (e.scrollLeft = 0) 7922 : e !== document.body && 7923 this._resetHorizontalScrollPosition(e.parentNode); 7924 }, 7925 }, 7926 P = e, 7927 D = g, 7928 U = f, 7929 G = v, 7930 K = y, 7931 H = { 7932 beforeCreate() { 7933 this.selections = { 7934 initiated: { current: null, previous: null }, 7935 occurred: { current: null, previous: null }, 7936 completed: { current: null, previous: null }, 7937 }; 7938 }, 7939 onItemChangeInitiated(e) { 7940 ((this.selections.initiated.previous = 7941 this.selections.initiated.current), 7942 (this.selections.initiated.current = 7943 this.selections.initiated.next), 7944 (this.selections.initiated.next = e.next)); 7945 }, 7946 onItemChangeOccurred(e) { 7947 ((this.selections.occurred.previous = e.previous = 7948 this.selections.occurred.current), 7949 (this.selections.occurred.current = e.current)); 7950 }, 7951 onItemChangeCompleted(e) { 7952 ((this.selections.completed.previous = e.previous = 7953 this.selections.completed.current), 7954 (this.selections.completed.current = e.current)); 7955 }, 7956 }, 7957 W = R, 7958 z = { 7959 mounted() { 7960 var e = this._items[this.wrappedIndex(this.currentIndex)]; 7961 (this.trigger(this.model.Events.ITEM_CHANGE_INITIATED, { 7962 gallery: this, 7963 next: e, 7964 }), 7965 this.trigger(this.model.Events.ITEM_CHANGE_OCCURRED, { 7966 gallery: this, 7967 current: e, 7968 }), 7969 this.trigger(this.model.Events.ITEM_CHANGE_COMPLETED, { 7970 gallery: this, 7971 current: e, 7972 })); 7973 }, 7974 }, 7975 q = F, 7976 Y = B, 7977 V = [ 7978 "beforeCreate", 7979 "created", 7980 "beforeMount", 7981 "createItems", 7982 "itemsCreated", 7983 "mounted", 7984 "animateToItem", 7985 "onItemChangeInitiated", 7986 "onItemChangeOccurred", 7987 "onItemChangeCompleted", 7988 "onResizeImmediate", 7989 "onBreakpointChange", 7990 "onResizeDebounced", 7991 "destroy", 7992 ]; 7993 class k extends P { 7994 constructor(t) { 7995 (super(t), 7996 (this.el = t.el), 7997 (this.model = Object.assign( 7998 { options: t }, 7999 JSON.parse(JSON.stringify(D)), 8000 )), 8001 (this.model.Item.ConstructorFunction = D.Item.ConstructorFunction), 8002 (this._items = []), 8003 (this.currentIndex = 0),
8004 V.forEach((e) => { 8005 this[e] = (...t) => { 8006 this["__" + e] && this["__" + e].forEach((e) => e.apply(this, t)); 8007 }; 8008 })); 8009 let i = this.destroy; 8010 ((this.destroy = (...e) => { 8011 (i.apply(this, e), P.prototype.destroy.call(this)); 8012 }), 8013 this.on(D.Events.ITEM_CHANGE_INITIATED, this.onItemChangeInitiated), 8014 this.on(D.Events.ITEM_CHANGE_OCCURRED, this.onItemChangeOccurred), 8015 this.on(D.Events.ITEM_CHANGE_COMPLETED, this.onItemChangeCompleted), 8016 ["beforeCreate", "created", "beforeMount", "createItems"].forEach( 8017 (e) => this[e](t), 8018 )); 8019 } 8020 } 8021 ((k.withMixins = (...e) => { 8022 var t = e.findIndex((e) => "excluding" in e); 8023 let i = new Set(), 8024 s = 8025 (0 <= t && (e[t].excluding.forEach((e) => i.add(e)), e.splice(t)), 8026 class extends k {}), 8027 r = s.prototype; 8028 var t = [U, H, K, Y].filter((e) => !i.has(e)), 8029 n = [W, q, G, z].filter((e) => !i.has(e)); 8030 return ( 8031 e.unshift(...t), 8032 e.push(...n), 8033 e.forEach((e) => { 8034 for (var t in e) 8035 V.includes(t) 8036 ? ((r["__" + t] = r["__" + t] || []), r["__" + t].push(e[t])) 8037 : (r[t] = e[t]); 8038 }), 8039 s 8040 ); 8041 }), 8042 (A = k), 8043 (e = 8044 (w = A) && 8045 w.__esModule && 8046 Object.prototype.hasOwnProperty.call(w, "default") 8047 ? w.default 8048 : w), 8049 typeof window < "u" && 8050 ((window.channelHtml18pro = window.channelHtml18pro || {}), 8051 (window.channelHtml18pro.MixinGallery = e))); 8052 })(), 8053 (() => { 8054 var n, 8055 o, 8056 a, 8057 l, 8058 h, 8059 c, 8060 e = { exports: {} }; 8061 { 8062 class u { 8063 constructor() { 8064 this._events = {}; 8065 } 8066 on(e, t) { 8067 return ( 8068 (this._events[e] = this._events[e] || []), 8069 this._events[e].unshift(t), 8070 t 8071 ); 8072 } 8073 once(t, i) { 8074 let s = (e) => { 8075 (this.off(t, s), void 0 !== e ? i(e) : i()); 8076 }; 8077 return this.on(t, s); 8078 } 8079 off(e, t) { 8080 this.has(e) && 8081 (t 8082 ? -1 !== (t = this._events[e].indexOf(t)) && 8083 this._events[e].splice(t, 1) 8084 : delete this._events[e]); 8085 } 8086 trigger(t, i) { 8087 if (this.has(t)) 8088 for (let e = this._events[t].length - 1; 0 <= e; e--) 8089 void 0 !== i ? this._events[t][e](i) : this._events[t][e](); 8090 } 8091 has(e) { 8092 return e in this._events && 0 !== this._events[e].length; 8093 } 8094 destroy() { 8095 this._events = null; 8096 } 8097 } 8098 e.exports = u.EventEmitterMicro = u; 8099 } 8100 function d() { 8101 return ( 8102 l || 8103 ((l = 1), 8104 (a = { 8105 SharedInstance: 8106 (o || 8107 ((o = 1), 8108 (t = "SharedInstance"), 8109 (r = (e = typeof window < "u" ? window : {}).AC), 8110 (s = {}), 8111 (i = { 8112 get: function (e, t) { 8113 var i = null; 8114 return (i = s[e] && s[e][t] ? s[e][t] : i); 8115 }, 8116 set: function (e, t, i) { 8117 return ( 8118 s[e] || (s[e] = {}), 8119 (s[e][t] = "function" == typeof i ? new i() : i), 8120 s[e][t] 8121 ); 8122 }, 8123 share: function (e, t, i) { 8124 return this.get(e, t) || this.set(e, t, i); 8125 }, 8126 remove: function (e, t) { 8127 var i = typeof t; 8128 if ("string" == i || "number" == i) 8129 return s[e] && s[e][t] ? void (s[e][t] = null) : void 0; 8130 s[e] && (s[e] = null); 8131 }, 8132 }), 8133 (r = r || (e.AC = {}))[t] || (r[t] = i), 8134 (n = r[t])), 8135 n), 8136 })), 8137 a 8138 ); 8139 var e, t, i, s, r; 8140 } 8141 function t() { 8142 if (!c) { 8143 c = 1; 8144 let e = d().SharedInstance, 8145 n = (e) => "" + (e[0].toUpperCase() + e.slice(1)), 8146 i = [ 8147 "before:update", 8148 "update", 8149 "after:update", 8150 "before:draw", 8151 "draw", 8152 "after:draw", 8153 ], 8154 t = (e, r, t) => { 8155 var i = n(t);
8156 ["before" + i, t, "after" + i].forEach((e) => { 8157 let s = e.replace(/[A-Z]/, (e) => ":" + e[0].toLowerCase()); 8158 ((r[e] = (e) => r.once(s, e, !0)), 8159 (r["next" + n(e)] = (e) => { 8160 let t = 0, 8161 i = () => { 8162 if (1 == t++) return (e(), r.off(s, i)); 8163 r.run(); 8164 }; 8165 return r.on(s, i, !0); 8166 }), 8167 (r["cancel" + n(e)] = r["cancelNext" + n(e)] = 8168 (e) => r.off(s, e))); 8169 }); 8170 }; 8171 class r { 8172 constructor() { 8173 ((this.scheduled = !1), (this.e = {})); 8174 } 8175 setExec(e) { 8176 return ( 8177 (this.exec = e), 8178 t(this.exec, this, "update"), 8179 t(this.exec, this, "draw"), 8180 this 8181 ); 8182 } 8183 run() { 8184 this.scheduled || (this.exec.schedule(this), (this.scheduled = !0)); 8185 } 8186 destroy() { 8187 (this.cancel(), Object.freeze((this.e = {}))); 8188 } 8189 cancel() { 8190 ((this.scheduled = !1), this.exec.emitters.delete(this)); 8191 } 8192 on(e, t, i) { 8193 return ( 8194 i && this.run(), 8195 (this.e[e] = this.e[e] || []), 8196 this.e[e].push(t), 8197 t 8198 ); 8199 } 8200 once(e, t, i) { 8201 let s = () => { 8202 (this.off(e, s), t()); 8203 }; 8204 return this.on(e, s, i); 8205 } 8206 has(e) { 8207 return e in this.e && 0 !== this.e[e].size; 8208 } 8209 off(e, t) { 8210 this.has(e) && 8211 (t 8212 ? -1 !== (t = this.e[e].indexOf(t)) && this.e[e].splice(t, 1) 8213 : delete this.e[e]); 8214 } 8215 trigger(t) { 8216 this.has(t) && 8217 this.e[t].slice().forEach((e) => { 8218 this.e[t].includes(e) && e(); 8219 }); 8220 } 8221 } 8222 class o extends r { 8223 constructor() { 8224 (super(), 8225 (this.raf = 8226 typeof window < "u" 8227 ? window.requestAnimationFrame.bind(window) 8228 : () => {}), 8229 (this.emitters = new Set([this])), 8230 this.setExec(this)); 8231 } 8232 cancel() {} 8233 destroy() {} 8234 create() { 8235 return new r().setExec(this); 8236 } 8237 schedule(e) { 8238 (this.emitters.add(e), 8239 this.scheduled || 8240 ((this.scheduled = !0), this.raf(this.perform.bind(this)))); 8241 } 8242 perform() { 8243 this.scheduled = !1; 8244 let e = this.emitters; 8245 ((this.emitters = new Set([this])), 8246 i.forEach((t) => { 8247 e.forEach((e) => { 8248 (t === i[0] && (e.scheduled = !1), e.trigger(t)); 8249 }); 8250 })); 8251 } 8252 } 8253 var s = e.share("RAFEmitter", "1.x", new o()); 8254 h = { 8255 RAFExecutor: s, 8256 beforeUpdate: s.beforeUpdate, 8257 update: s.update, 8258 afterUpdate: s.afterUpdate, 8259 beforeDraw: s.beforeDraw, 8260 draw: s.draw, 8261 afterDraw: s.afterDraw, 8262 nextBeforeUpdate: s.nextBeforeUpdate, 8263 nextUpdate: s.nextUpdate, 8264 nextAfterUpdate: s.nextAfterUpdate, 8265 nextBeforeDraw: s.nextBeforeDraw, 8266 nextDraw: s.nextDraw, 8267 nextAfterDraw: s.nextAfterDraw, 8268 cancelBeforeUpdate: s.cancelBeforeUpdate, 8269 cancelUpdate: s.cancelUpdate, 8270 cancelAfterUpdate: s.cancelAfterUpdate, 8271 cancelBeforeDraw: s.cancelBeforeDraw, 8272 cancelDraw: s.cancelDraw, 8273 cancelAfterDraw: s.cancelAfterDraw, 8274 cancelNextBeforeUpdate: s.cancelNextBeforeUpdate, 8275 cancelNextUpdate: s.cancelNextUpdate, 8276 cancelNextAfterUpdate: s.cancelNextAfterUpdate, 8277 cancelNextBeforeDraw: s.cancelNextBeforeDraw, 8278 cancelNextDraw: s.cancelNextDraw, 8279 cancelNextAfterDraw: s.cancelNextAfterDraw, 8280 }; 8281 } 8282 return h; 8283 } 8284 let i = e.exports.EventEmitterMicro, 8285 s = {}; 8286 typeof window < "u" && 8287 ((s.draw = t().draw), (s.cancelDraw = t().cancelDraw)); 8288 class r extends i { 8289 constructor(e) { 8290 (super(), 8291 (this.index = e.index), 8292 (this.el = e.el), 8293 (this._x = 0), 8294 (this._y = 0), 8295 (this._opacity = 0), 8296 (this._width = 0), 8297 (this._height = 0), 8298 (this._zIndex = 0), 8299 (this.id = this.el.getAttribute("id")), 8300 (this.analyticsId = 8301 this.el.getAttribute("data-analytics-gallery-item-id") || 8302 this.el.getAttribute("id")), 8303 (this.applyDraw = this.applyDraw.bind(this)), 8304 this.measure()); 8305 } 8306 measure() { 8307 var e = getComputedStyle(this.el); 8308 ((this._width = this.el.clientWidth), 8309 (this._height = this.el.clientHeight), 8310 (this._zIndex = parseInt(e.getPropertyValue("z-index"))), 8311 (this._opacity = parseFloat(e.getPropertyValue("opacity")))); 8312 } 8313 select() { 8314 (this.el.classList.add("current"), this.trigger("select", this)); 8315 } 8316 deselect() { 8317 (this.el.classList.remove("current"), this.trigger("deselect", this)); 8318 } 8319 progress(e) {} 8320 needsRedraw() { 8321 (s.cancelDraw(this.applyDraw), s.draw(this.applyDraw)); 8322 } 8323 applyDraw() { 8324 ((this.el.style.zIndex = this._zIndex), 8325 (this.el.style.opacity = this._opacity), 8326 (this.el.style.transform = `translate(${this._x}px, ${this._y}px)`)); 8327 } 8328 get height() { 8329 return this._height; 8330 } 8331 set height(e) { 8332 ((this._height = e), this.needsRedraw()); 8333 } 8334 get width() { 8335 return this._width; 8336 } 8337 set width(e) { 8338 ((this._width = e), this.needsRedraw()); 8339 } 8340 get x() { 8341 return this._x; 8342 } 8343 set x(e) { 8344 ((this._x = e), this.needsRedraw()); 8345 } 8346 get y() { 8347 return this._y; 8348 } 8349 set y(e) { 8350 ((this._y = e), this.needsRedraw()); 8351 } 8352 get opacity() { 8353 return this._opacity; 8354 }
8355 set opacity(e) { 8356 ((this._opacity = e), this.needsRedraw()); 8357 } 8358 get zIndex() { 8359 return this._zIndex; 8360 } 8361 set zIndex(e) { 8362 ((this._zIndex = e), this.needsRedraw()); 8363 } 8364 } 8365 ((e = 8366 (e = { 8367 PrefersReducedMotion: !1, 8368 IsRTL: !1, 8369 IsTouch: !1, 8370 Slide: { Selector: ".item-container", duration: 1 }, 8371 Fade: { duration: 0.5 }, 8372 Item: { 8373 Selector: ".item-container .gallery-item", 8374 ConstructorFunction: r, 8375 }, 8376 DotNav: { Selector: ".dotnav" }, 8377 PaddleNav: { Selector: ".paddlenav" }, 8378 ChapterPlayer: { defaultEase: (e) => e }, 8379 FadeCaptionOnChange: { 8380 ItemSelector: ".captions-gallery [data-captions-gallery-item]", 8381 }, 8382 TabNav: { 8383 ItemSelector: ".tablist-wrapper li", 8384 RoamingTabIndexSelector: "a", 8385 }, 8386 SwipeDetect: { 8387 DesktopSwipe: !1, 8388 LimitIndexChange: !0, 8389 movementRateMultiplier: 1.5, 8390 velocityMultiplier: 8, 8391 }, 8392 SwipeDrag: { 8393 DesktopSwipe: !1, 8394 movementRateMultiplier: 1.5, 8395 velocityMultiplier: 8, 8396 }, 8397 InitialIndexFromHashLink: { Enabled: !1, ScrollReset: !1 }, 8398 Scroll: { ClientWidthCssVar: !1 }, 8399 Theme: { classPrefix: "theme" }, 8400 Events: { 8401 ITEM_CHANGE_INITIATED: "ITEM_CHANGE_INITIATED", 8402 ITEM_CHANGE_OCCURRED: "ITEM_CHANGE_OCCURRED", 8403 ITEM_CHANGE_COMPLETED: "ITEM_CHANGE_COMPLETED", 8404 }, 8405 }) && 8406 e.__esModule && 8407 Object.prototype.hasOwnProperty.call(e, "default") 8408 ? e.default 8409 : e), 8410 typeof window < "u" && 8411 ((window.channelHtml18pro = window.channelHtml18pro || {}), 8412 (window.channelHtml18pro.GalleryModel = e))); 8413 })(), 8414 (() => { 8415 function e() { 8416 this._events = {}; 8417 } 8418 var s; 8419 (((c = e.prototype).on = function (e, t) { 8420 return ( 8421 (this._events[e] = this._events[e] || []), 8422 this._events[e].unshift(t), 8423 t 8424 ); 8425 }), 8426 (c.once = function (i, s) { 8427 let r = this; 8428 return this.on(i, function e(t) { 8429 (r.off(i, e), void 0 !== t ? s(t) : s()); 8430 }); 8431 }), 8432 (c.off = function (e, t) { 8433 this.has(e) && 8434 (1 === arguments.length 8435 ? ((this._events[e] = null), delete this._events[e]) 8436 : -1 !== (t = this._events[e].indexOf(t)) && 8437 this._events[e].splice(t, 1)); 8438 }), 8439 (c.trigger = function (t, i) { 8440 if (this.has(t)) 8441 for (let e = this._events[t].length - 1; 0 <= e; e--) 8442 void 0 !== i ? this._events[t][e](i) : this._events[t][e](); 8443 }), 8444 (c.has = function (e) { 8445 return !(!(e in this._events) || 0 === this._events[e].length); 8446 }), 8447 (c.destroy = function () { 8448 for (var e in this._events) this._events[e] = null; 8449 this._events = null; 8450 })); 8451 var t = { EventEmitterMicro: (c = e) }, 8452 i = typeof window < "u" ? window : {}, 8453 r = "SharedInstance", 8454 n = i.AC, 8455 o = 8456 ((s = {}), 8457 { 8458 get: function (e, t) { 8459 var i = null; 8460 return (i = s[e] && s[e][t] ? s[e][t] : i); 8461 }, 8462 set: function (e, t, i) { 8463 return ( 8464 s[e] || (s[e] = {}), 8465 (s[e][t] = "function" == typeof i ? new i() : i), 8466 s[e][t] 8467 ); 8468 }, 8469 share: function (e, t, i) { 8470 return this.get(e, t) || this.set(e, t, i); 8471 }, 8472 remove: function (e, t) { 8473 var i = typeof t; 8474 if ("string" == i || "number" == i) 8475 return s[e] && s[e][t] ? void (s[e][t] = null) : void 0; 8476 s[e] && (s[e] = null); 8477 }, 8478 }), 8479 i = ((n = n || (i.AC = {}))[r] || (n[r] = o), { SharedInstance: n[r] }), 8480 o = "3.x", 8481 a = c; 8482 function l(e) { 8483 (this._reset(), 8484 this.updatePhases(), 8485 (this.eventEmitter = new a()), 8486 (this._willRun = !1), 8487 (this._totalSubscribeCount = -1)); 8488 var t = null, 8489 i = null; 8490 (typeof window < "u" 8491 ? ((t = window.requestAnimationFrame), 8492 (i = window.cancelAnimationFrame)) 8493 : (t = i = function () {}), 8494 (this._requestAnimationFrame = t), 8495 (this._cancelAnimationFrame = i), 8496 (this._boundOnAnimationFrame = this._onAnimationFrame.bind(this)), 8497 (this._boundOnExternalAnimationFrame = 8498 this._onExternalAnimationFrame.bind(this))); 8499 } 8500 function h() { 8501 this._currentID = 0; 8502 } 8503 (((n = l.prototype).frameRequestedPhase = "requested"),
8504 (n.startPhase = "start"), 8505 (n.runPhases = ["update", "external", "draw"]), 8506 (n.endPhase = "end"), 8507 (n.disabledPhase = "disabled"), 8508 (n.beforePhaseEventPrefix = "before:"), 8509 (n.afterPhaseEventPrefix = "after:"), 8510 (n.subscribe = function (e, t) { 8511 return ( 8512 this._totalSubscribeCount++, 8513 this._nextFrameSubscribers[e.id] || 8514 (t 8515 ? this._nextFrameSubscribersOrder.unshift(e.id) 8516 : this._nextFrameSubscribersOrder.push(e.id), 8517 (this._nextFrameSubscribers[e.id] = e), 8518 this._nextFrameSubscriberArrayLength++, 8519 this._nextFrameSubscriberCount++, 8520 this._run()), 8521 this._totalSubscribeCount 8522 ); 8523 }), 8524 (n.subscribeImmediate = function (e, t) { 8525 return ( 8526 this._totalSubscribeCount++, 8527 this._subscribers[e.id] || 8528 (t 8529 ? this._subscribersOrder.splice( 8530 this._currentSubscriberIndex + 1, 8531 0, 8532 e.id, 8533 ) 8534 : this._subscribersOrder.unshift(e.id), 8535 (this._subscribers[e.id] = e), 8536 this._subscriberArrayLength++, 8537 this._subscriberCount++), 8538 this._totalSubscribeCount 8539 ); 8540 }), 8541 (n.unsubscribe = function (e) { 8542 return ( 8543 !!this._nextFrameSubscribers[e.id] && 8544 ((this._nextFrameSubscribers[e.id] = null), 8545 this._nextFrameSubscriberCount--, 8546 0 === this._nextFrameSubscriberCount && this._cancel(), 8547 !0) 8548 ); 8549 }), 8550 (n.getSubscribeID = function () { 8551 return (this._totalSubscribeCount += 1); 8552 }), 8553 (n.destroy = function () { 8554 var e = this._cancel(); 8555 return ( 8556 this.eventEmitter.destroy(), 8557 (this.eventEmitter = null), 8558 (this.phases = null), 8559 (this._subscribers = null), 8560 (this._subscribersOrder = null), 8561 (this._nextFrameSubscribers = null), 8562 (this._nextFrameSubscribersOrder = null), 8563 (this._rafData = null), 8564 (this._boundOnAnimationFrame = null), 8565 (this._onExternalAnimationFrame = null), 8566 e 8567 ); 8568 }), 8569 (n.useExternalAnimationFrame = function (e) { 8570 var t; 8571 if ("boolean" == typeof e) 8572 return ( 8573 (t = this._isUsingExternalAnimationFrame), 8574 e && 8575 this._animationFrame && 8576 (this._cancelAnimationFrame.call(window, this._animationFrame), 8577 (this._animationFrame = null)), 8578 !this._willRun || 8579 e || 8580 this._animationFrame || 8581 (this._animationFrame = this._requestAnimationFrame.call( 8582 window, 8583 this._boundOnAnimationFrame, 8584 )), 8585 (this._isUsingExternalAnimationFrame = e) 8586 ? this._boundOnExternalAnimationFrame 8587 : t || !1 8588 ); 8589 }), 8590 (n.updatePhases = function () { 8591 (this.phases || (this.phases = []), 8592 (this.phases.length = 0), 8593 this.phases.push(this.frameRequestedPhase), 8594 this.phases.push(this.startPhase), 8595 Array.prototype.push.apply(this.phases, this.runPhases), 8596 this.phases.push(this.endPhase), 8597 (this._runPhasesLength = this.runPhases.length), 8598 (this._phasesLength = this.phases.length)); 8599 }), 8600 (n._run = function () { 8601 if (!this._willRun) 8602 return ( 8603 (this._willRun = !0), 8604 0 === this.lastFrameTime && 8605 (this.lastFrameTime = performance.now()), 8606 (this._animationFrameActive = !0), 8607 this._isUsingExternalAnimationFrame || 8608 (this._animationFrame = this._requestAnimationFrame.call( 8609 window, 8610 this._boundOnAnimationFrame, 8611 )), 8612 this.phase === this.disabledPhase && 8613 ((this.phaseIndex = 0), 8614 (this.phase = this.phases[this.phaseIndex])), 8615 !0 8616 ); 8617 }), 8618 (n._cancel = function () { 8619 var e = !1; 8620 return ( 8621 this._animationFrameActive && 8622 (this._animationFrame && 8623 (this._cancelAnimationFrame.call(window, this._animationFrame), 8624 (this._animationFrame = null)), 8625 (this._animationFrameActive = !1), 8626 (e = !(this._willRun = !1))), 8627 this._isRunning || this._reset(), 8628 e 8629 ); 8630 }), 8631 (n._onAnimationFrame = function (e) { 8632 for ( 8633 this._subscribers = this._nextFrameSubscribers, 8634 this._subscribersOrder = this._nextFrameSubscribersOrder, 8635 this._subscriberArrayLength = this._nextFrameSubscriberArrayLength, 8636 this._subscriberCount = this._nextFrameSubscriberCount, 8637 this._nextFrameSubscribers = {}, 8638 this._nextFrameSubscribersOrder = [], 8639 this._nextFrameSubscriberArrayLength = 0, 8640 this._nextFrameSubscriberCount = 0, 8641 this.phaseIndex = 0, 8642 this.phase = this.phases[this.phaseIndex], 8643 this._isRunning = !0, 8644 this._willRun = !1, 8645 this._didRequestNextRAF = !1, 8646 this._rafData.delta = e - this.lastFrameTime, 8647 this.lastFrameTime = e, 8648 this._rafData.fps = 0, 8649 1e3 <= this._rafData.delta && (this._rafData.delta = 0), 8650 0 !== this._rafData.delta && 8651 (this._rafData.fps = 1e3 / this._rafData.delta), 8652 this._rafData.time = e, 8653 this._rafData.naturalFps = this._rafData.fps, 8654 this._rafData.timeNow = Date.now(), 8655 this.phaseIndex++, 8656 this.phase = this.phases[this.phaseIndex], 8657 this.eventEmitter.trigger(this.beforePhaseEventPrefix + this.phase), 8658 this._currentSubscriberIndex = 0; 8659 this._currentSubscriberIndex < this._subscriberArrayLength; 8660 this._currentSubscriberIndex++ 8661 ) 8662 null !== 8663 this._subscribers[ 8664 this._subscribersOrder[this._currentSubscriberIndex] 8665 ] && 8666 !1 === 8667 this._subscribers[ 8668 this._subscribersOrder[this._currentSubscriberIndex] 8669 ]._didDestroy && 8670 this._subscribers[ 8671 this._subscribersOrder[this._currentSubscriberIndex] 8672 ]._onAnimationFrameStart(this._rafData); 8673 for ( 8674 this.eventEmitter.trigger(this.afterPhaseEventPrefix + this.phase), 8675 this._runPhaseIndex = 0; 8676 this._runPhaseIndex < this._runPhasesLength; 8677 this._runPhaseIndex++ 8678 ) { 8679 for ( 8680 this.phaseIndex++, 8681 this.phase = this.phases[this.phaseIndex], 8682 this.eventEmitter.trigger( 8683 this.beforePhaseEventPrefix + this.phase, 8684 ), 8685 this._currentSubscriberIndex = 0; 8686 this._currentSubscriberIndex < this._subscriberArrayLength; 8687 this._currentSubscriberIndex++ 8688 ) 8689 null !== 8690 this._subscribers[ 8691 this._subscribersOrder[this._currentSubscriberIndex] 8692 ] && 8693 !1 === 8694 this._subscribers[ 8695 this._subscribersOrder[this._currentSubscriberIndex] 8696 ]._didDestroy && 8697 this._subscribers[ 8698 this._subscribersOrder[this._currentSubscriberIndex] 8699 ].trigger(this.phase, this._rafData); 8700 this.eventEmitter.trigger(this.afterPhaseEventPrefix + this.phase); 8701 } 8702 for ( 8703 this.phaseIndex++, 8704 this.phase = this.phases[this.phaseIndex], 8705 this.eventEmitter.trigger(this.beforePhaseEventPrefix + this.phase), 8706 this._currentSubscriberIndex = 0; 8707 this._currentSubscriberIndex < this._subscriberArrayLength; 8708 this._currentSubscriberIndex++ 8709 ) 8710 null !== 8711 this._subscribers[ 8712 this._subscribersOrder[this._currentSubscriberIndex] 8713 ] && 8714 !1 === 8715 this._subscribers[ 8716 this._subscribersOrder[this._currentSubscriberIndex] 8717 ]._didDestroy && 8718 this._subscribers[ 8719 this._subscribersOrder[this._currentSubscriberIndex] 8720 ]._onAnimationFrameEnd(this._rafData); 8721 (this.eventEmitter.trigger(this.afterPhaseEventPrefix + this.phase), 8722 this._willRun 8723 ? ((this.phaseIndex = 0), 8724 (this.phaseIndex = this.phases[this.phaseIndex])) 8725 : this._reset()); 8726 }), 8727 (n._onExternalAnimationFrame = function (e) { 8728 this._isUsingExternalAnimationFrame && this._onAnimationFrame(e); 8729 }), 8730 (n._reset = function () { 8731 (this._rafData || (this._rafData = {}), 8732 (this._rafData.time = 0), 8733 (this._rafData.delta = 0), 8734 (this._rafData.fps = 0), 8735 (this._rafData.naturalFps = 0), 8736 (this._rafData.timeNow = 0), 8737 (this._subscribers = {}), 8738 (this._subscribersOrder = []), 8739 (this._currentSubscriberIndex = -1), 8740 (this._subscriberArrayLength = 0), 8741 (this._subscriberCount = 0), 8742 (this._nextFrameSubscribers = {}), 8743 (this._nextFrameSubscribersOrder = []), 8744 (this._nextFrameSubscriberArrayLength = 0), 8745 (this._nextFrameSubscriberCount = 0), 8746 (this._didEmitFrameData = !1), 8747 (this._animationFrame = null),
8748 (this._animationFrameActive = !1), 8749 (this._isRunning = !1), 8750 (this._shouldReset = !1), 8751 (this.lastFrameTime = 0), 8752 (this._runPhaseIndex = -1), 8753 (this.phaseIndex = -1), 8754 (this.phase = this.disabledPhase)); 8755 })); 8756 var r = o, 8757 c = i.SharedInstance.share( 8758 "@marcom/ac-raf-emitter/sharedRAFExecutorInstance", 8759 r, 8760 l, 8761 ), 8762 n = i.SharedInstance, 8763 r = o, 8764 i = 8765 ((h.prototype.getNewID = function () { 8766 return (this._currentID++, "raf:" + this._currentID); 8767 }), 8768 n.share( 8769 "@marcom/ac-raf-emitter/sharedRAFEmitterIDGeneratorInstance", 8770 r, 8771 h, 8772 )), 8773 d = t.EventEmitterMicro, 8774 u = c, 8775 p = i; 8776 function m(e) { 8777 ((e = e || {}), 8778 d.call(this), 8779 (this.id = p.getNewID()), 8780 (this.executor = e.executor || u), 8781 this._reset(), 8782 (this._willRun = !1), 8783 (this._didDestroy = !1)); 8784 } 8785 function g(e) { 8786 f.call(this, e); 8787 } 8788 (((o = m.prototype = Object.create(d.prototype)).run = function () { 8789 return (this._willRun || (this._willRun = !0), this._subscribe()); 8790 }), 8791 (o.cancel = function () { 8792 (this._unsubscribe(), 8793 this._willRun && (this._willRun = !1), 8794 this._reset()); 8795 }), 8796 (o.destroy = function () { 8797 var e = this.willRun(); 8798 return ( 8799 this.cancel(), 8800 (this.executor = null), 8801 d.prototype.destroy.call(this), 8802 (this._didDestroy = !0), 8803 e 8804 ); 8805 }), 8806 (o.willRun = function () { 8807 return this._willRun; 8808 }), 8809 (o.isRunning = function () { 8810 return this._isRunning; 8811 }), 8812 (o._subscribe = function () { 8813 return this.executor.subscribe(this); 8814 }), 8815 (o._unsubscribe = function () { 8816 return this.executor.unsubscribe(this); 8817 }), 8818 (o._onAnimationFrameStart = function (e) { 8819 ((this._isRunning = !0), 8820 (this._willRun = !1), 8821 this._didEmitFrameData || 8822 ((this._didEmitFrameData = !0), this.trigger("start", e))); 8823 }), 8824 (o._onAnimationFrameEnd = function (e) { 8825 this._willRun || (this.trigger("stop", e), this._reset()); 8826 }), 8827 (o._reset = function () { 8828 ((this._didEmitFrameData = !1), (this._isRunning = !1)); 8829 })); 8830 var f = m; 8831 function v(e) { 8832 ((this.phase = e), 8833 (this.rafEmitter = new y()), 8834 this._cachePhaseIndex(), 8835 (this.requestAnimationFrame = this.requestAnimationFrame.bind(this)), 8836 (this.cancelAnimationFrame = this.cancelAnimationFrame.bind(this)), 8837 (this._onBeforeRAFExecutorStart = 8838 this._onBeforeRAFExecutorStart.bind(this)), 8839 (this._onBeforeRAFExecutorPhase = 8840 this._onBeforeRAFExecutorPhase.bind(this)), 8841 (this._onAfterRAFExecutorPhase = 8842 this._onAfterRAFExecutorPhase.bind(this)), 8843 this.rafEmitter.on(this.phase, this._onRAFExecuted.bind(this)), 8844 this.rafEmitter.executor.eventEmitter.on( 8845 "before:start", 8846 this._onBeforeRAFExecutorStart, 8847 ), 8848 this.rafEmitter.executor.eventEmitter.on( 8849 "before:" + this.phase, 8850 this._onBeforeRAFExecutorPhase, 8851 ), 8852 this.rafEmitter.executor.eventEmitter.on( 8853 "after:" + this.phase, 8854 this._onAfterRAFExecutorPhase, 8855 ), 8856 (this._frameCallbacks = []), 8857 (this._currentFrameCallbacks = []), 8858 (this._nextFrameCallbacks = []), 8859 (this._phaseActive = !1), 8860 (this._currentFrameID = -1), 8861 (this._cancelFrameIdx = -1), 8862 (this._frameCallbackLength = 0), 8863 (this._currentFrameCallbacksLength = 0), 8864 (this._nextFrameCallbacksLength = 0), 8865 (this._frameCallbackIteration = 0)); 8866 } 8867 (g.prototype = Object.create(f.prototype))._subscribe = function () { 8868 return this.executor.subscribe(this, !0); 8869 }; 8870 var y = g; 8871 function w() { 8872 this.events = {}; 8873 } 8874 (((n = v.prototype).requestAnimationFrame = function (e, t) { 8875 return ( 8876 !0 === t && 8877 0 < this.rafEmitter.executor.phaseIndex && 8878 this.rafEmitter.executor.phaseIndex <= this.phaseIndex 8879 ? this._phaseActive 8880 ? ((this._currentFrameID = 8881 this.rafEmitter.executor.subscribeImmediate( 8882 this.rafEmitter, 8883 !0, 8884 )), 8885 this._frameCallbacks.push(this._currentFrameID, e), 8886 (this._frameCallbackLength += 2)) 8887 : ((this._currentFrameID = 8888 this.rafEmitter.executor.subscribeImmediate( 8889 this.rafEmitter, 8890 !1, 8891 )), 8892 this._currentFrameCallbacks.push(this._currentFrameID, e),
8893 (this._currentFrameCallbacksLength += 2)) 8894 : ((this._currentFrameID = this.rafEmitter.run()), 8895 this._nextFrameCallbacks.push(this._currentFrameID, e), 8896 (this._nextFrameCallbacksLength += 2)), 8897 this._currentFrameID 8898 ); 8899 }), 8900 (n.cancelAnimationFrame = function (e) { 8901 ((this._cancelFrameIdx = this._nextFrameCallbacks.indexOf(e)), 8902 -1 < this._cancelFrameIdx 8903 ? this._cancelNextAnimationFrame() 8904 : ((this._cancelFrameIdx = this._currentFrameCallbacks.indexOf(e)), 8905 -1 < this._cancelFrameIdx 8906 ? this._cancelCurrentAnimationFrame() 8907 : ((this._cancelFrameIdx = this._frameCallbacks.indexOf(e)), 8908 -1 < this._cancelFrameIdx && 8909 this._cancelRunningAnimationFrame()))); 8910 }), 8911 (n._onRAFExecuted = function (e) { 8912 for ( 8913 this._frameCallbackIteration = 0; 8914 this._frameCallbackIteration < this._frameCallbackLength; 8915 this._frameCallbackIteration += 2 8916 ) 8917 this._frameCallbacks[this._frameCallbackIteration + 1](e.time, e); 8918 ((this._frameCallbacks.length = 0), (this._frameCallbackLength = 0)); 8919 }), 8920 (n._onBeforeRAFExecutorStart = function () { 8921 (Array.prototype.push.apply( 8922 this._currentFrameCallbacks, 8923 this._nextFrameCallbacks.splice(0, this._nextFrameCallbacksLength), 8924 ), 8925 (this._currentFrameCallbacksLength = this._nextFrameCallbacksLength), 8926 (this._nextFrameCallbacks.length = 0), 8927 (this._nextFrameCallbacksLength = 0)); 8928 }), 8929 (n._onBeforeRAFExecutorPhase = function () { 8930 ((this._phaseActive = !0), 8931 Array.prototype.push.apply( 8932 this._frameCallbacks, 8933 this._currentFrameCallbacks.splice( 8934 0, 8935 this._currentFrameCallbacksLength, 8936 ), 8937 ), 8938 (this._frameCallbackLength = this._currentFrameCallbacksLength), 8939 (this._currentFrameCallbacks.length = 0), 8940 (this._currentFrameCallbacksLength = 0)); 8941 }), 8942 (n._onAfterRAFExecutorPhase = function () { 8943 this._phaseActive = !1; 8944 }), 8945 (n._cachePhaseIndex = function () { 8946 this.phaseIndex = this.rafEmitter.executor.phases.indexOf(this.phase); 8947 }), 8948 (n._cancelRunningAnimationFrame = function () { 8949 (this._frameCallbacks.splice(this._cancelFrameIdx, 2), 8950 (this._frameCallbackLength -= 2)); 8951 }), 8952 (n._cancelCurrentAnimationFrame = function () { 8953 (this._currentFrameCallbacks.splice(this._cancelFrameIdx, 2), 8954 (this._currentFrameCallbacksLength -= 2)); 8955 }), 8956 (n._cancelNextAnimationFrame = function () { 8957 (this._nextFrameCallbacks.splice(this._cancelFrameIdx, 2), 8958 (this._nextFrameCallbacksLength -= 2), 8959 0 === this._nextFrameCallbacksLength && this.rafEmitter.cancel()); 8960 })); 8961 var _ = v; 8962 (((r = w.prototype).requestAnimationFrame = function (e) { 8963 return ( 8964 this.events[e] || (this.events[e] = new _(e)), 8965 this.events[e].requestAnimationFrame 8966 ); 8967 }), 8968 (r.cancelAnimationFrame = function (e) { 8969 return ( 8970 this.events[e] || (this.events[e] = new _(e)), 8971 this.events[e].cancelAnimationFrame 8972 ); 8973 })); 8974 ((c = (t = new w()).requestAnimationFrame("update")), 8975 (i = t.requestAnimationFrame("draw"))); 8976 let A = c, 8977 C = i, 8978 E = function (e, t) { 8979 e instanceof Promise ? e.then(t) : t(); 8980 }, 8981 b = function (e) { 8982 return "function" == typeof e ? e : null; 8983 }, 8984 x = function (t, i) { 8985 let s = i.length, 8986 r = 0; 8987 !(function e() { 8988 ("function" == typeof i[r] && t(i[r]), ++r < s && e()); 8989 })(); 8990 }, 8991 S = function (e, t, i) { 8992 return Math.min(Math.max(e, t), i); 8993 }, 8994 M = 8995 ((o = new (class { 8996 constructor() { 8997 ((this.linear = function (e) { 8998 return e; 8999 }), 9000 (this.easeInQuad = function (e) { 9001 return e * e; 9002 }), 9003 (this.easeOutQuad = function (e) { 9004 return e * (2 - e); 9005 }), 9006 (this.easeInOutQuad = function (e) { 9007 return e < 0.5 ? 2 * e * e : (4 - 2 * e) * e - 1; 9008 }), 9009 (this.easeInSin = function (e) { 9010 return 1 + Math.sin((Math.PI / 2) * e - Math.PI / 2); 9011 }), 9012 (this.easeOutSin = function (e) { 9013 return Math.sin((Math.PI / 2) * e); 9014 }), 9015 (this.easeInOutSin = function (e) { 9016 return (1 + Math.sin(Math.PI * e - Math.PI / 2)) / 2; 9017 }), 9018 (this.easeInElastic = function (e) { 9019 return 0 === e ? e : (0.04 - 0.04 / e) * Math.sin(25 * e) + 1; 9020 }), 9021 (this.easeOutElastic = function (e) { 9022 return ((0.04 * e) / --e) * Math.sin(25 * e); 9023 }), 9024 (this.easeInOutElastic = function (e) { 9025 return (e -= 0.5) < 0 9026 ? (0.02 + 0.01 / e) * Math.sin(50 * e) 9027 : (0.02 - 0.01 / e) * Math.sin(50 * e) + 1; 9028 }), 9029 (this.easeOutBack = function (e) { 9030 return (e -= 1) * e * (2.70158 * e + 1.70158) + 1; 9031 }), 9032 (this.easeInCubic = function (e) { 9033 return e * e * e; 9034 }), 9035 (this.easeOutCubic = function (e) { 9036 return --e * e * e + 1; 9037 }), 9038 (this.easeInOutCubic = function (e) { 9039 return e < 0.5 9040 ? 4 * e * e * e 9041 : (e - 1) * (2 * e - 2) * (2 * e - 2) + 1; 9042 }), 9043 (this.easeInQuart = function (e) { 9044 return e * e * e * e; 9045 }), 9046 (this.easeOutQuart = function (e) { 9047 return 1 - --e * e * e * e; 9048 }), 9049 (this.easeInOutQuart = function (e) { 9050 return e < 0.5 ? 8 * e * e * e * e : 1 - 8 * --e * e * e * e; 9051 }), 9052 (this.easeInQuint = function (e) { 9053 return e * e * e * e * e; 9054 }), 9055 (this.easeOutQuint = function (e) { 9056 return 1 + --e * e * e * e * e; 9057 }), 9058 (this.easeInOutQuint = function (e) { 9059 return e < 0.5 9060 ? 16 * e * e * e * e * e 9061 : 1 + 16 * --e * e * e * e * e; 9062 })); 9063 } 9064 })()), 9065 class { 9066 constructor(e, t = {}) { 9067 if ("number" != typeof e || !isFinite(e)) 9068 throw new TypeError( 9069 `Clip duration must be a finite number; got "${e}"`, 9070 ); 9071 ("function" == typeof t && (t = { draw: t }), 9072 (this.ease = b(t.ease)), 9073 (this.update = b(t.update)), 9074 (this.draw = b(t.draw)), 9075 (this.prepare = b(t.prepare)), 9076 (this.finish = b(t.finish)), 9077 (this._duration = 1e3 * e), 9078 (this._startTime = null),
9079 (this._isPrepared = !1), 9080 (this._promise = null), 9081 (this._isPlaying = !1)); 9082 } 9083 get isReversed() { 9084 return this._duration < 0; 9085 } 9086 get isComplete() { 9087 var e = this.progress; 9088 return (!this.isReversed && 1 <= e) || (this.isReversed && e <= 0); 9089 } 9090 get progress() { 9091 if (0 === this._duration) return 1; 9092 let e = (this.lastFrameTime - this._startTime) / this._duration; 9093 return (this.isReversed && (e = 1 + e), S(e, 0, 1)); 9094 } 9095 get easedProgress() { 9096 return this.ease ? this.ease(this.progress) : this.progress; 9097 } 9098 _run(e, t) { 9099 ((this.lastFrameTime = Date.now()), 9100 null === this._startTime && 9101 (this._startTime = this.lastFrameTime)); 9102 let i = this.easedProgress; 9103 (this.update && A(() => this._isPlaying && this.update(i)), 9104 C(() => { 9105 this._isPlaying && 9106 (this.draw && this.draw(i), 9107 this.isComplete 9108 ? x(C, [this.finish, t]) 9109 : this._run(this, t)); 9110 })); 9111 } 9112 play() { 9113 if ("function" != typeof this.draw) 9114 throw new Error( 9115 'Clip must be given a "draw" function as an option or have its "draw" method overriden.', 9116 ); 9117 return ( 9118 (this._isPlaying = !0), 9119 this._promise || 9120 ((this._promise = new Promise((e, t) => { 9121 !this._isPrepared && this.prepare 9122 ? ((this._isPrepared = !0), 9123 C(() => 9124 E(this.prepare(), () => { 9125 this._run(this, e); 9126 }), 9127 )) 9128 : this._run(this, e); 9129 })), 9130 this._promise) 9131 ); 9132 } 9133 destroy() { 9134 ((this._isPlaying = !1), 9135 (this.draw = this.finish = this.update = this.prepare = null)); 9136 } 9137 static play() { 9138 return new this(...arguments).play(); 9139 } 9140 }), 9141 T = o, 9142 I = { 9143 mounted() { 9144 (this.el.classList.remove("peeking"), 9145 this._items.forEach((e) => { 9146 (e.measure(), 9147 (e.x = 0), 9148 (e.zIndex = e === this.currentItem ? 2 : 0)); 9149 }), 9150 this.trigger(this.model.Events.ITEM_CHANGE_OCCURRED, { 9151 gallery: this, 9152 previous: null, 9153 current: this.currentItem, 9154 })); 9155 }, 9156 animateToItem(n) { 9157 if ( 9158 this.currentIndex !== n && 9159 this.currentIndex !== this.wrappedIndex(n) 9160 ) { 9161 this.el.parentElement.scrollLeft = 0; 9162 let e = this.model.IsTouch ? "easeOutCubic" : "easeInOutCubic", 9163 t = 9164 (this.clip && 9165 this.clip._isPlaying && 9166 ((e = "easeOutQuint"), this.clip.destroy()), 9167 this.selections.occurred.previous), 9168 i = this.selections.occurred.current, 9169 s = this._items[this.wrappedIndex(n)], 9170 r = 9171 ((s.opacity = 0), 9172 t && (t.zIndex = 0), 9173 i && (i.zIndex = 1), 9174 !(s.zIndex = 2)); 9175 ((this.clip = new M(this.model.Fade.duration, { 9176 ease: T[e], 9177 prepare: () => 9178 this.trigger(this.model.Events.ITEM_CHANGE_INITIATED, { 9179 gallery: this, 9180 next: s, 9181 }), 9182 update: (e) => { 9183 (0.5 < e && 9184 !r && 9185 ((r = !0), 9186 (this.currentIndex = s.index), 9187 this.trigger(this.model.Events.ITEM_CHANGE_OCCURRED, { 9188 gallery: this, 9189 current: s, 9190 })), 9191 (s.opacity = e)); 9192 }, 9193 draw: () => {}, 9194 finish: () => { 9195 this.trigger(this.model.Events.ITEM_CHANGE_COMPLETED, { 9196 gallery: this, 9197 current: s, 9198 }); 9199 }, 9200 })), 9201 this.clip.play().then(() => { 9202 (this.clip.destroy(), (this.clip = null)); 9203 })); 9204 } 9205 }, 9206 onResizeImmediate() { 9207 (this.clip && (this.clip.destroy(), (this.clip = null)), 9208 this.resetFadeItems()); 9209 }, 9210 resetFadeItems() {
9211 this._items.forEach((e) => { 9212 ((e.zIndex = e === this.currentItem ? 2 : 0), (e.opacity = 1)); 9213 }); 9214 }, 9215 destroy() { 9216 (this.clip && this.clip.destroy(), this.resetFadeItems()); 9217 }, 9218 }; 9219 ((r = 9220 (n = I) && 9221 n.__esModule && 9222 Object.prototype.hasOwnProperty.call(n, "default") 9223 ? n.default 9224 : n), 9225 typeof window < "u" && 9226 ((window.channelHtml18pro = window.channelHtml18pro || {}), 9227 (window.channelHtml18pro.MixinGallery = 9228 window.channelHtml18pro.MixinGallery || {}), 9229 (window.channelHtml18pro.MixinGallery.mixins = 9230 window.channelHtml18pro.MixinGallery.mixins || {}), 9231 (window.channelHtml18pro.MixinGallery.mixins.Fade = r))); 9232 })(), 9233 (() => { 9234 let e, 9235 t, 9236 i = "--global-scrollbar-width", 9237 s, 9238 r = { 9239 getScrollBarWidth: function () { 9240 return ( 9241 s || 9242 ((e = ( 9243 (null == (e = window.channelHtml18pro) ? void 0 : e.helpers) || {} 9244 ).isDesktop), 9245 (s = 9246 e && e() 9247 ? window.innerWidth - document.body.clientWidth + "px" 9248 : "0px"), 9249 (e = document.querySelector(".channel-html-18-pro")) && 9250 e.style.setProperty(i, s), 9251 s) 9252 ); 9253 var e; 9254 }, 9255 }, 9256 n = "ArrowLeft"; 9257 class o { 9258 constructor() { 9259 ((this.updateCallbacks = []), 9260 (this.drawCallbacks = []), 9261 (this.isRunning = !1), 9262 (this.rafId = null), 9263 (this._tick = this._tick.bind(this))); 9264 } 9265 on(e, t) { 9266 "update" === e 9267 ? this.updateCallbacks.push(t) 9268 : "draw" === e && this.drawCallbacks.push(t); 9269 } 9270 run() { 9271 this.isRunning || 9272 ((this.isRunning = !0), 9273 (this.rafId = requestAnimationFrame(this._tick))); 9274 } 9275 _tick() { 9276 (this.updateCallbacks.forEach((e) => e()), 9277 this.drawCallbacks.forEach((e) => e()), 9278 this.isRunning && (this.rafId = requestAnimationFrame(this._tick))); 9279 } 9280 cancel() { 9281 ((this.isRunning = !1), 9282 null !== this.rafId && 9283 (cancelAnimationFrame(this.rafId), (this.rafId = null))); 9284 } 9285 } 9286 let a = { 9287 create() { 9288 return new o(); 9289 }, 9290 }, 9291 l = { 9292 height: { 9293 target: 0, 9294 position: 0, 9295 velocity: 0, 9296 stiffness: 200, 9297 damping: 15, 9298 }, 9299 width: { 9300 target: 0, 9301 position: 0, 9302 velocity: 0, 9303 stiffness: 200, 9304 damping: 15, 9305 }, 9306 x: { target: 0, position: 0, velocity: 0, stiffness: 200, damping: 25 }, 9307 y: { target: 0, position: 0, velocity: 0, stiffness: 200, damping: 25 }, 9308 scale: { 9309 target: 1, 9310 position: 1, 9311 velocity: 0, 9312 stiffness: 200, 9313 damping: 20, 9314 }, 9315 opacity: { 9316 target: 1, 9317 position: 1, 9318 velocity: 0, 9319 stiffness: 200, 9320 damping: 10, 9321 }, 9322 }, 9323 { springs: h, SpringLayerRAF: c } = (() => { 9324 let t = [], 9325 i = performance.now(), 9326 s = 1 / 60; 9327 var e = a.create(); 9328 return ( 9329 e.on("update", function () { 9330 var e = performance.now(); 9331 ((s = 0.001 * (e - i)), (i = e), t.forEach((e) => e._onUpdate(s))); 9332 }), 9333 e.on("draw", function () { 9334 t.forEach((e) => e._onDraw(s)); 9335 }), 9336 { springs: t, SpringLayerRAF: e } 9337 ); 9338 })(); 9339 class d extends class { 9340 constructor() { 9341 this._events = {}; 9342 } 9343 on(e, t) { 9344 return ( 9345 (this._events[e] = this._events[e] || []), 9346 this._events[e].unshift(t), 9347 t 9348 ); 9349 } 9350 once(t, i) { 9351 let s = (e) => { 9352 (this.off(t, s), void 0 !== e ? i(e) : i()); 9353 }; 9354 return this.on(t, s); 9355 } 9356 off(e, t) { 9357 this.has(e) && 9358 (t 9359 ? -1 !== (t = this._events[e].indexOf(t)) && 9360 this._events[e].splice(t, 1) 9361 : delete this._events[e]); 9362 } 9363 trigger(t, i) { 9364 if (this.has(t)) 9365 for (let e = this._events[t].length - 1; 0 <= e; e--) 9366 void 0 !== i ? this._events[t][e](i) : this._events[t][e](); 9367 } 9368 has(e) { 9369 return e in this._events && 0 !== this._events[e].length; 9370 } 9371 destroy() { 9372 this._events = null; 9373 } 9374 } { 9375 constructor(e, t = l) { 9376 (super(), 9377 (this.RAF = c), 9378 (this.el = e), 9379 (this.props = t), 9380 (this.dimensionProps = ["width", "height"]), 9381 (this.transformProps = [ 9382 "x", 9383 "y", 9384 "z", 9385 "scale", 9386 "scale-x", 9387 "scale-y", 9388 ])); 9389 } 9390 mounted() { 9391 for (var e in this.props) 9392 ((this.props[e].velocity = 0), 9393 void 0 !== this.props[e].bounce && 9394 void 0 !== this.props[e].duration &&
9395 ((this.props[e].mass = 1), 9396 (this.props[e].stiffness = 9397 ((2 * Math.PI) / this.props[e].duration) ** 2), 9398 (this.props[e].damping = 9399 ((1 - this.props[e].bounce) * (4 * Math.PI)) / 9400 this.props[e].duration))); 9401 (this._initEnhanced(), this.RAF.run()); 9402 } 9403 get(e, t) { 9404 return this.props[e][t]; 9405 } 9406 set(e, t, i) { 9407 ("velocity" !== t 9408 ? (this.props[e][t] = i) 9409 : (this.props[e].velocity = i), 9410 ("bounce" !== t && "duration" !== t) || 9411 void 0 === this.props[e].bounce || 9412 void 0 === this.props[e].duration || 9413 ((this.props[e].mass = 1), 9414 (this.props[e].stiffness = 9415 ((2 * Math.PI) / this.props[e].duration) ** 2), 9416 (this.props[e].damping = 9417 ((1 - this.props[e].bounce) * (4 * Math.PI)) / 9418 this.props[e].duration)), 9419 this.RAF.run()); 9420 } 9421 setTarget(e, t, i = null) { 9422 ((this.props[e].target = t), 9423 i && (this.props[e].velocity = i), 9424 this.RAF.run()); 9425 } 9426 setImmediateValue(e, t = null) { 9427 var i, s, r, n, o, a; 9428 (null === t && (t = this.renderState[e].position), 9429 this.dimensionProps.includes(e) 9430 ? (this.el.style[e] = t + "px") 9431 : this.transformProps.includes(e) 9432 ? ((i = this.renderState.x ? this.renderState.x.position : 0), 9433 (s = this.renderState.y ? this.renderState.y.position : 0), 9434 (r = this.renderState.z ? this.renderState.z.position : 0), 9435 (n = this.renderState.scale 9436 ? this.renderState.scale.position 9437 : 1), 9438 (o = this.renderState["scale-x"] 9439 ? this.renderState["scale-x"].position 9440 : 1), 9441 (a = this.renderState["scale-y"] 9442 ? this.renderState["scale-y"].position 9443 : 1), 9444 (this.el.style.transform = `translate3d(${i}px, ${s}px, ${r}px) scale(${n}) scaleX(${o}) scaleY(${a})`)) 9445 : -1 < e.indexOf("--") 9446 ? this.el.style.setProperty("" + e, "" + t) 9447 : -1 < e.indexOf("**") || (this.el.style[e] = "" + t)); 9448 } 9449 snapValue(e, t = null) { 9450 ((this.props[e].target = 9451 this.previousState[e].target = 9452 this.renderState[e].target = 9453 t), 9454 (this.props[e].position = 9455 this.previousState[e].position = 9456 this.renderState[e].position = 9457 t), 9458 this.props[e].onUpdate && this.props[e].onUpdate(), 9459 this.el instanceof Element && 9460 this.setImmediateValue(e, t.toFixed(5))); 9461 } 9462 destroy() { 9463 (h.splice(h.indexOf(this), 1), 9464 (this.el.style = null), 9465 (this.el = null), 9466 (this.props = null), 9467 (this.dimensionProps = null), 9468 (this.transformProps = null), 9469 (this.frameTime = null), 9470 (this.frameTimeTarget = null), 9471 (this.frameTimeAccumulator = null)); 9472 } 9473 _initEnhanced() { 9474 ((this.frameTimeTarget = 1 / 60), 9475 (this.frameTimeAccumulator = 0), 9476 (this.fpsThen = performance.now()), 9477 (this.previousState = JSON.parse(JSON.stringify(this.props))), 9478 (this.renderState = JSON.parse(JSON.stringify(this.props))), 9479 (this._onUpdate = this._onUpdate.bind(this)), 9480 (this._onDraw = this._onDraw.bind(this)), 9481 h.push(this)); 9482 } 9483 _isNear(e, t) { 9484 var i = 9485 Math.abs(this.renderState[e].position - this.props[e].target) < t, 9486 e = Math.abs(this.renderState[e].velocity) < t; 9487 return i && e; 9488 } 9489 _onDraw() { 9490 let e = !0; 9491 for (var t in this.props) 9492 (this._isNear(t, 0.001) 9493 ? ((this.props[t].position = this.renderState[t].position = 9494 this.props[t].target), 9495 (this.props[t].velocity = this.renderState[t].velocity = 0)) 9496 : (e = !1), 9497 this.el instanceof Element && this.setImmediateValue(t)); 9498 e ? this.trigger("complete", this) : this.RAF.run(); 9499 } 9500 _onUpdate(e) { 9501 for ( 9502 this.frameTime = Math.min(1 / 30, e), 9503 this.frameTimeAccumulator += this.frameTime; 9504 this.frameTimeAccumulator >= this.frameTimeTarget; 9505 ) { 9506 for (var t in ((this.previousState = {}),
9507 Object.entries(this.props).forEach(([i, e]) => { 9508 ((this.previousState[i] = {}), 9509 Object.entries(e).forEach(([e, t]) => { 9510 this.previousState[i][e] = t; 9511 })); 9512 }), 9513 this.props)) { 9514 if (this._isNear(t, 0.001)) { 9515 ((this.props[t].position = 9516 this.previousState[t].position = 9517 this.renderState[t].position = 9518 this.props[t].target), 9519 (this.props[t].velocity = 9520 this.previousState[t].velocity = 9521 this.renderState[t].velocity = 9522 0)); 9523 continue; 9524 } 9525 var { newPosition: i, newVelocity: s } = this._spring( 9526 1, 9527 this.props[t].stiffness, 9528 this.props[t].damping, 9529 this.props[t].position, 9530 this.props[t].velocity, 9531 this.props[t].target, 9532 ); 9533 ((this.props[t].velocity = s), (this.props[t].position = i)); 9534 } 9535 this.frameTimeAccumulator -= this.frameTimeTarget; 9536 } 9537 var r, 9538 n = this.frameTimeAccumulator / this.frameTimeTarget; 9539 for (r in this.props) 9540 ((this.renderState[r].velocity = 9541 this.props[r].velocity * n + 9542 this.previousState[r].velocity * (1 - n)), 9543 (this.renderState[r].position = 9544 this.props[r].position * n + 9545 this.previousState[r].position * (1 - n)), 9546 this.props[r].onUpdate && this.props[r].onUpdate()); 9547 } 9548 _spring(e, t, i, s, r, n) { 9549 t = r += ((-t * (s - n) + -i * r) / e) * this.frameTimeTarget; 9550 return { newPosition: (s += t * this.frameTimeTarget), newVelocity: t }; 9551 } 9552 } 9553 let u = null == (e = window.channelHtml18pro) ? void 0 : e.ChannelBase, 9554 { registerComponent: p, touchAvailable: m } = 9555 (null == (t = window.channelHtml18pro) ? void 0 : t.helpers) || {}; 9556 if (!u) 9557 throw new Error( 9558 "ProductViewer: ChannelBase not found. Make sure ChannelBase.js is loaded before ProductViewer.js", 9559 ); 9560 class g extends u { 9561 constructor(e) { 9562 var t; 9563 (super(), 9564 (this.element = document.querySelector( 9565 `.${e} .product-viewer-component`, 9566 )), 9567 (this.isRTL = "rtl" === document.documentElement.dir), 9568 (this.reducedMotion = 9569 (null == 9570 (t = 9571 null == 9572 (e = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 9573 ? void 0 9574 : e.prefersReducedMotion) 9575 ? void 0 9576 : t.call(e)) || !1), 9577 (this.isInsideModal = !1)); 9578 } 9579 mounted() { 9580 var t = 9581 null == (t = this.element) 9582 ? void 0 9583 : t.closest(".channel-modal-content"); 9584 if (t) { 9585 let e = t.closest(".channel-modal"), 9586 i = null == e ? void 0 : e.dataset.shortid; 9587 if (i) { 9588 this.isInsideModal = !0; 9589 let t = () => { 9590 var e = 9591 null == 9592 (e = 9593 null == 9594 (e = 9595 null == (e = window.channelHtml18pro) 9596 ? void 0 9597 : e.channelModal) 9598 ? void 0 9599 : e.instances) 9600 ? void 0 9601 : e[i]; 9602 null != e && e.modal 9603 ? (e.modal.on(e.modal.model.Events.OPEN, () => { 9604 requestAnimationFrame(() => { 9605 var e; 9606 (this._initialize(), 9607 this.isSmall 9608 ? null != (e = this.smallInstance) && e._onEnter() 9609 : null != (e = this.desktopInstance) && 9610 e._triggerAnimationIntroElement()); 9611 }); 9612 }), 9613 e.modal.on(e.modal.model.Events.CLOSE, () => { 9614 requestAnimationFrame(() => { 9615 (this.destroy(), 9616 this._reset(), 9617 (this._initialized = !1), 9618 (this.isDestroyed = !1)); 9619 }); 9620 })) 9621 : setTimeout(t, 100); 9622 }; 9623 return void t(); 9624 } 9625 } 9626 this._initialize(); 9627 } 9628 _initialize() { 9629 var e; 9630 this._initialized || 9631 ((this._initialized = !0), 9632 this._smallValidation(), 9633 (this.colorNavGalleryEl = 9634 null == (e = this.element) 9635 ? void 0
9636 : e.querySelector(".colornav-gallery")), 9637 (this.controlsEl = 9638 null == (e = this.element) ? void 0 : e.querySelector(".controls")), 9639 (this.aapEl = 9640 null == (e = this.element) 9641 ? void 0 9642 : e.querySelector(".all-access-pass--product-viewer")), 9643 (this.productViewerGallery = 9644 null == (e = this.element) 9645 ? void 0 9646 : e.querySelector(".product-viewer.gallery")), 9647 (this.closeButton = 9648 null == (e = this.element) 9649 ? void 0 9650 : e.querySelector(".close-button")), 9651 (this.introElement = 9652 null == (e = this.element) 9653 ? void 0 9654 : e.querySelector(".intro-element")), 9655 (this.productViewerContainer = 9656 null == (e = this.element) 9657 ? void 0 9658 : e.querySelector(".product-viewer-container")), 9659 (this.landingElementAccessibilityContainer = 9660 null == (e = this.element) 9661 ? void 0 9662 : e.querySelector(".landing-element-accessibility-container")), 9663 (this.colorSelectorElement = 9664 null == (e = this.element) 9665 ? void 0 9666 : e.querySelector('.control-item[data-type="color-selector"]')), 9667 (this.instances = []), 9668 this._createInstances(), 9669 (this._onBreakpointChange = this._onBreakpointChange.bind(this)), 9670 (this._onResizeDebounced = this._onResizeDebounced.bind(this)), 9671 this.anim.on( 9672 this.anim.model.PageEvents.ON_BREAKPOINT_CHANGE, 9673 this._onBreakpointChange, 9674 ), 9675 this.anim.on( 9676 this.anim.model.PageEvents.ON_RESIZE_DEBOUNCED, 9677 this._onResizeDebounced, 9678 )); 9679 } 9680 _createInstances() { 9681 [ 9682 { 9683 Class: class { 9684 constructor(e) { 9685 ((this.productViewer = e), 9686 (this.el = e.element), 9687 (this.anim = e.anim), 9688 (this.aapEl = e.aapEl), 9689 (this.productViewerGallery = e.productViewerGallery), 9690 (this.productViewerContainer = e.productViewerContainer), 9691 (this.landingElementAccessibilityContainer = 9692 e.landingElementAccessibilityContainer), 9693 (this.colorSelectorElement = e.colorSelectorElement), 9694 (this.controlItems = Array.from( 9695 (null == (e = this.el) 9696 ? void 0 9697 : e.querySelectorAll(".control-item")) || [], 9698 )), 9699 (this.cachedControls = []), 9700 (this._aapElContractedBCR = 9701 null == (e = this.aapEl) 9702 ? void 0 9703 : e.getBoundingClientRect()), 9704 (this.isRTL = this.productViewer.isRTL), 9705 (this.rtlDirection = this.isRTL ? -1 : 1), 9706 (this.toggleOptions = Array.from( 9707 (null == (e = this.el) 9708 ? void 0 9709 : e.querySelectorAll(".control-color input")) || [], 9710 )), 9711 (this.colorSelectorElementIndex = this.controlItems.indexOf( 9712 this.colorSelectorElement, 9713 )), 9714 (this.colorSelectElementSelectedColorNav = 9715 null == (e = this.colorSelectorElement) 9716 ? void 0 9717 : e.querySelector("input[checked]")), 9718 (this.activeSwatch = 9719 null == (e = this.colorSelectorElement) 9720 ? void 0 9721 : e.querySelector(".control-color-active-swatch")), 9722 (this.activeLabel = 9723 null == (e = this.colorSelectorElement) 9724 ? void 0 9725 : e.querySelector(".control-color-current")), 9726 (this._onKeyDown = this._onKeyDown.bind(this)), 9727 (this._onColorSelectorClick = 9728 this._onColorSelectorClick.bind(this)), 9729 this._addEventListeners(), 9730 this.computeControlsDimensions()); 9731 } 9732 get pageMetrics() { 9733 return this.productViewer.pageMetrics; 9734 } 9735 mounted() { 9736 (r.getScrollBarWidth(), 9737 this._setAccessibilityContainersFallbackAriaLabels(), 9738 this._setAccessibilityLandingContainerFallbackAriaLabels(), 9739 this.productViewerGallery && 9740 this.productViewerGallery.setAttribute( 9741 "aria-hidden", 9742 "true", 9743 )); 9744 } 9745 computeControlsDimensions() { 9746 ((this.cachedControls = []), 9747 (this.cachedGlobalDimensions = { 9748 container: this.el.getBoundingClientRect(), 9749 aap: { 9750 contracted: this._aapElContractedBCR, 9751 expanded: null, 9752 }, 9753 }),
9754 this.controlItems.forEach((e, t) => { 9755 var i = e.querySelector(".control-item-open"), 9756 s = e.querySelector(".control-item-content-mask"), 9757 r = e.querySelector(".control-item-media"), 9758 n = e.querySelector("video"); 9759 let o = null, 9760 a = 9761 (r && 9762 (((p = r.getBoundingClientRect()).height += 9763 this.expandedWidth / (16 / 9)), 9764 (o = { 9765 el: r, 9766 videoEl: n, 9767 width: p.width, 9768 height: p.height, 9769 })), 9770 e.querySelector(".paddlenav-prev")), 9771 l = e.querySelector(".paddlenav-next"), 9772 h = e.querySelector( 9773 ".control-item-accessibility-container", 9774 ), 9775 c = 9776 null == h 9777 ? void 0 9778 : h.querySelector( 9779 ".control-item-accessibility-image", 9780 ), 9781 d = i.getBoundingClientRect(), 9782 u = { width: 0, height: 0 }; 9783 ((this.expandedWidth = parseFloat( 9784 getComputedStyle(this.aapEl).getPropertyValue( 9785 "--aap-expanded-width", 9786 ), 9787 )), 9788 this.productViewer.isSmall && 9789 (this.expandedWidth = Math.min( 9790 this.pageMetrics.windowWidth - 80, 9791 400, 9792 )), 9793 Array.from(s.children).forEach((e) => { 9794 e.classList.contains("control-item-media") 9795 ? (u.height += this.expandedWidth / (16 / 9)) 9796 : ((e = e.getBoundingClientRect()), 9797 (u.width = this.expandedWidth), 9798 (u.height += e.height)); 9799 })); 9800 var r = { id: null }, 9801 p = 9802 (null != (n = null == i ? void 0 : i.dataset) && 9803 n.tourMediaId && 9804 (r.id = this.el.querySelector( 9805 ".tour-" + i.dataset.tourMediaId, 9806 )), 9807 0 === t ? 1 : 0); 9808 this.cachedControls.push({ 9809 index: t, 9810 el: e, 9811 cardWeight: p, 9812 content: { 9813 el: s, 9814 x: e.offsetLeft, 9815 y: e.offsetTop, 9816 width: u.width, 9817 height: u.height, 9818 }, 9819 button: { 9820 el: i, 9821 x: e.offsetLeft, 9822 y: e.offsetTop, 9823 width: d.width, 9824 height: d.height, 9825 }, 9826 cardMedia: o, 9827 tourMedia: r, 9828 controls: { prevButton: a, nextButton: l }, 9829 scroll: { 9830 scrollOffset: 0, 9831 expandedScrollOffset: 0, 9832 collapsedOffset: 0, 9833 expandedOffset: 0, 9834 }, 9835 accessibilityContainer: { 9836 el: h, 9837 media: c, 9838 ...(null != c && c.dataset.ariaMap 9839 ? { ariaMap: JSON.parse(c.dataset.ariaMap) } 9840 : {}), 9841 ...(null != c && c.dataset.ariaMapFallback 9842 ? { 9843 ariaMapFallback: JSON.parse( 9844 c.dataset.ariaMapFallback, 9845 ), 9846 } 9847 : {}), 9848 }, 9849 }); 9850 })); 9851 } 9852 onResizeDebounced() { 9853 ((this.expandedWidth = parseFloat( 9854 getComputedStyle(this.aapEl).getPropertyValue( 9855 "--aap-expanded-width", 9856 ), 9857 )), 9858 this.productViewer.isSmall && 9859 (this.expandedWidth = Math.min( 9860 this.pageMetrics.windowWidth - 80, 9861 400, 9862 )),
9863 this.cachedControls.forEach((t) => { 9864 var e = t.button.el.getBoundingClientRect(); 9865 ((t.button.width = e.width), 9866 (t.button.height = e.height), 9867 (t.content.width = 0), 9868 (t.content.height = 0), 9869 Array.from(t.content.el.children).forEach((e) => { 9870 e.classList.contains("control-item-media") 9871 ? (t.content.height += this.expandedWidth / (16 / 9)) 9872 : ((e = e.getBoundingClientRect()), 9873 (t.content.width = this.expandedWidth), 9874 (t.content.height += e.height)); 9875 })); 9876 })); 9877 } 9878 _addEventListeners() { 9879 let e, 9880 t = (e) => { 9881 e.target instanceof HTMLElement && 9882 "key" === e.target.dataset.focusMethod && 9883 (this.el.style.overflow = "visible"); 9884 }; 9885 (this.el.addEventListener("focusout", (e) => { 9886 this.productViewer.isSmall || 9887 (this.el.style.overflow = "hidden"); 9888 }), 9889 this.el.addEventListener("focusin", (e) => { 9890 this.productViewer.isSmall || t(e); 9891 }), 9892 (this.onInputChange = this.onInputChange.bind(this)), 9893 this.toggleOptions.forEach((e) => { 9894 e.addEventListener("change", this.onInputChange); 9895 }), 9896 null != (e = this.colorSelectorElement) && 9897 e.addEventListener("keydown", this._onKeyDown), 9898 this._setupColorSelectorLabelClicks()); 9899 } 9900 _onColorSelectorClick(e) {
9901 var e = e.target.closest(".colornav-link"); 9902 e && 9903 (e = (e = e.getAttribute("for")) 9904 ? document.getElementById(e) 9905 : null) && 9906 "radio" === e.type && 9907 ((e.checked = !0), 9908 e.dispatchEvent(new Event("change", { bubbles: !0 }))); 9909 } 9910 _setupColorSelectorLabelClicks() { 9911 this.colorSelectorElement && 9912 this.colorSelectorElement.addEventListener( 9913 "click", 9914 this._onColorSelectorClick, 9915 ); 9916 } 9917 _removeEventListeners() { 9918 (this.toggleOptions.forEach((e) => { 9919 e.removeEventListener("change", this.onInputChange); 9920 }), 9921 this.colorSelectorElement && 9922 (this.colorSelectorElement.removeEventListener( 9923 "keydown", 9924 this._onKeyDown, 9925 ), 9926 this.colorSelectorElement.removeEventListener( 9927 "click", 9928 this._onColorSelectorClick, 9929 ))); 9930 } 9931 destroy() { 9932 this._removeEventListeners(); 9933 } 9934 _onKeyDown(e) { 9935 var t = this.toggleOptions.indexOf(document.activeElement); 9936 -1 !== t && 9937 (e.code === n || "ArrowRight" === e.code) && 9938 ((t = 9939 (t = 9940 (t + (e.code === n ? -1 : 1) * this.rtlDirection) % 9941 this.toggleOptions.length) < 0 9942 ? this.toggleOptions.length + t 9943 : t), 9944 (t = this.toggleOptions[t])) && 9945 (t.click(), t.focus(), e.preventDefault()); 9946 } 9947 onInputChange(e) { 9948 var t, 9949 i = e.target; 9950 (this.activeSwatch && 9951 this.colorSelectElementSelectedColorNav && 9952 this.activeSwatch.classList.toggle( 9953 this.colorSelectElementSelectedColorNav.value, 9954 !1, 9955 ), 9956 (this.colorSelectElementSelectedColorNav = i), 9957 this.activeSwatch && 9958 this.colorSelectElementSelectedColorNav && 9959 this.activeSwatch.classList.toggle( 9960 this.colorSelectElementSelectedColorNav.value, 9961 !0, 9962 ), 9963 this.activeLabel && 9964 null != 9965 (t = 9966 null == (t = this.colorSelectElementSelectedColorNav) 9967 ? void 0 9968 : t.dataset) && 9969 t.label && 9970 (this.activeLabel.innerHTML = 9971 this.colorSelectElementSelectedColorNav.dataset.label), 9972 this.activeSwatch && 9973 null != 9974 (t = 9975 null == (t = this.colorSelectElementSelectedColorNav) 9976 ? void 0 9977 : t.dataset) && 9978 t.label && 9979 (this.activeSwatch.textContent = 9980 this.colorSelectElementSelectedColorNav.dataset.label), 9981 (this._lastColorSelectedData = { 9982 el: i, 9983 isDefault: "true" === i.dataset.defaultColor, 9984 event: e, 9985 index: parseInt(i.dataset.index, 10), 9986 aap: { component: this, el: this.el, id: this.el.id }, 9987 }), 9988 0 <= this.colorSelectorElementIndex && 9989 this.cachedControls[this.colorSelectorElementIndex] && 9990 (({ width: t, height: e } = 9991 this.cachedControls[ 9992 this.colorSelectorElementIndex 9993 ].button.el.getBoundingClientRect()), 9994 ({ width: i, height: t } = 9995 ((this.cachedControls[ 9996 this.colorSelectorElementIndex 9997 ].button.width = t), 9998 (this.cachedControls[ 9999 this.colorSelectorElementIndex 10000 ].button.height = e), 10001 this.cachedControls[ 10002 this.colorSelectorElementIndex 10003 ].content.el.children[0].getBoundingClientRect())), 10004 (this.cachedControls[ 10005 this.colorSelectorElementIndex 10006 ].content.width = i), 10007 (this.cachedControls[ 10008 this.colorSelectorElementIndex 10009 ].content.height = t)), 10010 this.anim && 10011 this.anim.trigger( 10012 "aap-product-viewer:input:change", 10013 this._lastColorSelectedData, 10014 ), 10015 0 <= this.colorSelectorElementIndex && 10016 this.cachedControls[this.colorSelectorElementIndex] && 10017 (e = 10018 this.cachedControls[this.colorSelectorElementIndex] 10019 .accessibilityContainer.ariaMapFallback || 10020 this.cachedControls[this.colorSelectorElementIndex] 10021 .accessibilityContainer.ariaMap) && 10022 this._lastColorSelectedData.el.value && 10023 (i = e[this._lastColorSelectedData.el.value]) && 10024 this.cachedControls[ 10025 this.colorSelectorElementIndex 10026 ].accessibilityContainer.media.setAttribute( 10027 "aria-label", 10028 i, 10029 )); 10030 }
10031 _setAccessibilityContainersFallbackAriaLabels(i) { 10032 this.cachedControls.forEach((e) => { 10033 var t = this.productViewer.isSmall 10034 ? (null == 10035 (t = 10036 null == 10037 (t = 10038 null == (t = e.accessibilityContainer) 10039 ? void 0 10040 : t.media) 10041 ? void 0 10042 : t.dataset) 10043 ? void 0 10044 : t.ariaLabelSmallFallback) || 10045 (null == 10046 (t = 10047 null == 10048 (t = 10049 null == (t = e.accessibilityContainer) 10050 ? void 0 10051 : t.media) 10052 ? void 0 10053 : t.dataset) 10054 ? void 0 10055 : t.ariaLabelFallback) 10056 : null == 10057 (t = 10058 null == 10059 (t = 10060 null == (t = e.accessibilityContainer) 10061 ? void 0 10062 : t.media) 10063 ? void 0 10064 : t.dataset) 10065 ? void 0 10066 : t.ariaLabelFallback; 10067 i 10068 ? e.el.dataset.mtype === i && 10069 t && 10070 e.accessibilityContainer.media.setAttribute( 10071 "aria-label", 10072 t, 10073 ) 10074 : (e.el.dataset.type && 10075 "color-selector" === e.el.dataset.type) || 10076 (t && 10077 e.accessibilityContainer.media.setAttribute( 10078 "aria-label", 10079 t, 10080 )); 10081 }); 10082 } 10083 _setAccessibilityLandingContainerFallbackAriaLabels() { 10084 var e = this.landingElementAccessibilityContainer, 10085 t = this.productViewer.isSmall 10086 ? (null == (t = null == e ? void 0 : e.dataset) 10087 ? void 0 10088 : t.ariaLabelSmallFallback) || 10089 (null == (t = null == e ? void 0 : e.dataset) 10090 ? void 0 10091 : t.ariaLabelFallback) 10092 : null == (t = null == e ? void 0 : e.dataset) 10093 ? void 0 10094 : t.ariaLabelFallback; 10095 t && e.setAttribute("aria-label", t); 10096 } 10097 _resetAccessibilityContainersAriaLabels() { 10098 (this._setAccessibilityContainersFallbackAriaLabels(), 10099 this._setAccessibilityLandingContainerFallbackAriaLabels(), 10100 this._resetAccessibilityContainerForColorSelectorElement()); 10101 } 10102 _resetAccessibilityContainerForColorSelectorElement() { 10103 var e; 10104 null != 10105 (e = this.cachedControls[this.colorSelectorElementIndex]) && 10106 e.accessibilityContainer.ariaMapFallback && 10107 this.cachedControls[ 10108 this.colorSelectorElementIndex 10109 ].accessibilityContainer.media.setAttribute( 10110 "aria-label", 10111 this.cachedControls[this.colorSelectorElementIndex] 10112 .accessibilityContainer.ariaMapFallback[ 10113 (null == 10114 (e = 10115 null == (e = this._lastColorSelectedData) 10116 ? void 0 10117 : e.el) 10118 ? void 0 10119 : e.value) || 10120 this.colorSelectElementSelectedColorNav.value 10121 ], 10122 ); 10123 } 10124 }, 10125 propName: "productViewerCore", 10126 }, 10127 { 10128 Class: class { 10129 constructor(e) { 10130 var t; 10131 ((this.productViewer = e), 10132 (this.element = e.element), 10133 (this.anim = e.anim), 10134 (this.productViewerCore = e.productViewerCore), 10135 (this.aapEl = e.aapEl), 10136 (this.controlsEl = e.controlsEl), 10137 (this.productViewerEnhancedWrapper = e.productViewerGallery), 10138 (this.closeButton = e.closeButton), 10139 (this._paddlenavContainer = this.element.querySelector( 10140 ".paddlenav-container", 10141 )), 10142 (this._prevPaddlenav = 10143 null == (t = this._paddlenavContainer) 10144 ? void 0 10145 : t.querySelector(".paddlenav-prev")), 10146 (this._nextPaddlenav = 10147 null == (t = this._paddlenavContainer) 10148 ? void 0 10149 : t.querySelector(".paddlenav-next")), 10150 (this.toggleOptions = Array.from( 10151 this.element.querySelectorAll(".control-color input"), 10152 )), 10153 (this.controlsContainer = 10154 this.element.querySelector(".control-group")), 10155 (this.controlsContainerComputerStyles = 10156 window.getComputedStyle(this.controlsContainer)), 10157 (this.controlsContainerItemGap = parseInt( 10158 this.controlsContainerComputerStyles 10159 .getPropertyValue("gap") 10160 .replace("px", ""), 10161 10, 10162 )), 10163 (this._introElementData = { 10164 el: e.introElement, 10165 animations: { 10166 scale: { origin: 0, target: 1 }, 10167 x: { origin: -100, target: 0 }, 10168 }, 10169 }), 10170 (this.introAnimationFinished = !1), 10171 (this.introAnimationInProgress = !1), 10172 (this._animationInProgress = !1), 10173 (this._lastSelected = { el: null, index: null }), 10174 (this.currentSelected = null),
10175 (this.isPaddlenavOpen = !1), 10176 (this.aapContainerOffsetY = 0), 10177 (this.ANIM_CONSTANTS = { 10178 easeBoth: "cubic-bezier(0.42, 0, 0.58, 1)", 10179 easeIn: "cubic-bezier(0.42, 0, 1, 1)", 10180 }), 10181 this._configureUiPane(), 10182 this._addEventListeners()); 10183 } 10184 _configureUiPane() { 10185 this.PANE_PARAMS = { 10186 global: { rtl: !1 }, 10187 expandCard: { 10188 duration: 1, 10189 delay: 0, 10190 springMass: 1, 10191 springStiffness: 100, 10192 springDamping: 14, 10193 springInitialVelocity: 0, 10194 buttonFadeOutOpacityAnimDuration: 100, 10195 buttonFadeOutOpacityAnimDelay: 200, 10196 buttonFadeInOpacityAnimDuration: 0, 10197 buttonFadeInOpacityAnimDelay: 0, 10198 cardContentFadeOutOpacityAnimDuration: 0, 10199 cardContentFadeOutOpacityAnimDelay: 0, 10200 cardContentFadeInOpacityAnimDuration: 400, 10201 cardContentFadeInOpacityAnimDelay: 50, 10202 cardContentYAnimAmount: 50, 10203 cardContentFadeOutYAnimDuration: 400, 10204 cardContentFadeOutYAnimDelay: 0, 10205 cardContentFadeInYAnimDuration: 100, 10206 cardContentFadeInYAnimDelay: 70, 10207 cardContentImageFadeOutOpacityAnimDuration: 200, 10208 cardContentImageFadeOutOpacityAnimDelay: 0, 10209 cardContentImageFadeInOpacityAnimDuration: 400, 10210 cardContentImageFadeInOpacityAnimDelay: 150, 10211 }, 10212 introElement: { 10213 scaleDuration: 0.4, 10214 scaleDelay: 0.4, 10215 xDuration: 0.4, 10216 xDelay: 0.2, 10217 peScaleDuration: 0.6, 10218 peScaleDelay: 0.4, 10219 }, 10220 introElementEaseFunction: { 10221 springMass: 1, 10222 springStiffness: 50, 10223 springDamping: 10, 10224 springInitialVelocity: 0, 10225 }, 10226 intro: { 10227 revealStaggeredItemsDelayedStart: 0.6, 10228 separator0: 1, 10229 revealBackgroundCenterOpacityDuration: 0.6, 10230 revealBackgroundCenterOpacityDelay: 0, 10231 revealLabelCenterOpacityDuration: 0.25, 10232 revealLabelCenterOpacityDelay: 0.25, 10233 separator0b: 1, 10234 revealBackgroundWidthDuration: 0.8, 10235 revealBackgroundWidthStagger: 0.05, 10236 revealBackgroundWidthDelay: 0, 10237 separator1: 1, 10238 revealBackgroundOpacityDuration: 0.2, 10239 revealBackgroundOpacityStagger: 0, 10240 revealBackgroundOpacityDelay: 0.1, 10241 separator2: 1, 10242 revealBackgroundScale: 0.5, 10243 revealBackgroundScaleDuration: 0.8, 10244 revealBackgroundScaleStagger: 0.05, 10245 revealBackgroundScaleDelay: 0, 10246 separator3: 1, 10247 revealBackgroundY: 35, 10248 revealBackgroundYDuration: 1, 10249 revealBackgroundYStagger: 0, 10250 revealBackgroundYDelay: 0.05, 10251 separator4: 1, 10252 revealLabelOpacityDuration: 0.4, 10253 revealLabelOpacityStagger: 0.04, 10254 revealLabelOpacityDelay: 0.2, 10255 separator5: 1, 10256 revealLabelY: 7, 10257 revealLabelYDuration: 0.2, 10258 revealLabelYStagger: 0.02, 10259 revealLabelYDelay: 0.16, 10260 }, 10261 introEaseFunctions: { 10262 spring: { 10263 springMass: 1, 10264 springStiffness: 100, 10265 springDamping: 14, 10266 springInitialVelocity: 0, 10267 }, 10268 }, 10269 }; 10270 } 10271 mounted() { 10272 this.productViewer.isSmall || 10273 (this._resetAccessibilityContainerPositions(), 10274 requestAnimationFrame(() => { 10275 this._aapIntroAnimationEvents(); 10276 }), 10277 this.productViewer.reducedMotion || 10278 this.productViewerCore.cachedControls.forEac
10278h((e) => { 10279 e.button.el.style.visibility = "hidden"; 10280 }), 10281 this.productViewerCore.cachedControls.forEach((e, t) => { 10282 e = e.content.el.querySelector("video"); 10283 e && 10284 (this.productViewerCore.cachedControls[t].content.media = 10285 e); 10286 }), 10287 this.productViewer.reducedMotion && 10288 this.controlsEl.removeAttribute("aria-hidden")); 10289 } 10290 onInputChange(e) { 10291 this.productViewer.isSmall || 10292 (this.productViewer.reducedMotion 10293 ? (this._lastSelected.el.style.height = 10294 this.productViewerCore.cachedControls[ 10295 this._lastSelected.index 10296 ].content.height + "px") 10297 : ((this._animationInProgress = !0), 10298 this.anim.addTween(this._lastSelected.el, { 10299 duration: this.PANE_PARAMS.expandCard.duration, 10300 delay: this.PANE_PARAMS.expandCard.delay, 10301 easeFunction: `spring(${this.PANE_PARAMS.expandCard.springMass}, ${this.PANE_PARAMS.expandCard.springStiffness}, ${this.PANE_PARAMS.expandCard.springDamping}, ${this.PANE_PARAMS.expandCard.springInitialVelocity})`, 10302 height: [ 10303 null, 10304 this.productViewerCore.cachedControls[ 10305 this._lastSelected.index 10306 ].content.height, 10307 ], 10308 onComplete: () => { 10309 this._animationInProgress = !1; 10310 }, 10311 }))); 10312 } 10313 _addEventListeners() { 10314 ((this._closeButtonClicked = 10315 this._closeButtonClicked.bind(this)), 10316 this.closeButton.addEventListener( 10317 "click", 10318 this._closeButtonClicked, 10319 ), 10320 this.productViewerCore.productViewerContainer.addEventListener( 10321 "pointerdown", 10322 this._closeButtonClicked, 10323 ), 10324 (this.expandEventHandlers = []), 10325 this.productViewerCore.controlItems.forEach((e) => { 10326 var t = this._expandItem.bind(this); 10327 (e.addEventListener("click", t), 10328 this.expandEventHandlers.push([e, t])); 10329 }), 10330 (this.onInputChange = this.onInputChange.bind(this)), 10331 this.toggleOptions.forEach((e) => { 10332 e.addEventListener("change", this.onInputChange); 10333 }), 10334 this._paddlenavContainer && 10335 ((this._onClickPrevPaddleNav = 10336 this._onClickPrevPaddleNav.bind(this)), 10337 (this._onClickNextPaddleNav = 10338 this._onClickNextPaddleNav.bind(this)), 10339 this._prevPaddlenav.addEventListener( 10340 "click", 10341 this._onClickPrevPaddleNav, 10342 ), 10343 this._nextPaddlenav.addEventListener( 10344 "click", 10345 this._onClickNextPaddleNav, 10346 )), 10347 (this._onTextZoomChanged = 10348 this._onTextZoomChanged.bind(this)), 10349 window.addEventListener( 10350 "resize:text-zoom", 10351 this._onTextZoomChanged, 10352 )); 10353 } 10354 _closeButtonClicked(e) { 10355 var t; 10356 if (this.isPaddlenavOpen) { 10357 if (!e.currentTarget.classList.contains("close-button")) 10358 return; 10359 (this._paddlenavContainer && 10360 (this.anim.addTween(this._paddlenavContainer, { 10361 duration: this.productViewer.reducedMotion ? 0.1 : 0.3, 10362 easeFunction: (t = "easeOutQuart"), 10363 scale: [1, 0], 10364 onComplete: () => { 10365 this._paddlenavContainer.classList.toggle( 10366 "visible", 10367 !1, 10368 ); 10369 }, 10370 }), 10371 this.anim.addTween(this._paddlenavContainer, { 10372 duration: this.productViewer.reducedMotion ? 0.1 : 0.6, 10373 easeFunction: t, 10374 y: [null, 120], 10375 })), 10376 this._closeButtonAnimation("out"), 10377 e.type 10378 ? null != (t = this._lastSelected) && 10379 t.el.querySelector("button").focus() 10380 : null != (e = document.activeElement) && e.blur(), 10381 this._resetAccessibilityContainerPositions(), 10382 (this.isPaddlenavOpen = !1)); 10383 } 10384 (this._lastSelected.el && 10385 this._transitionElement( 10386 this.productViewerEnhancedWrapper, 10387 "in", 10388 "tour-out", 10389 ), 10390 this._resetLastSelected("tour-out"), 10391 this.productViewerCore.landingElementAccessibilityContainer.removeAttribute( 10392 "aria-hidden", 10393 ), 10394 (this.currentSelected = null)); 10395 } 10396 _expandItem(e) { 10397 var t, i, s, r; 10398 this.productViewer.isSmall || 10399 ((this.currentSelected = e.currentTarget), 10400 (s = parseInt(this.currentSelected.dataset.index, 10)), 10401 this._lastSelected.el && 10402 this._lastSelected.el.className === 10403 this.currentSelected.className) || 10404 (this.productViewerCore.landingElementAccessibilityContainer.setAttribute( 10405 "aria-hidden", 10406 "true", 10407 ), 10408 (i = this.productViewerCore.cachedControls[s].button.el), 10409 (s = 10410 this.productViewerCore.cachedControls[s].content.el 10411 .parentElement), 10412 (t = `spring(${this.PANE_PARAMS.expandCard.springMass}, ${this.PANE_PARAMS.expandCard.springStiffness}, ${this.PANE_PARAMS.expandCard.springDamping}, ${this.PANE_PARAMS.expandCard.springInitialVelocity})`), 10413 (r = i.dataset.tourMediaId) && 10414 ((r = this.element.querySelector( 10415 ".product-viewer-media-gallery .tour-" + r, 10416 )), 10417 this._lastSelected.el 10418 ? this._transitionElement(r, "in") 10419 : this._transitionElement(r, "in", "tour-in")), 10420 this._resetLastSelected(), 10421 this.currentSelected.classList.add("expanded"), 10422 s.setAttribute("aria-hidden", "false"), 10423 i.setAttribute("aria-expanded", "true"), 10424 i.setAttribute("aria-hidden", "true"), 10425 i.setAttribute("tabindex", "-1"), 10426 e.target && s.focus(), 10427 (this._lastSelected.el = this.currentSelected), 10428 (this._lastSelected.index = parseInt( 10429 this.currentSelected.dataset.index, 10430 10, 10431 )), 10432 this._paddlenavContainer && this._updatePaddleNavState(), 10433 null != (r = this.productViewer.channelContainer) && 10434 r.classList.contains("enhanced") && 10435 this.productViewerCore.cachedControls[ 10436 this._lastSelected.index 10437 ].content.media && 10438 (this.productViewerCore.cachedControls[ 10439 this._lastSelected.index 10440 ].cardMedia.el.classList.contains("loaded") || 10441 ((i = 10442 this.productViewerCore.cachedControls[ 10443 this._lastSelected.index 10444 ].cardMedia.el.dataset.shortid), 10445 null != 10446 (e = 10447 null == 10448 (r = 10449 null == 10450 (s = 10451 null == (e = window.channelHtml18pro) 10452 ? void 0 10453 : e.inlineMedia) 10454 ? void 0 10455 : s.instances) 10456 ? void 0 10457 : r[i]) && 10458 e.mediaItem && 10459 !e.mediaItem._destroyed && 10460 e.mediaItem.load()), 10461 (this.productViewerCore.cachedControls[ 10462 this._lastSelected.index 10463 ].content.media.currentTime = 0), 10464 null != 10465 (s = 10466 this.productViewerCore.cachedControls[ 10467 this._lastSelected.index 10468 ].content.media.play())) && 10469 s.catch(() => {}), 10470 this.productViewer.reducedMotion 10471 ? ((this.currentSelected.style.width = 10472 this.productViewerCore.cachedControls[ 10473 this._lastSelected.index 10474 ].content.width + "px"), 10475 (this.currentSelected.style.height = 10476 this.productViewerCore.cachedControls[ 10477 this._lastSelected.index 10478 ].content.height + "px")) 10479 : ((this._animationInProgress = !0), 10480 this.anim.addTween(this.currentSelected, { 10481 duration: this.PANE_PARAMS.expandCard.duration, 10482 delay: this.PANE_PARAMS.expandCard.delay, 10483 easeFunction: t, 10484 width: [ 10485 this.productViewerCore.cachedControls[ 10486 this._lastSelected.index 10487 ].button.width, 10488 this.productViewerCore.cachedControls[ 10489 this._lastSelected.index 10490 ].content.width, 10491 ], 10492 height: [ 10493 this.productViewerCore.cachedControls[ 10494 this._lastSelected.index 10495 ].button.height, 10496 this.productViewerCore.cachedControls[ 10497 this._lastSelected.index 10498 ].content.height, 10499 ], 10500 onComplete: () => { 10501 this._animationInProgress = !1; 10502 }, 10503 })), 10504 (this.productViewerCore.cachedGlobalDimensions.aap.expanded = 10505 { 10506 width: 10507 this.productViewerCore.cachedControls[ 10508 this._lastSelected.index 10509 ].content.width, 10510 height: 10511 this.productViewerCore.cachedGlobalDimensions.aap 10512 .contracted.height - 10513 this.productViewerCore.cachedControls[ 10514 this._lastSelected.index 10515 ].button.height + 10516 this.productViewerCore.cachedControls[ 10517 this._lastSelected.index 10518 ].content.height, 10519 }), 10520 this._checkItemInContainer(), 10521 this._repositionAccessibilityContainers(), 10522 this.isPaddlenavOpen 10523 ? this._paddlenavContainer && 10524 this.anim.addTween(this._paddlenavContainer, { 10525 duration: this.productViewer.reducedMotion 10526 ? 0.1 10527 : this.PANE_PARAMS.expandCard.duration, 10528 delay: this.productViewer.reducedMotion 10529 ? 0 10530 : this.PANE_PARAMS.expandCard.delay, 10531 easeFunction: t, 10532 y: [null, -this.aapContainerOffsetY], 10533 }) 10534 : (this._closeButtonAnimation("in"), 10535 this._paddlenavContainer && 10536 ((r = "easeOutQuart"), 10537 this._paddlenavContainer.classList.toggle( 10538 "visible", 10539 !0, 10540 ), 10541 this.anim.addTween(this._paddlenavContainer, { 10542 duration: this.productViewer.reducedMotion 10543 ? 0.1 10544 : 0.3, 10545 easeFunction: r, 10546 scale: [0, 1], 10547 }), 10548 this.anim.addTween(this._paddlenavContainer, { 10549 duration: this.productViewer.reducedMotion 10550 ? 0.1 10551 : 0.6, 10552 easeFunction: r, 10553 y: [120, -this.aapContainerOffsetY], 10554 })),
10555 (this.isPaddlenavOpen = !0))); 10556 } 10557 _onClickPrevPaddleNav(e) { 10558 var t = this._lastSelected.index - 1; 10559 (0 == t 10560 ? (this._nextPaddlenav.focus(), 10561 this._prevPaddlenav.setAttribute("disabled", "true")) 10562 : requestAnimationFrame(() => { 10563 this._prevPaddlenav.focus(); 10564 }), 10565 t < this.productViewerCore.controlItems.length - 1 && 10566 this._nextPaddlenav.removeAttribute("disabled"), 10567 this._expandItem({ 10568 currentTarget: this.productViewerCore.controlItems[t], 10569 })); 10570 } 10571 _onClickNextPaddleNav(e) { 10572 var t; 10573 this._lastSelected.el 10574 ? ((t = this._lastSelected.index + 1) === 10575 this.productViewerCore.controlItems.length - 1 && 10576 (requestAnimationFrame(() => { 10577 this._prevPaddlenav.focus(); 10578 }), 10579 this._nextPaddlenav.setAttribute("disabled", "true")), 10580 0 < t && this._prevPaddlenav.removeAttribute("disabled"), 10581 this._expandItem({ 10582 currentTarget: this.productViewerCore.controlItems[t], 10583 })) 10584 : this._expandItem({ 10585 currentTarget: this.productViewerCore.controlItems[0], 10586 }); 10587 } 10588 _checkItemInContainer() { 10589 var e = 10590 this.productViewerCore.cachedGlobalDimensions.container 10591 .height - 80, 10592 t = 10593 this.productViewerCore.cachedGlobalDimensions.aap.expanded 10594 .height - e, 10595 i = this.controlsContainerItemGap; 10596 !(0 < t) || 10597 ((t = 10598 (i = 10599 (this.productViewerCore.cachedControls[ 10600 this._lastSelected.index 10601 ].button.height + 10602 i) * 10603 this._lastSelected.index - 10604 t / 2) + 10605 this.productViewerCore.cachedControls[ 10606 this._lastSelected.index 10607 ].content.height), 10608 0 < i && t < e) 10609 ? (this.aapContainerOffsetY = 0) 10610 : (this._lastSelected.index < 10611 this.productViewerCore.cachedControls.length / 2 10612 ? (this.aapContainerOffsetY = -1 * i) 10613 : (this.aapContainerOffsetY = -1 * (t - e)), 10614 this.anim.addTween(this.controlsEl, { 10615 duration: this.productViewer.reducedMotion 10616 ? 0.1 10617 : this.PANE_PARAMS.expandCard.duration, 10618 delay: this.productViewer.reducedMotion 10619 ? 0 10620 : this.PANE_PARAMS.expandCard.delay, 10621 easeFunction: `spring(${this.PANE_PARAMS.expandCard.springMass}, ${this.PANE_PARAMS.expandCard.springStiffness}, ${this.PANE_PARAMS.expandCard.springDamping}, ${this.PANE_PARAMS.expandCard.springInitialVelocity})`, 10622 y: [null, this.aapContainerOffsetY], 10623 })); 10624 } 10625 _repositionAccessibilityContainers() { 10626 let s = 10627 (this.productViewerCore.cachedGlobalDimensions.container 10628 .height - 10629 this.productViewerCore.cachedGlobalDimensions.aap.expanded 10630 .height) / 10631 2; 10632 this.productViewerCore.cachedControls.forEach((e, t) => { 10633 var i; 10634 t === this._lastSelected.index 10635 ? ((i = -e.button.y - s - this.aapContainerOffsetY), 10636 (e.accessibilityContainer.el.style.top = i + "px")) 10637 : t > this._lastSelected.index 10638 ? ((i = 10639 -e.button.y - 10640 this.productViewerCore.cachedControls[ 10641 this._lastSelected.index 10642 ].content.height + 10643 this.productViewerCore.cachedControls[ 10644 this._lastSelected.index 10645 ].button.height - 10646 s - 10647 this.aapContainerOffsetY),
10648 (e.accessibilityContainer.el.style.top = i + "px")) 10649 : ((t = -e.button.y - s - this.aapContainerOffsetY), 10650 (e.accessibilityContainer.el.style.top = t + "px")); 10651 }); 10652 } 10653 _updatePaddleNavState() { 10654 (0 === this._lastSelected.index && 10655 this._prevPaddlenav.setAttribute("disabled", "true"), 10656 this._lastSelected.index === 10657 this.productViewerCore.controlItems.length - 1 && 10658 (this._nextPaddlenav.setAttribute("disabled", "true"), 10659 this._prevPaddlenav.removeAttribute("disabled")), 10660 0 < this._lastSelected.index && 10661 this._lastSelected.index < 10662 this.productViewerCore.controlItems.length - 1 && 10663 (this._prevPaddlenav.removeAttribute("disabled"), 10664 this._nextPaddlenav.removeAttribute("disabled"))); 10665 } 10666 _onTextZoomChanged(e) { 10667 (this._closeButtonClicked({ 10668 currentTarget: this.element.querySelector(".close-button"), 10669 }), 10670 requestAnimationFrame(() => { 10671 (this.productViewerCore.onResizeDebounced(), 10672 this.productViewerCore.controlItems.forEach((e, t) => { 10673 e.classList.contains("expanded") 10674 ? ((e.style.width = 10675 this.productViewerCore.cachedControls[t].content 10676 .width + "px"), 10677 (e.style.height = 10678 this.productViewerCore.cachedControls[t].content 10679 .height + "px")) 10680 : ((e.style.width = 10681 this.productViewerCore.cachedControls[t].button 10682 .width + "px"), 10683 (e.style.height = 10684 this.productViewerCore.cachedControls[t].button 10685 .height + "px")); 10686 })); 10687 })); 10688 } 10689 _closeButtonAnimation(e) { 10690 var t; 10691 ("out" === e && 10692 (this.anim.addTween(this.closeButton, { 10693 duration: this.productViewer.reducedMotion ? 0.1 : 0.3, 10694 easeFunction: (t = "easeOutQuart"), 10695 scale: [1, 0], 10696 onComplete: () => { 10697 this.closeButton.classList.toggle("visible", !1); 10698 }, 10699 }), 10700 this.anim.addTween(this.closeButton, { 10701 duration: this.productViewer.reducedMotion ? 0.1 : 0.6, 10702 easeFunction: t, 10703 y: [0, 120], 10704 })), 10705 "in" === e && 10706 ((t = "spring(1, 56, 10, 0.00)"), 10707 this.closeButton.classList.toggle("visible", !0), 10708 this.anim.addTween(this.closeButton, { 10709 duration: this.productViewer.reducedMotion ? 0.1 : 0.3, 10710 easeFunction: t, 10711 scale: [0, 1], 10712 }), 10713 this.anim.addTween(this.closeButton, { 10714 duration: this.productViewer.reducedMotion ? 0.1 : 0.6, 10715 easeFunction: t, 10716 y: [120, 0], 10717 }))); 10718 } 10719 _resetLastSelected(n) { 10720 var o; 10721 if (!this.productViewer.isSmall) 10722 if (this._lastSelected.el) { 10723 let e = this._lastSelected.el, 10724 t = 10725 this.productViewerCore.cachedControls[ 10726 this._lastSelected.index 10727 ].button.el, 10728 i = 10729 this.productViewerCore.cachedControls[ 10730 this._lastSelected.index 10731 ].content.el.parentElement, 10732 s = `spring(${this.PANE_PARAMS.expandCard.springMass}, ${this.PANE_PARAMS.expandCard.springStiffness}, ${this.PANE_PARAMS.expandCard.springDamping}, ${this.PANE_PARAMS.expandCard.springInitialVelocity})`, 10733 r = t.dataset.tourMediaId; 10734 (r && 10735 ((o = this.element.querySelector( 10736 ".product-viewer-media-gallery .tour-" + r, 10737 )), 10738 this._transitionElement(o, "out", n)), 10739 requestAnimationFrame(() => { 10740 e.classList.remove("expanded"); 10741 }), 10742 i.setAttribute("aria-hidden", "true"), 10743 t.setAttribute("aria-expanded", "false"), 10744 t.removeAttribute("aria-hidden"), 10745 t.removeAttribute("tabindex"), 10746 this.productViewer.reducedMotion 10747 ? e.removeAttribute("style") 10748 : this.anim.addTween(e, { 10749 duration: this.productViewer.reducedMotion 10750 ? 0.1 10751 : this.PANE_PARAMS.expandCard.duration, 10752 delay: this.productViewer.reducedMotion 10753 ? 0 10754 : this.PANE_PARAMS.expandCard.delay, 10755 easeFunction: s, 10756 width: [ 10757 this.productViewerCore.cachedControls[ 10758 this._lastSelected.index 10759 ].content.width, 10760 this.productViewerCore.cachedControls[ 10761 this._lastSelected.index 10762 ].button.width, 10763 ], 10764 height: [ 10765 this.productViewerCore.cachedControls[ 10766 this._lastSelected.index 10767 ].content.height, 10768 this.productViewerCore.cachedControls[ 10769 this._lastSelected.index 10770 ].button.height, 10771 ], 10772 }), 10773 this.anim.addTween(this.controlsEl, { 10774 duration: this.productViewer.reducedMotion 10775 ? 0.1 10776 : this.PANE_PARAMS.expandCard.duration, 10777 delay: this.productViewer.reducedMotion 10778 ? 0 10779 : this.PANE_PARAMS.expandCard.delay, 10780 easeFunction: s, 10781 y: [null, 0], 10782 }), 10783 null != (o = this.productViewer.channelContainer) && 10784 o.classList.contains("enhanced") && 10785 null != (n = this.productViewer.channelContainer) && 10786 n.classList.contains("inline-media") && 10787 this.productViewerCore.cachedControls[ 10788 this._lastSelected.index 10789 ].content.media && 10790 this.productViewerCore.cachedControls[ 10791 this._lastSelected.index 10792 ].content.media.pause(), 10793 this._paddlenavContainer && 10794 (this._prevPaddlenav.setAttribute("disabled", "true"), 10795 this._nextPaddlenav.removeAttribute("disabled")), 10796 (this._lastSelected = { el: null, index: null })); 10797 } else 10798 !this._lastSelected.el && 10799 this.currentSelected && 10800 this._transitionElement( 10801 this.productViewerEnhancedWrapper, 10802 "out", 10803 "tour-in", 10804 ); 10805 } 10806 _transitionElement(i, e, t) { 10807 var s, r; 10808 i && 10809 ((s = () => { 10810 var e; 10811 (null != (e = this.productViewer.channelContainer) && 10812 e.classList.contains("no-enhanced")) || 10813 (null != (e = this.productViewer.channelContainer) && 10814 e.classList.contains("no-inline-media")) || 10815 !i.classList.contains("tour-video") || 10816 ((e = i.querySelector("video")) && e.pause()); 10817 }), 10818 (r = () => { 10819 var e, t; 10820 (null != (e = this.productViewer.channelContainer) && 10821 e.classList.contains("no-enhanced")) || 10822 (null != (e = this.productViewer.channelContainer) && 10823 e.classList.contains("no-inline-media")) || 10824 !i.classList.contains("tour-video") || 10825 ((e = i.querySelector( 10826 ".inline-media-component-container", 10827 )) && 10828 !e.classList.contains("loaded") && 10829 ((e = e.dataset.shortid), 10830 null != 10831 (t = 10832 null == 10833 (t = 10834 null == 10835 (t = 10836 null == (t = window.channelHtml18pro) 10837 ? void 0 10838 : t.inlineMedia) 10839 ? void 0 10840 : t.instances) 10841 ? void 0 10842 : t[e])) && 10843 t.mediaItem && 10844 !t.mediaItem._destroyed && 10845 t.mediaItem.load(), 10846 (e = i.querySelector("video")) && 10847 ((e.currentTime = 0), null != (t = e.play())) && 10848 t.catch(() => {})); 10849 }), 10850 "tour-in" === t 10851 ? "in" === e 10852 ? (r(), 10853 (i.style.pointerEvents = "auto"), 10854 this.productViewer.reducedMotion 10855 ? (i.removeAttribute("style"), 10856 (i.style.opacity = "1")) 10857 : ((i.style.visibility = "visible"), 10858 (i.style.display = "grid"), 10859 this.anim.addTween(i, { 10860 easeFunction: "spring(1, 60, 10, 0)", 10861 delay: 0.1, 10862 opacity: [0, 1], 10863 duration: 0.45, 10864 }))) 10865 : "out" === e && 10866 (s(), 10867 (i.style.pointerEvents = "none"), 10868 this.productViewer.reducedMotion 10869 ? i.removeAttribute("style") 10870 : ((i.style.visibility = "visible"), 10871 (i.style.display = "grid"), 10872 this.anim.addTween(i, { 10873 easeFunction: "easeInQuad", 10874 duration: 0.15, 10875 opacity: [1, 0], 10876 onComplete: () => { 10877 ((i.style.visibility = "hidden"), 10878 i.style.setProperty( 10879 "display", 10880 "none", 10881 "important", 10882 )); 10883 }, 10884 }))) 10885 : "tour-out" === t 10886 ? "in" === e 10887 ? (r(), 10888 (i.style.pointerEvents = "auto"), 10889 this.productViewer.reducedMotion 10890 ? (i.removeAttribute("style"), 10891 (i.style.opacity = "1")) 10892 : ((i.style.visibility = "visible"), 10893 (i.style.display = "grid"), 10894 this.anim.addTween(i, { 10895 easeFunction: "spring(1, 60, 10, 0)", 10896 delay: 0.1, 10897 duration: 0.45, 10898 opacity: [0, 1], 10899 }))) 10900 : "out" === e && 10901 (s(), 10902 (i.style.pointerEvents = "none"), 10903 this.productViewer.reducedMotion 10904 ? i.removeAttribute("style") 10905 : ((i.style.visibility = "visible"), 10906 (i.style.display = "grid"), 10907 this.anim.addTween(i, { 10908 easeFunction: "easeInQuad", 10909 duration: 0.15, 10910 opacity: [1, 0], 10911 onComplete: () => { 10912 i.removeAttribute("style"); 10913 }, 10914 }))) 10915 : "in" === e 10916 ? (r(), 10917 (i.style.pointerEvents = "auto"), 10918 this.productViewer.reducedMotion 10919 ? (i.removeAttribute("style"), 10920 (i.style.opacity = "1")) 10921 : ((i.style.visibility = "visible"), 10922 (i.style.display = "grid"), 10923 this.anim.addTween(i, { 10924 easeFunction: "spring(1, 60, 10, 0)", 10925 delay: 0.1, 10926 opacity: [0, 1], 10927 duration: 0.45, 10928 }))) 10929 : "out" === e && 10930 (s(), 10931 (i.style.pointerEvents = "none"), 10932 this.productViewer.reducedMotion 10933 ? i.removeAttribute("style") 10934 : ((i.style.visibility = "visible"), 10935 (i.style.display = "grid"), 10936 this.anim.addTween(i, { 10937 easeFunction: "easeInQuad", 10938 duration: 0.15, 10939 opacity: [1, 0], 10940 onComplete: () => { 10941 ((i.style.visibility = ""), 10942 (i.style.display = "")); 10943 }, 10944 })))); 10945 } 10946 _aapIntroAnimationEvents() { 10947 ((this.aapScrollGroup = this.anim.createScrollGroup( 10948 this.element, 10949 )), 10950 (this.aapScrollGroup.name = 10951 "Product Viewer 2D :: AAP Intro trigger"), 10952 this.aapScrollGroup.addEvent(this.element, { 10953 start: "t + 60h - 100vh", 10954 end: "b - 50vh", 10955 onEnterOnce: () => { 10956 this._triggerAnimationIntroElement(); 10957 }, 10958 }), 10959 this.aapScrollGroup.addEvent(this.element, { 10960 start: "t - 100vh", 10961 end: "b", 10962 onExit: () => { 10963 this._closeButtonClicked({ 10964 currentTarget: this.closeButton, 10965 }); 10966 }, 10967 })); 10968 } 10969 _triggerAnimationIntroElement() { 10970 var e; 10971 this.productViewer.reducedMotion || 10972 this.productViewer.isSmall || 10973 this.introAnimationFinished || 10974 this.introAnimationInProgress || 10975 ((this.introAnimationInProgress = !0), 10976 (this.controlsEl.style.pointerEvents = "none"), 10977 (e = Math.floor( 10978 thi
10978s.productViewerCore.controlItems.length / 2, 10979 )), 10980 (this._introElementData.el.style.transform = `translateY(${this.productViewerCore.cachedControls[e].button.y}px)`), 10981 this.anim.addTween(this._introElementData.el, { 10982 duration: 1.4, 10983 easeFunction: `spring(1.61, ${this.PANE_PARAMS.expandCard.springStiffness}, ${this.PANE_PARAMS.expandCard.springDamping}, ${this.PANE_PARAMS.expandCard.springInitialVelocity})`, 10984 opacity: [1, 1], 10985 scale: [ 10986 this._introElementData.animations.scale.origin, 10987 this._introElementData.animations.scale.target, 10988 ], 10989 x: [ 10990 this._introElementData.animations.x.origin, 10991 this._introElementData.animations.x.target, 10992 ], 10993 onComplete: () => { 10994 this.controlsEl.style.pointerEvents = "auto"; 10995 }, 10996 }), 10997 this.anim.addTween(this._introElementData.el, { 10998 duration: this.PANE_PARAMS.introElement.peScaleDuration, 10999 delay: this.PANE_PARAMS.introElement.peScaleDelay, 11000 easeFunction: `spring(${this.PANE_PARAMS.introElementEaseFunction.springMass}, ${this.PANE_PARAMS.introElementEaseFunction.springStiffness}, ${this.PANE_PARAMS.introElementEaseFunction.springDamping}, ${this.PANE_PARAMS.introElementEaseFunction.springInitialVelocity})`, 11001 "--pe-scale": [0, 1.008], 11002 }), 11003 (this._introPillsTimeout = setTimeout(() => { 11004 (this.controlsEl.removeAttribute("aria-hidden"), 11005 this._introStaggeredPillsAnimation()); 11006 }, 1e3 * this.PANE_PARAMS.intro.revealStaggeredItemsDelayedStart))); 11007 } 11008 _introStaggeredPillsAnimation() { 11009 var e = Math.floor( 11010 this.productViewerCore.controlItems.length / 2, 11011 ), 11012 r = `spring(${this.PANE_PARAMS.introEaseFunctions.spring.springMass}, ${this.PANE_PARAMS.introEaseFunctions.spring.springStiffness}, ${this.PANE_PARAMS.introEaseFunctions.spring.springDamping}, ${this.PANE_PARAMS.introEaseFunctions.spring.springInitialVelocity})`; 11013 let n = 0, 11014 { 11015 revealBackgroundWidthDuration: o, 11016 revealBackgroundWidthStagger: a, 11017 revealBackgroundWidthDelay: l, 11018 revealBackgroundOpacityDuration: h, 11019 revealBackgroundOpacityStagger: c, 11020 revealBackgroundOpacityDelay: d, 11021 revealBackgroundScale: u, 11022 revealBackgroundScaleDuration: p, 11023 revealBackgroundScaleStagger: m, 11024 revealBackgroundScaleDelay: g, 11025 revealBackgroundY: f, 11026 revealBackgroundYDuration: v, 11027 revealBackgroundYStagger: y, 11028 revealBackgroundYDelay: w, 11029 revealLabelOpacityDuration: _, 11030 revealLabelOpacityStagger: A, 11031 revealLabelOpacityDelay: C, 11032 revealLabelY: E, 11033 revealLabelYDuration: b, 11034 revealLabelYStagger: x, 11035 revealLabelYDelay: S, 11036 } = this.PANE_PARAMS.intro, 11037 t = 11038 this.productViewerCore.controlItems[e].querySelector( 11039 ".control-item-bg", 11040 ), 11041 i = this.productViewerCore.controlItems[e].querySelector( 11042 ".control-item-label", 11043 ); 11044 ((this.productViewerCore.cachedControls[ 11045 e 11046 ].button.el.style.visibility = "visible"), 11047 (t.parentElement.style["justify-content"] = "flex-start"), 11048 this.anim.addTween(t, { 11049 duration: 11050 this.PANE_PARAMS.intro
11051 .revealBackgroundCenterOpacityDuration, 11052 delay: 11053 this.PANE_PARAMS.intro.revealBackgroundCenterOpacityDelay, 11054 easeFunction: r, 11055 opacity: [1, 1], 11056 width: [ 11057 56, 11058 this.productViewerCore.cachedControls[e].button.width, 11059 ], 11060 onStart: () => { 11061 this._introElementData.el.style.display = "none"; 11062 }, 11063 onComplete: () => { 11064 t.style.removeProperty("width"); 11065 }, 11066 }), 11067 this.anim.addTween(i, { 11068 duration: 11069 this.PANE_PARAMS.intro.revealLabelCenterOpacityDuration, 11070 delay: this.PANE_PARAMS.intro.revealLabelCenterOpacityDelay, 11071 easeFunction: this.ANIM_CONSTANTS.easeIn, 11072 opacity: [0, 1], 11073 onComplete: () => { 11074 i.style.opacity = 1; 11075 }, 11076 })); 11077 for (let s = e - 1; 0 <= s; s--) { 11078 let e = 11079 this.productViewerCore.controlItems[s].querySelector( 11080 ".control-item-bg", 11081 ), 11082 t = this.productViewerCore.controlItems[s].querySelector( 11083 ".control-item-label", 11084 ), 11085 i = t.querySelector(".control-color-active-swatch"); 11086 if ( 11087 ((this.productViewerCore.cachedControls[ 11088 s 11089 ].button.el.style.visibility = "visible"), 11090 this.anim.addTween(e, { 11091 duration: o, 11092 delay: 0 + l + n * a, 11093 easeFunction: r, 11094 width: [ 11095 this.productViewerCore.cachedControls[s].button.height, 11096 this.productViewerCore.cachedControls[s].button.width, 11097 ], 11098 onComplete: () => { 11099 e.style.removeProperty("width"); 11100 }, 11101 }), 11102 this.anim.addTween(e, { 11103 duration: h, 11104 delay: 0 + d + n * c, 11105 easeFunction: r, 11106 opacity: [0, 1], 11107 }), 11108 this.anim.addTween(e, { 11109 duration: p, 11110 delay: 0 + g + n * m, 11111 easeFunction: r, 11112 scale: [u, 1], 11113 }), 11114 this.anim.addTween(e, { 11115 duration: v, 11116 delay: 0 + w + n * y, 11117 easeFunction: r, 11118 y: [f, 0], 11119 }), 11120 i) 11121 ) { 11122 ((t.style.opacity = 1), 11123 this.anim.addTween(i, { 11124 duration: _, 11125 delay: 0 + C + n * A, 11126 easeFunction: this.ANIM_CONSTANTS.easeIn, 11127 opacity: [0, 1], 11128 }), 11129 this.anim.addTween(i, { 11130 duration: p, 11131 delay: 0 + g + n * m, 11132 easeFunction: r, 11133 scale: [0, 1], 11134 }), 11135 this.anim.addTween(i, { 11136 duration: v, 11137 delay: 0 + w + n * y, 11138 easeFunction: r, 11139 y: [f, 0], 11140 })); 11141 let e = this.productViewerCore.controlItems[ 11142 s 11143 ].querySelector(".control-color-active-label"); 11144 (this.anim.addTween(e, { 11145 duration: _, 11146 delay: 0 + C + n * A, 11147 easeFunction: this.ANIM_CONSTANTS.easeIn, 11148 opacity: [0, 1], 11149 onComplete: () => { 11150 e.style.opacity = 1; 11151 }, 11152 }), 11153 this.anim.addTween(e, { 11154 duration: b, 11155 delay: 0 + S + n * x, 11156 easeFunction: this.ANIM_CONSTANTS.easeIn, 11157 y: [E, 0], 11158 })); 11159 } else 11160 (this.anim.addTween(t, { 11161 duration: _, 11162 delay: 0 + C + n * A, 11163 easeFunction: this.ANIM_CONSTANTS.easeIn, 11164 opacity: [0, 1], 11165 onComplete: () => { 11166 t.style.opacity = 1; 11167 }, 11168 }), 11169 this.anim.addTween(t, { 11170 duration: b, 11171 delay: 0 + S + n * x, 11172 easeFunction: this.ANIM_CONSTANTS.easeIn, 11173 y: [E, 0], 11174 })); 11175 (0 === s && 11176 this.anim.addTween(this.aapEl, { 11177 duration: 1, 11178 delay: 0 + S + n * x + b, 11179 easeFunction: this.ANIM_CONSTANTS.easeIn, 11180 "--blur-amount": [0, 20, "px"], 11181 }), 11182 n++); 11183 } 11184 n = 0; 11185 for ( 11186 let i = e + 1; 11187 i <= this.productViewerCore.controlItems.length - 1; 11188 i++ 11189 ) { 11190 let e = 11191 this.productViewerCore.controlItems[i].querySelector( 11192 ".control-item-bg", 11193 ), 11194 t = this.productViewerCore.controlItems[i].querySelector( 11195 ".control-item-label", 11196 ); 11197 ((this.productViewerCore.cachedControls[ 11198 i 11199 ].button.el.style.visibility = "visible"), 11200 this.anim.addTween(e, { 11201 duration: o, 11202 delay: 0 + l + n * a, 11203 easeFunction: r, 11204 width: [ 11205 this.productViewerCore.cachedControls[i].button.height, 11206 this.productViewerCore.cachedControls[i].button.width, 11207 ], 11208 onComplete: () => { 11209 (e.style.removeProperty("width"), 11210 (this.introAnimationFinished = !0), 11211 (this.introAnimationInProgress = !1)); 11212 }, 11213 }), 11214 this.anim.addTween(e, { 11215 duration: h, 11216 delay: 0 + d + n * c, 11217 easeFunction: r, 11218 opacity: [0, 1], 11219 }), 11220 this.anim.addTween(e, { 11221 duration: p, 11222 delay: 0 + g + n * m, 11223 easeFunction: r, 11224 scale: [u, 1], 11225 }), 11226 this.anim.addTween(e, { 11227 duration: v, 11228 delay: 0 + w + n * y, 11229 easeFunction: r, 11230 y: [-f, 0], 11231 }), 11232 this.anim.addTween(t, { 11233 duration: _, 11234 delay: 0 + C + n * A, 11235 easeFunction: this.ANIM_CONSTANTS.easeIn, 11236 opacity: [0, 1], 11237 onComplete: () => { 11238 t.style.opacity = 1; 11239 }, 11240 }), 11241 this.anim.addTween(t, { 11242 duration: b, 11243 delay: 0 + S + n * x, 11244 easeFunction: this.ANIM_CONSTANTS.easeIn, 11245 y: [-E, 0], 11246 }), 11247 n++); 11248 } 11249 } 11250 _resetAccessibilityContainerPositions() { 11251 let t = 11252 (this.productViewerCore.cachedGlobalDimensions.container 11253 .height - 11254 this.productViewerCore.cachedGlobalDimensions.aap.contracted 11255 .height) / 11256 2;
11257 this.productViewerCore.cachedControls.forEach((e) => { 11258 e.accessibilityContainer.el.style.top = 11259 -e.button.y - t + "px"; 11260 }); 11261 } 11262 _softDestroy() { 11263 (this.element 11264 .querySelectorAll(".control-item-label") 11265 .forEach((e) => { 11266 e.removeAttribute("style"); 11267 }), 11268 this.productViewerCore.el.removeAttribute("style"), 11269 this.productViewerCore.cachedControls.forEach((e) => { 11270 (e.accessibilityContainer.el.removeAttribute("style"), 11271 e.button.el.removeAttribute("style"), 11272 e.button.el.removeAttribute("tabindex")); 11273 })); 11274 var e = 11275 this.productViewerCore.productViewerContainer.querySelector( 11276 ".product-viewer-media-gallery", 11277 ); 11278 (e && 11279 e.querySelectorAll(".product-viewer-media").forEach((e) => { 11280 e.removeAttribute("style"); 11281 }), 11282 this.closeButton.removeEventListener( 11283 "click", 11284 this._closeButtonClicked, 11285 ), 11286 this.productViewerCore.productViewerContainer.removeEventListener( 11287 "pointerdown", 11288 this._closeButtonClicked, 11289 ), 11290 window.removeEventListener( 11291 "resize:text-zoom", 11292 this._onTextZoomChanged, 11293 )); 11294 } 11295 onBreakpointChange(e) { 11296 (this._closeButtonClicked({ currentTarget: this.closeButton }), 11297 this.controlsEl.removeAttribute("aria-hidden")); 11298 var t = null == (t = this._introElementData) ? void 0 : t.el; 11299 (t && (t.style.display = "none"), 11300 (this.introAnimationFinished = !0), 11301 clearTimeout(this._introPillsTimeout), 11302 "small" === e.breakpoint || "xsmall" === e.breakpoint 11303 ? this._softDestroy() 11304 : (this.productViewerCore.onResizeDebounced(), 11305 (this.productViewerCore.cachedGlobalDimensions.container = 11306 this.productViewerCore.el.getBoundingClientRect()), 11307 (this.productViewerCore.cachedGlobalDimensions.aap.contracted = 11308 this.productViewerCore.aapEl.getBoundingClientRect()), 11309 this._resetAccessibilityContainerPositions(), 11310 this.productViewerCore._resetAccessibilityContainersAriaLabels(), 11311 this.aapEl.style.setProperty("--blur-amount", "20px"), 11312 this.closeButton.addEventListener( 11313 "click", 11314 this._closeButtonClicked, 11315 ), 11316 this.productViewerCore.productViewerContainer.addEventListener( 11317 "pointerdown", 11318 this._closeButtonClicked, 11319 ), 11320 window.addEventListener( 11321 "resize:text-zoom", 11322 this._onTextZoomChanged, 11323 ), 11324 this.productViewerCore.cachedControls.forEach((e) => { 11325 e.button.el.removeAttribute("style"); 11326 var t = e.el.querySelector(".control-item-label"), 11327 t = 11328 (t && (t.style.opacity = "1"), 11329 e.el.querySelector(".control-item-bg")); 11330 t && (t.style.opacity = "1"); 11331 }), 11332 this._onTextZoomChanged())); 11333 } 11334 destroy() { 11335 (this.closeButton && 11336 this.closeButton.removeEventListener( 11337 "click", 11338 this._closeButtonClicked, 11339 ), 11340 this.productViewerCore.productViewerContainer && 11341 this.productViewerCore.productViewerContainer.removeEventListener( 11342 "pointerdown", 11343 this._closeButtonClicked, 11344 ), 11345 this.expandEventHandlers &&
11346 (this.expandEventHandlers.forEach(([e, t]) => { 11347 e.removeEventListener("click", t); 11348 }), 11349 (this.expandEventHandlers = [])), 11350 this.toggleOptions && 11351 this.toggleOptions.forEach((e) => { 11352 e.removeEventListener("change", this.onInputChange); 11353 }), 11354 this._paddlenavContainer && 11355 (this._prevPaddlenav.removeEventListener( 11356 "click", 11357 this._onClickPrevPaddleNav, 11358 ), 11359 this._nextPaddlenav.removeEventListener( 11360 "click", 11361 this._onClickNextPaddleNav, 11362 )), 11363 window.removeEventListener( 11364 "resize:text-zoom", 11365 this._onTextZoomChanged, 11366 ), 11367 this._introPillsTimeout && 11368 clearTimeout(this._introPillsTimeout), 11369 this.aapScrollGroup && this.aapScrollGroup.remove()); 11370 } 11371 }, 11372 propName: "desktopInstance", 11373 }, 11374 { 11375 Class: class { 11376 constructor(e) { 11377 ((this.productViewer = e), 11378 (this.element = e.element), 11379 (this.anim = e.anim), 11380 (this.productViewerCore = e.productViewerCore), 11381 (this.didMount = !1), 11382 (this.destroyed = !0), 11383 (this.isRTL = e.isRTL), 11384 (this.direction = this.isRTL ? -1 : 1), 11385 (this.skipIntro = !1), 11386 (this.introElement = e.introElement), 11387 (this.viewerReset = e.productViewerContainer), 11388 (this.modelWrapper = e.productViewerGallery), 11389 (this.closeButton = e.closeButton), 11390 (this.landingElementAccessibilityContainer = 11391 e.landingElementAccessibilityContainer), 11392 (this.landingFallback = this.element.querySelectorAll( 11393 ".product-viewer.gallery .product-viewer-landing-fallback, .product-viewer.gallery .product-viewer-media", 11394 )), 11395 (this.stickyContainer = e.aapEl), 11396 (this.scrollContainer = 11397 this.element.querySelector(".controls")), 11398 (this.colorSelectorElement = e.colorSelectorElement), 11399 (this.colorSelectorElementIndex = 11400 this.productViewerCore.controlItems.indexOf( 11401 this.colorSelectorElement, 11402 ))); 11403 var e = e.productViewerCore.controlItems; 11404 ((this.leftMostItemIndex = this.isRTL ? e.length - 1 : 0), 11405 (this.rightMostItemIndex = this.isRTL ? 0 : e.length - 1), 11406 (this.tourExpanded = !1), 11407 (this.expandedWidth = Math.min( 11408 this.productViewer.pageMetrics.windowWidth - 80, 11409 400, 11410 )), 11411 (this.closestIndex = 0), 11412 (this.progress = 0), 11413 (this.offsetOrigin = 11414 (0.5 * this.productViewer.pageMetrics.windowWidth - 11415 0.5 * this.expandedWidth) * 11416 this.direction), 11417 (this.offsetMax = this.expandedWidth / 2 + 5), 11418 (this.maxCardHeight = 0), 11419 (this.colorSwatches = this.element.querySelectorAll( 11420 ".control-color .colornav-value", 11421 )), 11422 (this.settings = { 11423 scrollVelocityThreshold: 4, 11424 minimumQuickSwipeDistance: 16, 11425 maxSwipeVelocity: 0, 11426 swipeVelocity: 0, 11427 swipeDistance: 74, 11428 tourMorphBounce: 0.42, 11429 tourMorphDuration: 0.5, 11430 tourImageClipBounce: 0.24, 11431 tourImageClipDuration: 0.5, 11432 interactiveMorphBounce: 0, 11433 interactiveMorphDuration: 0.32, 11434 interactiveImageClipBounce: 0, 11435 interactiveImageClipDuration: 0.32, 11436 cardMorphBounce: 0.16, 11437 cardMorphDuration: 0.5, 11438 cardImageClipBounce: 0.16, 11439 cardImageClipDuration: 0.5, 11440 }), 11441 (this.noSafari = 11442 (null == (e = this.productViewer.channelContainer) 11443 ? void 0 11444 : e.classList.contains("no-safari")) ?? !1), 11445 this.bindEvents()); 11446 } 11447 destroy() { 11448 var e; 11449 this.didMount && 11450 ((this.destroyed = !0),
11451 this.productViewerCore.cachedControls.forEach((e) => { 11452 var t; 11453 ((e.spring = null == (t = e.spring) ? void 0 : t.destroy()), 11454 (e.content.spring = 11455 null == (t = e.content.spring) ? void 0 : t.destroy()), 11456 e.cardMedia && 11457 (e.cardMedia.spring = 11458 null == (t = e.cardMedia.spring) 11459 ? void 0 11460 : t.destroy()), 11461 e.tourMedia.id && 11462 (e.tourMedia.spring = 11463 null == (t = e.tourMedia.spring) 11464 ? void 0 11465 : t.destroy()), 11466 (e.controls.spring = 11467 null == (t = e.controls.spring) ? void 0 : t.destroy()), 11468 e.button.el.removeEventListener( 11469 "pointerdown", 11470 this._onOpenButtonPointerDown, 11471 ), 11472 e.button.el.removeEventListener( 11473 "pointerup", 11474 this._onOpenButtonPointerUp, 11475 ), 11476 e.button.el.removeEventListener( 11477 "click", 11478 this.onOpenButtonClick, 11479 ), 11480 e.button.el.removeEventListener( 11481 "focus", 11482 this._onOpenButtonFocus, 11483 ), 11484 e.controls.prevButton.removeEventListener( 11485 "click", 11486 this.onPrevClick, 11487 ), 11488 e.controls.nextButton.removeEventListener( 11489 "click", 11490 this.onNextClick, 11491 ), 11492 e.el.classList.remove("expanded"), 11493 e.button.el.classList.remove("activated")); 11494 }), 11495 this.landingFallback[0].classList.remove("should-hide"), 11496 (this.introElementSpring = 11497 null == (e = this.introElementSpring) 11498 ? void 0 11499 : e.destroy()), 11500 (this.modeSpring = 11501 null == (e = this.modeSpring) ? void 0 : e.destroy()), 11502 (this.closeButtonSpring = 11503 null == (e = this.closeButtonSpring) 11504 ? void 0 11505 : e.destroy()), 11506 (this.modelSpring = 11507 null == (e = this.modelSpring) ? void 0 : e.destroy()), 11508 this.colorSelectorElement && 11509 ((this.colorSwatchSpring = 11510 null == (e = this.colorSwatchSpring) 11511 ? void 0 11512 : e.destroy()), 11513 this.colorSwatches.forEach((e) => { 11514 e.removeEventListener("change", this._onSwatchChange); 11515 })), 11516 this.scrollContainer.removeEventListener( 11517 "touchstart", 11518 this.onTouchStart, 11519 ), 11520 this.scrollContainer.removeEventListener( 11521 "touchmove", 11522 this.onTouchMove, 11523 ), 11524 this.scrollContainer.removeEventListener( 11525 "touchend", 11526 this.onTouchEnd, 11527 ), 11528 this.scrollContainer.removeEventListener( 11529 "wheel", 11530 this.onMouseWheel, 11531 ), 11532 this.closeButton.removeEventListener("click", this.closeTour), 11533 this.scrollContainer.classList.remove("tour-opening"), 11534 this.scrollContainer.classList.remove("tour-engaged"), 11535 this.scrollContainer.classList.remove("activated"), 11536 this.scrollContainer.classList.remove("intro-complete"), 11537 this.viewerReset.classList.remove("static-gallery-active"), 11538 this.element.classList.remove("tour-engaged"), 11539 this.closeButton.classList.remove("visible"), 11540 this.aapScrollGroup.remove(), 11541 (this.didMount = !1)); 11542 } 11543 bindEvents() { 11544 ((this.onOpenButtonClick = this.onOpenButtonClick.bind(this)), 11545 (this.onPrevClick = this.onPrevClick.bind(this)), 11546 (this.onNextClick = this.onNextClick.bind(this)), 11547 (this.closeTour = this.closeTour.bind(this)), 11548 (this.onTouchStart = this.onTouchStart.bind(this)), 11549 (this.onTouchMove = this.onTouchMove.bind(this)), 11550 (this.onTouchEnd = this.onTouchEnd.bind(this)), 11551 (this.onMouseWheel = this.onMouseWheel.bind(this)), 11552 (this.glide = this.glide.bind(this)), 11553 (this._onEnter = this._onEnter.bind(this)), 11554 (this._onOpenButtonPointerDown = 11555 this._onOpenButtonPointerDown.bind(this)), 11556 (this._onOpenButtonPointerUp = 11557 this._onOpenButtonPointerUp.bind(this)), 11558 (this._onOpenButtonFocus = 11559 this._onOpenButtonFocus.bind(this)), 11560 (this._onSwatchChange = this._onSwatchChange.bind(this))); 11561 } 11562 getClosest() { 11563 for ( 11564 let e = 0, t = this.productViewerCore.cachedControls.length; 11565 e < t; 11566 ++e 11567 ) { 11568 var i = 11569 this.productViewerCore.cachedControls[e].scroll 11570 .scrollOffset + 11571 this.productViewerCore.cachedControls[e].scroll 11572 .expandedScrollOffset, 11573 s = 11574 this.productViewerCore.cachedControls[this.closestIndex] 11575 .scroll.scrollOffset + 11576 this.productViewerCore.cachedControls[this.closestIndex] 11577 .scroll.expandedScrollOffset; 11578 Math.abs(this.offsetOrigin - i) < 11579 Math.abs(this.offsetOrigin - s) && (this.closestIndex = e); 11580 } 11581 return this.productViewerCore.cachedControls[this.closestIndex]; 11582 } 11583 glide() { 11584 if (!this.tourExpanded && !this.isTouching) { 11585 var t = this.isRTL 11586 ? 0.9375 * -this.productViewer.pageMetrics.windowWidth + 11587 this.productViewerCore.cachedControls[ 11588 this.leftMostItemIndex 11589 ].button.width 11590 : 0.0625 * this.productViewer.pageMetrics.windowWidth, 11591 i = this.isRTL 11592 ? 0.0625 * -this.productViewer.pageMetrics.windowWidth 11593 : 0.9375 * this.productViewer.pageMetrics.windowWidth - 11594 this.productViewerCore.cachedControls[ 11595 this.rightMostItemIndex 11596 ].button.width, 11597 t = 11598 this.productViewerCore.cachedControls[ 11599 this.leftMostItemIndex
11600 ].scroll.scrollOffset >= t, 11601 i = 11602 this.productViewerCore.cachedControls[ 11603 this.rightMostItemIndex 11604 ].scroll.scrollOffset <= i, 11605 s = this.isRTL 11606 ? this.collapsedContainerWidth - 11607 this.productViewer.pageMetrics.windowWidth 11608 : 0, 11609 r = this.isRTL 11610 ? 0 11611 : -this.collapsedContainerWidth + 11612 this.productViewer.pageMetrics.windowWidth; 11613 let e = t || i ? !0 : !1; 11614 if (!this.touchEnd || !e) 11615 for ( 11616 let e = 0, 11617 t = this.productViewerCore.cachedControls.length; 11618 e < t; 11619 ++e 11620 ) 11621 ((this.productViewerCore.cachedControls[ 11622 e 11623 ].scroll.scrollOffset = 11624 this.productViewerCore.cachedControls[e].scroll 11625 .scrollOffset + this.glideVelocity), 11626 this.productViewerCore.cachedControls[ 11627 e 11628 ].spring.snapValue( 11629 "x", 11630 this.productViewerCore.cachedControls[e].scroll 11631 .scrollOffset, 11632 )); 11633 if ( 11634 ((this.glideVelocity = e 11635 ? Math.sign(this.glideVelocity) * 11636 Math.log10(Math.abs(this.glideVelocity)) 11637 : 0.975 * this.glideVelocity), 11638 Math.abs(this.glideVelocity) < 1 || (this.touchEnd && e)) 11639 ) { 11640 if (t) 11641 for ( 11642 let e = 0, 11643 t = this.productViewerCore.cachedControls.length; 11644 e < t; 11645 ++e 11646 ) 11647 ((this.productViewerCore.cachedControls[ 11648 e 11649 ].scroll.scrollOffset = 11650 this.productViewerCore.cachedControls[e].scroll 11651 .collapsedOffset + s), 11652 this.productViewerCore.cachedControls[e].spring.set( 11653 "x", 11654 "target", 11655 this.productViewerCore.cachedControls[e].scroll 11656 .scrollOffset, 11657 )); 11658 if (i && this.glideVelocity < 0) 11659 for ( 11660 let e = 0, 11661 t = this.productViewerCore.cachedControls.length; 11662 e < t; 11663 ++e 11664 ) 11665 ((this.productViewerCore.cachedControls[ 11666 e 11667 ].scroll.scrollOffset = 11668 this.productViewerCore.cachedControls[e].scroll 11669 .collapsedOffset + r), 11670 this.productViewerCore.cachedControls[e].spring.set( 11671 "x", 11672 "target", 11673 this.productViewerCore.cachedControls[e].scroll 11674 .scrollOffset, 11675 )); 11676 this.touchEnd = !1; 11677 } else 11678 ((this.touchEnd = !1), requestAnimationFrame(this.glide)); 11679 } 11680 } 11681 mounted() { 11682 this.productViewer.isSmall && 11683 ((this.destroyed = !1), 11684 (this.activeControl = null), 11685 this._setupSprings(), 11686 this._setScrollOffsets(), 11687 this._setupOpenButtons(), 11688 this._setupCloseButtons(), 11689 this._setupPaddleNav(), 11690 this._setupColorSwatches(), 11691 this._containerAnimation(),
11692 this.productViewerCore.cachedControls.forEach((e) => { 11693 e.content.height > this.maxCardHeight && 11694 (this.maxCardHeight = e.content.height); 11695 }), 11696 this.stickyContainer.style.setProperty( 11697 "--max-card-height", 11698 this.maxCardHeight + "px", 11699 ), 11700 this.scrollContainer.addEventListener( 11701 "touchstart", 11702 this.onTouchStart, 11703 ), 11704 this.scrollContainer.addEventListener( 11705 "wheel", 11706 this.onMouseWheel, 11707 ), 11708 this.scrollContainer.removeAttribute("aria-hidden"), 11709 (this.didMount = !0)); 11710 } 11711 onBreakpointChange(e) { 11712 (this.scrollContainer.removeAttribute("aria-hidden"), 11713 "small" !== e.breakpoint && 11714 "xsmall" !== e.breakpoint && 11715 this.didMount && 11716 this.destroy(), 11717 this.didMount || 11718 ("small" !== e.breakpoint && "xsmall" !== e.breakpoint) || 11719 ("medium" !== e.previousBreakpoint && 11720 "large" !== e.previousBreakpoint && 11721 "xlarge" !== e.previousBreakpoint) || 11722 ((this.destroyed = !1), 11723 (this.skipIntro = !0), 11724 this.mounted(), 11725 this._onEnter(), 11726 (this.tourExpanded = !0), 11727 this.closeTour(null))); 11728 } 11729 onResizeDebounced() { 11730 !this.destroyed && 11731 this.didMount && 11732 ((this.expandedWidth = Math.min( 11733 this.productViewer.pageMetrics.windowWidth - 80, 11734 400, 11735 )), 11736 (this.offsetOrigin = 11737 (0.5 * this.productViewer.pageMetrics.windowWidth - 11738 0.5 * this.expandedWidth) * 11739 this.direction), 11740 (this.offsetMax = this.expandedWidth / 2 + 5), 11741 (this.maxCardHeight = 0), 11742 this.productViewerCore.cachedControls.forEach((e) => { 11743 e.content.height > this.maxCardHeight && 11744 (this.maxCardHeight = e.content.height); 11745 }), 11746 this.stickyContainer.style.setProperty( 11747 "--max-card-height", 11748 this.maxCardHeight + "px", 11749 ), 11750 this._setScrollOffsets(), 11751 this.tourExpanded 11752 ? this.expandControl(this.activeControl, 0, window.event) 11753 : (this.productViewerCore.cachedControls.forEach((e) => { 11754 e.spring.snapValue("width", e.button.width); 11755 }), 11756 this.centerControl( 11757 this.productViewerCore.cachedControls[0], 11758 ))); 11759 } 11760 onMouseWheel(e) { 11761 if ( 11762 (e.preventDefault(), 11763 0 !== e.deltaY && window.scrollBy(0, e.deltaY), 11764 !this.tourExpanded) 11765 ) { 11766 this.touchDeltaX = -e.deltaX; 11767 var e = this.isRTL 11768 ? 0.9375 * -this.productViewer.pageMetrics.windowWidth + 11769 this.productViewerCore.cachedControls[ 11770 this.leftMostItemIndex 11771 ].button.width 11772 : 0.0625 * this.productViewer.pageMetrics.windowWidth, 11773 t = this.isRTL 11774 ? 0.0625 * -this.productViewer.pageMetrics.windowWidth 11775 : 0.9375 * this.productViewer.pageMetrics.windowWidth - 11776 this.productViewerCore.cachedControls[ 11777 this.rightMostItemIndex 11778 ].button.width, 11779 e = 11780 this.productViewerCore.cachedControls[ 11781 this.leftMostItemIndex
11782 ].scroll.scrollOffset >= e, 11783 t = 11784 this.productViewerCore.cachedControls[ 11785 this.rightMostItemIndex 11786 ].scroll.scrollOffset <= t, 11787 i = this.isRTL 11788 ? this.collapsedContainerWidth - 11789 this.productViewer.pageMetrics.windowWidth 11790 : 0, 11791 s = this.isRTL 11792 ? 0 11793 : -this.collapsedContainerWidth + 11794 this.productViewer.pageMetrics.windowWidth; 11795 if (e && 0 < this.touchDeltaX) 11796 for ( 11797 let e = 0, 11798 t = this.productViewerCore.cachedControls.length; 11799 e < t; 11800 ++e 11801 ) 11802 this.productViewerCore.cachedControls[e].spring.snapValue( 11803 "x", 11804 this.productViewerCore.cachedControls[e].scroll 11805 .collapsedOffset + 11806 i + 11807 this.decay( 11808 this.touchDeltaX, 11809 this.expandedWidth * Math.sign(this.touchDeltaX), 11810 2, 11811 ), 11812 ); 11813 else if (t && this.touchDeltaX < 0) 11814 for ( 11815 let e = 0, 11816 t = this.productViewerCore.cachedControls.length; 11817 e < t; 11818 ++e 11819 ) 11820 this.productViewerCore.cachedControls[e].spring.snapValue( 11821 "x", 11822 this.productViewerCore.cachedControls[e].scroll 11823 .collapsedOffset + 11824 s + 11825 this.decay( 11826 this.touchDeltaX, 11827 this.expandedWidth * Math.sign(this.touchDeltaX), 11828 2, 11829 ), 11830 ); 11831 else 11832 for ( 11833 let e = 0, 11834 t = this.productViewerCore.cachedControls.length; 11835 e < t; 11836 ++e 11837 ) 11838 ((this.productViewerCore.cachedControls[ 11839 e 11840 ].scroll.scrollOffset = 11841 this.productViewerCore.cachedControls[e].scroll 11842 .scrollOffset + this.touchDeltaX), 11843 this.productViewerCore.cachedControls[ 11844 e 11845 ].spring.snapValue( 11846 "x", 11847 this.productViewerCore.cachedControls[e].scroll 11848 .scrollOffset, 11849 )); 11850 } 11851 } 11852 onTouchStart() { 11853 if ( 11854 ((this.isClick = !0), 11855 (this.isTouching = !0), 11856 (this.lastTouch = null), 11857 (this.progress = 0), 11858 (this.touchDeltaX = 0), 11859 (this.interruptionOffset = 0), 11860 (this.swipeDistance = 0), 11861 (this.settings.maxSwipeVelocity = 0), 11862 (this.activeControl = this.getClosest()), 11863 this.scrollContainer.addEventListener( 11864 "touchmove", 11865 this.onTouchMove, 11866 ), 11867 this.scrollContainer.addEventListener( 11868 "touchend", 11869 this.onTouchEnd, 11870 ), 11871 this.tourExpanded) 11872 ) 11873 for ( 11874 let e = 0, t = this.productViewerCore.cachedControls.length; 11875 e < t; 11876 ++e 11877 ) 11878 (this.productViewerCore.cachedControls[e].spring.set( 11879 "x", 11880 "bounce", 11881 this.settings.cardMorphBounce, 11882 ), 11883 this.productViewerCore.cachedControls[e].spring.set( 11884 "x", 11885 "duration", 11886 this.settings.cardMorphDuration, 11887 ), 11888 this.productViewerCore.cachedControls[e].spring.set( 11889 "width", 11890 "bounce", 11891 this.settings.cardMorphBounce, 11892 ), 11893 this.productViewerCore.cachedControls[e].spring.set( 11894 "width", 11895 "duration", 11896 this.settings.cardMorphDuration, 11897 ), 11898 this.productViewerCore.cachedControls[e].spring.set( 11899 "height", 11900 "bounce", 11901 this.settings.cardMorphBounce, 11902 ), 11903 this.productViewerCore.cachedControls[e].spring.set( 11904 "height", 11905 "duration", 11906 this.settings.cardMorphDuration, 11907 ), 11908 this.productViewerCore.cachedControls[e].cardMedia && 11909 (this.productViewerCore.cachedControls[ 11910 e 11911 ].cardMedia.spring.set( 11912 "--image-clip", 11913 "bounce", 11914 this.settings.cardImageClipBounce, 11915 ), 11916 this.productViewerCore.cachedControls[ 11917 e 11918 ].cardMedia.spring.set( 11919 "--image-clip", 11920 "duration", 11921 this.settings.cardImageClipDuration, 11922 ))); 11923 } 11924 lerp(e, t, i) { 11925 return t * i + e * (1 - i); 11926 } 11927 onTouchMove(e) { 11928 ((this.isClick = !1), 11929 this.lastTouch || 11930 ((this.lastTouch = e.touches[0]), 11931 (this.interruptionOffset = 11932 this.activeControl.spring.get("x", "position") - 11933 this.activeControl.scroll.scrollOffset))); 11934 var i = this.touchDeltaX; 11935 if ( 11936 ((this.touchDeltaX = 11937 e.touches[0].clientX - this.lastTouch.clientX), 11938 Math.abs(this.touchDeltaX) > Math.abs(i) && 11939 (this.settings.maxSwipeVelocity = Math.abs( 11940 this.touchDeltaX, 11941 )), 11942 this.tourExpanded) 11943 ) { 11944 if (Object.is(this.touchDeltaX, -0)) return; 11945 ((this.progress += 11946 this.touchDeltaX + this.interruptionOffset), 11947 (this.swipeDistance += this.touchDeltaX)); 11948 for ( 11949 let e = 0, t = this.productViewerCore.cachedControls.length; 11950 e < t; 11951 ++e 11952 ) 11953 e > this.activeControl.index - 3 && 11954 e < this.activeControl.index + 3 && 11955 ((this.productViewerCore.cachedControls[ 11956 e 11957 ].scroll.expandedScrollOffset = 11958 this.productViewerCore.cachedControls[e].scroll 11959 .expandedScrollOffset + 11960 this.touchDeltaX + 11961 this.interruptionOffset), 11962 this.productViewerCore.cachedControls[e].spring.snapValue( 11963 "x", 11964 this.productViewerCore.cachedControls[e].scroll 11965 .scrollOffset + 11966 this.productViewerCore.cachedControls[e].scroll 11967 .expandedScrollOffset, 11968 ), 11969 (this.productViewerCore.cachedControls[e].cardWeight = 11970 0)); 11971 ((this.activeControl.cardWeight = 1), 11972 (this.interruptionOffset = 0), 11973 (this.progressRatio = Math.min( 11974 Math.abs(this.progress / this.offsetMax), 11975 1, 11976 ))); 11977 i = 0.5 * this.progressRatio; 11978 ((0 !== this.activeControl.index && 0 < this.progress) || 11979 (this.activeControl.index !== 11980 this.productViewerCore.cachedControls.length - 1 && 11981 this.progress < 0)) && 11982 (this.activeControl.content.spring.snapValue( 11983 "opacity", 11984 this.lerp(1, 0, i), 11985 ), 11986 (this.activeControl.cardWeight = this.lerp(1, 0, i)), 11987 this.activeControl.controls.spring.snapValue( 11988 "opacity", 11989 this.lerp(1, 0, 8 * this.progressRatio), 11990 )); 11991 let e = null, 11992 t = 11993 (this.productViewerCore.cachedControls[ 11994 this.activeControl.index + -1 * this.direction 11995 ] && 11996 (e = 11997 this.productViewerCore.cachedControls[ 11998 this.activeControl.index + -1 * this.direction 11999 ]), 12000 null); 12001 (this.productViewerCore.cachedControls[ 12002 this.activeControl.index + +this.direction 12003 ] && 12004 (t = 12005 this.productViewerCore.cachedControls[ 12006 this.activeControl.index + +this.direction 12007 ]), 12008 0 < this.progress 12009 ? e && 12010 (e.spring.snapValue( 12011 "height", 12012 this.lerp(56, e.content.height, i), 12013 ), 12014 e.spring.snapValue( 12015 "--gradient-progress", 12016 this.lerp(-1 * this.direction, 0, i), 12017 ), 12018 e.content.spring.snapValue("opacity", 1), 12019 (e.cardWeight = this.lerp(0, 1, i)), 12020 e.tourMedia.id && 12021 !this.activeControl.tourMedia.id && 12022 this.modelSpring.setTarget( 12023 "opacity", 12024 this.lerp(1, 0, this.progressRatio), 12025 ), 12026 this.activeControl.tourMedia.id) && 12027 this.activeControl.tourMedia.spring.setTarget( 12028 "opacity", 12029 this.lerp(1, 0, this.progressRatio), 12030 ) 12031 : this.progress < 0 && 12032 t && 12033 (t.spring.snapValue( 12034 "height", 12035 this.lerp(56, t.content.height, i), 12036 ), 12037 t.spring.snapValue( 12038 "--gradient-progress", 12039 this.lerp(+this.direction, 0, i), 12040 ), 12041 t.content.spring.snapValue("opacity", 1), 12042 (t.cardWeight = this.lerp(0, 1, i)), 12043 t.tourMedia.id && 12044 !this.activeControl.tourMedia.id && 12045 this.modelSpring.setTarget( 12046 "opacity", 12047 this.lerp(1, 0, this.progressRatio), 12048 ), 12049 this.activeControl.tourMedia.id) && 12050 this.activeControl.tourMedia.spring.setTarget( 12051 "opacity", 12052 this.lerp(1, 0, this.progressRatio), 12053 )); 12054 i = this.getClosest(); 12055 if (i !== this.activeControl) 12056 return ( 12057 this.scrollContainer.removeEventListener( 12058 "touchmove", 12059 this.onTouchMove, 12060 ), 12061 this.scrollContainer.removeEventListener( 12062 "touchend", 12063 this.onTouchEnd, 12064 ), 12065 this.expandControl( 12066 i, 12067 this.productViewer.reducedMotion ? 0 : this.touchDeltaX, 12068 window.event, 12069 ), 12070 (this.progress = 0), 12071 (this.swipeDistance = 0), 12072 void (this.lastTouch = null) 12073 ); 12074 } else { 12075 var i = this.isRTL 12076 ? 0.9375 * -this.productViewer.pageMetrics.windowWidth + 12077 this.productViewerCore.cachedControls[ 12078 this.leftMostItemIndex 12079 ].button.width 12080 : 0.0625 * this.productViewer.pageMetrics.windowWidth, 12081 t = this.isRTL 12082 ? 0.0625 * -this.productViewer.pageMetrics.windowWidth 12083 : 0.9375 * this.productViewer.pageMetrics.windowWidth - 12084 this.productViewerCore.cachedControls[ 12085 this.rightMostItemIndex 12086 ].button.width, 12087 i = 12088 this.productViewerCore.cachedControls[ 12089 this.leftMostItemIndex
12090 ].scroll.scrollOffset >= i, 12091 t = 12092 this.productViewerCore.cachedControls[ 12093 this.rightMostItemIndex 12094 ].scroll.scrollOffset <= t, 12095 s = this.isRTL 12096 ? this.collapsedContainerWidth - 12097 this.productViewer.pageMetrics.windowWidth 12098 : 0, 12099 r = this.isRTL 12100 ? 0 12101 : -this.collapsedContainerWidth + 12102 this.productViewer.pageMetrics.windowWidth; 12103 if (i && 0 < this.touchDeltaX) { 12104 for ( 12105 let e = 0, 12106 t = this.productViewerCore.cachedControls.length; 12107 e < t; 12108 ++e 12109 ) 12110 this.productViewerCore.cachedControls[e].spring.snapValue( 12111 "x", 12112 this.productViewerCore.cachedControls[e].scroll 12113 .collapsedOffset + 12114 s + 12115 this.decay( 12116 this.touchDeltaX, 12117 this.expandedWidth * Math.sign(this.touchDeltaX), 12118 2, 12119 ), 12120 ); 12121 return; 12122 } 12123 if (t && this.touchDeltaX < 0) { 12124 for ( 12125 let e = 0, 12126 t = this.productViewerCore.cachedControls.length; 12127 e < t; 12128 ++e 12129 ) 12130 this.productViewerCore.cachedControls[e].spring.snapValue( 12131 "x", 12132 this.productViewerCore.cachedControls[e].scroll 12133 .collapsedOffset + 12134 r + 12135 this.decay( 12136 this.touchDeltaX, 12137 this.expandedWidth * Math.sign(this.touchDeltaX), 12138 2, 12139 ), 12140 ); 12141 return; 12142 } 12143 for ( 12144 let e = 0, t = this.productViewerCore.cachedControls.length; 12145 e < t; 12146 ++e 12147 ) 12148 ((this.productViewerCore.cachedControls[ 12149 e 12150 ].scroll.scrollOffset = 12151 this.productViewerCore.cachedControls[e].scroll 12152 .scrollOffset + this.touchDeltaX), 12153 this.productViewerCore.cachedControls[e].spring.snapValue( 12154 "x", 12155 this.productViewerCore.cachedControls[e].scroll 12156 .scrollOffset, 12157 )); 12158 } 12159 this.lastTouch = e.touches[0]; 12160 } 12161 onTouchEnd() { 12162 if ( 12163 (this.scrollContainer.removeEventListener( 12164 "touchmove", 12165 this.onTouchMove, 12166 ), 12167 this.scrollContainer.removeEventListener( 12168 "touchend", 12169 this.onTouchEnd, 12170 ), 12171 (this.lastTouch = null), 12172 (this.progress = 0), 12173 (this.isTouching = !1), 12174 this.tourExpanded) 12175 ) { 12176 let e = null, 12177 t = 12178 (this.productViewerCore.cachedControls[ 12179 this.activeControl.index - 1 12180 ] && 12181 (e = 12182 this.productViewerCore.cachedControls[ 12183 this.activeControl.index - 1 12184 ]), 12185 null); 12186 this.productViewerCore.cachedControls[ 12187 this.activeControl.index + 1 12188 ] && 12189 (t = 12190 this.productViewerCore.cachedControls[ 12191 this.activeControl.index + 1 12192 ]); 12193 var i = this.isRTL ? t : e, 12194 s = this.isRTL ? e : t; 12195 if ( 12196 0 < this.touchDeltaX && 12197 0 < this.swipeDistance && 12198 this.settings.maxSwipeVelocity >= 12199 this.settings.scrollVelocityThreshold && 12200 Math.abs(this.swipeDistance) > 12201 this.settings.minimumQuickSwipeDistance && 12202 i 12203 ) { 12204 for ( 12205 let e = 0, 12206 t = this.productViewerCore.cachedControls.length; 12207 e < t; 12208 ++e 12209 ) 12210 this.productViewerCore.cachedControls[ 12211 e 12212 ].scroll.expandedScrollOffset = 0; 12213 (this.expandControl( 12214 i, 12215 this.productViewer.reducedMotion 12216 ? 0 12217 : this.settings.maxSwipeVelocity * 12218 Math.sign(this.touchDeltaX), 12219 window.event, 12220 ), 12221 (this.touchDeltaX = 0), 12222 (this.swipeDistance = 0)); 12223 } else if ( 12224 this.touchDeltaX < 0 && 12225 this.swipeDistance < 0 && 12226 this.settings.maxSwipeVelocity >= 12227 this.settings.scrollVelocityThreshold && 12228 Math.abs(this.swipeDistance) > 12229 this.settings.minimumQuickSwipeDistance && 12230 s 12231 ) { 12232 for ( 12233 let e = 0, 12234 t = this.productViewerCore.cachedControls.length; 12235 e < t; 12236 ++e 12237 ) 12238 this.productViewerCore.cachedControls[ 12239 e 12240 ].scroll.expandedScrollOffset = 0; 12241 (this.expandControl( 12242 s, 12243 this.productViewer.reducedMotion 12244 ? 0 12245 : this.settings.maxSwipeVelocity * 12246 Math.sign(this.touchDeltaX), 12247 window.event, 12248 ), 12249 (this.touchDeltaX = 0), 12250 (this.swipeDistance = 0)); 12251 } else { 12252 for ( 12253 let e = 0, 12254 t = this.productViewerCore.cachedControls.length; 12255 e < t; 12256 ++e 12257 ) 12258 ((this.productViewerCore.cachedControls[ 12259 e 12260 ].scroll.expandedScrollOffset = 0), 12261 this.productViewerCore.cachedControls[e].spring.set( 12262 "x", 12263 "target", 12264 this.productViewerCore.cachedControls[e].scroll 12265 .scrollOffset, 12266 )); 12267 (this.productViewer.reducedMotion 12268 ? (this.activeControl.spring.snapValue( 12269 "height", 12270 this.activeControl.content.height, 12271 ), 12272 this.activeControl.cardMedia && 12273 this.activeControl.cardMedia.spring.snapValue( 12274 "--image-clip", 12275 0, 12276 ), 12277 this.activeControl.content.spring.snapValue( 12278 "opacity", 12279 1, 12280 ), 12281 (this.activeControl.cardWeight = 1), 12282 this.activeControl.controls.spring.snapValue( 12283 "opacity", 12284 1, 12285 )) 12286 : (this.activeControl.spring.setTarget( 12287 "height", 12288 this.activeControl.content.height, 12289 ), 12290 this.activeControl.cardMedia && 12291 this.activeControl.cardMedia.spring.setTarget( 12292 "--image-clip", 12293 0, 12294 ), 12295 this.activeControl.content.spring.setTarget( 12296 "opacity", 12297 1, 12298 ), 12299 (this.activeControl.cardWeight = 1), 12300 this.activeControl.controls.spring.setTarget( 12301 "opacity", 12302 1, 12303 )), 12304 e && 12305 (this.productViewer.reducedMotion 12306 ? (e.spring.snapValue("height", 56), 12307 e.spring.snapValue("--gradient-progress", -1), 12308 e.cardMedia && 12309 e.cardMedia.spring.snapValue("--image-clip", 100), 12310 e.content.spring.snapValue("opacity", 0)) 12311 : (e.spring.setTarget("height", 56), 12312 e.spring.setTarget("--gradient-progress", -1), 12313 e.cardMedia && 12314 e.cardMedia.spring.setTarget("--image-clip", 100), 12315 e.content.spring.setTarget("opacity", 0)), 12316 (e.cardWeight = 0)), 12317 t && 12318 (this.productViewer.reducedMotion 12319 ? (t.spring.snapValue("height", 56), 12320 t.spring.snapValue("--gradient-progress", 1), 12321 t.cardMedia && 12322 t.cardMedia.spring.snapValue("--image-clip", 100), 12323 t.content.spring.snapValue("opacity", 0)) 12324 : (t.spring.setTarget("height", 56), 12325 t.spring.setTarget("--gradient-progress", 1), 12326 t.cardMedia && 12327 t.cardMedia.spring.setTarget("--image-clip", 100), 12328 t.content.spring.setTarget("opacity", 0)), 12329 (t.cardWeight = 0)), 12330 this.activeControl.tourMedia.id 12331 ? (this.activeControl.tourMedia.spring.setTarget( 12332 "opacity", 12333 1, 12334 ), 12335 this.modelSpring.setTarget("opacity", 0)) 12336 : this.modelSpring.setTarget("opacity", 1), 12337 t && 12338 t.tourMedia.id && 12339 t.tourMedia.spring.setTarget("opacity", 0), 12340 e && 12341 e.tourMedia.id && 12342 e.tourMedia.spring.setTarget("opacity", 0)); 12343 } 12344 } else 12345 this.isClick || 12346 ((this.touchEnd = !0), 12347 (this.glideVelocity = 12348 this.settings.maxSwipeVelocity * 12349 Math.sign(this.touchDeltaX)), 12350 requestAnimationFrame(this.glide)); 12351 } 12352 decay(e, t, i) { 12353 return Math.tanh(e / (t * i)) * t; 12354 } 12355 onOpenButtonClick(e) { 12356 this.fromInteractive = !0; 12357 ((e = e.target.closest(".control-item")), 12358 (e = this.productViewerCore.cachedControls[e.dataset.index])); 12359 (this.openTour(e, window.event), 12360 this.scrollContainer.classList.add("tour-opening"), 12361 setTimeout(() => { 12362 this.scrollContainer.classList.remove("tour-opening"); 12363 }, 250)); 12364 } 12365 onPrevClick(e) { 12366 ((e = e.target.closest(".control-item")), 12367 (e = parseInt(e.dataset.index)), 12368 (e = this.productViewerCore.cachedControls[e - 1])); 12369 e && this.expandControl(e, 0, null); 12370 } 12371 onNextClick(e) { 12372 ((e = e.target.closest(".control-item")), 12373 (e = parseInt(e.dataset.index)), 12374 (e = this.productViewerCore.cachedControls[e + 1])); 12375 e && this.expandControl(e, 0, null); 12376 } 12377 openTour(i, e = void 0) { 12378 ((this.tourExpanded = !0), 12379 this.landingElementAccessibilityContainer.setAttribute( 12380 "aria-hidden", 12381 "true", 12382 ), 12383 this.scrollContainer.classList.add("tour-engaged"), 12384 this.element.classList.add("tour-engaged"), 12385 this.closeButton.classList.add("visible"), 12386 this.productViewer.reducedMotion 12387 ? (this.closeButtonSpring.snapValue("opacity", 1), 12388 this.closeButtonSpring.snapValue("scale", 1)) 12389 : (this.closeButtonSpring.setTarget("opacity", 1), 12390 this.closeButtonSpring.setTarget("scale", 1))); 12391 for ( 12392 let e = 0, t = this.productViewerCore.cachedControls.length; 12393 e < t; 12394 ++e 12395 ) 12396 (this.productViewer.reducedMotion || 12397 (this.productViewerCore.cachedControls[e].spring.set( 12398 "x", 12399 "bounce", 12400 this.settings.tourMorphBounce, 12401 ), 12402 this.productViewerCore.cachedControls[e].spring.set( 12403 "x", 12404 "duration", 12405 this.settings.tourMorphDuration, 12406 ), 12407 this.productViewerCore.cachedControls[e].spring.set( 12408 "width", 12409 "bounce", 12410 this.settings.tourMorphBounce, 12411 ), 12412 this.productViewerCore.cachedControls[e].spring.set( 12413 "width", 12414 "duration", 12415 this.settings.tourMorphDuration, 12416 ), 12417 this.productViewerCore.cachedControls[e].spring.set( 12418 "height", 12419 "bounce", 12420 this.settings.tourMorphBounce, 12421 ), 12422 this.productViewerCore.cachedControls[e].spring.set( 12423 "height", 12424 "duration", 12425 this.settings.tourMorphDuration, 12426 )), 12427 (this.productViewerCore.cachedControls[ 12428 e
12429 ].scroll.scrollOffset = 12430 (this.expandedWidth + 10) * 12431 ((this.productViewerCore.cachedControls[e].index - 12432 i.index) * 12433 this.direction) + 12434 this.offsetOrigin), 12435 (this.productViewerCore.cachedControls[ 12436 e 12437 ].scroll.expandedScrollOffset = 0), 12438 this.productViewer.reducedMotion 12439 ? (this.productViewerCore.cachedControls[ 12440 e 12441 ].spring.snapValue("width", this.expandedWidth), 12442 this.productViewerCore.cachedControls[ 12443 e 12444 ].spring.snapValue( 12445 "x", 12446 this.productViewerCore.cachedControls[e].scroll 12447 .scrollOffset, 12448 )) 12449 : (this.productViewerCore.cachedControls[ 12450 e 12451 ].spring.setTarget("width", this.expandedWidth), 12452 this.productViewerCore.cachedControls[ 12453 e 12454 ].spring.setTarget( 12455 "x", 12456 this.productViewerCore.cachedControls[e].scroll 12457 .scrollOffset, 12458 )), 12459 this.productViewer.reducedMotion 12460 ? ((this.productViewerCore.cachedControls[e].cardWeight = 12461 0), 12462 this.productViewerCore.cachedControls[ 12463 e 12464 ].spring.snapValue("height", 56), 12465 this.productViewerCore.cachedControls[e].cardMedia && 12466 this.productViewerCore.cachedControls[ 12467 e 12468 ].cardMedia.spring.snapValue("--image-clip", 100), 12469 this.productViewerCore.cachedControls[ 12470 e 12471 ].content.spring.snapValue("opacity", 0), 12472 this.productViewerCore.cachedControls[ 12473 e 12474 ].controls.spring.snapValue("opacity", 0)) 12475 : ((this.productViewerCore.cachedControls[e].cardWeight = 12476 0), 12477 this.productViewerCore.cachedControls[ 12478 e 12479 ].spring.setTarget("height", 56), 12480 this.productViewerCore.cachedControls[e].cardMedia && 12481 this.productViewerCore.cachedControls[ 12482 e 12483 ].cardMedia.spring.setTarget("--image-clip", 100), 12484 this.productViewerCore.cachedControls[ 12485 e 12486 ].content.spring.setTarget("opacity", 0), 12487 this.productViewerCore.cachedControls[ 12488 e 12489 ].controls.spring.setTarget("opacity", 0)), 12490 requestAnimationFrame(() => { 12491 this.productViewerCore.cachedControls[ 12492 e 12493 ].el.classList.remove("expanded"); 12494 }), 12495 this.productViewerCore.cachedControls[ 12496 e 12497 ].button.el.setAttribute("aria-expanded", "false"), 12498 this.productViewerCore.cachedControls[ 12499 e 12500 ].button.el.setAttribute("aria-hidden", "true"), 12501 this.productViewerCore.cachedControls[ 12502 e 12503 ].content.el.parentNode.setAttribute("aria-hidden", "true"), 12504 this.productViewerCore.cachedControls[e].tourMedia.id && 12505 (e < i.index - 1 || e > i.index + 1 12506 ? (this.productViewerCore.cachedControls[ 12507 e 12508 ].tourMedia.spring.el.style.display = "none") 12509 : (this.productViewerCore.cachedControls[ 12510 e 12511 ].tourMedia.spring.el.style.display = "flex"), 12512 this.productViewerCore.cachedControls[ 12513 e 12514 ].tourMedia.spring.setTarget("opacity", 0), 12515 this.productViewer.reducedMotion || 12516 (this.productViewerCore.cachedControls[ 12517 e 12518 ].tourMedia.id.classList.contains("tour-video") && 12519 this.productViewerCore.cachedControls[e].tourMedia.id 12520 .querySelector("video") 12521 .pause())), 12522 this.productViewer.channelContainer && 12523 this.productViewer.channelContainer.classList.contains( 12524 "enhanced", 12525 ) && 12526 this.productViewer.channelContainer.classList.contains( 12527 "inline-media", 12528 ) && 12529 this.productViewerCore.cachedControls[e].cardMedia && 12530 this.productViewerCore.cachedControls[e].cardMedia 12531 .videoEl && 12532 this.productViewerCore.cachedControls[ 12533 e 12534 ].cardMedia.videoEl.pause()); 12535 ((this.previousControl = null),
12536 (this.activeControl = null), 12537 requestAnimationFrame(() => { 12538 this.expandControl(i, 0, e); 12539 })); 12540 } 12541 expandControl(t, i = 0, e) { 12542 var s, r; 12543 if ( 12544 (this.fromInteractive || 12545 this.landingFallback[0].classList.add("should-hide"), 12546 (this.previousControl = this.activeControl || null), 12547 !this.productViewer.reducedMotion && !this.fromInteractive) 12548 ) 12549 for ( 12550 let e = 0; 12551 e < this.productViewerCore.cachedControls.length; 12552 e++ 12553 ) 12554 (this.productViewerCore.cachedControls[e].spring.set( 12555 "x", 12556 "bounce", 12557 this.settings.cardMorphBounce, 12558 ), 12559 this.productViewerCore.cachedControls[e].spring.set( 12560 "x", 12561 "duration", 12562 this.settings.cardMorphDuration, 12563 ), 12564 this.productViewerCore.cachedControls[e].spring.set( 12565 "width", 12566 "bounce", 12567 this.settings.cardMorphBounce, 12568 ), 12569 this.productViewerCore.cachedControls[e].spring.set( 12570 "width", 12571 "duration", 12572 this.settings.cardMorphDuration, 12573 ), 12574 this.productViewerCore.cachedControls[e].spring.set( 12575 "height", 12576 "bounce", 12577 this.settings.cardMorphBounce, 12578 ), 12579 this.productViewerCore.cachedControls[e].spring.set( 12580 "height", 12581 "duration", 12582 this.settings.cardMorphDuration, 12583 )); 12584 for ( 12585 let e = 0; 12586 e < this.productViewerCore.cachedControls.length; 12587 e++ 12588 ) 12589 e > t.index - 3 && 12590 e < t.index + 3 && 12591 ((this.productViewerCore.cachedControls[ 12592 e 12593 ].scroll.scrollOffset = 12594 (this.expandedWidth + 10) * 12595 ((this.productViewerCore.cachedControls[e].index - 12596 t.index) * 12597 this.direction) + 12598 this.offsetOrigin), 12599 (this.productViewerCore.cachedControls[ 12600 e 12601 ].scroll.expandedScrollOffset = 0), 12602 this.productViewer.reducedMotion 12603 ? (this.productViewerCore.cachedControls[ 12604 e 12605 ].spring.snapValue("width", this.expandedWidth), 12606 this.productViewerCore.cachedControls[ 12607 e 12608 ].spring.snapValue( 12609 "x", 12610 this.productViewerCore.cachedControls[e].scroll 12611 .scrollOffset, 12612 )) 12613 : (this.productViewerCore.cachedControls[ 12614 e 12615 ].spring.setTarget("width", this.expandedWidth), 12616 this.productViewerCore.cachedControls[ 12617 e 12618 ].spring.setTarget( 12619 "x", 12620 this.productViewerCore.cachedControls[e].scroll 12621 .scrollOffset, 12622 i * Math.abs(i), 12623 ))); 12624 ((this.activeControl = t).el.classList.add("expanded"), 12625 this.productViewer.reducedMotion 12626 ? ((t.cardWeight = 1), 12627 t.spring.snapValue("--gradient-progress", 0), 12628 this.productViewerCore.cachedControls[t.index - 1] && 12629 this.productViewerCore.cachedControls[ 12630 t.index - 1 12631 ].spring.snapValue("--gradient-progress", -1), 12632 this.productViewerCore.cachedControls[t.index + 1] && 12633 this.productViewerCore.cachedControls[ 12634 t.index + 1 12635 ].spring.snapValue("--gradient-progress", 1), 12636 t.cardMedia && 12637 t.cardMedia.spring.snapValue( 12638 "--image-clip", 12639 0, 12640 -Math.abs(i), 12641 ), 12642 t.content.spring.snapValue("opacity", 1, Math.abs(i)), 12643 t.spring.snapValue("height", t.content.height), 12644 t.controls.spring.snapValue("opacity", 1, 0
12644)) 12645 : ((t.cardWeight = 1), 12646 t.spring.setTarget("--gradient-progress", 0), 12647 this.productViewerCore.cachedControls[t.index - 1] && 12648 this.productViewerCore.cachedControls[ 12649 t.index - 1 12650 ].spring.setTarget("--gradient-progress", -1), 12651 this.productViewerCore.cachedControls[t.index + 1] && 12652 this.productViewerCore.cachedControls[ 12653 t.index + 1 12654 ].spring.setTarget("--gradient-progress", 1), 12655 t.cardMedia && 12656 (t.cardMedia.spring.set( 12657 "--image-clip", 12658 "bounce", 12659 this.fromInteractive 12660 ? this.settings.tourImageClipBounce 12661 : this.settings.cardImageClipBounce, 12662 ), 12663 t.cardMedia.spring.set( 12664 "--image-clip", 12665 "duration", 12666 this.fromInteractive 12667 ? this.settings.tourImageClipDuration 12668 : this.settings.cardImageClipDuration, 12669 ), 12670 t.cardMedia.spring.setTarget( 12671 "--image-clip", 12672 0, 12673 -Math.abs(i), 12674 )), 12675 t.content.spring.setTarget("opacity", 1, Math.abs(i)), 12676 t.spring.setTarget( 12677 "height", 12678 t.content.height, 12679 Math.abs(i) * 12680 Math.sign( 12681 t.content.height - 12682 t.spring.get("height", "position"), 12683 ), 12684 ), 12685 t.controls.spring.setTarget("opacity", 1, 0)), 12686 t.content.el.parentNode.setAttribute("aria-hidden", "false"), 12687 t.content.el.parentNode.removeAttribute("aria-hidden"), 12688 t.button.el.setAttribute("aria-expanded", "true"), 12689 t.button.el.setAttribute("aria-hidden", "true"), 12690 t.content.el.parentNode.focus(), 12691 t.tourMedia.id 12692 ? ((t.tourMedia.spring.el.style.display = "flex"), 12693 t.tourMedia.spring.setTarget("opacity", 1), 12694 this.viewerReset.classList.add("static-gallery-active"), 12695 this.modelSpring.setTarget("opacity", 0), 12696 !this.productViewer.reducedMotion && 12697 t.tourMedia.id.classList.contains("tour-video") && 12698 ((r = t.tourMedia.id.querySelector( 12699 ".inline-media-component-container", 12700 )) && 12701 !r.classList.contains("loaded") && 12702 ((r = r.dataset.shortid), 12703 null != 12704 (s = 12705 null == 12706 (s = 12707 null == 12708 (s = 12709 null == (s = window.channelHtml18pro) 12710 ? void 0 12711 : s.inlineMedia) 12712 ? void 0 12713 : s.instances) 12714 ? void 0 12715 : s[r])) && 12716 s.mediaItem && 12717 !s.mediaItem._destroyed && 12718 s.mediaItem.load(), 12719 ((r = 12720 t.tourMedia.id.querySelector("video")).currentTime = 12721 0), 12722 null != (s = r.play())) && 12723 s.then(() => {}).catch(() => {})) 12724 : (this.viewerReset.classList.remove( 12725 "static-gallery-active", 12726 ), 12727 this.modelSpring.setTarget("opacity", 1)), 12728 this.previousControl && 12729 this.previousControl !== t && 12730 (this.productViewer.reducedMotion 12731 ? ((this.previousControl.cardWeight = 0), 12732 this.previousControl.spring.snapValue("height", 56), 12733 this.previousControl.cardMedia && 12734 this.previousControl.cardMedia.spring.snapValue( 12735 "--image-clip", 12736 100, 12737 ), 12738 this.previousControl.content.spring.snapValue( 12739 "opacity", 12740 0, 12741 ), 12742 this.previousControl.controls.spring.snapValue( 12743 "opacity", 12744 0, 12745 )) 12746 : ((this.previousControl.cardWeight = 0), 12747 this.previousControl.spring.setTarget( 12748 "height", 12749 56, 12750 Math.abs(i) * 12751 Math.sign( 12752 56 - 12753 this.previousControl.spring.get( 12754 "height", 12755 "position", 12756 ), 12757 ), 12758 ), 12759 this.previousControl.cardMedia && 12760 this.previousControl.cardMedia.spring.setTarget( 12761 "--image-clip", 12762 100, 12763 Math.abs(i), 12764 ), 12765 this.previousControl.content.spring.setTarget( 12766 "opacity", 12767 0, 12768 -Math.abs(i), 12769 ), 12770 this.previousControl.controls.spring.setTarget( 12771 "opacity", 12772 0, 12773 -Math.abs(i), 12774 )), 12775 requestAnimationFrame(() => { 12776 this.previousControl.el.classList.remove("expanded"); 12777 }), 12778 this.previousControl.button.el.setAttribute( 12779 "aria-expanded", 12780 "false", 12781 ), 12782 this.previousControl.button.el.setAttribute( 12783 "aria-hidden", 12784 "true", 12785 ), 12786 this.previousControl.content.el.parentNode.setAttribute( 12787 "aria-hidden", 12788 "true", 12789 ), 12790 this.previousControl.tourMedia.id && 12791 (this.previousControl.tourMedia.spring.setTarget( 12792 "opacity", 12793 0, 12794 ), 12795 this.productViewer.reducedMotion || 12796 (this.previousControl.tourMedia.id.classList.contains( 12797 "tour-video", 12798 ) && 12799 this.previousControl.tourMedia.id 12800 .querySelector("video") 12801 .pause())), 12802 this.productViewer.channelContainer) && 12803 this.productViewer.channelContainer.classList.contains( 12804 "enhanced", 12805 ) && 12806 this.productViewer.channelContainer.classList.contains( 12807 "inline-media", 12808 ) && 12809 this.previousControl.cardMedia && 12810 this.previousControl.cardMedia.videoEl && 12811 this.previousControl.cardMedia.videoEl.pause(), 12812 this.productViewer.channelContainer && 12813 this.productViewer.channelContainer.classList.contains( 12814 "enhanced", 12815 ) && 12816 this.productViewer.channelContainer.classList.contains( 12817 "inline-media", 12818 ) && 12819 t.cardMedia && 12820 t.cardMedia.videoEl && 12821 (t.cardMedia.el.classList.contains("loaded") || 12822 ((r = t.cardMedia.el.dataset.shortid), 12823 null != 12824 (s = 12825 null == 12826 (s = 12827 null == 12828 (s = 12829 null == (s = window.channelHtml18pro) 12830 ? void 0 12831 : s.inlineMedia) 12832 ? void 0 12833 : s.instances) 12834 ? void 0 12835 : s[r]) && 12836 s.mediaItem && 12837 !s.mediaItem._destroyed && 12838 s.mediaItem.load()), 12839 (t.cardMedia.videoEl.currentTime = 0), 12840 null != (r = t.cardMedia.videoEl.play())) && 12841 r.then(() => {}).catch(() => {}), 12842 (this.fromInteractive = !1)); 12843 } 12844 centerControl(t) { 12845 this.tourExpanded ||
12846 this.productViewerCore.cachedControls.forEach((e) => { 12847 ((e.scroll.scrollOffset = 12848 e.scroll.collapsedOffset - t.scroll.collapsedOffset), 12849 t.index === this.leftMostItemIndex 12850 ? this.isRTL 12851 ? (e.scroll.scrollOffset += 12852 (0.9375 * 12853 this.productViewer.pageMetrics.windowWidth - 12854 t.button.width) * 12855 this.direction) 12856 : (e.scroll.scrollOffset += 12857 0.0625 * 12858 this.productViewer.pageMetrics.windowWidth * 12859 this.direction) 12860 : t.index === this.rightMostItemIndex 12861 ? this.isRTL 12862 ? (e.scroll.scrollOffset += 12863 0.0625 * 12864 this.productViewer.pageMetrics.windowWidth * 12865 this.direction) 12866 : (e.scroll.scrollOffset += 12867 (0.9375 * 12868 this.productViewer.pageMetrics.windowWidth - 12869 t.button.width) * 12870 this.direction) 12871 : (e.scroll.scrollOffset += 12872 (0.5 * 12873 this.productViewer.pageMetrics.windowWidth - 12874 0.5 * t.button.width) * 12875 this.direction), 12876 e.spring.snapValue("x", e.scroll.scrollOffset)); 12877 }); 12878 } 12879 closeTour(e) { 12880 var i; 12881 if (this.tourExpanded) { 12882 (this.landingElementAccessibilityContainer.removeAttribute( 12883 "aria-hidden", 12884 ), 12885 this.landingFallback[0].classList.remove("should-hide"), 12886 e 12887 ? this.activeControl.button.el.focus() 12888 : null != (e = document.activeElement) && e.blur(), 12889 (this.tourExpanded = !1), 12890 this.scrollContainer.classList.remove("tour-engaged"), 12891 this.closeButton && 12892 (this.productViewer.reducedMotion 12893 ? (this.closeButtonSpring.snapValue("opacity", 0), 12894 this.closeButtonSpring.snapValue("scale", 0)) 12895 : (this.closeButtonSpring.setTarget("opacity", 0), 12896 this.closeButtonSpring.setTarget("scale", 0)), 12897 this.closeButton.classList.remove("visible")), 12898 this.viewerReset.classList.remove("static-gallery-active"), 12899 this.modelSpring.setTarget("opacity", 1)); 12900 for ( 12901 let e = 0, t = this.productViewerCore.cachedControls.length; 12902 e < t; 12903 ++e 12904 ) 12905 (this.productViewer.reducedMotion 12906 ? (this.productViewerCore.cachedControls[ 12907 e 12908 ].spring.snapValue( 12909 "width", 12910 this.productViewerCore.cachedControls[e].button.width, 12911 ), 12912 this.productViewerCore.cachedControls[ 12913 e 12914 ].spring.snapValue("height", 56), 12915 this.productViewerCore.cachedControls[ 12916 e 12917 ].spring.snapValue("--gradient-progress", 0), 12918 this.productViewerCore.cachedControls[e].cardMedia && 12919 this.productViewerCore.cachedControls[ 12920 e 12921 ].cardMedia.spring.snapValue("--image-clip", 100), 12922 this.productViewerCore.cachedControls[ 12923 e 12924 ].content.spring.snapValue("opacity", 0), 12925 this.productViewerCore.cachedControls[ 12926 e 12927 ].controls.spring.snapValue("opacity", 0)) 12928 : (this.productViewerCore.cachedControls[e].spring.set( 12929 "x", 12930 "bounce", 12931 this.settings.interactiveMorphBounce, 12932 ), 12933 this.productViewerCore.cachedControls[e].spring.set( 12934 "x", 12935 "duration", 12936 this.settings.interactiveMorphDuration, 12937 ), 12938 this.productViewerCore.cachedControls[e].spring.set( 12939 "width", 12940 "bounce", 12941 this.settings.interactiveMorphBounce, 12942 ), 12943 this.productViewerCore.cachedControls[e].spring.set( 12944 "width", 12945 "duration", 12946 this.settings.interactiveMorphDuration, 12947 ), 12948 this.productViewerCore.cachedControls[ 12949 e 12950 ].spring.setTarget( 12951 "width", 12952 this.productViewerCore.cachedControls[e].button.width, 12953 ), 12954 this.productViewerCore.cachedControls[e].spring.set( 12955 "height", 12956 "bounce", 12957 this.settings.interactiveMorphBounce, 12958 ), 12959 this.productViewerCore.cachedControls[e].spring.set( 12960 "height", 12961 "duration", 12962 this.settings.interactiveMorphDuration, 12963 ), 12964 this.productViewerCore.cachedControls[ 12965 e 12966 ].spring.setTarget("height", 56), 12967 this.productViewerCore.cachedControls[ 12968 e 12969 ].spring.setTarget("--gradient-progress", 0), 12970 this.productViewerCore.cachedControls[e].cardMedia && 12971 (this.productViewerCore.cachedControls[ 12972 e 12973 ].cardMedia.spring.set( 12974 "--image-clip", 12975 "bounce", 12976 this.settings.interactiveImageClipBounce, 12977 ), 12978 this.productViewerCore.cachedControls[ 12979 e 12980 ].cardMedia.spring.set( 12981 "--image-clip", 12982 "duration", 12983 this.settings.interactiveImageClipDuration, 12984 ), 12985 this.productViewerCore.cachedControls[ 12986 e 12987 ].cardMedia.spring.setTarget("--image-clip", 100)), 12988 this.productViewerCore.cachedControls[ 12989 e 12990 ].content.spring.setTarget("opacity", 0), 12991 this.productViewerCore.cachedControls[ 12992 e 12993 ].controls.spring.setTarget("opacity", 0)), 12994 (this.productViewerCore.cachedControls[ 12995 e
12996 ].scroll.scrollOffset = 12997 this.productViewerCore.cachedControls[e].scroll 12998 .collapsedOffset - 12999 (null == (i = this.activeControl) 13000 ? void 0 13001 : i.scroll.collapsedOffset)), 13002 0 === 13003 (null == (i = this.activeControl) ? void 0 : i.index) 13004 ? (this.productViewerCore.cachedControls[ 13005 e 13006 ].scroll.scrollOffset += 13007 0.0625 * 13008 this.productViewer.pageMetrics.windowWidth * 13009 this.direction) 13010 : (null == (i = this.activeControl) 13011 ? void 0 13012 : i.index) === 13013 this.productViewerCore.cachedControls.length - 1 13014 ? (this.productViewerCore.cachedControls[ 13015 e 13016 ].scroll.scrollOffset += 13017 (0.9375 * 13018 this.productViewer.pageMetrics.windowWidth - 13019 (null == (i = this.activeControl) 13020 ? void 0 13021 : i.button.width)) * 13022 this.direction) 13023 : (this.productViewerCore.cachedControls[ 13024 e 13025 ].scroll.scrollOffset += 13026 (0.5 * 13027 this.productViewer.pageMetrics.windowWidth - 13028 0.5 * 13029 (null == (i = this.activeControl) 13030 ? void 0 13031 : i.button.width)) * 13032 this.direction), 13033 this.productViewer.reducedMotion 13034 ? this.productViewerCore.cachedControls[ 13035 e 13036 ].spring.snapValue( 13037 "x", 13038 this.productViewerCore.cachedControls[e].scroll 13039 .scrollOffset, 13040 ) 13041 : this.productViewerCore.cachedControls[ 13042 e 13043 ].spring.setTarget( 13044 "x", 13045 this.productViewerCore.cachedControls[e].scroll 13046 .scrollOffset, 13047 ), 13048 this.productViewerCore.cachedControls[e].tourMedia.id && 13049 (this.productViewerCore.cachedControls[ 13050 e 13051 ].tourMedia.spring.setTarget("opacity", 0), 13052 this.productViewer.reducedMotion || 13053 (this.productViewerCore.cachedControls[ 13054 e 13055 ].tourMedia.id.classList.contains("tour-video") && 13056 this.productViewerCore.cachedControls[ 13057 e 13058 ].tourMedia.id 13059 .querySelector("video") 13060 .pause())), 13061 this.productViewer.channelContainer && 13062 this.productViewer.channelContainer.classList.contains( 13063 "enhanced", 13064 ) && 13065 this.productViewer.channelContainer.classList.contains( 13066 "inline-media", 13067 ) && 13068 this.productViewerCore.cachedControls[e].cardMedia && 13069 this.productViewerCore.cachedControls[e].cardMedia 13070 .videoEl && 13071 this.productViewerCore.cachedControls[ 13072 e 13073 ].cardMedia.videoEl.pause(), 13074 requestAnimationFrame(() => { 13075 this.productViewerCore.cachedControls[ 13076 e 13077 ].el.classList.remove("expanded"); 13078 }), 13079 this.productViewerCore.cachedControls[ 13080 e 13081 ].button.el.setAttribute("aria-hidden", "false"), 13082 this.productViewerCore.cachedControls[ 13083 e 13084 ].button.el.removeAttribute("aria-hidden"), 13085 this.productViewerCore.cachedControls[ 13086 e 13087 ].button.el.setAttribute("aria-expanded", "false"), 13088 this.productViewerCore.cachedControls[ 13089 e 13090 ].content.el.parentNode.setAttribute( 13091 "aria-hidden", 13092 "true", 13093 )); 13094 (this.element.classList.remove("tour-engaged"), 13095 (this.activeControl = null),
13096 (this.previousControl = null), 13097 (this.lastTouch = null), 13098 (this.progress = 0)); 13099 } 13100 } 13101 _containerAnimation() { 13102 ((this.aapScrollGroup = this.anim.createScrollGroup( 13103 this.element, 13104 )), 13105 (this.aapScrollGroup.name = 13106 "Product Viewer 2D :: AAP Intro trigger"), 13107 this.productViewer.reducedMotion 13108 ? (this.modeSpring.snapValue("y", 0), 13109 this._setInitialPositions(), 13110 this.scrollContainer.classList.add("activated"), 13111 this.scrollContainer.classList.add("intro-complete")) 13112 : this.aapScrollGroup.addEvent( 13113 this.productViewerCore.cachedControls[0].button.el, 13114 { 13115 start: "(b - 100vh) + 20px", 13116 end: "t - 20px", 13117 onEnterOnce: () => { 13118 this._onEnter(); 13119 }, 13120 }, 13121 ), 13122 this.aapScrollGroup.addEvent(this.element, { 13123 start: "t - 100vh", 13124 end: "b", 13125 onExit: () => { 13126 this.closeTour(null); 13127 }, 13128 })); 13129 } 13130 _onEnter() { 13131 (this.centerControl( 13132 this.productViewer.productViewerCore.cachedControls[0], 13133 ), 13134 this.introElement && (this.introElement.style.opacity = "0"), 13135 this.introElementSpring && 13136 (this.introElementSpring.snapValue("scale", 1.3), 13137 this.introElementSpring.snapValue("x", -15), 13138 this.introElementSpring.snapValue("width", 30), 13139 this.introElementSpring.snapValue("height", 80)), 13140 this.modeSpring && this.modeSpring.snapValue("y", 180), 13141 this.scrollContainer && 13142 (this.scrollContainer.classList.remove("intro-complete"), 13143 this.scrollContainer.classList.remove("activated")), 13144 this.productViewerCore.cachedControls.forEach((e, t) => { 13145 (e.button.el.classList.remove("activated"), 13146 e.spring.snapValue( 13147 "x", 13148 (0.5 * this.productViewer.pageMetrics.windowWidth - 13149 20) * 13150 this.direction, 13151 ), 13152 e.spring.snapValue("--alpha", 0), 13153 e.spring.snapValue("width", 40), 13154 e.spring.snapValue("--height", 20), 13155 e.spring.snapValue("--scale", 0 === t ? 1.3 : 0)); 13156 }), 13157 this.colorSelectorElement && 13158 this.colorSwatchSpring && 13159 this.colorSwatchSpring.snapValue("scale", 0), 13160 this.skipIntro 13161 ? (this.modeSpring && this.modeSpring.snapValue("y", 0), 13162 this.scrollContainer && 13163 (this.scrollContainer.classList.add("activated"), 13164 this.scrollContainer.removeAttribute("aria-hidden"), 13165 this.scrollContainer.classList.add("intro-complete")), 13166 this.productViewerCore.cachedControls.forEach((e) => { 13167 (e.spring.snapValue("--alpha", 1), 13168 e.spring.snapValue("--height", 0), 13169 e.spring.snapValue("width", e.button.width), 13170 e.spring.snapValue("--scale", 1)); 13171 }), 13172 this.colorSelectorElement && 13173 this.colorSwatchSpring && 13174 this.colorSwatchSpring.snapValue("scale", 1), 13175 this._setInitialPositions()) 13176 : (this.anim.addTween( 13177 {}, 13178 { 13179 progress: [0, 1], 13180 duration: 0.02, 13181 onStart: () => { 13182 this.destroyed || 13183 (requestAnimationFrame(() => { 13184 this.introElement && 13185 (this.introElement.style.opacity = "1"); 13186 }), 13187 this.introElementSpring && 13188 this.introElementSpring.setTarget( 13189 "scale", 13190 0.7, 13191 )); 13192 }, 13193 }, 13194 ), 13195 this.anim.addTween( 13196 {}, 13197 { 13198 progress: [0, 1], 13199 duration: 0.03, 13200 onComplete: () => { 13201 this.destroyed || 13202 (this.modeSpring && 13203 this.modeSpring.setTarget("y", 0)); 13204 }, 13205 }, 13206 ), 13207 this.anim.addTween( 13208 {}, 13209 { 13210 progress: [0, 1], 13211 duration: 0.05, 13212 onComplete: () => { 13213 this.destroyed || 13214 (this.introElementSpring && 13215 (this.introElementSpring.setTarget("x", -28), 13216 this.introElementSpring.setTarget( 13217 "width", 13218 56, 13219 ))); 13220 }, 13221 }, 13222 ), 13223 this.anim.addTween( 13224 {}, 13225 { 13226 progress: [0, 1], 13227 duration: 0.15, 13228 onComplete: () => { 13229 this.destroyed || 13230 (this.introElementSpring && 13231 this.introElementSpring.setTarget( 13232 "height", 13233 56, 13234 )); 13235 }, 13236 }, 13237 ), 13238 this.anim.addTween( 13239 {}, 13240 { 13241 progress: [0, 1], 13242 duration: 0.52, 13243 onComplete: () => { 13244 this.destroyed || 13245 requestAnimationFrame(() => { 13246 (this.introElement && 13247 (this.introElement.style.opacity = "0"), 13248 this.scrollContainer && 13249 (this.scrollContainer.classList.add( 13250 "activated", 13251 ), 13252 this.scrollContainer.removeAttribute( 13253 "aria-hidden", 13254 ))); 13255 }); 13256 }, 13257 }, 13258 ), 13259 this.anim.addTween( 13260 {}, 13261 { 13262 progress: [0, 1], 13263 duration: 0.1, 13264 onComplete: () => { 13265 this.productViewerCore.cachedControls[0] && 13266 this.productViewerCore.cachedControls[0].spring.setTarget( 13267 "--scale", 13268 1, 13269 ); 13270 }, 13271 }, 13272 ), 13273 this.anim.addTween( 13274 {}, 13275 { 13276 progress: [0, 1], 13277 duration: 0.2, 13278 onComplete: () => { 13279 this.productViewerCore.cachedControls.forEac
13279h( 13280 (e, t) => { 13281 0 < t && e.spring.setTarget("--scale", 1); 13282 }, 13283 ); 13284 }, 13285 }, 13286 ), 13287 this.anim.addTween( 13288 {}, 13289 { 13290 progress: [0, 1], 13291 duration: 0.5, 13292 onComplete: () => { 13293 this.productViewerCore.cachedControls[0] && 13294 this.productViewerCore.cachedControls[0].spring.setTarget( 13295 "width", 13296 this.productViewerCore.cachedControls[0].button 13297 .width, 13298 ); 13299 }, 13300 }, 13301 ), 13302 this.anim.addTween( 13303 {}, 13304 { 13305 progress: [0, 1], 13306 duration: 0.5, 13307 onComplete: () => { 13308 this.productViewerCore.cachedControls.forEach( 13309 (e) => { 13310 e.spring.setTarget("width", e.button.width); 13311 }, 13312 ); 13313 }, 13314 }, 13315 ), 13316 this.anim.addTween( 13317 {}, 13318 { 13319 progress: [0, 1], 13320 duration: 0.6, 13321 onComplete: () => { 13322 this._setInitialPositions(); 13323 }, 13324 }, 13325 ), 13326 this.anim.addTween( 13327 {}, 13328 { 13329 progress: [0, 1], 13330 duration: 0.7, 13331 onComplete: () => { 13332 this.productViewerCore.cachedControls.forEach( 13333 (e) => { 13334 e.spring.setTarget("--height", 0); 13335 }, 13336 ); 13337 }, 13338 }, 13339 ), 13340 this.colorSelectorElement && 13341 this.colorSwatchSpring && 13342 this.anim.addTween( 13343 {}, 13344 { 13345 progress: [0, 1], 13346 duration: 0.91, 13347 onComplete: () => { 13348 this.colorSwatchSpring.setTarget("scale", 1); 13349 }, 13350 }, 13351 ), 13352 this.anim.addTween( 13353 {}, 13354 { 13355 progress: [0, 1], 13356 duration: 1.1, 13357 onComplete: () => { 13358 this.productViewerCore.cachedControls.forEach( 13359 (e) => { 13360 e.spring.setTarget("--alpha", 1); 13361 }, 13362 ); 13363 }, 13364 }, 13365 ), 13366 this.anim.addTween( 13367 {}, 13368 { 13369 progress: [0, 1], 13370 duration: 1.6, 13371 onComplete: () => { 13372 this.destroyed || 13373 (this.scrollContainer && 13374 this.scrollContainer.classList.add( 13375 "intro-complete", 13376 )); 13377 }, 13378 }, 13379 ))); 13380 } 13381 _onOpenButtonPointerDown() { 13382 this.pointerDown = !0; 13383 } 13384 _onOpenButtonPointerUp() { 13385 this.pointerDown = !1; 13386 } 13387 _onOpenButtonFocus(e) { 13388 var e = e.target; 13389 (this.noSafari && this.pointerDown) || 13390 ((e = 13391 this.productViewerCore.cachedControls[ 13392 e.parentNode.dataset.index 13393 ]), 13394 this.centerControl(e)); 13395 } 13396 _onSwatchChange() { 13397 this.activeControl && 13398 0 <= this.colorSelectorElementIndex && 13399 this.activeControl.spring.setTarget( 13400 "height", 13401 this.productViewerCore.cachedControls[ 13402 this.colorSelectorElementIndex 13403 ].content.height, 13404 0, 13405 ); 13406 } 13407 _setScrollOffsets() { 13408 if (this.isRTL) { 13409 let i = 0.0625 * -this.productViewer.pageMetrics.windowWidth, 13410 s = this.offsetOrigin; 13411 for ( 13412 let e = 0, t = this.productViewerCore.cachedControls.length; 13413 e < t; 13414 ++e 13415 ) 13416 ((this.productViewerCore.cachedControls[ 13417 e
13418 ].scroll.collapsedOffset = i), 13419 (this.productViewerCore.cachedControls[ 13420 e 13421 ].scroll.expandedOffset = s), 13422 (i = 13423 i - 13424 this.productViewerCore.cachedControls[e].button.width - 13425 12), 13426 (s = s - this.expandedWidth - 10)); 13427 void (this.collapsedContainerWidth = Math.abs( 13428 i + 13429 12 - 13430 0.0625 * this.productViewer.pageMetrics.windowWidth, 13431 )); 13432 } else { 13433 let i = 0.0625 * this.productViewer.pageMetrics.windowWidth, 13434 s = this.offsetOrigin; 13435 for ( 13436 let e = 0, t = this.productViewerCore.cachedControls.length; 13437 e < t; 13438 ++e 13439 ) 13440 ((this.productViewerCore.cachedControls[ 13441 e 13442 ].scroll.collapsedOffset = i), 13443 (this.productViewerCore.cachedControls[ 13444 e 13445 ].scroll.expandedOffset = s), 13446 (i = 13447 i + 13448 this.productViewerCore.cachedControls[e].button.width + 13449 12), 13450 (s = s + this.expandedWidth + 10)); 13451 this.collapsedContainerWidth = 13452 i - 13453 12 + 13454 0.0625 * this.productViewer.pageMetrics.windowWidth; 13455 } 13456 } 13457 _setInitialPositions() { 13458 for ( 13459 let e = 0; 13460 e < this.productViewerCore.cachedControls.length; 13461 e++ 13462 ) { 13463 if (this.destroyed) return; 13464 var t = this.productViewerCore.cachedControls[e]; 13465 (t.button.el.classList.add("activated"), 13466 t.spring.set("x", "target", t.scroll.collapsedOffset), 13467 (t.scroll.scrollOffset = t.scroll.collapsedOffset)); 13468 } 13469 } 13470 _setupOpenButtons() { 13471 this.productViewerCore.cachedControls.forEach((e) => { 13472 (e.button.el.addEventListener( 13473 "pointerdown", 13474 this._onOpenButtonPointerDown, 13475 ), 13476 e.button.el.addEventListener( 13477 "pointerup", 13478 this._onOpenButtonPointerUp, 13479 ), 13480 e.button.el.addEventListener( 13481 "click", 13482 this.onOpenButtonClick, 13483 ), 13484 e.button.el.addEventListener( 13485 "focus", 13486 this._onOpenButtonFocus, 13487 )); 13488 }); 13489 } 13490 _setupCloseButtons() { 13491 this.closeButton && 13492 this.closeButton.addEventListener("click", this.closeTour); 13493 } 13494 _setupPaddleNav() { 13495 this.productViewerCore.cachedControls.forEach((e) => { 13496 (0 === e.index 13497 ? (e.controls.prevButton.disabled = !0) 13498 : e.controls.prevButton.addEventListener( 13499 "click", 13500 this.onPrevClick, 13501 ), 13502 e.index === this.productViewerCore.cachedControls.length - 1 13503 ? (e.controls.nextButton.disabled = !0) 13504 : e.controls.nextButton.addEventListener( 13505 "click", 13506 this.onNextClick, 13507 )); 13508 }); 13509 } 13510 _setupColorSwatches() { 13511 this.colorSwatches.forEach((e) => { 13512 e.addEventListener("change", this._onSwatchChange); 13513 }); 13514 } 13515 _setupSprings() { 13516 (this.introElement && 13517 ((this.introElementSpring = new d(this.introElement, { 13518 x: { 13519 position: -15,
13520 target: -15, 13521 velocity: 0, 13522 stiffness: 100, 13523 damping: 8, 13524 }, 13525 scale: { 13526 position: 1.3, 13527 target: 1.3, 13528 velocity: 0, 13529 duration: 0.5, 13530 bounce: 0, 13531 }, 13532 height: { 13533 position: 80, 13534 target: 80, 13535 velocity: 0, 13536 stiffness: 100, 13537 damping: 8, 13538 }, 13539 width: { 13540 position: 30, 13541 target: 30, 13542 velocity: 0, 13543 stiffness: 100, 13544 damping: 8, 13545 }, 13546 })), 13547 this.introElementSpring.mounted()), 13548 this.scrollContainer && 13549 ((this.modeSpring = new d(this.scrollContainer, { 13550 y: { 13551 position: 180, 13552 target: 180, 13553 velocity: 0, 13554 stiffness: 100, 13555 damping: 8, 13556 }, 13557 })), 13558 this.modeSpring.mounted()), 13559 this.closeButton && 13560 ((this.closeButtonSpring = new d(this.closeButton, { 13561 opacity: { 13562 target: 0, 13563 position: 0, 13564 velocity: 0, 13565 duration: 0.5, 13566 bounce: 0, 13567 }, 13568 scale: { 13569 target: 0, 13570 position: 0, 13571 velocity: 0, 13572 duration: 0.63, 13573 bounce: 0.39, 13574 }, 13575 })), 13576 this.closeButtonSpring.mounted()), 13577 this.productViewerCore.cachedControls.forEach((e) => { 13578 var t = new d(e.el, { 13579 width: { 13580 target: e.button.width, 13581 position: e.button.width, 13582 velocity: 0, 13583 stiffness: 100, 13584 damping: 10, 13585 }, 13586 height: { 13587 target: 56, 13588 position: 56, 13589 velocity: 0, 13590 duration: 0.5, 13591 bounce: 0, 13592 }, 13593 x: { 13594 target: 0, 13595 position: 0, 13596 velocity: 0, 13597 stiffness: 100, 13598 damping: 20, 13599 }, 13600 "--alpha": { 13601 position: 0, 13602 target: 0, 13603 velocity: 0, 13604 stiffness: 100, 13605 damping: 20, 13606 }, 13607 "--scale": { 13608 position: 1, 13609 target: 1, 13610 velocity: 0, 13611 duration: 0.3, 13612 bounce: 0, 13613 }, 13614 "--height": { 13615 position: 0, 13616 target: 0, 13617 velocity: 0, 13618 stiffness: 100, 13619 damping: 20, 13620 }, 13621 "--gradient-progress": { 13622 target: 0, 13623 position: 0, 13624 velocity: 0, 13625 duration: 0.5, 13626 bounce: 0, 13627 }, 13628 }), 13629 t = 13630 (t.mounted(), 13631 (e.spring = t), 13632 new d(e.content.el.parentNode, { 13633 opacity: { 13634 target: 0, 13635 position: 0, 13636 velocity: 0, 13637 duration: this.settings.tourImageClipDuration, 13638 bounce: 0, 13639 }, 13640 })), 13641 t = 13642 (t.mounted(), 13643 (e.content.spring = t), 13644 e.cardMedia && 13645 ((t = new d(e.cardMedia.el, { 13646 "--image-clip": { 13647 target: 100, 13648 position: 100, 13649 velocity: 0, 13650 duration: this.settings.tourImageClipDuration, 13651 bounce: this.settings.tourImageClipBounce, 13652 }, 13653 })).mounted(), 13654 (e.cardMedia.spring = t)), 13655 e.tourMedia.id && 13656 ((t = new d(e.tourMedia.id, { 13657 opacity: { 13658 target: 0, 13659 position: 0, 13660 velocity: 0, 13661 duration: 0.32, 13662 bounce: 0, 13663 }, 13664 })).mounted(), 13665 (e.tourMedia.spring = t)), 13666 new d(e.controls.prevButton.parentNode, { 13667 opacity: { 13668 target: 0, 13669 position: 0, 13670 velocity: 0, 13671 duration: 0.5, 13672 bounce: 0, 13673 }, 13674 })); 13675 (t.mounted(), (e.controls.spring = t)); 13676 }), 13677 this.modelWrapper && 13678 ((this.modelSpring = new d(this.modelWrapper, { 13679 opacity: { 13680 target: 1, 13681 position: 1, 13682 velocity: 0, 13683 duration: 0.32, 13684 bounce: 0, 13685 }, 13686 })), 13687 this.modelSpring.mounted()), 13688 this.colorSelectorElement && 13689 ((this.colorSwatchSpring = new d( 13690 this.colorSelectorElement.querySelector( 13691 ".control-color-active-swatch", 13692 ), 13693 { 13694 scale: { 13695 target: 1, 13696 position: 1, 13697 velocity: 0, 13698 stiffness: 100, 13699 damping: 10, 13700 }, 13701 }, 13702 )), 13703 this.colorSwatchSpring.mounted())); 13704 } 13705 }, 13706 propName: "smallInstance", 13707 }, 13708 { 13709 Class: class { 13710 constructor(e) { 13711 ((this.productViewer = e), 13712 (this.el = e.colorNavGalleryEl), 13713 (this.anim = e.anim)); 13714 } 13715 mounted() { 13716 if (this.el) { 13717 var s = 13718 null == (s = window.channelHtml18pro) 13719 ? void 0 13720 : s.MixinGallery, 13721 r = 13722 null == (r = window.channelHtml18pro) 13723 ? void 0 13724 : r.GalleryModel, 13725 n = 13726 null == 13727 (n = 13728 null == 13729 (n = 13730 null == (n = window.channelHtml18pro) 13731 ? void 0 13732 : n.MixinGallery) 13733 ? void 0 13734 : n.mixins) 13735 ? void 0 13736 : n.Fade; 13737 if (s && r && n) { 13738 let t = this, 13739 e = { 13740 beforeCreate() {
13741 ((this.model.PrefersReducedMotion = 13742 t.productViewer.reducedMotion), 13743 (this.model.isRTL = t.productViewer.isRTL), 13744 (this.model.IsTouch = t.productViewer.isTouch), 13745 (this.model.Fade.duration = t.productViewer 13746 .reducedMotion 13747 ? 0 13748 : 0.5)); 13749 var e = 13750 null == (e = t.productViewer.element) 13751 ? void 0 13752 : e.querySelector(".control-color input:checked"); 13753 (e && 13754 e.dataset.index && 13755 (this.currentIndex = parseInt(e.dataset.index, 10)), 13756 (this._aapInputChange = 13757 this._aapInputChange.bind(this)), 13758 this.anim.on( 13759 "aap-product-viewer:input:change", 13760 this._aapInputChange, 13761 )); 13762 }, 13763 _aapInputChange(e) { 13764 var t = e.index; 13765 ((this.lastInteractionEvent = 13766 "key" === e.event.focusMethod 13767 ? new KeyboardEvent("keydown") 13768 : e.event), 13769 this.animateToItem(t)); 13770 }, 13771 }, 13772 i = s.withMixins(e, n); 13773 this.gallery = new i({ el: this.el }); 13774 for (let e = 0; e < this.gallery._items.length; e++) 13775 e !== this.gallery.currentIndex && 13776 this.gallery._items[e].el.classList.add("should-hide"); 13777 (this.gallery.on( 13778 r.Events.ITEM_CHANGE_COMPLETED, 13779 this._onItemChangeCompleted.bind(this), 13780 ), 13781 this.gallery.on( 13782 r.Events.ITEM_CHANGE_INITIATED, 13783 this._onItemChangeInitiated.bind(this), 13784 )); 13785 } else 13786 console.warn( 13787 "ProductViewerColorNavGallery: Gallery dependencies not found", 13788 ); 13789 } else 13790 console.log( 13791 "ProductViewerColorNavGallery: No element found, skipping mount", 13792 ); 13793 } 13794 _onItemChangeCompleted(e) { 13795 null != (e = e.previous) && e.el.classList.add("should-hide"); 13796 } 13797 _onItemChangeInitiated(e) { 13798 null != (e = e.next) && e.el.classList.remove("should-hide"); 13799 } 13800 destroy() { 13801 this.gallery && 13802 (this.gallery._aapInputChange && 13803 this.anim.off( 13804 "aap-product-viewer:input:change", 13805 this.gallery._aapInputChange, 13806 ), 13807 this.gallery.destroy(), 13808 (this.gallery = null)); 13809 } 13810 }, 13811 propName: "colorNavGallery", 13812 }, 13813 ].forEach(({ Class: e, propName: t }) => { 13814 ((this[t] = new e(this)), 13815 this.instances.push(this[t]), 13816 this[t].mounted && this[t].mounted()); 13817 }); 13818 } 13819 get pageMetrics() { 13820 var e; 13821 return null == (e = null == (e = this.anim) ? void 0 : e.model) 13822 ? void 0 13823 : e.pageMetrics; 13824 } 13825 get isTouch() { 13826 return m && m(); 13827 } 13828 get isSmall() { 13829 var e = null == (e = this.pageMetrics) ? void 0 : e.breakpoint; 13830 return "small" === e || "xsmall" === e; 13831 } 13832 _onBreakpointChange() { 13833 let t = this.pageMetrics; 13834 t && 13835 (this._smallValidation(), 13836 this.instances.forEach((e) => { 13837 e.onBreakpointChange && e.onBreakpointChange(t); 13838 })); 13839 } 13840 _onResizeDebounced() { 13841 let t = this.pageMetrics; 13842 t && 13843 (this._smallValidation(),
13844 this.instances.forEach((e) => { 13845 e.onResizeDebounced && e.onResizeDebounced(t); 13846 })); 13847 } 13848 _smallValidation() { 13849 var e; 13850 this.channelContainer 13851 ? (null != (e = this.pageMetrics) && e.breakpoint, 13852 this.isSmall 13853 ? (this.channelContainer.classList.add("small-breakpoint"), 13854 this.channelContainer.classList.remove("no-small-breakpoint")) 13855 : (this.channelContainer.classList.add("no-small-breakpoint"), 13856 this.channelContainer.classList.remove("small-breakpoint"))) 13857 : console.warn( 13858 "ProductViewer._smallValidation: .channel-html-18-pro container not found", 13859 ); 13860 } 13861 _reset() { 13862 if (this.element) { 13863 var e = this.aapEl; 13864 if (e) { 13865 var t = this.controlsEl; 13866 if (t) { 13867 var i = this.introElement, 13868 s = this.element.querySelectorAll(".control-item"), 13869 r = t.querySelectorAll(".control-item-bg"), 13870 n = t.querySelectorAll(".control-item-open"), 13871 o = t.querySelectorAll(".control-item-label"), 13872 a = t.querySelectorAll(".control-item-accessibility-container"), 13873 e = 13874 ([ 13875 e, 13876 t, 13877 i, 13878 ...Array.from(s || []), 13879 ...Array.from(r || []), 13880 ...Array.from(n || []), 13881 ...Array.from(o || []), 13882 ...Array.from(a || []), 13883 ] 13884 .filter(Boolean) 13885 .forEach((e) => { 13886 null != e && e.removeAttribute("style"); 13887 }), 13888 s.forEach((e) => { 13889 e.classList.remove("expanded"); 13890 }), 13891 this.closeButton && 13892 (this.closeButton.classList.remove("visible"), 13893 this.closeButton.removeAttribute("style")), 13894 this.element 13895 .querySelectorAll(".paddlenav-container") 13896 .forEach((e) => { 13897 (e.classList.remove("visible"), 13898 e.removeAttribute("style")); 13899 }), 13900 this.desktopInstance && 13901 ((this.desktopInstance.introAnimationFinished = !1), 13902 (this.desktopInstance.introAnimationInProgress = !1), 13903 (this.desktopInstance.isPaddlenavOpen = !1), 13904 (this.desktopInstance._lastSelected = { 13905 el: null, 13906 index: null, 13907 }), 13908 (this.desktopInstance.currentSelected = null)), 13909 this.element.querySelectorAll( 13910 '.control-color input[type="radio"]', 13911 )); 13912 if (0 < e.length) { 13913 let t = 13914 Array.from(e).find( 13915 (e) => "true" === e.dataset.defaultColor, 13916 ) || e[0]; 13917 e.forEach((e) => { 13918 e.checked = e === t; 13919 }); 13920 } 13921 this.element
13922 .querySelectorAll(".colornav-gallery .gallery-item") 13923 .forEach((e) => { 13924 e.classList.add("should-hide"); 13925 }); 13926 ((i = this.element.querySelector(".product-viewer.gallery")), 13927 (r = 13928 (i && 13929 (i.removeAttribute("style"), 13930 i.classList.remove("should-hide")), 13931 this.element.querySelector( 13932 ".product-viewer-media-gallery", 13933 )))); 13934 (r && 13935 r.querySelectorAll(".product-viewer-media").forEach((e) => { 13936 e.removeAttribute("style"); 13937 }), 13938 t.setAttribute("aria-hidden", "true")); 13939 } 13940 } 13941 } 13942 } 13943 destroy() { 13944 this.isDestroyed || 13945 ((this.isDestroyed = !0), 13946 this.anim && 13947 (this.anim.off( 13948 this.anim.model.PageEvents.ON_BREAKPOINT_CHANGE, 13949 this._onBreakpointChange, 13950 ), 13951 this.anim.off( 13952 this.anim.model.PageEvents.ON_RESIZE_DEBOUNCED, 13953 this._onResizeDebounced, 13954 )), 13955 Array.isArray(this.instances) && 13956 this.instances.forEach((e) => { 13957 e.destroy && e.destroy(); 13958 })); 13959 } 13960 } 13961 p 13962 ? p("productViewer", g) 13963 : console.warn("make sure ChannelHelpers.js is included"); 13964 })(), 13965 (() => { 13966 { 13967 function n(e) { 13968 return 0 === e.detail ? "Keyboard Interaction" : "Mouse Click"; 13969 } 13970 function o(e) { 13971 return e 13972 ? e.trim().replace(" ", " ").split(``).reverse().join(" - ") 13973 : ""; 13974 } 13975 let e = { 13976 cState: null, 13977 init: function () { 13978 this.addListeners(); 13979 }, 13980 addListeners: function () { 13981 let i = { 13982 small: window.matchMedia("(max-width: 734px)"), 13983 medium: window.matchMedia( 13984 "(min-width: 735px) and (max-width: 1068px)", 13985 ), 13986 large: window.matchMedia("(min-width: 1069px)"), 13987 };
13988 Object.keys(i).forEach((e) => { 13989 let t = i[e]; 13990 ("function" != typeof t.addEventListener 13991 ? t.addListener(() => { 13992 t.matches && this.viewportObserve(e); 13993 }) 13994 : t.addEventListener("change", () => { 13995 t.matches && this.viewportObserve(e); 13996 }), 13997 t.matches && this.viewportObserve(e)); 13998 }); 13999 }, 14000 viewportObserve: function (e) { 14001 this.cState !== e && ((this.cState = e), this.dispatch(e)); 14002 }, 14003 dispatch: function (e) { 14004 e = new CustomEvent("channel:pv-viewport-change", { detail: e }); 14005 window.dispatchEvent(e); 14006 }, 14007 }, 14008 t = { 14009 productViewerEl: null, 14010 init: function () { 14011 ((this.productViewerEl = document.querySelector( 14012 ".product-viewer-component", 14013 )), 14014 this.productViewerEl && this.attachControlListeners()); 14015 }, 14016 attachControlListeners: function () { 14017 this.productViewerEl && 14018 this.productViewerEl.addEventListener("click", (e) => { 14019 var t = e.target; 14020 t.closest(".control-item-open") 14021 ? this.handleControlClick(e) 14022 : t.closest(".close-button") && this.handleControlClose(e); 14023 }); 14024 }, 14025 handleControlClick: function (e) { 14026 var t, 14027 i, 14028 s, 14029 r = e.target.closest(".control-item-open"); 14030 r && 14031 ((t = r.getAttribute("data-tour-media-id") || ""), 14032 (i = o( 14033 null == (i = r.querySelector(".control-item-label")) 14034 ? void 0 14035 : i.innerText, 14036 )), 14037 (s = 14038 (null == (s = r.closest(".control-item")) 14039 ? void 0 14040 : s.getAttribute("data-type")) || "tour"), 14041 (r = r.id || ""), 14042 (e = n(e)), 14043 this.dispatch({ 14044 type: "control-open", 14045 controlId: r, 14046 controlTitle: i, 14047 controlType: s, 14048 tourMediaId: t, 14049 eventSource: e, 14050 })); 14051 }, 14052 handleControlClose: function (e) { 14053 e = n(e); 14054 this.dispatch({ type: "control-close", eventSource: e }); 14055 }, 14056 dispatch: function (e) { 14057 e = new CustomEvent("channel:pv-control-interaction", { 14058 detail: e, 14059 }); 14060 window.dispatchEvent(e); 14061 }, 14062 }, 14063 i = { 14064 productViewerEl: null, 14065 init: function () { 14066 ((this.productViewerEl = document.querySelector( 14067 ".product-viewer-component", 14068 )), 14069 this.productViewerEl && this.attachPaddleListeners()); 14070 }, 14071 attachPaddleListeners: function () { 14072 this.productViewerEl && 14073 this.productViewerEl.addEventListener("click", (e) => { 14074 e.target.closest(".paddlenav-button") && 14075 this.handlePaddleClick(e); 14076 }); 14077 }, 14078 handlePaddleClick: function (e) { 14079 var t, 14080 i = e.target.closest(".paddlenav-button"); 14081 i && 14082 ((i = i.classList.contains("paddlenav-prev") 14083 ? "previous" 14084 : "next"), 14085 (e = n(e)), 14086 (t = o( 14087 null == 14088 (t = 14089 null == (t = this.productViewerEl) 14090 ? void 0 14091 : t.querySelector( 14092 '.control-group button[aria-expanded="true"]', 14093 )) 14094 ? void 0 14095 : t.innerText, 14096 )), 14097 this.dispatch({ 14098 direction: i, 14099 eventSource: e, 14100 openedControlTitle: t, 14101 })); 14102 }, 14103 dispatch: function (e) { 14104 e = new CustomEvent("channel:pv-paddle-navigation", { detail: e }); 14105 window.dispatchEvent(e); 14106 }, 14107 }, 14108 s = { 14109 productViewerEl: null, 14110 init: function () { 14111 ((this.productViewerEl = document.querySelector( 14112 ".product-viewer-component", 14113 )), 14114 this.productViewerEl && this.attachSwatchListeners()); 14115 }, 14116 attachSwatchListeners: function () { 14117 this.productViewerEl && 14118 this.productViewerEl.addEventListener("change", (e) => {
14119 e.target.classList.contains("colornav-value") && 14120 this.handleSwatchChange(e); 14121 }); 14122 }, 14123 handleSwatchChange: function (e) { 14124 var e = e.target, 14125 t = 14126 (null == (t = e.getAttribute("data-label")) 14127 ? void 0 14128 : t.replace(" ", " ")) || "", 14129 i = e.value || "", 14130 e = e.getAttribute("data-index") || ""; 14131 this.dispatch({ 14132 colorName: t, 14133 colorValue: i, 14134 colorIndex: Number(e), 14135 }); 14136 }, 14137 dispatch: function (e) { 14138 e = new CustomEvent("channel:pv-swatch-selection", { detail: e }); 14139 window.dispatchEvent(e); 14140 }, 14141 }, 14142 r = { 14143 inited: !1, 14144 init: function () { 14145 this.inited || 14146 (document.querySelector(".product-viewer-component") 14147 ? (e.init(), t.init(), i.init(), s.init(), (this.inited = !0)) 14148 : console.warn( 14149 "channelProductViewerAnalytics: .product-viewer-component not found", 14150 )); 14151 }, 14152 }; 14153 window.addEventListener("pageshow", (e) => { 14154 e = e.persisted; 14155 e || r.init(); 14156 }); 14157 } 14158 })(), 14159 document.dispatchEvent( 14160 new CustomEvent("channel:productViewer:create", { 14161 detail: { id: "v71DED8" }, 14162 }), 14163 ), 14164 (() => { 14165 let e, 14166 t, 14167 i = "cha-expanded"; 14168 var s = 14169 null == (t = null == (e = window.channelHtml18pro) ? void 0 : e.helpers) 14170 ? void 0 14171 : t.registerComponent; 14172 s 14173 ? s( 14174 "collapsibleList", 14175 class { 14176 constructor(e) { 14177 ((this.isDestroyed = !1), 14178 (this.isCollapsed = !0), 14179 (this.el = document.querySelector(`.${e}.collapsible-list`)), 14180 (this.firstCollapsibleItem = document.querySelector( 14181 `.${e} .collapsible`, 14182 )), 14183 (this.showMoreLink = document.querySelector( 14184 `.${e} .button-wrapper .link`, 14185 )), 14186 (this.linkIcon = document.querySelector( 14187 `.${e} .button-wrapper .icon`, 14188 )), 14189 (this.buttonText = document.querySelector( 14190 `.${e} .button-wrapper .button-text`, 14191 )), 14192 (this._onToggleMore = this._onToggleMore.bind(this)), 14193 (this._toggleCollapsedState = 14194 this._toggleCollapsedState.bind(this)), 14195 (this._toggleQueryParam = this._toggleQueryParam.bind(this)), 14196 (this._checkStateFromQueryParam = 14197 this._checkStateFromQueryParam.bind(this)), 14198 this._checkStateFromQueryParam()); 14199 } 14200 _checkStateFromQueryParam() { 14201 new URL(window.location).searchParams.has(i) && 14202 (this._toggleCollapsedState(), this._toggleQueryParam()); 14203 } 14204 _toggleQueryParam() { 14205 var e = new URL(window.location), 14206 t = e.searchParams; 14207 (this.isCollapsed && t.has(i) 14208 ? t.delete(i) 14209 : this.isCollapsed || t.has(i) || t.set(i, "true"), 14210 window.history.replaceState({}, "", e)); 14211 } 14212 _toggleCollapsedState() { 14213 ((this.isCollapsed = !this.isCollapsed), 14214 this.el.classList.toggle("collapsed"), 14215 this.linkIcon.classList.toggle("icon-chevrondown"), 14216 this.linkIcon.classList.toggle("icon-chevronup"), 14217 this.showMoreLink.setAttribute( 14218 "aria-expanded", 14219 String(!this.isCollapsed), 14220 )); 14221 var e = this.isCollapsed 14222 ? this.showMoreLink.dataset.copyCollapsed 14223 : this.showMoreLink.dataset.copyExpanded; 14224 this.buttonText.innerHTML = e; 14225 } 14226 _onToggleMore(e) { 14227 (e.preventDefault(), 14228 this._toggleCollapsedState(), 14229 this._toggleQueryParam(), 14230 this.isCollapsed || 14231 setTimeout(() => { 14232 this._focusRevealedItem(); 14233 }, 250)); 14234 } 14235 _focusRevealedItem() { 14236 let e = this.firstCollapsibleItem; 14237 (e.setAttribute("tabindex", "-1"), 14238 e.focus({ preventScroll: !0 }), 14239 clearTimeout(this._focusCleanup), 14240 (this._focusCleanup = setTimeout(() => { 14241 e.removeAttribute("tabindex"); 14242 }, 100))); 14243 } 14244 destroy() { 14245 this.isDestroyed || 14246 ((this.isDestroyed = !0), 14247 this.showMoreLink.removeEventListener( 14248 "click", 14249 this._onToggleMore, 14250 )); 14251 } 14252 }, 14253 ) 14254 : console.warn("make sure ChannelHelpers.js is included"); 14255 })(), 14256 document.dispatchEvent( 14257 new CustomEvent("channel:collapsibleList:create", { 14258 detail: { id: "qeFQACpH" }, 14259 }), 14260 ));
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.