(() => { var __create = Object.create; var __getProtoOf = Object.getPrototypeOf; var __defProp = Object.defineProperty; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __hasOwnProp = Object.prototype.hasOwnProperty; var __toESM = (mod, isNodeMode, target) => { target = mod != null ? __create(__getProtoOf(mod)) : {}; const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target; for (let key of __getOwnPropNames(mod)) if (!__hasOwnProp.call(to, key)) __defProp(to, key, { get: () => mod[key], enumerable: true }); return to; }; var __moduleCache = /* @__PURE__ */ new WeakMap; var __toCommonJS = (from) => { var entry = __moduleCache.get(from), desc; if (entry) return entry; entry = __defProp({}, "__esModule", { value: true }); if (from && typeof from === "object" || typeof from === "function") __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })); __moduleCache.set(from, entry); return entry; }; var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true, configurable: true, set: (newValue) => all[name] = () => newValue }); }; // node_modules/gsap/dist/Draggable.js var require_Draggable = __commonJS((exports, module) => { (function(global2, factory) { typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = global2 || self, factory(global2.window = global2.window || {})); })(exports, function(exports2) { function _inheritsLoose2(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function _assertThisInitialized2(self2) { if (self2 === undefined) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } var _doc5, _win5, _docElement2, _body3, _divContainer, _svgContainer, _identityMatrix, _gEl, _transformProp3 = "transform", _transformOriginProp2 = _transformProp3 + "Origin", _hasOffsetBug, _setDoc = function _setDoc(element) { var doc = element.ownerDocument || element; if (!(_transformProp3 in element.style) && "msTransform" in element.style) { _transformProp3 = "msTransform"; _transformOriginProp2 = _transformProp3 + "Origin"; } while (doc.parentNode && (doc = doc.parentNode)) { } _win5 = window; _identityMatrix = new Matrix2D; if (doc) { _doc5 = doc; _docElement2 = doc.documentElement; _body3 = doc.body; _gEl = _doc5.createElementNS("http://www.w3.org/2000/svg", "g"); _gEl.style.transform = "none"; var d1 = doc.createElement("div"), d2 = doc.createElement("div"), root = doc && (doc.body || doc.firstElementChild); if (root && root.appendChild) { root.appendChild(d1); d1.appendChild(d2); d1.style.position = "static"; d1.style.transform = "translate3d(0,0,1px)"; _hasOffsetBug = d2.offsetParent !== d1; root.removeChild(d1); } } return doc; }, _forceNonZeroScale = function _forceNonZeroScale(e) { var a, cache; while (e && e !== _body3) { cache = e._gsap; cache && cache.uncache && cache.get(e, "x"); if (cache && !cache.scaleX && !cache.scaleY && cache.renderTransform) { cache.scaleX = cache.scaleY = 0.0001; cache.renderTransform(1, cache); a ? a.push(cache) : a = [cache]; } e = e.parentNode; } return a; }, _svgTemps = [], _divTemps = [], _getDocScrollTop = function _getDocScrollTop() { return _win5.pageYOffset || _doc5.scrollTop || _docElement2.scrollTop || _body3.scrollTop || 0; }, _getDocScrollLeft = function _getDocScrollLeft() { return _win5.pageXOffset || _doc5.scrollLeft || _docElement2.scrollLeft || _body3.scrollLeft || 0; }, _svgOwner = function _svgOwner(element) { return element.ownerSVGElement || ((element.tagName + "").toLowerCase() === "svg" ? element : null); }, _isFixed = function _isFixed(element) { if (_win5.getComputedStyle(element).position === "fixed") { return true; } element = element.parentNode; if (element && element.nodeType === 1) { return _isFixed(element); } }, _createSibling = function _createSibling(element, i) { if (element.parentNode && (_doc5 || _setDoc(element))) { var svg = _svgOwner(element), ns = svg ? svg.getAttribute("xmlns") || "http://www.w3.org/2000/svg" : "http://www.w3.org/1999/xhtml", type = svg ? i ? "rect" : "g" : "div", x = i !== 2 ? 0 : 100, y = i === 3 ? 100 : 0, css = { position: "absolute", display: "block", pointerEvents: "none", margin: "0", padding: "0" }, e = _doc5.createElementNS ? _doc5.createElementNS(ns.replace(/^https/, "http"), type) : _doc5.createElement(type); if (i) { if (!svg) { if (!_divContainer) { _divContainer = _createSibling(element); Object.assign(_divContainer.style, css); } Object.assign(e.style, css, { width: "0.1px", height: "0.1px", top: y + "px", left: x + "px" }); _divContainer.appendChild(e); } else { _svgContainer || (_svgContainer = _createSibling(element)); e.setAttribute("width", 0.01); e.setAttribute("height", 0.01); e.setAttribute("transform", "translate(" + x + "," + y + ")"); e.setAttribute("fill", "transparent"); _svgContainer.appendChild(e); } } return e; } throw "Need document and parent."; }, _consolidate = function _consolidate(m) { var c = new Matrix2D, i = 0; for (;i < m.numberOfItems; i++) { c.multiply(m.getItem(i).matrix); } return c; }, _getCTM = function _getCTM(svg) { var m = svg.getCTM(), transform; if (!m) { transform = svg.style[_transformProp3]; svg.style[_transformProp3] = "none"; svg.appendChild(_gEl); m = _gEl.getCTM(); svg.removeChild(_gEl); transform ? svg.style[_transformProp3] = transform : svg.style.removeProperty(_transformProp3.replace(/([A-Z])/g, "-$1").toLowerCase()); } return m || _identityMatrix.clone(); }, _placeSiblings = function _placeSiblings(element, adjustGOffset) { var svg = _svgOwner(element), isRootSVG = element === svg, siblings = svg ? _svgTemps : _divTemps, parent = element.parentNode, appendToEl = parent && !svg && parent.shadowRoot && parent.shadowRoot.appendChild ? parent.shadowRoot : parent, container, m, b, x, y, cs; if (element === _win5) { return element; } siblings.length || siblings.push(_createSibling(element, 1), _createSibling(element, 2), _createSibling(element, 3)); container = svg ? _svgContainer : _divContainer; if (svg) { if (isRootSVG) { b = _getCTM(element); x = -b.e / b.a; y = -b.f / b.d; m = _identityMatrix; } else if (element.getBBox) { b = element.getBBox(); m = element.transform ? element.transform.baseVal : {}; m = !m.numberOfItems ? _identityMatrix : m.numberOfItems > 1 ? _consolidate(m) : m.getItem(0).matrix; x = m.a * b.x + m.c * b.y; y = m.b * b.x + m.d * b.y; } else { m = new Matrix2D; x = y = 0; } if (adjustGOffset && element.tagName.toLowerCase() === "g") { x = y = 0; } (isRootSVG || !element.getBoundingClientRect().width ? svg : parent).appendChild(container); container.setAttribute("transform", "matrix(" + m.a + "," + m.b + "," + m.c + "," + m.d + "," + (m.e + x) + "," + (m.f + y) + ")"); } else { x = y = 0; if (_hasOffsetBug) { m = element.offsetParent; b = element; while (b && (b = b.parentNode) && b !== m && b.parentNode) { if ((_win5.getComputedStyle(b)[_transformProp3] + "").length > 4) { x = b.offsetLeft; y = b.offsetTop; b = 0; } } } cs = _win5.getComputedStyle(element); if (cs.position !== "absolute" && cs.position !== "fixed") { m = element.offsetParent; while (parent && parent !== m) { x += parent.scrollLeft || 0; y += parent.scrollTop || 0; parent = parent.parentNode; } } b = container.style; b.top = element.offsetTop - y + "px"; b.left = element.offsetLeft - x + "px"; b[_transformProp3] = cs[_transformProp3]; b[_transformOriginProp2] = cs[_transformOriginProp2]; b.position = cs.position === "fixed" ? "fixed" : "absolute"; appendToEl.appendChild(container); } return container; }, _setMatrix = function _setMatrix(m, a, b, c, d, e, f) { m.a = a; m.b = b; m.c = c; m.d = d; m.e = e; m.f = f; return m; }; var Matrix2D = function() { function Matrix2D2(a, b, c, d, e, f) { if (a === undefined) { a = 1; } if (b === undefined) { b = 0; } if (c === undefined) { c = 0; } if (d === undefined) { d = 1; } if (e === undefined) { e = 0; } if (f === undefined) { f = 0; } _setMatrix(this, a, b, c, d, e, f); } var _proto = Matrix2D2.prototype; _proto.inverse = function inverse() { var a = this.a, b = this.b, c = this.c, d = this.d, e = this.e, f = this.f, determinant = a * d - b * c || 0.0000000001; return _setMatrix(this, d / determinant, -b / determinant, -c / determinant, a / determinant, (c * f - d * e) / determinant, -(a * f - b * e) / determinant); }; _proto.multiply = function multiply(matrix) { var a = this.a, b = this.b, c = this.c, d = this.d, e = this.e, f = this.f, a2 = matrix.a, b2 = matrix.c, c2 = matrix.b, d2 = matrix.d, e2 = matrix.e, f2 = matrix.f; return _setMatrix(this, a2 * a + c2 * c, a2 * b + c2 * d, b2 * a + d2 * c, b2 * b + d2 * d, e + e2 * a + f2 * c, f + e2 * b + f2 * d); }; _proto.clone = function clone() { return new Matrix2D2(this.a, this.b, this.c, this.d, this.e, this.f); }; _proto.equals = function equals(matrix) { var a = this.a, b = this.b, c = this.c, d = this.d, e = this.e, f = this.f; return a === matrix.a && b === matrix.b && c === matrix.c && d === matrix.d && e === matrix.e && f === matrix.f; }; _proto.apply = function apply(point, decoratee) { if (decoratee === undefined) { decoratee = {}; } var { x, y } = point, a = this.a, b = this.b, c = this.c, d = this.d, e = this.e, f = this.f; decoratee.x = x * a + y * c + e || 0; decoratee.y = x * b + y * d + f || 0; return decoratee; }; return Matrix2D2; }(); function getGlobalMatrix(element, inverse, adjustGOffset, includeScrollInFixed) { if (!element || !element.parentNode || (_doc5 || _setDoc(element)).documentElement === element) { return new Matrix2D; } var zeroScales = _forceNonZeroScale(element), svg = _svgOwner(element), temps = svg ? _svgTemps : _divTemps, container = _placeSiblings(element, adjustGOffset), b1 = temps[0].getBoundingClientRect(), b2 = temps[1].getBoundingClientRect(), b3 = temps[2].getBoundingClientRect(), parent = container.parentNode, isFixed = !includeScrollInFixed && _isFixed(element), m = new Matrix2D((b2.left - b1.left) / 100, (b2.top - b1.top) / 100, (b3.left - b1.left) / 100, (b3.top - b1.top) / 100, b1.left + (isFixed ? 0 : _getDocScrollLeft()), b1.top + (isFixed ? 0 : _getDocScrollTop())); parent.removeChild(container); if (zeroScales) { b1 = zeroScales.length; while (b1--) { b2 = zeroScales[b1]; b2.scaleX = b2.scaleY = 0; b2.renderTransform(1, b2); } } return inverse ? m.inverse() : m; } var gsap6, _win$1, _doc$1, _docElement$1, _body$1, _tempDiv2, _placeholderDiv, _coreInitted6, _checkPrefix, _toArray3, _supportsPassive, _isTouchDevice, _touchEventLookup, _isMultiTouching, _isAndroid, InertiaPlugin, _defaultCursor, _supportsPointer, _context5, _getStyleSaver3, _dragCount = 0, _windowExists7 = function _windowExists() { return typeof window !== "undefined"; }, _getGSAP7 = function _getGSAP() { return gsap6 || _windowExists7() && (gsap6 = window.gsap) && gsap6.registerPlugin && gsap6; }, _isFunction5 = function _isFunction(value) { return typeof value === "function"; }, _isObject5 = function _isObject(value) { return typeof value === "object"; }, _isUndefined3 = function _isUndefined(value) { return typeof value === "undefined"; }, _emptyFunc3 = function _emptyFunc() { return false; }, _transformProp$1 = "transform", _transformOriginProp$1 = "transformOrigin", _round9 = function _round(value) { return Math.round(value * 1e4) / 1e4; }, _isArray2 = Array.isArray, _createElement3 = function _createElement(type, ns) { var e = _doc$1.createElementNS ? _doc$1.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc$1.createElement(type); return e.style ? e : _doc$1.createElement(type); }, _RAD2DEG3 = 180 / Math.PI, _bigNum4 = 100000000000000000000, _identityMatrix$1 = new Matrix2D, _getTime3 = Date.now || function() { return new Date().getTime(); }, _renderQueue = [], _lookup = {}, _lookupCount = 0, _clickableTagExp = /^(?:a|input|textarea|button|select)$/i, _lastDragTime = 0, _temp1 = {}, _windowProxy = {}, _copy = function _copy(obj, factor) { var copy = {}, p; for (p in obj) { copy[p] = factor ? obj[p] * factor : obj[p]; } return copy; }, _extend = function _extend(obj, defaults3) { for (var p in defaults3) { if (!(p in obj)) { obj[p] = defaults3[p]; } } return obj; }, _setTouchActionForAllDescendants = function _setTouchActionForAllDescendants(elements, value) { var i = elements.length, children; while (i--) { value ? elements[i].style.touchAction = value : elements[i].style.removeProperty("touch-action"); children = elements[i].children; children && children.length && _setTouchActionForAllDescendants(children, value); } }, _renderQueueTick = function _renderQueueTick() { return _renderQueue.forEach(function(func) { return func(); }); }, _addToRenderQueue = function _addToRenderQueue(func) { _renderQueue.push(func); if (_renderQueue.length === 1) { gsap6.ticker.add(_renderQueueTick); } }, _renderQueueTimeout = function _renderQueueTimeout() { return !_renderQueue.length && gsap6.ticker.remove(_renderQueueTick); }, _removeFromRenderQueue = function _removeFromRenderQueue(func) { var i = _renderQueue.length; while (i--) { if (_renderQueue[i] === func) { _renderQueue.splice(i, 1); } } gsap6.to(_renderQueueTimeout, { overwrite: true, delay: 15, duration: 0, onComplete: _renderQueueTimeout, data: "_draggable" }); }, _setDefaults5 = function _setDefaults(obj, defaults3) { for (var p in defaults3) { if (!(p in obj)) { obj[p] = defaults3[p]; } } return obj; }, _addListener5 = function _addListener(element, type, func, capture) { if (element.addEventListener) { var touchType = _touchEventLookup[type]; capture = capture || (_supportsPassive ? { passive: false } : null); element.addEventListener(touchType || type, func, capture); touchType && type !== touchType && element.addEventListener(type, func, capture); } }, _removeListener5 = function _removeListener(element, type, func, capture) { if (element.removeEventListener) { var touchType = _touchEventLookup[type]; element.removeEventListener(touchType || type, func, capture); touchType && type !== touchType && element.removeEventListener(type, func, capture); } }, _preventDefault = function _preventDefault(event) { event.preventDefault && event.preventDefault(); event.preventManipulation && event.preventManipulation(); }, _hasTouchID = function _hasTouchID(list, ID) { var i = list.length; while (i--) { if (list[i].identifier === ID) { return true; } } }, _onMultiTouchDocumentEnd = function _onMultiTouchDocumentEnd(event) { _isMultiTouching = event.touches && _dragCount < event.touches.length; _removeListener5(event.target, "touchend", _onMultiTouchDocumentEnd); }, _onMultiTouchDocument = function _onMultiTouchDocument(event) { _isMultiTouching = event.touches && _dragCount < event.touches.length; _addListener5(event.target, "touchend", _onMultiTouchDocumentEnd); }, _getDocScrollTop$1 = function _getDocScrollTop(doc) { return _win$1.pageYOffset || doc.scrollTop || doc.documentElement.scrollTop || doc.body.scrollTop || 0; }, _getDocScrollLeft$1 = function _getDocScrollLeft(doc) { return _win$1.pageXOffset || doc.scrollLeft || doc.documentElement.scrollLeft || doc.body.scrollLeft || 0; }, _addScrollListener = function _addScrollListener(e, callback) { _addListener5(e, "scroll", callback); if (!_isRoot(e.parentNode)) { _addScrollListener(e.parentNode, callback); } }, _removeScrollListener = function _removeScrollListener(e, callback) { _removeListener5(e, "scroll", callback); if (!_isRoot(e.parentNode)) { _removeScrollListener(e.parentNode, callback); } }, _isRoot = function _isRoot(e) { return !!(!e || e === _docElement$1 || e.nodeType === 9 || e === _doc$1.body || e === _win$1 || !e.nodeType || !e.parentNode); }, _getMaxScroll = function _getMaxScroll(element, axis) { var dim = axis === "x" ? "Width" : "Height", scroll = "scroll" + dim, client = "client" + dim; return Math.max(0, _isRoot(element) ? Math.max(_docElement$1[scroll], _body$1[scroll]) - (_win$1["inner" + dim] || _docElement$1[client] || _body$1[client]) : element[scroll] - element[client]); }, _recordMaxScrolls = function _recordMaxScrolls(e, skipCurrent) { var x = _getMaxScroll(e, "x"), y = _getMaxScroll(e, "y"); if (_isRoot(e)) { e = _windowProxy; } else { _recordMaxScrolls(e.parentNode, skipCurrent); } e._gsMaxScrollX = x; e._gsMaxScrollY = y; if (!skipCurrent) { e._gsScrollX = e.scrollLeft || 0; e._gsScrollY = e.scrollTop || 0; } }, _setStyle = function _setStyle(element, property, value) { var style = element.style; if (!style) { return; } if (_isUndefined3(style[property])) { property = _checkPrefix(property, element) || property; } if (value == null) { style.removeProperty && style.removeProperty(property.replace(/([A-Z])/g, "-$1").toLowerCase()); } else { style[property] = value; } }, _getComputedStyle3 = function _getComputedStyle(element) { return _win$1.getComputedStyle(element instanceof Element ? element : element.host || (element.parentNode || {}).host || element); }, _tempRect = {}, _parseRect = function _parseRect(e) { if (e === _win$1) { _tempRect.left = _tempRect.top = 0; _tempRect.width = _tempRect.right = _docElement$1.clientWidth || e.innerWidth || _body$1.clientWidth || 0; _tempRect.height = _tempRect.bottom = (e.innerHeight || 0) - 20 < _docElement$1.clientHeight ? _docElement$1.clientHeight : e.innerHeight || _body$1.clientHeight || 0; return _tempRect; } var doc = e.ownerDocument || _doc$1, r = !_isUndefined3(e.pageX) ? { left: e.pageX - _getDocScrollLeft$1(doc), top: e.pageY - _getDocScrollTop$1(doc), right: e.pageX - _getDocScrollLeft$1(doc) + 1, bottom: e.pageY - _getDocScrollTop$1(doc) + 1 } : !e.nodeType && !_isUndefined3(e.left) && !_isUndefined3(e.top) ? e : _toArray3(e)[0].getBoundingClientRect(); if (_isUndefined3(r.right) && !_isUndefined3(r.width)) { r.right = r.left + r.width; r.bottom = r.top + r.height; } else if (_isUndefined3(r.width)) { r = { width: r.right - r.left, height: r.bottom - r.top, right: r.right, left: r.left, bottom: r.bottom, top: r.top }; } return r; }, _dispatchEvent = function _dispatchEvent(target, type, callbackName) { var vars = target.vars, callback = vars[callbackName], listeners2 = target._listeners[type], result; if (_isFunction5(callback)) { result = callback.apply(vars.callbackScope || target, vars[callbackName + "Params"] || [target.pointerEvent]); } if (listeners2 && target.dispatchEvent(type) === false) { result = false; } return result; }, _getBounds3 = function _getBounds(target, context3) { var e = _toArray3(target)[0], top, left, offset; if (!e.nodeType && e !== _win$1) { if (!_isUndefined3(target.left)) { offset = { x: 0, y: 0 }; return { left: target.left - offset.x, top: target.top - offset.y, width: target.width, height: target.height }; } left = target.min || target.minX || target.minRotation || 0; top = target.min || target.minY || 0; return { left, top, width: (target.max || target.maxX || target.maxRotation || 0) - left, height: (target.max || target.maxY || 0) - top }; } return _getElementBounds(e, context3); }, _point1 = {}, _getElementBounds = function _getElementBounds(element, context3) { context3 = _toArray3(context3)[0]; var isSVG = element.getBBox && element.ownerSVGElement, doc = element.ownerDocument || _doc$1, left, right, top, bottom, matrix, p1, p2, p3, p4, bbox, width, height, cs; if (element === _win$1) { top = _getDocScrollTop$1(doc); left = _getDocScrollLeft$1(doc); right = left + (doc.documentElement.clientWidth || element.innerWidth || doc.body.clientWidth || 0); bottom = top + ((element.innerHeight || 0) - 20 < doc.documentElement.clientHeight ? doc.documentElement.clientHeight : element.innerHeight || doc.body.clientHeight || 0); } else if (context3 === _win$1 || _isUndefined3(context3)) { return element.getBoundingClientRect(); } else { left = top = 0; if (isSVG) { bbox = element.getBBox(); width = bbox.width; height = bbox.height; } else { if (element.viewBox && (bbox = element.viewBox.baseVal)) { left = bbox.x || 0; top = bbox.y || 0; width = bbox.width; height = bbox.height; } if (!width) { cs = _getComputedStyle3(element); bbox = cs.boxSizing === "border-box"; width = (parseFloat(cs.width) || element.clientWidth || 0) + (bbox ? 0 : parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth)); height = (parseFloat(cs.height) || element.clientHeight || 0) + (bbox ? 0 : parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth)); } } right = width; bottom = height; } if (element === context3) { return { left, top, width: right - left, height: bottom - top }; } matrix = getGlobalMatrix(context3, true).multiply(getGlobalMatrix(element)); p1 = matrix.apply({ x: left, y: top }); p2 = matrix.apply({ x: right, y: top }); p3 = matrix.apply({ x: right, y: bottom }); p4 = matrix.apply({ x: left, y: bottom }); left = Math.min(p1.x, p2.x, p3.x, p4.x); top = Math.min(p1.y, p2.y, p3.y, p4.y); return { left, top, width: Math.max(p1.x, p2.x, p3.x, p4.x) - left, height: Math.max(p1.y, p2.y, p3.y, p4.y) - top }; }, _parseInertia = function _parseInertia(draggable, snap3, max, min, factor, forceZeroVelocity) { var vars = {}, a, i, l; if (snap3) { if (factor !== 1 && snap3 instanceof Array) { vars.end = a = []; l = snap3.length; if (_isObject5(snap3[0])) { for (i = 0;i < l; i++) { a[i] = _copy(snap3[i], factor); } } else { for (i = 0;i < l; i++) { a[i] = snap3[i] * factor; } } max += 1.1; min -= 1.1; } else if (_isFunction5(snap3)) { vars.end = function(value) { var result = snap3.call(draggable, value), copy, p; if (factor !== 1) { if (_isObject5(result)) { copy = {}; for (p in result) { copy[p] = result[p] * factor; } result = copy; } else { result *= factor; } } return result; }; } else { vars.end = snap3; } } if (max || max === 0) { vars.max = max; } if (min || min === 0) { vars.min = min; } if (forceZeroVelocity) { vars.velocity = 0; } return vars; }, _isClickable = function _isClickable(element) { var data; return !element || !element.getAttribute || element === _body$1 ? false : (data = element.getAttribute("data-clickable")) === "true" || data !== "false" && (_clickableTagExp.test(element.nodeName + "") || element.getAttribute("contentEditable") === "true") ? true : _isClickable(element.parentNode); }, _setSelectable = function _setSelectable(elements, selectable) { var i = elements.length, e; while (i--) { e = elements[i]; e.ondragstart = e.onselectstart = selectable ? null : _emptyFunc3; gsap6.set(e, { lazy: true, userSelect: selectable ? "text" : "none" }); } }, _isFixed$1 = function _isFixed(element) { if (_getComputedStyle3(element).position === "fixed") { return true; } element = element.parentNode; if (element && element.nodeType === 1) { return _isFixed(element); } }, _supports3D2, _addPaddingBR, ScrollProxy = function ScrollProxy(element, vars) { element = gsap6.utils.toArray(element)[0]; vars = vars || {}; var content = document.createElement("div"), style = content.style, node = element.firstChild, offsetTop = 0, offsetLeft = 0, prevTop = element.scrollTop, prevLeft = element.scrollLeft, scrollWidth = element.scrollWidth, scrollHeight = element.scrollHeight, extraPadRight = 0, maxLeft = 0, maxTop = 0, elementWidth, elementHeight, contentHeight, nextNode, transformStart, transformEnd; if (_supports3D2 && vars.force3D !== false) { transformStart = "translate3d("; transformEnd = "px,0px)"; } else if (_transformProp$1) { transformStart = "translate("; transformEnd = "px)"; } this.scrollTop = function(value, force) { if (!arguments.length) { return -this.top(); } this.top(-value, force); }; this.scrollLeft = function(value, force) { if (!arguments.length) { return -this.left(); } this.left(-value, force); }; this.left = function(value, force) { if (!arguments.length) { return -(element.scrollLeft + offsetLeft); } var dif = element.scrollLeft - prevLeft, oldOffset = offsetLeft; if ((dif > 2 || dif < -2) && !force) { prevLeft = element.scrollLeft; gsap6.killTweensOf(this, { left: 1, scrollLeft: 1 }); this.left(-prevLeft); if (vars.onKill) { vars.onKill(); } return; } value = -value; if (value < 0) { offsetLeft = value - 0.5 | 0; value = 0; } else if (value > maxLeft) { offsetLeft = value - maxLeft | 0; value = maxLeft; } else { offsetLeft = 0; } if (offsetLeft || oldOffset) { if (!this._skip) { style[_transformProp$1] = transformStart + -offsetLeft + "px," + -offsetTop + transformEnd; } if (offsetLeft + extraPadRight >= 0) { style.paddingRight = offsetLeft + extraPadRight + "px"; } } element.scrollLeft = value | 0; prevLeft = element.scrollLeft; }; this.top = function(value, force) { if (!arguments.length) { return -(element.scrollTop + offsetTop); } var dif = element.scrollTop - prevTop, oldOffset = offsetTop; if ((dif > 2 || dif < -2) && !force) { prevTop = element.scrollTop; gsap6.killTweensOf(this, { top: 1, scrollTop: 1 }); this.top(-prevTop); if (vars.onKill) { vars.onKill(); } return; } value = -value; if (value < 0) { offsetTop = value - 0.5 | 0; value = 0; } else if (value > maxTop) { offsetTop = value - maxTop | 0; value = maxTop; } else { offsetTop = 0; } if (offsetTop || oldOffset) { if (!this._skip) { style[_transformProp$1] = transformStart + -offsetLeft + "px," + -offsetTop + transformEnd; } } element.scrollTop = value | 0; prevTop = element.scrollTop; }; this.maxScrollTop = function() { return maxTop; }; this.maxScrollLeft = function() { return maxLeft; }; this.disable = function() { node = content.firstChild; while (node) { nextNode = node.nextSibling; element.appendChild(node); node = nextNode; } if (element === content.parentNode) { element.removeChild(content); } }; this.enable = function() { node = element.firstChild; if (node === content) { return; } while (node) { nextNode = node.nextSibling; content.appendChild(node); node = nextNode; } element.appendChild(content); this.calibrate(); }; this.calibrate = function(force) { var widthMatches = element.clientWidth === elementWidth, cs, x, y; prevTop = element.scrollTop; prevLeft = element.scrollLeft; if (widthMatches && element.clientHeight === elementHeight && content.offsetHeight === contentHeight && scrollWidth === element.scrollWidth && scrollHeight === element.scrollHeight && !force) { return; } if (offsetTop || offsetLeft) { x = this.left(); y = this.top(); this.left(-element.scrollLeft); this.top(-element.scrollTop); } cs = _getComputedStyle3(element); if (!widthMatches || force) { style.display = "block"; style.width = "auto"; style.paddingRight = "0px"; extraPadRight = Math.max(0, element.scrollWidth - element.clientWidth); if (extraPadRight) { extraPadRight += parseFloat(cs.paddingLeft) + (_addPaddingBR ? parseFloat(cs.paddingRight) : 0); } } style.display = "inline-block"; style.position = "relative"; style.overflow = "visible"; style.verticalAlign = "top"; style.boxSizing = "content-box"; style.width = "100%"; style.paddingRight = extraPadRight + "px"; if (_addPaddingBR) { style.paddingBottom = cs.paddingBottom; } elementWidth = element.clientWidth; elementHeight = element.clientHeight; scrollWidth = element.scrollWidth; scrollHeight = element.scrollHeight; maxLeft = element.scrollWidth - elementWidth; maxTop = element.scrollHeight - elementHeight; contentHeight = content.offsetHeight; style.display = "block"; if (x || y) { this.left(x); this.top(y); } }; this.content = content; this.element = element; this._skip = false; this.enable(); }, _initCore7 = function _initCore(required) { if (_windowExists7() && document.body) { var nav = window && window.navigator; _win$1 = window; _doc$1 = document; _docElement$1 = _doc$1.documentElement; _body$1 = _doc$1.body; _tempDiv2 = _createElement3("div"); _supportsPointer = !!window.PointerEvent; _placeholderDiv = _createElement3("div"); _placeholderDiv.style.cssText = "visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab"; _defaultCursor = _placeholderDiv.style.cursor === "grab" ? "grab" : "move"; _isAndroid = nav && nav.userAgent.toLowerCase().indexOf("android") !== -1; _isTouchDevice = "ontouchstart" in _docElement$1 && "orientation" in _win$1 || nav && (nav.MaxTouchPoints > 0 || nav.msMaxTouchPoints > 0); _addPaddingBR = function() { var div = _createElement3("div"), child = _createElement3("div"), childStyle = child.style, parent = _body$1, val; childStyle.display = "inline-block"; childStyle.position = "relative"; div.style.cssText = "width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden"; div.appendChild(child); parent.appendChild(div); val = child.offsetHeight + 18 > div.scrollHeight; parent.removeChild(div); return val; }(); _touchEventLookup = function(types) { var standard = types.split(","), converted = ("onpointerdown" in _tempDiv2 ? "pointerdown,pointermove,pointerup,pointercancel" : ("onmspointerdown" in _tempDiv2) ? "MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel" : types).split(","), obj = {}, i = 4; while (--i > -1) { obj[standard[i]] = converted[i]; obj[converted[i]] = standard[i]; } try { _docElement$1.addEventListener("test", null, Object.defineProperty({}, "passive", { get: function get() { _supportsPassive = 1; } })); } catch (e) { } return obj; }("touchstart,touchmove,touchend,touchcancel"); _addListener5(_doc$1, "touchcancel", _emptyFunc3); _addListener5(_win$1, "touchmove", _emptyFunc3); _body$1 && _body$1.addEventListener("touchstart", _emptyFunc3); _addListener5(_doc$1, "contextmenu", function() { for (var p in _lookup) { if (_lookup[p].isPressed) { _lookup[p].endDrag(); } } }); gsap6 = _coreInitted6 = _getGSAP7(); } if (gsap6) { InertiaPlugin = gsap6.plugins.inertia; _context5 = gsap6.core.context || function() { }; _checkPrefix = gsap6.utils.checkPrefix; _transformProp$1 = _checkPrefix(_transformProp$1); _transformOriginProp$1 = _checkPrefix(_transformOriginProp$1); _toArray3 = gsap6.utils.toArray; _getStyleSaver3 = gsap6.core.getStyleSaver; _supports3D2 = !!_checkPrefix("perspective"); } else if (required) { console.warn("Please gsap.registerPlugin(Draggable)"); } }; var EventDispatcher = function() { function EventDispatcher2(target) { this._listeners = {}; this.target = target || this; } var _proto = EventDispatcher2.prototype; _proto.addEventListener = function addEventListener(type, callback) { var list = this._listeners[type] || (this._listeners[type] = []); if (!~list.indexOf(callback)) { list.push(callback); } }; _proto.removeEventListener = function removeEventListener(type, callback) { var list = this._listeners[type], i = list && list.indexOf(callback); i >= 0 && list.splice(i, 1); }; _proto.dispatchEvent = function dispatchEvent(type) { var _this = this; var result; (this._listeners[type] || []).forEach(function(callback) { return callback.call(_this, { type, target: _this.target }) === false && (result = false); }); return result; }; return EventDispatcher2; }(); var Draggable = function(_EventDispatcher) { _inheritsLoose2(Draggable2, _EventDispatcher); function Draggable2(target, vars) { var _this2; _this2 = _EventDispatcher.call(this) || this; _coreInitted6 || _initCore7(1); target = _toArray3(target)[0]; _this2.styles = _getStyleSaver3 && _getStyleSaver3(target, "transform,left,top"); if (!InertiaPlugin) { InertiaPlugin = gsap6.plugins.inertia; } _this2.vars = vars = _copy(vars || {}); _this2.target = target; _this2.x = _this2.y = _this2.rotation = 0; _this2.dragResistance = parseFloat(vars.dragResistance) || 0; _this2.edgeResistance = isNaN(vars.edgeResistance) ? 1 : parseFloat(vars.edgeResistance) || 0; _this2.lockAxis = vars.lockAxis; _this2.autoScroll = vars.autoScroll || 0; _this2.lockedAxis = null; _this2.allowEventDefault = !!vars.allowEventDefault; gsap6.getProperty(target, "x"); var type = (vars.type || "x,y").toLowerCase(), xyMode = ~type.indexOf("x") || ~type.indexOf("y"), rotationMode = type.indexOf("rotation") !== -1, xProp = rotationMode ? "rotation" : xyMode ? "x" : "left", yProp = xyMode ? "y" : "top", allowX = !!(~type.indexOf("x") || ~type.indexOf("left") || type === "scroll"), allowY = !!(~type.indexOf("y") || ~type.indexOf("top") || type === "scroll"), minimumMovement = vars.minimumMovement || 2, self2 = _assertThisInitialized2(_this2), triggers = _toArray3(vars.trigger || vars.handle || target), killProps = {}, dragEndTime = 0, checkAutoScrollBounds = false, autoScrollMarginTop = vars.autoScrollMarginTop || 40, autoScrollMarginRight = vars.autoScrollMarginRight || 40, autoScrollMarginBottom = vars.autoScrollMarginBottom || 40, autoScrollMarginLeft = vars.autoScrollMarginLeft || 40, isClickable = vars.clickableTest || _isClickable, clickTime = 0, gsCache = target._gsap || gsap6.core.getCache(target), isFixed = _isFixed$1(target), getPropAsNum = function getPropAsNum(property, unit) { return parseFloat(gsCache.get(target, property, unit)); }, ownerDoc = target.ownerDocument || _doc$1, enabled, scrollProxy, startPointerX, startPointerY, startElementX, startElementY, hasBounds, hasDragCallback, hasMoveCallback, maxX, minX, maxY, minY, touch, touchID, rotationOrigin, dirty, old, snapX, snapY, snapXY, isClicking, touchEventTarget, matrix, interrupted, allowNativeTouchScrolling, touchDragAxis, isDispatching, clickDispatch, trustedClickDispatch, isPreventingDefault, innerMatrix, dragged, onContextMenu = function onContextMenu(e) { _preventDefault(e); e.stopImmediatePropagation && e.stopImmediatePropagation(); return false; }, render3 = function render(suppressEvents) { if (self2.autoScroll && self2.isDragging && (checkAutoScrollBounds || dirty)) { var e = target, autoScrollFactor = self2.autoScroll * 15, parent, isRoot, rect, pointerX, pointerY, changeX, changeY, gap; checkAutoScrollBounds = false; _windowProxy.scrollTop = _win$1.pageYOffset != null ? _win$1.pageYOffset : ownerDoc.documentElement.scrollTop != null ? ownerDoc.documentElement.scrollTop : ownerDoc.body.scrollTop; _windowProxy.scrollLeft = _win$1.pageXOffset != null ? _win$1.pageXOffset : ownerDoc.documentElement.scrollLeft != null ? ownerDoc.documentElement.scrollLeft : ownerDoc.body.scrollLeft; pointerX = self2.pointerX - _windowProxy.scrollLeft; pointerY = self2.pointerY - _windowProxy.scrollTop; while (e && !isRoot) { isRoot = _isRoot(e.parentNode); parent = isRoot ? _windowProxy : e.parentNode; rect = isRoot ? { bottom: Math.max(_docElement$1.clientHeight, _win$1.innerHeight || 0), right: Math.max(_docElement$1.clientWidth, _win$1.innerWidth || 0), left: 0, top: 0 } : parent.getBoundingClientRect(); changeX = changeY = 0; if (allowY) { gap = parent._gsMaxScrollY - parent.scrollTop; if (gap < 0) { changeY = gap; } else if (pointerY > rect.bottom - autoScrollMarginBottom && gap) { checkAutoScrollBounds = true; changeY = Math.min(gap, autoScrollFactor * (1 - Math.max(0, rect.bottom - pointerY) / autoScrollMarginBottom) | 0); } else if (pointerY < rect.top + autoScrollMarginTop && parent.scrollTop) { checkAutoScrollBounds = true; changeY = -Math.min(parent.scrollTop, autoScrollFactor * (1 - Math.max(0, pointerY - rect.top) / autoScrollMarginTop) | 0); } if (changeY) { parent.scrollTop += changeY; } } if (allowX) { gap = parent._gsMaxScrollX - parent.scrollLeft; if (gap < 0) { changeX = gap; } else if (pointerX > rect.right - autoScrollMarginRight && gap) { checkAutoScrollBounds = true; changeX = Math.min(gap, autoScrollFactor * (1 - Math.max(0, rect.right - pointerX) / autoScrollMarginRight) | 0); } else if (pointerX < rect.left + autoScrollMarginLeft && parent.scrollLeft) { checkAutoScrollBounds = true; changeX = -Math.min(parent.scrollLeft, autoScrollFactor * (1 - Math.max(0, pointerX - rect.left) / autoScrollMarginLeft) | 0); } if (changeX) { parent.scrollLeft += changeX; } } if (isRoot && (changeX || changeY)) { _win$1.scrollTo(parent.scrollLeft, parent.scrollTop); setPointerPosition(self2.pointerX + changeX, self2.pointerY + changeY); } e = parent; } } if (dirty) { var { x, y } = self2; if (rotationMode) { self2.deltaX = x - parseFloat(gsCache.rotation); self2.rotation = x; gsCache.rotation = x + "deg"; gsCache.renderTransform(1, gsCache); } else { if (scrollProxy) { if (allowY) { self2.deltaY = y - scrollProxy.top(); scrollProxy.top(y); } if (allowX) { self2.deltaX = x - scrollProxy.left(); scrollProxy.left(x); } } else if (xyMode) { if (allowY) { self2.deltaY = y - parseFloat(gsCache.y); gsCache.y = y + "px"; } if (allowX) { self2.deltaX = x - parseFloat(gsCache.x); gsCache.x = x + "px"; } gsCache.renderTransform(1, gsCache); } else { if (allowY) { self2.deltaY = y - parseFloat(target.style.top || 0); target.style.top = y + "px"; } if (allowX) { self2.deltaX = x - parseFloat(target.style.left || 0); target.style.left = x + "px"; } } } if (hasDragCallback && !suppressEvents && !isDispatching) { isDispatching = true; if (_dispatchEvent(self2, "drag", "onDrag") === false) { if (allowX) { self2.x -= self2.deltaX; } if (allowY) { self2.y -= self2.deltaY; } render(true); } isDispatching = false; } } dirty = false; }, syncXY = function syncXY(skipOnUpdate, skipSnap) { var { x, y } = self2, snappedValue, cs; if (!target._gsap) { gsCache = gsap6.core.getCache(target); } gsCache.uncache && gsap6.getProperty(target, "x"); if (xyMode) { self2.x = parseFloat(gsCache.x); self2.y = parseFloat(gsCache.y); } else if (rotationMode) { self2.x = self2.rotation = _round9(parseFloat(gsCache.rotation)); } else if (scrollProxy) { self2.y = scrollProxy.top(); self2.x = scrollProxy.left(); } else { self2.y = parseFloat(target.style.top || (cs = _getComputedStyle3(target)) && cs.top) || 0; self2.x = parseFloat(target.style.left || (cs || {}).left) || 0; } if ((snapX || snapY || snapXY) && !skipSnap && (self2.isDragging || self2.isThrowing)) { if (snapXY) { _temp1.x = self2.x; _temp1.y = self2.y; snappedValue = snapXY(_temp1); if (snappedValue.x !== self2.x) { self2.x = snappedValue.x; dirty = true; } if (snappedValue.y !== self2.y) { self2.y = snappedValue.y; dirty = true; } } if (snapX) { snappedValue = snapX(self2.x); if (snappedValue !== self2.x) { self2.x = snappedValue; if (rotationMode) { self2.rotation = snappedValue; } dirty = true; } } if (snapY) { snappedValue = snapY(self2.y); if (snappedValue !== self2.y) { self2.y = snappedValue; } dirty = true; } } dirty && render3(true); if (!skipOnUpdate) { self2.deltaX = self2.x - x; self2.deltaY = self2.y - y; _dispatchEvent(self2, "throwupdate", "onThrowUpdate"); } }, buildSnapFunc = function buildSnapFunc(snap3, min, max, factor) { if (min == null) { min = -_bigNum4; } if (max == null) { max = _bigNum4; } if (_isFunction5(snap3)) { return function(n) { var edgeTolerance = !self2.isPressed ? 1 : 1 - self2.edgeResistance; return snap3.call(self2, (n > max ? max + (n - max) * edgeTolerance : n < min ? min + (n - min) * edgeTolerance : n) * factor) * factor; }; } if (_isArray2(snap3)) { return function(n) { var i = snap3.length, closest = 0, absDif = _bigNum4, val, dif; while (--i > -1) { val = snap3[i]; dif = val - n; if (dif < 0) { dif = -dif; } if (dif < absDif && val >= min && val <= max) { closest = i; absDif = dif; } } return snap3[closest]; }; } return isNaN(snap3) ? function(n) { return n; } : function() { return snap3 * factor; }; }, buildPointSnapFunc = function buildPointSnapFunc(snap3, minX2, maxX2, minY2, maxY2, radius, factor) { radius = radius && radius < _bigNum4 ? radius * radius : _bigNum4; if (_isFunction5(snap3)) { return function(point) { var edgeTolerance = !self2.isPressed ? 1 : 1 - self2.edgeResistance, x = point.x, y = point.y, result, dx, dy; point.x = x = x > maxX2 ? maxX2 + (x - maxX2) * edgeTolerance : x < minX2 ? minX2 + (x - minX2) * edgeTolerance : x; point.y = y = y > maxY2 ? maxY2 + (y - maxY2) * edgeTolerance : y < minY2 ? minY2 + (y - minY2) * edgeTolerance : y; result = snap3.call(self2, point); if (result !== point) { point.x = result.x; point.y = result.y; } if (factor !== 1) { point.x *= factor; point.y *= factor; } if (radius < _bigNum4) { dx = point.x - x; dy = point.y - y; if (dx * dx + dy * dy > radius) { point.x = x; point.y = y; } } return point; }; } if (_isArray2(snap3)) { return function(p) { var i = snap3.length, closest = 0, minDist = _bigNum4, x, y, point, dist; while (--i > -1) { point = snap3[i]; x = point.x - p.x; y = point.y - p.y; dist = x * x + y * y; if (dist < minDist) { closest = i; minDist = dist; } } return minDist <= radius ? snap3[closest] : p; }; } return function(n) { return n; }; }, calculateBounds = function calculateBounds() { var bounds, targetBounds, snap3, snapIsRaw; hasBounds = false; if (scrollProxy) { scrollProxy.calibrate(); self2.minX = minX = -scrollProxy.maxScrollLeft(); self2.minY = minY = -scrollProxy.maxScrollTop(); self2.maxX = maxX = self2.maxY = maxY = 0; hasBounds = true; } else if (!!vars.bounds) { bounds = _getBounds3(vars.bounds, target.parentNode); if (rotationMode) { self2.minX = minX = bounds.left; self2.maxX = maxX = bounds.left + bounds.width; self2.minY = minY = self2.maxY = maxY = 0; } else if (!_isUndefined3(vars.bounds.maxX) || !_isUndefined3(vars.bounds.maxY)) { bounds = vars.bounds; self2.minX = minX = bounds.minX; self2.minY = minY = bounds.minY; self2.maxX = maxX = bounds.maxX; self2.maxY = maxY = bounds.maxY; } else { targetBounds = _getBounds3(target, target.parentNode); self2.minX = minX = Math.round(getPropAsNum(xProp, "px") + bounds.left - targetBounds.left); self2.minY = minY = Math.round(getPropAsNum(yProp, "px") + bounds.top - targetBounds.top); self2.maxX = maxX = Math.round(minX + (bounds.width - targetBounds.width)); self2.maxY = maxY = Math.round(minY + (bounds.height - targetBounds.height)); } if (minX > maxX) { self2.minX = maxX; self2.maxX = maxX = minX; minX = self2.minX; } if (minY > maxY) { self2.minY = maxY; self2.maxY = maxY = minY; minY = self2.minY; } if (rotationMode) { self2.minRotation = minX; self2.maxRotation = maxX; } hasBounds = true; } if (vars.liveSnap) { snap3 = vars.liveSnap === true ? vars.snap || {} : vars.liveSnap; snapIsRaw = _isArray2(snap3) || _isFunction5(snap3); if (rotationMode) { snapX = buildSnapFunc(snapIsRaw ? snap3 : snap3.rotation, minX, maxX, 1); snapY = null; } else { if (snap3.points) { snapXY = buildPointSnapFunc(snapIsRaw ? snap3 : snap3.points, minX, maxX, minY, maxY, snap3.radius, scrollProxy ? -1 : 1); } else { if (allowX) { snapX = buildSnapFunc(snapIsRaw ? snap3 : snap3.x || snap3.left || snap3.scrollLeft, minX, maxX, scrollProxy ? -1 : 1); } if (allowY) { snapY = buildSnapFunc(snapIsRaw ? snap3 : snap3.y || snap3.top || snap3.scrollTop, minY, maxY, scrollProxy ? -1 : 1); } } } } }, onThrowComplete = function onThrowComplete() { self2.isThrowing = false; _dispatchEvent(self2, "throwcomplete", "onThrowComplete"); }, onThrowInterrupt = function onThrowInterrupt() { self2.isThrowing = false; }, animate = function animate(inertia, forceZeroVelocity) { var snap3, snapIsRaw, tween, overshootTolerance; if (inertia && InertiaPlugin) { if (inertia === true) { snap3 = vars.snap || vars.liveSnap || {}; snapIsRaw = _isArray2(snap3) || _isFunction5(snap3); inertia = { resistance: (vars.throwResistance || vars.resistance || 1000) / (rotationMode ? 10 : 1) }; if (rotationMode) { inertia.rotation = _parseInertia(self2, snapIsRaw ? snap3 : snap3.rotation, maxX, minX, 1, forceZeroVelocity); } else { if (allowX) { inertia[xProp] = _parseInertia(self2, snapIsRaw ? snap3 : snap3.points || snap3.x || snap3.left, maxX, minX, scrollProxy ? -1 : 1, forceZeroVelocity || self2.lockedAxis === "x"); } if (allowY) { inertia[yProp] = _parseInertia(self2, snapIsRaw ? snap3 : snap3.points || snap3.y || snap3.top, maxY, minY, scrollProxy ? -1 : 1, forceZeroVelocity || self2.lockedAxis === "y"); } if (snap3.points || _isArray2(snap3) && _isObject5(snap3[0])) { inertia.linkedProps = xProp + "," + yProp; inertia.radius = snap3.radius; } } } self2.isThrowing = true; overshootTolerance = !isNaN(vars.overshootTolerance) ? vars.overshootTolerance : vars.edgeResistance === 1 ? 0 : 1 - self2.edgeResistance + 0.2; if (!inertia.duration) { inertia.duration = { max: Math.max(vars.minDuration || 0, "maxDuration" in vars ? vars.maxDuration : 2), min: !isNaN(vars.minDuration) ? vars.minDuration : overshootTolerance === 0 || _isObject5(inertia) && inertia.resistance > 1000 ? 0 : 0.5, overshoot: overshootTolerance }; } self2.tween = tween = gsap6.to(scrollProxy || target, { inertia, data: "_draggable", inherit: false, onComplete: onThrowComplete, onInterrupt: onThrowInterrupt, onUpdate: vars.fastMode ? _dispatchEvent : syncXY, onUpdateParams: vars.fastMode ? [self2, "onthrowupdate", "onThrowUpdate"] : snap3 && snap3.radius ? [false, true] : [] }); if (!vars.fastMode) { if (scrollProxy) { scrollProxy._skip = true; } tween.render(1e9, true, true); syncXY(true, true); self2.endX = self2.x; self2.endY = self2.y; if (rotationMode) { self2.endRotation = self2.x; } tween.play(0); syncXY(true, true); if (scrollProxy) { scrollProxy._skip = false; } } } else if (hasBounds) { self2.applyBounds(); } }, updateMatrix = function updateMatrix(shiftStart) { var start = matrix, p; matrix = getGlobalMatrix(target.parentNode, true); if (shiftStart && self2.isPressed && !matrix.equals(start || new Matrix2D)) { p = start.inverse().apply({ x: startPointerX, y: startPointerY }); matrix.apply(p, p); startPointerX = p.x; startPointerY = p.y; } if (matrix.equals(_identityMatrix$1)) { matrix = null; } }, recordStartPositions = function recordStartPositions() { var edgeTolerance = 1 - self2.edgeResistance, offsetX = isFixed ? _getDocScrollLeft$1(ownerDoc) : 0, offsetY = isFixed ? _getDocScrollTop$1(ownerDoc) : 0, parsedOrigin, x, y; if (xyMode) { gsCache.x = getPropAsNum(xProp, "px") + "px"; gsCache.y = getPropAsNum(yProp, "px") + "px"; gsCache.renderTransform(); } updateMatrix(false); _point1.x = self2.pointerX - offsetX; _point1.y = self2.pointerY - offsetY; matrix && matrix.apply(_point1, _point1); startPointerX = _point1.x; startPointerY = _point1.y; if (dirty) { setPointerPosition(self2.pointerX, self2.pointerY); render3(true); } innerMatrix = getGlobalMatrix(target); if (scrollProxy) { calculateBounds(); startElementY = scrollProxy.top(); startElementX = scrollProxy.left(); } else { if (isTweening2()) { syncXY(true, true); calculateBounds(); } else { self2.applyBounds(); } if (rotationMode) { parsedOrigin = target.ownerSVGElement ? [gsCache.xOrigin - target.getBBox().x, gsCache.yOrigin - target.getBBox().y] : (_getComputedStyle3(target)[_transformOriginProp$1] || "0 0").split(" "); rotationOrigin = self2.rotationOrigin = getGlobalMatrix(target).apply({ x: parseFloat(parsedOrigin[0]) || 0, y: parseFloat(parsedOrigin[1]) || 0 }); syncXY(true, true); x = self2.pointerX - rotationOrigin.x - offsetX; y = rotationOrigin.y - self2.pointerY + offsetY; startElementX = self2.x; startElementY = self2.y = Math.atan2(y, x) * _RAD2DEG3; } else { startElementY = getPropAsNum(yProp, "px"); startElementX = getPropAsNum(xProp, "px"); } } if (hasBounds && edgeTolerance) { if (startElementX > maxX) { startElementX = maxX + (startElementX - maxX) / edgeTolerance; } else if (startElementX < minX) { startElementX = minX - (minX - startElementX) / edgeTolerance; } if (!rotationMode) { if (startElementY > maxY) { startElementY = maxY + (startElementY - maxY) / edgeTolerance; } else if (startElementY < minY) { startElementY = minY - (minY - startElementY) / edgeTolerance; } } } self2.startX = startElementX = _round9(startElementX); self2.startY = startElementY = _round9(startElementY); }, isTweening2 = function isTweening() { return self2.tween && self2.tween.isActive(); }, removePlaceholder = function removePlaceholder() { if (_placeholderDiv.parentNode && !isTweening2() && !self2.isDragging) { _placeholderDiv.parentNode.removeChild(_placeholderDiv); } }, onPress = function onPress(e, force) { var i; if (!enabled || self2.isPressed || !e || (e.type === "mousedown" || e.type === "pointerdown") && !force && _getTime3() - clickTime < 30 && _touchEventLookup[self2.pointerEvent.type]) { isPreventingDefault && e && enabled && _preventDefault(e); return; } interrupted = isTweening2(); dragged = false; self2.pointerEvent = e; if (_touchEventLookup[e.type]) { touchEventTarget = ~e.type.indexOf("touch") ? e.currentTarget || e.target : ownerDoc; _addListener5(touchEventTarget, "touchend", onRelease); _addListener5(touchEventTarget, "touchmove", onMove); _addListener5(touchEventTarget, "touchcancel", onRelease); _addListener5(ownerDoc, "touchstart", _onMultiTouchDocument); } else { touchEventTarget = null; _addListener5(ownerDoc, "mousemove", onMove); } touchDragAxis = null; if (!_supportsPointer || !touchEventTarget) { _addListener5(ownerDoc, "mouseup", onRelease); e && e.target && _addListener5(e.target, "mouseup", onRelease); } isClicking = isClickable.call(self2, e.target) && vars.dragClickables === false && !force; if (isClicking) { _addListener5(e.target, "change", onRelease); _dispatchEvent(self2, "pressInit", "onPressInit"); _dispatchEvent(self2, "press", "onPress"); _setSelectable(triggers, true); isPreventingDefault = false; return; } allowNativeTouchScrolling = !touchEventTarget || allowX === allowY || self2.vars.allowNativeTouchScrolling === false || self2.vars.allowContextMenu && e && (e.ctrlKey || e.which > 2) ? false : allowX ? "y" : "x"; isPreventingDefault = !allowNativeTouchScrolling && !self2.allowEventDefault; if (isPreventingDefault) { _preventDefault(e); _addListener5(_win$1, "touchforcechange", _preventDefault); } if (e.changedTouches) { e = touch = e.changedTouches[0]; touchID = e.identifier; } else if (e.pointerId) { touchID = e.pointerId; } else { touch = touchID = null; } _dragCount++; _addToRenderQueue(render3); startPointerY = self2.pointerY = e.pageY; startPointerX = self2.pointerX = e.pageX; _dispatchEvent(self2, "pressInit", "onPressInit"); if (allowNativeTouchScrolling || self2.autoScroll) { _recordMaxScrolls(target.parentNode); } if (target.parentNode && self2.autoScroll && !scrollProxy && !rotationMode && target.parentNode._gsMaxScrollX && !_placeholderDiv.parentNode && !target.getBBox) { _placeholderDiv.style.width = target.parentNode.scrollWidth + "px"; target.parentNode.appendChild(_placeholderDiv); } recordStartPositions(); self2.tween && self2.tween.kill(); self2.isThrowing = false; gsap6.killTweensOf(scrollProxy || target, killProps, true); scrollProxy && gsap6.killTweensOf(target, { scrollTo: 1 }, true); self2.tween = self2.lockedAxis = null; if (vars.zIndexBoost || !rotationMode && !scrollProxy && vars.zIndexBoost !== false) { target.style.zIndex = Draggable2.zIndex++; } self2.isPressed = true; hasDragCallback = !!(vars.onDrag || self2._listeners.drag); hasMoveCallback = !!(vars.onMove || self2._listeners.move); if (vars.cursor !== false || vars.activeCursor) { i = triggers.length; while (--i > -1) { gsap6.set(triggers[i], { cursor: vars.activeCursor || vars.cursor || (_defaultCursor === "grab" ? "grabbing" : _defaultCursor) }); } } _dispatchEvent(self2, "press", "onPress"); InertiaPlugin && InertiaPlugin.track(scrollProxy || target, xyMode ? "x,y" : rotationMode ? "rotation" : "top,left"); }, onMove = function onMove(e) { var originalEvent = e, touches, pointerX, pointerY, i, dx, dy; if (!enabled || _isMultiTouching || !self2.isPressed || !e) { isPreventingDefault && e && enabled && _preventDefault(e); return; } self2.pointerEvent = e; touches = e.changedTouches; if (touches) { e = touches[0]; if (e !== touch && e.identifier !== touchID) { i = touches.length; while (--i > -1 && (e = touches[i]).identifier !== touchID && e.target !== target) { } if (i < 0) { return; } } } else if (e.pointerId && touchID && e.pointerId !== touchID) { return; } if (touchEventTarget && allowNativeTouchScrolling && !touchDragAxis) { _point1.x = e.pageX - (isFixed ? _getDocScrollLeft$1(ownerDoc) : 0); _point1.y = e.pageY - (isFixed ? _getDocScrollTop$1(ownerDoc) : 0); matrix && matrix.apply(_point1, _point1); pointerX = _point1.x; pointerY = _point1.y; dx = Math.abs(pointerX - startPointerX); dy = Math.abs(pointerY - startPointerY); if (dx !== dy && (dx > minimumMovement || dy > minimumMovement) || _isAndroid && allowNativeTouchScrolling === touchDragAxis) { touchDragAxis = dx > dy && allowX ? "x" : "y"; if (allowNativeTouchScrolling && touchDragAxis !== allowNativeTouchScrolling) { _addListener5(_win$1, "touchforcechange", _preventDefault); } if (self2.vars.lockAxisOnTouchScroll !== false && allowX && allowY) { self2.lockedAxis = touchDragAxis === "x" ? "y" : "x"; _isFunction5(self2.vars.onLockAxis) && self2.vars.onLockAxis.call(self2, originalEvent); } if (_isAndroid && allowNativeTouchScrolling === touchDragAxis) { onRelease(originalEvent); return; } } } if (!self2.allowEventDefault && (!allowNativeTouchScrolling || touchDragAxis && allowNativeTouchScrolling !== touchDragAxis) && originalEvent.cancelable !== false) { _preventDefault(originalEvent); isPreventingDefault = true; } else if (isPreventingDefault) { isPreventingDefault = false; } if (self2.autoScroll) { checkAutoScrollBounds = true; } setPointerPosition(e.pageX, e.pageY, hasMoveCallback); }, setPointerPosition = function setPointerPosition(pointerX, pointerY, invokeOnMove) { var dragTolerance = 1 - self2.dragResistance, edgeTolerance = 1 - self2.edgeResistance, prevPointerX = self2.pointerX, prevPointerY = self2.pointerY, prevStartElementY = startElementY, prevX = self2.x, prevY = self2.y, prevEndX = self2.endX, prevEndY = self2.endY, prevEndRotation = self2.endRotation, prevDirty = dirty, xChange, yChange, x, y, dif, temp; self2.pointerX = pointerX; self2.pointerY = pointerY; if (isFixed) { pointerX -= _getDocScrollLeft$1(ownerDoc); pointerY -= _getDocScrollTop$1(ownerDoc); } if (rotationMode) { y = _round9(Math.atan2(rotationOrigin.y - pointerY, pointerX - rotationOrigin.x) * _RAD2DEG3); dif = self2.y - y; if (dif > 180) { startElementY -= 360; self2.y = y; } else if (dif < -180) { startElementY += 360; self2.y = y; } if (matrix) { temp = pointerX * matrix.a + pointerY * matrix.c + matrix.e; pointerY = pointerX * matrix.b + pointerY * matrix.d + matrix.f; pointerX = temp; } if (self2.x !== startElementX || Math.max(Math.abs(startPointerX - pointerX), Math.abs(startPointerY - pointerY)) > minimumMovement) { self2.y = y; x = _round9(startElementX + (startElementY - y) * dragTolerance); } else { x = startElementX; } } else { if (matrix) { temp = pointerX * matrix.a + pointerY * matrix.c + matrix.e; pointerY = pointerX * matrix.b + pointerY * matrix.d + matrix.f; pointerX = temp; } yChange = pointerY - startPointerY; xChange = pointerX - startPointerX; if (yChange < minimumMovement && yChange > -minimumMovement) { yChange = 0; } if (xChange < minimumMovement && xChange > -minimumMovement) { xChange = 0; } if ((self2.lockAxis || self2.lockedAxis) && (xChange || yChange)) { temp = self2.lockedAxis; if (!temp) { self2.lockedAxis = temp = allowX && Math.abs(xChange) > Math.abs(yChange) ? "y" : allowY ? "x" : null; if (temp && _isFunction5(self2.vars.onLockAxis)) { self2.vars.onLockAxis.call(self2, self2.pointerEvent); } } if (temp === "y") { yChange = 0; } else if (temp === "x") { xChange = 0; } } x = _round9(startElementX + xChange * dragTolerance); y = _round9(startElementY + yChange * dragTolerance); } if ((snapX || snapY || snapXY) && (self2.x !== x || self2.y !== y && !rotationMode)) { if (snapXY) { _temp1.x = x; _temp1.y = y; temp = snapXY(_temp1); x = _round9(temp.x); y = _round9(temp.y); } if (snapX) { x = _round9(snapX(x)); } if (snapY) { y = _round9(snapY(y)); } } if (hasBounds) { if (x > maxX) { x = maxX + Math.round((x - maxX) * edgeTolerance); } else if (x < minX) { x = minX + Math.round((x - minX) * edgeTolerance); } if (!rotationMode) { if (y > maxY) { y = Math.round(maxY + (y - maxY) * edgeTolerance); } else if (y < minY) { y = Math.round(minY + (y - minY) * edgeTolerance); } } } if (self2.x !== x || self2.y !== y && !rotationMode) { if (rotationMode) { self2.endRotation = self2.x = self2.endX = _round9(x); dirty = true; } else { if (allowY) { self2.y = self2.endY = y; dirty = true; } if (allowX) { self2.x = self2.endX = x; dirty = true; } } if (!invokeOnMove || _dispatchEvent(self2, "move", "onMove") !== false) { if (!self2.isDragging && self2.isPressed) { self2.isDragging = dragged = true; _dispatchEvent(self2, "dragstart", "onDragStart"); } } else { self2.pointerX = prevPointerX; self2.pointerY = prevPointerY; startElementY = prevStartElementY; self2.x = prevX; self2.y = prevY; self2.endX = prevEndX; self2.endY = prevEndY; self2.endRotation = prevEndRotation; dirty = prevDirty; } } }, onRelease = function onRelease(e, force) { if (!enabled || !self2.isPressed || e && touchID != null && !force && (e.pointerId && e.pointerId !== touchID && e.target !== target || e.changedTouches && !_hasTouchID(e.changedTouches, touchID))) { isPreventingDefault && e && enabled && _preventDefault(e); return; } self2.isPressed = false; var originalEvent = e, wasDragging = self2.isDragging, isContextMenuRelease = self2.vars.allowContextMenu && e && (e.ctrlKey || e.which > 2), placeholderDelayedCall = gsap6.delayedCall(0.001, removePlaceholder), touches, i, syntheticEvent, eventTarget, syntheticClick; if (touchEventTarget) { _removeListener5(touchEventTarget, "touchend", onRelease); _removeListener5(touchEventTarget, "touchmove", onMove); _removeListener5(touchEventTarget, "touchcancel", onRelease); _removeListener5(ownerDoc, "touchstart", _onMultiTouchDocument); } else { _removeListener5(ownerDoc, "mousemove", onMove); } _removeListener5(_win$1, "touchforcechange", _preventDefault); if (!_supportsPointer || !touchEventTarget) { _removeListener5(ownerDoc, "mouseup", onRelease); e && e.target && _removeListener5(e.target, "mouseup", onRelease); } dirty = false; if (wasDragging) { dragEndTime = _lastDragTime = _getTime3(); self2.isDragging = false; } _removeFromRenderQueue(render3); if (isClicking && !isContextMenuRelease) { if (e) { _removeListener5(e.target, "change", onRelease); self2.pointerEvent = originalEvent; } _setSelectable(triggers, false); _dispatchEvent(self2, "release", "onRelease"); _dispatchEvent(self2, "click", "onClick"); isClicking = false; return; } i = triggers.length; while (--i > -1) { _setStyle(triggers[i], "cursor", vars.cursor || (vars.cursor !== false ? _defaultCursor : null)); } _dragCount--; if (e) { touches = e.changedTouches; if (touches) { e = touches[0]; if (e !== touch && e.identifier !== touchID) { i = touches.length; while (--i > -1 && (e = touches[i]).identifier !== touchID && e.target !== target) { } if (i < 0 && !force) { return; } } } self2.pointerEvent = originalEvent; self2.pointerX = e.pageX; self2.pointerY = e.pageY; } if (isContextMenuRelease && originalEvent) { _preventDefault(originalEvent); isPreventingDefault = true; _dispatchEvent(self2, "release", "onRelease"); } else if (originalEvent && !wasDragging) { isPreventingDefault = false; if (interrupted && (vars.snap || vars.bounds)) { animate(vars.inertia || vars.throwProps); } _dispatchEvent(self2, "release", "onRelease"); if ((!_isAndroid || originalEvent.type !== "touchmove") && originalEvent.type.indexOf("cancel") === -1) { _dispatchEvent(self2, "click", "onClick"); if (_getTime3() - clickTime < 300) { _dispatchEvent(self2, "doubleclick", "onDoubleClick"); } eventTarget = originalEvent.target || target; clickTime = _getTime3(); syntheticClick = function syntheticClick() { if (clickTime !== clickDispatch && self2.enabled() && !self2.isPressed && !originalEvent.defaultPrevented) { if (eventTarget.click) { eventTarget.click(); } else if (ownerDoc.createEvent) { syntheticEvent = ownerDoc.createEvent("MouseEvents"); syntheticEvent.initMouseEvent("click", true, true, _win$1, 1, self2.pointerEvent.screenX, self2.pointerEvent.screenY, self2.pointerX, self2.pointerY, false, false, false, false, 0, null); eventTarget.dispatchEvent(syntheticEvent); } } }; if (!_isAndroid && !originalEvent.defaultPrevented) { gsap6.delayedCall(0.05, syntheticClick); } } } else { animate(vars.inertia || vars.throwProps); if (!self2.allowEventDefault && originalEvent && (vars.dragClickables !== false || !isClickable.call(self2, originalEvent.target)) && wasDragging && (!allowNativeTouchScrolling || touchDragAxis && allowNativeTouchScrolling === touchDragAxis) && originalEvent.cancelable !== false) { isPreventingDefault = true; _preventDefault(originalEvent); } else { isPreventingDefault = false; } _dispatchEvent(self2, "release", "onRelease"); } isTweening2() && placeholderDelayedCall.duration(self2.tween.duration()); wasDragging && _dispatchEvent(self2, "dragend", "onDragEnd"); return true; }, updateScroll = function updateScroll(e) { if (e && self2.isDragging && !scrollProxy) { var parent = e.target || target.parentNode, deltaX = parent.scrollLeft - parent._gsScrollX, deltaY = parent.scrollTop - parent._gsScrollY; if (deltaX || deltaY) { if (matrix) { startPointerX -= deltaX * matrix.a + deltaY * matrix.c; startPointerY -= deltaY * matrix.d + deltaX * matrix.b; } else { startPointerX -= deltaX; startPointerY -= deltaY; } parent._gsScrollX += deltaX; parent._gsScrollY += deltaY; setPointerPosition(self2.pointerX, self2.pointerY); } } }, onClick = function onClick(e) { var time = _getTime3(), recentlyClicked = time - clickTime < 100, recentlyDragged = time - dragEndTime < 50, alreadyDispatched = recentlyClicked && clickDispatch === clickTime, defaultPrevented = self2.pointerEvent && self2.pointerEvent.defaultPrevented, alreadyDispatchedTrusted = recentlyClicked && trustedClickDispatch === clickTime, trusted = e.isTrusted || e.isTrusted == null && recentlyClicked && alreadyDispatched; if ((alreadyDispatched || recentlyDragged && self2.vars.suppressClickOnDrag !== false) && e.stopImmediatePropagation) { e.stopImmediatePropagation(); } if (recentlyClicked && !(self2.pointerEvent && self2.pointerEvent.defaultPrevented) && (!alreadyDispatched || trusted && !alreadyDispatchedTrusted)) { if (trusted && alreadyDispatched) { trustedClickDispatch = clickTime; } clickDispatch = clickTime; return; } if (self2.isPressed || recentlyDragged || recentlyClicked) { if (!trusted || !e.detail || !recentlyClicked || defaultPrevented) { _preventDefault(e); } } if (!recentlyClicked && !recentlyDragged && !dragged) { e && e.target && (self2.pointerEvent = e); _dispatchEvent(self2, "click", "onClick"); } }, localizePoint = function localizePoint(p) { return matrix ? { x: p.x * matrix.a + p.y * matrix.c + matrix.e, y: p.x * matrix.b + p.y * matrix.d + matrix.f } : { x: p.x, y: p.y }; }; old = Draggable2.get(target); old && old.kill(); _this2.startDrag = function(event, align) { var r1, r2, p1, p2; onPress(event || self2.pointerEvent, true); if (align && !self2.hitTest(event || self2.pointerEvent)) { r1 = _parseRect(event || self2.pointerEvent); r2 = _parseRect(target); p1 = localizePoint({ x: r1.left + r1.width / 2, y: r1.top + r1.height / 2 }); p2 = localizePoint({ x: r2.left + r2.width / 2, y: r2.top + r2.height / 2 }); startPointerX -= p1.x - p2.x; startPointerY -= p1.y - p2.y; } if (!self2.isDragging) { self2.isDragging = dragged = true; _dispatchEvent(self2, "dragstart", "onDragStart"); } }; _this2.drag = onMove; _this2.endDrag = function(e) { return onRelease(e || self2.pointerEvent, true); }; _this2.timeSinceDrag = function() { return self2.isDragging ? 0 : (_getTime3() - dragEndTime) / 1000; }; _this2.timeSinceClick = function() { return (_getTime3() - clickTime) / 1000; }; _this2.hitTest = function(target2, threshold) { return Draggable2.hitTest(self2.target, target2, threshold); }; _this2.getDirection = function(from, diagonalThreshold) { var mode = from === "velocity" && InertiaPlugin ? from : _isObject5(from) && !rotationMode ? "element" : "start", xChange, yChange, ratio, direction, r1, r2; if (mode === "element") { r1 = _parseRect(self2.target); r2 = _parseRect(from); } xChange = mode === "start" ? self2.x - startElementX : mode === "velocity" ? InertiaPlugin.getVelocity(target, xProp) : r1.left + r1.width / 2 - (r2.left + r2.width / 2); if (rotationMode) { return xChange < 0 ? "counter-clockwise" : "clockwise"; } else { diagonalThreshold = diagonalThreshold || 2; yChange = mode === "start" ? self2.y - startElementY : mode === "velocity" ? InertiaPlugin.getVelocity(target, yProp) : r1.top + r1.height / 2 - (r2.top + r2.height / 2); ratio = Math.abs(xChange / yChange); direction = ratio < 1 / diagonalThreshold ? "" : xChange < 0 ? "left" : "right"; if (ratio < diagonalThreshold) { if (direction !== "") { direction += "-"; } direction += yChange < 0 ? "up" : "down"; } } return direction; }; _this2.applyBounds = function(newBounds, sticky) { var x, y, forceZeroVelocity, e, parent, isRoot; if (newBounds && vars.bounds !== newBounds) { vars.bounds = newBounds; return self2.update(true, sticky); } syncXY(true); calculateBounds(); if (hasBounds && !isTweening2()) { x = self2.x; y = self2.y; if (x > maxX) { x = maxX; } else if (x < minX) { x = minX; } if (y > maxY) { y = maxY; } else if (y < minY) { y = minY; } if (self2.x !== x || self2.y !== y) { forceZeroVelocity = true; self2.x = self2.endX = x; if (rotationMode) { self2.endRotation = x; } else { self2.y = self2.endY = y; } dirty = true; render3(true); if (self2.autoScroll && !self2.isDragging) { _recordMaxScrolls(target.parentNode); e = target; _windowProxy.scrollTop = _win$1.pageYOffset != null ? _win$1.pageYOffset : ownerDoc.documentElement.scrollTop != null ? ownerDoc.documentElement.scrollTop : ownerDoc.body.scrollTop; _windowProxy.scrollLeft = _win$1.pageXOffset != null ? _win$1.pageXOffset : ownerDoc.documentElement.scrollLeft != null ? ownerDoc.documentElement.scrollLeft : ownerDoc.body.scrollLeft; while (e && !isRoot) { isRoot = _isRoot(e.parentNode); parent = isRoot ? _windowProxy : e.parentNode; if (allowY && parent.scrollTop > parent._gsMaxScrollY) { parent.scrollTop = parent._gsMaxScrollY; } if (allowX && parent.scrollLeft > parent._gsMaxScrollX) { parent.scrollLeft = parent._gsMaxScrollX; } e = parent; } } } if (self2.isThrowing && (forceZeroVelocity || self2.endX > maxX || self2.endX < minX || self2.endY > maxY || self2.endY < minY)) { animate(vars.inertia || vars.throwProps, forceZeroVelocity); } } return self2; }; _this2.update = function(applyBounds, sticky, ignoreExternalChanges) { if (sticky && self2.isPressed) { if (rotationMode) { self2.x = self2.y = _round9(parseFloat(gsCache.rotation)); } else { var m = getGlobalMatrix(target), p = innerMatrix.apply({ x: self2.x - startElementX, y: self2.y - startElementY }), m2 = getGlobalMatrix(target.parentNode, true); m2.apply({ x: m.e - p.x, y: m.f - p.y }, p); self2.x = _round9(self2.x - (p.x - m2.e)); self2.y = _round9(self2.y - (p.y - m2.f)); } render3(true); recordStartPositions(); } var { x, y } = self2; updateMatrix(!sticky); if (applyBounds) { self2.applyBounds(); } else { dirty && ignoreExternalChanges && render3(true); syncXY(true); } if (sticky) { setPointerPosition(self2.pointerX, self2.pointerY); dirty && render3(true); } if (self2.isPressed && !sticky && (allowX && Math.abs(x - self2.x) > 0.01 || allowY && Math.abs(y - self2.y) > 0.01 && !rotationMode)) { recordStartPositions(); } if (self2.autoScroll) { _recordMaxScrolls(target.parentNode, self2.isDragging); checkAutoScrollBounds = self2.isDragging; render3(true); _removeScrollListener(target, updateScroll); _addScrollListener(target, updateScroll); } return self2; }; _this2.enable = function(type2) { var setVars = { lazy: true }, id, i, trigger2; if (vars.cursor !== false) { setVars.cursor = vars.cursor || _defaultCursor; } if (gsap6.utils.checkPrefix("touchCallout")) { setVars.touchCallout = "none"; } if (type2 !== "soft") { _setTouchActionForAllDescendants(triggers, allowX === allowY ? "none" : vars.allowNativeTouchScrolling && target.scrollHeight === target.clientHeight === (target.scrollWidth === target.clientHeight) || vars.allowEventDefault ? "manipulation" : allowX ? "pan-y" : "pan-x"); i = triggers.length; while (--i > -1) { trigger2 = triggers[i]; _supportsPointer || _addListener5(trigger2, "mousedown", onPress); _addListener5(trigger2, "touchstart", onPress); _addListener5(trigger2, "click", onClick, true); gsap6.set(trigger2, setVars); if (trigger2.getBBox && trigger2.ownerSVGElement && allowX !== allowY) { gsap6.set(trigger2.ownerSVGElement, { touchAction: vars.allowNativeTouchScrolling || vars.allowEventDefault ? "manipulation" : allowX ? "pan-y" : "pan-x" }); } vars.allowContextMenu || _addListener5(trigger2, "contextmenu", onContextMenu); } _setSelectable(triggers, false); } _addScrollListener(target, updateScroll); enabled = true; if (InertiaPlugin && type2 !== "soft") { InertiaPlugin.track(scrollProxy || target, xyMode ? "x,y" : rotationMode ? "rotation" : "top,left"); } target._gsDragID = id = target._gsDragID || "d" + _lookupCount++; _lookup[id] = self2; if (scrollProxy) { scrollProxy.enable(); scrollProxy.element._gsDragID = id; } (vars.bounds || rotationMode) && recordStartPositions(); vars.bounds && self2.applyBounds(); return self2; }; _this2.disable = function(type2) { var dragging = self2.isDragging, i = triggers.length, trigger2; while (--i > -1) { _setStyle(triggers[i], "cursor", null); } if (type2 !== "soft") { _setTouchActionForAllDescendants(triggers, null); i = triggers.length; while (--i > -1) { trigger2 = triggers[i]; _setStyle(trigger2, "touchCallout", null); _removeListener5(trigger2, "mousedown", onPress); _removeListener5(trigger2, "touchstart", onPress); _removeListener5(trigger2, "click", onClick, true); _removeListener5(trigger2, "contextmenu", onContextMenu); } _setSelectable(triggers, true); if (touchEventTarget) { _removeListener5(touchEventTarget, "touchcancel", onRelease); _removeListener5(touchEventTarget, "touchend", onRelease); _removeListener5(touchEventTarget, "touchmove", onMove); } _removeListener5(ownerDoc, "mouseup", onRelease); _removeListener5(ownerDoc, "mousemove", onMove); } _removeScrollListener(target, updateScroll); enabled = false; if (InertiaPlugin && type2 !== "soft") { InertiaPlugin.untrack(scrollProxy || target, xyMode ? "x,y" : rotationMode ? "rotation" : "top,left"); self2.tween && self2.tween.kill(); } scrollProxy && scrollProxy.disable(); _removeFromRenderQueue(render3); self2.isDragging = self2.isPressed = isClicking = false; dragging && _dispatchEvent(self2, "dragend", "onDragEnd"); return self2; }; _this2.enabled = function(value, type2) { return arguments.length ? value ? self2.enable(type2) : self2.disable(type2) : enabled; }; _this2.kill = function() { self2.isThrowing = false; self2.tween && self2.tween.kill(); self2.disable(); gsap6.set(triggers, { clearProps: "userSelect" }); delete _lookup[target._gsDragID]; return self2; }; _this2.revert = function() { this.kill(); this.styles && this.styles.revert(); }; if (~type.indexOf("scroll")) { scrollProxy = _this2.scrollProxy = new ScrollProxy(target, _extend({ onKill: function onKill() { self2.isPressed && onRelease(null); } }, vars)); target.style.overflowY = allowY && !_isTouchDevice ? "auto" : "hidden"; target.style.overflowX = allowX && !_isTouchDevice ? "auto" : "hidden"; target = scrollProxy.content; } if (rotationMode) { killProps.rotation = 1; } else { if (allowX) { killProps[xProp] = 1; } if (allowY) { killProps[yProp] = 1; } } gsCache.force3D = "force3D" in vars ? vars.force3D : true; _context5(_assertThisInitialized2(_this2)); _this2.enable(); return _this2; } Draggable2.register = function register(core) { gsap6 = core; _initCore7(); }; Draggable2.create = function create(targets, vars) { _coreInitted6 || _initCore7(true); return _toArray3(targets).map(function(target) { return new Draggable2(target, vars); }); }; Draggable2.get = function get(target) { return _lookup[(_toArray3(target)[0] || {})._gsDragID]; }; Draggable2.timeSinceDrag = function timeSinceDrag() { return (_getTime3() - _lastDragTime) / 1000; }; Draggable2.hitTest = function hitTest(obj1, obj2, threshold) { if (obj1 === obj2) { return false; } var r1 = _parseRect(obj1), r2 = _parseRect(obj2), top = r1.top, left = r1.left, right = r1.right, bottom = r1.bottom, width = r1.width, height = r1.height, isOutside = r2.left > right || r2.right < left || r2.top > bottom || r2.bottom < top, overlap, area, isRatio; if (isOutside || !threshold) { return !isOutside; } isRatio = (threshold + "").indexOf("%") !== -1; threshold = parseFloat(threshold) || 0; overlap = { left: Math.max(left, r2.left), top: Math.max(top, r2.top) }; overlap.width = Math.min(right, r2.right) - overlap.left; overlap.height = Math.min(bottom, r2.bottom) - overlap.top; if (overlap.width < 0 || overlap.height < 0) { return false; } if (isRatio) { threshold *= 0.01; area = overlap.width * overlap.height; return area >= width * height * threshold || area >= r2.width * r2.height * threshold; } return overlap.width > threshold && overlap.height > threshold; }; return Draggable2; }(EventDispatcher); _setDefaults5(Draggable.prototype, { pointerX: 0, pointerY: 0, startX: 0, startY: 0, deltaX: 0, deltaY: 0, isDragging: false, isPressed: false }); Draggable.zIndex = 1000; Draggable.version = "3.14.2"; _getGSAP7() && gsap6.registerPlugin(Draggable); exports2.Draggable = Draggable; exports2.default = Draggable; if (typeof window === "undefined" || window !== exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); } else { delete window.default; } }); }); // src/app.ts var exports_app = {}; __export(exports_app, { App: () => App }); // node_modules/lenis/dist/lenis.mjs var version = "1.3.17"; function clamp(min, input, max) { return Math.max(min, Math.min(input, max)); } function lerp(x, y, t) { return (1 - t) * x + t * y; } function damp(x, y, lambda, deltaTime) { return lerp(x, y, 1 - Math.exp(-lambda * deltaTime)); } function modulo(n, d) { return (n % d + d) % d; } var Animate = class { isRunning = false; value = 0; from = 0; to = 0; currentTime = 0; lerp; duration; easing; onUpdate; advance(deltaTime) { if (!this.isRunning) return; let completed = false; if (this.duration && this.easing) { this.currentTime += deltaTime; const linearProgress = clamp(0, this.currentTime / this.duration, 1); completed = linearProgress >= 1; const easedProgress = completed ? 1 : this.easing(linearProgress); this.value = this.from + (this.to - this.from) * easedProgress; } else if (this.lerp) { this.value = damp(this.value, this.to, this.lerp * 60, deltaTime); if (Math.round(this.value) === this.to) { this.value = this.to; completed = true; } } else { this.value = this.to; completed = true; } if (completed) { this.stop(); } this.onUpdate?.(this.value, completed); } stop() { this.isRunning = false; } fromTo(from, to, { lerp: lerp2, duration, easing, onStart, onUpdate }) { this.from = this.value = from; this.to = to; this.lerp = lerp2; this.duration = duration; this.easing = easing; this.currentTime = 0; this.isRunning = true; onStart?.(); this.onUpdate = onUpdate; } }; function debounce(callback, delay) { let timer; return function(...args) { let context = this; clearTimeout(timer); timer = setTimeout(() => { timer = undefined; callback.apply(context, args); }, delay); }; } var Dimensions = class { constructor(wrapper, content, { autoResize = true, debounce: debounceValue = 250 } = {}) { this.wrapper = wrapper; this.content = content; if (autoResize) { this.debouncedResize = debounce(this.resize, debounceValue); if (this.wrapper instanceof Window) { window.addEventListener("resize", this.debouncedResize, false); } else { this.wrapperResizeObserver = new ResizeObserver(this.debouncedResize); this.wrapperResizeObserver.observe(this.wrapper); } this.contentResizeObserver = new ResizeObserver(this.debouncedResize); this.contentResizeObserver.observe(this.content); } this.resize(); } width = 0; height = 0; scrollHeight = 0; scrollWidth = 0; debouncedResize; wrapperResizeObserver; contentResizeObserver; destroy() { this.wrapperResizeObserver?.disconnect(); this.contentResizeObserver?.disconnect(); if (this.wrapper === window && this.debouncedResize) { window.removeEventListener("resize", this.debouncedResize, false); } } resize = () => { this.onWrapperResize(); this.onContentResize(); }; onWrapperResize = () => { if (this.wrapper instanceof Window) { this.width = window.innerWidth; this.height = window.innerHeight; } else { this.width = this.wrapper.clientWidth; this.height = this.wrapper.clientHeight; } }; onContentResize = () => { if (this.wrapper instanceof Window) { this.scrollHeight = this.content.scrollHeight; this.scrollWidth = this.content.scrollWidth; } else { this.scrollHeight = this.wrapper.scrollHeight; this.scrollWidth = this.wrapper.scrollWidth; } }; get limit() { return { x: this.scrollWidth - this.width, y: this.scrollHeight - this.height }; } }; var Emitter = class { events = {}; emit(event, ...args) { let callbacks = this.events[event] || []; for (let i = 0, length = callbacks.length;i < length; i++) { callbacks[i]?.(...args); } } on(event, cb) { this.events[event]?.push(cb) || (this.events[event] = [cb]); return () => { this.events[event] = this.events[event]?.filter((i) => cb !== i); }; } off(event, callback) { this.events[event] = this.events[event]?.filter((i) => callback !== i); } destroy() { this.events = {}; } }; var LINE_HEIGHT = 100 / 6; var listenerOptions = { passive: false }; var VirtualScroll = class { constructor(element, options = { wheelMultiplier: 1, touchMultiplier: 1 }) { this.element = element; this.options = options; window.addEventListener("resize", this.onWindowResize, false); this.onWindowResize(); this.element.addEventListener("wheel", this.onWheel, listenerOptions); this.element.addEventListener("touchstart", this.onTouchStart, listenerOptions); this.element.addEventListener("touchmove", this.onTouchMove, listenerOptions); this.element.addEventListener("touchend", this.onTouchEnd, listenerOptions); } touchStart = { x: 0, y: 0 }; lastDelta = { x: 0, y: 0 }; window = { width: 0, height: 0 }; emitter = new Emitter; on(event, callback) { return this.emitter.on(event, callback); } destroy() { this.emitter.destroy(); window.removeEventListener("resize", this.onWindowResize, false); this.element.removeEventListener("wheel", this.onWheel, listenerOptions); this.element.removeEventListener("touchstart", this.onTouchStart, listenerOptions); this.element.removeEventListener("touchmove", this.onTouchMove, listenerOptions); this.element.removeEventListener("touchend", this.onTouchEnd, listenerOptions); } onTouchStart = (event) => { const { clientX, clientY } = event.targetTouches ? event.targetTouches[0] : event; this.touchStart.x = clientX; this.touchStart.y = clientY; this.lastDelta = { x: 0, y: 0 }; this.emitter.emit("scroll", { deltaX: 0, deltaY: 0, event }); }; onTouchMove = (event) => { const { clientX, clientY } = event.targetTouches ? event.targetTouches[0] : event; const deltaX = -(clientX - this.touchStart.x) * this.options.touchMultiplier; const deltaY = -(clientY - this.touchStart.y) * this.options.touchMultiplier; this.touchStart.x = clientX; this.touchStart.y = clientY; this.lastDelta = { x: deltaX, y: deltaY }; this.emitter.emit("scroll", { deltaX, deltaY, event }); }; onTouchEnd = (event) => { this.emitter.emit("scroll", { deltaX: this.lastDelta.x, deltaY: this.lastDelta.y, event }); }; onWheel = (event) => { let { deltaX, deltaY, deltaMode } = event; const multiplierX = deltaMode === 1 ? LINE_HEIGHT : deltaMode === 2 ? this.window.width : 1; const multiplierY = deltaMode === 1 ? LINE_HEIGHT : deltaMode === 2 ? this.window.height : 1; deltaX *= multiplierX; deltaY *= multiplierY; deltaX *= this.options.wheelMultiplier; deltaY *= this.options.wheelMultiplier; this.emitter.emit("scroll", { deltaX, deltaY, event }); }; onWindowResize = () => { this.window = { width: window.innerWidth, height: window.innerHeight }; }; }; var defaultEasing = (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)); var Lenis = class { _isScrolling = false; _isStopped = false; _isLocked = false; _preventNextNativeScrollEvent = false; _resetVelocityTimeout = null; _rafId = null; isTouching; time = 0; userData = {}; lastVelocity = 0; velocity = 0; direction = 0; options; targetScroll; animatedScroll; animate = new Animate; emitter = new Emitter; dimensions; virtualScroll; constructor({ wrapper = window, content = document.documentElement, eventsTarget = wrapper, smoothWheel = true, syncTouch = false, syncTouchLerp = 0.075, touchInertiaExponent = 1.7, duration, easing, lerp: lerp2 = 0.1, infinite = false, orientation = "vertical", gestureOrientation = orientation === "horizontal" ? "both" : "vertical", touchMultiplier = 1, wheelMultiplier = 1, autoResize = true, prevent, virtualScroll, overscroll = true, autoRaf = false, anchors = false, autoToggle = false, allowNestedScroll = false, __experimental__naiveDimensions = false, naiveDimensions = __experimental__naiveDimensions, stopInertiaOnNavigate = false } = {}) { window.lenisVersion = version; if (!wrapper || wrapper === document.documentElement) { wrapper = window; } if (typeof duration === "number" && typeof easing !== "function") { easing = defaultEasing; } else if (typeof easing === "function" && typeof duration !== "number") { duration = 1; } this.options = { wrapper, content, eventsTarget, smoothWheel, syncTouch, syncTouchLerp, touchInertiaExponent, duration, easing, lerp: lerp2, infinite, gestureOrientation, orientation, touchMultiplier, wheelMultiplier, autoResize, prevent, virtualScroll, overscroll, autoRaf, anchors, autoToggle, allowNestedScroll, naiveDimensions, stopInertiaOnNavigate }; this.dimensions = new Dimensions(wrapper, content, { autoResize }); this.updateClassName(); this.targetScroll = this.animatedScroll = this.actualScroll; this.options.wrapper.addEventListener("scroll", this.onNativeScroll, false); this.options.wrapper.addEventListener("scrollend", this.onScrollEnd, { capture: true }); if (this.options.anchors || this.options.stopInertiaOnNavigate) { this.options.wrapper.addEventListener("click", this.onClick, false); } this.options.wrapper.addEventListener("pointerdown", this.onPointerDown, false); this.virtualScroll = new VirtualScroll(eventsTarget, { touchMultiplier, wheelMultiplier }); this.virtualScroll.on("scroll", this.onVirtualScroll); if (this.options.autoToggle) { this.checkOverflow(); this.rootElement.addEventListener("transitionend", this.onTransitionEnd, { passive: true }); } if (this.options.autoRaf) { this._rafId = requestAnimationFrame(this.raf); } } destroy() { this.emitter.destroy(); this.options.wrapper.removeEventListener("scroll", this.onNativeScroll, false); this.options.wrapper.removeEventListener("scrollend", this.onScrollEnd, { capture: true }); this.options.wrapper.removeEventListener("pointerdown", this.onPointerDown, false); if (this.options.anchors || this.options.stopInertiaOnNavigate) { this.options.wrapper.removeEventListener("click", this.onClick, false); } this.virtualScroll.destroy(); this.dimensions.destroy(); this.cleanUpClassName(); if (this._rafId) { cancelAnimationFrame(this._rafId); } } on(event, callback) { return this.emitter.on(event, callback); } off(event, callback) { return this.emitter.off(event, callback); } onScrollEnd = (e) => { if (!(e instanceof CustomEvent)) { if (this.isScrolling === "smooth" || this.isScrolling === false) { e.stopPropagation(); } } }; dispatchScrollendEvent = () => { this.options.wrapper.dispatchEvent(new CustomEvent("scrollend", { bubbles: this.options.wrapper === window, detail: { lenisScrollEnd: true } })); }; get overflow() { const property = this.isHorizontal ? "overflow-x" : "overflow-y"; return getComputedStyle(this.rootElement)[property]; } checkOverflow() { if (["hidden", "clip"].includes(this.overflow)) { this.internalStop(); } else { this.internalStart(); } } onTransitionEnd = (event) => { if (event.propertyName.includes("overflow")) { this.checkOverflow(); } }; setScroll(scroll) { if (this.isHorizontal) { this.options.wrapper.scrollTo({ left: scroll, behavior: "instant" }); } else { this.options.wrapper.scrollTo({ top: scroll, behavior: "instant" }); } } onClick = (event) => { const path = event.composedPath(); const anchorElements = path.filter((node) => node instanceof HTMLAnchorElement && node.getAttribute("href")); if (this.options.anchors) { const anchor = anchorElements.find((node) => node.getAttribute("href")?.includes("#")); if (anchor) { const href = anchor.getAttribute("href"); if (href) { const options = typeof this.options.anchors === "object" && this.options.anchors ? this.options.anchors : undefined; const target = `#${href.split("#")[1]}`; this.scrollTo(target, options); } } } if (this.options.stopInertiaOnNavigate) { const internalLink = anchorElements.find((node) => node.host === window.location.host); if (internalLink) { this.reset(); } } }; onPointerDown = (event) => { if (event.button === 1) { this.reset(); } }; onVirtualScroll = (data) => { if (typeof this.options.virtualScroll === "function" && this.options.virtualScroll(data) === false) return; const { deltaX, deltaY, event } = data; this.emitter.emit("virtual-scroll", { deltaX, deltaY, event }); if (event.ctrlKey) return; if (event.lenisStopPropagation) return; const isTouch = event.type.includes("touch"); const isWheel = event.type.includes("wheel"); this.isTouching = event.type === "touchstart" || event.type === "touchmove"; const isClickOrTap = deltaX === 0 && deltaY === 0; const isTapToStop = this.options.syncTouch && isTouch && event.type === "touchstart" && isClickOrTap && !this.isStopped && !this.isLocked; if (isTapToStop) { this.reset(); return; } const isUnknownGesture = this.options.gestureOrientation === "vertical" && deltaY === 0 || this.options.gestureOrientation === "horizontal" && deltaX === 0; if (isClickOrTap || isUnknownGesture) { return; } let composedPath = event.composedPath(); composedPath = composedPath.slice(0, composedPath.indexOf(this.rootElement)); const prevent = this.options.prevent; if (!!composedPath.find((node) => node instanceof HTMLElement && (typeof prevent === "function" && prevent?.(node) || node.hasAttribute?.("data-lenis-prevent") || isTouch && node.hasAttribute?.("data-lenis-prevent-touch") || isWheel && node.hasAttribute?.("data-lenis-prevent-wheel") || this.options.allowNestedScroll && this.checkNestedScroll(node, { deltaX, deltaY })))) return; if (this.isStopped || this.isLocked) { if (event.cancelable) { event.preventDefault(); } return; } const isSmooth = this.options.syncTouch && isTouch || this.options.smoothWheel && isWheel; if (!isSmooth) { this.isScrolling = "native"; this.animate.stop(); event.lenisStopPropagation = true; return; } let delta = deltaY; if (this.options.gestureOrientation === "both") { delta = Math.abs(deltaY) > Math.abs(deltaX) ? deltaY : deltaX; } else if (this.options.gestureOrientation === "horizontal") { delta = deltaX; } if (!this.options.overscroll || this.options.infinite || this.options.wrapper !== window && this.limit > 0 && (this.animatedScroll > 0 && this.animatedScroll < this.limit || this.animatedScroll === 0 && deltaY > 0 || this.animatedScroll === this.limit && deltaY < 0)) { event.lenisStopPropagation = true; } if (event.cancelable) { event.preventDefault(); } const isSyncTouch = isTouch && this.options.syncTouch; const isTouchEnd = isTouch && event.type === "touchend"; const hasTouchInertia = isTouchEnd; if (hasTouchInertia) { delta = Math.sign(this.velocity) * Math.pow(Math.abs(this.velocity), this.options.touchInertiaExponent); } this.scrollTo(this.targetScroll + delta, { programmatic: false, ...isSyncTouch ? { lerp: hasTouchInertia ? this.options.syncTouchLerp : 1 } : { lerp: this.options.lerp, duration: this.options.duration, easing: this.options.easing } }); }; resize() { this.dimensions.resize(); this.animatedScroll = this.targetScroll = this.actualScroll; this.emit(); } emit() { this.emitter.emit("scroll", this); } onNativeScroll = () => { if (this._resetVelocityTimeout !== null) { clearTimeout(this._resetVelocityTimeout); this._resetVelocityTimeout = null; } if (this._preventNextNativeScrollEvent) { this._preventNextNativeScrollEvent = false; return; } if (this.isScrolling === false || this.isScrolling === "native") { const lastScroll = this.animatedScroll; this.animatedScroll = this.targetScroll = this.actualScroll; this.lastVelocity = this.velocity; this.velocity = this.animatedScroll - lastScroll; this.direction = Math.sign(this.animatedScroll - lastScroll); if (!this.isStopped) { this.isScrolling = "native"; } this.emit(); if (this.velocity !== 0) { this._resetVelocityTimeout = setTimeout(() => { this.lastVelocity = this.velocity; this.velocity = 0; this.isScrolling = false; this.emit(); }, 400); } } }; reset() { this.isLocked = false; this.isScrolling = false; this.animatedScroll = this.targetScroll = this.actualScroll; this.lastVelocity = this.velocity = 0; this.animate.stop(); } start() { if (!this.isStopped) return; if (this.options.autoToggle) { this.rootElement.style.removeProperty("overflow"); return; } this.internalStart(); } internalStart() { if (!this.isStopped) return; this.reset(); this.isStopped = false; this.emit(); } stop() { if (this.isStopped) return; if (this.options.autoToggle) { this.rootElement.style.setProperty("overflow", "clip"); return; } this.internalStop(); } internalStop() { if (this.isStopped) return; this.reset(); this.isStopped = true; this.emit(); } raf = (time) => { const deltaTime = time - (this.time || time); this.time = time; this.animate.advance(deltaTime * 0.001); if (this.options.autoRaf) { this._rafId = requestAnimationFrame(this.raf); } }; scrollTo(target, { offset = 0, immediate = false, lock = false, programmatic = true, lerp: lerp2 = programmatic ? this.options.lerp : undefined, duration = programmatic ? this.options.duration : undefined, easing = programmatic ? this.options.easing : undefined, onStart, onComplete, force = false, userData } = {}) { if ((this.isStopped || this.isLocked) && !force) return; if (typeof target === "string" && ["top", "left", "start", "#"].includes(target)) { target = 0; } else if (typeof target === "string" && ["bottom", "right", "end"].includes(target)) { target = this.limit; } else { let node; if (typeof target === "string") { node = document.querySelector(target); if (!node) { if (target === "#top") { target = 0; } else { console.warn("Lenis: Target not found", target); } } } else if (target instanceof HTMLElement && target?.nodeType) { node = target; } if (node) { if (this.options.wrapper !== window) { const wrapperRect = this.rootElement.getBoundingClientRect(); offset -= this.isHorizontal ? wrapperRect.left : wrapperRect.top; } const rect = node.getBoundingClientRect(); target = (this.isHorizontal ? rect.left : rect.top) + this.animatedScroll; } } if (typeof target !== "number") return; target += offset; target = Math.round(target); if (this.options.infinite) { if (programmatic) { this.targetScroll = this.animatedScroll = this.scroll; const distance = target - this.animatedScroll; if (distance > this.limit / 2) { target = target - this.limit; } else if (distance < -this.limit / 2) { target = target + this.limit; } } } else { target = clamp(0, target, this.limit); } if (target === this.targetScroll) { onStart?.(this); onComplete?.(this); return; } this.userData = userData ?? {}; if (immediate) { this.animatedScroll = this.targetScroll = target; this.setScroll(this.scroll); this.reset(); this.preventNextNativeScrollEvent(); this.emit(); onComplete?.(this); this.userData = {}; requestAnimationFrame(() => { this.dispatchScrollendEvent(); }); return; } if (!programmatic) { this.targetScroll = target; } if (typeof duration === "number" && typeof easing !== "function") { easing = defaultEasing; } else if (typeof easing === "function" && typeof duration !== "number") { duration = 1; } this.animate.fromTo(this.animatedScroll, target, { duration, easing, lerp: lerp2, onStart: () => { if (lock) this.isLocked = true; this.isScrolling = "smooth"; onStart?.(this); }, onUpdate: (value, completed) => { this.isScrolling = "smooth"; this.lastVelocity = this.velocity; this.velocity = value - this.animatedScroll; this.direction = Math.sign(this.velocity); this.animatedScroll = value; this.setScroll(this.scroll); if (programmatic) { this.targetScroll = value; } if (!completed) this.emit(); if (completed) { this.reset(); this.emit(); onComplete?.(this); this.userData = {}; requestAnimationFrame(() => { this.dispatchScrollendEvent(); }); this.preventNextNativeScrollEvent(); } } }); } preventNextNativeScrollEvent() { this._preventNextNativeScrollEvent = true; requestAnimationFrame(() => { this._preventNextNativeScrollEvent = false; }); } checkNestedScroll(node, { deltaX, deltaY }) { const time = Date.now(); const cache = node._lenis ??= {}; let hasOverflowX, hasOverflowY, isScrollableX, isScrollableY, scrollWidth, scrollHeight, clientWidth, clientHeight; const gestureOrientation = this.options.gestureOrientation; if (time - (cache.time ?? 0) > 2000) { cache.time = Date.now(); const computedStyle = window.getComputedStyle(node); cache.computedStyle = computedStyle; const overflowXString = computedStyle.overflowX; const overflowYString = computedStyle.overflowY; hasOverflowX = ["auto", "overlay", "scroll"].includes(overflowXString); hasOverflowY = ["auto", "overlay", "scroll"].includes(overflowYString); cache.hasOverflowX = hasOverflowX; cache.hasOverflowY = hasOverflowY; if (!hasOverflowX && !hasOverflowY) return false; if (gestureOrientation === "vertical" && !hasOverflowY) return false; if (gestureOrientation === "horizontal" && !hasOverflowX) return false; scrollWidth = node.scrollWidth; scrollHeight = node.scrollHeight; clientWidth = node.clientWidth; clientHeight = node.clientHeight; isScrollableX = scrollWidth > clientWidth; isScrollableY = scrollHeight > clientHeight; cache.isScrollableX = isScrollableX; cache.isScrollableY = isScrollableY; cache.scrollWidth = scrollWidth; cache.scrollHeight = scrollHeight; cache.clientWidth = clientWidth; cache.clientHeight = clientHeight; } else { isScrollableX = cache.isScrollableX; isScrollableY = cache.isScrollableY; hasOverflowX = cache.hasOverflowX; hasOverflowY = cache.hasOverflowY; scrollWidth = cache.scrollWidth; scrollHeight = cache.scrollHeight; clientWidth = cache.clientWidth; clientHeight = cache.clientHeight; } if (!hasOverflowX && !hasOverflowY || !isScrollableX && !isScrollableY) { return false; } if (gestureOrientation === "vertical" && (!hasOverflowY || !isScrollableY)) return false; if (gestureOrientation === "horizontal" && (!hasOverflowX || !isScrollableX)) return false; let orientation; if (gestureOrientation === "horizontal") { orientation = "x"; } else if (gestureOrientation === "vertical") { orientation = "y"; } else { const isScrollingX = deltaX !== 0; const isScrollingY = deltaY !== 0; if (isScrollingX && hasOverflowX && isScrollableX) { orientation = "x"; } if (isScrollingY && hasOverflowY && isScrollableY) { orientation = "y"; } } if (!orientation) return false; let scroll, maxScroll, delta, hasOverflow, isScrollable; if (orientation === "x") { scroll = node.scrollLeft; maxScroll = scrollWidth - clientWidth; delta = deltaX; hasOverflow = hasOverflowX; isScrollable = isScrollableX; } else if (orientation === "y") { scroll = node.scrollTop; maxScroll = scrollHeight - clientHeight; delta = deltaY; hasOverflow = hasOverflowY; isScrollable = isScrollableY; } else { return false; } const willScroll = delta > 0 ? scroll < maxScroll : scroll > 0; return willScroll && hasOverflow && isScrollable; } get rootElement() { return this.options.wrapper === window ? document.documentElement : this.options.wrapper; } get limit() { if (this.options.naiveDimensions) { if (this.isHorizontal) { return this.rootElement.scrollWidth - this.rootElement.clientWidth; } else { return this.rootElement.scrollHeight - this.rootElement.clientHeight; } } else { return this.dimensions.limit[this.isHorizontal ? "x" : "y"]; } } get isHorizontal() { return this.options.orientation === "horizontal"; } get actualScroll() { const wrapper = this.options.wrapper; return this.isHorizontal ? wrapper.scrollX ?? wrapper.scrollLeft : wrapper.scrollY ?? wrapper.scrollTop; } get scroll() { return this.options.infinite ? modulo(this.animatedScroll, this.limit) : this.animatedScroll; } get progress() { return this.limit === 0 ? 1 : this.scroll / this.limit; } get isScrolling() { return this._isScrolling; } set isScrolling(value) { if (this._isScrolling !== value) { this._isScrolling = value; this.updateClassName(); } } get isStopped() { return this._isStopped; } set isStopped(value) { if (this._isStopped !== value) { this._isStopped = value; this.updateClassName(); } } get isLocked() { return this._isLocked; } set isLocked(value) { if (this._isLocked !== value) { this._isLocked = value; this.updateClassName(); } } get isSmooth() { return this.isScrolling === "smooth"; } get className() { let className = "lenis"; if (this.options.autoToggle) className += " lenis-autoToggle"; if (this.isStopped) className += " lenis-stopped"; if (this.isLocked) className += " lenis-locked"; if (this.isScrolling) className += " lenis-scrolling"; if (this.isScrolling === "smooth") className += " lenis-smooth"; return className; } updateClassName() { this.cleanUpClassName(); this.rootElement.className = `${this.rootElement.className} ${this.className}`.trim(); } cleanUpClassName() { this.rootElement.className = this.rootElement.className.replace(/lenis(-\w+)?/g, "").trim(); } }; // node_modules/gsap/gsap-core.js function _assertThisInitialized(self2) { if (self2 === undefined) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /*! * GSAP 3.14.2 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var _config = { autoSleep: 120, force3D: "auto", nullTargetWarn: 1, units: { lineHeight: "" } }; var _defaults = { duration: 0.5, overwrite: false, delay: 0 }; var _suppressOverwrites; var _reverting; var _context; var _bigNum = 1e8; var _tinyNum = 1 / _bigNum; var _2PI = Math.PI * 2; var _HALF_PI = _2PI / 4; var _gsID = 0; var _sqrt = Math.sqrt; var _cos = Math.cos; var _sin = Math.sin; var _isString = function _isString2(value) { return typeof value === "string"; }; var _isFunction = function _isFunction2(value) { return typeof value === "function"; }; var _isNumber = function _isNumber2(value) { return typeof value === "number"; }; var _isUndefined = function _isUndefined2(value) { return typeof value === "undefined"; }; var _isObject = function _isObject2(value) { return typeof value === "object"; }; var _isNotFalse = function _isNotFalse2(value) { return value !== false; }; var _windowExists = function _windowExists2() { return typeof window !== "undefined"; }; var _isFuncOrString = function _isFuncOrString2(value) { return _isFunction(value) || _isString(value); }; var _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function() { }; var _isArray = Array.isArray; var _randomExp = /random\([^)]+\)/g; var _commaDelimExp = /,\s*/g; var _strictNumExp = /(?:-?\.?\d|\.)+/gi; var _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g; var _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g; var _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi; var _relExp = /[+-]=-?[.\d]+/; var _delimitedValueExp = /[^,'"\[\]\s]+/gi; var _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i; var _globalTimeline; var _win; var _coreInitted; var _doc; var _globals = {}; var _installScope = {}; var _coreReady; var _install = function _install2(scope) { return (_installScope = _merge(scope, _globals)) && gsap; }; var _missingPlugin = function _missingPlugin2(property, value) { return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()"); }; var _warn = function _warn2(message, suppress) { return !suppress && console.warn(message); }; var _addGlobal = function _addGlobal2(name, obj) { return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals; }; var _emptyFunc = function _emptyFunc2() { return 0; }; var _startAtRevertConfig = { suppressEvents: true, isStart: true, kill: false }; var _revertConfigNoKill = { suppressEvents: true, kill: false }; var _revertConfig = { suppressEvents: true }; var _reservedProps = {}; var _lazyTweens = []; var _lazyLookup = {}; var _lastRenderedFrame; var _plugins = {}; var _effects = {}; var _nextGCFrame = 30; var _harnessPlugins = []; var _callbackNames = ""; var _harness = function _harness2(targets) { var target = targets[0], harnessPlugin, i; _isObject(target) || _isFunction(target) || (targets = [targets]); if (!(harnessPlugin = (target._gsap || {}).harness)) { i = _harnessPlugins.length; while (i-- && !_harnessPlugins[i].targetTest(target)) { } harnessPlugin = _harnessPlugins[i]; } i = targets.length; while (i--) { targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1); } return targets; }; var _getCache = function _getCache2(target) { return target._gsap || _harness(toArray(target))[0]._gsap; }; var _getProperty = function _getProperty2(target, property, v) { return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v; }; var _forEachName = function _forEachName2(names, func) { return (names = names.split(",")).forEach(func) || names; }; var _round = function _round2(value) { return Math.round(value * 1e5) / 1e5 || 0; }; var _roundPrecise = function _roundPrecise2(value) { return Math.round(value * 1e7) / 1e7 || 0; }; var _parseRelative = function _parseRelative2(start, value) { var operator = value.charAt(0), end = parseFloat(value.substr(2)); start = parseFloat(start); return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end; }; var _arrayContainsAny = function _arrayContainsAny2(toSearch, toFind) { var l = toFind.length, i = 0; for (;toSearch.indexOf(toFind[i]) < 0 && ++i < l; ) { } return i < l; }; var _lazyRender = function _lazyRender2() { var l = _lazyTweens.length, a = _lazyTweens.slice(0), i, tween; _lazyLookup = {}; _lazyTweens.length = 0; for (i = 0;i < l; i++) { tween = a[i]; tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0); } }; var _isRevertWorthy = function _isRevertWorthy2(animation) { return !!(animation._initted || animation._startAt || animation.add); }; var _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) { _lazyTweens.length && !_reverting && _lazyRender(); animation.render(time, suppressEvents, force || !!(_reverting && time < 0 && _isRevertWorthy(animation))); _lazyTweens.length && !_reverting && _lazyRender(); }; var _numericIfPossible = function _numericIfPossible2(value) { var n = parseFloat(value); return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value; }; var _passThrough = function _passThrough2(p) { return p; }; var _setDefaults = function _setDefaults2(obj, defaults) { for (var p in defaults) { p in obj || (obj[p] = defaults[p]); } return obj; }; var _setKeyframeDefaults = function _setKeyframeDefaults2(excludeDuration) { return function(obj, defaults) { for (var p in defaults) { p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults[p]); } }; }; var _merge = function _merge2(base, toMerge) { for (var p in toMerge) { base[p] = toMerge[p]; } return base; }; var _mergeDeep = function _mergeDeep2(base, toMerge) { for (var p in toMerge) { p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep2(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]); } return base; }; var _copyExcluding = function _copyExcluding2(obj, excluding) { var copy = {}, p; for (p in obj) { p in excluding || (copy[p] = obj[p]); } return copy; }; var _inheritDefaults = function _inheritDefaults2(vars) { var parent = vars.parent || _globalTimeline, func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults; if (_isNotFalse(vars.inherit)) { while (parent) { func(vars, parent.vars.defaults); parent = parent.parent || parent._dp; } } return vars; }; var _arraysMatch = function _arraysMatch2(a1, a2) { var i = a1.length, match = i === a2.length; while (match && i-- && a1[i] === a2[i]) { } return i < 0; }; var _addLinkedListItem = function _addLinkedListItem2(parent, child, firstProp, lastProp, sortBy) { if (firstProp === undefined) { firstProp = "_first"; } if (lastProp === undefined) { lastProp = "_last"; } var prev = parent[lastProp], t; if (sortBy) { t = child[sortBy]; while (prev && prev[sortBy] > t) { prev = prev._prev; } } if (prev) { child._next = prev._next; prev._next = child; } else { child._next = parent[firstProp]; parent[firstProp] = child; } if (child._next) { child._next._prev = child; } else { parent[lastProp] = child; } child._prev = prev; child.parent = child._dp = parent; return child; }; var _removeLinkedListItem = function _removeLinkedListItem2(parent, child, firstProp, lastProp) { if (firstProp === undefined) { firstProp = "_first"; } if (lastProp === undefined) { lastProp = "_last"; } var { _prev: prev, _next: next } = child; if (prev) { prev._next = next; } else if (parent[firstProp] === child) { parent[firstProp] = next; } if (next) { next._prev = prev; } else if (parent[lastProp] === child) { parent[lastProp] = prev; } child._next = child._prev = child.parent = null; }; var _removeFromParent = function _removeFromParent2(child, onlyIfParentHasAutoRemove) { child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child); child._act = 0; }; var _uncache = function _uncache2(animation, child) { if (animation && (!child || child._end > animation._dur || child._start < 0)) { var a = animation; while (a) { a._dirty = 1; a = a.parent; } } return animation; }; var _recacheAncestors = function _recacheAncestors2(animation) { var parent = animation.parent; while (parent && parent.parent) { parent._dirty = 1; parent.totalDuration(); parent = parent.parent; } return animation; }; var _rewindStartAt = function _rewindStartAt2(tween, totalTime, suppressEvents, force) { return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force)); }; var _hasNoPausedAncestors = function _hasNoPausedAncestors2(animation) { return !animation || animation._ts && _hasNoPausedAncestors2(animation.parent); }; var _elapsedCycleDuration = function _elapsedCycleDuration2(animation) { return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0; }; var _animationCycle = function _animationCycle2(tTime, cycleDuration) { var whole = Math.floor(tTime = _roundPrecise(tTime / cycleDuration)); return tTime && whole === tTime ? whole - 1 : whole; }; var _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child) { return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur); }; var _setEnd = function _setEnd2(animation) { return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0)); }; var _alignPlayhead = function _alignPlayhead2(animation, totalTime) { var parent = animation._dp; if (parent && parent.smoothChildTiming && animation._ts) { animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts)); _setEnd(animation); parent._dirty || _uncache(parent, animation); } return animation; }; var _postAddChecks = function _postAddChecks2(timeline, child) { var t; if (child._time || !child._dur && child._initted || child._start < timeline._time && (child._dur || !child.add)) { t = _parentToChildTotalTime(timeline.rawTime(), child); if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) { child.render(t, true); } } if (_uncache(timeline, child)._dp && timeline._initted && timeline._time >= timeline._dur && timeline._ts) { if (timeline._dur < timeline.duration()) { t = timeline; while (t._dp) { t.rawTime() >= 0 && t.totalTime(t._tTime); t = t._dp; } } timeline._zTime = -_tinyNum; } }; var _addToTimeline = function _addToTimeline2(timeline, child, position, skipChecks) { child.parent && _removeFromParent(child); child._start = _roundPrecise((_isNumber(position) ? position : position || timeline !== _globalTimeline ? _parsePosition(timeline, position, child) : timeline._time) + child._delay); child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0)); _addLinkedListItem(timeline, child, "_first", "_last", timeline._sort ? "_start" : 0); _isFromOrFromStart(child) || (timeline._recent = child); skipChecks || _postAddChecks(timeline, child); timeline._ts < 0 && _alignPlayhead(timeline, timeline._tTime); return timeline; }; var _scrollTrigger = function _scrollTrigger2(animation, trigger) { return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation); }; var _attemptInitTween = function _attemptInitTween2(tween, time, force, suppressEvents, tTime) { _initTween(tween, time, tTime); if (!tween._initted) { return 1; } if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) { _lazyTweens.push(tween); tween._lazy = [tTime, suppressEvents]; return 1; } }; var _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart2(_ref) { var parent = _ref.parent; return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart2(parent)); }; var _isFromOrFromStart = function _isFromOrFromStart2(_ref2) { var data = _ref2.data; return data === "isFromStart" || data === "isStart"; }; var _renderZeroDurationTween = function _renderZeroDurationTween2(tween, totalTime, suppressEvents, force) { var prevRatio = tween.ratio, ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, repeatDelay = tween._rDelay, tTime = 0, pt, iteration, prevIteration; if (repeatDelay && tween._repeat) { tTime = _clamp(0, tween._tDur, totalTime); iteration = _animationCycle(tTime, repeatDelay); tween._yoyo && iteration & 1 && (ratio = 1 - ratio); if (iteration !== _animationCycle(tween._tTime, repeatDelay)) { prevRatio = 1 - ratio; tween.vars.repeatRefresh && tween._initted && tween.invalidate(); } } if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) { if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) { return; } prevIteration = tween._zTime; tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); suppressEvents || (suppressEvents = totalTime && !prevIteration); tween.ratio = ratio; tween._from && (ratio = 1 - ratio); tween._time = 0; tween._tTime = tTime; pt = tween._pt; while (pt) { pt.r(ratio, pt.d); pt = pt._next; } totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true); tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate"); tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat"); if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) { ratio && _removeFromParent(tween, 1); if (!suppressEvents && !_reverting) { _callback(tween, ratio ? "onComplete" : "onReverseComplete", true); tween._prom && tween._prom(); } } } else if (!tween._zTime) { tween._zTime = totalTime; } }; var _findNextPauseTween = function _findNextPauseTween2(animation, prevTime, time) { var child; if (time > prevTime) { child = animation._first; while (child && child._start <= time) { if (child.data === "isPause" && child._start > prevTime) { return child; } child = child._next; } } else { child = animation._last; while (child && child._start >= time) { if (child.data === "isPause" && child._start < prevTime) { return child; } child = child._prev; } } }; var _setDuration = function _setDuration2(animation, duration, skipUncache, leavePlayhead) { var repeat = animation._repeat, dur = _roundPrecise(duration) || 0, totalProgress = animation._tTime / animation._tDur; totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur); animation._dur = dur; animation._tDur = !repeat ? dur : repeat < 0 ? 10000000000 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat); totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress); animation.parent && _setEnd(animation); skipUncache || _uncache(animation.parent, animation); return animation; }; var _onUpdateTotalDuration = function _onUpdateTotalDuration2(animation) { return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur); }; var _zeroPosition = { _start: 0, endTime: _emptyFunc, totalDuration: _emptyFunc }; var _parsePosition = function _parsePosition2(animation, position, percentAnimation) { var labels = animation.labels, recent = animation._recent || _zeroPosition, clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur, i, offset, isPercent; if (_isString(position) && (isNaN(position) || (position in labels))) { offset = position.charAt(0); isPercent = position.substr(-1) === "%"; i = position.indexOf("="); if (offset === "<" || offset === ">") { i >= 0 && (position = position.replace(/=/, "")); return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1); } if (i < 0) { position in labels || (labels[position] = clippedDuration); return labels[position]; } offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1)); if (isPercent && percentAnimation) { offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration(); } return i > 1 ? _parsePosition2(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset; } return position == null ? clippedDuration : +position; }; var _createTweenType = function _createTweenType2(type, params, timeline) { var isLegacy = _isNumber(params[1]), varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), vars = params[varsIndex], irVars, parent; isLegacy && (vars.duration = params[1]); vars.parent = timeline; if (type) { irVars = vars; parent = timeline; while (parent && !("immediateRender" in irVars)) { irVars = parent.vars.defaults || {}; parent = _isNotFalse(parent.vars.inherit) && parent.parent; } vars.immediateRender = _isNotFalse(irVars.immediateRender); type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; } return new Tween(params[0], vars, params[varsIndex + 1]); }; var _conditionalReturn = function _conditionalReturn2(value, func) { return value || value === 0 ? func(value) : func; }; var _clamp = function _clamp2(min, max, value) { return value < min ? min : value > max ? max : value; }; var getUnit = function getUnit2(value, v) { return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1]; }; var clamp2 = function clamp3(min, max, value) { return _conditionalReturn(value, function(v) { return _clamp(min, max, v); }); }; var _slice = [].slice; var _isArrayLike = function _isArrayLike2(value, nonEmpty) { return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || (value.length - 1 in value) && _isObject(value[0])) && !value.nodeType && value !== _win; }; var _flatten = function _flatten2(ar, leaveStrings, accumulator) { if (accumulator === undefined) { accumulator = []; } return ar.forEach(function(value) { var _accumulator; return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value); }) || accumulator; }; var toArray = function toArray2(value, scope, leaveStrings) { return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : []; }; var selector = function selector2(value) { value = toArray(value)[0] || _warn("Invalid scope") || {}; return function(v) { var el = value.current || value.nativeElement || value; return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc.createElement("div") : value); }; }; var shuffle = function shuffle2(a) { return a.sort(function() { return 0.5 - Math.random(); }); }; var distribute = function distribute2(v) { if (_isFunction(v)) { return v; } var vars = _isObject(v) ? v : { each: v }, ease = _parseEase(vars.ease), from = vars.from || 0, base = parseFloat(vars.base) || 0, cache = {}, isDecimal = from > 0 && from < 1, ratios = isNaN(from) || isDecimal, axis = vars.axis, ratioX = from, ratioY = from; if (_isString(from)) { ratioX = ratioY = { center: 0.5, edges: 0.5, end: 1 }[from] || 0; } else if (!isDecimal && ratios) { ratioX = from[0]; ratioY = from[1]; } return function(i, target, a) { var l = (a || vars).length, distances = cache[l], originX, originY, x, y, d, j, max, min, wrapAt; if (!distances) { wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum])[1]; if (!wrapAt) { max = -_bigNum; while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) { } wrapAt < l && wrapAt--; } distances = cache[l] = []; originX = ratios ? Math.min(wrapAt, l) * ratioX - 0.5 : from % wrapAt; originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - 0.5 : from / wrapAt | 0; max = 0; min = _bigNum; for (j = 0;j < l; j++) { x = j % wrapAt - originX; y = originY - (j / wrapAt | 0); distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x); d > max && (max = d); d < min && (min = d); } from === "random" && shuffle(distances); distances.max = max - min; distances.min = min; distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === "y" ? l / wrapAt : wrapAt) || 0) * (from === "edges" ? -1 : 1); distances.b = l < 0 ? base - l : base; distances.u = getUnit(vars.amount || vars.each) || 0; ease = ease && l < 0 ? _invertEase(ease) : ease; } l = (distances[i] - distances.min) / distances.max || 0; return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; }; }; var _roundModifier = function _roundModifier2(v) { var p = Math.pow(10, ((v + "").split(".")[1] || "").length); return function(raw) { var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p); return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); }; }; var snap = function snap2(snapTo, value) { var isArray = _isArray(snapTo), radius, is2D; if (!isArray && _isObject(snapTo)) { radius = isArray = snapTo.radius || _bigNum; if (snapTo.values) { snapTo = toArray(snapTo.values); if (is2D = !_isNumber(snapTo[0])) { radius *= radius; } } else { snapTo = _roundModifier(snapTo.increment); } } return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function(raw) { is2D = snapTo(raw); return Math.abs(is2D - raw) <= radius ? is2D : raw; } : function(raw) { var x = parseFloat(is2D ? raw.x : raw), y = parseFloat(is2D ? raw.y : 0), min = _bigNum, closest = 0, i = snapTo.length, dx, dy; while (i--) { if (is2D) { dx = snapTo[i].x - x; dy = snapTo[i].y - y; dx = dx * dx + dy * dy; } else { dx = Math.abs(snapTo[i] - x); } if (dx < min) { min = dx; closest = i; } } closest = !radius || min <= radius ? snapTo[closest] : raw; return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw); }); }; var random = function random2(min, max, roundingIncrement, returnFunction) { return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function() { return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 0.00001) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + "").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * 0.99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction; }); }; var pipe = function pipe2() { for (var _len = arguments.length, functions = new Array(_len), _key = 0;_key < _len; _key++) { functions[_key] = arguments[_key]; } return function(value) { return functions.reduce(function(v, f) { return f(v); }, value); }; }; var unitize = function unitize2(func, unit) { return function(value) { return func(parseFloat(value)) + (unit || getUnit(value)); }; }; var normalize = function normalize2(min, max, value) { return mapRange(min, max, 0, 1, value); }; var _wrapArray = function _wrapArray2(a, wrapper, value) { return _conditionalReturn(value, function(index) { return a[~~wrapper(index)]; }); }; var wrap = function wrap2(min, max, value) { var range = max - min; return _isArray(min) ? _wrapArray(min, wrap2(0, min.length), max) : _conditionalReturn(value, function(value2) { return (range + (value2 - min) % range) % range + min; }); }; var wrapYoyo = function wrapYoyo2(min, max, value) { var range = max - min, total = range * 2; return _isArray(min) ? _wrapArray(min, wrapYoyo2(0, min.length - 1), max) : _conditionalReturn(value, function(value2) { value2 = (total + (value2 - min) % total) % total || 0; return min + (value2 > range ? total - value2 : value2); }); }; var _replaceRandom = function _replaceRandom2(s) { return s.replace(_randomExp, function(match) { var arIndex = match.indexOf("[") + 1, values = match.substring(arIndex || 7, arIndex ? match.indexOf("]") : match.length - 1).split(_commaDelimExp); return random(arIndex ? values : +values[0], arIndex ? 0 : +values[1], +values[2] || 0.00001); }); }; var mapRange = function mapRange2(inMin, inMax, outMin, outMax, value) { var inRange = inMax - inMin, outRange = outMax - outMin; return _conditionalReturn(value, function(value2) { return outMin + ((value2 - inMin) / inRange * outRange || 0); }); }; var interpolate = function interpolate2(start, end, progress, mutate) { var func = isNaN(start + end) ? 0 : function(p2) { return (1 - p2) * start + p2 * end; }; if (!func) { var isString = _isString(start), master = {}, p, i, interpolators, l, il; progress === true && (mutate = 1) && (progress = null); if (isString) { start = { p: start }; end = { p: end }; } else if (_isArray(start) && !_isArray(end)) { interpolators = []; l = start.length; il = l - 2; for (i = 1;i < l; i++) { interpolators.push(interpolate2(start[i - 1], start[i])); } l--; func = function func(p2) { p2 *= l; var i2 = Math.min(il, ~~p2); return interpolators[i2](p2 - i2); }; progress = end; } else if (!mutate) { start = _merge(_isArray(start) ? [] : {}, start); } if (!interpolators) { for (p in end) { _addPropTween.call(master, start, p, "get", end[p]); } func = function func(p2) { return _renderPropTweens(p2, master) || (isString ? start.p : start); }; } } return _conditionalReturn(progress, func); }; var _getLabelInDirection = function _getLabelInDirection2(timeline, fromTime, backward) { var labels = timeline.labels, min = _bigNum, p, distance, label; for (p in labels) { distance = labels[p] - fromTime; if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) { label = p; min = distance; } } return label; }; var _callback = function _callback2(animation, type, executeLazyFirst) { var v = animation.vars, callback = v[type], prevContext = _context, context = animation._ctx, params, scope, result; if (!callback) { return; } params = v[type + "Params"]; scope = v.callbackScope || animation; executeLazyFirst && _lazyTweens.length && _lazyRender(); context && (_context = context); result = params ? callback.apply(scope, params) : callback.call(scope); _context = prevContext; return result; }; var _interrupt = function _interrupt2(animation) { _removeFromParent(animation); animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting); animation.progress() < 1 && _callback(animation, "onInterrupt"); return animation; }; var _quickTween; var _registerPluginQueue = []; var _createPlugin = function _createPlugin2(config) { if (!config) return; config = !config.name && config["default"] || config; if (_windowExists() || config.headless) { var name = config.name, isFunc = _isFunction(config), Plugin = name && !isFunc && config.init ? function() { this._props = []; } : config, instanceDefaults = { init: _emptyFunc, render: _renderPropTweens, add: _addPropTween, kill: _killPropTweensOf, modifier: _addPluginModifier, rawVars: 0 }, statics = { targetTest: 0, get: 0, getSetter: _getSetter, aliases: {}, register: 0 }; _wake(); if (config !== Plugin) { if (_plugins[name]) { return; } _setDefaults(Plugin, _setDefaults(_copyExcluding(config, instanceDefaults), statics)); _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config, statics))); _plugins[Plugin.prop = name] = Plugin; if (config.targetTest) { _harnessPlugins.push(Plugin); _reservedProps[name] = 1; } name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin"; } _addGlobal(name, Plugin); config.register && config.register(gsap, Plugin, PropTween); } else { _registerPluginQueue.push(config); } }; var _255 = 255; var _colorLookup = { aqua: [0, _255, _255], lime: [0, _255, 0], silver: [192, 192, 192], black: [0, 0, 0], maroon: [128, 0, 0], teal: [0, 128, 128], blue: [0, 0, _255], navy: [0, 0, 128], white: [_255, _255, _255], olive: [128, 128, 0], yellow: [_255, _255, 0], orange: [_255, 165, 0], gray: [128, 128, 128], purple: [128, 0, 128], green: [0, 128, 0], red: [_255, 0, 0], pink: [_255, 192, 203], cyan: [0, _255, _255], transparent: [_255, _255, _255, 0] }; var _hue = function _hue2(h, m1, m2) { h += h < 0 ? 1 : h > 1 ? -1 : 0; return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < 0.5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + 0.5 | 0; }; var splitColor = function splitColor2(v, toHSL, forceAlpha) { var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, r, g, b, h, s, l, max, min, d, wasHSL; if (!a) { if (v.substr(-1) === ",") { v = v.substr(0, v.length - 1); } if (_colorLookup[v]) { a = _colorLookup[v]; } else if (v.charAt(0) === "#") { if (v.length < 6) { r = v.charAt(1); g = v.charAt(2); b = v.charAt(3); v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : ""); } if (v.length === 9) { a = parseInt(v.substr(1, 6), 16); return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255]; } v = parseInt(v.substr(1), 16); a = [v >> 16, v >> 8 & _255, v & _255]; } else if (v.substr(0, 3) === "hsl") { a = wasHSL = v.match(_strictNumExp); if (!toHSL) { h = +a[0] % 360 / 360; s = +a[1] / 100; l = +a[2] / 100; g = l <= 0.5 ? l * (s + 1) : l + s - l * s; r = l * 2 - g; a.length > 3 && (a[3] *= 1); a[0] = _hue(h + 1 / 3, r, g); a[1] = _hue(h, r, g); a[2] = _hue(h - 1 / 3, r, g); } else if (~v.indexOf("=")) { a = v.match(_numExp); forceAlpha && a.length < 4 && (a[3] = 1); return a; } } else { a = v.match(_strictNumExp) || _colorLookup.transparent; } a = a.map(Number); } if (toHSL && !wasHSL) { r = a[0] / _255; g = a[1] / _255; b = a[2] / _255; max = Math.max(r, g, b); min = Math.min(r, g, b); l = (max + min) / 2; if (max === min) { h = s = 0; } else { d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4; h *= 60; } a[0] = ~~(h + 0.5); a[1] = ~~(s * 100 + 0.5); a[2] = ~~(l * 100 + 0.5); } forceAlpha && a.length < 4 && (a[3] = 1); return a; }; var _colorOrderData = function _colorOrderData2(v) { var values = [], c = [], i = -1; v.split(_colorExp).forEach(function(v2) { var a = v2.match(_numWithUnitExp) || []; values.push.apply(values, a); c.push(i += a.length + 1); }); values.c = c; return values; }; var _formatColors = function _formatColors2(s, toHSL, orderMatchData) { var result = "", colors = (s + result).match(_colorExp), type = toHSL ? "hsla(" : "rgba(", i = 0, c, shell, d, l; if (!colors) { return s; } colors = colors.map(function(color) { return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")"; }); if (orderMatchData) { d = _colorOrderData(s); c = orderMatchData.c; if (c.join(result) !== d.c.join(result)) { shell = s.replace(_colorExp, "1").split(_numWithUnitExp); l = shell.length - 1; for (;i < l; i++) { result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift()); } } } if (!shell) { shell = s.split(_colorExp); l = shell.length - 1; for (;i < l; i++) { result += shell[i] + colors[i]; } } return result + shell[l]; }; var _colorExp = function() { var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", p; for (p in _colorLookup) { s += "|" + p + "\\b"; } return new RegExp(s + ")", "gi"); }(); var _hslExp = /hsl[a]?\(/; var _colorStringFilter = function _colorStringFilter2(a) { var combined = a.join(" "), toHSL; _colorExp.lastIndex = 0; if (_colorExp.test(combined)) { toHSL = _hslExp.test(combined); a[1] = _formatColors(a[1], toHSL); a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); return true; } }; var _tickerActive; var _ticker = function() { var _getTime = Date.now, _lagThreshold = 500, _adjustedLag = 33, _startTime = _getTime(), _lastUpdate = _startTime, _gap = 1000 / 240, _nextTime = _gap, _listeners = [], _id, _req, _raf, _self, _delta, _i, _tick = function _tick(v) { var elapsed = _getTime() - _lastUpdate, manual = v === true, overlap, dispatch, time, frame; (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag); _lastUpdate += elapsed; time = _lastUpdate - _startTime; overlap = time - _nextTime; if (overlap > 0 || manual) { frame = ++_self.frame; _delta = time - _self.time * 1000; _self.time = time = time / 1000; _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap); dispatch = 1; } manual || (_id = _req(_tick)); if (dispatch) { for (_i = 0;_i < _listeners.length; _i++) { _listeners[_i](time, _delta, frame, v); } } }; _self = { time: 0, frame: 0, tick: function tick() { _tick(true); }, deltaRatio: function deltaRatio(fps) { return _delta / (1000 / (fps || 60)); }, wake: function wake() { if (_coreReady) { if (!_coreInitted && _windowExists()) { _win = _coreInitted = window; _doc = _win.document || {}; _globals.gsap = gsap; (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version); _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {}); _registerPluginQueue.forEach(_createPlugin); } _raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame; _id && _self.sleep(); _req = _raf || function(f) { return setTimeout(f, _nextTime - _self.time * 1000 + 1 | 0); }; _tickerActive = 1; _tick(2); } }, sleep: function sleep() { (_raf ? cancelAnimationFrame : clearTimeout)(_id); _tickerActive = 0; _req = _emptyFunc; }, lagSmoothing: function lagSmoothing(threshold, adjustedLag) { _lagThreshold = threshold || Infinity; _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold); }, fps: function fps(_fps) { _gap = 1000 / (_fps || 240); _nextTime = _self.time * 1000 + _gap; }, add: function add(callback, once, prioritize) { var func = once ? function(t, d, f, v) { callback(t, d, f, v); _self.remove(func); } : callback; _self.remove(callback); _listeners[prioritize ? "unshift" : "push"](func); _wake(); return func; }, remove: function remove(callback, i) { ~(i = _listeners.indexOf(callback)) && _listeners.splice(i, 1) && _i >= i && _i--; }, _listeners }; return _self; }(); var _wake = function _wake2() { return !_tickerActive && _ticker.wake(); }; var _easeMap = {}; var _customEaseExp = /^[\d.\-M][\d.\-,\s]/; var _quotesExp = /["']/g; var _parseObjectInString = function _parseObjectInString2(value) { var obj = {}, split = value.substr(1, value.length - 3).split(":"), key = split[0], i = 1, l = split.length, index, val, parsedVal; for (;i < l; i++) { val = split[i]; index = i !== l - 1 ? val.lastIndexOf(",") : val.length; parsedVal = val.substr(0, index); obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal; key = val.substr(index + 1).trim(); } return obj; }; var _valueInParentheses = function _valueInParentheses2(value) { var open = value.indexOf("(") + 1, close = value.indexOf(")"), nested = value.indexOf("(", open); return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close); }; var _configEaseFromString = function _configEaseFromString2(name) { var split = (name + "").split("("), ease = _easeMap[split[0]]; return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf("{") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(",").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE("", name) : ease; }; var _invertEase = function _invertEase2(ease) { return function(p) { return 1 - ease(1 - p); }; }; var _propagateYoyoEase = function _propagateYoyoEase2(timeline, isYoyo) { var child = timeline._first, ease; while (child) { if (child instanceof Timeline) { _propagateYoyoEase2(child, isYoyo); } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) { if (child.timeline) { _propagateYoyoEase2(child.timeline, isYoyo); } else { ease = child._ease; child._ease = child._yEase; child._yEase = ease; child._yoyo = isYoyo; } } child = child._next; } }; var _parseEase = function _parseEase2(ease, defaultEase) { return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase; }; var _insertEase = function _insertEase2(names, easeIn, easeOut, easeInOut) { if (easeOut === undefined) { easeOut = function easeOut(p) { return 1 - easeIn(1 - p); }; } if (easeInOut === undefined) { easeInOut = function easeInOut(p) { return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2; }; } var ease = { easeIn, easeOut, easeInOut }, lowercaseName; _forEachName(names, function(name) { _easeMap[name] = _globals[name] = ease; _easeMap[lowercaseName = name.toLowerCase()] = easeOut; for (var p in ease) { _easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p]; } }); return ease; }; var _easeInOutFromOut = function _easeInOutFromOut2(easeOut) { return function(p) { return p < 0.5 ? (1 - easeOut(1 - p * 2)) / 2 : 0.5 + easeOut((p - 0.5) * 2) / 2; }; }; var _configElastic = function _configElastic2(type, amplitude, period) { var p1 = amplitude >= 1 ? amplitude : 1, p2 = (period || (type ? 0.3 : 0.45)) / (amplitude < 1 ? amplitude : 1), p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), easeOut = function easeOut(p) { return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1; }, ease = type === "out" ? easeOut : type === "in" ? function(p) { return 1 - easeOut(1 - p); } : _easeInOutFromOut(easeOut); p2 = _2PI / p2; ease.config = function(amplitude2, period2) { return _configElastic2(type, amplitude2, period2); }; return ease; }; var _configBack = function _configBack2(type, overshoot) { if (overshoot === undefined) { overshoot = 1.70158; } var easeOut = function easeOut(p) { return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0; }, ease = type === "out" ? easeOut : type === "in" ? function(p) { return 1 - easeOut(1 - p); } : _easeInOutFromOut(easeOut); ease.config = function(overshoot2) { return _configBack2(type, overshoot2); }; return ease; }; _forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function(name, i) { var power = i < 5 ? i + 1 : i; _insertEase(name + ",Power" + (power - 1), i ? function(p) { return Math.pow(p, power); } : function(p) { return p; }, function(p) { return 1 - Math.pow(1 - p, power); }, function(p) { return p < 0.5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2; }); }); _easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn; _insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic()); (function(n, c) { var n1 = 1 / c, n2 = 2 * n1, n3 = 2.5 * n1, easeOut = function easeOut(p) { return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + 0.75 : p < n3 ? n * (p -= 2.25 / c) * p + 0.9375 : n * Math.pow(p - 2.625 / c, 2) + 0.984375; }; _insertEase("Bounce", function(p) { return 1 - easeOut(1 - p); }, easeOut); })(7.5625, 2.75); _insertEase("Expo", function(p) { return Math.pow(2, 10 * (p - 1)) * p + p * p * p * p * p * p * (1 - p); }); _insertEase("Circ", function(p) { return -(_sqrt(1 - p * p) - 1); }); _insertEase("Sine", function(p) { return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1; }); _insertEase("Back", _configBack("in"), _configBack("out"), _configBack()); _easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = { config: function config(steps, immediateStart) { if (steps === undefined) { steps = 1; } var p1 = 1 / steps, p2 = steps + (immediateStart ? 0 : 1), p3 = immediateStart ? 1 : 0, max = 1 - _tinyNum; return function(p) { return ((p2 * _clamp(0, max, p) | 0) + p3) * p1; }; } }; _defaults.ease = _easeMap["quad.out"]; _forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function(name) { return _callbackNames += name + "," + name + "Params,"; }); var GSCache = function GSCache2(target, harness) { this.id = _gsID++; target._gsap = this; this.target = target; this.harness = harness; this.get = harness ? harness.get : _getProperty; this.set = harness ? harness.getSetter : _getSetter; }; var Animation = /* @__PURE__ */ function() { function Animation2(vars) { this.vars = vars; this._delay = +vars.delay || 0; if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) { this._rDelay = vars.repeatDelay || 0; this._yoyo = !!vars.yoyo || !!vars.yoyoEase; } this._ts = 1; _setDuration(this, +vars.duration, 1, 1); this.data = vars.data; if (_context) { this._ctx = _context; _context.data.push(this); } _tickerActive || _ticker.wake(); } var _proto = Animation2.prototype; _proto.delay = function delay(value) { if (value || value === 0) { this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay); this._delay = value; return this; } return this._delay; }; _proto.duration = function duration(value) { return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur; }; _proto.totalDuration = function totalDuration(value) { if (!arguments.length) { return this._tDur; } this._dirty = 0; return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1)); }; _proto.totalTime = function totalTime(_totalTime, suppressEvents) { _wake(); if (!arguments.length) { return this._tTime; } var parent = this._dp; if (parent && parent.smoothChildTiming && this._ts) { _alignPlayhead(this, _totalTime); !parent._dp || parent.parent || _postAddChecks(parent, this); while (parent && parent.parent) { if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) { parent.totalTime(parent._tTime, true); } parent = parent.parent; } if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) { _addToTimeline(this._dp, this, this._start - this._delay); } } if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !this._initted && this._dur && _totalTime || !_totalTime && !this._initted && (this.add || this._ptLookup)) { this._ts || (this._pTime = _totalTime); _lazySafeRender(this, _totalTime, suppressEvents); } return this; }; _proto.time = function time(value, suppressEvents) { return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; }; _proto.totalProgress = function totalProgress(value, suppressEvents) { return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() >= 0 && this._initted ? 1 : 0; }; _proto.progress = function progress(value, suppressEvents) { return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0; }; _proto.iteration = function iteration(value, suppressEvents) { var cycleDuration = this.duration() + this._rDelay; return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1; }; _proto.timeScale = function timeScale(value, suppressEvents) { if (!arguments.length) { return this._rts === -_tinyNum ? 0 : this._rts; } if (this._rts === value) { return this; } var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; this._rts = +value || 0; this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; this.totalTime(_clamp(-Math.abs(this._delay), this.totalDuration(), tTime), suppressEvents !== false); _setEnd(this); return _recacheAncestors(this); }; _proto.paused = function paused(value) { if (!arguments.length) { return this._ps; } if (this._ps !== value) { this._ps = value; if (value) { this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); this._ts = this._act = 0; } else { _wake(); this._ts = this._rts; this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); } } return this; }; _proto.startTime = function startTime(value) { if (arguments.length) { this._start = _roundPrecise(value); var parent = this.parent || this._dp; parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, this._start - this._delay); return this; } return this._start; }; _proto.endTime = function endTime(includeRepeats) { return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1); }; _proto.rawTime = function rawTime(wrapRepeats) { var parent = this.parent || this._dp; return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this); }; _proto.revert = function revert(config2) { if (config2 === undefined) { config2 = _revertConfig; } var prevIsReverting = _reverting; _reverting = config2; if (_isRevertWorthy(this)) { this.timeline && this.timeline.revert(config2); this.totalTime(-0.01, config2.suppressEvents); } this.data !== "nested" && config2.kill !== false && this.kill(); _reverting = prevIsReverting; return this; }; _proto.globalTime = function globalTime(rawTime) { var animation = this, time = arguments.length ? rawTime : animation.rawTime(); while (animation) { time = animation._start + time / (Math.abs(animation._ts) || 1); animation = animation._dp; } return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; }; _proto.repeat = function repeat(value) { if (arguments.length) { this._repeat = value === Infinity ? -2 : value; return _onUpdateTotalDuration(this); } return this._repeat === -2 ? Infinity : this._repeat; }; _proto.repeatDelay = function repeatDelay(value) { if (arguments.length) { var time = this._time; this._rDelay = value; _onUpdateTotalDuration(this); return time ? this.time(time) : this; } return this._rDelay; }; _proto.yoyo = function yoyo(value) { if (arguments.length) { this._yoyo = value; return this; } return this._yoyo; }; _proto.seek = function seek(position, suppressEvents) { return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents)); }; _proto.restart = function restart(includeDelay, suppressEvents) { this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents)); this._dur || (this._zTime = -_tinyNum); return this; }; _proto.play = function play(from, suppressEvents) { from != null && this.seek(from, suppressEvents); return this.reversed(false).paused(false); }; _proto.reverse = function reverse(from, suppressEvents) { from != null && this.seek(from || this.totalDuration(), suppressEvents); return this.reversed(true).paused(false); }; _proto.pause = function pause(atTime, suppressEvents) { atTime != null && this.seek(atTime, suppressEvents); return this.paused(true); }; _proto.resume = function resume() { return this.paused(false); }; _proto.reversed = function reversed(value) { if (arguments.length) { !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); return this; } return this._rts < 0; }; _proto.invalidate = function invalidate() { this._initted = this._act = 0; this._zTime = -_tinyNum; return this; }; _proto.isActive = function isActive() { var parent = this.parent || this._dp, start = this._start, rawTime; return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum); }; _proto.eventCallback = function eventCallback(type, callback, params) { var vars = this.vars; if (arguments.length > 1) { if (!callback) { delete vars[type]; } else { vars[type] = callback; params && (vars[type + "Params"] = params); type === "onUpdate" && (this._onUpdate = callback); } return this; } return vars[type]; }; _proto.then = function then(onFulfilled) { var self2 = this, prevProm = self2._prom; return new Promise(function(resolve) { var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, _resolve = function _resolve() { var _then = self2.then; self2.then = null; prevProm && prevProm(); _isFunction(f) && (f = f(self2)) && (f.then || f === self2) && (self2.then = _then); resolve(f); self2.then = _then; }; if (self2._initted && self2.totalProgress() === 1 && self2._ts >= 0 || !self2._tTime && self2._ts < 0) { _resolve(); } else { self2._prom = _resolve; } }); }; _proto.kill = function kill() { _interrupt(this); }; return Animation2; }(); _setDefaults(Animation.prototype, { _time: 0, _start: 0, _end: 0, _tTime: 0, _tDur: 0, _dirty: 0, _repeat: 0, _yoyo: false, parent: null, _initted: false, _rDelay: 0, _ts: 1, _dp: 0, ratio: 0, _zTime: -_tinyNum, _prom: 0, _ps: false, _rts: 1 }); var Timeline = /* @__PURE__ */ function(_Animation) { _inheritsLoose(Timeline2, _Animation); function Timeline2(vars, position) { var _this; if (vars === undefined) { vars = {}; } _this = _Animation.call(this, vars) || this; _this.labels = {}; _this.smoothChildTiming = !!vars.smoothChildTiming; _this.autoRemoveChildren = !!vars.autoRemoveChildren; _this._sort = _isNotFalse(vars.sortChildren); _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position); vars.reversed && _this.reverse(); vars.paused && _this.paused(true); vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger); return _this; } var _proto2 = Timeline2.prototype; _proto2.to = function to(targets, vars, position) { _createTweenType(0, arguments, this); return this; }; _proto2.from = function from(targets, vars, position) { _createTweenType(1, arguments, this); return this; }; _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) { _createTweenType(2, arguments, this); return this; }; _proto2.set = function set(targets, vars, position) { vars.duration = 0; vars.parent = this; _inheritDefaults(vars).repeatDelay || (vars.repeat = 0); vars.immediateRender = !!vars.immediateRender; new Tween(targets, vars, _parsePosition(this, position), 1); return this; }; _proto2.call = function call(callback, params, position) { return _addToTimeline(this, Tween.delayedCall(0, callback, params), position); }; _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { vars.duration = duration; vars.stagger = vars.stagger || stagger; vars.onComplete = onCompleteAll; vars.onCompleteParams = onCompleteAllParams; vars.parent = this; new Tween(targets, vars, _parsePosition(this, position)); return this; }; _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { vars.runBackwards = 1; _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender); return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams); }; _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) { toVars.startAt = fromVars; _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender); return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams); }; _proto2.render = function render(totalTime, suppressEvents, force) { var prevTime = this._time, tDur = this._dirty ? this.totalDuration() : this._tDur, dur = this._dur, tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), time, child, next, iteration, cycleDuration, prevPaused, pauseTween, timeScale, prevStart, prevIteration, yoyo, isYoyo; this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur); if (tTime !== this._tTime || force || crossingStart) { if (prevTime !== this._time && dur) { tTime += this._time - prevTime; totalTime += this._time - prevTime; } time = tTime; prevStart = this._start; timeScale = this._ts; prevPaused = !timeScale; if (crossingStart) { dur || (prevTime = this._zTime); (totalTime || !suppressEvents) && (this._zTime = totalTime); } if (this._repeat) { yoyo = this._yoyo; cycleDuration = dur + this._rDelay; if (this._repeat < -1 && totalTime < 0) { return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); } time = _roundPrecise(tTime % cycleDuration); if (tTime === tDur) { iteration = this._repeat; time = dur; } else { prevIteration = _roundPrecise(tTime / cycleDuration); iteration = ~~prevIteration; if (iteration && iteration === prevIteration) { time = dur; iteration--; } time > dur && (time = dur); } prevIteration = _animationCycle(this._tTime, cycleDuration); !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); if (yoyo && iteration & 1) { time = dur - time; isYoyo = 1; } if (iteration !== prevIteration && !this._lock) { var rewinding = yoyo && prevIteration & 1, doesWrap = rewinding === (yoyo && iteration & 1); iteration < prevIteration && (rewinding = !rewinding); prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; this._lock = 1; this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0; this._tTime = tTime; !suppressEvents && this.parent && _callback(this, "onRepeat"); if (this.vars.repeatRefresh && !isYoyo) { this.invalidate()._lock = 1; prevIteration = iteration; } if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) { return this; } dur = this._dur; tDur = this._tDur; if (doesWrap) { this._lock = 2; prevTime = rewinding ? dur : -0.0001; this.render(prevTime, true); this.vars.repeatRefresh && !isYoyo && this.invalidate(); } this._lock = 0; if (!this._ts && !prevPaused) { return this; } _propagateYoyoEase(this, isYoyo); } } if (this._hasPause && !this._forcing && this._lock < 2) { pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time)); if (pauseTween) { tTime -= time - (time = pauseTween._start); } } this._tTime = tTime; this._time = time; this._act = !timeScale; if (!this._initted) { this._onUpdate = this.vars.onUpdate; this._initted = 1; this._zTime = totalTime; prevTime = 0; } if (!prevTime && tTime && dur && !suppressEvents && !prevIteration) { _callback(this, "onStart"); if (this._tTime !== tTime) { return this; } } if (time >= prevTime && totalTime >= 0) { child = this._first; while (child) { next = child._next; if ((child._act || time >= child._start) && child._ts && pauseTween !== child) { if (child.parent !== this) { return this.render(totalTime, suppressEvents, force); } child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force); if (time !== this._time || !this._ts && !prevPaused) { pauseTween = 0; next && (tTime += this._zTime = -_tinyNum); break; } } child = next; } } else { child = this._last; var adjustedTime = totalTime < 0 ? totalTime : time; while (child) { next = child._prev; if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) { if (child.parent !== this) { return this.render(totalTime, suppressEvents, force); } child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && _isRevertWorthy(child)); if (time !== this._time || !this._ts && !prevPaused) { pauseTween = 0; next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); break; } } child = next; } } if (pauseTween && !suppressEvents) { this.pause(); pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1; if (this._ts) { this._start = prevStart; _setEnd(this); return this.render(totalTime, suppressEvents, force); } } this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true); if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) { if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) { if (!this._lock) { (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) { _callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true); this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); } } } } } return this; }; _proto2.add = function add(child, position) { var _this2 = this; _isNumber(position) || (position = _parsePosition(this, position, child)); if (!(child instanceof Animation)) { if (_isArray(child)) { child.forEach(function(obj) { return _this2.add(obj, position); }); return this; } if (_isString(child)) { return this.addLabel(child, position); } if (_isFunction(child)) { child = Tween.delayedCall(0, child); } else { return this; } } return this !== child ? _addToTimeline(this, child, position) : this; }; _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) { if (nested === undefined) { nested = true; } if (tweens === undefined) { tweens = true; } if (timelines === undefined) { timelines = true; } if (ignoreBeforeTime === undefined) { ignoreBeforeTime = -_bigNum; } var a = [], child = this._first; while (child) { if (child._start >= ignoreBeforeTime) { if (child instanceof Tween) { tweens && a.push(child); } else { timelines && a.push(child); nested && a.push.apply(a, child.getChildren(true, tweens, timelines)); } } child = child._next; } return a; }; _proto2.getById = function getById(id) { var animations = this.getChildren(1, 1, 1), i = animations.length; while (i--) { if (animations[i].vars.id === id) { return animations[i]; } } }; _proto2.remove = function remove(child) { if (_isString(child)) { return this.removeLabel(child); } if (_isFunction(child)) { return this.killTweensOf(child); } child.parent === this && _removeLinkedListItem(this, child); if (child === this._recent) { this._recent = this._last; } return _uncache(this); }; _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) { if (!arguments.length) { return this._tTime; } this._forcing = 1; if (!this._dp && this._ts) { this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts)); } _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents); this._forcing = 0; return this; }; _proto2.addLabel = function addLabel(label, position) { this.labels[label] = _parsePosition(this, position); return this; }; _proto2.removeLabel = function removeLabel(label) { delete this.labels[label]; return this; }; _proto2.addPause = function addPause(position, callback, params) { var t = Tween.delayedCall(0, callback || _emptyFunc, params); t.data = "isPause"; this._hasPause = 1; return _addToTimeline(this, t, _parsePosition(this, position)); }; _proto2.removePause = function removePause(position) { var child = this._first; position = _parsePosition(this, position); while (child) { if (child._start === position && child.data === "isPause") { _removeFromParent(child); } child = child._next; } }; _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) { var tweens = this.getTweensOf(targets, onlyActive), i = tweens.length; while (i--) { _overwritingTween !== tweens[i] && tweens[i].kill(targets, props); } return this; }; _proto2.getTweensOf = function getTweensOf(targets, onlyActive) { var a = [], parsedTargets = toArray(targets), child = this._first, isGlobalTime = _isNumber(onlyActive), children; while (child) { if (child instanceof Tween) { if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) { a.push(child); } } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) { a.push.apply(a, children); } child = child._next; } return a; }; _proto2.tweenTo = function tweenTo(position, vars) { vars = vars || {}; var tl = this, endTime = _parsePosition(tl, position), _vars = vars, startAt = _vars.startAt, _onStart = _vars.onStart, onStartParams = _vars.onStartParams, immediateRender = _vars.immediateRender, initted, tween = Tween.to(tl, _setDefaults({ ease: vars.ease || "none", lazy: false, immediateRender: false, time: endTime, overwrite: "auto", duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum, onStart: function onStart() { tl.pause(); if (!initted) { var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()); tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true); initted = 1; } _onStart && _onStart.apply(tween, onStartParams || []); } }, vars)); return immediateRender ? tween.render(0) : tween; }; _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) { return this.tweenTo(toPosition, _setDefaults({ startAt: { time: _parsePosition(this, fromPosition) } }, vars)); }; _proto2.recent = function recent() { return this._recent; }; _proto2.nextLabel = function nextLabel(afterTime) { if (afterTime === undefined) { afterTime = this._time; } return _getLabelInDirection(this, _parsePosition(this, afterTime)); }; _proto2.previousLabel = function previousLabel(beforeTime) { if (beforeTime === undefined) { beforeTime = this._time; } return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1); }; _proto2.currentLabel = function currentLabel(value) { return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum); }; _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) { if (ignoreBeforeTime === undefined) { ignoreBeforeTime = 0; } var child = this._first, labels = this.labels, p; amount = _roundPrecise(amount); while (child) { if (child._start >= ignoreBeforeTime) { child._start += amount; child._end += amount; } child = child._next; } if (adjustLabels) { for (p in labels) { if (labels[p] >= ignoreBeforeTime) { labels[p] += amount; } } } return _uncache(this); }; _proto2.invalidate = function invalidate(soft) { var child = this._first; this._lock = 0; while (child) { child.invalidate(soft); child = child._next; } return _Animation.prototype.invalidate.call(this, soft); }; _proto2.clear = function clear(includeLabels) { if (includeLabels === undefined) { includeLabels = true; } var child = this._first, next; while (child) { next = child._next; this.remove(child); child = next; } this._dp && (this._time = this._tTime = this._pTime = 0); includeLabels && (this.labels = {}); return _uncache(this); }; _proto2.totalDuration = function totalDuration(value) { var max = 0, self2 = this, child = self2._last, prevStart = _bigNum, prev, start, parent; if (arguments.length) { return self2.timeScale((self2._repeat < 0 ? self2.duration() : self2.totalDuration()) / (self2.reversed() ? -value : value)); } if (self2._dirty) { parent = self2.parent; while (child) { prev = child._prev; child._dirty && child.totalDuration(); start = child._start; if (start > prevStart && self2._sort && child._ts && !self2._lock) { self2._lock = 1; _addToTimeline(self2, child, start - child._delay, 1)._lock = 0; } else { prevStart = start; } if (start < 0 && child._ts) { max -= start; if (!parent && !self2._dp || parent && parent.smoothChildTiming) { self2._start += _roundPrecise(start / self2._ts); self2._time -= start; self2._tTime -= start; } self2.shiftChildren(-start, false, -Infinity); prevStart = 0; } child._end > max && child._ts && (max = child._end); child = prev; } _setDuration(self2, self2 === _globalTimeline && self2._time > max ? self2._time : max, 1, 1); self2._dirty = 0; } return self2._tDur; }; Timeline2.updateRoot = function updateRoot(time) { if (_globalTimeline._ts) { _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline)); _lastRenderedFrame = _ticker.frame; } if (_ticker.frame >= _nextGCFrame) { _nextGCFrame += _config.autoSleep || 120; var child = _globalTimeline._first; if (!child || !child._ts) { if (_config.autoSleep && _ticker._listeners.length < 2) { while (child && !child._ts) { child = child._next; } child || _ticker.sleep(); } } } }; return Timeline2; }(Animation); _setDefaults(Timeline.prototype, { _lock: 0, _hasPause: 0, _forcing: 0 }); var _addComplexStringPropTween = function _addComplexStringPropTween2(target, prop, start, end, setter, stringFilter, funcParam) { var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), index = 0, matchIndex = 0, result, startNums, color, endNum, chunk, startNum, hasRandom, a; pt.b = start; pt.e = end; start += ""; end += ""; if (hasRandom = ~end.indexOf("random(")) { end = _replaceRandom(end); } if (stringFilter) { a = [start, end]; stringFilter(a, target, prop); start = a[0]; end = a[1]; } startNums = start.match(_complexStringNumExp) || []; while (result = _complexStringNumExp.exec(end)) { endNum = result[0]; chunk = end.substring(index, result.index); if (color) { color = (color + 1) % 5; } else if (chunk.substr(-5) === "rgba(") { color = 1; } if (endNum !== startNums[matchIndex++]) { startNum = parseFloat(startNums[matchIndex - 1]) || 0; pt._pt = { _next: pt._pt, p: chunk || matchIndex === 1 ? chunk : ",", s: startNum, c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum, m: color && color < 4 ? Math.round : 0 }; index = _complexStringNumExp.lastIndex; } } pt.c = index < end.length ? end.substring(index, end.length) : ""; pt.fp = funcParam; if (_relExp.test(end) || hasRandom) { pt.e = 0; } this._pt = pt; return pt; }; var _addPropTween = function _addPropTween2(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) { _isFunction(end) && (end = end(index || 0, target, targets)); var currentValue = target[prop], parsedStart = start !== "get" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf("set") || !_isFunction(target["get" + prop.substr(3)]) ? prop : "get" + prop.substr(3)](funcParam) : target[prop](), setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, pt; if (_isString(end)) { if (~end.indexOf("random(")) { end = _replaceRandom(end); } if (end.charAt(1) === "=") { pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0); if (pt || pt === 0) { end = pt; } } } if (!optional || parsedStart !== end || _forceAllPropTweens) { if (!isNaN(parsedStart * end) && end !== "") { pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter); funcParam && (pt.fp = funcParam); modifier && pt.modifier(modifier, this, target); return this._pt = pt; } !currentValue && !(prop in target) && _missingPlugin(prop, end); return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam); } }; var _processVars = function _processVars2(vars, index, target, targets, tween) { _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets)); if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) { return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars; } var copy = {}, p; for (p in vars) { copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets); } return copy; }; var _checkPlugin = function _checkPlugin2(property, vars, tween, index, target, targets) { var plugin, pt, ptLookup, i; if (_plugins[property] && (plugin = new _plugins[property]).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) { tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority); if (tween !== _quickTween) { ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; i = plugin._props.length; while (i--) { ptLookup[plugin._props[i]] = pt; } } } return plugin; }; var _overwritingTween; var _forceAllPropTweens; var _initTween = function _initTween2(tween, time, tTime) { var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, tl = tween.timeline, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten; tl && (!keyframes || !ease) && (ease = "none"); tween._ease = _parseEase(ease, _defaults.ease); tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0; if (yoyoEase && tween._yoyo && !tween._repeat) { yoyoEase = tween._yEase; tween._yEase = tween._ease; tween._ease = yoyoEase; } tween._from = !tl && !!vars.runBackwards; if (!tl || keyframes && !vars.stagger) { harness = targets[0] ? _getCache(targets[0]).harness : 0; harnessVars = harness && vars[harness.prop]; cleanVars = _copyExcluding(vars, _reservedProps); if (prevStartAt) { prevStartAt._zTime < 0 && prevStartAt.progress(1); time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); prevStartAt._lazy = 0; } if (startAt) { _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({ data: "isStart", overwrite: false, parent, immediateRender: true, lazy: !prevStartAt && _isNotFalse(lazy), startAt: null, delay: 0, onUpdate: onUpdate && function() { return _callback(tween, "onUpdate"); }, stagger: 0 }, startAt))); tween._startAt._dp = 0; tween._startAt._sat = tween; time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); if (immediateRender) { if (dur && time <= 0 && tTime <= 0) { time && (tween._zTime = time); return; } } } else if (runBackwards && dur) { if (!prevStartAt) { time && (immediateRender = false); p = _setDefaults({ overwrite: false, data: "isFromStart", lazy: immediateRender && !prevStartAt && _isNotFalse(lazy), immediateRender, stagger: 0, parent }, cleanVars); harnessVars && (p[harness.prop] = harnessVars); _removeFromParent(tween._startAt = Tween.set(targets, p)); tween._startAt._dp = 0; tween._startAt._sat = tween; time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true)); tween._zTime = time; if (!immediateRender) { _initTween2(tween._startAt, _tinyNum, _tinyNum); } else if (!time) { return; } } } tween._pt = tween._ptCache = 0; lazy = dur && _isNotFalse(lazy) || lazy && !dur; for (i = 0;i < targets.length; i++) { target = targets[i]; gsData = target._gsap || _harness(targets)[i]._gsap; tween._ptLookup[i] = ptLookup = {}; _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); index = fullTargets === targets ? i : fullTargets.indexOf(target); if (harness && (plugin = new harness).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) { tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority); plugin._props.forEach(function(name) { ptLookup[name] = pt; }); plugin.priority && (hasPriority = 1); } if (!harness || harnessVars) { for (p in cleanVars) { if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) { plugin.priority && (hasPriority = 1); } else { ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter); } } } tween._op && tween._op[i] && tween.kill(target, tween._op[i]); if (autoOverwrite && tween._pt) { _overwritingTween = tween; _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); overwritten = !tween.parent; _overwritingTween = 0; } tween._pt && lazy && (_lazyLookup[gsData.id] = 1); } hasPriority && _sortPropTweensByPriority(tween); tween._onInit && tween._onInit(tween); } tween._onUpdate = onUpdate; tween._initted = (!tween._op || tween._pt) && !overwritten; keyframes && time <= 0 && tl.render(_bigNum, true, true); }; var _updatePropTweens = function _updatePropTweens2(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) { var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], pt, rootPT, lookup, i; if (!ptCache) { ptCache = tween._ptCache[property] = []; lookup = tween._ptLookup; i = tween._targets.length; while (i--) { pt = lookup[i][property]; if (pt && pt.d && pt.d._pt) { pt = pt.d._pt; while (pt && pt.p !== property && pt.fp !== property) { pt = pt._next; } } if (!pt) { _forceAllPropTweens = 1; tween.vars[property] = "+=0"; _initTween(tween, time); _forceAllPropTweens = 0; return skipRecursion ? _warn(property + " not eligible for reset") : 1; } ptCache.push(pt); } } i = ptCache.length; while (i--) { rootPT = ptCache[i]; pt = rootPT._pt || rootPT; pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c; pt.c = value - pt.s; rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); } }; var _addAliasesToVars = function _addAliasesToVars2(targets, vars) { var harness = targets[0] ? _getCache(targets[0]).harness : 0, propertyAliases = harness && harness.aliases, copy, p, i, aliases; if (!propertyAliases) { return vars; } copy = _merge({}, vars); for (p in propertyAliases) { if (p in copy) { aliases = propertyAliases[p].split(","); i = aliases.length; while (i--) { copy[aliases[i]] = copy[p]; } } } return copy; }; var _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) { var ease = obj.ease || easeEach || "power1.inOut", p, a; if (_isArray(obj)) { a = allProps[prop] || (allProps[prop] = []); obj.forEach(function(value, i) { return a.push({ t: i / (obj.length - 1) * 100, v: value, e: ease }); }); } else { for (p in obj) { a = allProps[p] || (allProps[p] = []); p === "ease" || a.push({ t: parseFloat(prop), v: obj[p], e: ease }); } } }; var _parseFuncOrString = function _parseFuncOrString2(value, tween, i, target, targets) { return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value; }; var _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert"; var _staggerPropsToSkip = {}; _forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) { return _staggerPropsToSkip[name] = 1; }); var Tween = /* @__PURE__ */ function(_Animation2) { _inheritsLoose(Tween2, _Animation2); function Tween2(targets, vars, position, skipInherit) { var _this3; if (typeof vars === "number") { position.duration = vars; vars = position; position = null; } _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this; var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, yoyoEase = _this3$vars.yoyoEase, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : ("length" in vars)) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge; _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://gsap.com", !_config.nullTargetWarn) || []; _this3._ptLookup = []; _this3._overwrite = overwrite; if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { vars = _this3.vars; tl = _this3.timeline = new Timeline({ data: "nested", defaults: defaults || {}, targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets }); tl.kill(); tl.parent = tl._dp = _assertThisInitialized(_this3); tl._start = 0; if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { l = parsedTargets.length; staggerFunc = stagger && distribute(stagger); if (_isObject(stagger)) { for (p in stagger) { if (~_staggerTweenProps.indexOf(p)) { staggerVarsToMerge || (staggerVarsToMerge = {}); staggerVarsToMerge[p] = stagger[p]; } } } for (i = 0;i < l; i++) { copy = _copyExcluding(vars, _staggerPropsToSkip); copy.stagger = 0; yoyoEase && (copy.yoyoEase = yoyoEase); staggerVarsToMerge && _merge(copy, staggerVarsToMerge); curTarget = parsedTargets[i]; copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets); copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay; if (!stagger && l === 1 && copy.delay) { _this3._delay = delay = copy.delay; _this3._start += delay; copy.delay = 0; } tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0); tl._ease = _easeMap.none; } tl.duration() ? duration = delay = 0 : _this3.timeline = 0; } else if (keyframes) { _inheritDefaults(_setDefaults(tl.vars.defaults, { ease: "none" })); tl._ease = _parseEase(keyframes.ease || vars.ease || "none"); var time = 0, a, kf, v; if (_isArray(keyframes)) { keyframes.forEach(function(frame) { return tl.to(parsedTargets, frame, ">"); }); tl.duration(); } else { copy = {}; for (p in keyframes) { p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach); } for (p in copy) { a = copy[p].sort(function(a2, b) { return a2.t - b.t; }); time = 0; for (i = 0;i < a.length; i++) { kf = a[i]; v = { ease: kf.e, duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration }; v[p] = kf.v; tl.to(parsedTargets, v, time); time += v.duration; } } tl.duration() < duration && tl.to({}, { duration: duration - tl.duration() }); } } duration || _this3.duration(duration = tl.duration()); } else { _this3.timeline = 0; } if (overwrite === true && !_suppressOverwrites) { _overwritingTween = _assertThisInitialized(_this3); _globalTimeline.killTweensOf(parsedTargets); _overwritingTween = 0; } _addToTimeline(parent, _assertThisInitialized(_this3), position); vars.reversed && _this3.reverse(); vars.paused && _this3.paused(true); if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") { _this3._tTime = -_tinyNum; _this3.render(Math.max(0, -delay) || 0); } scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger); return _this3; } var _proto3 = Tween2.prototype; _proto3.render = function render(totalTime, suppressEvents, force) { var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline, yoyoEase; if (!dur) { _renderZeroDurationTween(this, totalTime, suppressEvents, force); } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative || this._lazy) { time = tTime; timeline = this.timeline; if (this._repeat) { cycleDuration = dur + this._rDelay; if (this._repeat < -1 && isNegative) { return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); } time = _roundPrecise(tTime % cycleDuration); if (tTime === tDur) { iteration = this._repeat; time = dur; } else { prevIteration = _roundPrecise(tTime / cycleDuration); iteration = ~~prevIteration; if (iteration && iteration === prevIteration) { time = dur; iteration--; } else if (time > dur) { time = dur; } } isYoyo = this._yoyo && iteration & 1; if (isYoyo) { yoyoEase = this._yEase; time = dur - time; } prevIteration = _animationCycle(this._tTime, cycleDuration); if (time === prevTime && !force && this._initted && iteration === prevIteration) { this._tTime = tTime; return this; } if (iteration !== prevIteration) { timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo); if (this.vars.repeatRefresh && !isYoyo && !this._lock && time !== cycleDuration && this._initted) { this._lock = force = 1; this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0; } } } if (!this._initted) { if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) { this._tTime = 0; return this; } if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) { return this; } if (dur !== this._dur) { return this.render(totalTime, suppressEvents, force); } } this._tTime = tTime; this._time = time; if (!this._act && this._ts) { this._act = 1; this._lazy = 0; } this.ratio = ratio = (yoyoEase || this._ease)(time / dur); if (this._from) { this.ratio = ratio = 1 - ratio; } if (!prevTime && tTime && !suppressEvents && !prevIteration) { _callback(this, "onStart"); if (this._tTime !== tTime) { return this; } } pt = this._pt; while (pt) { pt.r(ratio, pt.d); pt = pt._next; } timeline && timeline.render(totalTime < 0 ? totalTime : timeline._dur * timeline._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime); if (this._onUpdate && !suppressEvents) { isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); _callback(this, "onUpdate"); } this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat"); if ((tTime === this._tDur || !tTime) && this._tTime === tTime) { isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true); (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) { _callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true); this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); } } } return this; }; _proto3.targets = function targets() { return this._targets; }; _proto3.invalidate = function invalidate(soft) { (!soft || !this.vars.runBackwards) && (this._startAt = 0); this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0; this._ptLookup = []; this.timeline && this.timeline.invalidate(soft); return _Animation2.prototype.invalidate.call(this, soft); }; _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) { _tickerActive || _ticker.wake(); this._ts || this.play(); var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), ratio; this._initted || _initTween(this, time); ratio = this._ease(time / this._dur); if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) { return this.resetTo(property, value, start, startIsRelative, 1); } _alignPlayhead(this, 0); this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0); return this.render(0); }; _proto3.kill = function kill(targets, vars) { if (vars === undefined) { vars = "all"; } if (!targets && (!vars || vars === "all")) { this._lazy = this._pt = 0; this.parent ? _interrupt(this) : this.scrollTrigger && this.scrollTrigger.kill(!!_reverting); return this; } if (this.timeline) { var tDur = this.timeline.totalDuration(); this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); return this; } var parsedTargets = this._targets, killingTargets = targets ? toArray(targets) : parsedTargets, propTweenLookup = this._ptLookup, firstPT = this._pt, overwrittenProps, curLookup, curOverwriteProps, props, p, pt, i; if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) { vars === "all" && (this._pt = 0); return _interrupt(this); } overwrittenProps = this._op = this._op || []; if (vars !== "all") { if (_isString(vars)) { p = {}; _forEachName(vars, function(name) { return p[name] = 1; }); vars = p; } vars = _addAliasesToVars(parsedTargets, vars); } i = parsedTargets.length; while (i--) { if (~killingTargets.indexOf(parsedTargets[i])) { curLookup = propTweenLookup[i]; if (vars === "all") { overwrittenProps[i] = vars; props = curLookup; curOverwriteProps = {}; } else { curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {}; props = vars; } for (p in props) { pt = curLookup && curLookup[p]; if (pt) { if (!("kill" in pt.d) || pt.d.kill(p) === true) { _removeLinkedListItem(this, pt, "_pt"); } delete curLookup[p]; } if (curOverwriteProps !== "all") { curOverwriteProps[p] = 1; } } } } this._initted && !this._pt && firstPT && _interrupt(this); return this; }; Tween2.to = function to(targets, vars) { return new Tween2(targets, vars, arguments[2]); }; Tween2.from = function from(targets, vars) { return _createTweenType(1, arguments); }; Tween2.delayedCall = function delayedCall(delay, callback, params, scope) { return new Tween2(callback, 0, { immediateRender: false, lazy: false, overwrite: false, delay, onComplete: callback, onReverseComplete: callback, onCompleteParams: params, onReverseCompleteParams: params, callbackScope: scope }); }; Tween2.fromTo = function fromTo(targets, fromVars, toVars) { return _createTweenType(2, arguments); }; Tween2.set = function set(targets, vars) { vars.duration = 0; vars.repeatDelay || (vars.repeat = 0); return new Tween2(targets, vars); }; Tween2.killTweensOf = function killTweensOf(targets, props, onlyActive) { return _globalTimeline.killTweensOf(targets, props, onlyActive); }; return Tween2; }(Animation); _setDefaults(Tween.prototype, { _targets: [], _lazy: 0, _startAt: 0, _op: 0, _onInit: 0 }); _forEachName("staggerTo,staggerFrom,staggerFromTo", function(name) { Tween[name] = function() { var tl = new Timeline, params = _slice.call(arguments, 0); params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0); return tl[name].apply(tl, params); }; }); var _setterPlain = function _setterPlain2(target, property, value) { return target[property] = value; }; var _setterFunc = function _setterFunc2(target, property, value) { return target[property](value); }; var _setterFuncWithParam = function _setterFuncWithParam2(target, property, value, data) { return target[property](data.fp, value); }; var _setterAttribute = function _setterAttribute2(target, property, value) { return target.setAttribute(property, value); }; var _getSetter = function _getSetter2(target, property) { return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain; }; var _renderPlain = function _renderPlain2(ratio, data) { return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e6) / 1e6, data); }; var _renderBoolean = function _renderBoolean2(ratio, data) { return data.set(data.t, data.p, !!(data.s + data.c * ratio), data); }; var _renderComplexString = function _renderComplexString2(ratio, data) { var pt = data._pt, s = ""; if (!ratio && data.b) { s = data.b; } else if (ratio === 1 && data.e) { s = data.e; } else { while (pt) { s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 1e4) / 1e4) + s; pt = pt._next; } s += data.c; } data.set(data.t, data.p, s, data); }; var _renderPropTweens = function _renderPropTweens2(ratio, data) { var pt = data._pt; while (pt) { pt.r(ratio, pt.d); pt = pt._next; } }; var _addPluginModifier = function _addPluginModifier2(modifier, tween, target, property) { var pt = this._pt, next; while (pt) { next = pt._next; pt.p === property && pt.modifier(modifier, tween, target); pt = next; } }; var _killPropTweensOf = function _killPropTweensOf2(property) { var pt = this._pt, hasNonDependentRemaining, next; while (pt) { next = pt._next; if (pt.p === property && !pt.op || pt.op === property) { _removeLinkedListItem(this, pt, "_pt"); } else if (!pt.dep) { hasNonDependentRemaining = 1; } pt = next; } return !hasNonDependentRemaining; }; var _setterWithModifier = function _setterWithModifier2(target, property, value, data) { data.mSet(target, property, data.m.call(data.tween, value, data.mt), data); }; var _sortPropTweensByPriority = function _sortPropTweensByPriority2(parent) { var pt = parent._pt, next, pt2, first, last; while (pt) { next = pt._next; pt2 = first; while (pt2 && pt2.pr > pt.pr) { pt2 = pt2._next; } if (pt._prev = pt2 ? pt2._prev : last) { pt._prev._next = pt; } else { first = pt; } if (pt._next = pt2) { pt2._prev = pt; } else { last = pt; } pt = next; } parent._pt = first; }; var PropTween = /* @__PURE__ */ function() { function PropTween2(next, target, prop, start, change, renderer, data, setter, priority) { this.t = target; this.s = start; this.c = change; this.p = prop; this.r = renderer || _renderPlain; this.d = data || this; this.set = setter || _setterPlain; this.pr = priority || 0; this._next = next; if (next) { next._prev = this; } } var _proto4 = PropTween2.prototype; _proto4.modifier = function modifier(func, tween, target) { this.mSet = this.mSet || this.set; this.set = _setterWithModifier; this.m = func; this.mt = target; this.tween = tween; }; return PropTween2; }(); _forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function(name) { return _reservedProps[name] = 1; }); _globals.TweenMax = _globals.TweenLite = Tween; _globals.TimelineLite = _globals.TimelineMax = Timeline; _globalTimeline = new Timeline({ sortChildren: false, defaults: _defaults, autoRemoveChildren: true, id: "root", smoothChildTiming: true }); _config.stringFilter = _colorStringFilter; var _media = []; var _listeners = {}; var _emptyArray = []; var _lastMediaTime = 0; var _contextID = 0; var _dispatch = function _dispatch2(type) { return (_listeners[type] || _emptyArray).map(function(f) { return f(); }); }; var _onMediaChange = function _onMediaChange2() { var time = Date.now(), matches = []; if (time - _lastMediaTime > 2) { _dispatch("matchMediaInit"); _media.forEach(function(c) { var { queries, conditions } = c, match, p, anyMatch, toggled; for (p in queries) { match = _win.matchMedia(queries[p]).matches; match && (anyMatch = 1); if (match !== conditions[p]) { conditions[p] = match; toggled = 1; } } if (toggled) { c.revert(); anyMatch && matches.push(c); } }); _dispatch("matchMediaRevert"); matches.forEach(function(c) { return c.onMatch(c, function(func) { return c.add(null, func); }); }); _lastMediaTime = time; _dispatch("matchMedia"); } }; var Context = /* @__PURE__ */ function() { function Context2(func, scope) { this.selector = scope && selector(scope); this.data = []; this._r = []; this.isReverted = false; this.id = _contextID++; func && this.add(func); } var _proto5 = Context2.prototype; _proto5.add = function add(name, func, scope) { if (_isFunction(name)) { scope = func; func = name; name = _isFunction; } var self2 = this, f = function f() { var prev = _context, prevSelector = self2.selector, result; prev && prev !== self2 && prev.data.push(self2); scope && (self2.selector = selector(scope)); _context = self2; result = func.apply(self2, arguments); _isFunction(result) && self2._r.push(result); _context = prev; self2.selector = prevSelector; self2.isReverted = false; return result; }; self2.last = f; return name === _isFunction ? f(self2, function(func2) { return self2.add(null, func2); }) : name ? self2[name] = f : f; }; _proto5.ignore = function ignore(func) { var prev = _context; _context = null; func(this); _context = prev; }; _proto5.getTweens = function getTweens() { var a = []; this.data.forEach(function(e) { return e instanceof Context2 ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e); }); return a; }; _proto5.clear = function clear() { this._r.length = this.data.length = 0; }; _proto5.kill = function kill(revert, matchMedia) { var _this4 = this; if (revert) { (function() { var tweens = _this4.getTweens(), i2 = _this4.data.length, t; while (i2--) { t = _this4.data[i2]; if (t.data === "isFlip") { t.revert(); t.getChildren(true, true, false).forEach(function(tween) { return tweens.splice(tweens.indexOf(tween), 1); }); } } tweens.map(function(t2) { return { g: t2._dur || t2._delay || t2._sat && !t2._sat.vars.immediateRender ? t2.globalTime(0) : -Infinity, t: t2 }; }).sort(function(a, b) { return b.g - a.g || -Infinity; }).forEach(function(o) { return o.t.revert(revert); }); i2 = _this4.data.length; while (i2--) { t = _this4.data[i2]; if (t instanceof Timeline) { if (t.data !== "nested") { t.scrollTrigger && t.scrollTrigger.revert(); t.kill(); } } else { !(t instanceof Tween) && t.revert && t.revert(revert); } } _this4._r.forEach(function(f) { return f(revert, _this4); }); _this4.isReverted = true; })(); } else { this.data.forEach(function(e) { return e.kill && e.kill(); }); } this.clear(); if (matchMedia) { var i = _media.length; while (i--) { _media[i].id === this.id && _media.splice(i, 1); } } }; _proto5.revert = function revert(config2) { this.kill(config2 || {}); }; return Context2; }(); var MatchMedia = /* @__PURE__ */ function() { function MatchMedia2(scope) { this.contexts = []; this.scope = scope; _context && _context.data.push(this); } var _proto6 = MatchMedia2.prototype; _proto6.add = function add(conditions, func, scope) { _isObject(conditions) || (conditions = { matches: conditions }); var context = new Context(0, scope || this.scope), cond = context.conditions = {}, mq, p, active; _context && !context.selector && (context.selector = _context.selector); this.contexts.push(context); func = context.add("onMatch", func); context.queries = conditions; for (p in conditions) { if (p === "all") { active = 1; } else { mq = _win.matchMedia(conditions[p]); if (mq) { _media.indexOf(context) < 0 && _media.push(context); (cond[p] = mq.matches) && (active = 1); mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange); } } } active && func(context, function(f) { return context.add(null, f); }); return this; }; _proto6.revert = function revert(config2) { this.kill(config2 || {}); }; _proto6.kill = function kill(revert) { this.contexts.forEach(function(c) { return c.kill(revert, true); }); }; return MatchMedia2; }(); var _gsap = { registerPlugin: function registerPlugin() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0;_key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } args.forEach(function(config3) { return _createPlugin(config3); }); }, timeline: function timeline(vars) { return new Timeline(vars); }, getTweensOf: function getTweensOf(targets, onlyActive) { return _globalTimeline.getTweensOf(targets, onlyActive); }, getProperty: function getProperty(target, property, unit, uncache) { _isString(target) && (target = toArray(target)[0]); var getter = _getCache(target || {}).get, format = unit ? _passThrough : _numericIfPossible; unit === "native" && (unit = ""); return !target ? target : !property ? function(property2, unit2, uncache2) { return format((_plugins[property2] && _plugins[property2].get || getter)(target, property2, unit2, uncache2)); } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache)); }, quickSetter: function quickSetter(target, property, unit) { target = toArray(target); if (target.length > 1) { var setters = target.map(function(t) { return gsap.quickSetter(t, property, unit); }), l = setters.length; return function(value) { var i = l; while (i--) { setters[i](value); } }; } target = target[0] || {}; var Plugin = _plugins[property], cache = _getCache(target), p = cache.harness && (cache.harness.aliases || {})[property] || property, setter = Plugin ? function(value) { var p2 = new Plugin; _quickTween._pt = 0; p2.init(target, unit ? value + unit : value, _quickTween, 0, [target]); p2.render(1, p2); _quickTween._pt && _renderPropTweens(1, _quickTween); } : cache.set(target, p); return Plugin ? setter : function(value) { return setter(target, p, unit ? value + unit : value, cache, 1); }; }, quickTo: function quickTo(target, property, vars) { var _setDefaults22; var tween = gsap.to(target, _setDefaults((_setDefaults22 = {}, _setDefaults22[property] = "+=0.1", _setDefaults22.paused = true, _setDefaults22.stagger = 0, _setDefaults22), vars || {})), func = function func(value, start, startIsRelative) { return tween.resetTo(property, value, start, startIsRelative); }; func.tween = tween; return func; }, isTweening: function isTweening(targets) { return _globalTimeline.getTweensOf(targets, true).length > 0; }, defaults: function defaults(value) { value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease)); return _mergeDeep(_defaults, value || {}); }, config: function config2(value) { return _mergeDeep(_config, value || {}); }, registerEffect: function registerEffect(_ref3) { var { name, effect, plugins, defaults: defaults2, extendTimeline } = _ref3; (plugins || "").split(",").forEach(function(pluginName) { return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin."); }); _effects[name] = function(targets, vars, tl) { return effect(toArray(targets), _setDefaults(vars || {}, defaults2), tl); }; if (extendTimeline) { Timeline.prototype[name] = function(targets, vars, position) { return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position); }; } }, registerEase: function registerEase(name, ease) { _easeMap[name] = _parseEase(ease); }, parseEase: function parseEase(ease, defaultEase) { return arguments.length ? _parseEase(ease, defaultEase) : _easeMap; }, getById: function getById(id) { return _globalTimeline.getById(id); }, exportRoot: function exportRoot(vars, includeDelayedCalls) { if (vars === undefined) { vars = {}; } var tl = new Timeline(vars), child, next; tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming); _globalTimeline.remove(tl); tl._dp = 0; tl._time = tl._tTime = _globalTimeline._time; child = _globalTimeline._first; while (child) { next = child._next; if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) { _addToTimeline(tl, child, child._start - child._delay); } child = next; } _addToTimeline(_globalTimeline, tl, 0); return tl; }, context: function context(func, scope) { return func ? new Context(func, scope) : _context; }, matchMedia: function matchMedia(scope) { return new MatchMedia(scope); }, matchMediaRefresh: function matchMediaRefresh() { return _media.forEach(function(c) { var cond = c.conditions, found, p; for (p in cond) { if (cond[p]) { cond[p] = false; found = 1; } } found && c.revert(); }) || _onMediaChange(); }, addEventListener: function addEventListener(type, callback) { var a = _listeners[type] || (_listeners[type] = []); ~a.indexOf(callback) || a.push(callback); }, removeEventListener: function removeEventListener(type, callback) { var a = _listeners[type], i = a && a.indexOf(callback); i >= 0 && a.splice(i, 1); }, utils: { wrap, wrapYoyo, distribute, random, snap, normalize, getUnit, clamp: clamp2, splitColor, toArray, selector, mapRange, pipe, unitize, interpolate, shuffle }, install: _install, effects: _effects, ticker: _ticker, updateRoot: Timeline.updateRoot, plugins: _plugins, globalTimeline: _globalTimeline, core: { PropTween, globals: _addGlobal, Tween, Timeline, Animation, getCache: _getCache, _removeLinkedListItem, reverting: function reverting() { return _reverting; }, context: function context2(toAdd) { if (toAdd && _context) { _context.data.push(toAdd); toAdd._ctx = _context; } return _context; }, suppressOverwrites: function suppressOverwrites(value) { return _suppressOverwrites = value; } } }; _forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function(name) { return _gsap[name] = Tween[name]; }); _ticker.add(Timeline.updateRoot); _quickTween = _gsap.to({}, { duration: 0 }); var _getPluginPropTween = function _getPluginPropTween2(plugin, prop) { var pt = plugin._pt; while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) { pt = pt._next; } return pt; }; var _addModifiers = function _addModifiers2(tween, modifiers) { var targets = tween._targets, p, i, pt; for (p in modifiers) { i = targets.length; while (i--) { pt = tween._ptLookup[i][p]; if (pt && (pt = pt.d)) { if (pt._pt) { pt = _getPluginPropTween(pt, p); } pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p); } } } }; var _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) { return { name, headless: 1, rawVars: 1, init: function init(target, vars, tween) { tween._onInit = function(tween2) { var temp, p; if (_isString(vars)) { temp = {}; _forEachName(vars, function(name2) { return temp[name2] = 1; }); vars = temp; } if (modifier) { temp = {}; for (p in vars) { temp[p] = modifier(vars[p]); } vars = temp; } _addModifiers(tween2, vars); }; } }; }; var gsap = _gsap.registerPlugin({ name: "attr", init: function init(target, vars, tween, index, targets) { var p, pt, v; this.tween = tween; for (p in vars) { v = target.getAttribute(p) || ""; pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p); pt.op = p; pt.b = v; this._props.push(p); } }, render: function render(ratio, data) { var pt = data._pt; while (pt) { _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); pt = pt._next; } } }, { name: "endArray", headless: 1, init: function init2(target, value) { var i = value.length; while (i--) { this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1); } } }, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap; Tween.version = Timeline.version = gsap.version = "3.14.2"; _coreReady = 1; _windowExists() && _wake(); var Power0 = _easeMap.Power0; var Power1 = _easeMap.Power1; var Power2 = _easeMap.Power2; var Power3 = _easeMap.Power3; var Power4 = _easeMap.Power4; var Linear = _easeMap.Linear; var Quad = _easeMap.Quad; var Cubic = _easeMap.Cubic; var Quart = _easeMap.Quart; var Quint = _easeMap.Quint; var Strong = _easeMap.Strong; var Elastic = _easeMap.Elastic; var Back = _easeMap.Back; var SteppedEase = _easeMap.SteppedEase; var Bounce = _easeMap.Bounce; var Sine = _easeMap.Sine; var Expo = _easeMap.Expo; var Circ = _easeMap.Circ; // node_modules/gsap/CSSPlugin.js /*! * CSSPlugin 3.14.2 * https://gsap.com * * Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var _win2; var _doc2; var _docElement; var _pluginInitted; var _tempDiv; var _tempDivStyler; var _recentSetterPlugin; var _reverting2; var _windowExists3 = function _windowExists4() { return typeof window !== "undefined"; }; var _transformProps = {}; var _RAD2DEG = 180 / Math.PI; var _DEG2RAD = Math.PI / 180; var _atan2 = Math.atan2; var _bigNum2 = 1e8; var _capsExp = /([A-Z])/g; var _horizontalExp = /(left|right|width|margin|padding|x)/i; var _complexExp = /[\s,\(]\S/; var _propertyAliases = { autoAlpha: "opacity,visibility", scale: "scaleX,scaleY", alpha: "opacity" }; var _renderCSSProp = function _renderCSSProp2(ratio, data) { return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data); }; var _renderPropWithEnd = function _renderPropWithEnd2(ratio, data) { return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data); }; var _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning2(ratio, data) { return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data); }; var _renderCSSPropWithBeginningAndEnd = function _renderCSSPropWithBeginningAndEnd2(ratio, data) { return data.set(data.t, data.p, ratio === 1 ? data.e : ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data); }; var _renderRoundedCSSProp = function _renderRoundedCSSProp2(ratio, data) { var value = data.s + data.c * ratio; data.set(data.t, data.p, ~~(value + (value < 0 ? -0.5 : 0.5)) + data.u, data); }; var _renderNonTweeningValue = function _renderNonTweeningValue2(ratio, data) { return data.set(data.t, data.p, ratio ? data.e : data.b, data); }; var _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd2(ratio, data) { return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data); }; var _setterCSSStyle = function _setterCSSStyle2(target, property, value) { return target.style[property] = value; }; var _setterCSSProp = function _setterCSSProp2(target, property, value) { return target.style.setProperty(property, value); }; var _setterTransform = function _setterTransform2(target, property, value) { return target._gsap[property] = value; }; var _setterScale = function _setterScale2(target, property, value) { return target._gsap.scaleX = target._gsap.scaleY = value; }; var _setterScaleWithRender = function _setterScaleWithRender2(target, property, value, data, ratio) { var cache = target._gsap; cache.scaleX = cache.scaleY = value; cache.renderTransform(ratio, cache); }; var _setterTransformWithRender = function _setterTransformWithRender2(target, property, value, data, ratio) { var cache = target._gsap; cache[property] = value; cache.renderTransform(ratio, cache); }; var _transformProp = "transform"; var _transformOriginProp = _transformProp + "Origin"; var _saveStyle = function _saveStyle2(property, isNotCSS) { var _this = this; var target = this.target, style = target.style, cache = target._gsap; if (property in _transformProps && style) { this.tfm = this.tfm || {}; if (property !== "transform") { property = _propertyAliases[property] || property; ~property.indexOf(",") ? property.split(",").forEach(function(a) { return _this.tfm[a] = _get(target, a); }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin); } else { return _propertyAliases.transform.split(",").forEach(function(p) { return _saveStyle2.call(_this, p, isNotCSS); }); } if (this.props.indexOf(_transformProp) >= 0) { return; } if (cache.svg) { this.svgo = target.getAttribute("data-svg-origin"); this.props.push(_transformOriginProp, isNotCSS, ""); } property = _transformProp; } (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]); }; var _removeIndependentTransforms = function _removeIndependentTransforms2(style) { if (style.translate) { style.removeProperty("translate"); style.removeProperty("scale"); style.removeProperty("rotate"); } }; var _revertStyle = function _revertStyle2() { var props = this.props, target = this.target, style = target.style, cache = target._gsap, i, p; for (i = 0;i < props.length; i += 3) { if (!props[i + 1]) { props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === "--" ? props[i] : props[i].replace(_capsExp, "-$1").toLowerCase()); } else if (props[i + 1] === 2) { target[props[i]](props[i + 2]); } else { target[props[i]] = props[i + 2]; } } if (this.tfm) { for (p in this.tfm) { cache[p] = this.tfm[p]; } if (cache.svg) { cache.renderTransform(); target.setAttribute("data-svg-origin", this.svgo || ""); } i = _reverting2(); if ((!i || !i.isStart) && !style[_transformProp]) { _removeIndependentTransforms(style); if (cache.zOrigin && style[_transformOriginProp]) { style[_transformOriginProp] += " " + cache.zOrigin + "px"; cache.zOrigin = 0; cache.renderTransform(); } cache.uncache = 1; } } }; var _getStyleSaver = function _getStyleSaver2(target, properties) { var saver = { target, props: [], revert: _revertStyle, save: _saveStyle }; target._gsap || gsap.core.getCache(target); properties && target.style && target.nodeType && properties.split(",").forEach(function(p) { return saver.save(p); }); return saver; }; var _supports3D; var _createElement = function _createElement2(type, ns) { var e = _doc2.createElementNS ? _doc2.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc2.createElement(type); return e && e.style ? e : _doc2.createElement(type); }; var _getComputedProperty = function _getComputedProperty2(target, property, skipPrefixFallback) { var cs = getComputedStyle(target); return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty2(target, _checkPropPrefix(property) || property, 1) || ""; }; var _prefixes = "O,Moz,ms,Ms,Webkit".split(","); var _checkPropPrefix = function _checkPropPrefix2(property, element, preferPrefix) { var e = element || _tempDiv, s = e.style, i = 5; if (property in s && !preferPrefix) { return property; } property = property.charAt(0).toUpperCase() + property.substr(1); while (i-- && !(_prefixes[i] + property in s)) { } return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property; }; var _initCore = function _initCore2() { if (_windowExists3() && window.document) { _win2 = window; _doc2 = _win2.document; _docElement = _doc2.documentElement; _tempDiv = _createElement("div") || { style: {} }; _tempDivStyler = _createElement("div"); _transformProp = _checkPropPrefix(_transformProp); _transformOriginProp = _transformProp + "Origin"; _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0"; _supports3D = !!_checkPropPrefix("perspective"); _reverting2 = gsap.core.reverting; _pluginInitted = 1; } }; var _getReparentedCloneBBox = function _getReparentedCloneBBox2(target) { var owner = target.ownerSVGElement, svg = _createElement("svg", owner && owner.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), clone = target.cloneNode(true), bbox; clone.style.display = "block"; svg.appendChild(clone); _docElement.appendChild(svg); try { bbox = clone.getBBox(); } catch (e) { } svg.removeChild(clone); _docElement.removeChild(svg); return bbox; }; var _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) { var i = attributesArray.length; while (i--) { if (target.hasAttribute(attributesArray[i])) { return target.getAttribute(attributesArray[i]); } } }; var _getBBox = function _getBBox2(target) { var bounds, cloned; try { bounds = target.getBBox(); } catch (error) { bounds = _getReparentedCloneBBox(target); cloned = 1; } bounds && (bounds.width || bounds.height) || cloned || (bounds = _getReparentedCloneBBox(target)); return bounds && !bounds.width && !bounds.x && !bounds.y ? { x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0, y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0, width: 0, height: 0 } : bounds; }; var _isSVG = function _isSVG2(e) { return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); }; var _removeProperty = function _removeProperty2(target, property) { if (property) { var style = target.style, first2Chars; if (property in _transformProps && property !== _transformOriginProp) { property = _transformProp; } if (style.removeProperty) { first2Chars = property.substr(0, 2); if (first2Chars === "ms" || property.substr(0, 6) === "webkit") { property = "-" + property; } style.removeProperty(first2Chars === "--" ? property : property.replace(_capsExp, "-$1").toLowerCase()); } else { style.removeAttribute(property); } } }; var _addNonTweeningPT = function _addNonTweeningPT2(plugin, target, property, beginning, end, onlySetAtEnd) { var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue); plugin._pt = pt; pt.b = beginning; pt.e = end; plugin._props.push(property); return pt; }; var _nonConvertibleUnits = { deg: 1, rad: 1, turn: 1 }; var _nonStandardLayouts = { grid: 1, flex: 1 }; var _convertToUnit = function _convertToUnit2(target, property, value, unit) { var curValue = parseFloat(value) || 0, curUnit = (value + "").trim().substr((curValue + "").length) || "px", style = _tempDiv.style, horizontal = _horizontalExp.test(property), isRootSVG = target.tagName.toLowerCase() === "svg", measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), amount = 100, toPixels = unit === "px", toPercent = unit === "%", px, parent, cache, isSVG; if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) { return curValue; } curUnit !== "px" && !toPixels && (curValue = _convertToUnit2(target, property, value, "px")); isSVG = target.getCTM && _isSVG(target); if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) { px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty]; return _round(toPercent ? curValue / px * amount : curValue / 100 * px); } style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit); parent = unit !== "rem" && ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode; if (isSVG) { parent = (target.ownerSVGElement || {}).parentNode; } if (!parent || parent === _doc2 || !parent.appendChild) { parent = _doc2.body; } cache = parent._gsap; if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) { return _round(curValue / cache.width * amount); } else { if (toPercent && (property === "height" || property === "width")) { var v = target.style[property]; target.style[property] = amount + unit; px = target[measureProperty]; v ? target.style[property] = v : _removeProperty(target, property); } else { (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position")); parent === target && (style.position = "static"); parent.appendChild(_tempDiv); px = _tempDiv[measureProperty]; parent.removeChild(_tempDiv); style.position = "absolute"; } if (horizontal && toPercent) { cache = _getCache(parent); cache.time = _ticker.time; cache.width = parent[measureProperty]; } } return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0); }; var _get = function _get2(target, property, unit, uncache) { var value; _pluginInitted || _initCore(); if (property in _propertyAliases && property !== "transform") { property = _propertyAliases[property]; if (~property.indexOf(",")) { property = property.split(",")[0]; } } if (_transformProps[property] && property !== "transform") { value = _parseTransform(target, uncache); value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px"; } else { value = target.style[property]; if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) { value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0); } } return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value; }; var _tweenComplexCSSString = function _tweenComplexCSSString2(target, prop, start, end) { if (!start || start === "none") { var p = _checkPropPrefix(prop, target, 1), s = p && _getComputedProperty(target, p, 1); if (s && s !== start) { prop = p; start = s; } else if (prop === "borderColor") { start = _getComputedProperty(target, "borderTopColor"); } } var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), index = 0, matchIndex = 0, a, result, startValues, startNum, color, startValue, endValue, endNum, chunk, endUnit, startUnit, endValues; pt.b = start; pt.e = end; start += ""; end += ""; if (end.substring(0, 6) === "var(--") { end = _getComputedProperty(target, end.substring(4, end.indexOf(")"))); } if (end === "auto") { startValue = target.style[prop]; target.style[prop] = end; end = _getComputedProperty(target, prop) || end; startValue ? target.style[prop] = startValue : _removeProperty(target, prop); } a = [start, end]; _colorStringFilter(a); start = a[0]; end = a[1]; startValues = start.match(_numWithUnitExp) || []; endValues = end.match(_numWithUnitExp) || []; if (endValues.length) { while (result = _numWithUnitExp.exec(end)) { endValue = result[0]; chunk = end.substring(index, result.index); if (color) { color = (color + 1) % 5; } else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") { color = 1; } if (endValue !== (startValue = startValues[matchIndex++] || "")) { startNum = parseFloat(startValue) || 0; startUnit = startValue.substr((startNum + "").length); endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit); endNum = parseFloat(endValue); endUnit = endValue.substr((endNum + "").length); index = _numWithUnitExp.lastIndex - endUnit.length; if (!endUnit) { endUnit = endUnit || _config.units[prop] || startUnit; if (index === end.length) { end += endUnit; pt.e += endUnit; } } if (startUnit !== endUnit) { startNum = _convertToUnit(target, prop, startValue, endUnit) || 0; } pt._pt = { _next: pt._pt, p: chunk || matchIndex === 1 ? chunk : ",", s: startNum, c: endNum - startNum, m: color && color < 4 || prop === "zIndex" ? Math.round : 0 }; } } pt.c = index < end.length ? end.substring(index, end.length) : ""; } else { pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue; } _relExp.test(end) && (pt.e = 0); this._pt = pt; return pt; }; var _keywordToPercent = { top: "0%", bottom: "100%", left: "0%", right: "100%", center: "50%" }; var _convertKeywordsToPercentages = function _convertKeywordsToPercentages2(value) { var split = value.split(" "), x = split[0], y = split[1] || "50%"; if (x === "top" || x === "bottom" || y === "left" || y === "right") { value = x; x = y; y = value; } split[0] = _keywordToPercent[x] || x; split[1] = _keywordToPercent[y] || y; return split.join(" "); }; var _renderClearProps = function _renderClearProps2(ratio, data) { if (data.tween && data.tween._time === data.tween._dur) { var target = data.t, style = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i; if (props === "all" || props === true) { style.cssText = ""; clearTransforms = 1; } else { props = props.split(","); i = props.length; while (--i > -1) { prop = props[i]; if (_transformProps[prop]) { clearTransforms = 1; prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp; } _removeProperty(target, prop); } } if (clearTransforms) { _removeProperty(target, _transformProp); if (cache) { cache.svg && target.removeAttribute("transform"); style.scale = style.rotate = style.translate = "none"; _parseTransform(target, 1); cache.uncache = 1; _removeIndependentTransforms(style); } } } }; var _specialProps = { clearProps: function clearProps(plugin, target, property, endValue, tween) { if (tween.data !== "isFromStart") { var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps); pt.u = endValue; pt.pr = -10; pt.tween = tween; plugin._props.push(property); return 1; } } }; var _identity2DMatrix = [1, 0, 0, 1, 0, 0]; var _rotationalProperties = {}; var _isNullTransform = function _isNullTransform2(value) { return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value; }; var _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray2(target) { var matrixString = _getComputedProperty(target, _transformProp); return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round); }; var _getMatrix = function _getMatrix2(target, force2D) { var cache = target._gsap || _getCache(target), style = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM; if (cache.svg && target.getAttribute("transform")) { temp = target.transform.baseVal.consolidate().matrix; matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f]; return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix; } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) { temp = style.display; style.display = "block"; parent = target.parentNode; if (!parent || !target.offsetParent && !target.getBoundingClientRect().width) { addedToDOM = 1; nextSibling = target.nextElementSibling; _docElement.appendChild(target); } matrix = _getComputedTransformMatrixAsArray(target); temp ? style.display = temp : _removeProperty(target, "display"); if (addedToDOM) { nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target); } } return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix; }; var _applySVGOrigin = function _applySVGOrigin2(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) { var cache = target._gsap, matrix = matrixArray || _getMatrix(target, true), xOriginOld = cache.xOrigin || 0, yOriginOld = cache.yOrigin || 0, xOffsetOld = cache.xOffset || 0, yOffsetOld = cache.yOffset || 0, a = matrix[0], b = matrix[1], c = matrix[2], d = matrix[3], tx = matrix[4], ty = matrix[5], originSplit = origin.split(" "), xOrigin = parseFloat(originSplit[0]) || 0, yOrigin = parseFloat(originSplit[1]) || 0, bounds, determinant, x, y; if (!originIsAbsolute) { bounds = _getBBox(target); xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin); yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin); } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) { x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant; y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant; xOrigin = x; yOrigin = y; } if (smooth || smooth !== false && cache.smooth) { tx = xOrigin - xOriginOld; ty = yOrigin - yOriginOld; cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx; cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty; } else { cache.xOffset = cache.yOffset = 0; } cache.xOrigin = xOrigin; cache.yOrigin = yOrigin; cache.smooth = !!smooth; cache.origin = origin; cache.originIsAbsolute = !!originIsAbsolute; target.style[_transformOriginProp] = "0px 0px"; if (pluginToAddPropTweensTo) { _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin); _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin); _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset); _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset); } target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin); }; var _parseTransform = function _parseTransform2(target, uncache) { var cache = target._gsap || new GSCache(target); if ("x" in cache && !uncache && !cache.uncache) { return cache; } var style = target.style, invertedScaleX = cache.scaleX < 0, px = "px", deg = "deg", cs = getComputedStyle(target), origin = _getComputedProperty(target, _transformOriginProp) || "0", x, y, z, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY, perspective, xOrigin, yOrigin, matrix, angle, cos, sin, a, b, c, d, a12, a22, t1, t2, t3, a13, a23, a33, a42, a43, a32; x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0; scaleX = scaleY = 1; cache.svg = !!(target.getCTM && _isSVG(target)); if (cs.translate) { if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") { style[_transformProp] = (cs.translate !== "none" ? "translate3d(" + (cs.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (cs.rotate !== "none" ? "rotate(" + cs.rotate + ") " : "") + (cs.scale !== "none" ? "scale(" + cs.scale.split(" ").join(",") + ") " : "") + (cs[_transformProp] !== "none" ? cs[_transformProp] : ""); } style.scale = style.rotate = style.translate = "none"; } matrix = _getMatrix(target, cache.svg); if (cache.svg) { if (cache.uncache) { t2 = target.getBBox(); origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px"; t1 = ""; } else { t1 = !uncache && target.getAttribute("data-svg-origin"); } _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix); } xOrigin = cache.xOrigin || 0; yOrigin = cache.yOrigin || 0; if (matrix !== _identity2DMatrix) { a = matrix[0]; b = matrix[1]; c = matrix[2]; d = matrix[3]; x = a12 = matrix[4]; y = a22 = matrix[5]; if (matrix.length === 6) { scaleX = Math.sqrt(a * a + b * b); scaleY = Math.sqrt(d * d + c * c); rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0; skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD))); if (cache.svg) { x -= xOrigin - (xOrigin * a + yOrigin * c); y -= yOrigin - (xOrigin * b + yOrigin * d); } } else { a32 = matrix[6]; a42 = matrix[7]; a13 = matrix[8]; a23 = matrix[9]; a33 = matrix[10]; a43 = matrix[11]; x = matrix[12]; y = matrix[13]; z = matrix[14]; angle = _atan2(a32, a33); rotationX = angle * _RAD2DEG; if (angle) { cos = Math.cos(-angle); sin = Math.sin(-angle); t1 = a12 * cos + a13 * sin; t2 = a22 * cos + a23 * sin; t3 = a32 * cos + a33 * sin; a13 = a12 * -sin + a13 * cos; a23 = a22 * -sin + a23 * cos; a33 = a32 * -sin + a33 * cos; a43 = a42 * -sin + a43 * cos; a12 = t1; a22 = t2; a32 = t3; } angle = _atan2(-c, a33); rotationY = angle * _RAD2DEG; if (angle) { cos = Math.cos(-angle); sin = Math.sin(-angle); t1 = a * cos - a13 * sin; t2 = b * cos - a23 * sin; t3 = c * cos - a33 * sin; a43 = d * sin + a43 * cos; a = t1; b = t2; c = t3; } angle = _atan2(b, a); rotation = angle * _RAD2DEG; if (angle) { cos = Math.cos(angle); sin = Math.sin(angle); t1 = a * cos + b * sin; t2 = a12 * cos + a22 * sin; b = b * cos - a * sin; a22 = a22 * cos - a12 * sin; a = t1; a12 = t2; } if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) { rotationX = rotation = 0; rotationY = 180 - rotationY; } scaleX = _round(Math.sqrt(a * a + b * b + c * c)); scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32)); angle = _atan2(a12, a22); skewX = Math.abs(angle) > 0.0002 ? angle * _RAD2DEG : 0; perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0; } if (cache.svg) { t1 = target.getAttribute("transform"); cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp)); t1 && target.setAttribute("transform", t1); } } if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { if (invertedScaleX) { scaleX *= -1; skewX += rotation <= 0 ? 180 : -180; rotation += rotation <= 0 ? 180 : -180; } else { scaleY *= -1; skewX += skewX <= 0 ? 180 : -180; } } uncache = uncache || cache.uncache; cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px; cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px; cache.z = z + px; cache.scaleX = _round(scaleX); cache.scaleY = _round(scaleY); cache.rotation = _round(rotation) + deg; cache.rotationX = _round(rotationX) + deg; cache.rotationY = _round(rotationY) + deg; cache.skewX = skewX + deg; cache.skewY = skewY + deg; cache.transformPerspective = perspective + px; if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || !uncache && cache.zOrigin || 0) { style[_transformOriginProp] = _firstTwoOnly(origin); } cache.xOffset = cache.yOffset = 0; cache.force3D = _config.force3D; cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms; cache.uncache = 0; return cache; }; var _firstTwoOnly = function _firstTwoOnly2(value) { return (value = value.split(" "))[0] + " " + value[1]; }; var _addPxTranslate = function _addPxTranslate2(target, start, value) { var unit = getUnit(start); return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit; }; var _renderNon3DTransforms = function _renderNon3DTransforms2(ratio, cache) { cache.z = "0px"; cache.rotationY = cache.rotationX = "0deg"; cache.force3D = 0; _renderCSSTransforms(ratio, cache); }; var _zeroDeg = "0deg"; var _zeroPx = "0px"; var _endParenthesis = ") "; var _renderCSSTransforms = function _renderCSSTransforms2(ratio, cache) { var _ref = cache || this, xPercent = _ref.xPercent, yPercent = _ref.yPercent, x = _ref.x, y = _ref.y, z = _ref.z, rotation = _ref.rotation, rotationY = _ref.rotationY, rotationX = _ref.rotationX, skewX = _ref.skewX, skewY = _ref.skewY, scaleX = _ref.scaleX, scaleY = _ref.scaleY, transformPerspective = _ref.transformPerspective, force3D = _ref.force3D, target = _ref.target, zOrigin = _ref.zOrigin, transforms = "", use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true; if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) { var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos; angle = parseFloat(rotationX) * _DEG2RAD; cos = Math.cos(angle); x = _addPxTranslate(target, x, a13 * cos * -zOrigin); y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin); z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin); } if (transformPerspective !== _zeroPx) { transforms += "perspective(" + transformPerspective + _endParenthesis; } if (xPercent || yPercent) { transforms += "translate(" + xPercent + "%, " + yPercent + "%) "; } if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) { transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis; } if (rotation !== _zeroDeg) { transforms += "rotate(" + rotation + _endParenthesis; } if (rotationY !== _zeroDeg) { transforms += "rotateY(" + rotationY + _endParenthesis; } if (rotationX !== _zeroDeg) { transforms += "rotateX(" + rotationX + _endParenthesis; } if (skewX !== _zeroDeg || skewY !== _zeroDeg) { transforms += "skew(" + skewX + ", " + skewY + _endParenthesis; } if (scaleX !== 1 || scaleY !== 1) { transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis; } target.style[_transformProp] = transforms || "translate(0, 0)"; }; var _renderSVGTransforms = function _renderSVGTransforms2(ratio, cache) { var _ref2 = cache || this, xPercent = _ref2.xPercent, yPercent = _ref2.yPercent, x = _ref2.x, y = _ref2.y, rotation = _ref2.rotation, skewX = _ref2.skewX, skewY = _ref2.skewY, scaleX = _ref2.scaleX, scaleY = _ref2.scaleY, target = _ref2.target, xOrigin = _ref2.xOrigin, yOrigin = _ref2.yOrigin, xOffset = _ref2.xOffset, yOffset = _ref2.yOffset, forceCSS = _ref2.forceCSS, tx = parseFloat(x), ty = parseFloat(y), a11, a21, a12, a22, temp; rotation = parseFloat(rotation); skewX = parseFloat(skewX); skewY = parseFloat(skewY); if (skewY) { skewY = parseFloat(skewY); skewX += skewY; rotation += skewY; } if (rotation || skewX) { rotation *= _DEG2RAD; skewX *= _DEG2RAD; a11 = Math.cos(rotation) * scaleX; a21 = Math.sin(rotation) * scaleX; a12 = Math.sin(rotation - skewX) * -scaleY; a22 = Math.cos(rotation - skewX) * scaleY; if (skewX) { skewY *= _DEG2RAD; temp = Math.tan(skewX - skewY); temp = Math.sqrt(1 + temp * temp); a12 *= temp; a22 *= temp; if (skewY) { temp = Math.tan(skewY); temp = Math.sqrt(1 + temp * temp); a11 *= temp; a21 *= temp; } } a11 = _round(a11); a21 = _round(a21); a12 = _round(a12); a22 = _round(a22); } else { a11 = scaleX; a22 = scaleY; a21 = a12 = 0; } if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) { tx = _convertToUnit(target, "x", x, "px"); ty = _convertToUnit(target, "y", y, "px"); } if (xOrigin || yOrigin || xOffset || yOffset) { tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset); ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset); } if (xPercent || yPercent) { temp = target.getBBox(); tx = _round(tx + xPercent / 100 * temp.width); ty = _round(ty + yPercent / 100 * temp.height); } temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")"; target.setAttribute("transform", temp); forceCSS && (target.style[_transformProp] = temp); }; var _addRotationalPropTween = function _addRotationalPropTween2(plugin, target, property, startNum, endValue) { var cap = 360, isString = _isString(endValue), endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), change = endNum - startNum, finalValue = startNum + change + "deg", direction, pt; if (isString) { direction = endValue.split("_")[1]; if (direction === "short") { change %= cap; if (change !== change % (cap / 2)) { change += change < 0 ? cap : -cap; } } if (direction === "cw" && change < 0) { change = (change + cap * _bigNum2) % cap - ~~(change / cap) * cap; } else if (direction === "ccw" && change > 0) { change = (change - cap * _bigNum2) % cap - ~~(change / cap) * cap; } } plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd); pt.e = finalValue; pt.u = "deg"; plugin._props.push(property); return pt; }; var _assign = function _assign2(target, source) { for (var p in source) { target[p] = source[p]; } return target; }; var _addRawTransformPTs = function _addRawTransformPTs2(plugin, transforms, target) { var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit; if (startCache.svg) { startValue = target.getAttribute("transform"); target.setAttribute("transform", ""); style[_transformProp] = transforms; endCache = _parseTransform(target, 1); _removeProperty(target, _transformProp); target.setAttribute("transform", startValue); } else { startValue = getComputedStyle(target)[_transformProp]; style[_transformProp] = transforms; endCache = _parseTransform(target, 1); style[_transformProp] = startValue; } for (p in _transformProps) { startValue = startCache[p]; endValue = endCache[p]; if (startValue !== endValue && exclude.indexOf(p) < 0) { startUnit = getUnit(startValue); endUnit = getUnit(endValue); startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue); endNum = parseFloat(endValue); plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp); plugin._pt.u = endUnit || 0; plugin._props.push(p); } } _assign(endCache, startCache); }; _forEachName("padding,margin,Width,Radius", function(name, index) { var t = "Top", r = "Right", b = "Bottom", l = "Left", props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function(side) { return index < 2 ? name + side : "border" + side + name; }); _specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) { var a, vars; if (arguments.length < 4) { a = props.map(function(prop) { return _get(plugin, prop, property); }); vars = a.join(" "); return vars.split(a[0]).length === 5 ? a[0] : vars; } a = (endValue + "").split(" "); vars = {}; props.forEach(function(prop, i) { return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0]; }); plugin.init(target, vars, tween); }; }); var CSSPlugin = { name: "css", register: _initCore, targetTest: function targetTest(target) { return target.style && target.nodeType; }, init: function init3(target, vars, tween, index, targets) { var props = this._props, style = target.style, startAt = tween.vars.startAt, startValue, endValue, endNum, startNum, type, specialProp, p, startUnit, endUnit, relative, isTransformRelated, transformPropTween, cache, smooth, hasPriority, inlineProps, finalTransformValue; _pluginInitted || _initCore(); this.styles = this.styles || _getStyleSaver(target); inlineProps = this.styles.props; this.tween = tween; for (p in vars) { if (p === "autoRound") { continue; } endValue = vars[p]; if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) { continue; } type = typeof endValue; specialProp = _specialProps[p]; if (type === "function") { endValue = endValue.call(tween, index, target, targets); type = typeof endValue; } if (type === "string" && ~endValue.indexOf("random(")) { endValue = _replaceRandom(endValue); } if (specialProp) { specialProp(this, target, p, endValue, tween) && (hasPriority = 1); } else if (p.substr(0, 2) === "--") { startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim(); endValue += ""; _colorExp.lastIndex = 0; if (!_colorExp.test(startValue)) { startUnit = getUnit(startValue); endUnit = getUnit(endValue); endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit); } this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p); props.push(p); inlineProps.push(p, 0, style[p]); } else if (type !== "undefined") { if (startAt && p in startAt) { startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p]; _isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue)); getUnit(startValue + "") || startValue === "auto" || (startValue += _config.units[p] || getUnit(_get(target, p)) || ""); (startValue + "").charAt(1) === "=" && (startValue = _get(target, p)); } else { startValue = _get(target, p); } startNum = parseFloat(startValue); relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2); relative && (endValue = endValue.substr(2)); endNum = parseFloat(endValue); if (p in _propertyAliases) { if (p === "autoAlpha") { if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) { startNum = 0; } inlineProps.push("visibility", 0, style.visibility); _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum); } if (p !== "scale" && p !== "transform") { p = _propertyAliases[p]; ~p.indexOf(",") && (p = p.split(",")[0]); } } isTransformRelated = p in _transformProps; if (isTransformRelated) { this.styles.save(p); finalTransformValue = endValue; if (type === "string" && endValue.substring(0, 6) === "var(--") { endValue = _getComputedProperty(target, endValue.substring(4, endValue.indexOf(")"))); if (endValue.substring(0, 5) === "calc(") { var origPerspective = target.style.perspective; target.style.perspective = endValue; endValue = _getComputedProperty(target, "perspective"); origPerspective ? target.style.perspective = origPerspective : _removeProperty(target, "perspective"); } endNum = parseFloat(endValue); } if (!transformPropTween) { cache = target._gsap; cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); smooth = vars.smoothOrigin !== false && cache.smooth; transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); transformPropTween.dep = 1; } if (p === "scale") { this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp); this._pt.u = 0; props.push("scaleY", p); p += "X"; } else if (p === "transformOrigin") { inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]); endValue = _convertKeywordsToPercentages(endValue); if (cache.svg) { _applySVGOrigin(target, endValue, 0, smooth, 0, this); } else { endUnit = parseFloat(endValue.split(" ")[2]) || 0; endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit); _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue)); } continue; } else if (p === "svgOrigin") { _applySVGOrigin(target, endValue, 1, smooth, 0, this); continue; } else if (p in _rotationalProperties) { _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue); continue; } else if (p === "smoothOrigin") { _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue); continue; } else if (p === "force3D") { cache[p] = endValue; continue; } else if (p === "transform") { _addRawTransformPTs(this, endValue, target); continue; } } else if (!(p in style)) { p = _checkPropPrefix(p) || p; } if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) { startUnit = (startValue + "").substr((startNum + "").length); endNum || (endNum = 0); endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit); startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit)); this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === "px" || p === "zIndex") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp); this._pt.u = endUnit || 0; if (isTransformRelated && finalTransformValue !== endValue) { this._pt.b = startValue; this._pt.e = finalTransformValue; this._pt.r = _renderCSSPropWithBeginningAndEnd; } else if (startUnit !== endUnit && endUnit !== "%") { this._pt.b = startValue; this._pt.r = _renderCSSPropWithBeginning; } } else if (!(p in style)) { if (p in target) { this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets); } else if (p !== "parseTransform") { _missingPlugin(p, endValue); continue; } } else { _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue); } isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : typeof target[p] === "function" ? inlineProps.push(p, 2, target[p]()) : inlineProps.push(p, 1, startValue || target[p])); props.push(p); } } hasPriority && _sortPropTweensByPriority(this); }, render: function render2(ratio, data) { if (data.tween._time || !_reverting2()) { var pt = data._pt; while (pt) { pt.r(ratio, pt.d); pt = pt._next; } } else { data.styles.revert(); } }, get: _get, aliases: _propertyAliases, getSetter: function getSetter(target, property, plugin) { var p = _propertyAliases[property]; p && p.indexOf(",") < 0 && (property = p); return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, "x")) ? plugin && _recentSetterPlugin === plugin ? property === "scale" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === "scale" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf("-") ? _setterCSSProp : _getSetter(target, property); }, core: { _removeProperty, _getMatrix } }; gsap.utils.checkPrefix = _checkPropPrefix; gsap.core.getStyleSaver = _getStyleSaver; (function(positionAndScale, rotation, others, aliases) { var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) { _transformProps[name] = 1; }); _forEachName(rotation, function(name) { _config.units[name] = "deg"; _rotationalProperties[name] = 1; }); _propertyAliases[all[13]] = positionAndScale + "," + rotation; _forEachName(aliases, function(name) { var split = name.split(":"); _propertyAliases[split[1]] = all[split[0]]; }); })("x,y,z,scale,scaleX,scaleY,xPercent,yPercent", "rotation,rotationX,rotationY,skewX,skewY", "transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective", "0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"); _forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) { _config.units[name] = "px"; }); gsap.registerPlugin(CSSPlugin); // node_modules/gsap/index.js var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap; var TweenMaxWithCSS = gsapWithCSS.core.Tween; // node_modules/gsap/Observer.js function _defineProperties(target, props) { for (var i = 0;i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /*! * Observer 3.14.2 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var gsap2; var _coreInitted2; var _clamp3; var _win3; var _doc3; var _docEl; var _body; var _isTouch; var _pointerType; var ScrollTrigger2; var _root; var _normalizer; var _eventTypes; var _context2; var _getGSAP = function _getGSAP2() { return gsap2 || typeof window !== "undefined" && (gsap2 = window.gsap) && gsap2.registerPlugin && gsap2; }; var _startup = 1; var _observers = []; var _scrollers = []; var _proxies = []; var _getTime = Date.now; var _bridge = function _bridge2(name, value) { return value; }; var _integrate = function _integrate2() { var core = ScrollTrigger2.core, data = core.bridge || {}, scrollers = core._scrollers, proxies = core._proxies; scrollers.push.apply(scrollers, _scrollers); proxies.push.apply(proxies, _proxies); _scrollers = scrollers; _proxies = proxies; _bridge = function _bridge(name, value) { return data[name](value); }; }; var _getProxyProp = function _getProxyProp2(element, property) { return ~_proxies.indexOf(element) && _proxies[_proxies.indexOf(element) + 1][property]; }; var _isViewport = function _isViewport2(el) { return !!~_root.indexOf(el); }; var _addListener = function _addListener2(element, type, func, passive, capture) { return element.addEventListener(type, func, { passive: passive !== false, capture: !!capture }); }; var _removeListener = function _removeListener2(element, type, func, capture) { return element.removeEventListener(type, func, !!capture); }; var _scrollLeft = "scrollLeft"; var _scrollTop = "scrollTop"; var _onScroll = function _onScroll2() { return _normalizer && _normalizer.isPressed || _scrollers.cache++; }; var _scrollCacheFunc = function _scrollCacheFunc2(f, doNotCache) { var cachingFunc = function cachingFunc(value) { if (value || value === 0) { _startup && (_win3.history.scrollRestoration = "manual"); var isNormalizing = _normalizer && _normalizer.isPressed; value = cachingFunc.v = Math.round(value) || (_normalizer && _normalizer.iOS ? 1 : 0); f(value); cachingFunc.cacheID = _scrollers.cache; isNormalizing && _bridge("ss", value); } else if (doNotCache || _scrollers.cache !== cachingFunc.cacheID || _bridge("ref")) { cachingFunc.cacheID = _scrollers.cache; cachingFunc.v = f(); } return cachingFunc.v + cachingFunc.offset; }; cachingFunc.offset = 0; return f && cachingFunc; }; var _horizontal = { s: _scrollLeft, p: "left", p2: "Left", os: "right", os2: "Right", d: "width", d2: "Width", a: "x", sc: _scrollCacheFunc(function(value) { return arguments.length ? _win3.scrollTo(value, _vertical.sc()) : _win3.pageXOffset || _doc3[_scrollLeft] || _docEl[_scrollLeft] || _body[_scrollLeft] || 0; }) }; var _vertical = { s: _scrollTop, p: "top", p2: "Top", os: "bottom", os2: "Bottom", d: "height", d2: "Height", a: "y", op: _horizontal, sc: _scrollCacheFunc(function(value) { return arguments.length ? _win3.scrollTo(_horizontal.sc(), value) : _win3.pageYOffset || _doc3[_scrollTop] || _docEl[_scrollTop] || _body[_scrollTop] || 0; }) }; var _getTarget = function _getTarget2(t, self2) { return (self2 && self2._ctx && self2._ctx.selector || gsap2.utils.toArray)(t)[0] || (typeof t === "string" && gsap2.config().nullTargetWarn !== false ? console.warn("Element not found:", t) : null); }; var _isWithin = function _isWithin2(element, list) { var i = list.length; while (i--) { if (list[i] === element || list[i].contains(element)) { return true; } } return false; }; var _getScrollFunc = function _getScrollFunc2(element, _ref) { var { s, sc } = _ref; _isViewport(element) && (element = _doc3.scrollingElement || _docEl); var i = _scrollers.indexOf(element), offset = sc === _vertical.sc ? 1 : 2; !~i && (i = _scrollers.push(element) - 1); _scrollers[i + offset] || _addListener(element, "scroll", _onScroll); var prev = _scrollers[i + offset], func = prev || (_scrollers[i + offset] = _scrollCacheFunc(_getProxyProp(element, s), true) || (_isViewport(element) ? sc : _scrollCacheFunc(function(value) { return arguments.length ? element[s] = value : element[s]; }))); func.target = element; prev || (func.smooth = gsap2.getProperty(element, "scrollBehavior") === "smooth"); return func; }; var _getVelocityProp = function _getVelocityProp2(value, minTimeRefresh, useDelta) { var v1 = value, v2 = value, t1 = _getTime(), t2 = t1, min = minTimeRefresh || 50, dropToZeroTime = Math.max(500, min * 3), update = function update(value2, force) { var t = _getTime(); if (force || t - t1 > min) { v2 = v1; v1 = value2; t2 = t1; t1 = t; } else if (useDelta) { v1 += value2; } else { v1 = v2 + (value2 - v2) / (t - t2) * (t1 - t2); } }, reset = function reset() { v2 = v1 = useDelta ? 0 : v1; t2 = t1 = 0; }, getVelocity = function getVelocity(latestValue) { var tOld = t2, vOld = v2, t = _getTime(); (latestValue || latestValue === 0) && latestValue !== v1 && update(latestValue); return t1 === t2 || t - t2 > dropToZeroTime ? 0 : (v1 + (useDelta ? vOld : -vOld)) / ((useDelta ? t : t1) - tOld) * 1000; }; return { update, reset, getVelocity }; }; var _getEvent = function _getEvent2(e, preventDefault) { preventDefault && !e._gsapAllow && e.preventDefault(); return e.changedTouches ? e.changedTouches[0] : e; }; var _getAbsoluteMax = function _getAbsoluteMax2(a) { var max = Math.max.apply(Math, a), min = Math.min.apply(Math, a); return Math.abs(max) >= Math.abs(min) ? max : min; }; var _setScrollTrigger = function _setScrollTrigger2() { ScrollTrigger2 = gsap2.core.globals().ScrollTrigger; ScrollTrigger2 && ScrollTrigger2.core && _integrate(); }; var _initCore3 = function _initCore4(core) { gsap2 = core || _getGSAP(); if (!_coreInitted2 && gsap2 && typeof document !== "undefined" && document.body) { _win3 = window; _doc3 = document; _docEl = _doc3.documentElement; _body = _doc3.body; _root = [_win3, _doc3, _docEl, _body]; _clamp3 = gsap2.utils.clamp; _context2 = gsap2.core.context || function() { }; _pointerType = "onpointerenter" in _body ? "pointer" : "mouse"; _isTouch = Observer.isTouch = _win3.matchMedia && _win3.matchMedia("(hover: none), (pointer: coarse)").matches ? 1 : ("ontouchstart" in _win3) || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ? 2 : 0; _eventTypes = Observer.eventTypes = ("ontouchstart" in _docEl ? "touchstart,touchmove,touchcancel,touchend" : !("onpointerdown" in _docEl) ? "mousedown,mousemove,mouseup,mouseup" : "pointerdown,pointermove,pointercancel,pointerup").split(","); setTimeout(function() { return _startup = 0; }, 500); _setScrollTrigger(); _coreInitted2 = 1; } return _coreInitted2; }; _horizontal.op = _vertical; _scrollers.cache = 0; var Observer = /* @__PURE__ */ function() { function Observer2(vars) { this.init(vars); } var _proto = Observer2.prototype; _proto.init = function init(vars) { _coreInitted2 || _initCore3(gsap2) || console.warn("Please gsap.registerPlugin(Observer)"); ScrollTrigger2 || _setScrollTrigger(); var { tolerance, dragMinimum, type, target, lineHeight, debounce: debounce2, preventDefault, onStop, onStopDelay, ignore, wheelSpeed, event, onDragStart, onDragEnd, onDrag, onPress, onRelease, onRight, onLeft, onUp, onDown, onChangeX, onChangeY, onChange, onToggleX, onToggleY, onHover, onHoverEnd, onMove, ignoreCheck, isNormalizer, onGestureStart, onGestureEnd, onWheel, onEnable, onDisable, onClick, scrollSpeed, capture, allowClicks, lockAxis, onLockAxis } = vars; this.target = target = _getTarget(target) || _docEl; this.vars = vars; ignore && (ignore = gsap2.utils.toArray(ignore)); tolerance = tolerance || 0.000000001; dragMinimum = dragMinimum || 0; wheelSpeed = wheelSpeed || 1; scrollSpeed = scrollSpeed || 1; type = type || "wheel,touch,pointer"; debounce2 = debounce2 !== false; lineHeight || (lineHeight = parseFloat(_win3.getComputedStyle(_body).lineHeight) || 22); var id, onStopDelayedCall, dragged, moved, wheeled, locked, axis, self2 = this, prevDeltaX = 0, prevDeltaY = 0, passive = vars.passive || !preventDefault && vars.passive !== false, scrollFuncX = _getScrollFunc(target, _horizontal), scrollFuncY = _getScrollFunc(target, _vertical), scrollX = scrollFuncX(), scrollY = scrollFuncY(), limitToTouch = ~type.indexOf("touch") && !~type.indexOf("pointer") && _eventTypes[0] === "pointerdown", isViewport = _isViewport(target), ownerDoc = target.ownerDocument || _doc3, deltaX = [0, 0, 0], deltaY = [0, 0, 0], onClickTime = 0, clickCapture = function clickCapture() { return onClickTime = _getTime(); }, _ignoreCheck = function _ignoreCheck(e, isPointerOrTouch) { return (self2.event = e) && ignore && _isWithin(e.target, ignore) || isPointerOrTouch && limitToTouch && e.pointerType !== "touch" || ignoreCheck && ignoreCheck(e, isPointerOrTouch); }, onStopFunc = function onStopFunc() { self2._vx.reset(); self2._vy.reset(); onStopDelayedCall.pause(); onStop && onStop(self2); }, update = function update() { var dx = self2.deltaX = _getAbsoluteMax(deltaX), dy = self2.deltaY = _getAbsoluteMax(deltaY), changedX = Math.abs(dx) >= tolerance, changedY = Math.abs(dy) >= tolerance; onChange && (changedX || changedY) && onChange(self2, dx, dy, deltaX, deltaY); if (changedX) { onRight && self2.deltaX > 0 && onRight(self2); onLeft && self2.deltaX < 0 && onLeft(self2); onChangeX && onChangeX(self2); onToggleX && self2.deltaX < 0 !== prevDeltaX < 0 && onToggleX(self2); prevDeltaX = self2.deltaX; deltaX[0] = deltaX[1] = deltaX[2] = 0; } if (changedY) { onDown && self2.deltaY > 0 && onDown(self2); onUp && self2.deltaY < 0 && onUp(self2); onChangeY && onChangeY(self2); onToggleY && self2.deltaY < 0 !== prevDeltaY < 0 && onToggleY(self2); prevDeltaY = self2.deltaY; deltaY[0] = deltaY[1] = deltaY[2] = 0; } if (moved || dragged) { onMove && onMove(self2); if (dragged) { onDragStart && dragged === 1 && onDragStart(self2); onDrag && onDrag(self2); dragged = 0; } moved = false; } locked && !(locked = false) && onLockAxis && onLockAxis(self2); if (wheeled) { onWheel(self2); wheeled = false; } id = 0; }, onDelta = function onDelta(x, y, index) { deltaX[index] += x; deltaY[index] += y; self2._vx.update(x); self2._vy.update(y); debounce2 ? id || (id = requestAnimationFrame(update)) : update(); }, onTouchOrPointerDelta = function onTouchOrPointerDelta(x, y) { if (lockAxis && !axis) { self2.axis = axis = Math.abs(x) > Math.abs(y) ? "x" : "y"; locked = true; } if (axis !== "y") { deltaX[2] += x; self2._vx.update(x, true); } if (axis !== "x") { deltaY[2] += y; self2._vy.update(y, true); } debounce2 ? id || (id = requestAnimationFrame(update)) : update(); }, _onDrag = function _onDrag(e) { if (_ignoreCheck(e, 1)) { return; } e = _getEvent(e, preventDefault); var { clientX: x, clientY: y } = e, dx = x - self2.x, dy = y - self2.y, isDragging = self2.isDragging; self2.x = x; self2.y = y; if (isDragging || (dx || dy) && (Math.abs(self2.startX - x) >= dragMinimum || Math.abs(self2.startY - y) >= dragMinimum)) { dragged || (dragged = isDragging ? 2 : 1); isDragging || (self2.isDragging = true); onTouchOrPointerDelta(dx, dy); } }, _onPress = self2.onPress = function(e) { if (_ignoreCheck(e, 1) || e && e.button) { return; } self2.axis = axis = null; onStopDelayedCall.pause(); self2.isPressed = true; e = _getEvent(e); prevDeltaX = prevDeltaY = 0; self2.startX = self2.x = e.clientX; self2.startY = self2.y = e.clientY; self2._vx.reset(); self2._vy.reset(); _addListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, passive, true); self2.deltaX = self2.deltaY = 0; onPress && onPress(self2); }, _onRelease = self2.onRelease = function(e) { if (_ignoreCheck(e, 1)) { return; } _removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true); var isTrackingDrag = !isNaN(self2.y - self2.startY), wasDragging = self2.isDragging, isDragNotClick = wasDragging && (Math.abs(self2.x - self2.startX) > 3 || Math.abs(self2.y - self2.startY) > 3), eventData = _getEvent(e); if (!isDragNotClick && isTrackingDrag) { self2._vx.reset(); self2._vy.reset(); if (preventDefault && allowClicks) { gsap2.delayedCall(0.08, function() { if (_getTime() - onClickTime > 300 && !e.defaultPrevented) { if (e.target.click) { e.target.click(); } else if (ownerDoc.createEvent) { var syntheticEvent = ownerDoc.createEvent("MouseEvents"); syntheticEvent.initMouseEvent("click", true, true, _win3, 1, eventData.screenX, eventData.screenY, eventData.clientX, eventData.clientY, false, false, false, false, 0, null); e.target.dispatchEvent(syntheticEvent); } } }); } } self2.isDragging = self2.isGesturing = self2.isPressed = false; onStop && wasDragging && !isNormalizer && onStopDelayedCall.restart(true); dragged && update(); onDragEnd && wasDragging && onDragEnd(self2); onRelease && onRelease(self2, isDragNotClick); }, _onGestureStart = function _onGestureStart(e) { return e.touches && e.touches.length > 1 && (self2.isGesturing = true) && onGestureStart(e, self2.isDragging); }, _onGestureEnd = function _onGestureEnd() { return (self2.isGesturing = false) || onGestureEnd(self2); }, onScroll = function onScroll(e) { if (_ignoreCheck(e)) { return; } var x = scrollFuncX(), y = scrollFuncY(); onDelta((x - scrollX) * scrollSpeed, (y - scrollY) * scrollSpeed, 1); scrollX = x; scrollY = y; onStop && onStopDelayedCall.restart(true); }, _onWheel = function _onWheel(e) { if (_ignoreCheck(e)) { return; } e = _getEvent(e, preventDefault); onWheel && (wheeled = true); var multiplier = (e.deltaMode === 1 ? lineHeight : e.deltaMode === 2 ? _win3.innerHeight : 1) * wheelSpeed; onDelta(e.deltaX * multiplier, e.deltaY * multiplier, 0); onStop && !isNormalizer && onStopDelayedCall.restart(true); }, _onMove = function _onMove(e) { if (_ignoreCheck(e)) { return; } var { clientX: x, clientY: y } = e, dx = x - self2.x, dy = y - self2.y; self2.x = x; self2.y = y; moved = true; onStop && onStopDelayedCall.restart(true); (dx || dy) && onTouchOrPointerDelta(dx, dy); }, _onHover = function _onHover(e) { self2.event = e; onHover(self2); }, _onHoverEnd = function _onHoverEnd(e) { self2.event = e; onHoverEnd(self2); }, _onClick = function _onClick(e) { return _ignoreCheck(e) || _getEvent(e, preventDefault) && onClick(self2); }; onStopDelayedCall = self2._dc = gsap2.delayedCall(onStopDelay || 0.25, onStopFunc).pause(); self2.deltaX = self2.deltaY = 0; self2._vx = _getVelocityProp(0, 50, true); self2._vy = _getVelocityProp(0, 50, true); self2.scrollX = scrollFuncX; self2.scrollY = scrollFuncY; self2.isDragging = self2.isGesturing = self2.isPressed = false; _context2(this); self2.enable = function(e) { if (!self2.isEnabled) { _addListener(isViewport ? ownerDoc : target, "scroll", _onScroll); type.indexOf("scroll") >= 0 && _addListener(isViewport ? ownerDoc : target, "scroll", onScroll, passive, capture); type.indexOf("wheel") >= 0 && _addListener(target, "wheel", _onWheel, passive, capture); if (type.indexOf("touch") >= 0 && _isTouch || type.indexOf("pointer") >= 0) { _addListener(target, _eventTypes[0], _onPress, passive, capture); _addListener(ownerDoc, _eventTypes[2], _onRelease); _addListener(ownerDoc, _eventTypes[3], _onRelease); allowClicks && _addListener(target, "click", clickCapture, true, true); onClick && _addListener(target, "click", _onClick); onGestureStart && _addListener(ownerDoc, "gesturestart", _onGestureStart); onGestureEnd && _addListener(ownerDoc, "gestureend", _onGestureEnd); onHover && _addListener(target, _pointerType + "enter", _onHover); onHoverEnd && _addListener(target, _pointerType + "leave", _onHoverEnd); onMove && _addListener(target, _pointerType + "move", _onMove); } self2.isEnabled = true; self2.isDragging = self2.isGesturing = self2.isPressed = moved = dragged = false; self2._vx.reset(); self2._vy.reset(); scrollX = scrollFuncX(); scrollY = scrollFuncY(); e && e.type && _onPress(e); onEnable && onEnable(self2); } return self2; }; self2.disable = function() { if (self2.isEnabled) { _observers.filter(function(o) { return o !== self2 && _isViewport(o.target); }).length || _removeListener(isViewport ? ownerDoc : target, "scroll", _onScroll); if (self2.isPressed) { self2._vx.reset(); self2._vy.reset(); _removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true); } _removeListener(isViewport ? ownerDoc : target, "scroll", onScroll, capture); _removeListener(target, "wheel", _onWheel, capture); _removeListener(target, _eventTypes[0], _onPress, capture); _removeListener(ownerDoc, _eventTypes[2], _onRelease); _removeListener(ownerDoc, _eventTypes[3], _onRelease); _removeListener(target, "click", clickCapture, true); _removeListener(target, "click", _onClick); _removeListener(ownerDoc, "gesturestart", _onGestureStart); _removeListener(ownerDoc, "gestureend", _onGestureEnd); _removeListener(target, _pointerType + "enter", _onHover); _removeListener(target, _pointerType + "leave", _onHoverEnd); _removeListener(target, _pointerType + "move", _onMove); self2.isEnabled = self2.isPressed = self2.isDragging = false; onDisable && onDisable(self2); } }; self2.kill = self2.revert = function() { self2.disable(); var i = _observers.indexOf(self2); i >= 0 && _observers.splice(i, 1); _normalizer === self2 && (_normalizer = 0); }; _observers.push(self2); isNormalizer && _isViewport(target) && (_normalizer = self2); self2.enable(event); }; _createClass(Observer2, [{ key: "velocityX", get: function get() { return this._vx.getVelocity(); } }, { key: "velocityY", get: function get() { return this._vy.getVelocity(); } }]); return Observer2; }(); Observer.version = "3.14.2"; Observer.create = function(vars) { return new Observer(vars); }; Observer.register = _initCore3; Observer.getAll = function() { return _observers.slice(); }; Observer.getById = function(id) { return _observers.filter(function(o) { return o.vars.id === id; })[0]; }; _getGSAP() && gsap2.registerPlugin(Observer); // node_modules/gsap/ScrollTrigger.js /*! * ScrollTrigger 3.14.2 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var gsap3; var _coreInitted3; var _win4; var _doc4; var _docEl2; var _body2; var _root2; var _resizeDelay; var _toArray; var _clamp4; var _time2; var _syncInterval; var _refreshing; var _pointerIsDown; var _transformProp2; var _i; var _prevWidth; var _prevHeight; var _autoRefresh; var _sort; var _suppressOverwrites2; var _ignoreResize; var _normalizer2; var _ignoreMobileResize; var _baseScreenHeight; var _baseScreenWidth; var _fixIOSBug; var _context3; var _scrollRestoration; var _div100vh; var _100vh; var _isReverted; var _clampingMax; var _limitCallbacks; var _startup2 = 1; var _getTime2 = Date.now; var _time1 = _getTime2(); var _lastScrollTime = 0; var _enabled = 0; var _parseClamp = function _parseClamp2(value, type, self2) { var clamp4 = _isString3(value) && (value.substr(0, 6) === "clamp(" || value.indexOf("max") > -1); self2["_" + type + "Clamp"] = clamp4; return clamp4 ? value.substr(6, value.length - 7) : value; }; var _keepClamp = function _keepClamp2(value, clamp4) { return clamp4 && (!_isString3(value) || value.substr(0, 6) !== "clamp(") ? "clamp(" + value + ")" : value; }; var _rafBugFix = function _rafBugFix2() { return _enabled && requestAnimationFrame(_rafBugFix2); }; var _pointerDownHandler = function _pointerDownHandler2() { return _pointerIsDown = 1; }; var _pointerUpHandler = function _pointerUpHandler2() { return _pointerIsDown = 0; }; var _passThrough3 = function _passThrough4(v) { return v; }; var _round3 = function _round4(value) { return Math.round(value * 1e5) / 1e5 || 0; }; var _windowExists5 = function _windowExists6() { return typeof window !== "undefined"; }; var _getGSAP3 = function _getGSAP4() { return gsap3 || _windowExists5() && (gsap3 = window.gsap) && gsap3.registerPlugin && gsap3; }; var _isViewport3 = function _isViewport4(e) { return !!~_root2.indexOf(e); }; var _getViewportDimension = function _getViewportDimension2(dimensionProperty) { return (dimensionProperty === "Height" ? _100vh : _win4["inner" + dimensionProperty]) || _docEl2["client" + dimensionProperty] || _body2["client" + dimensionProperty]; }; var _getBoundsFunc = function _getBoundsFunc2(element) { return _getProxyProp(element, "getBoundingClientRect") || (_isViewport3(element) ? function() { _winOffsets.width = _win4.innerWidth; _winOffsets.height = _100vh; return _winOffsets; } : function() { return _getBounds(element); }); }; var _getSizeFunc = function _getSizeFunc2(scroller, isViewport, _ref) { var { d, d2, a } = _ref; return (a = _getProxyProp(scroller, "getBoundingClientRect")) ? function() { return a()[d]; } : function() { return (isViewport ? _getViewportDimension(d2) : scroller["client" + d2]) || 0; }; }; var _getOffsetsFunc = function _getOffsetsFunc2(element, isViewport) { return !isViewport || ~_proxies.indexOf(element) ? _getBoundsFunc(element) : function() { return _winOffsets; }; }; var _maxScroll = function _maxScroll2(element, _ref2) { var { s, d2, d, a } = _ref2; return Math.max(0, (s = "scroll" + d2) && (a = _getProxyProp(element, s)) ? a() - _getBoundsFunc(element)()[d] : _isViewport3(element) ? (_docEl2[s] || _body2[s]) - _getViewportDimension(d2) : element[s] - element["offset" + d2]); }; var _iterateAutoRefresh = function _iterateAutoRefresh2(func, events) { for (var i = 0;i < _autoRefresh.length; i += 3) { (!events || ~events.indexOf(_autoRefresh[i + 1])) && func(_autoRefresh[i], _autoRefresh[i + 1], _autoRefresh[i + 2]); } }; var _isString3 = function _isString4(value) { return typeof value === "string"; }; var _isFunction3 = function _isFunction4(value) { return typeof value === "function"; }; var _isNumber3 = function _isNumber4(value) { return typeof value === "number"; }; var _isObject3 = function _isObject4(value) { return typeof value === "object"; }; var _endAnimation = function _endAnimation2(animation, reversed, pause) { return animation && animation.progress(reversed ? 0 : 1) && pause && animation.pause(); }; var _callback3 = function _callback4(self2, func) { if (self2.enabled) { var result = self2._ctx ? self2._ctx.add(function() { return func(self2); }) : func(self2); result && result.totalTime && (self2.callbackAnimation = result); } }; var _abs = Math.abs; var _left = "left"; var _top = "top"; var _right = "right"; var _bottom = "bottom"; var _width = "width"; var _height = "height"; var _Right = "Right"; var _Left = "Left"; var _Top = "Top"; var _Bottom = "Bottom"; var _padding = "padding"; var _margin = "margin"; var _Width = "Width"; var _Height = "Height"; var _px = "px"; var _getComputedStyle = function _getComputedStyle2(element) { return _win4.getComputedStyle(element); }; var _makePositionable = function _makePositionable2(element) { var position = _getComputedStyle(element).position; element.style.position = position === "absolute" || position === "fixed" ? position : "relative"; }; var _setDefaults3 = function _setDefaults4(obj, defaults2) { for (var p in defaults2) { p in obj || (obj[p] = defaults2[p]); } return obj; }; var _getBounds = function _getBounds2(element, withoutTransforms) { var tween = withoutTransforms && _getComputedStyle(element)[_transformProp2] !== "matrix(1, 0, 0, 1, 0, 0)" && gsap3.to(element, { x: 0, y: 0, xPercent: 0, yPercent: 0, rotation: 0, rotationX: 0, rotationY: 0, scale: 1, skewX: 0, skewY: 0 }).progress(1), bounds = element.getBoundingClientRect(); tween && tween.progress(0).kill(); return bounds; }; var _getSize = function _getSize2(element, _ref3) { var d2 = _ref3.d2; return element["offset" + d2] || element["client" + d2] || 0; }; var _getLabelRatioArray = function _getLabelRatioArray2(timeline2) { var a = [], labels = timeline2.labels, duration = timeline2.duration(), p; for (p in labels) { a.push(labels[p] / duration); } return a; }; var _getClosestLabel = function _getClosestLabel2(animation) { return function(value) { return gsap3.utils.snap(_getLabelRatioArray(animation), value); }; }; var _snapDirectional = function _snapDirectional2(snapIncrementOrArray) { var snap3 = gsap3.utils.snap(snapIncrementOrArray), a = Array.isArray(snapIncrementOrArray) && snapIncrementOrArray.slice(0).sort(function(a2, b) { return a2 - b; }); return a ? function(value, direction, threshold) { if (threshold === undefined) { threshold = 0.001; } var i; if (!direction) { return snap3(value); } if (direction > 0) { value -= threshold; for (i = 0;i < a.length; i++) { if (a[i] >= value) { return a[i]; } } return a[i - 1]; } else { i = a.length; value += threshold; while (i--) { if (a[i] <= value) { return a[i]; } } } return a[0]; } : function(value, direction, threshold) { if (threshold === undefined) { threshold = 0.001; } var snapped = snap3(value); return !direction || Math.abs(snapped - value) < threshold || snapped - value < 0 === direction < 0 ? snapped : snap3(direction < 0 ? value - snapIncrementOrArray : value + snapIncrementOrArray); }; }; var _getLabelAtDirection = function _getLabelAtDirection2(timeline2) { return function(value, st) { return _snapDirectional(_getLabelRatioArray(timeline2))(value, st.direction); }; }; var _multiListener = function _multiListener2(func, element, types, callback) { return types.split(",").forEach(function(type) { return func(element, type, callback); }); }; var _addListener3 = function _addListener4(element, type, func, nonPassive, capture) { return element.addEventListener(type, func, { passive: !nonPassive, capture: !!capture }); }; var _removeListener3 = function _removeListener4(element, type, func, capture) { return element.removeEventListener(type, func, !!capture); }; var _wheelListener = function _wheelListener2(func, el, scrollFunc) { scrollFunc = scrollFunc && scrollFunc.wheelHandler; if (scrollFunc) { func(el, "wheel", scrollFunc); func(el, "touchmove", scrollFunc); } }; var _markerDefaults = { startColor: "green", endColor: "red", indent: 0, fontSize: "16px", fontWeight: "normal" }; var _defaults2 = { toggleActions: "play", anticipatePin: 0 }; var _keywords = { top: 0, left: 0, center: 0.5, bottom: 1, right: 1 }; var _offsetToPx = function _offsetToPx2(value, size) { if (_isString3(value)) { var eqIndex = value.indexOf("="), relative = ~eqIndex ? +(value.charAt(eqIndex - 1) + 1) * parseFloat(value.substr(eqIndex + 1)) : 0; if (~eqIndex) { value.indexOf("%") > eqIndex && (relative *= size / 100); value = value.substr(0, eqIndex - 1); } value = relative + (value in _keywords ? _keywords[value] * size : ~value.indexOf("%") ? parseFloat(value) * size / 100 : parseFloat(value) || 0); } return value; }; var _createMarker = function _createMarker2(type, name, container, direction, _ref4, offset, matchWidthEl, containerAnimation) { var { startColor, endColor, fontSize, indent, fontWeight } = _ref4; var e = _doc4.createElement("div"), useFixedPosition = _isViewport3(container) || _getProxyProp(container, "pinType") === "fixed", isScroller = type.indexOf("scroller") !== -1, parent = useFixedPosition ? _body2 : container, isStart = type.indexOf("start") !== -1, color = isStart ? startColor : endColor, css = "border-color:" + color + ";font-size:" + fontSize + ";color:" + color + ";font-weight:" + fontWeight + ";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;"; css += "position:" + ((isScroller || containerAnimation) && useFixedPosition ? "fixed;" : "absolute;"); (isScroller || containerAnimation || !useFixedPosition) && (css += (direction === _vertical ? _right : _bottom) + ":" + (offset + parseFloat(indent)) + "px;"); matchWidthEl && (css += "box-sizing:border-box;text-align:left;width:" + matchWidthEl.offsetWidth + "px;"); e._isStart = isStart; e.setAttribute("class", "gsap-marker-" + type + (name ? " marker-" + name : "")); e.style.cssText = css; e.innerText = name || name === 0 ? type + "-" + name : type; parent.children[0] ? parent.insertBefore(e, parent.children[0]) : parent.appendChild(e); e._offset = e["offset" + direction.op.d2]; _positionMarker(e, 0, direction, isStart); return e; }; var _positionMarker = function _positionMarker2(marker, start, direction, flipped) { var vars = { display: "block" }, side = direction[flipped ? "os2" : "p2"], oppositeSide = direction[flipped ? "p2" : "os2"]; marker._isFlipped = flipped; vars[direction.a + "Percent"] = flipped ? -100 : 0; vars[direction.a] = flipped ? "1px" : 0; vars["border" + side + _Width] = 1; vars["border" + oppositeSide + _Width] = 0; vars[direction.p] = start + "px"; gsap3.set(marker, vars); }; var _triggers = []; var _ids = {}; var _rafID; var _sync = function _sync2() { return _getTime2() - _lastScrollTime > 34 && (_rafID || (_rafID = requestAnimationFrame(_updateAll))); }; var _onScroll3 = function _onScroll4() { if (!_normalizer2 || !_normalizer2.isPressed || _normalizer2.startX > _body2.clientWidth) { _scrollers.cache++; if (_normalizer2) { _rafID || (_rafID = requestAnimationFrame(_updateAll)); } else { _updateAll(); } _lastScrollTime || _dispatch3("scrollStart"); _lastScrollTime = _getTime2(); } }; var _setBaseDimensions = function _setBaseDimensions2() { _baseScreenWidth = _win4.innerWidth; _baseScreenHeight = _win4.innerHeight; }; var _onResize = function _onResize2(force) { _scrollers.cache++; (force === true || !_refreshing && !_ignoreResize && !_doc4.fullscreenElement && !_doc4.webkitFullscreenElement && (!_ignoreMobileResize || _baseScreenWidth !== _win4.innerWidth || Math.abs(_win4.innerHeight - _baseScreenHeight) > _win4.innerHeight * 0.25)) && _resizeDelay.restart(true); }; var _listeners2 = {}; var _emptyArray2 = []; var _softRefresh = function _softRefresh2() { return _removeListener3(ScrollTrigger3, "scrollEnd", _softRefresh2) || _refreshAll(true); }; var _dispatch3 = function _dispatch4(type) { return _listeners2[type] && _listeners2[type].map(function(f) { return f(); }) || _emptyArray2; }; var _savedStyles = []; var _revertRecorded = function _revertRecorded2(media) { for (var i = 0;i < _savedStyles.length; i += 5) { if (!media || _savedStyles[i + 4] && _savedStyles[i + 4].query === media) { _savedStyles[i].style.cssText = _savedStyles[i + 1]; _savedStyles[i].getBBox && _savedStyles[i].setAttribute("transform", _savedStyles[i + 2] || ""); _savedStyles[i + 3].uncache = 1; } } }; var _recordScrollPositions = function _recordScrollPositions2() { return _scrollers.forEach(function(obj) { return _isFunction3(obj) && ++obj.cacheID && (obj.rec = obj()); }); }; var _revertAll = function _revertAll2(kill, media) { var trigger; for (_i = 0;_i < _triggers.length; _i++) { trigger = _triggers[_i]; if (trigger && (!media || trigger._ctx === media)) { if (kill) { trigger.kill(1); } else { trigger.revert(true, true); } } } _isReverted = true; media && _revertRecorded(media); media || _dispatch3("revert"); }; var _clearScrollMemory = function _clearScrollMemory2(scrollRestoration, force) { _scrollers.cache++; (force || !_refreshingAll) && _scrollers.forEach(function(obj) { return _isFunction3(obj) && obj.cacheID++ && (obj.rec = 0); }); _isString3(scrollRestoration) && (_win4.history.scrollRestoration = _scrollRestoration = scrollRestoration); }; var _refreshingAll; var _refreshID = 0; var _queueRefreshID; var _queueRefreshAll = function _queueRefreshAll2() { if (_queueRefreshID !== _refreshID) { var id = _queueRefreshID = _refreshID; requestAnimationFrame(function() { return id === _refreshID && _refreshAll(true); }); } }; var _refresh100vh = function _refresh100vh2() { _body2.appendChild(_div100vh); _100vh = !_normalizer2 && _div100vh.offsetHeight || _win4.innerHeight; _body2.removeChild(_div100vh); }; var _hideAllMarkers = function _hideAllMarkers2(hide) { return _toArray(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(el) { return el.style.display = hide ? "none" : "block"; }); }; var _refreshAll = function _refreshAll2(force, skipRevert) { _docEl2 = _doc4.documentElement; _body2 = _doc4.body; _root2 = [_win4, _doc4, _docEl2, _body2]; if (_lastScrollTime && !force && !_isReverted) { _addListener3(ScrollTrigger3, "scrollEnd", _softRefresh); return; } _refresh100vh(); _refreshingAll = ScrollTrigger3.isRefreshing = true; _isReverted || _recordScrollPositions(); var refreshInits = _dispatch3("refreshInit"); _sort && ScrollTrigger3.sort(); skipRevert || _revertAll(); _scrollers.forEach(function(obj) { if (_isFunction3(obj)) { obj.smooth && (obj.target.style.scrollBehavior = "auto"); obj(0); } }); _triggers.slice(0).forEach(function(t) { return t.refresh(); }); _isReverted = false; _triggers.forEach(function(t) { if (t._subPinOffset && t.pin) { var prop = t.vars.horizontal ? "offsetWidth" : "offsetHeight", original = t.pin[prop]; t.revert(true, 1); t.adjustPinSpacing(t.pin[prop] - original); t.refresh(); } }); _clampingMax = 1; _hideAllMarkers(true); _triggers.forEach(function(t) { var max = _maxScroll(t.scroller, t._dir), endClamp = t.vars.end === "max" || t._endClamp && t.end > max, startClamp = t._startClamp && t.start >= max; (endClamp || startClamp) && t.setPositions(startClamp ? max - 1 : t.start, endClamp ? Math.max(startClamp ? max : t.start + 1, max) : t.end, true); }); _hideAllMarkers(false); _clampingMax = 0; refreshInits.forEach(function(result) { return result && result.render && result.render(-1); }); _scrollers.forEach(function(obj) { if (_isFunction3(obj)) { obj.smooth && requestAnimationFrame(function() { return obj.target.style.scrollBehavior = "smooth"; }); obj.rec && obj(obj.rec); } }); _clearScrollMemory(_scrollRestoration, 1); _resizeDelay.pause(); _refreshID++; _refreshingAll = 2; _updateAll(2); _triggers.forEach(function(t) { return _isFunction3(t.vars.onRefresh) && t.vars.onRefresh(t); }); _refreshingAll = ScrollTrigger3.isRefreshing = false; _dispatch3("refresh"); }; var _lastScroll = 0; var _direction = 1; var _primary; var _updateAll = function _updateAll2(force) { if (force === 2 || !_refreshingAll && !_isReverted) { ScrollTrigger3.isUpdating = true; _primary && _primary.update(0); var l = _triggers.length, time = _getTime2(), recordVelocity = time - _time1 >= 50, scroll = l && _triggers[0].scroll(); _direction = _lastScroll > scroll ? -1 : 1; _refreshingAll || (_lastScroll = scroll); if (recordVelocity) { if (_lastScrollTime && !_pointerIsDown && time - _lastScrollTime > 200) { _lastScrollTime = 0; _dispatch3("scrollEnd"); } _time2 = _time1; _time1 = time; } if (_direction < 0) { _i = l; while (_i-- > 0) { _triggers[_i] && _triggers[_i].update(0, recordVelocity); } _direction = 1; } else { for (_i = 0;_i < l; _i++) { _triggers[_i] && _triggers[_i].update(0, recordVelocity); } } ScrollTrigger3.isUpdating = false; } _rafID = 0; }; var _propNamesToCopy = [_left, _top, _bottom, _right, _margin + _Bottom, _margin + _Right, _margin + _Top, _margin + _Left, "display", "flexShrink", "float", "zIndex", "gridColumnStart", "gridColumnEnd", "gridRowStart", "gridRowEnd", "gridArea", "justifySelf", "alignSelf", "placeSelf", "order"]; var _stateProps = _propNamesToCopy.concat([_width, _height, "boxSizing", "max" + _Width, "max" + _Height, "position", _margin, _padding, _padding + _Top, _padding + _Right, _padding + _Bottom, _padding + _Left]); var _swapPinOut = function _swapPinOut2(pin, spacer, state) { _setState(state); var cache = pin._gsap; if (cache.spacerIsNative) { _setState(cache.spacerState); } else if (pin._gsap.swappedIn) { var parent = spacer.parentNode; if (parent) { parent.insertBefore(pin, spacer); parent.removeChild(spacer); } } pin._gsap.swappedIn = false; }; var _swapPinIn = function _swapPinIn2(pin, spacer, cs, spacerState) { if (!pin._gsap.swappedIn) { var i = _propNamesToCopy.length, spacerStyle = spacer.style, pinStyle = pin.style, p; while (i--) { p = _propNamesToCopy[i]; spacerStyle[p] = cs[p]; } spacerStyle.position = cs.position === "absolute" ? "absolute" : "relative"; cs.display === "inline" && (spacerStyle.display = "inline-block"); pinStyle[_bottom] = pinStyle[_right] = "auto"; spacerStyle.flexBasis = cs.flexBasis || "auto"; spacerStyle.overflow = "visible"; spacerStyle.boxSizing = "border-box"; spacerStyle[_width] = _getSize(pin, _horizontal) + _px; spacerStyle[_height] = _getSize(pin, _vertical) + _px; spacerStyle[_padding] = pinStyle[_margin] = pinStyle[_top] = pinStyle[_left] = "0"; _setState(spacerState); pinStyle[_width] = pinStyle["max" + _Width] = cs[_width]; pinStyle[_height] = pinStyle["max" + _Height] = cs[_height]; pinStyle[_padding] = cs[_padding]; if (pin.parentNode !== spacer) { pin.parentNode.insertBefore(spacer, pin); spacer.appendChild(pin); } pin._gsap.swappedIn = true; } }; var _capsExp2 = /([A-Z])/g; var _setState = function _setState2(state) { if (state) { var style = state.t.style, l = state.length, i = 0, p, value; (state.t._gsap || gsap3.core.getCache(state.t)).uncache = 1; for (;i < l; i += 2) { value = state[i + 1]; p = state[i]; if (value) { style[p] = value; } else if (style[p]) { style.removeProperty(p.replace(_capsExp2, "-$1").toLowerCase()); } } } }; var _getState = function _getState2(element) { var l = _stateProps.length, style = element.style, state = [], i = 0; for (;i < l; i++) { state.push(_stateProps[i], style[_stateProps[i]]); } state.t = element; return state; }; var _copyState = function _copyState2(state, override, omitOffsets) { var result = [], l = state.length, i = omitOffsets ? 8 : 0, p; for (;i < l; i += 2) { p = state[i]; result.push(p, p in override ? override[p] : state[i + 1]); } result.t = state.t; return result; }; var _winOffsets = { left: 0, top: 0 }; var _parsePosition3 = function _parsePosition4(value, trigger, scrollerSize, direction, scroll, marker, markerScroller, self2, scrollerBounds, borderWidth, useFixedPosition, scrollerMax, containerAnimation, clampZeroProp) { _isFunction3(value) && (value = value(self2)); if (_isString3(value) && value.substr(0, 3) === "max") { value = scrollerMax + (value.charAt(4) === "=" ? _offsetToPx("0" + value.substr(3), scrollerSize) : 0); } var time = containerAnimation ? containerAnimation.time() : 0, p1, p2, element; containerAnimation && containerAnimation.seek(0); isNaN(value) || (value = +value); if (!_isNumber3(value)) { _isFunction3(trigger) && (trigger = trigger(self2)); var offsets = (value || "0").split(" "), bounds, localOffset, globalOffset, display; element = _getTarget(trigger, self2) || _body2; bounds = _getBounds(element) || {}; if ((!bounds || !bounds.left && !bounds.top) && _getComputedStyle(element).display === "none") { display = element.style.display; element.style.display = "block"; bounds = _getBounds(element); display ? element.style.display = display : element.style.removeProperty("display"); } localOffset = _offsetToPx(offsets[0], bounds[direction.d]); globalOffset = _offsetToPx(offsets[1] || "0", scrollerSize); value = bounds[direction.p] - scrollerBounds[direction.p] - borderWidth + localOffset + scroll - globalOffset; markerScroller && _positionMarker(markerScroller, globalOffset, direction, scrollerSize - globalOffset < 20 || markerScroller._isStart && globalOffset > 20); scrollerSize -= scrollerSize - globalOffset; } else { containerAnimation && (value = gsap3.utils.mapRange(containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, 0, scrollerMax, value)); markerScroller && _positionMarker(markerScroller, scrollerSize, direction, true); } if (clampZeroProp) { self2[clampZeroProp] = value || -0.001; value < 0 && (value = 0); } if (marker) { var position = value + scrollerSize, isStart = marker._isStart; p1 = "scroll" + direction.d2; _positionMarker(marker, position, direction, isStart && position > 20 || !isStart && (useFixedPosition ? Math.max(_body2[p1], _docEl2[p1]) : marker.parentNode[p1]) <= position + 1); if (useFixedPosition) { scrollerBounds = _getBounds(markerScroller); useFixedPosition && (marker.style[direction.op.p] = scrollerBounds[direction.op.p] - direction.op.m - marker._offset + _px); } } if (containerAnimation && element) { p1 = _getBounds(element); containerAnimation.seek(scrollerMax); p2 = _getBounds(element); containerAnimation._caScrollDist = p1[direction.p] - p2[direction.p]; value = value / containerAnimation._caScrollDist * scrollerMax; } containerAnimation && containerAnimation.seek(time); return containerAnimation ? value : Math.round(value); }; var _prefixExp = /(webkit|moz|length|cssText|inset)/i; var _reparent = function _reparent2(element, parent, top, left) { if (element.parentNode !== parent) { var style = element.style, p, cs; if (parent === _body2) { element._stOrig = style.cssText; cs = _getComputedStyle(element); for (p in cs) { if (!+p && !_prefixExp.test(p) && cs[p] && typeof style[p] === "string" && p !== "0") { style[p] = cs[p]; } } style.top = top; style.left = left; } else { style.cssText = element._stOrig; } gsap3.core.getCache(element).uncache = 1; parent.appendChild(element); } }; var _interruptionTracker = function _interruptionTracker2(getValueFunc, initialValue, onInterrupt) { var last1 = initialValue, last2 = last1; return function(value) { var current = Math.round(getValueFunc()); if (current !== last1 && current !== last2 && Math.abs(current - last1) > 3 && Math.abs(current - last2) > 3) { value = current; onInterrupt && onInterrupt(); } last2 = last1; last1 = Math.round(value); return last1; }; }; var _shiftMarker = function _shiftMarker2(marker, direction, value) { var vars = {}; vars[direction.p] = "+=" + value; gsap3.set(marker, vars); }; var _getTweenCreator = function _getTweenCreator2(scroller, direction) { var getScroll = _getScrollFunc(scroller, direction), prop = "_scroll" + direction.p2, getTween = function getTween(scrollTo, vars, initialValue, change1, change2) { var tween = getTween.tween, onComplete = vars.onComplete, modifiers = {}; initialValue = initialValue || getScroll(); var checkForInterruption = _interruptionTracker(getScroll, initialValue, function() { tween.kill(); getTween.tween = 0; }); change2 = change1 && change2 || 0; change1 = change1 || scrollTo - initialValue; tween && tween.kill(); vars[prop] = scrollTo; vars.inherit = false; vars.modifiers = modifiers; modifiers[prop] = function() { return checkForInterruption(initialValue + change1 * tween.ratio + change2 * tween.ratio * tween.ratio); }; vars.onUpdate = function() { _scrollers.cache++; getTween.tween && _updateAll(); }; vars.onComplete = function() { getTween.tween = 0; onComplete && onComplete.call(tween); }; tween = getTween.tween = gsap3.to(scroller, vars); return tween; }; scroller[prop] = getScroll; getScroll.wheelHandler = function() { return getTween.tween && getTween.tween.kill() && (getTween.tween = 0); }; _addListener3(scroller, "wheel", getScroll.wheelHandler); ScrollTrigger3.isTouch && _addListener3(scroller, "touchmove", getScroll.wheelHandler); return getTween; }; var ScrollTrigger3 = /* @__PURE__ */ function() { function ScrollTrigger4(vars, animation) { _coreInitted3 || ScrollTrigger4.register(gsap3) || console.warn("Please gsap.registerPlugin(ScrollTrigger)"); _context3(this); this.init(vars, animation); } var _proto = ScrollTrigger4.prototype; _proto.init = function init(vars, animation) { this.progress = this.start = 0; this.vars && this.kill(true, true); if (!_enabled) { this.update = this.refresh = this.kill = _passThrough3; return; } vars = _setDefaults3(_isString3(vars) || _isNumber3(vars) || vars.nodeType ? { trigger: vars } : vars, _defaults2); var _vars = vars, onUpdate = _vars.onUpdate, toggleClass = _vars.toggleClass, id = _vars.id, onToggle = _vars.onToggle, onRefresh = _vars.onRefresh, scrub = _vars.scrub, trigger = _vars.trigger, pin = _vars.pin, pinSpacing = _vars.pinSpacing, invalidateOnRefresh = _vars.invalidateOnRefresh, anticipatePin = _vars.anticipatePin, onScrubComplete = _vars.onScrubComplete, onSnapComplete = _vars.onSnapComplete, once = _vars.once, snap3 = _vars.snap, pinReparent = _vars.pinReparent, pinSpacer = _vars.pinSpacer, containerAnimation = _vars.containerAnimation, fastScrollEnd = _vars.fastScrollEnd, preventOverlaps = _vars.preventOverlaps, direction = vars.horizontal || vars.containerAnimation && vars.horizontal !== false ? _horizontal : _vertical, isToggle = !scrub && scrub !== 0, scroller = _getTarget(vars.scroller || _win4), scrollerCache = gsap3.core.getCache(scroller), isViewport = _isViewport3(scroller), useFixedPosition = ("pinType" in vars ? vars.pinType : _getProxyProp(scroller, "pinType") || isViewport && "fixed") === "fixed", callbacks = [vars.onEnter, vars.onLeave, vars.onEnterBack, vars.onLeaveBack], toggleActions = isToggle && vars.toggleActions.split(" "), markers = "markers" in vars ? vars.markers : _defaults2.markers, borderWidth = isViewport ? 0 : parseFloat(_getComputedStyle(scroller)["border" + direction.p2 + _Width]) || 0, self2 = this, onRefreshInit = vars.onRefreshInit && function() { return vars.onRefreshInit(self2); }, getScrollerSize = _getSizeFunc(scroller, isViewport, direction), getScrollerOffsets = _getOffsetsFunc(scroller, isViewport), lastSnap = 0, lastRefresh = 0, prevProgress = 0, scrollFunc = _getScrollFunc(scroller, direction), tweenTo, pinCache, snapFunc, scroll1, scroll2, start, end, markerStart, markerEnd, markerStartTrigger, markerEndTrigger, markerVars, executingOnRefresh, change, pinOriginalState, pinActiveState, pinState, spacer, offset, pinGetter, pinSetter, pinStart, pinChange, spacingStart, spacerState, markerStartSetter, pinMoves, markerEndSetter, cs, snap1, snap22, scrubTween, scrubSmooth, snapDurClamp, snapDelayedCall, prevScroll, prevAnimProgress, caMarkerSetter, customRevertReturn; self2._startClamp = self2._endClamp = false; self2._dir = direction; anticipatePin *= 45; self2.scroller = scroller; self2.scroll = containerAnimation ? containerAnimation.time.bind(containerAnimation) : scrollFunc; scroll1 = scrollFunc(); self2.vars = vars; animation = animation || vars.animation; if ("refreshPriority" in vars) { _sort = 1; vars.refreshPriority === -9999 && (_primary = self2); } scrollerCache.tweenScroll = scrollerCache.tweenScroll || { top: _getTweenCreator(scroller, _vertical), left: _getTweenCreator(scroller, _horizontal) }; self2.tweenTo = tweenTo = scrollerCache.tweenScroll[direction.p]; self2.scrubDuration = function(value) { scrubSmooth = _isNumber3(value) && value; if (!scrubSmooth) { scrubTween && scrubTween.progress(1).kill(); scrubTween = 0; } else { scrubTween ? scrubTween.duration(value) : scrubTween = gsap3.to(animation, { ease: "expo", totalProgress: "+=0", inherit: false, duration: scrubSmooth, paused: true, onComplete: function onComplete() { return onScrubComplete && onScrubComplete(self2); } }); } }; if (animation) { animation.vars.lazy = false; animation._initted && !self2.isReverted || animation.vars.immediateRender !== false && vars.immediateRender !== false && animation.duration() && animation.render(0, true, true); self2.animation = animation.pause(); animation.scrollTrigger = self2; self2.scrubDuration(scrub); snap1 = 0; id || (id = animation.vars.id); } if (snap3) { if (!_isObject3(snap3) || snap3.push) { snap3 = { snapTo: snap3 }; } "scrollBehavior" in _body2.style && gsap3.set(isViewport ? [_body2, _docEl2] : scroller, { scrollBehavior: "auto" }); _scrollers.forEach(function(o) { return _isFunction3(o) && o.target === (isViewport ? _doc4.scrollingElement || _docEl2 : scroller) && (o.smooth = false); }); snapFunc = _isFunction3(snap3.snapTo) ? snap3.snapTo : snap3.snapTo === "labels" ? _getClosestLabel(animation) : snap3.snapTo === "labelsDirectional" ? _getLabelAtDirection(animation) : snap3.directional !== false ? function(value, st) { return _snapDirectional(snap3.snapTo)(value, _getTime2() - lastRefresh < 500 ? 0 : st.direction); } : gsap3.utils.snap(snap3.snapTo); snapDurClamp = snap3.duration || { min: 0.1, max: 2 }; snapDurClamp = _isObject3(snapDurClamp) ? _clamp4(snapDurClamp.min, snapDurClamp.max) : _clamp4(snapDurClamp, snapDurClamp); snapDelayedCall = gsap3.delayedCall(snap3.delay || scrubSmooth / 2 || 0.1, function() { var scroll = scrollFunc(), refreshedRecently = _getTime2() - lastRefresh < 500, tween = tweenTo.tween; if ((refreshedRecently || Math.abs(self2.getVelocity()) < 10) && !tween && !_pointerIsDown && lastSnap !== scroll) { var progress = (scroll - start) / change, totalProgress = animation && !isToggle ? animation.totalProgress() : progress, velocity = refreshedRecently ? 0 : (totalProgress - snap22) / (_getTime2() - _time2) * 1000 || 0, change1 = gsap3.utils.clamp(-progress, 1 - progress, _abs(velocity / 2) * velocity / 0.185), naturalEnd = progress + (snap3.inertia === false ? 0 : change1), endValue, endScroll, _snap = snap3, onStart = _snap.onStart, _onInterrupt = _snap.onInterrupt, _onComplete = _snap.onComplete; endValue = snapFunc(naturalEnd, self2); _isNumber3(endValue) || (endValue = naturalEnd); endScroll = Math.max(0, Math.round(start + endValue * change)); if (scroll <= end && scroll >= start && endScroll !== scroll) { if (tween && !tween._initted && tween.data <= _abs(endScroll - scroll)) { return; } if (snap3.inertia === false) { change1 = endValue - progress; } tweenTo(endScroll, { duration: snapDurClamp(_abs(Math.max(_abs(naturalEnd - totalProgress), _abs(endValue - totalProgress)) * 0.185 / velocity / 0.05 || 0)), ease: snap3.ease || "power3", data: _abs(endScroll - scroll), onInterrupt: function onInterrupt() { return snapDelayedCall.restart(true) && _onInterrupt && _onInterrupt(self2); }, onComplete: function onComplete() { self2.update(); lastSnap = scrollFunc(); if (animation && !isToggle) { scrubTween ? scrubTween.resetTo("totalProgress", endValue, animation._tTime / animation._tDur) : animation.progress(endValue); } snap1 = snap22 = animation && !isToggle ? animation.totalProgress() : self2.progress; onSnapComplete && onSnapComplete(self2); _onComplete && _onComplete(self2); } }, scroll, change1 * change, endScroll - scroll - change1 * change); onStart && onStart(self2, tweenTo.tween); } } else if (self2.isActive && lastSnap !== scroll) { snapDelayedCall.restart(true); } }).pause(); } id && (_ids[id] = self2); trigger = self2.trigger = _getTarget(trigger || pin !== true && pin); customRevertReturn = trigger && trigger._gsap && trigger._gsap.stRevert; customRevertReturn && (customRevertReturn = customRevertReturn(self2)); pin = pin === true ? trigger : _getTarget(pin); _isString3(toggleClass) && (toggleClass = { targets: trigger, className: toggleClass }); if (pin) { pinSpacing === false || pinSpacing === _margin || (pinSpacing = !pinSpacing && pin.parentNode && pin.parentNode.style && _getComputedStyle(pin.parentNode).display === "flex" ? false : _padding); self2.pin = pin; pinCache = gsap3.core.getCache(pin); if (!pinCache.spacer) { if (pinSpacer) { pinSpacer = _getTarget(pinSpacer); pinSpacer && !pinSpacer.nodeType && (pinSpacer = pinSpacer.current || pinSpacer.nativeElement); pinCache.spacerIsNative = !!pinSpacer; pinSpacer && (pinCache.spacerState = _getState(pinSpacer)); } pinCache.spacer = spacer = pinSpacer || _doc4.createElement("div"); spacer.classList.add("pin-spacer"); id && spacer.classList.add("pin-spacer-" + id); pinCache.pinState = pinOriginalState = _getState(pin); } else { pinOriginalState = pinCache.pinState; } vars.force3D !== false && gsap3.set(pin, { force3D: true }); self2.spacer = spacer = pinCache.spacer; cs = _getComputedStyle(pin); spacingStart = cs[pinSpacing + direction.os2]; pinGetter = gsap3.getProperty(pin); pinSetter = gsap3.quickSetter(pin, direction.a, _px); _swapPinIn(pin, spacer, cs); pinState = _getState(pin); } if (markers) { markerVars = _isObject3(markers) ? _setDefaults3(markers, _markerDefaults) : _markerDefaults; markerStartTrigger = _createMarker("scroller-start", id, scroller, direction, markerVars, 0); markerEndTrigger = _createMarker("scroller-end", id, scroller, direction, markerVars, 0, markerStartTrigger); offset = markerStartTrigger["offset" + direction.op.d2]; var content = _getTarget(_getProxyProp(scroller, "content") || scroller); markerStart = this.markerStart = _createMarker("start", id, content, direction, markerVars, offset, 0, containerAnimation); markerEnd = this.markerEnd = _createMarker("end", id, content, direction, markerVars, offset, 0, containerAnimation); containerAnimation && (caMarkerSetter = gsap3.quickSetter([markerStart, markerEnd], direction.a, _px)); if (!useFixedPosition && !(_proxies.length && _getProxyProp(scroller, "fixedMarkers") === true)) { _makePositionable(isViewport ? _body2 : scroller); gsap3.set([markerStartTrigger, markerEndTrigger], { force3D: true }); markerStartSetter = gsap3.quickSetter(markerStartTrigger, direction.a, _px); markerEndSetter = gsap3.quickSetter(markerEndTrigger, direction.a, _px); } } if (containerAnimation) { var oldOnUpdate = containerAnimation.vars.onUpdate, oldParams = containerAnimation.vars.onUpdateParams; containerAnimation.eventCallback("onUpdate", function() { self2.update(0, 0, 1); oldOnUpdate && oldOnUpdate.apply(containerAnimation, oldParams || []); }); } self2.previous = function() { return _triggers[_triggers.indexOf(self2) - 1]; }; self2.next = function() { return _triggers[_triggers.indexOf(self2) + 1]; }; self2.revert = function(revert, temp) { if (!temp) { return self2.kill(true); } var r = revert !== false || !self2.enabled, prevRefreshing = _refreshing; if (r !== self2.isReverted) { if (r) { prevScroll = Math.max(scrollFunc(), self2.scroll.rec || 0); prevProgress = self2.progress; prevAnimProgress = animation && animation.progress(); } markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function(m) { return m.style.display = r ? "none" : "block"; }); if (r) { _refreshing = self2; self2.update(r); } if (pin && (!pinReparent || !self2.isActive)) { if (r) { _swapPinOut(pin, spacer, pinOriginalState); } else { _swapPinIn(pin, spacer, _getComputedStyle(pin), spacerState); } } r || self2.update(r); _refreshing = prevRefreshing; self2.isReverted = r; } }; self2.refresh = function(soft, force, position, pinOffset) { if ((_refreshing || !self2.enabled) && !force) { return; } if (pin && soft && _lastScrollTime) { _addListener3(ScrollTrigger4, "scrollEnd", _softRefresh); return; } !_refreshingAll && onRefreshInit && onRefreshInit(self2); _refreshing = self2; if (tweenTo.tween && !position) { tweenTo.tween.kill(); tweenTo.tween = 0; } scrubTween && scrubTween.pause(); if (invalidateOnRefresh && animation) { animation.revert({ kill: false }).invalidate(); animation.getChildren ? animation.getChildren(true, true, false).forEach(function(t) { return t.vars.immediateRender && t.render(0, true, true); }) : animation.vars.immediateRender && animation.render(0, true, true); } self2.isReverted || self2.revert(true, true); self2._subPinOffset = false; var size = getScrollerSize(), scrollerBounds = getScrollerOffsets(), max = containerAnimation ? containerAnimation.duration() : _maxScroll(scroller, direction), isFirstRefresh = change <= 0.01 || !change, offset2 = 0, otherPinOffset = pinOffset || 0, parsedEnd = _isObject3(position) ? position.end : vars.end, parsedEndTrigger = vars.endTrigger || trigger, parsedStart = _isObject3(position) ? position.start : vars.start || (vars.start === 0 || !trigger ? 0 : pin ? "0 0" : "0 100%"), pinnedContainer = self2.pinnedContainer = vars.pinnedContainer && _getTarget(vars.pinnedContainer, self2), triggerIndex = trigger && Math.max(0, _triggers.indexOf(self2)) || 0, i = triggerIndex, cs2, bounds, scroll, isVertical, override, curTrigger, curPin, oppositeScroll, initted, revertedPins, forcedOverflow, markerStartOffset, markerEndOffset; if (markers && _isObject3(position)) { markerStartOffset = gsap3.getProperty(markerStartTrigger, direction.p); markerEndOffset = gsap3.getProperty(markerEndTrigger, direction.p); } while (i-- > 0) { curTrigger = _triggers[i]; curTrigger.end || curTrigger.refresh(0, 1) || (_refreshing = self2); curPin = curTrigger.pin; if (curPin && (curPin === trigger || curPin === pin || curPin === pinnedContainer) && !curTrigger.isReverted) { revertedPins || (revertedPins = []); revertedPins.unshift(curTrigger); curTrigger.revert(true, true); } if (curTrigger !== _triggers[i]) { triggerIndex--; i--; } } _isFunction3(parsedStart) && (parsedStart = parsedStart(self2)); parsedStart = _parseClamp(parsedStart, "start", self2); start = _parsePosition3(parsedStart, trigger, size, direction, scrollFunc(), markerStart, markerStartTrigger, self2, scrollerBounds, borderWidth, useFixedPosition, max, containerAnimation, self2._startClamp && "_startClamp") || (pin ? -0.001 : 0); _isFunction3(parsedEnd) && (parsedEnd = parsedEnd(self2)); if (_isString3(parsedEnd) && !parsedEnd.indexOf("+=")) { if (~parsedEnd.indexOf(" ")) { parsedEnd = (_isString3(parsedStart) ? parsedStart.split(" ")[0] : "") + parsedEnd; } else { offset2 = _offsetToPx(parsedEnd.substr(2), size); parsedEnd = _isString3(parsedStart) ? parsedStart : (containerAnimation ? gsap3.utils.mapRange(0, containerAnimation.duration(), containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, start) : start) + offset2; parsedEndTrigger = trigger; } } parsedEnd = _parseClamp(parsedEnd, "end", self2); end = Math.max(start, _parsePosition3(parsedEnd || (parsedEndTrigger ? "100% 0" : max), parsedEndTrigger, size, direction, scrollFunc() + offset2, markerEnd, markerEndTrigger, self2, scrollerBounds, borderWidth, useFixedPosition, max, containerAnimation, self2._endClamp && "_endClamp")) || -0.001; offset2 = 0; i = triggerIndex; while (i--) { curTrigger = _triggers[i] || {}; curPin = curTrigger.pin; if (curPin && curTrigger.start - curTrigger._pinPush <= start && !containerAnimation && curTrigger.end > 0) { cs2 = curTrigger.end - (self2._startClamp ? Math.max(0, curTrigger.start) : curTrigger.start); if ((curPin === trigger && curTrigger.start - curTrigger._pinPush < start || curPin === pinnedContainer) && isNaN(parsedStart)) { offset2 += cs2 * (1 - curTrigger.progress); } curPin === pin && (otherPinOffset += cs2); } } start += offset2; end += offset2; self2._startClamp && (self2._startClamp += offset2); if (self2._endClamp && !_refreshingAll) { self2._endClamp = end || -0.001; end = Math.min(end, _maxScroll(scroller, direction)); } change = end - start || (start -= 0.01) && 0.001; if (isFirstRefresh) { prevProgress = gsap3.utils.clamp(0, 1, gsap3.utils.normalize(start, end, prevScroll)); } self2._pinPush = otherPinOffset; if (markerStart && offset2) { cs2 = {}; cs2[direction.a] = "+=" + offset2; pinnedContainer && (cs2[direction.p] = "-=" + scrollFunc()); gsap3.set([markerStart, markerEnd], cs2); } if (pin && !(_clampingMax && self2.end >= _maxScroll(scroller, direction))) { cs2 = _getComputedStyle(pin); isVertical = direction === _vertical; scroll = scrollFunc(); pinStart = parseFloat(pinGetter(direction.a)) + otherPinOffset; if (!max && end > 1) { forcedOverflow = (isViewport ? _doc4.scrollingElement || _docEl2 : scroller).style; forcedOverflow = { style: forcedOverflow, value: forcedOverflow["overflow" + direction.a.toUpperCase()] }; if (isViewport && _getComputedStyle(_body2)["overflow" + direction.a.toUpperCase()] !== "scroll") { forcedOverflow.style["overflow" + direction.a.toUpperCase()] = "scroll"; } } _swapPinIn(pin, spacer, cs2); pinState = _getState(pin); bounds = _getBounds(pin, true); oppositeScroll = useFixedPosition && _getScrollFunc(scroller, isVertical ? _horizontal : _vertical)(); if (pinSpacing) { spacerState = [pinSpacing + direction.os2, change + otherPinOffset + _px]; spacerState.t = spacer; i = pinSpacing === _padding ? _getSize(pin, direction) + change + otherPinOffset : 0; if (i) { spacerState.push(direction.d, i + _px); spacer.style.flexBasis !== "auto" && (spacer.style.flexBasis = i + _px); } _setState(spacerState); if (pinnedContainer) { _triggers.forEach(function(t) { if (t.pin === pinnedContainer && t.vars.pinSpacing !== false) { t._subPinOffset = true; } }); } useFixedPosition && scrollFunc(prevScroll); } else { i = _getSize(pin, direction); i && spacer.style.flexBasis !== "auto" && (spacer.style.flexBasis = i + _px); } if (useFixedPosition) { override = { top: bounds.top + (isVertical ? scroll - start : oppositeScroll) + _px, left: bounds.left + (isVertical ? oppositeScroll : scroll - start) + _px, boxSizing: "border-box", position: "fixed" }; override[_width] = override["max" + _Width] = Math.ceil(bounds.width) + _px; override[_height] = override["max" + _Height] = Math.ceil(bounds.height) + _px; override[_margin] = override[_margin + _Top] = override[_margin + _Right] = override[_margin + _Bottom] = override[_margin + _Left] = "0"; override[_padding] = cs2[_padding]; override[_padding + _Top] = cs2[_padding + _Top]; override[_padding + _Right] = cs2[_padding + _Right]; override[_padding + _Bottom] = cs2[_padding + _Bottom]; override[_padding + _Left] = cs2[_padding + _Left]; pinActiveState = _copyState(pinOriginalState, override, pinReparent); _refreshingAll && scrollFunc(0); } if (animation) { initted = animation._initted; _suppressOverwrites2(1); animation.render(animation.duration(), true, true); pinChange = pinGetter(direction.a) - pinStart + change + otherPinOffset; pinMoves = Math.abs(change - pinChange) > 1; useFixedPosition && pinMoves && pinActiveState.splice(pinActiveState.length - 2, 2); animation.render(0, true, true); initted || animation.invalidate(true); animation.parent || animation.totalTime(animation.totalTime()); _suppressOverwrites2(0); } else { pinChange = change; } forcedOverflow && (forcedOverflow.value ? forcedOverflow.style["overflow" + direction.a.toUpperCase()] = forcedOverflow.value : forcedOverflow.style.removeProperty("overflow-" + direction.a)); } else if (trigger && scrollFunc() && !containerAnimation) { bounds = trigger.parentNode; while (bounds && bounds !== _body2) { if (bounds._pinOffset) { start -= bounds._pinOffset; end -= bounds._pinOffset; } bounds = bounds.parentNode; } } revertedPins && revertedPins.forEach(function(t) { return t.revert(false, true); }); self2.start = start; self2.end = end; scroll1 = scroll2 = _refreshingAll ? prevScroll : scrollFunc(); if (!containerAnimation && !_refreshingAll) { scroll1 < prevScroll && scrollFunc(prevScroll); self2.scroll.rec = 0; } self2.revert(false, true); lastRefresh = _getTime2(); if (snapDelayedCall) { lastSnap = -1; snapDelayedCall.restart(true); } _refreshing = 0; animation && isToggle && (animation._initted || prevAnimProgress) && animation.progress() !== prevAnimProgress && animation.progress(prevAnimProgress || 0, true).render(animation.time(), true, true); if (isFirstRefresh || prevProgress !== self2.progress || containerAnimation || invalidateOnRefresh || animation && !animation._initted) { animation && !isToggle && (animation._initted || prevProgress || animation.vars.immediateRender !== false) && animation.totalProgress(containerAnimation && start < -0.001 && !prevProgress ? gsap3.utils.normalize(start, end, 0) : prevProgress, true); self2.progress = isFirstRefresh || (scroll1 - start) / change === prevProgress ? 0 : prevProgress; } pin && pinSpacing && (spacer._pinOffset = Math.round(self2.progress * pinChange)); scrubTween && scrubTween.invalidate(); if (!isNaN(markerStartOffset)) { markerStartOffset -= gsap3.getProperty(markerStartTrigger, direction.p); markerEndOffset -= gsap3.getProperty(markerEndTrigger, direction.p); _shiftMarker(markerStartTrigger, direction, markerStartOffset); _shiftMarker(markerStart, direction, markerStartOffset - (pinOffset || 0)); _shiftMarker(markerEndTrigger, direction, markerEndOffset); _shiftMarker(markerEnd, direction, markerEndOffset - (pinOffset || 0)); } isFirstRefresh && !_refreshingAll && self2.update(); if (onRefresh && !_refreshingAll && !executingOnRefresh) { executingOnRefresh = true; onRefresh(self2); executingOnRefresh = false; } }; self2.getVelocity = function() { return (scrollFunc() - scroll2) / (_getTime2() - _time2) * 1000 || 0; }; self2.endAnimation = function() { _endAnimation(self2.callbackAnimation); if (animation) { scrubTween ? scrubTween.progress(1) : !animation.paused() ? _endAnimation(animation, animation.reversed()) : isToggle || _endAnimation(animation, self2.direction < 0, 1); } }; self2.labelToScroll = function(label) { return animation && animation.labels && (start || self2.refresh() || start) + animation.labels[label] / animation.duration() * change || 0; }; self2.getTrailing = function(name) { var i = _triggers.indexOf(self2), a = self2.direction > 0 ? _triggers.slice(0, i).reverse() : _triggers.slice(i + 1); return (_isString3(name) ? a.filter(function(t) { return t.vars.preventOverlaps === name; }) : a).filter(function(t) { return self2.direction > 0 ? t.end <= start : t.start >= end; }); }; self2.update = function(reset, recordVelocity, forceFake) { if (containerAnimation && !forceFake && !reset) { return; } var scroll = _refreshingAll === true ? prevScroll : self2.scroll(), p = reset ? 0 : (scroll - start) / change, clipped = p < 0 ? 0 : p > 1 ? 1 : p || 0, prevProgress2 = self2.progress, isActive, wasActive, toggleState, action, stateChanged, toggled, isAtMax, isTakingAction; if (recordVelocity) { scroll2 = scroll1; scroll1 = containerAnimation ? scrollFunc() : scroll; if (snap3) { snap22 = snap1; snap1 = animation && !isToggle ? animation.totalProgress() : clipped; } } if (anticipatePin && pin && !_refreshing && !_startup2 && _lastScrollTime) { if (!clipped && start < scroll + (scroll - scroll2) / (_getTime2() - _time2) * anticipatePin) { clipped = 0.0001; } else if (clipped === 1 && end > scroll + (scroll - scroll2) / (_getTime2() - _time2) * anticipatePin) { clipped = 0.9999; } } if (clipped !== prevProgress2 && self2.enabled) { isActive = self2.isActive = !!clipped && clipped < 1; wasActive = !!prevProgress2 && prevProgress2 < 1; toggled = isActive !== wasActive; stateChanged = toggled || !!clipped !== !!prevProgress2; self2.direction = clipped > prevProgress2 ? 1 : -1; self2.progress = clipped; if (stateChanged && !_refreshing) { toggleState = clipped && !prevProgress2 ? 0 : clipped === 1 ? 1 : prevProgress2 === 1 ? 2 : 3; if (isToggle) { action = !toggled && toggleActions[toggleState + 1] !== "none" && toggleActions[toggleState + 1] || toggleActions[toggleState]; isTakingAction = animation && (action === "complete" || action === "reset" || (action in animation)); } } preventOverlaps && (toggled || isTakingAction) && (isTakingAction || scrub || !animation) && (_isFunction3(preventOverlaps) ? preventOverlaps(self2) : self2.getTrailing(preventOverlaps).forEach(function(t) { return t.endAnimation(); })); if (!isToggle) { if (scrubTween && !_refreshing && !_startup2) { scrubTween._dp._time - scrubTween._start !== scrubTween._time && scrubTween.render(scrubTween._dp._time - scrubTween._start); if (scrubTween.resetTo) { scrubTween.resetTo("totalProgress", clipped, animation._tTime / animation._tDur); } else { scrubTween.vars.totalProgress = clipped; scrubTween.invalidate().restart(); } } else if (animation) { animation.totalProgress(clipped, !!(_refreshing && (lastRefresh || reset))); } } if (pin) { reset && pinSpacing && (spacer.style[pinSpacing + direction.os2] = spacingStart); if (!useFixedPosition) { pinSetter(_round3(pinStart + pinChange * clipped)); } else if (stateChanged) { isAtMax = !reset && clipped > prevProgress2 && end + 1 > scroll && scroll + 1 >= _maxScroll(scroller, direction); if (pinReparent) { if (!reset && (isActive || isAtMax)) { var bounds = _getBounds(pin, true), _offset = scroll - start; _reparent(pin, _body2, bounds.top + (direction === _vertical ? _offset : 0) + _px, bounds.left + (direction === _vertical ? 0 : _offset) + _px); } else { _reparent(pin, spacer); } } _setState(isActive || isAtMax ? pinActiveState : pinState); pinMoves && clipped < 1 && isActive || pinSetter(pinStart + (clipped === 1 && !isAtMax ? pinChange : 0)); } } snap3 && !tweenTo.tween && !_refreshing && !_startup2 && snapDelayedCall.restart(true); toggleClass && (toggled || once && clipped && (clipped < 1 || !_limitCallbacks)) && _toArray(toggleClass.targets).forEach(function(el) { return el.classList[isActive || once ? "add" : "remove"](toggleClass.className); }); onUpdate && !isToggle && !reset && onUpdate(self2); if (stateChanged && !_refreshing) { if (isToggle) { if (isTakingAction) { if (action === "complete") { animation.pause().totalProgress(1); } else if (action === "reset") { animation.restart(true).pause(); } else if (action === "restart") { animation.restart(true); } else { animation[action](); } } onUpdate && onUpdate(self2); } if (toggled || !_limitCallbacks) { onToggle && toggled && _callback3(self2, onToggle); callbacks[toggleState] && _callback3(self2, callbacks[toggleState]); once && (clipped === 1 ? self2.kill(false, 1) : callbacks[toggleState] = 0); if (!toggled) { toggleState = clipped === 1 ? 1 : 3; callbacks[toggleState] && _callback3(self2, callbacks[toggleState]); } } if (fastScrollEnd && !isActive && Math.abs(self2.getVelocity()) > (_isNumber3(fastScrollEnd) ? fastScrollEnd : 2500)) { _endAnimation(self2.callbackAnimation); scrubTween ? scrubTween.progress(1) : _endAnimation(animation, action === "reverse" ? 1 : !clipped, 1); } } else if (isToggle && onUpdate && !_refreshing) { onUpdate(self2); } } if (markerEndSetter) { var n = containerAnimation ? scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0) : scroll; markerStartSetter(n + (markerStartTrigger._isFlipped ? 1 : 0)); markerEndSetter(n); } caMarkerSetter && caMarkerSetter(-scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0)); }; self2.enable = function(reset, refresh) { if (!self2.enabled) { self2.enabled = true; _addListener3(scroller, "resize", _onResize); isViewport || _addListener3(scroller, "scroll", _onScroll3); onRefreshInit && _addListener3(ScrollTrigger4, "refreshInit", onRefreshInit); if (reset !== false) { self2.progress = prevProgress = 0; scroll1 = scroll2 = lastSnap = scrollFunc(); } refresh !== false && self2.refresh(); } }; self2.getTween = function(snap4) { return snap4 && tweenTo ? tweenTo.tween : scrubTween; }; self2.setPositions = function(newStart, newEnd, keepClamp, pinOffset) { if (containerAnimation) { var st = containerAnimation.scrollTrigger, duration = containerAnimation.duration(), _change = st.end - st.start; newStart = st.start + _change * newStart / duration; newEnd = st.start + _change * newEnd / duration; } self2.refresh(false, false, { start: _keepClamp(newStart, keepClamp && !!self2._startClamp), end: _keepClamp(newEnd, keepClamp && !!self2._endClamp) }, pinOffset); self2.update(); }; self2.adjustPinSpacing = function(amount) { if (spacerState && amount) { var i = spacerState.indexOf(direction.d) + 1; spacerState[i] = parseFloat(spacerState[i]) + amount + _px; spacerState[1] = parseFloat(spacerState[1]) + amount + _px; _setState(spacerState); } }; self2.disable = function(reset, allowAnimation) { reset !== false && self2.revert(true, true); if (self2.enabled) { self2.enabled = self2.isActive = false; allowAnimation || scrubTween && scrubTween.pause(); prevScroll = 0; pinCache && (pinCache.uncache = 1); onRefreshInit && _removeListener3(ScrollTrigger4, "refreshInit", onRefreshInit); if (snapDelayedCall) { snapDelayedCall.pause(); tweenTo.tween && tweenTo.tween.kill() && (tweenTo.tween = 0); } if (!isViewport) { var i = _triggers.length; while (i--) { if (_triggers[i].scroller === scroller && _triggers[i] !== self2) { return; } } _removeListener3(scroller, "resize", _onResize); isViewport || _removeListener3(scroller, "scroll", _onScroll3); } } }; self2.kill = function(revert, allowAnimation) { self2.disable(revert, allowAnimation); scrubTween && !allowAnimation && scrubTween.kill(); id && delete _ids[id]; var i = _triggers.indexOf(self2); i >= 0 && _triggers.splice(i, 1); i === _i && _direction > 0 && _i--; i = 0; _triggers.forEach(function(t) { return t.scroller === self2.scroller && (i = 1); }); i || _refreshingAll || (self2.scroll.rec = 0); if (animation) { animation.scrollTrigger = null; revert && animation.revert({ kill: false }); allowAnimation || animation.kill(); } markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function(m) { return m.parentNode && m.parentNode.removeChild(m); }); _primary === self2 && (_primary = 0); if (pin) { pinCache && (pinCache.uncache = 1); i = 0; _triggers.forEach(function(t) { return t.pin === pin && i++; }); i || (pinCache.spacer = 0); } vars.onKill && vars.onKill(self2); }; _triggers.push(self2); self2.enable(false, false); customRevertReturn && customRevertReturn(self2); if (animation && animation.add && !change) { var updateFunc = self2.update; self2.update = function() { self2.update = updateFunc; _scrollers.cache++; start || end || self2.refresh(); }; gsap3.delayedCall(0.01, self2.update); change = 0.01; start = end = 0; } else { self2.refresh(); } pin && _queueRefreshAll(); }; ScrollTrigger4.register = function register(core) { if (!_coreInitted3) { gsap3 = core || _getGSAP3(); _windowExists5() && window.document && ScrollTrigger4.enable(); _coreInitted3 = _enabled; } return _coreInitted3; }; ScrollTrigger4.defaults = function defaults(config3) { if (config3) { for (var p in config3) { _defaults2[p] = config3[p]; } } return _defaults2; }; ScrollTrigger4.disable = function disable(reset, kill) { _enabled = 0; _triggers.forEach(function(trigger) { return trigger[kill ? "kill" : "disable"](reset); }); _removeListener3(_win4, "wheel", _onScroll3); _removeListener3(_doc4, "scroll", _onScroll3); clearInterval(_syncInterval); _removeListener3(_doc4, "touchcancel", _passThrough3); _removeListener3(_body2, "touchstart", _passThrough3); _multiListener(_removeListener3, _doc4, "pointerdown,touchstart,mousedown", _pointerDownHandler); _multiListener(_removeListener3, _doc4, "pointerup,touchend,mouseup", _pointerUpHandler); _resizeDelay.kill(); _iterateAutoRefresh(_removeListener3); for (var i = 0;i < _scrollers.length; i += 3) { _wheelListener(_removeListener3, _scrollers[i], _scrollers[i + 1]); _wheelListener(_removeListener3, _scrollers[i], _scrollers[i + 2]); } }; ScrollTrigger4.enable = function enable() { _win4 = window; _doc4 = document; _docEl2 = _doc4.documentElement; _body2 = _doc4.body; if (gsap3) { _toArray = gsap3.utils.toArray; _clamp4 = gsap3.utils.clamp; _context3 = gsap3.core.context || _passThrough3; _suppressOverwrites2 = gsap3.core.suppressOverwrites || _passThrough3; _scrollRestoration = _win4.history.scrollRestoration || "auto"; _lastScroll = _win4.pageYOffset || 0; gsap3.core.globals("ScrollTrigger", ScrollTrigger4); if (_body2) { _enabled = 1; _div100vh = document.createElement("div"); _div100vh.style.height = "100vh"; _div100vh.style.position = "absolute"; _refresh100vh(); _rafBugFix(); Observer.register(gsap3); ScrollTrigger4.isTouch = Observer.isTouch; _fixIOSBug = Observer.isTouch && /(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent); _ignoreMobileResize = Observer.isTouch === 1; _addListener3(_win4, "wheel", _onScroll3); _root2 = [_win4, _doc4, _docEl2, _body2]; if (gsap3.matchMedia) { ScrollTrigger4.matchMedia = function(vars) { var mm = gsap3.matchMedia(), p; for (p in vars) { mm.add(p, vars[p]); } return mm; }; gsap3.addEventListener("matchMediaInit", function() { _recordScrollPositions(); _revertAll(); }); gsap3.addEventListener("matchMediaRevert", function() { return _revertRecorded(); }); gsap3.addEventListener("matchMedia", function() { _refreshAll(0, 1); _dispatch3("matchMedia"); }); gsap3.matchMedia().add("(orientation: portrait)", function() { _setBaseDimensions(); return _setBaseDimensions; }); } else { console.warn("Requires GSAP 3.11.0 or later"); } _setBaseDimensions(); _addListener3(_doc4, "scroll", _onScroll3); var bodyHasStyle = _body2.hasAttribute("style"), bodyStyle = _body2.style, border = bodyStyle.borderTopStyle, AnimationProto = gsap3.core.Animation.prototype, bounds, i; AnimationProto.revert || Object.defineProperty(AnimationProto, "revert", { value: function value() { return this.time(-0.01, true); } }); bodyStyle.borderTopStyle = "solid"; bounds = _getBounds(_body2); _vertical.m = Math.round(bounds.top + _vertical.sc()) || 0; _horizontal.m = Math.round(bounds.left + _horizontal.sc()) || 0; border ? bodyStyle.borderTopStyle = border : bodyStyle.removeProperty("border-top-style"); if (!bodyHasStyle) { _body2.setAttribute("style", ""); _body2.removeAttribute("style"); } _syncInterval = setInterval(_sync, 250); gsap3.delayedCall(0.5, function() { return _startup2 = 0; }); _addListener3(_doc4, "touchcancel", _passThrough3); _addListener3(_body2, "touchstart", _passThrough3); _multiListener(_addListener3, _doc4, "pointerdown,touchstart,mousedown", _pointerDownHandler); _multiListener(_addListener3, _doc4, "pointerup,touchend,mouseup", _pointerUpHandler); _transformProp2 = gsap3.utils.checkPrefix("transform"); _stateProps.push(_transformProp2); _coreInitted3 = _getTime2(); _resizeDelay = gsap3.delayedCall(0.2, _refreshAll).pause(); _autoRefresh = [_doc4, "visibilitychange", function() { var { innerWidth: w, innerHeight: h } = _win4; if (_doc4.hidden) { _prevWidth = w; _prevHeight = h; } else if (_prevWidth !== w || _prevHeight !== h) { _onResize(); } }, _doc4, "DOMContentLoaded", _refreshAll, _win4, "load", _refreshAll, _win4, "resize", _onResize]; _iterateAutoRefresh(_addListener3); _triggers.forEach(function(trigger) { return trigger.enable(0, 1); }); for (i = 0;i < _scrollers.length; i += 3) { _wheelListener(_removeListener3, _scrollers[i], _scrollers[i + 1]); _wheelListener(_removeListener3, _scrollers[i], _scrollers[i + 2]); } } } }; ScrollTrigger4.config = function config(vars) { "limitCallbacks" in vars && (_limitCallbacks = !!vars.limitCallbacks); var ms = vars.syncInterval; ms && clearInterval(_syncInterval) || (_syncInterval = ms) && setInterval(_sync, ms); "ignoreMobileResize" in vars && (_ignoreMobileResize = ScrollTrigger4.isTouch === 1 && vars.ignoreMobileResize); if ("autoRefreshEvents" in vars) { _iterateAutoRefresh(_removeListener3) || _iterateAutoRefresh(_addListener3, vars.autoRefreshEvents || "none"); _ignoreResize = (vars.autoRefreshEvents + "").indexOf("resize") === -1; } }; ScrollTrigger4.scrollerProxy = function scrollerProxy(target, vars) { var t = _getTarget(target), i = _scrollers.indexOf(t), isViewport = _isViewport3(t); if (~i) { _scrollers.splice(i, isViewport ? 6 : 2); } if (vars) { isViewport ? _proxies.unshift(_win4, vars, _body2, vars, _docEl2, vars) : _proxies.unshift(t, vars); } }; ScrollTrigger4.clearMatchMedia = function clearMatchMedia(query) { _triggers.forEach(function(t) { return t._ctx && t._ctx.query === query && t._ctx.kill(true, true); }); }; ScrollTrigger4.isInViewport = function isInViewport(element, ratio, horizontal) { var bounds = (_isString3(element) ? _getTarget(element) : element).getBoundingClientRect(), offset = bounds[horizontal ? _width : _height] * ratio || 0; return horizontal ? bounds.right - offset > 0 && bounds.left + offset < _win4.innerWidth : bounds.bottom - offset > 0 && bounds.top + offset < _win4.innerHeight; }; ScrollTrigger4.positionInViewport = function positionInViewport(element, referencePoint, horizontal) { _isString3(element) && (element = _getTarget(element)); var bounds = element.getBoundingClientRect(), size = bounds[horizontal ? _width : _height], offset = referencePoint == null ? size / 2 : (referencePoint in _keywords) ? _keywords[referencePoint] * size : ~referencePoint.indexOf("%") ? parseFloat(referencePoint) * size / 100 : parseFloat(referencePoint) || 0; return horizontal ? (bounds.left + offset) / _win4.innerWidth : (bounds.top + offset) / _win4.innerHeight; }; ScrollTrigger4.killAll = function killAll(allowListeners) { _triggers.slice(0).forEach(function(t) { return t.vars.id !== "ScrollSmoother" && t.kill(); }); if (allowListeners !== true) { var listeners = _listeners2.killAll || []; _listeners2 = {}; listeners.forEach(function(f) { return f(); }); } }; return ScrollTrigger4; }(); ScrollTrigger3.version = "3.14.2"; ScrollTrigger3.saveStyles = function(targets) { return targets ? _toArray(targets).forEach(function(target) { if (target && target.style) { var i = _savedStyles.indexOf(target); i >= 0 && _savedStyles.splice(i, 5); _savedStyles.push(target, target.style.cssText, target.getBBox && target.getAttribute("transform"), gsap3.core.getCache(target), _context3()); } }) : _savedStyles; }; ScrollTrigger3.revert = function(soft, media) { return _revertAll(!soft, media); }; ScrollTrigger3.create = function(vars, animation) { return new ScrollTrigger3(vars, animation); }; ScrollTrigger3.refresh = function(safe) { return safe ? _onResize(true) : (_coreInitted3 || ScrollTrigger3.register()) && _refreshAll(true); }; ScrollTrigger3.update = function(force) { return ++_scrollers.cache && _updateAll(force === true ? 2 : 0); }; ScrollTrigger3.clearScrollMemory = _clearScrollMemory; ScrollTrigger3.maxScroll = function(element, horizontal) { return _maxScroll(element, horizontal ? _horizontal : _vertical); }; ScrollTrigger3.getScrollFunc = function(element, horizontal) { return _getScrollFunc(_getTarget(element), horizontal ? _horizontal : _vertical); }; ScrollTrigger3.getById = function(id) { return _ids[id]; }; ScrollTrigger3.getAll = function() { return _triggers.filter(function(t) { return t.vars.id !== "ScrollSmoother"; }); }; ScrollTrigger3.isScrolling = function() { return !!_lastScrollTime; }; ScrollTrigger3.snapDirectional = _snapDirectional; ScrollTrigger3.addEventListener = function(type, callback) { var a = _listeners2[type] || (_listeners2[type] = []); ~a.indexOf(callback) || a.push(callback); }; ScrollTrigger3.removeEventListener = function(type, callback) { var a = _listeners2[type], i = a && a.indexOf(callback); i >= 0 && a.splice(i, 1); }; ScrollTrigger3.batch = function(targets, vars) { var result = [], varsCopy = {}, interval = vars.interval || 0.016, batchMax = vars.batchMax || 1e9, proxyCallback = function proxyCallback(type, callback) { var elements = [], triggers = [], delay = gsap3.delayedCall(interval, function() { callback(elements, triggers); elements = []; triggers = []; }).pause(); return function(self2) { elements.length || delay.restart(true); elements.push(self2.trigger); triggers.push(self2); batchMax <= elements.length && delay.progress(1); }; }, p; for (p in vars) { varsCopy[p] = p.substr(0, 2) === "on" && _isFunction3(vars[p]) && p !== "onRefreshInit" ? proxyCallback(p, vars[p]) : vars[p]; } if (_isFunction3(batchMax)) { batchMax = batchMax(); _addListener3(ScrollTrigger3, "refresh", function() { return batchMax = vars.batchMax(); }); } _toArray(targets).forEach(function(target) { var config3 = {}; for (p in varsCopy) { config3[p] = varsCopy[p]; } config3.trigger = target; result.push(ScrollTrigger3.create(config3)); }); return result; }; var _clampScrollAndGetDurationMultiplier = function _clampScrollAndGetDurationMultiplier2(scrollFunc, current, end, max) { current > max ? scrollFunc(max) : current < 0 && scrollFunc(0); return end > max ? (max - current) / (end - current) : end < 0 ? current / (current - end) : 1; }; var _allowNativePanning = function _allowNativePanning2(target, direction) { if (direction === true) { target.style.removeProperty("touch-action"); } else { target.style.touchAction = direction === true ? "auto" : direction ? "pan-" + direction + (Observer.isTouch ? " pinch-zoom" : "") : "none"; } target === _docEl2 && _allowNativePanning2(_body2, direction); }; var _overflow = { auto: 1, scroll: 1 }; var _nestedScroll = function _nestedScroll2(_ref5) { var { event, target, axis } = _ref5; var node = (event.changedTouches ? event.changedTouches[0] : event).target, cache = node._gsap || gsap3.core.getCache(node), time = _getTime2(), cs; if (!cache._isScrollT || time - cache._isScrollT > 2000) { while (node && node !== _body2 && (node.scrollHeight <= node.clientHeight && node.scrollWidth <= node.clientWidth || !(_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]))) { node = node.parentNode; } cache._isScroll = node && node !== target && !_isViewport3(node) && (_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]); cache._isScrollT = time; } if (cache._isScroll || axis === "x") { event.stopPropagation(); event._gsapAllow = true; } }; var _inputObserver = function _inputObserver2(target, type, inputs, nested) { return Observer.create({ target, capture: true, debounce: false, lockAxis: true, type, onWheel: nested = nested && _nestedScroll, onPress: nested, onDrag: nested, onScroll: nested, onEnable: function onEnable() { return inputs && _addListener3(_doc4, Observer.eventTypes[0], _captureInputs, false, true); }, onDisable: function onDisable() { return _removeListener3(_doc4, Observer.eventTypes[0], _captureInputs, true); } }); }; var _inputExp = /(input|label|select|textarea)/i; var _inputIsFocused; var _captureInputs = function _captureInputs2(e) { var isInput = _inputExp.test(e.target.tagName); if (isInput || _inputIsFocused) { e._gsapAllow = true; _inputIsFocused = isInput; } }; var _getScrollNormalizer = function _getScrollNormalizer2(vars) { _isObject3(vars) || (vars = {}); vars.preventDefault = vars.isNormalizer = vars.allowClicks = true; vars.type || (vars.type = "wheel,touch"); vars.debounce = !!vars.debounce; vars.id = vars.id || "normalizer"; var _vars2 = vars, normalizeScrollX = _vars2.normalizeScrollX, momentum = _vars2.momentum, allowNestedScroll = _vars2.allowNestedScroll, onRelease = _vars2.onRelease, self2, maxY, target = _getTarget(vars.target) || _docEl2, smoother = gsap3.core.globals().ScrollSmoother, smootherInstance = smoother && smoother.get(), content = _fixIOSBug && (vars.content && _getTarget(vars.content) || smootherInstance && vars.content !== false && !smootherInstance.smooth() && smootherInstance.content()), scrollFuncY = _getScrollFunc(target, _vertical), scrollFuncX = _getScrollFunc(target, _horizontal), scale = 1, initialScale = (Observer.isTouch && _win4.visualViewport ? _win4.visualViewport.scale * _win4.visualViewport.width : _win4.outerWidth) / _win4.innerWidth, wheelRefresh = 0, resolveMomentumDuration = _isFunction3(momentum) ? function() { return momentum(self2); } : function() { return momentum || 2.8; }, lastRefreshID, skipTouchMove, inputObserver = _inputObserver(target, vars.type, true, allowNestedScroll), resumeTouchMove = function resumeTouchMove() { return skipTouchMove = false; }, scrollClampX = _passThrough3, scrollClampY = _passThrough3, updateClamps = function updateClamps() { maxY = _maxScroll(target, _vertical); scrollClampY = _clamp4(_fixIOSBug ? 1 : 0, maxY); normalizeScrollX && (scrollClampX = _clamp4(0, _maxScroll(target, _horizontal))); lastRefreshID = _refreshID; }, removeContentOffset = function removeContentOffset() { content._gsap.y = _round3(parseFloat(content._gsap.y) + scrollFuncY.offset) + "px"; content.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + parseFloat(content._gsap.y) + ", 0, 1)"; scrollFuncY.offset = scrollFuncY.cacheID = 0; }, ignoreDrag = function ignoreDrag() { if (skipTouchMove) { requestAnimationFrame(resumeTouchMove); var offset = _round3(self2.deltaY / 2), scroll = scrollClampY(scrollFuncY.v - offset); if (content && scroll !== scrollFuncY.v + scrollFuncY.offset) { scrollFuncY.offset = scroll - scrollFuncY.v; var y = _round3((parseFloat(content && content._gsap.y) || 0) - scrollFuncY.offset); content.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + y + ", 0, 1)"; content._gsap.y = y + "px"; scrollFuncY.cacheID = _scrollers.cache; _updateAll(); } return true; } scrollFuncY.offset && removeContentOffset(); skipTouchMove = true; }, tween, startScrollX, startScrollY, onStopDelayedCall, onResize = function onResize() { updateClamps(); if (tween.isActive() && tween.vars.scrollY > maxY) { scrollFuncY() > maxY ? tween.progress(1) && scrollFuncY(maxY) : tween.resetTo("scrollY", maxY); } }; content && gsap3.set(content, { y: "+=0" }); vars.ignoreCheck = function(e) { return _fixIOSBug && e.type === "touchmove" && ignoreDrag(e) || scale > 1.05 && e.type !== "touchstart" || self2.isGesturing || e.touches && e.touches.length > 1; }; vars.onPress = function() { skipTouchMove = false; var prevScale = scale; scale = _round3((_win4.visualViewport && _win4.visualViewport.scale || 1) / initialScale); tween.pause(); prevScale !== scale && _allowNativePanning(target, scale > 1.01 ? true : normalizeScrollX ? false : "x"); startScrollX = scrollFuncX(); startScrollY = scrollFuncY(); updateClamps(); lastRefreshID = _refreshID; }; vars.onRelease = vars.onGestureStart = function(self3, wasDragging) { scrollFuncY.offset && removeContentOffset(); if (!wasDragging) { onStopDelayedCall.restart(true); } else { _scrollers.cache++; var dur = resolveMomentumDuration(), currentScroll, endScroll; if (normalizeScrollX) { currentScroll = scrollFuncX(); endScroll = currentScroll + dur * 0.05 * -self3.velocityX / 0.227; dur *= _clampScrollAndGetDurationMultiplier(scrollFuncX, currentScroll, endScroll, _maxScroll(target, _horizontal)); tween.vars.scrollX = scrollClampX(endScroll); } currentScroll = scrollFuncY(); endScroll = currentScroll + dur * 0.05 * -self3.velocityY / 0.227; dur *= _clampScrollAndGetDurationMultiplier(scrollFuncY, currentScroll, endScroll, _maxScroll(target, _vertical)); tween.vars.scrollY = scrollClampY(endScroll); tween.invalidate().duration(dur).play(0.01); if (_fixIOSBug && tween.vars.scrollY >= maxY || currentScroll >= maxY - 1) { gsap3.to({}, { onUpdate: onResize, duration: dur }); } } onRelease && onRelease(self3); }; vars.onWheel = function() { tween._ts && tween.pause(); if (_getTime2() - wheelRefresh > 1000) { lastRefreshID = 0; wheelRefresh = _getTime2(); } }; vars.onChange = function(self3, dx, dy, xArray, yArray) { _refreshID !== lastRefreshID && updateClamps(); dx && normalizeScrollX && scrollFuncX(scrollClampX(xArray[2] === dx ? startScrollX + (self3.startX - self3.x) : scrollFuncX() + dx - xArray[1])); if (dy) { scrollFuncY.offset && removeContentOffset(); var isTouch = yArray[2] === dy, y = isTouch ? startScrollY + self3.startY - self3.y : scrollFuncY() + dy - yArray[1], yClamped = scrollClampY(y); isTouch && y !== yClamped && (startScrollY += yClamped - y); scrollFuncY(yClamped); } (dy || dx) && _updateAll(); }; vars.onEnable = function() { _allowNativePanning(target, normalizeScrollX ? false : "x"); ScrollTrigger3.addEventListener("refresh", onResize); _addListener3(_win4, "resize", onResize); if (scrollFuncY.smooth) { scrollFuncY.target.style.scrollBehavior = "auto"; scrollFuncY.smooth = scrollFuncX.smooth = false; } inputObserver.enable(); }; vars.onDisable = function() { _allowNativePanning(target, true); _removeListener3(_win4, "resize", onResize); ScrollTrigger3.removeEventListener("refresh", onResize); inputObserver.kill(); }; vars.lockAxis = vars.lockAxis !== false; self2 = new Observer(vars); self2.iOS = _fixIOSBug; _fixIOSBug && !scrollFuncY() && scrollFuncY(1); _fixIOSBug && gsap3.ticker.add(_passThrough3); onStopDelayedCall = self2._dc; tween = gsap3.to(self2, { ease: "power4", paused: true, inherit: false, scrollX: normalizeScrollX ? "+=0.1" : "+=0", scrollY: "+=0.1", modifiers: { scrollY: _interruptionTracker(scrollFuncY, scrollFuncY(), function() { return tween.pause(); }) }, onUpdate: _updateAll, onComplete: onStopDelayedCall.vars.onComplete }); return self2; }; ScrollTrigger3.sort = function(func) { if (_isFunction3(func)) { return _triggers.sort(func); } var scroll = _win4.pageYOffset || 0; ScrollTrigger3.getAll().forEach(function(t) { return t._sortY = t.trigger ? scroll + t.trigger.getBoundingClientRect().top : t.start + _win4.innerHeight; }); return _triggers.sort(func || function(a, b) { return (a.vars.refreshPriority || 0) * -1e6 + (a.vars.containerAnimation ? 1e6 : a._sortY) - ((b.vars.containerAnimation ? 1e6 : b._sortY) + (b.vars.refreshPriority || 0) * -1e6); }); }; ScrollTrigger3.observe = function(vars) { return new Observer(vars); }; ScrollTrigger3.normalizeScroll = function(vars) { if (typeof vars === "undefined") { return _normalizer2; } if (vars === true && _normalizer2) { return _normalizer2.enable(); } if (vars === false) { _normalizer2 && _normalizer2.kill(); _normalizer2 = vars; return; } var normalizer = vars instanceof Observer ? vars : _getScrollNormalizer(vars); _normalizer2 && _normalizer2.target === normalizer.target && _normalizer2.kill(); _isViewport3(normalizer.target) && (_normalizer2 = normalizer); return normalizer; }; ScrollTrigger3.core = { _getVelocityProp, _inputObserver, _scrollers, _proxies, bridge: { ss: function ss() { _lastScrollTime || _dispatch3("scrollStart"); _lastScrollTime = _getTime2(); }, ref: function ref() { return _refreshing; } } }; _getGSAP3() && gsap3.registerPlugin(ScrollTrigger3); // node_modules/gsap/SplitText.js /*! * SplitText 3.14.2 * https://gsap.com * * @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license. * @author: Jack Doyle */ var gsap4; var _fonts; var _splitProp = typeof Symbol === "function" ? Symbol() : "_split"; var _coreInitted4; var _initIfNecessary = () => _coreInitted4 || SplitText.register(window.gsap); var _charSegmenter = typeof Intl !== "undefined" && "Segmenter" in Intl ? new Intl.Segmenter : 0; var _toArray2 = (r) => typeof r === "string" ? _toArray2(document.querySelectorAll(r)) : ("length" in r) ? Array.from(r).reduce((acc, cur) => { typeof cur === "string" ? acc.push(..._toArray2(cur)) : acc.push(cur); return acc; }, []) : [r]; var _elements = (targets) => _toArray2(targets).filter((e) => e instanceof HTMLElement); var _emptyArray3 = []; var _context4 = function() { }; var _defaultContext = { add: (f) => f() }; var _spacesRegEx = /\s+/g; var _emojiSafeRegEx = new RegExp("\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.", "gu"); var _emptyBounds = { left: 0, top: 0, width: 0, height: 0 }; var _findNextValidBounds = (allBounds, startIndex) => { while (++startIndex < allBounds.length && allBounds[startIndex] === _emptyBounds) { } return allBounds[startIndex] || _emptyBounds; }; var _revertOriginal = ({ element, html, ariaL, ariaH }) => { element.innerHTML = html; ariaL ? element.setAttribute("aria-label", ariaL) : element.removeAttribute("aria-label"); ariaH ? element.setAttribute("aria-hidden", ariaH) : element.removeAttribute("aria-hidden"); }; var _stretchToFitSpecialChars = (collection, specialCharsRegEx) => { if (specialCharsRegEx) { let charsFound = new Set(collection.join("").match(specialCharsRegEx) || _emptyArray3), i = collection.length, slots, word, char, combined; if (charsFound.size) { while (--i > -1) { word = collection[i]; for (char of charsFound) { if (char.startsWith(word) && char.length > word.length) { slots = 0; combined = word; while (char.startsWith(combined += collection[i + ++slots]) && combined.length < char.length) { } if (slots && combined.length === char.length) { collection[i] = char; collection.splice(i + 1, slots); break; } } } } } } return collection; }; var _disallowInline = (element) => window.getComputedStyle(element).display === "inline" && (element.style.display = "inline-block"); var _insertNodeBefore = (newChild, parent, existingChild) => parent.insertBefore(typeof newChild === "string" ? document.createTextNode(newChild) : newChild, existingChild); var _getWrapper = (type, config3, collection) => { let className = config3[type + "sClass"] || "", { tag = "div", aria = "auto", propIndex = false } = config3, display = type === "line" ? "block" : "inline-block", incrementClass = className.indexOf("++") > -1, wrapper = (text) => { let el = document.createElement(tag), i = collection.length + 1; className && (el.className = className + (incrementClass ? " " + className + i : "")); propIndex && el.style.setProperty("--" + type, i + ""); aria !== "none" && el.setAttribute("aria-hidden", "true"); if (tag !== "span") { el.style.position = "relative"; el.style.display = display; } el.textContent = text; collection.push(el); return el; }; incrementClass && (className = className.replace("++", "")); wrapper.collection = collection; return wrapper; }; var _getLineWrapper = (element, nodes, config3, collection) => { let lineWrapper = _getWrapper("line", config3, collection), textAlign = window.getComputedStyle(element).textAlign || "left"; return (startIndex, endIndex) => { let newLine = lineWrapper(""); newLine.style.textAlign = textAlign; element.insertBefore(newLine, nodes[startIndex]); for (;startIndex < endIndex; startIndex++) { newLine.appendChild(nodes[startIndex]); } newLine.normalize(); }; }; var _splitWordsAndCharsRecursively = (element, config3, wordWrapper, charWrapper, prepForCharsOnly, deepSlice, ignore, charSplitRegEx, specialCharsRegEx, isNested) => { var _a; let nodes = Array.from(element.childNodes), i = 0, { wordDelimiter, reduceWhiteSpace = true, prepareText } = config3, elementBounds = element.getBoundingClientRect(), lastBounds = elementBounds, isPreformatted = !reduceWhiteSpace && window.getComputedStyle(element).whiteSpace.substring(0, 3) === "pre", ignoredPreviousSibling = 0, wordsCollection = wordWrapper.collection, wordDelimIsNotSpace, wordDelimString, wordDelimSplitter, curNode, words, curWordEl, startsWithSpace, endsWithSpace, j, bounds, curWordChars, clonedNode, curSubNode, tempSubNode, curTextContent, wordText, lastWordText, k; if (typeof wordDelimiter === "object") { wordDelimSplitter = wordDelimiter.delimiter || wordDelimiter; wordDelimString = wordDelimiter.replaceWith || ""; } else { wordDelimString = wordDelimiter === "" ? "" : wordDelimiter || " "; } wordDelimIsNotSpace = wordDelimString !== " "; for (;i < nodes.length; i++) { curNode = nodes[i]; if (curNode.nodeType === 3) { curTextContent = curNode.textContent || ""; if (reduceWhiteSpace) { curTextContent = curTextContent.replace(_spacesRegEx, " "); } else if (isPreformatted) { curTextContent = curTextContent.replace(/\n/g, wordDelimString + ` `); } prepareText && (curTextContent = prepareText(curTextContent, element)); curNode.textContent = curTextContent; words = wordDelimString || wordDelimSplitter ? curTextContent.split(wordDelimSplitter || wordDelimString) : curTextContent.match(charSplitRegEx) || _emptyArray3; lastWordText = words[words.length - 1]; endsWithSpace = wordDelimIsNotSpace ? lastWordText.slice(-1) === " " : !lastWordText; lastWordText || words.pop(); lastBounds = elementBounds; startsWithSpace = wordDelimIsNotSpace ? words[0].charAt(0) === " " : !words[0]; startsWithSpace && _insertNodeBefore(" ", element, curNode); words[0] || words.shift(); _stretchToFitSpecialChars(words, specialCharsRegEx); deepSlice && isNested || (curNode.textContent = ""); for (j = 1;j <= words.length; j++) { wordText = words[j - 1]; if (!reduceWhiteSpace && isPreformatted && wordText.charAt(0) === ` `) { (_a = curNode.previousSibling) == null || _a.remove(); _insertNodeBefore(document.createElement("br"), element, curNode); wordText = wordText.slice(1); } if (!reduceWhiteSpace && wordText === "") { _insertNodeBefore(wordDelimString, element, curNode); } else if (wordText === " ") { element.insertBefore(document.createTextNode(" "), curNode); } else { wordDelimIsNotSpace && wordText.charAt(0) === " " && _insertNodeBefore(" ", element, curNode); if (ignoredPreviousSibling && j === 1 && !startsWithSpace && wordsCollection.indexOf(ignoredPreviousSibling.parentNode) > -1) { curWordEl = wordsCollection[wordsCollection.length - 1]; curWordEl.appendChild(document.createTextNode(charWrapper ? "" : wordText)); } else { curWordEl = wordWrapper(charWrapper ? "" : wordText); _insertNodeBefore(curWordEl, element, curNode); ignoredPreviousSibling && j === 1 && !startsWithSpace && curWordEl.insertBefore(ignoredPreviousSibling, curWordEl.firstChild); } if (charWrapper) { curWordChars = _charSegmenter ? _stretchToFitSpecialChars([..._charSegmenter.segment(wordText)].map((s) => s.segment), specialCharsRegEx) : wordText.match(charSplitRegEx) || _emptyArray3; for (k = 0;k < curWordChars.length; k++) { curWordEl.appendChild(curWordChars[k] === " " ? document.createTextNode(" ") : charWrapper(curWordChars[k])); } } if (deepSlice && isNested) { curTextContent = curNode.textContent = curTextContent.substring(wordText.length + 1, curTextContent.length); bounds = curWordEl.getBoundingClientRect(); if (bounds.top > lastBounds.top && bounds.left <= lastBounds.left) { clonedNode = element.cloneNode(); curSubNode = element.childNodes[0]; while (curSubNode && curSubNode !== curWordEl) { tempSubNode = curSubNode; curSubNode = curSubNode.nextSibling; clonedNode.appendChild(tempSubNode); } element.parentNode.insertBefore(clonedNode, element); prepForCharsOnly && _disallowInline(clonedNode); } lastBounds = bounds; } if (j < words.length || endsWithSpace) { _insertNodeBefore(j >= words.length ? " " : wordDelimIsNotSpace && wordText.slice(-1) === " " ? " " + wordDelimString : wordDelimString, element, curNode); } } } element.removeChild(curNode); ignoredPreviousSibling = 0; } else if (curNode.nodeType === 1) { if (ignore && ignore.indexOf(curNode) > -1) { wordsCollection.indexOf(curNode.previousSibling) > -1 && wordsCollection[wordsCollection.length - 1].appendChild(curNode); ignoredPreviousSibling = curNode; } else { _splitWordsAndCharsRecursively(curNode, config3, wordWrapper, charWrapper, prepForCharsOnly, deepSlice, ignore, charSplitRegEx, specialCharsRegEx, true); ignoredPreviousSibling = 0; } prepForCharsOnly && _disallowInline(curNode); } } }; var _SplitText = class _SplitText2 { constructor(elements, config3) { this.isSplit = false; _initIfNecessary(); this.elements = _elements(elements); this.chars = []; this.words = []; this.lines = []; this.masks = []; this.vars = config3; this.elements.forEach((el) => { var _a; config3.overwrite !== false && ((_a = el[_splitProp]) == null || _a._data.orig.filter(({ element }) => element === el).forEach(_revertOriginal)); el[_splitProp] = this; }); this._split = () => this.isSplit && this.split(this.vars); let orig = [], timerId, checkWidths = () => { let i = orig.length, o; while (i--) { o = orig[i]; let w = o.element.offsetWidth; if (w !== o.width) { o.width = w; this._split(); return; } } }; this._data = { orig, obs: typeof ResizeObserver !== "undefined" && new ResizeObserver(() => { clearTimeout(timerId); timerId = setTimeout(checkWidths, 200); }) }; _context4(this); this.split(config3); } split(config3) { (this._ctx || _defaultContext).add(() => { this.isSplit && this.revert(); this.vars = config3 = config3 || this.vars || {}; let { type = "chars,words,lines", aria = "auto", deepSlice = true, smartWrap, onSplit, autoSplit = false, specialChars, mask } = this.vars, splitLines = type.indexOf("lines") > -1, splitCharacters = type.indexOf("chars") > -1, splitWords = type.indexOf("words") > -1, onlySplitCharacters = splitCharacters && !splitWords && !splitLines, specialCharsRegEx = specialChars && ("push" in specialChars ? new RegExp("(?:" + specialChars.join("|") + ")", "gu") : specialChars), finalCharSplitRegEx = specialCharsRegEx ? new RegExp(specialCharsRegEx.source + "|" + _emojiSafeRegEx.source, "gu") : _emojiSafeRegEx, ignore = !!config3.ignore && _elements(config3.ignore), { orig, animTime, obs } = this._data, onSplitResult; if (splitCharacters || splitWords || splitLines) { this.elements.forEach((element, index) => { orig[index] = { element, html: element.innerHTML, ariaL: element.getAttribute("aria-label"), ariaH: element.getAttribute("aria-hidden") }; aria === "auto" ? element.setAttribute("aria-label", (element.textContent || "").trim()) : aria === "hidden" && element.setAttribute("aria-hidden", "true"); let chars = [], words = [], lines = [], charWrapper = splitCharacters ? _getWrapper("char", config3, chars) : null, wordWrapper = _getWrapper("word", config3, words), i, curWord, smartWrapSpan, nextSibling; _splitWordsAndCharsRecursively(element, config3, wordWrapper, charWrapper, onlySplitCharacters, deepSlice && (splitLines || onlySplitCharacters), ignore, finalCharSplitRegEx, specialCharsRegEx, false); if (splitLines) { let nodes = _toArray2(element.childNodes), wrapLine = _getLineWrapper(element, nodes, config3, lines), curNode, toRemove = [], lineStartIndex = 0, allBounds = nodes.map((n) => n.nodeType === 1 ? n.getBoundingClientRect() : _emptyBounds), lastBounds = _emptyBounds, curBounds; for (i = 0;i < nodes.length; i++) { curNode = nodes[i]; if (curNode.nodeType === 1) { if (curNode.nodeName === "BR") { if (!i || nodes[i - 1].nodeName !== "BR") { toRemove.push(curNode); wrapLine(lineStartIndex, i + 1); } lineStartIndex = i + 1; lastBounds = _findNextValidBounds(allBounds, i); } else { curBounds = allBounds[i]; if (i && curBounds.top > lastBounds.top && curBounds.left < lastBounds.left + lastBounds.width - 1) { wrapLine(lineStartIndex, i); lineStartIndex = i; } lastBounds = curBounds; } } } lineStartIndex < i && wrapLine(lineStartIndex, i); toRemove.forEach((el) => { var _a; return (_a = el.parentNode) == null ? undefined : _a.removeChild(el); }); } if (!splitWords) { for (i = 0;i < words.length; i++) { curWord = words[i]; if (splitCharacters || !curWord.nextSibling || curWord.nextSibling.nodeType !== 3) { if (smartWrap && !splitLines) { smartWrapSpan = document.createElement("span"); smartWrapSpan.style.whiteSpace = "nowrap"; while (curWord.firstChild) { smartWrapSpan.appendChild(curWord.firstChild); } curWord.replaceWith(smartWrapSpan); } else { curWord.replaceWith(...curWord.childNodes); } } else { nextSibling = curWord.nextSibling; if (nextSibling && nextSibling.nodeType === 3) { nextSibling.textContent = (curWord.textContent || "") + (nextSibling.textContent || ""); curWord.remove(); } } } words.length = 0; element.normalize(); } this.lines.push(...lines); this.words.push(...words); this.chars.push(...chars); }); mask && this[mask] && this.masks.push(...this[mask].map((el) => { let maskEl = el.cloneNode(); el.replaceWith(maskEl); maskEl.appendChild(el); el.className && (maskEl.className = el.className.trim() + "-mask"); maskEl.style.overflow = "clip"; return maskEl; })); } this.isSplit = true; _fonts && splitLines && (autoSplit ? _fonts.addEventListener("loadingdone", this._split) : _fonts.status === "loading" && console.warn("SplitText called before fonts loaded")); if ((onSplitResult = onSplit && onSplit(this)) && onSplitResult.totalTime) { this._data.anim = animTime ? onSplitResult.totalTime(animTime) : onSplitResult; } splitLines && autoSplit && this.elements.forEach((element, index) => { orig[index].width = element.offsetWidth; obs && obs.observe(element); }); }); return this; } kill() { let { obs } = this._data; obs && obs.disconnect(); _fonts == null || _fonts.removeEventListener("loadingdone", this._split); } revert() { var _a, _b; if (this.isSplit) { let { orig, anim } = this._data; this.kill(); orig.forEach(_revertOriginal); this.chars.length = this.words.length = this.lines.length = orig.length = this.masks.length = 0; this.isSplit = false; if (anim) { this._data.animTime = anim.totalTime(); anim.revert(); } (_b = (_a = this.vars).onRevert) == null || _b.call(_a, this); } return this; } static create(elements, config3) { return new _SplitText2(elements, config3); } static register(core) { gsap4 = gsap4 || core || window.gsap; if (gsap4) { _toArray2 = gsap4.utils.toArray; _context4 = gsap4.core.context || _context4; } if (!_coreInitted4 && window.innerWidth > 0) { _fonts = document.fonts; _coreInitted4 = true; } } }; _SplitText.version = "3.14.2"; var SplitText = _SplitText; // node_modules/gsap/utils/paths.js /*! * paths 3.14.2 * https://gsap.com * * Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var _svgPathExp = /[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig; var _scientific = /[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig; var _DEG2RAD2 = Math.PI / 180; var _RAD2DEG2 = 180 / Math.PI; var _sin2 = Math.sin; var _cos2 = Math.cos; var _abs2 = Math.abs; var _sqrt2 = Math.sqrt; var _isNumber5 = function _isNumber6(value) { return typeof value === "number"; }; var _roundingNum = 1e5; var _round5 = function _round6(value) { return Math.round(value * _roundingNum) / _roundingNum || 0; }; var _segmentIsClosed = function _segmentIsClosed2(segment) { return segment.closed = Math.abs(segment[0] - segment[segment.length - 2]) < 0.001 && Math.abs(segment[1] - segment[segment.length - 1]) < 0.001; }; function transformRawPath(rawPath, a, b, c, d, tx, ty) { var j = rawPath.length, segment, l, i, x, y; while (--j > -1) { segment = rawPath[j]; l = segment.length; for (i = 0;i < l; i += 2) { x = segment[i]; y = segment[i + 1]; segment[i] = x * a + y * c + tx; segment[i + 1] = x * b + y * d + ty; } } rawPath._dirty = 1; return rawPath; } function arcToSegment(lastX, lastY, rx, ry, angle, largeArcFlag, sweepFlag, x, y) { if (lastX === x && lastY === y) { return; } rx = _abs2(rx); ry = _abs2(ry); var angleRad = angle % 360 * _DEG2RAD2, cosAngle = _cos2(angleRad), sinAngle = _sin2(angleRad), PI = Math.PI, TWOPI = PI * 2, dx2 = (lastX - x) / 2, dy2 = (lastY - y) / 2, x1 = cosAngle * dx2 + sinAngle * dy2, y1 = -sinAngle * dx2 + cosAngle * dy2, x1_sq = x1 * x1, y1_sq = y1 * y1, radiiCheck = x1_sq / (rx * rx) + y1_sq / (ry * ry); if (radiiCheck > 1) { rx = _sqrt2(radiiCheck) * rx; ry = _sqrt2(radiiCheck) * ry; } var rx_sq = rx * rx, ry_sq = ry * ry, sq = (rx_sq * ry_sq - rx_sq * y1_sq - ry_sq * x1_sq) / (rx_sq * y1_sq + ry_sq * x1_sq); if (sq < 0) { sq = 0; } var coef = (largeArcFlag === sweepFlag ? -1 : 1) * _sqrt2(sq), cx1 = coef * (rx * y1 / ry), cy1 = coef * -(ry * x1 / rx), sx2 = (lastX + x) / 2, sy2 = (lastY + y) / 2, cx = sx2 + (cosAngle * cx1 - sinAngle * cy1), cy = sy2 + (sinAngle * cx1 + cosAngle * cy1), ux = (x1 - cx1) / rx, uy = (y1 - cy1) / ry, vx = (-x1 - cx1) / rx, vy = (-y1 - cy1) / ry, temp = ux * ux + uy * uy, angleStart = (uy < 0 ? -1 : 1) * Math.acos(ux / _sqrt2(temp)), angleExtent = (ux * vy - uy * vx < 0 ? -1 : 1) * Math.acos((ux * vx + uy * vy) / _sqrt2(temp * (vx * vx + vy * vy))); isNaN(angleExtent) && (angleExtent = PI); if (!sweepFlag && angleExtent > 0) { angleExtent -= TWOPI; } else if (sweepFlag && angleExtent < 0) { angleExtent += TWOPI; } angleStart %= TWOPI; angleExtent %= TWOPI; var segments = Math.ceil(_abs2(angleExtent) / (TWOPI / 4)), rawPath = [], angleIncrement = angleExtent / segments, controlLength = 4 / 3 * _sin2(angleIncrement / 2) / (1 + _cos2(angleIncrement / 2)), ma = cosAngle * rx, mb = sinAngle * rx, mc = sinAngle * -ry, md = cosAngle * ry, i; for (i = 0;i < segments; i++) { angle = angleStart + i * angleIncrement; x1 = _cos2(angle); y1 = _sin2(angle); ux = _cos2(angle += angleIncrement); uy = _sin2(angle); rawPath.push(x1 - controlLength * y1, y1 + controlLength * x1, ux + controlLength * uy, uy - controlLength * ux, ux, uy); } for (i = 0;i < rawPath.length; i += 2) { x1 = rawPath[i]; y1 = rawPath[i + 1]; rawPath[i] = x1 * ma + y1 * mc + cx; rawPath[i + 1] = x1 * mb + y1 * md + cy; } rawPath[i - 2] = x; rawPath[i - 1] = y; return rawPath; } function stringToRawPath(d) { var a = (d + "").replace(_scientific, function(m) { var n = +m; return n < 0.0001 && n > -0.0001 ? 0 : n; }).match(_svgPathExp) || [], path = [], relativeX = 0, relativeY = 0, twoThirds = 2 / 3, elements = a.length, points = 0, errorMessage = "ERROR: malformed path: " + d, i, j, x, y, command, isRelative, segment, startX, startY, difX, difY, beziers, prevCommand, flag1, flag2, line = function line(sx, sy, ex, ey) { difX = (ex - sx) / 3; difY = (ey - sy) / 3; segment.push(sx + difX, sy + difY, ex - difX, ey - difY, ex, ey); }; if (!d || !isNaN(a[0]) || isNaN(a[1])) { console.log(errorMessage); return path; } for (i = 0;i < elements; i++) { prevCommand = command; if (isNaN(a[i])) { command = a[i].toUpperCase(); isRelative = command !== a[i]; } else { i--; } x = +a[i + 1]; y = +a[i + 2]; if (isRelative) { x += relativeX; y += relativeY; } if (!i) { startX = x; startY = y; } if (command === "M") { if (segment) { if (segment.length < 8) { path.length -= 1; } else { points += segment.length; } _segmentIsClosed(segment); } relativeX = startX = x; relativeY = startY = y; segment = [x, y]; path.push(segment); i += 2; command = "L"; } else if (command === "C") { if (!segment) { segment = [0, 0]; } if (!isRelative) { relativeX = relativeY = 0; } segment.push(x, y, relativeX + a[i + 3] * 1, relativeY + a[i + 4] * 1, relativeX += a[i + 5] * 1, relativeY += a[i + 6] * 1); i += 6; } else if (command === "S") { difX = relativeX; difY = relativeY; if (prevCommand === "C" || prevCommand === "S") { difX += relativeX - segment[segment.length - 4]; difY += relativeY - segment[segment.length - 3]; } if (!isRelative) { relativeX = relativeY = 0; } segment.push(difX, difY, x, y, relativeX += a[i + 3] * 1, relativeY += a[i + 4] * 1); i += 4; } else if (command === "Q") { difX = relativeX + (x - relativeX) * twoThirds; difY = relativeY + (y - relativeY) * twoThirds; if (!isRelative) { relativeX = relativeY = 0; } relativeX += a[i + 3] * 1; relativeY += a[i + 4] * 1; segment.push(difX, difY, relativeX + (x - relativeX) * twoThirds, relativeY + (y - relativeY) * twoThirds, relativeX, relativeY); i += 4; } else if (command === "T") { difX = relativeX - segment[segment.length - 4]; difY = relativeY - segment[segment.length - 3]; segment.push(relativeX + difX, relativeY + difY, x + (relativeX + difX * 1.5 - x) * twoThirds, y + (relativeY + difY * 1.5 - y) * twoThirds, relativeX = x, relativeY = y); i += 2; } else if (command === "H") { line(relativeX, relativeY, relativeX = x, relativeY); i += 1; } else if (command === "V") { line(relativeX, relativeY, relativeX, relativeY = x + (isRelative ? relativeY - relativeX : 0)); i += 1; } else if (command === "L" || command === "Z") { if (command === "Z") { x = startX; y = startY; segment.closed = true; } if (command === "L" || _abs2(relativeX - x) > 0.5 || _abs2(relativeY - y) > 0.5) { line(relativeX, relativeY, x, y); if (command === "L") { i += 2; } } relativeX = x; relativeY = y; } else if (command === "A") { flag1 = a[i + 4]; flag2 = a[i + 5]; difX = a[i + 6]; difY = a[i + 7]; j = 7; if (flag1.length > 1) { if (flag1.length < 3) { difY = difX; difX = flag2; j--; } else { difY = flag2; difX = flag1.substr(2); j -= 2; } flag2 = flag1.charAt(1); flag1 = flag1.charAt(0); } beziers = arcToSegment(relativeX, relativeY, +a[i + 1], +a[i + 2], +a[i + 3], +flag1, +flag2, (isRelative ? relativeX : 0) + difX * 1, (isRelative ? relativeY : 0) + difY * 1); i += j; if (beziers) { for (j = 0;j < beziers.length; j++) { segment.push(beziers[j]); } } relativeX = segment[segment.length - 2]; relativeY = segment[segment.length - 1]; } else { console.log(errorMessage); } } i = segment.length; if (i < 6) { path.pop(); i = 0; } else { _segmentIsClosed(segment); } path.totalPoints = points + i; return path; } function rawPathToString(rawPath) { if (_isNumber5(rawPath[0])) { rawPath = [rawPath]; } var result = "", l = rawPath.length, sl, s, i, segment; for (s = 0;s < l; s++) { segment = rawPath[s]; result += "M" + _round5(segment[0]) + "," + _round5(segment[1]) + " C"; sl = segment.length; for (i = 2;i < sl; i++) { result += _round5(segment[i++]) + "," + _round5(segment[i++]) + " " + _round5(segment[i++]) + "," + _round5(segment[i++]) + " " + _round5(segment[i++]) + "," + _round5(segment[i]) + " "; } if (segment.closed) { result += "z"; } } return result; } // node_modules/gsap/CustomEase.js /*! * CustomEase 3.14.2 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var gsap5; var _coreInitted5; var _getGSAP5 = function _getGSAP6() { return gsap5 || typeof window !== "undefined" && (gsap5 = window.gsap) && gsap5.registerPlugin && gsap5; }; var _initCore5 = function _initCore6() { gsap5 = _getGSAP5(); if (gsap5) { gsap5.registerEase("_CE", CustomEase.create); _coreInitted5 = 1; } else { console.warn("Please gsap.registerPlugin(CustomEase)"); } }; var _bigNum3 = 100000000000000000000; var _round7 = function _round8(value) { return ~~(value * 1000 + (value < 0 ? -0.5 : 0.5)) / 1000; }; var _bonusValidated = 1; var _numExp2 = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi; var _needsParsingExp = /[cLlsSaAhHvVtTqQ]/g; var _findMinimum = function _findMinimum2(values) { var l = values.length, min = _bigNum3, i; for (i = 1;i < l; i += 6) { +values[i] < min && (min = +values[i]); } return min; }; var _normalize = function _normalize2(values, height, originY) { if (!originY && originY !== 0) { originY = Math.max(+values[values.length - 1], +values[1]); } var tx = +values[0] * -1, ty = -originY, l = values.length, sx = 1 / (+values[l - 2] + tx), sy = -height || (Math.abs(+values[l - 1] - +values[1]) < 0.01 * (+values[l - 2] - +values[0]) ? _findMinimum(values) + ty : +values[l - 1] + ty), i; if (sy) { sy = 1 / sy; } else { sy = -sx; } for (i = 0;i < l; i += 2) { values[i] = (+values[i] + tx) * sx; values[i + 1] = (+values[i + 1] + ty) * sy; } }; var _bezierToPoints = function _bezierToPoints2(x1, y1, x2, y2, x3, y3, x4, y4, threshold, points, index) { var x12 = (x1 + x2) / 2, y12 = (y1 + y2) / 2, x23 = (x2 + x3) / 2, y23 = (y2 + y3) / 2, x34 = (x3 + x4) / 2, y34 = (y3 + y4) / 2, x123 = (x12 + x23) / 2, y123 = (y12 + y23) / 2, x234 = (x23 + x34) / 2, y234 = (y23 + y34) / 2, x1234 = (x123 + x234) / 2, y1234 = (y123 + y234) / 2, dx = x4 - x1, dy = y4 - y1, d2 = Math.abs((x2 - x4) * dy - (y2 - y4) * dx), d3 = Math.abs((x3 - x4) * dy - (y3 - y4) * dx), length; if (!points) { points = [{ x: x1, y: y1 }, { x: x4, y: y4 }]; index = 1; } points.splice(index || points.length - 1, 0, { x: x1234, y: y1234 }); if ((d2 + d3) * (d2 + d3) > threshold * (dx * dx + dy * dy)) { length = points.length; _bezierToPoints2(x1, y1, x12, y12, x123, y123, x1234, y1234, threshold, points, index); _bezierToPoints2(x1234, y1234, x234, y234, x34, y34, x4, y4, threshold, points, index + 1 + (points.length - length)); } return points; }; var CustomEase = /* @__PURE__ */ function() { function CustomEase2(id, data, config3) { _coreInitted5 || _initCore5(); this.id = id; _bonusValidated && this.setData(data, config3); } var _proto = CustomEase2.prototype; _proto.setData = function setData(data, config3) { config3 = config3 || {}; data = data || "0,0,1,1"; var values = data.match(_numExp2), closest = 1, points = [], lookup = [], precision = config3.precision || 1, fast = precision <= 1, l, a1, a2, i, inc, j, point, prevPoint, p; this.data = data; if (_needsParsingExp.test(data) || ~data.indexOf("M") && data.indexOf("C") < 0) { values = stringToRawPath(data)[0]; } l = values.length; if (l === 4) { values.unshift(0, 0); values.push(1, 1); l = 8; } else if ((l - 2) % 6) { throw "Invalid CustomEase"; } if (+values[0] !== 0 || +values[l - 2] !== 1) { _normalize(values, config3.height, config3.originY); } this.segment = values; for (i = 2;i < l; i += 6) { a1 = { x: +values[i - 2], y: +values[i - 1] }; a2 = { x: +values[i + 4], y: +values[i + 5] }; points.push(a1, a2); _bezierToPoints(a1.x, a1.y, +values[i], +values[i + 1], +values[i + 2], +values[i + 3], a2.x, a2.y, 1 / (precision * 200000), points, points.length - 1); } l = points.length; for (i = 0;i < l; i++) { point = points[i]; prevPoint = points[i - 1] || point; if ((point.x > prevPoint.x || prevPoint.y !== point.y && prevPoint.x === point.x || point === prevPoint) && point.x <= 1) { prevPoint.cx = point.x - prevPoint.x; prevPoint.cy = point.y - prevPoint.y; prevPoint.n = point; prevPoint.nx = point.x; if (fast && i > 1 && Math.abs(prevPoint.cy / prevPoint.cx - points[i - 2].cy / points[i - 2].cx) > 2) { fast = 0; } if (prevPoint.cx < closest) { if (!prevPoint.cx) { prevPoint.cx = 0.001; if (i === l - 1) { prevPoint.x -= 0.001; closest = Math.min(closest, 0.001); fast = 0; } } else { closest = prevPoint.cx; } } } else { points.splice(i--, 1); l--; } } l = 1 / closest + 1 | 0; inc = 1 / l; j = 0; point = points[0]; if (fast) { for (i = 0;i < l; i++) { p = i * inc; if (point.nx < p) { point = points[++j]; } a1 = point.y + (p - point.x) / point.cx * point.cy; lookup[i] = { x: p, cx: inc, y: a1, cy: 0, nx: 9 }; if (i) { lookup[i - 1].cy = a1 - lookup[i - 1].y; } } j = points[points.length - 1]; lookup[l - 1].cy = j.y - a1; lookup[l - 1].cx = j.x - lookup[lookup.length - 1].x; } else { for (i = 0;i < l; i++) { if (point.nx < i * inc) { point = points[++j]; } lookup[i] = point; } if (j < points.length - 1) { lookup[i - 1] = points[points.length - 2]; } } this.ease = function(p2) { var point2 = lookup[p2 * l | 0] || lookup[l - 1]; if (point2.nx < p2) { point2 = point2.n; } return point2.y + (p2 - point2.x) / point2.cx * point2.cy; }; this.ease.custom = this; this.id && gsap5 && gsap5.registerEase(this.id, this.ease); return this; }; _proto.getSVGData = function getSVGData(config3) { return CustomEase2.getSVGData(this, config3); }; CustomEase2.create = function create(id, data, config3) { return new CustomEase2(id, data, config3).ease; }; CustomEase2.register = function register(core) { gsap5 = core; _initCore5(); }; CustomEase2.get = function get(id) { return gsap5.parseEase(id); }; CustomEase2.getSVGData = function getSVGData(ease, config3) { config3 = config3 || {}; var width = config3.width || 100, height = config3.height || 100, x = config3.x || 0, y = (config3.y || 0) + height, e = gsap5.utils.toArray(config3.path)[0], a, slope, i, inc, tx, ty, precision, threshold, prevX, prevY; if (config3.invert) { height = -height; y = 0; } if (typeof ease === "string") { ease = gsap5.parseEase(ease); } if (ease.custom) { ease = ease.custom; } if (ease instanceof CustomEase2) { a = rawPathToString(transformRawPath([ease.segment.slice(0)], width, 0, 0, -height, x, y)); } else { a = [x, y]; precision = Math.max(5, (config3.precision || 1) * 200); inc = 1 / precision; precision += 2; threshold = 5 / precision; prevX = _round7(x + inc * width); prevY = _round7(y + ease(inc) * -height); slope = (prevY - y) / (prevX - x); for (i = 2;i < precision; i++) { tx = _round7(x + i * inc * width); ty = _round7(y + ease(i * inc) * -height); if (Math.abs((ty - prevY) / (tx - prevX) - slope) > threshold || i === precision - 1) { a.push(prevX, prevY); slope = (ty - prevY) / (tx - prevX); } prevX = tx; prevY = ty; } a = "M" + a.join(","); } e && e.setAttribute("d", a); return a; }; return CustomEase2; }(); CustomEase.version = "3.14.2"; CustomEase.headless = true; _getGSAP5() && gsap5.registerPlugin(CustomEase); // src/utils/media.ts var prefersReducedMotion = () => { return window.matchMedia("(prefers-reduced-motion: reduce)").matches; }; // src/lib/gsap.ts gsapWithCSS.registerPlugin(ScrollTrigger3, CustomEase); CustomEase.create("parallax", ".77, 0, .175, 1"); var defaults2 = { ease: "expo.out", duration: 1.2 }; gsapWithCSS.defaults(defaults2); var reduced = prefersReducedMotion(); var gsap_default = gsapWithCSS; // src/webflow/detect-editor.ts function handleEditor(onEditorView = null) { const checkEditorState = () => { const firstChild = document.body.firstElementChild; return firstChild instanceof HTMLElement && firstChild.classList.contains("w-editor-publish-node"); }; let previousState = checkEditorState(); const isEditor = previousState; const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === "childList") { const newIsEditor = checkEditorState(); if (newIsEditor !== previousState) { console.log("Editor state changed to:", newIsEditor); if (onEditorView) { onEditorView(newIsEditor); } previousState = newIsEditor; } } }); }); observer.observe(document.body, { childList: true, subtree: false }); if (onEditorView) { onEditorView(isEditor); } return isEditor; } // src/lib/scroll.ts var SCROLL_CONFIG = { infinite: false, lerp: 0.1, smoothWheel: true, touchMultiplier: 2 }; class _Scroll extends Lenis { #ticker = gsap_default.ticker.add((time) => this.raf(time * 1000)); constructor() { super(SCROLL_CONFIG); this.on("scroll", this.#scroll.bind(this)); } #scroll(data) { this.notify(data); } toTop() { this.scrollTo(0, { immediate: true }); } scrollToAnchor(target) { this.scrollTo(target, { offset: 0, duration: 1.2 }); } #subscribers = []; add(fn, priority = 0, id = Symbol()) { const index = this.#subscribers.findIndex((sub) => sub.priority > priority); if (index === -1) { this.#subscribers.push({ fn, priority, id }); } else { this.#subscribers.splice(index, 0, { fn, priority, id }); } return () => this.remove(id); } remove(id) { this.#subscribers = this.#subscribers.filter((f) => f.id !== id); } notify(data) { if (this.#subscribers.length < 1) return; this.#subscribers.forEach((f) => f.fn(data)); } } var Scroll = new _Scroll; handleEditor((isEditor) => { if (isEditor) { Scroll.destroy(); } else { Scroll.start(); } }); // node_modules/selector-set/selector-set.next.js function SelectorSet() { if (!(this instanceof SelectorSet)) { return new SelectorSet; } this.size = 0; this.uid = 0; this.selectors = []; this.selectorObjects = {}; this.indexes = Object.create(this.indexes); this.activeIndexes = []; } var docElem = window.document.documentElement; var matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector; SelectorSet.prototype.matchesSelector = function(el, selector3) { return matches.call(el, selector3); }; SelectorSet.prototype.querySelectorAll = function(selectors, context3) { return context3.querySelectorAll(selectors); }; SelectorSet.prototype.indexes = []; var idRe = /^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g; SelectorSet.prototype.indexes.push({ name: "ID", selector: function matchIdSelector(sel) { var m; if (m = sel.match(idRe)) { return m[0].slice(1); } }, element: function getElementId(el) { if (el.id) { return [el.id]; } } }); var classRe = /^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g; SelectorSet.prototype.indexes.push({ name: "CLASS", selector: function matchClassSelector(sel) { var m; if (m = sel.match(classRe)) { return m[0].slice(1); } }, element: function getElementClassNames(el) { var className = el.className; if (className) { if (typeof className === "string") { return className.split(/\s/); } else if (typeof className === "object" && "baseVal" in className) { return className.baseVal.split(/\s/); } } } }); var tagRe = /^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g; SelectorSet.prototype.indexes.push({ name: "TAG", selector: function matchTagSelector(sel) { var m; if (m = sel.match(tagRe)) { return m[0].toUpperCase(); } }, element: function getElementTagName(el) { return [el.nodeName.toUpperCase()]; } }); SelectorSet.prototype.indexes["default"] = { name: "UNIVERSAL", selector: function() { return true; }, element: function() { return [true]; } }; var Map2; if (typeof window.Map === "function") { Map2 = window.Map; } else { Map2 = function() { function Map3() { this.map = {}; } Map3.prototype.get = function(key) { return this.map[key + " "]; }; Map3.prototype.set = function(key, value) { this.map[key + " "] = value; }; return Map3; }(); } var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g; function parseSelectorIndexes(allIndexes, selector3) { allIndexes = allIndexes.slice(0).concat(allIndexes["default"]); var allIndexesLen = allIndexes.length, i, j, m, dup, rest = selector3, key, index, indexes = []; do { chunker.exec(""); if (m = chunker.exec(rest)) { rest = m[3]; if (m[2] || !rest) { for (i = 0;i < allIndexesLen; i++) { index = allIndexes[i]; if (key = index.selector(m[1])) { j = indexes.length; dup = false; while (j--) { if (indexes[j].index === index && indexes[j].key === key) { dup = true; break; } } if (!dup) { indexes.push({ index, key }); } break; } } } } } while (m); return indexes; } function findByPrototype(ary, proto) { var i, len, item; for (i = 0, len = ary.length;i < len; i++) { item = ary[i]; if (proto.isPrototypeOf(item)) { return item; } } } SelectorSet.prototype.logDefaultIndexUsed = function() { }; SelectorSet.prototype.add = function(selector3, data) { var obj, i, indexProto, key, index, objs, selectorIndexes, selectorIndex, indexes = this.activeIndexes, selectors = this.selectors, selectorObjects = this.selectorObjects; if (typeof selector3 !== "string") { return; } obj = { id: this.uid++, selector: selector3, data }; selectorObjects[obj.id] = obj; selectorIndexes = parseSelectorIndexes(this.indexes, selector3); for (i = 0;i < selectorIndexes.length; i++) { selectorIndex = selectorIndexes[i]; key = selectorIndex.key; indexProto = selectorIndex.index; index = findByPrototype(indexes, indexProto); if (!index) { index = Object.create(indexProto); index.map = new Map2; indexes.push(index); } if (indexProto === this.indexes["default"]) { this.logDefaultIndexUsed(obj); } objs = index.map.get(key); if (!objs) { objs = []; index.map.set(key, objs); } objs.push(obj); } this.size++; selectors.push(selector3); }; SelectorSet.prototype.remove = function(selector3, data) { if (typeof selector3 !== "string") { return; } var selectorIndexes, selectorIndex, i, j, k, selIndex, objs, obj, indexes = this.activeIndexes, selectors = this.selectors = [], selectorObjects = this.selectorObjects, removedIds = {}, removeAll = arguments.length === 1; selectorIndexes = parseSelectorIndexes(this.indexes, selector3); for (i = 0;i < selectorIndexes.length; i++) { selectorIndex = selectorIndexes[i]; j = indexes.length; while (j--) { selIndex = indexes[j]; if (selectorIndex.index.isPrototypeOf(selIndex)) { objs = selIndex.map.get(selectorIndex.key); if (objs) { k = objs.length; while (k--) { obj = objs[k]; if (obj.selector === selector3 && (removeAll || obj.data === data)) { objs.splice(k, 1); removedIds[obj.id] = true; } } } break; } } } for (i in removedIds) { delete selectorObjects[i]; this.size--; } for (i in selectorObjects) { selectors.push(selectorObjects[i].selector); } }; function sortById(a, b) { return a.id - b.id; } SelectorSet.prototype.queryAll = function(context3) { if (!this.selectors.length) { return []; } var matches2 = {}, results = []; var els = this.querySelectorAll(this.selectors.join(", "), context3); var i, j, len, len2, el, m, match, obj; for (i = 0, len = els.length;i < len; i++) { el = els[i]; m = this.matches(el); for (j = 0, len2 = m.length;j < len2; j++) { obj = m[j]; if (!matches2[obj.id]) { match = { id: obj.id, selector: obj.selector, data: obj.data, elements: [] }; matches2[obj.id] = match; results.push(match); } else { match = matches2[obj.id]; } match.elements.push(el); } } return results.sort(sortById); }; SelectorSet.prototype.matches = function(el) { if (!el) { return []; } var i, j, k, len, len2, len3, index, keys, objs, obj, id; var indexes = this.activeIndexes, matchedIds = {}, matches2 = []; for (i = 0, len = indexes.length;i < len; i++) { index = indexes[i]; keys = index.element(el); if (keys) { for (j = 0, len2 = keys.length;j < len2; j++) { if (objs = index.map.get(keys[j])) { for (k = 0, len3 = objs.length;k < len3; k++) { obj = objs[k]; id = obj.id; if (!matchedIds[id] && this.matchesSelector(el, obj.selector)) { matchedIds[id] = true; matches2.push(obj); } } } } } } return matches2.sort(sortById); }; // node_modules/@unseenco/e/src/utils.js var eventTypes = {}; var listeners = {}; var nonBubblers = ["mouseenter", "mouseleave", "pointerenter", "pointerleave", "blur", "focus"]; function makeBusStack(event) { if (listeners[event] === undefined) { listeners[event] = new Set; } } function triggerBus(event, args) { if (listeners[event]) { listeners[event].forEach((cb) => { cb(...args); }); } } function maybeRunQuerySelector(el) { return typeof el === "string" ? document.querySelectorAll(el) : el; } function handleDelegation(e) { let matches2 = traverse(eventTypes[e.type], e.target); if (matches2.length) { for (let i = 0;i < matches2.length; i++) { for (let i2 = 0;i2 < matches2[i].stack.length; i2++) { if (nonBubblers.indexOf(e.type) !== -1) { addDelegateTarget(e, matches2[i].delegatedTarget); if (e.target === matches2[i].delegatedTarget) { matches2[i].stack[i2].data(e); } } else { addDelegateTarget(e, matches2[i].delegatedTarget); matches2[i].stack[i2].data(e); } } } } } function traverse(listeners2, target) { const queue = []; let node = target; do { if (node.nodeType !== 1) { break; } const matches2 = listeners2.matches(node); if (matches2.length) { queue.push({ delegatedTarget: node, stack: matches2 }); } } while (node = node.parentElement); return queue; } function addDelegateTarget(event, delegatedTarget) { Object.defineProperty(event, "currentTarget", { configurable: true, enumerable: true, get: () => delegatedTarget }); } function clone(object) { const copy = {}; for (const key in object) { copy[key] = [...object[key]]; } return copy; } // node_modules/@unseenco/e/src/e.js class E { bindAll(context3, methods) { if (!methods) { methods = Object.getOwnPropertyNames(Object.getPrototypeOf(context3)); } for (let i = 0;i < methods.length; i++) { context3[methods[i]] = context3[methods[i]].bind(context3); } } on(event, el, callback, options) { const events = event.split(" "); for (let i = 0;i < events.length; i++) { if (typeof el === "function" && callback === undefined) { makeBusStack(events[i]); listeners[events[i]].add(el); continue; } if (el.nodeType && el.nodeType === 1 || el === window || el === document) { el.addEventListener(events[i], callback, options); continue; } el = maybeRunQuerySelector(el); for (let n = 0;n < el.length; n++) { el[n].addEventListener(events[i], callback, options); } } } delegate(event, delegate, callback) { const events = event.split(" "); for (let i = 0;i < events.length; i++) { let map = eventTypes[events[i]]; if (map === undefined) { map = new SelectorSet; eventTypes[events[i]] = map; if (nonBubblers.indexOf(events[i]) !== -1) { document.addEventListener(events[i], handleDelegation, true); } else { document.addEventListener(events[i], handleDelegation); } } map.add(delegate, callback); } } off(event, el, callback, options) { const events = event.split(" "); for (let i = 0;i < events.length; i++) { if (el === undefined) { listeners[events[i]]?.clear(); continue; } if (typeof el === "function") { makeBusStack(events[i]); listeners[events[i]].delete(el); continue; } const map = eventTypes[events[i]]; if (map !== undefined) { map.remove(el, callback); if (map.size === 0) { delete eventTypes[events[i]]; if (nonBubblers.indexOf(events[i]) !== -1) { document.removeEventListener(events[i], handleDelegation, true); } else { document.removeEventListener(events[i], handleDelegation); } continue; } } if (el.removeEventListener !== undefined) { el.removeEventListener(events[i], callback, options); continue; } el = maybeRunQuerySelector(el); for (let n = 0;n < el.length; n++) { el[n].removeEventListener(events[i], callback, options); } } } emit(event, ...args) { triggerBus(event, args); } debugDelegated() { return JSON.parse(JSON.stringify(eventTypes)); } debugBus() { return clone(listeners); } hasBus(event) { return this.debugBus().hasOwnProperty(event); } } var instance = new E; var e_default = instance; // node_modules/@unseenco/taxi/src/helpers.js var parser = new DOMParser; function parseDom(html) { return typeof html === "string" ? parser.parseFromString(html, "text/html") : html; } function processUrl(url) { const details = new URL(url, window.location.origin); const normalized = details.hash.length ? url.replace(details.hash, "") : null; return { hasHash: details.hash.length > 0, pathname: details.pathname.replace(/\/+$/, ""), host: details.host, search: details.search, raw: url, href: normalized || details.href }; } function reloadElement(node, elementType) { node.parentNode.replaceChild(duplicateElement(node, elementType), node); } function appendElement(node, elementType) { const target = node.parentNode.tagName === "HEAD" ? document.head : document.body; target.appendChild(duplicateElement(node, elementType)); } function duplicateElement(node, elementType) { const replacement = document.createElement(elementType); for (let k = 0;k < node.attributes.length; k++) { const attr = node.attributes[k]; replacement.setAttribute(attr.nodeName, attr.nodeValue); } if (node.innerHTML) { replacement.innerHTML = node.innerHTML; } return replacement; } // node_modules/@unseenco/taxi/src/Transition.js class Transition { constructor({ wrapper }) { this.wrapper = wrapper; } leave(props) { return new Promise((resolve) => { this.onLeave({ ...props, done: resolve }); }); } enter(props) { return new Promise((resolve) => { this.onEnter({ ...props, done: resolve }); }); } onLeave({ from, trigger, done }) { done(); } onEnter({ to, trigger, done }) { done(); } } // node_modules/@unseenco/taxi/src/Renderer.js class Renderer { constructor({ content, page, title, wrapper }) { this._contentString = content.outerHTML; this._DOM = null; this.page = page; this.title = title; this.wrapper = wrapper; this.content = this.wrapper.lastElementChild; } onEnter() { } onEnterCompleted() { } onLeave() { } onLeaveCompleted() { } initialLoad() { this.onEnter(); this.onEnterCompleted(); } update() { document.title = this.title; this.wrapper.appendChild(this._DOM.firstElementChild); this.content = this.wrapper.lastElementChild; this._DOM = null; } createDom() { if (!this._DOM) { this._DOM = document.createElement("div"); this._DOM.innerHTML = this._contentString; } } remove() { this.wrapper.firstElementChild.remove(); } enter(transition, trigger) { return new Promise((resolve) => { this.onEnter(); transition.enter({ trigger, to: this.content }).then(() => { this.onEnterCompleted(); resolve(); }); }); } leave(transition, trigger, removeOldContent) { return new Promise((resolve) => { this.onLeave(); transition.leave({ trigger, from: this.content }).then(() => { if (removeOldContent) { this.remove(); } this.onLeaveCompleted(); resolve(); }); }); } } // node_modules/@unseenco/taxi/src/RouteStore.js class RouteStore { data = new Map; regexCache = new Map; add(fromPattern, toPattern, transition) { if (!this.data.has(fromPattern)) { this.data.set(fromPattern, new Map); this.regexCache.set(fromPattern, new RegExp(`^${fromPattern}$`)); } this.data.get(fromPattern).set(toPattern, transition); this.regexCache.set(toPattern, new RegExp(`^${toPattern}$`)); } findMatch(currentUrl, nextUrl) { for (const [fromPattern, potentialMatches] of this.data) { if (currentUrl.pathname.match(this.regexCache.get(fromPattern))) { for (const [toPattern, transition] of potentialMatches) { if (nextUrl.pathname.match(this.regexCache.get(toPattern))) { return transition; } } break; } } return null; } } // node_modules/@unseenco/taxi/src/Core.js var IN_PROGRESS = "A transition is currently in progress"; class Core { isTransitioning = false; currentCacheEntry = null; cache = new Map; activePromises = new Map; constructor(parameters = {}) { const { links = "a[href]:not([target]):not([href^=\\#]):not([data-taxi-ignore])", removeOldContent = true, allowInterruption = false, bypassCache = false, enablePrefetch = true, renderers = { default: Renderer }, transitions = { default: Transition }, reloadJsFilter = (element) => element.dataset.taxiReload !== undefined, reloadCssFilter = (element) => true } = parameters; this.renderers = renderers; this.transitions = transitions; this.defaultRenderer = this.renderers.default || Renderer; this.defaultTransition = this.transitions.default || Transition; this.wrapper = document.querySelector("[data-taxi]"); this.reloadJsFilter = reloadJsFilter; this.reloadCssFilter = reloadCssFilter; this.removeOldContent = removeOldContent; this.allowInterruption = allowInterruption; this.bypassCache = bypassCache; this.enablePrefetch = enablePrefetch; this.cache = new Map; this.isPopping = false; this.attachEvents(links); this.currentLocation = processUrl(window.location.href); this.cache.set(this.currentLocation.href, this.createCacheEntry(document.cloneNode(true), window.location.href)); this.currentCacheEntry = this.cache.get(this.currentLocation.href); this.currentCacheEntry.renderer.initialLoad(); } setDefaultRenderer(renderer) { this.defaultRenderer = this.renderers[renderer]; } setDefaultTransition(transition) { this.defaultTransition = this.transitions[transition]; } addRoute(fromPattern, toPattern, transition) { if (!this.router) { this.router = new RouteStore; } this.router.add(fromPattern, toPattern, transition); } preload(url, preloadAssets = false) { url = processUrl(url).href; if (!this.cache.has(url)) { return this.fetch(url, false).then(async (response) => { this.cache.set(url, this.createCacheEntry(response.html, response.url)); if (preloadAssets) { this.cache.get(url).renderer.createDom(); } }).catch((err) => console.warn(err)); } return Promise.resolve(); } updateCache(url) { const key = processUrl(url || window.location.href).href; if (this.cache.has(key)) { this.cache.delete(key); } this.cache.set(key, this.createCacheEntry(document.cloneNode(true), key)); } clearCache(url) { const key = processUrl(url || window.location.href).href; if (this.cache.has(key)) { this.cache.delete(key); } } navigateTo(url, transition = false, trigger = false) { return new Promise((resolve, reject) => { if (!this.allowInterruption && this.isTransitioning) { reject(new Error(IN_PROGRESS)); return; } this.isTransitioning = true; this.isPopping = true; this.targetLocation = processUrl(url); this.popTarget = window.location.href; const TransitionClass = new (this.chooseTransition(transition))({ wrapper: this.wrapper }); let navigationPromise; if (this.bypassCache || !this.cache.has(this.targetLocation.href) || this.cache.get(this.targetLocation.href).skipCache) { const fetched = this.fetch(this.targetLocation.href).then((response) => { this.cache.set(this.targetLocation.href, this.createCacheEntry(response.html, response.url)); this.cache.get(this.targetLocation.href).renderer.createDom(); }).catch((err) => { window.location.href = url; }); navigationPromise = this.beforeFetch(this.targetLocation, TransitionClass, trigger).then(async () => { return fetched.then(async () => { return await this.afterFetch(this.targetLocation, TransitionClass, this.cache.get(this.targetLocation.href), trigger); }); }); } else { this.cache.get(this.targetLocation.href).renderer.createDom(); navigationPromise = this.beforeFetch(this.targetLocation, TransitionClass, trigger).then(async () => { return await this.afterFetch(this.targetLocation, TransitionClass, this.cache.get(this.targetLocation.href), trigger); }); } navigationPromise.then(() => { resolve(); }); }); } on(event, callback) { e_default.on(event, callback); } off(event, callback) { e_default.off(event, callback); } beforeFetch(url, TransitionClass, trigger) { e_default.emit("NAVIGATE_OUT", { from: this.currentCacheEntry, trigger }); return new Promise((resolve) => { this.currentCacheEntry.renderer.leave(TransitionClass, trigger, this.removeOldContent).then(() => { if (trigger !== "popstate") { window.history.pushState({}, "", url.raw); } resolve(); }); }); } afterFetch(url, TransitionClass, entry, trigger) { this.currentLocation = url; this.popTarget = this.currentLocation.href; return new Promise((resolve) => { entry.renderer.update(); e_default.emit("NAVIGATE_IN", { from: this.currentCacheEntry, to: entry, trigger }); if (this.reloadJsFilter) { this.loadScripts(entry.scripts); } if (this.reloadCssFilter) { this.loadStyles(entry.styles); } if (trigger !== "popstate" && url.href !== processUrl(entry.finalUrl).href) { window.history.replaceState({}, "", entry.finalUrl); } entry.renderer.enter(TransitionClass, trigger).then(() => { e_default.emit("NAVIGATE_END", { from: this.currentCacheEntry, to: entry, trigger }); this.currentCacheEntry = entry; this.isTransitioning = false; this.isPopping = false; resolve(); }); }); } loadScripts(cachedScripts) { const newScripts = [...cachedScripts]; const currentScripts = Array.from(document.querySelectorAll("script")).filter(this.reloadJsFilter); for (let i = 0;i < currentScripts.length; i++) { for (let n = 0;n < newScripts.length; n++) { if (currentScripts[i].outerHTML === newScripts[n].outerHTML) { reloadElement(currentScripts[i], "SCRIPT"); newScripts.splice(n, 1); break; } } } for (const script of newScripts) { appendElement(script, "SCRIPT"); } } loadStyles(cachedStyles) { const currentStyles = Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(this.reloadCssFilter); const currentInlineStyles = Array.from(document.querySelectorAll("style")).filter(this.reloadCssFilter); const newInlineStyles = cachedStyles.filter((el) => { if (!el.href) { return true; } else if (!currentStyles.find((link) => link.href === el.href)) { document.body.append(el); return false; } }); for (let i = 0;i < currentInlineStyles.length; i++) { for (let n = 0;n < newInlineStyles.length; n++) { if (currentInlineStyles[i].outerHTML === newInlineStyles[n].outerHTML) { reloadElement(currentInlineStyles[i], "STYLE"); newInlineStyles.splice(n, 1); break; } } } for (const style of newInlineStyles) { appendElement(style, "STYLE"); } } attachEvents(links) { e_default.delegate("click", links, this.onClick); e_default.on("popstate", window, this.onPopstate); if (this.enablePrefetch) { e_default.delegate("mouseenter focus", links, this.onPrefetch); } } onClick = (e) => { if (!(e.metaKey || e.ctrlKey)) { const target = processUrl(e.currentTarget.href); this.currentLocation = processUrl(window.location.href); if (this.currentLocation.host !== target.host) { return; } if (this.currentLocation.href !== target.href || this.currentLocation.hasHash && !target.hasHash) { e.preventDefault(); this.navigateTo(target.raw, e.currentTarget.dataset.transition || false, e.currentTarget).catch((err) => console.warn(err)); return; } if (!this.currentLocation.hasHash && !target.hasHash) { e.preventDefault(); } } }; onPopstate = () => { const target = processUrl(window.location.href); if (target.pathname === this.currentLocation.pathname && target.search === this.currentLocation.search && !this.isPopping) { return false; } if (!this.allowInterruption && (this.isTransitioning || this.isPopping)) { window.history.pushState({}, "", this.popTarget); console.warn(IN_PROGRESS); return false; } if (!this.isPopping) { this.popTarget = window.location.href; } this.isPopping = true; this.navigateTo(window.location.href, false, "popstate"); }; onPrefetch = (e) => { const target = processUrl(e.currentTarget.href); if (this.currentLocation.host !== target.host) { return; } this.preload(e.currentTarget.href, false); }; fetch(url, runFallback = true) { if (this.activePromises.has(url)) { return this.activePromises.get(url); } const request = new Promise((resolve, reject) => { let resolvedUrl; fetch(url, { mode: "same-origin", method: "GET", headers: { "X-Requested-With": "Taxi" }, credentials: "same-origin" }).then((response) => { if (!response.ok) { reject("Taxi encountered a non 2xx HTTP status code"); if (runFallback) { window.location.href = url; } } resolvedUrl = response.url; return response.text(); }).then((htmlString) => { resolve({ html: parseDom(htmlString), url: resolvedUrl }); }).catch((err) => { reject(err); if (runFallback) { window.location.href = url; } }).finally(() => { this.activePromises.delete(url); }); }); this.activePromises.set(url, request); return request; } chooseTransition(transition) { if (transition) { return this.transitions[transition]; } const routeTransition = this.router?.findMatch(this.currentLocation, this.targetLocation); if (routeTransition) { return this.transitions[routeTransition]; } return this.defaultTransition; } createCacheEntry(page, url) { const content = page.querySelector("[data-taxi-view]"); const Renderer2 = content.dataset.taxiView.length ? this.renderers[content.dataset.taxiView] : this.defaultRenderer; if (!Renderer2) { console.warn(`The Renderer "${content.dataset.taxiView}" was set in the data-taxi-view of the requested page, but not registered in Taxi.`); } return { page, content, finalUrl: url, skipCache: content.hasAttribute("data-taxi-nocache"), scripts: this.reloadJsFilter ? Array.from(page.querySelectorAll("script")).filter(this.reloadJsFilter) : [], styles: this.reloadCssFilter ? Array.from(page.querySelectorAll('link[rel="stylesheet"], style')).filter(this.reloadCssFilter) : [], title: page.title, renderer: new Renderer2({ wrapper: this.wrapper, title: page.title, content, page }) }; } } // src/lib/page-transitions.ts class Transition2 extends Transition { async onLeave({ from, trigger, done }) { await App.pages.transitionOut({ from, trigger }); done(); } async onEnter({ to, trigger, done }) { await App.pages.transitionIn({ to, trigger }); done(); } } // src/lib/subs.ts class Subscribable { #subscribers = []; add(fn, priority = 0, id = Symbol()) { const index = this.#subscribers.findIndex((sub) => sub.priority > priority); if (index === -1) { this.#subscribers.push({ fn, priority, id }); } else { this.#subscribers.splice(index, 0, { fn, priority, id }); } return () => this.remove(id); } remove(id) { this.#subscribers = this.#subscribers.filter((f) => f.id !== id); } notify(data) { if (this.#subscribers.length < 1) return; this.#subscribers.forEach((f) => f.fn(data)); } } class _Raf extends Subscribable { constructor() { super(); gsap_default.ticker.add(this.update.bind(this)); } update(deltaTime, time) { this.notify({ deltaTime, time: time * 0.01 }); } } class _Resize extends Subscribable { width = window.innerWidth; height = window.innerHeight; timeoutId = null; debounceDelay = 100; constructor() { super(); window.addEventListener("resize", this.update.bind(this)); } update() { if (this.timeoutId) { window.clearTimeout(this.timeoutId); } this.timeoutId = window.setTimeout(() => { const newWidth = window.innerWidth; const newHeight = window.innerHeight; if (newWidth !== this.width || newHeight !== this.height) { this.width = newWidth; this.height = newHeight; this.notify({ width: this.width, height: this.height }); } this.timeoutId = null; }, this.debounceDelay); } force() { this.width = window.innerWidth; this.height = window.innerHeight; this.notify({ width: this.width, height: this.height }); } } var Raf = new _Raf; var Resize = new _Resize; // src/modules/_/runner.ts var destroy = []; var mount = []; function onMount(fn) { mount.push(fn); } function onDestroy(fn) { destroy.push(fn); } function runDestroy() { destroy.forEach((fn) => fn()); destroy.length = 0; } function runMount() { mount.forEach((fn) => fn()); mount.length = 0; } var pageOut = []; var pageIn = []; async function runPageOut() { await Promise.allSettled(pageOut.map((fn) => fn())); pageOut.length = 0; } function onPageIn(fn) { pageIn.push(fn); } async function runPageIn() { gsap_default.set("body", { opacity: 1 }); await Promise.allSettled(pageIn.map((fn) => fn())); pageIn.length = 0; } // src/modules/accent-tag.js var exports_accent_tag = {}; __export(exports_accent_tag, { default: () => accent_tag_default }); // src/webflow/is-staging.ts function _isStaging() { if (true) return false; return window.location.toString().includes(".webflow.io"); } var isStaging = _isStaging(); // src/modules/accent-tag.js function accent_tag_default(element, dataset) { let tl = gsap_default.timeline({ scrollTrigger: { start: "top bottom", end: "bottom top", scrub: 1.5, trigger: element }, defaults: { ease: "none" } }); tl.fromTo(element, { x: "-20%" }, { x: "20%" }); onDestroy(() => { tl.kill(); }); } // src/modules/accordion-feature.js var exports_accordion_feature = {}; __export(exports_accordion_feature, { default: () => accordion_feature_default }); // src/lib/accordion.ts function createAccordion(items, options = {}) { const { closedHeight = "2.1rem", openHeight = "auto", activeColor = "#fef7aa", inactiveColor = "#f1f1f1" } = options; const itemsArray = Array.from(items); let activeItem = null; function init4() { gsap_default.set(itemsArray, { height: closedHeight }); open(itemsArray[0]); } init4(); function open(item) { activeItem = item; gsap_default.to(item, { height: openHeight, onComplete: () => Scroll.resize() }); item.querySelector(".g_large_dot")?.classList.add("is-open"); const tab = item.querySelector(".at_item_tab"); if (!tab) return; tab.classList.add("is-active"); } function close(item) { gsap_default.to(item, { height: closedHeight, onComplete: () => Scroll.resize() }); item.querySelector(".g_large_dot")?.classList.remove("is-open"); const tab = item.querySelector(".at_item_tab"); if (!tab) return; tab.classList.remove("is-active"); } function openAll() { itemsArray.forEach(open); } function closeAll() { itemsArray.forEach(close); } return { open, close, openAll, closeAll }; } // node_modules/@vue/shared/dist/shared.esm-bundler.js function makeMap(str) { const map = /* @__PURE__ */ Object.create(null); for (const key of str.split(",")) map[key] = 1; return (val) => (val in map); } var EMPTY_OBJ = Object.freeze({}); var EMPTY_ARR = Object.freeze([]); var NOOP = () => { }; var extend = Object.assign; var remove = (arr, el) => { const i = arr.indexOf(el); if (i > -1) { arr.splice(i, 1); } }; var hasOwnProperty = Object.prototype.hasOwnProperty; var hasOwn = (val, key) => hasOwnProperty.call(val, key); var isArray = Array.isArray; var isMap = (val) => toTypeString(val) === "[object Map]"; var isSet = (val) => toTypeString(val) === "[object Set]"; var isFunction = (val) => typeof val === "function"; var isString = (val) => typeof val === "string"; var isSymbol = (val) => typeof val === "symbol"; var isObject = (val) => val !== null && typeof val === "object"; var objectToString = Object.prototype.toString; var toTypeString = (value) => objectToString.call(value); var toRawType = (value) => { return toTypeString(value).slice(8, -1); }; var isPlainObject = (val) => toTypeString(val) === "[object Object]"; var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; var cacheStringFunction = (fn) => { const cache = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; var camelizeRE = /-\w/g; var camelize = cacheStringFunction((str) => { return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase()); }); var hyphenateRE = /\B([A-Z])/g; var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); var capitalize = cacheStringFunction((str) => { return str.charAt(0).toUpperCase() + str.slice(1); }); var toHandlerKey = cacheStringFunction((str) => { const s = str ? `on${capitalize(str)}` : ``; return s; }); var hasChanged = (value, oldValue) => !Object.is(value, oldValue); var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; var isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`); // node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js function warn(msg, ...args) { console.warn(`[Vue warn] ${msg}`, ...args); } var activeEffectScope; function getCurrentScope() { return activeEffectScope; } var activeSub; var pausedQueueEffects = /* @__PURE__ */ new WeakSet; class ReactiveEffect { constructor(fn) { this.fn = fn; this.deps = undefined; this.depsTail = undefined; this.flags = 1 | 4; this.next = undefined; this.cleanup = undefined; this.scheduler = undefined; if (activeEffectScope && activeEffectScope.active) { activeEffectScope.effects.push(this); } } pause() { this.flags |= 64; } resume() { if (this.flags & 64) { this.flags &= -65; if (pausedQueueEffects.has(this)) { pausedQueueEffects.delete(this); this.trigger(); } } } notify() { if (this.flags & 2 && !(this.flags & 32)) { return; } if (!(this.flags & 8)) { batch(this); } } run() { if (!(this.flags & 1)) { return this.fn(); } this.flags |= 2; cleanupEffect(this); prepareDeps(this); const prevEffect = activeSub; const prevShouldTrack = shouldTrack; activeSub = this; shouldTrack = true; try { return this.fn(); } finally { if (activeSub !== this) { warn("Active effect was not restored correctly - this is likely a Vue internal bug."); } cleanupDeps(this); activeSub = prevEffect; shouldTrack = prevShouldTrack; this.flags &= -3; } } stop() { if (this.flags & 1) { for (let link = this.deps;link; link = link.nextDep) { removeSub(link); } this.deps = this.depsTail = undefined; cleanupEffect(this); this.onStop && this.onStop(); this.flags &= -2; } } trigger() { if (this.flags & 64) { pausedQueueEffects.add(this); } else if (this.scheduler) { this.scheduler(); } else { this.runIfDirty(); } } runIfDirty() { if (isDirty(this)) { this.run(); } } get dirty() { return isDirty(this); } } var batchDepth = 0; var batchedSub; var batchedComputed; function batch(sub, isComputed = false) { sub.flags |= 8; if (isComputed) { sub.next = batchedComputed; batchedComputed = sub; return; } sub.next = batchedSub; batchedSub = sub; } function startBatch() { batchDepth++; } function endBatch() { if (--batchDepth > 0) { return; } if (batchedComputed) { let e = batchedComputed; batchedComputed = undefined; while (e) { const next = e.next; e.next = undefined; e.flags &= -9; e = next; } } let error; while (batchedSub) { let e = batchedSub; batchedSub = undefined; while (e) { const next = e.next; e.next = undefined; e.flags &= -9; if (e.flags & 1) { try { e.trigger(); } catch (err) { if (!error) error = err; } } e = next; } } if (error) throw error; } function prepareDeps(sub) { for (let link = sub.deps;link; link = link.nextDep) { link.version = -1; link.prevActiveLink = link.dep.activeLink; link.dep.activeLink = link; } } function cleanupDeps(sub) { let head; let tail = sub.depsTail; let link = tail; while (link) { const prev = link.prevDep; if (link.version === -1) { if (link === tail) tail = prev; removeSub(link); removeDep(link); } else { head = link; } link.dep.activeLink = link.prevActiveLink; link.prevActiveLink = undefined; link = prev; } sub.deps = head; sub.depsTail = tail; } function isDirty(sub) { for (let link = sub.deps;link; link = link.nextDep) { if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { return true; } } if (sub._dirty) { return true; } return false; } function refreshComputed(computed) { if (computed.flags & 4 && !(computed.flags & 16)) { return; } computed.flags &= -17; if (computed.globalVersion === globalVersion) { return; } computed.globalVersion = globalVersion; if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) { return; } computed.flags |= 2; const dep = computed.dep; const prevSub = activeSub; const prevShouldTrack = shouldTrack; activeSub = computed; shouldTrack = true; try { prepareDeps(computed); const value = computed.fn(computed._value); if (dep.version === 0 || hasChanged(value, computed._value)) { computed.flags |= 128; computed._value = value; dep.version++; } } catch (err) { dep.version++; throw err; } finally { activeSub = prevSub; shouldTrack = prevShouldTrack; cleanupDeps(computed); computed.flags &= -3; } } function removeSub(link, soft = false) { const { dep, prevSub, nextSub } = link; if (prevSub) { prevSub.nextSub = nextSub; link.prevSub = undefined; } if (nextSub) { nextSub.prevSub = prevSub; link.nextSub = undefined; } if (dep.subsHead === link) { dep.subsHead = nextSub; } if (dep.subs === link) { dep.subs = prevSub; if (!prevSub && dep.computed) { dep.computed.flags &= -5; for (let l = dep.computed.deps;l; l = l.nextDep) { removeSub(l, true); } } } if (!soft && !--dep.sc && dep.map) { dep.map.delete(dep.key); } } function removeDep(link) { const { prevDep, nextDep } = link; if (prevDep) { prevDep.nextDep = nextDep; link.prevDep = undefined; } if (nextDep) { nextDep.prevDep = prevDep; link.nextDep = undefined; } } var shouldTrack = true; var trackStack = []; function pauseTracking() { trackStack.push(shouldTrack); shouldTrack = false; } function resetTracking() { const last = trackStack.pop(); shouldTrack = last === undefined ? true : last; } function cleanupEffect(e) { const { cleanup } = e; e.cleanup = undefined; if (cleanup) { const prevSub = activeSub; activeSub = undefined; try { cleanup(); } finally { activeSub = prevSub; } } } var globalVersion = 0; class Link { constructor(sub, dep) { this.sub = sub; this.dep = dep; this.version = dep.version; this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = undefined; } } class Dep { constructor(computed) { this.computed = computed; this.version = 0; this.activeLink = undefined; this.subs = undefined; this.map = undefined; this.key = undefined; this.sc = 0; this.__v_skip = true; if (true) { this.subsHead = undefined; } } track(debugInfo) { if (!activeSub || !shouldTrack || activeSub === this.computed) { return; } let link = this.activeLink; if (link === undefined || link.sub !== activeSub) { link = this.activeLink = new Link(activeSub, this); if (!activeSub.deps) { activeSub.deps = activeSub.depsTail = link; } else { link.prevDep = activeSub.depsTail; activeSub.depsTail.nextDep = link; activeSub.depsTail = link; } addSub(link); } else if (link.version === -1) { link.version = this.version; if (link.nextDep) { const next = link.nextDep; next.prevDep = link.prevDep; if (link.prevDep) { link.prevDep.nextDep = next; } link.prevDep = activeSub.depsTail; link.nextDep = undefined; activeSub.depsTail.nextDep = link; activeSub.depsTail = link; if (activeSub.deps === link) { activeSub.deps = next; } } } if (activeSub.onTrack) { activeSub.onTrack(extend({ effect: activeSub }, debugInfo)); } return link; } trigger(debugInfo) { this.version++; globalVersion++; this.notify(debugInfo); } notify(debugInfo) { startBatch(); try { if (true) { for (let head = this.subsHead;head; head = head.nextSub) { if (head.sub.onTrigger && !(head.sub.flags & 8)) { head.sub.onTrigger(extend({ effect: head.sub }, debugInfo)); } } } for (let link = this.subs;link; link = link.prevSub) { if (link.sub.notify()) { link.sub.dep.notify(); } } } finally { endBatch(); } } } function addSub(link) { link.dep.sc++; if (link.sub.flags & 4) { const computed = link.dep.computed; if (computed && !link.dep.subs) { computed.flags |= 4 | 16; for (let l = computed.deps;l; l = l.nextDep) { addSub(l); } } const currentTail = link.dep.subs; if (currentTail !== link) { link.prevSub = currentTail; if (currentTail) currentTail.nextSub = link; } if (link.dep.subsHead === undefined) { link.dep.subsHead = link; } link.dep.subs = link; } } var targetMap = /* @__PURE__ */ new WeakMap; var ITERATE_KEY = /* @__PURE__ */ Symbol("Object iterate"); var MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol("Map keys iterate"); var ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol("Array iterate"); function track(target, type, key) { if (shouldTrack && activeSub) { let depsMap = targetMap.get(target); if (!depsMap) { targetMap.set(target, depsMap = /* @__PURE__ */ new Map); } let dep = depsMap.get(key); if (!dep) { depsMap.set(key, dep = new Dep); dep.map = depsMap; dep.key = key; } if (true) { dep.track({ target, type, key }); } else { } } } function trigger(target, type, key, newValue, oldValue, oldTarget) { const depsMap = targetMap.get(target); if (!depsMap) { globalVersion++; return; } const run = (dep) => { if (dep) { if (true) { dep.trigger({ target, type, key, newValue, oldValue, oldTarget }); } else { } } }; startBatch(); if (type === "clear") { depsMap.forEach(run); } else { const targetIsArray = isArray(target); const isArrayIndex = targetIsArray && isIntegerKey(key); if (targetIsArray && key === "length") { const newLength = Number(newValue); depsMap.forEach((dep, key2) => { if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { run(dep); } }); } else { if (key !== undefined || depsMap.has(undefined)) { run(depsMap.get(key)); } if (isArrayIndex) { run(depsMap.get(ARRAY_ITERATE_KEY)); } switch (type) { case "add": if (!targetIsArray) { run(depsMap.get(ITERATE_KEY)); if (isMap(target)) { run(depsMap.get(MAP_KEY_ITERATE_KEY)); } } else if (isArrayIndex) { run(depsMap.get("length")); } break; case "delete": if (!targetIsArray) { run(depsMap.get(ITERATE_KEY)); if (isMap(target)) { run(depsMap.get(MAP_KEY_ITERATE_KEY)); } } break; case "set": if (isMap(target)) { run(depsMap.get(ITERATE_KEY)); } break; } } } endBatch(); } function reactiveReadArray(array) { const raw = toRaw(array); if (raw === array) return raw; track(raw, "iterate", ARRAY_ITERATE_KEY); return isShallow(array) ? raw : raw.map(toReactive); } function shallowReadArray(arr) { track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); return arr; } function toWrapped(target, item) { if (isReadonly(target)) { return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item); } return toReactive(item); } var arrayInstrumentations = { __proto__: null, [Symbol.iterator]() { return iterator(this, Symbol.iterator, (item) => toWrapped(this, item)); }, concat(...args) { return reactiveReadArray(this).concat(...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)); }, entries() { return iterator(this, "entries", (value) => { value[1] = toWrapped(this, value[1]); return value; }); }, every(fn, thisArg) { return apply(this, "every", fn, thisArg, undefined, arguments); }, filter(fn, thisArg) { return apply(this, "filter", fn, thisArg, (v) => v.map((item) => toWrapped(this, item)), arguments); }, find(fn, thisArg) { return apply(this, "find", fn, thisArg, (item) => toWrapped(this, item), arguments); }, findIndex(fn, thisArg) { return apply(this, "findIndex", fn, thisArg, undefined, arguments); }, findLast(fn, thisArg) { return apply(this, "findLast", fn, thisArg, (item) => toWrapped(this, item), arguments); }, findLastIndex(fn, thisArg) { return apply(this, "findLastIndex", fn, thisArg, undefined, arguments); }, forEach(fn, thisArg) { return apply(this, "forEach", fn, thisArg, undefined, arguments); }, includes(...args) { return searchProxy(this, "includes", args); }, indexOf(...args) { return searchProxy(this, "indexOf", args); }, join(separator) { return reactiveReadArray(this).join(separator); }, lastIndexOf(...args) { return searchProxy(this, "lastIndexOf", args); }, map(fn, thisArg) { return apply(this, "map", fn, thisArg, undefined, arguments); }, pop() { return noTracking(this, "pop"); }, push(...args) { return noTracking(this, "push", args); }, reduce(fn, ...args) { return reduce(this, "reduce", fn, args); }, reduceRight(fn, ...args) { return reduce(this, "reduceRight", fn, args); }, shift() { return noTracking(this, "shift"); }, some(fn, thisArg) { return apply(this, "some", fn, thisArg, undefined, arguments); }, splice(...args) { return noTracking(this, "splice", args); }, toReversed() { return reactiveReadArray(this).toReversed(); }, toSorted(comparer) { return reactiveReadArray(this).toSorted(comparer); }, toSpliced(...args) { return reactiveReadArray(this).toSpliced(...args); }, unshift(...args) { return noTracking(this, "unshift", args); }, values() { return iterator(this, "values", (item) => toWrapped(this, item)); } }; function iterator(self2, method, wrapValue) { const arr = shallowReadArray(self2); const iter = arr[method](); if (arr !== self2 && !isShallow(self2)) { iter._next = iter.next; iter.next = () => { const result = iter._next(); if (!result.done) { result.value = wrapValue(result.value); } return result; }; } return iter; } var arrayProto = Array.prototype; function apply(self2, method, fn, thisArg, wrappedRetFn, args) { const arr = shallowReadArray(self2); const needsWrap = arr !== self2 && !isShallow(self2); const methodFn = arr[method]; if (methodFn !== arrayProto[method]) { const result2 = methodFn.apply(self2, args); return needsWrap ? toReactive(result2) : result2; } let wrappedFn = fn; if (arr !== self2) { if (needsWrap) { wrappedFn = function(item, index) { return fn.call(this, toWrapped(self2, item), index, self2); }; } else if (fn.length > 2) { wrappedFn = function(item, index) { return fn.call(this, item, index, self2); }; } } const result = methodFn.call(arr, wrappedFn, thisArg); return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; } function reduce(self2, method, fn, args) { const arr = shallowReadArray(self2); let wrappedFn = fn; if (arr !== self2) { if (!isShallow(self2)) { wrappedFn = function(acc, item, index) { return fn.call(this, acc, toWrapped(self2, item), index, self2); }; } else if (fn.length > 3) { wrappedFn = function(acc, item, index) { return fn.call(this, acc, item, index, self2); }; } } return arr[method](wrappedFn, ...args); } function searchProxy(self2, method, args) { const arr = toRaw(self2); track(arr, "iterate", ARRAY_ITERATE_KEY); const res = arr[method](...args); if ((res === -1 || res === false) && isProxy(args[0])) { args[0] = toRaw(args[0]); return arr[method](...args); } return res; } function noTracking(self2, method, args = []) { pauseTracking(); startBatch(); const res = toRaw(self2)[method].apply(self2, args); endBatch(); resetTracking(); return res; } var isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); var builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)); function hasOwnProperty2(key) { if (!isSymbol(key)) key = String(key); const obj = toRaw(this); track(obj, "has", key); return obj.hasOwnProperty(key); } class BaseReactiveHandler { constructor(_isReadonly = false, _isShallow = false) { this._isReadonly = _isReadonly; this._isShallow = _isShallow; } get(target, key, receiver) { if (key === "__v_skip") return target["__v_skip"]; const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_isShallow") { return isShallow2; } else if (key === "__v_raw") { if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { return target; } return; } const targetIsArray = isArray(target); if (!isReadonly2) { let fn; if (targetIsArray && (fn = arrayInstrumentations[key])) { return fn; } if (key === "hasOwnProperty") { return hasOwnProperty2; } } const res = Reflect.get(target, key, isRef(target) ? target : receiver); if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { return res; } if (!isReadonly2) { track(target, "get", key); } if (isShallow2) { return res; } if (isRef(res)) { const value = targetIsArray && isIntegerKey(key) ? res : res.value; return isReadonly2 && isObject(value) ? readonly(value) : value; } if (isObject(res)) { return isReadonly2 ? readonly(res) : reactive(res); } return res; } } class MutableReactiveHandler extends BaseReactiveHandler { constructor(isShallow2 = false) { super(false, isShallow2); } set(target, key, value, receiver) { let oldValue = target[key]; const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key); if (!this._isShallow) { const isOldValueReadonly = isReadonly(oldValue); if (!isShallow(value) && !isReadonly(value)) { oldValue = toRaw(oldValue); value = toRaw(value); } if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) { if (isOldValueReadonly) { if (true) { warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]); } return true; } else { oldValue.value = value; return true; } } } const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key); const result = Reflect.set(target, key, value, isRef(target) ? target : receiver); if (target === toRaw(receiver)) { if (!hadKey) { trigger(target, "add", key, value); } else if (hasChanged(value, oldValue)) { trigger(target, "set", key, value, oldValue); } } return result; } deleteProperty(target, key) { const hadKey = hasOwn(target, key); const oldValue = target[key]; const result = Reflect.deleteProperty(target, key); if (result && hadKey) { trigger(target, "delete", key, undefined, oldValue); } return result; } has(target, key) { const result = Reflect.has(target, key); if (!isSymbol(key) || !builtInSymbols.has(key)) { track(target, "has", key); } return result; } ownKeys(target) { track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY); return Reflect.ownKeys(target); } } class ReadonlyReactiveHandler extends BaseReactiveHandler { constructor(isShallow2 = false) { super(true, isShallow2); } set(target, key) { if (true) { warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target); } return true; } deleteProperty(target, key) { if (true) { warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target); } return true; } } var mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler; var readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler; var toShallow = (value) => value; var getProto = (v) => Reflect.getPrototypeOf(v); function createIterableMethod(method, isReadonly2, isShallow2) { return function(...args) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const targetIsMap = isMap(rawTarget); const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; const isKeyOnly = method === "keys" && targetIsMap; const innerIterator = target[method](...args); const wrap3 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); return extend(Object.create(innerIterator), { next() { const { value, done } = innerIterator.next(); return done ? { value, done } : { value: isPair ? [wrap3(value[0]), wrap3(value[1])] : wrap3(value), done }; } }); }; } function createReadonlyMethod(type) { return function(...args) { if (true) { const key = args[0] ? `on key "${args[0]}" ` : ``; warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this)); } return type === "delete" ? false : type === "clear" ? undefined : this; }; } function createInstrumentations(readonly, shallow) { const instrumentations = { get(key) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key); if (!readonly) { if (hasChanged(key, rawKey)) { track(rawTarget, "get", key); } track(rawTarget, "get", rawKey); } const { has } = getProto(rawTarget); const wrap3 = shallow ? toShallow : readonly ? toReadonly : toReactive; if (has.call(rawTarget, key)) { return wrap3(target.get(key)); } else if (has.call(rawTarget, rawKey)) { return wrap3(target.get(rawKey)); } else if (target !== rawTarget) { target.get(key); } }, get size() { const target = this["__v_raw"]; !readonly && track(toRaw(target), "iterate", ITERATE_KEY); return target.size; }, has(key) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key); if (!readonly) { if (hasChanged(key, rawKey)) { track(rawTarget, "has", key); } track(rawTarget, "has", rawKey); } return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); }, forEach(callback, thisArg) { const observed = this; const target = observed["__v_raw"]; const rawTarget = toRaw(target); const wrap3 = shallow ? toShallow : readonly ? toReadonly : toReactive; !readonly && track(rawTarget, "iterate", ITERATE_KEY); return target.forEach((value, key) => { return callback.call(thisArg, wrap3(value), wrap3(key), observed); }); } }; extend(instrumentations, readonly ? { add: createReadonlyMethod("add"), set: createReadonlyMethod("set"), delete: createReadonlyMethod("delete"), clear: createReadonlyMethod("clear") } : { add(value) { if (!shallow && !isShallow(value) && !isReadonly(value)) { value = toRaw(value); } const target = toRaw(this); const proto = getProto(target); const hadKey = proto.has.call(target, value); if (!hadKey) { target.add(value); trigger(target, "add", value, value); } return this; }, set(key, value) { if (!shallow && !isShallow(value) && !isReadonly(value)) { value = toRaw(value); } const target = toRaw(this); const { has, get } = getProto(target); let hadKey = has.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has.call(target, key); } else if (true) { checkIdentityKeys(target, has, key); } const oldValue = get.call(target, key); target.set(key, value); if (!hadKey) { trigger(target, "add", key, value); } else if (hasChanged(value, oldValue)) { trigger(target, "set", key, value, oldValue); } return this; }, delete(key) { const target = toRaw(this); const { has, get } = getProto(target); let hadKey = has.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has.call(target, key); } else if (true) { checkIdentityKeys(target, has, key); } const oldValue = get ? get.call(target, key) : undefined; const result = target.delete(key); if (hadKey) { trigger(target, "delete", key, undefined, oldValue); } return result; }, clear() { const target = toRaw(this); const hadItems = target.size !== 0; const oldTarget = isMap(target) ? new Map(target) : new Set(target); const result = target.clear(); if (hadItems) { trigger(target, "clear", undefined, undefined, oldTarget); } return result; } }); const iteratorMethods = [ "keys", "values", "entries", Symbol.iterator ]; iteratorMethods.forEach((method) => { instrumentations[method] = createIterableMethod(method, readonly, shallow); }); return instrumentations; } function createInstrumentationGetter(isReadonly2, shallow) { const instrumentations = createInstrumentations(isReadonly2, shallow); return (target, key, receiver) => { if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_raw") { return target; } return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); }; } var mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) }; var readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) }; function checkIdentityKeys(target, has, key) { const rawKey = toRaw(key); if (rawKey !== key && has.call(target, rawKey)) { const type = toRawType(target); warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); } } var reactiveMap = /* @__PURE__ */ new WeakMap; var shallowReactiveMap = /* @__PURE__ */ new WeakMap; var readonlyMap = /* @__PURE__ */ new WeakMap; var shallowReadonlyMap = /* @__PURE__ */ new WeakMap; function targetTypeMap(rawType) { switch (rawType) { case "Object": case "Array": return 1; case "Map": case "Set": case "WeakMap": case "WeakSet": return 2; default: return 0; } } function getTargetType(value) { return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); } function reactive(target) { if (/* @__PURE__ */ isReadonly(target)) { return target; } return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); } function readonly(target) { return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); } function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { if (!isObject(target)) { if (true) { warn(`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(target)}`); } return target; } if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } const targetType = getTargetType(target); if (targetType === 0) { return target; } const existingProxy = proxyMap.get(target); if (existingProxy) { return existingProxy; } const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); proxyMap.set(target, proxy); return proxy; } function isReactive(value) { if (/* @__PURE__ */ isReadonly(value)) { return /* @__PURE__ */ isReactive(value["__v_raw"]); } return !!(value && value["__v_isReactive"]); } function isReadonly(value) { return !!(value && value["__v_isReadonly"]); } function isShallow(value) { return !!(value && value["__v_isShallow"]); } function isProxy(value) { return value ? !!value["__v_raw"] : false; } function toRaw(observed) { const raw = observed && observed["__v_raw"]; return raw ? /* @__PURE__ */ toRaw(raw) : observed; } var toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value; var toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value; function isRef(r) { return r ? r["__v_isRef"] === true : false; } function ref2(value) { return createRef(value, false); } function createRef(rawValue, shallow) { if (/* @__PURE__ */ isRef(rawValue)) { return rawValue; } return new RefImpl(rawValue, shallow); } class RefImpl { constructor(value, isShallow2) { this.dep = new Dep; this["__v_isRef"] = true; this["__v_isShallow"] = false; this._rawValue = isShallow2 ? value : toRaw(value); this._value = isShallow2 ? value : toReactive(value); this["__v_isShallow"] = isShallow2; } get value() { if (true) { this.dep.track({ target: this, type: "get", key: "value" }); } else { } return this._value; } set value(newValue) { const oldValue = this._rawValue; const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); newValue = useDirectValue ? newValue : toRaw(newValue); if (hasChanged(newValue, oldValue)) { this._rawValue = newValue; this._value = useDirectValue ? newValue : toReactive(newValue); if (true) { this.dep.trigger({ target: this, type: "set", key: "value", newValue, oldValue }); } else { } } } } var INITIAL_WATCHER_VALUE = {}; var cleanupMap = /* @__PURE__ */ new WeakMap; var activeWatcher = undefined; function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { if (owner) { let cleanups = cleanupMap.get(owner); if (!cleanups) cleanupMap.set(owner, cleanups = []); cleanups.push(cleanupFn); } else if (!failSilently) { warn(`onWatcherCleanup() was called when there was no active watcher to associate with.`); } } function watch(source, cb, options = EMPTY_OBJ) { const { immediate, deep, once, scheduler, augmentJob, call } = options; const warnInvalidSource = (s) => { (options.onWarn || warn)(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`); }; const reactiveGetter = (source2) => { if (deep) return source2; if (isShallow(source2) || deep === false || deep === 0) return traverse2(source2, 1); return traverse2(source2); }; let effect; let getter; let cleanup; let boundCleanup; let forceTrigger = false; let isMultiSource = false; if (isRef(source)) { getter = () => source.value; forceTrigger = isShallow(source); } else if (isReactive(source)) { getter = () => reactiveGetter(source); forceTrigger = true; } else if (isArray(source)) { isMultiSource = true; forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); getter = () => source.map((s) => { if (isRef(s)) { return s.value; } else if (isReactive(s)) { return reactiveGetter(s); } else if (isFunction(s)) { return call ? call(s, 2) : s(); } else { warnInvalidSource(s); } }); } else if (isFunction(source)) { if (cb) { getter = call ? () => call(source, 2) : source; } else { getter = () => { if (cleanup) { pauseTracking(); try { cleanup(); } finally { resetTracking(); } } const currentEffect = activeWatcher; activeWatcher = effect; try { return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); } finally { activeWatcher = currentEffect; } }; } } else { getter = NOOP; warnInvalidSource(source); } if (cb && deep) { const baseGetter = getter; const depth = deep === true ? Infinity : deep; getter = () => traverse2(baseGetter(), depth); } const scope = getCurrentScope(); const watchHandle = () => { effect.stop(); if (scope && scope.active) { remove(scope.effects, effect); } }; if (once && cb) { const _cb = cb; cb = (...args) => { _cb(...args); watchHandle(); }; } let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; const job = (immediateFirstRun) => { if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { return; } if (cb) { const newValue = effect.run(); if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { if (cleanup) { cleanup(); } const currentWatcher = activeWatcher; activeWatcher = effect; try { const args = [ newValue, oldValue === INITIAL_WATCHER_VALUE ? undefined : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup ]; oldValue = newValue; call ? call(cb, 3, args) : cb(...args); } finally { activeWatcher = currentWatcher; } } } else { effect.run(); } }; if (augmentJob) { augmentJob(job); } effect = new ReactiveEffect(getter); effect.scheduler = scheduler ? () => scheduler(job, false) : job; boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); cleanup = effect.onStop = () => { const cleanups = cleanupMap.get(effect); if (cleanups) { if (call) { call(cleanups, 4); } else { for (const cleanup2 of cleanups) cleanup2(); } cleanupMap.delete(effect); } }; if (true) { effect.onTrack = options.onTrack; effect.onTrigger = options.onTrigger; } if (cb) { if (immediate) { job(true); } else { oldValue = effect.run(); } } else if (scheduler) { scheduler(job.bind(null, true), true); } else { effect.run(); } watchHandle.pause = effect.pause.bind(effect); watchHandle.resume = effect.resume.bind(effect); watchHandle.stop = watchHandle; return watchHandle; } function traverse2(value, depth = Infinity, seen) { if (depth <= 0 || !isObject(value) || value["__v_skip"]) { return value; } seen = seen || /* @__PURE__ */ new Map; if ((seen.get(value) || 0) >= depth) { return value; } seen.set(value, depth); depth--; if (isRef(value)) { traverse2(value.value, depth, seen); } else if (isArray(value)) { for (let i = 0;i < value.length; i++) { traverse2(value[i], depth, seen); } } else if (isSet(value) || isMap(value)) { value.forEach((v) => { traverse2(v, depth, seen); }); } else if (isPlainObject(value)) { for (const key in value) { traverse2(value[key], depth, seen); } for (const key of Object.getOwnPropertySymbols(value)) { if (Object.prototype.propertyIsEnumerable.call(value, key)) { traverse2(value[key], depth, seen); } } } return value; } // src/modules/accordion-feature.js function accordion_feature_default(element, dataset) { const currentTab = ref2(1); const items = element.querySelectorAll('[data-element="item"]'); const images = element.querySelectorAll('[data-element="image"]'); const accordion = createAccordion(items); if (window.innerWidth > 991) { moveImages(element); } items.forEach((e, index) => { e.addEventListener("click", () => { currentTab.value = index; }); }); watch(currentTab, (newValue, oldValue) => { let itemsToClose = Array.from(items).filter((_, i) => i !== newValue); let imagesToHide = Array.from(images).filter((_, i) => i !== newValue); itemsToClose.forEach((item) => accordion.close(item)); accordion.open(items[newValue]); gsap_default.to(imagesToHide, { opacity: 0 }); gsap_default.to(images[newValue], { opacity: 1 }); }); currentTab.value = 0; } function moveImages(element) { const images = element.querySelectorAll('[data-element="image"]'); const holder = element.querySelector('[data-element="image-holder"]'); images.forEach((e) => { holder.append(e); }); } // src/modules/accordion.js var exports_accordion = {}; __export(exports_accordion, { default: () => accordion_default }); function accordion_default(element, dataset) { const items = element.querySelectorAll(".at_item_wrap"); const accordion = createAccordion(items); items.forEach((e) => { e.addEventListener("click", () => { if (e.getAttribute("style").includes("auto")) return; accordion.closeAll(); accordion.open(e); }); }); } // src/modules/blog-list.js var exports_blog_list = {}; __export(exports_blog_list, { default: () => blog_list_default }); function blog_list_default(element, dataset) { const list = element.querySelector('[fs-list-element="list"]'); if (!list) return; const observer = new MutationObserver(() => { Scroll.resize(); console.log("refreshed"); }); observer.observe(list, { childList: true }); } // src/modules/blog-tags.js var exports_blog_tags = {}; __export(exports_blog_tags, { default: () => blog_tags_default }); function blog_tags_default(element, dataset) { onMount(() => { const tags = element.closest(".page_main").querySelectorAll(".bvl_tags_nest_item"); const slot = element.querySelector(".u-display-contents"); console.log(element, tags, slot); tags.forEach((e) => { slot.appendChild(e); }); }); } // src/modules/circular-feature-accordion.js var exports_circular_feature_accordion = {}; __export(exports_circular_feature_accordion, { default: () => circular_feature_accordion_default }); function circular_feature_accordion_default(element, dataset) { const desktop = window.matchMedia("(min-width: 991px)"); const onClick = () => element.classList.toggle("is-open"); const onEnter = () => element.classList.add("is-open"); const onLeave = () => element.classList.remove("is-open"); function bind(isDesktop) { if (isDesktop) { element.removeEventListener("click", onClick); element.addEventListener("mouseenter", onEnter); element.addEventListener("mouseleave", onLeave); } else { element.removeEventListener("mouseenter", onEnter); element.removeEventListener("mouseleave", onLeave); element.classList.remove("is-open"); element.addEventListener("click", onClick); } } bind(desktop.matches); const onMQChange = (e) => bind(e.matches); desktop.addEventListener("change", onMQChange); onDestroy(() => { element.removeEventListener("click", onClick); element.removeEventListener("mouseenter", onEnter); element.removeEventListener("mouseleave", onLeave); desktop.removeEventListener("change", onMQChange); }); } // src/modules/circular-feature.js var exports_circular_feature = {}; __export(exports_circular_feature, { default: () => circular_feature_default }); function circular_feature_default(element) { if (window.innerWidth < 991) return; const blocks = element.querySelectorAll(".cf_block"); const count = blocks.length; const startAngle = -5 * Math.PI / 6; const endAngle = -Math.PI / 6 - 2 * Math.PI; const angleStep = (endAngle - startAngle) / (count - 1); const clampedWidth = Math.min(window.innerWidth, 1360); const radiusX = clampedWidth * 0.3819444444; const radiusY = clampedWidth * 0.1736111111; const magnetMax = 3; const flipThreshold = -50; const positions = Array.from({ length: count }, (_, i) => ({ x: radiusX * Math.cos(startAngle + angleStep * i), y: radiusY * Math.sin(startAngle + angleStep * i) })); const ns = "http://www.w3.org/2000/svg"; const svg = document.createElementNS(ns, "svg"); Object.assign(svg.style, { position: "absolute", inset: "0", width: "100%", height: "100%", pointerEvents: "none", overflow: "visible" }); element.style.position ||= "relative"; element.prepend(svg); const lines = positions.map(({ x, y }) => { const line = document.createElementNS(ns, "line"); line.setAttribute("x1", "50%"); line.setAttribute("y1", "50%"); line.setAttribute("stroke", "currentColor"); line.setAttribute("stroke-width", "1"); line.setAttribute("stroke-dasharray", "4 4"); line.setAttribute("stroke-opacity", "0.3"); svg.appendChild(line); return line; }); function updateLines(offsets) { const rect = element.getBoundingClientRect(); const cx = rect.width / 2; const cy = rect.height / 2; lines.forEach((line, i) => { const ox = offsets ? offsets[i].x : 0; const oy = offsets ? offsets[i].y : 0; const blockW = blocks[i].offsetWidth; const edgeOffset = positions[i].x > flipThreshold ? -(blockW / 2) : blockW / 2; line.setAttribute("x2", cx + positions[i].x + ox + edgeOffset); line.setAttribute("y2", cy + positions[i].y + oy); }); } blocks.forEach((block, i) => { if (positions[i].x > flipThreshold) { block.style.display = "flex"; block.style.flexDirection = "row"; } }); gsap_default.to(blocks, { x: (i) => positions[i].x, y: (i) => positions[i].y, duration: 0.8, stagger: 0.05, ease: "power3.out", onUpdate() { const offsets = Array.from(blocks).map((b) => ({ x: gsap_default.getProperty(b, "x") - positions[Array.from(blocks).indexOf(b)].x, y: gsap_default.getProperty(b, "y") - positions[Array.from(blocks).indexOf(b)].y })); updateLines(offsets); }, onComplete: () => updateLines(null) }); const magOffsets = positions.map(() => ({ x: 0, y: 0 })); function onMouseMove(e) { const rect = element.getBoundingClientRect(); const mx = e.clientX - rect.left - rect.width / 2; const my = e.clientY - rect.top - rect.height / 2; blocks.forEach((block, i) => { const dx = mx - positions[i].x; const dy = my - positions[i].y; const dist = Math.sqrt(dx * dx + dy * dy); const pull = Math.min(magnetMax, magnetMax * (200 / (dist + 200))); const angle = Math.atan2(dy, dx); const ox = pull * Math.cos(angle); const oy = pull * Math.sin(angle); magOffsets[i] = { x: ox, y: oy }; gsap_default.to(block, { x: positions[i].x + ox, y: positions[i].y + oy, duration: 0.6, ease: "power2.out", overwrite: "auto" }); }); updateLines(magOffsets); } function onMouseLeave() { blocks.forEach((block, i) => { magOffsets[i] = { x: 0, y: 0 }; gsap_default.to(block, { x: positions[i].x, y: positions[i].y, duration: 0.6, ease: "power2.out", overwrite: "auto" }); }); updateLines(null); } element.addEventListener("mousemove", onMouseMove); element.addEventListener("mouseleave", onMouseLeave); onDestroy(() => { element.removeEventListener("mousemove", onMouseMove); element.removeEventListener("mouseleave", onMouseLeave); svg.remove(); }); } // src/modules/customer-stories-tabs.js var exports_customer_stories_tabs = {}; __export(exports_customer_stories_tabs, { default: () => customer_stories_tabs_default }); function customer_stories_tabs_default(element, dataset) { const currentTab = ref2(1); const cards = element.querySelectorAll(".cst_cards_item"); const links = element.querySelectorAll(".cst_tabs_item"); links.forEach((e, i) => { e.addEventListener("click", () => { currentTab.value = i; }); }); watch(currentTab, (newVal, oldVal) => { const notNewTab = Array.from(cards).filter((card, index) => { return index !== newVal; }); let tl = gsap_default.timeline(); tl.to(notNewTab, { opacity: 0 }); tl.to(cards[newVal], { opacity: 1 }, "<"); tl.to(links[newVal], { backgroundColor: "#F1DAFE" }, "<"); tl.to(links[oldVal], { backgroundColor: "rgba(241, 218, 254, 0)" }, "<"); }); currentTab.value = 0; } // src/modules/dots.js var exports_dots = {}; __export(exports_dots, { default: () => dots_default }); function dots_default(element, dataset) { const direction = dataset.direction; let tl = gsap_default.timeline({ scrollTrigger: { trigger: element, start: "top bottom", end: "bottom top", scrub: 1 }, defaults: { ease: "none" } }); if (direction === "horizontal") { tl.to(element, { x: 64 }); } else { tl.fromTo(element, { y: -24 }, { y: 24 }); } } // src/modules/draggable-card-list.js var exports_draggable_card_list = {}; __export(exports_draggable_card_list, { default: () => draggable_card_list_default }); var import_Draggable = __toESM(require_Draggable()); // node_modules/gsap/utils/VelocityTracker.js /*! * VelocityTracker: 3.14.2 * https://gsap.com * * Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var gsap6; var _coreInitted6; var _toArray3; var _getUnit; var _first; var _ticker2; var _time12; var _time22; var _getCache3; var _getGSAP7 = function _getGSAP8() { return gsap6 || typeof window !== "undefined" && (gsap6 = window.gsap); }; var _lookup = {}; var _round9 = function _round10(value) { return Math.round(value * 1e4) / 1e4; }; var _getID = function _getID2(target) { return _getCache3(target).id; }; var _getByTarget = function _getByTarget2(target) { return _lookup[_getID(typeof target === "string" ? _toArray3(target)[0] : target)]; }; var _onTick = function _onTick2(time) { var pt = _first, val; if (time - _time12 >= 0.05) { _time22 = _time12; _time12 = time; while (pt) { val = pt.g(pt.t, pt.p); if (val !== pt.v1 || time - pt.t1 > 0.2) { pt.v2 = pt.v1; pt.v1 = val; pt.t2 = pt.t1; pt.t1 = time; } pt = pt._next; } } }; var _types = { deg: 360, rad: Math.PI * 2 }; var _initCore7 = function _initCore8() { gsap6 = _getGSAP7(); if (gsap6) { _toArray3 = gsap6.utils.toArray; _getUnit = gsap6.utils.getUnit; _getCache3 = gsap6.core.getCache; _ticker2 = gsap6.ticker; _coreInitted6 = 1; } }; var PropTracker = function PropTracker2(target, property, type, next) { this.t = target; this.p = property; this.g = target._gsap.get; this.rCap = _types[type || _getUnit(this.g(target, property))]; this.v1 = this.v2 = this.g(target, property); this.t1 = this.t2 = _ticker2.time; if (next) { this._next = next; next._prev = this; } }; var VelocityTracker = /* @__PURE__ */ function() { function VelocityTracker2(target, property) { _coreInitted6 || _initCore7(); this.target = _toArray3(target)[0]; _lookup[_getID(this.target)] = this; this._props = {}; property && this.add(property); } VelocityTracker2.register = function register(core) { gsap6 = core; _initCore7(); }; var _proto = VelocityTracker2.prototype; _proto.get = function get(property, skipRecentTick) { var pt = this._props[property] || console.warn("Not tracking " + property + " velocity."), val, dif, rotationCap; val = parseFloat(skipRecentTick ? pt.v1 : pt.g(pt.t, pt.p)); dif = val - parseFloat(pt.v2); rotationCap = pt.rCap; if (rotationCap) { dif = dif % rotationCap; if (dif !== dif % (rotationCap / 2)) { dif = dif < 0 ? dif + rotationCap : dif - rotationCap; } } return _round9(dif / ((skipRecentTick ? pt.t1 : _ticker2.time) - pt.t2)); }; _proto.getAll = function getAll() { var result = {}, props = this._props, p; for (p in props) { result[p] = this.get(p); } return result; }; _proto.isTracking = function isTracking(property) { return property in this._props; }; _proto.add = function add(property, type) { var pt = this._props[property]; if (pt) { pt.v1 = pt.v2 = pt.g(pt.t, pt.p); pt.t1 = pt.t2 = _ticker2.time; } else { if (!_first) { _ticker2.add(_onTick); _time12 = _time22 = _ticker2.time; } _first = this._props[property] = new PropTracker(this.target, property, type, _first); } }; _proto.remove = function remove(property) { var pt = this._props[property], prev, next; if (pt) { prev = pt._prev; next = pt._next; if (prev) { prev._next = next; } if (next) { next._prev = prev; } else if (_first === pt) { _ticker2.remove(_onTick); _first = 0; } delete this._props[property]; } }; _proto.kill = function kill(shallow) { for (var p in this._props) { this.remove(p); } if (!shallow) { delete _lookup[_getID(this.target)]; } }; VelocityTracker2.track = function track(targets, properties, types) { _coreInitted6 || _initCore7(); var result = [], targs = _toArray3(targets), a = properties.split(","), t = (types || "").split(","), i = targs.length, tracker, j; while (i--) { tracker = _getByTarget(targs[i]) || new VelocityTracker2(targs[i]); j = a.length; while (j--) { tracker.add(a[j], t[j] || t[0]); } result.push(tracker); } return result; }; VelocityTracker2.untrack = function untrack(targets, properties) { var props = properties && properties.split(","); _toArray3(targets).forEach(function(target) { var tracker = _getByTarget(target); if (tracker) { props ? props.forEach(function(p) { return tracker.remove(p); }) : tracker.kill(1); } }); }; VelocityTracker2.isTracking = function isTracking(target, property) { var tracker = _getByTarget(target); return tracker && tracker.isTracking(property); }; VelocityTracker2.getVelocity = function getVelocity(target, property) { var tracker = _getByTarget(target); return !tracker || !tracker.isTracking(property) ? console.warn("Not tracking velocity of " + property) : tracker.get(property); }; return VelocityTracker2; }(); VelocityTracker.getByTarget = _getByTarget; _getGSAP7() && gsap6.registerPlugin(VelocityTracker); // node_modules/gsap/InertiaPlugin.js /*! * InertiaPlugin 3.14.2 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */ var gsap7; var _coreInitted7; var _parseEase3; var _toArray4; var _power3; var _config2; var _getUnit2; var PropTween2; var _getCache4; var _checkPointRatio; var _clamp5; var _processingVars; var _getStyleSaver3; var _reverting3; var _getTracker = VelocityTracker.getByTarget; var _getGSAP9 = function _getGSAP10() { return gsap7 || typeof window !== "undefined" && (gsap7 = window.gsap) && gsap7.registerPlugin && gsap7; }; var _isString5 = function _isString6(value) { return typeof value === "string"; }; var _isNumber7 = function _isNumber8(value) { return typeof value === "number"; }; var _isObject5 = function _isObject6(value) { return typeof value === "object"; }; var _isFunction5 = function _isFunction6(value) { return typeof value === "function"; }; var _bonusValidated2 = 1; var _isArray2 = Array.isArray; var _emptyFunc3 = function _emptyFunc4(p) { return p; }; var _bigNum4 = 10000000000; var _tinyNum2 = 1 / _bigNum4; var _checkPoint = 0.05; var _round11 = function _round12(value) { return Math.round(value * 1e4) / 1e4; }; var _extend = function _extend2(obj, defaults3, exclude) { for (var p in defaults3) { if (!(p in obj) && p !== exclude) { obj[p] = defaults3[p]; } } return obj; }; var _deepClone = function _deepClone2(obj) { var copy = {}, p, v; for (p in obj) { copy[p] = _isObject5(v = obj[p]) && !_isArray2(v) ? _deepClone2(v) : v; } return copy; }; var _getClosest = function _getClosest2(n, values, max, min, radius) { var i = values.length, closest = 0, absDif = _bigNum4, val, dif, p, dist; if (_isObject5(n)) { while (i--) { val = values[i]; dif = 0; for (p in n) { dist = val[p] - n[p]; dif += dist * dist; } if (dif < absDif) { closest = i; absDif = dif; } } if ((radius || _bigNum4) < _bigNum4 && radius < Math.sqrt(absDif)) { return n; } } else { while (i--) { val = values[i]; dif = val - n; if (dif < 0) { dif = -dif; } if (dif < absDif && val >= min && val <= max) { closest = i; absDif = dif; } } } return values[closest]; }; var _parseEnd = function _parseEnd2(curProp, end, max, min, name, radius, velocity) { if (curProp.end === "auto") { return curProp; } var endVar = curProp.end, adjustedEnd, p; max = isNaN(max) ? _bigNum4 : max; min = isNaN(min) ? -_bigNum4 : min; if (_isObject5(end)) { adjustedEnd = end.calculated ? end : (_isFunction5(endVar) ? endVar(end, velocity) : _getClosest(end, endVar, max, min, radius)) || end; if (!end.calculated) { for (p in adjustedEnd) { end[p] = adjustedEnd[p]; } end.calculated = true; } adjustedEnd = adjustedEnd[name]; } else { adjustedEnd = _isFunction5(endVar) ? endVar(end, velocity) : _isArray2(endVar) ? _getClosest(end, endVar, max, min, radius) : parseFloat(endVar); } if (adjustedEnd > max) { adjustedEnd = max; } else if (adjustedEnd < min) { adjustedEnd = min; } return { max: adjustedEnd, min: adjustedEnd, unitFactor: curProp.unitFactor }; }; var _getNumOrDefault = function _getNumOrDefault2(vars, property, defaultValue) { return isNaN(vars[property]) ? defaultValue : +vars[property]; }; var _calculateChange = function _calculateChange2(velocity, duration) { return duration * _checkPoint * velocity / _checkPointRatio; }; var _calculateDuration = function _calculateDuration2(start, end, velocity) { return Math.abs((end - start) * _checkPointRatio / velocity / _checkPoint); }; var _reservedProps2 = { resistance: 1, checkpoint: 1, preventOvershoot: 1, linkedProps: 1, radius: 1, duration: 1 }; var _processLinkedProps = function _processLinkedProps2(target, vars, getVal, resistance) { if (vars.linkedProps) { var linkedPropNames = vars.linkedProps.split(","), linkedProps = {}, i, p, curProp, curVelocity, tracker, curDuration; for (i = 0;i < linkedPropNames.length; i++) { p = linkedPropNames[i]; curProp = vars[p]; if (curProp) { if (_isNumber7(curProp.velocity)) { curVelocity = curProp.velocity; } else { tracker = tracker || _getTracker(target); curVelocity = tracker && tracker.isTracking(p) ? tracker.get(p) : 0; } curDuration = Math.abs(curVelocity / _getNumOrDefault(curProp, "resistance", resistance)); linkedProps[p] = parseFloat(getVal(target, p)) + _calculateChange(curVelocity, curDuration); } } return linkedProps; } }; var _calculateTweenDuration = function _calculateTweenDuration2(target, vars, maxDuration, minDuration, overshootTolerance, recordEnd) { if (maxDuration === undefined) { maxDuration = 10; } if (minDuration === undefined) { minDuration = 0.2; } if (overshootTolerance === undefined) { overshootTolerance = 1; } if (recordEnd === undefined) { recordEnd = 0; } _isString5(target) && (target = _toArray4(target)[0]); if (!target) { return 0; } var duration = 0, clippedDuration = _bigNum4, inertiaVars = vars.inertia || vars, getVal = _getCache4(target).get, resistance = _getNumOrDefault(inertiaVars, "resistance", _config2.resistance), p, curProp, curDuration, curVelocity, curVal, end, curClippedDuration, tracker, unitFactor, linkedProps; linkedProps = _processLinkedProps(target, inertiaVars, getVal, resistance); for (p in inertiaVars) { if (!_reservedProps2[p]) { curProp = inertiaVars[p]; if (!_isObject5(curProp)) { tracker = tracker || _getTracker(target); if (tracker && tracker.isTracking(p)) { curProp = _isNumber7(curProp) ? { velocity: curProp } : { velocity: tracker.get(p) }; } else { curVelocity = +curProp || 0; curDuration = Math.abs(curVelocity / resistance); } } if (_isObject5(curProp)) { if (_isNumber7(curProp.velocity)) { curVelocity = curProp.velocity; } else { tracker = tracker || _getTracker(target); curVelocity = tracker && tracker.isTracking(p) ? tracker.get(p) : 0; } curDuration = _clamp5(minDuration, maxDuration, Math.abs(curVelocity / _getNumOrDefault(curProp, "resistance", resistance))); curVal = parseFloat(getVal(target, p)) || 0; end = curVal + _calculateChange(curVelocity, curDuration); if ("end" in curProp) { curProp = _parseEnd(curProp, linkedProps && p in linkedProps ? linkedProps : end, curProp.max, curProp.min, p, inertiaVars.radius, curVelocity); if (recordEnd) { _processingVars === vars && (_processingVars = inertiaVars = _deepClone(vars)); inertiaVars[p] = _extend(curProp, inertiaVars[p], "end"); } } if ("max" in curProp && end > +curProp.max + _tinyNum2) { unitFactor = curProp.unitFactor || _config2.unitFactors[p] || 1; curClippedDuration = curVal > curProp.max && curProp.min !== curProp.max || curVelocity * unitFactor > -15 && curVelocity * unitFactor < 45 ? minDuration + (maxDuration - minDuration) * 0.1 : _calculateDuration(curVal, curProp.max, curVelocity); if (curClippedDuration + overshootTolerance < clippedDuration) { clippedDuration = curClippedDuration + overshootTolerance; } } else if ("min" in curProp && end < +curProp.min - _tinyNum2) { unitFactor = curProp.unitFactor || _config2.unitFactors[p] || 1; curClippedDuration = curVal < curProp.min && curProp.min !== curProp.max || curVelocity * unitFactor > -45 && curVelocity * unitFactor < 15 ? minDuration + (maxDuration - minDuration) * 0.1 : _calculateDuration(curVal, curProp.min, curVelocity); if (curClippedDuration + overshootTolerance < clippedDuration) { clippedDuration = curClippedDuration + overshootTolerance; } } curClippedDuration > duration && (duration = curClippedDuration); } curDuration > duration && (duration = curDuration); } } duration > clippedDuration && (duration = clippedDuration); return duration > maxDuration ? maxDuration : duration < minDuration ? minDuration : duration; }; var _initCore9 = function _initCore10() { gsap7 = _getGSAP9(); if (gsap7) { _parseEase3 = gsap7.parseEase; _toArray4 = gsap7.utils.toArray; _getUnit2 = gsap7.utils.getUnit; _getCache4 = gsap7.core.getCache; _clamp5 = gsap7.utils.clamp; _getStyleSaver3 = gsap7.core.getStyleSaver; _reverting3 = gsap7.core.reverting || function() { }; _power3 = _parseEase3("power3"); _checkPointRatio = _power3(0.05); PropTween2 = gsap7.core.PropTween; gsap7.config({ resistance: 100, unitFactors: { time: 1000, totalTime: 1000, progress: 1000, totalProgress: 1000 } }); _config2 = gsap7.config(); gsap7.registerPlugin(VelocityTracker); _coreInitted7 = 1; } }; var InertiaPlugin = { version: "3.14.2", name: "inertia", register: function register(core) { gsap7 = core; _initCore9(); }, init: function init4(target, vars, tween, index, targets) { _coreInitted7 || _initCore9(); var tracker = _getTracker(target); if (vars === "auto") { if (!tracker) { console.warn("No inertia tracking on " + target + ". InertiaPlugin.track(target) first."); return; } vars = tracker.getAll(); } this.styles = _getStyleSaver3 && typeof target.style === "object" && _getStyleSaver3(target); this.target = target; this.tween = tween; _processingVars = vars; var cache = target._gsap, getVal = cache.get, dur = vars.duration, durIsObj = _isObject5(dur), preventOvershoot = vars.preventOvershoot || durIsObj && dur.overshoot === 0, resistance = _getNumOrDefault(vars, "resistance", _config2.resistance), duration = _isNumber7(dur) ? dur : _calculateTweenDuration(target, vars, durIsObj && dur.max || 10, durIsObj && dur.min || 0.2, durIsObj && "overshoot" in dur ? +dur.overshoot : preventOvershoot ? 0 : 1, true), p, curProp, curVal, unit, velocity, change1, end, change2, linkedProps; vars = _processingVars; _processingVars = 0; linkedProps = _processLinkedProps(target, vars, getVal, resistance); for (p in vars) { if (!_reservedProps2[p]) { curProp = vars[p]; _isFunction5(curProp) && (curProp = curProp(index, target, targets)); if (_isNumber7(curProp)) { velocity = curProp; } else if (_isObject5(curProp) && !isNaN(curProp.velocity)) { velocity = +curProp.velocity; } else { if (tracker && tracker.isTracking(p)) { velocity = tracker.get(p); } else { console.warn("ERROR: No velocity was defined for " + target + " property: " + p); } } change1 = _calculateChange(velocity, duration); change2 = 0; curVal = getVal(target, p); unit = _getUnit2(curVal); curVal = parseFloat(curVal); if (_isObject5(curProp)) { end = curVal + change1; if ("end" in curProp) { curProp = _parseEnd(curProp, linkedProps && p in linkedProps ? linkedProps : end, curProp.max, curProp.min, p, vars.radius, velocity); } if ("max" in curProp && +curProp.max < end) { if (preventOvershoot || curProp.preventOvershoot) { change1 = curProp.max - curVal; } else { change2 = curProp.max - curVal - change1; } } else if ("min" in curProp && +curProp.min > end) { if (preventOvershoot || curProp.preventOvershoot) { change1 = curProp.min - curVal; } else { change2 = curProp.min - curVal - change1; } } } this._props.push(p); this.styles && this.styles.save(p); this._pt = new PropTween2(this._pt, target, p, curVal, 0, _emptyFunc3, 0, cache.set(target, p, this)); this._pt.u = unit || 0; this._pt.c1 = change1; this._pt.c2 = change2; } } tween.duration(duration); return _bonusValidated2; }, render: function render3(ratio, data) { var pt = data._pt; ratio = _power3(data.tween._time / data.tween._dur); if (ratio || !_reverting3()) { while (pt) { pt.set(pt.t, pt.p, _round11(pt.s + pt.c1 * ratio + pt.c2 * ratio * ratio) + pt.u, pt.d, ratio); pt = pt._next; } } else { data.styles.revert(); } } }; "track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(name) { return InertiaPlugin[name] = VelocityTracker[name]; }); _getGSAP9() && gsap7.registerPlugin(InertiaPlugin); // src/modules/draggable-card-list.js gsap_default.registerPlugin(import_Draggable.Draggable, InertiaPlugin); function draggable_card_list_default(element, dataset) { const list = element.querySelector(".cwtl_list"); if (!list) return; let draggableInstance = null; function getBounds() { const wrapWidth = element.offsetWidth; const listWidth = list.scrollWidth; const overflow = listWidth - wrapWidth; return { wrapWidth, listWidth, overflow }; } function create() { const { overflow } = getBounds(); if (overflow <= 0) { if (draggableInstance) { draggableInstance[0].kill(); draggableInstance = null; gsap_default.set(list, { x: 0 }); } return; } if (draggableInstance) { draggableInstance[0].applyBounds({ minX: -overflow - 32, maxX: 0 }); if (draggableInstance[0].x < -overflow - 32) { gsap_default.set(list, { x: -overflow - 32 }); draggableInstance[0].update(); } return; } draggableInstance = import_Draggable.Draggable.create(list, { type: "x", bounds: { minX: -overflow - 32, maxX: 0 }, inertia: true, edgeResistance: 0.65, cursor: "grab", activeCursor: "grabbing" }); } create(); const removeResize = Resize.add(() => create()); onDestroy(() => { if (draggableInstance) { draggableInstance[0].kill(); } gsap_default.set(list, { clearProps: "x" }); removeResize(); }); } // src/modules/dropdown.js var exports_dropdown = {}; __export(exports_dropdown, { default: () => dropdown_default }); function dropdown_default(element, dataset) { const button = element.querySelector(".dropdown_toggle_clickable"); const content = element.querySelector(".dropdown_content"); const variant = element.getAttribute("data-wf--dropdown--variant"); function openDropdown() { button.setAttribute("aria-expanded", "true"); element.classList.add("is-active"); let tl = gsap_default.timeline({ onComplete: () => { if (typeof ScrollTrigger !== "undefined") ScrollTrigger.refresh(); } }); tl.set(content, { display: "block" }); tl.fromTo(content, { height: 0 }, { height: "auto", ease: "power1.inOut", duration: 0.4 }); } function closeDropdown() { button.setAttribute("aria-expanded", "false"); element.classList.remove("is-active"); let tl = gsap_default.timeline({ onComplete: () => { if (typeof ScrollTrigger !== "undefined") ScrollTrigger.refresh(); } }); tl.to(content, { height: 0, ease: "power1.inOut", duration: 0.4 }); tl.set(content, { display: "none" }); } function isOpen() { return button.getAttribute("aria-expanded") === "true"; } button.addEventListener("click", () => { isOpen() ? closeDropdown() : openDropdown(); }); document.addEventListener("keydown", function(e) { if (e.key === "Escape" && isOpen()) { closeDropdown(); button.focus(); } if ((e.key === "ArrowDown" || e.key === "ArrowUp") && isOpen() && element.contains(document.activeElement)) { e.preventDefault(); const items = [...content.querySelectorAll("a, button")]; if (items.length === 0) return; const currentIndex = items.indexOf(document.activeElement); let nextIndex; if (currentIndex === -1) { nextIndex = e.key === "ArrowDown" ? 0 : items.length - 1; } else { nextIndex = (currentIndex + (e.key === "ArrowDown" ? 1 : -1) + items.length) % items.length; } items[nextIndex].focus(); } }); document.addEventListener("click", (e) => { if (isOpen() && !element.contains(e.target)) closeDropdown(); }); if (element.getAttribute("data-open-on-hover-in") === "True") { element.addEventListener("mouseenter", () => { if (!isOpen()) openDropdown(); }); } if (element.getAttribute("data-close-on-hover-out") === "True") { element.addEventListener("mouseleave", () => { if (isOpen()) closeDropdown(); }); } } // src/modules/filter.js var exports_filter = {}; __export(exports_filter, { default: () => filter_default }); function filter_default(element, dataset) { const toggle = element.querySelector('[data-match-toggle="tags"]'); if (!toggle) return; window.FinsweetAttributes ||= []; window.FinsweetAttributes.push([ "list", (listInstances) => { const listInstance = listInstances.find((item) => { return item.instance === "Articles"; }); if (!listInstance) return; let isAllMode = false; toggle.addEventListener("click", () => { isAllMode = !isAllMode; const mode = isAllMode ? "and" : "or"; const label = toggle.querySelector(".pill_text"); if (label) { gsap_default.to(label, { opacity: 0, filter: "blur(8px)", scale: 0.99, duration: 0.2, ease: "power2.in", onComplete: () => { label.textContent = isAllMode ? "All" : "Any"; gsap_default.fromTo(label, { opacity: 0, filter: "blur(8px)", scale: 0.99 }, { opacity: 1, filter: "blur(0px)", scale: 1, duration: 0.3, ease: "power2.out" }); } }); } const filters = listInstance.filters.value; for (const group of filters.groups) { for (const condition of group.conditions) { if (condition.fieldKey === "tags") { condition.filterMatch = mode; } } } listInstance.triggerHook("filter"); Scroll.resize(); }); } ]); } // src/modules/hero-video.js var exports_hero_video = {}; __export(exports_hero_video, { default: () => hero_video_default }); function hero_video_default(element) { const srcInitial = element.getAttribute("src-initial"); const srcLoop = element.getAttribute("src-loop"); if (!srcInitial) return; element.removeAttribute("loop"); element.src = srcInitial; element.load(); element.play().catch(() => { }); if (!srcLoop) { element.setAttribute("loop", ""); return; } const loopVideo = element.cloneNode(false); loopVideo.removeAttribute("data-module"); loopVideo.removeAttribute("src-initial"); loopVideo.removeAttribute("src-loop"); loopVideo.removeAttribute("autoplay"); loopVideo.setAttribute("loop", ""); loopVideo.setAttribute("preload", "auto"); loopVideo.src = srcLoop; Object.assign(loopVideo.style, { position: "absolute", inset: "0", width: "100%", height: "100%", opacity: "0", pointerEvents: "none" }); const parent = element.parentElement; let parentWasStatic = false; if (parent && getComputedStyle(parent).position === "static") { parent.style.position = "relative"; parentWasStatic = true; } element.insertAdjacentElement("afterend", loopVideo); loopVideo.load(); const onEnded = () => { loopVideo.play().catch(() => { }); loopVideo.style.opacity = "1"; element.style.opacity = "0"; element.pause(); }; element.addEventListener("ended", onEnded); onDestroy(() => { element.removeEventListener("ended", onEnded); loopVideo.pause(); loopVideo.remove(); element.style.opacity = ""; if (parentWasStatic && parent) parent.style.position = ""; }); } // src/modules/home-hero.js var exports_home_hero = {}; __export(exports_home_hero, { default: () => home_hero_default }); // src/lib/animations.ts var scrollTriggerDefaults = getScrolltriggerDefaults(); function getScrolltriggerDefaults() { let windowWidth = window.innerWidth; let defaults3; if (windowWidth > 991) { defaults3 = { start: "top 80%", end: "top 30%", scrub: true }; } else { defaults3 = { start: "top 80%", end: "bottom 80%", scrub: true }; } return defaults3; } function headingAnimation(element, selector3) { const headings = element.querySelectorAll(selector3); const splitHeadings = new SplitText(headings, { type: "lines, words, chars", charsClass: "char", linesClass: "line", wordsClass: "word" }); const tl = gsap_default.timeline(); splitHeadings.lines.forEach((e) => { tl.from(e.querySelectorAll(".char"), { delay: 0.1, clipPath: "inset(0 0 0 100%)", stagger: 0.05 }, "<+=0.02"); }); return { tl, revert: () => splitHeadings.revert() }; } function paragraphAnimation(element, selector3) { const paras = element.querySelectorAll(selector3); const splitPara = new SplitText(paras, { type: "lines, words, chars", charsClass: "char", linesClass: "u-overflow-hidden", wordsClass: "word" }); const tl = gsap_default.timeline(); splitPara.lines.forEach((e) => { tl.from(e.querySelectorAll(".char"), { yPercent: 100 }, "<+=0.05"); }); return { tl, revert: () => splitPara.revert() }; } function lineAnimation(element, direction) { const line = element.querySelector('[data-element="line"]'); const tl = gsap_default.timeline(); const config3 = direction === "down" ? { scaleY: 0 } : { scaleX: 0 }; tl.from(line, config3); return tl; } function cornerBlockAnimation(element) { const blocks = element.querySelectorAll('[data-element="corner-block"]'); const tl = gsap_default.timeline(); blocks.forEach((block) => { const variant = block.getAttribute("data-wf--corner-cover-small--variant") || block.getAttribute("data-wf--corner-cover-large--variant"); const fromRight = variant === "top-right" || variant === "bottom-right"; const xPercent = fromRight ? 100 : -100; const transformOrigin = variant.replace("-", " "); tl.from(block, { autoAlpha: 0, xPercent, scale: 0.5, transformOrigin }, "<"); }); return tl; } function videoAnimation(element) { const videos = element.querySelectorAll("video"); const tl = gsap_default.timeline(); tl.from(videos, { clipPath: "inset(50% 50% 50% 50%)" }); return tl; } var HIGHLIGHT_SELECTOR = [ ".u-heading-highlight b", ".u-heading-highlight strong", ".u-heading-highlight-purple b", ".u-heading-highlight-purple strong", ".u-heading-highlight-static em", ".u-heading-highlight-yellow b", ".u-heading-highlight-yellow strong" ].join(", "); function highlightAnimation() { const elements = document.querySelectorAll(HIGHLIGHT_SELECTOR); elements.forEach((el) => { if (el.closest('[data-module="scrolling-text-block"]')) return; gsap_default.set(el, { "--highlight-scale": 0 }); gsap_default.to(el, { "--highlight-scale": 1, ease: "none", scrollTrigger: { ...scrollTriggerDefaults, end: "top 50%", trigger: el } }); }); } function navigationAnimation() { const nav = document.querySelector("[data-nav]"); const tl = gsap_default.timeline(); tl.from(nav, { yPercent: -100 }); return tl; } function normalizePath(path) { const stripped = path.replace(/\/+$/, "").toLowerCase(); return stripped === "" ? "/" : stripped; } function setNavActiveState() { const nav = document.querySelector("[data-nav]"); if (!nav) return; const buttons = nav.querySelectorAll("[data-button]"); const current = normalizePath(window.location.pathname); buttons.forEach((button) => { const link = button.querySelector("a[href]"); if (!link) return; let linkUrl; try { linkUrl = new URL(link.href, window.location.origin); } catch { return; } const isExternal = linkUrl.origin !== window.location.origin || link.target === "_blank"; const linkPath = normalizePath(linkUrl.pathname); const isActive = !isExternal && (linkPath === current || linkPath !== "/" && current.startsWith(linkPath + "/")); button.setAttribute("data-trigger", isActive ? "on" : "hover focus"); }); } // src/modules/home-hero.js function home_hero_default(element) { let tl, heading, paragraph; let played = false; onMount(() => { heading = headingAnimation(element, "h1"); paragraph = paragraphAnimation(element, "p"); tl = gsap_default.timeline({ paused: true }); tl.add(heading.tl); tl.add(lineAnimation(element, "down"), "<+=0.4"); tl.add(paragraph.tl, "<+=0.2"); tl.add(videoAnimation(element), "<+=0.2"); tl.add(cornerBlockAnimation(element), "<+=0.2"); }); onPageIn(() => { tl.play(); played = true; }); const removeResize = Resize.add(() => { if (!played) return; heading.revert(); paragraph.revert(); heading = headingAnimation(element, "h1"); paragraph = paragraphAnimation(element, "p"); }); onDestroy(() => { removeResize(); heading?.revert(); paragraph?.revert(); tl?.kill(); }); } // src/modules/image-marquee.js var exports_image_marquee = {}; __export(exports_image_marquee, { default: () => image_marquee_default }); function image_marquee_default(element, dataset) { const clone2 = element.querySelector(".im_block").cloneNode(true); element.appendChild(clone2); let tl = gsap_default.timeline({ repeat: -1, defaults: { ease: "none" } }); tl.to(element.querySelectorAll(".im_block"), { xPercent: -100, duration: 15 }); element.addEventListener("mouseenter", () => tl.pause()); element.addEventListener("mouseleave", () => tl.resume()); } // src/modules/lined-bg.js var exports_lined_bg = {}; __export(exports_lined_bg, { default: () => lined_bg_default }); function lined_bg_default(element, dataset) { let height = element.clientHeight; let lineCount = Math.floor(height / 32); for (let i = 0;i < lineCount; i++) { const line = document.createElement("div"); line.classList.add("lined_bg_line"); element.appendChild(line); } gsap_default.set(".lined_bg_line", { width: 0 }); let tl = gsap_default.timeline({ scrollTrigger: { ...scrollTriggerDefaults, trigger: element, markers: isStaging } }); tl.to(".lined_bg_line", { width: "100%", stagger: 0.1 }); onDestroy(() => { tl.kill(); }); } // src/modules/logo-tabs.js var exports_logo_tabs = {}; __export(exports_logo_tabs, { default: () => logo_tabs_default }); // src/lib/cms-merge.ts function cms_merge_default(element, itemsArray, destinationsArray) { const items = itemsArray; const categories = new Map; const destinations = destinationsArray; items.forEach((e) => { const destination = destinations.filter((dest) => { return e.getAttribute("data-category") === dest.getAttribute("data-category"); }); if (!categories.get(destination)) { categories.set(destination[0].getAttribute("data-category"), []); } categories.get(destination[0].getAttribute("data-category")).push(destination[0]); destination[0].appendChild(e); }); return categories; } // src/modules/logo-tabs.js function logo_tabs_default(element, _dataset) { const logos = Array.from(element.querySelectorAll('[data-element="logo"]')); const destinations = Array.from(element.querySelectorAll('[data-element="logo-destination"]')); const tabMenus = cms_merge_default(element, logos, destinations); const buttons = getTabLinks('[data-element="button"]'); const index = ref2(""); watch(index, handleTabChange); tabMenus.forEach((e) => { gsap_default.set(e, { opacity: 0, filter: "blur(10px)", scale: 0.95 }); }); index.value = buttons.entries().next().value[0]; console.log(index.value); function getTabLinks(query) { const map = new Map; Array.from(element.querySelectorAll(query)).map((e) => { map.set(e.getAttribute("data-category"), e); e.addEventListener("click", () => { index.value = e.getAttribute("data-category"); }); }); return map; } function handleTabChange(newVal, oldVal) { console.log(buttons); const newButton = buttons.get(newVal); const newTabMenu = tabMenus.get(newVal); const oldButton = buttons.get(oldVal); const oldTabMenu = tabMenus.get(oldVal); console.log(newButton, newTabMenu, oldButton, oldTabMenu); let tl = gsap_default.timeline({}); tl.to(newButton, { backgroundColor: "#F1DAFE" }); tl.to(oldButton, { backgroundColor: "transparent" }, "<"); tl.to(newTabMenu, { opacity: 1, filter: "blur(0px)", scale: 1 }, "<"); tl.to(oldTabMenu, { opacity: 0, filter: "blur(10px)", scale: 0.98 }, "<"); } } // src/modules/s-lines.js var exports_s_lines = {}; __export(exports_s_lines, { default: () => s_lines_default }); function s_lines_default(element, dataset) { let lines = { top: element.querySelector(".s-lines_top"), horizontal: element.querySelector(".s-lines_horizontal"), bottom: element.querySelector(".s-lines_bottom") }; let tl = gsap_default.timeline({ scrollTrigger: { ...scrollTriggerDefaults, trigger: element, markers: isStaging }, defaults: { ease: "none" } }); tl.from(lines.top, { scaleY: 0 }); tl.from(lines.horizontal, { scaleX: 0 }); tl.from(lines.bottom, { scaleY: 0 }); onDestroy(() => { tl.kill(); }); } // src/modules/scrolling-text-block.js var exports_scrolling_text_block = {}; __export(exports_scrolling_text_block, { default: () => scrolling_text_block_default }); function scrolling_text_block_default(element, dataset) { const selector3 = dataset.selector || ".u-heading-highlight h2"; const heading = element.querySelector(selector3); if (!heading) return; let split, tl; function create() { split = new SplitText(heading, { type: "chars, words, lines", charsClass: "char", linesClass: "u-text-trim-off", deepSlice: true }); const strongs = heading.querySelectorAll("strong"); gsap_default.set(split.chars, { color: "#DCD5CC" }); gsap_default.set(strongs, { "--highlight-scale": 0 }); const charStagger = 0.4; const lineGap = 2; tl = gsap_default.timeline({ scrollTrigger: { ...scrollTriggerDefaults, trigger: element, markers: isStaging }, defaults: { ease: "none" } }); split.lines.forEach((line, index) => { const lineChars = line.querySelectorAll(".char"); tl.to(lineChars, { color: "#000", stagger: charStagger }, lineGap * index); }); tl.to(strongs, { "--highlight-scale": 1, stagger: 0.5, duration: 4 }, ">-=2"); } function teardown() { tl?.kill(); split?.revert(); } create(); const removeResize = Resize.add(() => { teardown(); create(); }); onDestroy(() => { removeResize(); teardown(); }); } // src/modules/sticky-pill.js var exports_sticky_pill = {}; __export(exports_sticky_pill, { default: () => sticky_pill_default }); // src/utils/client-rect.ts var clientRect = (element) => { const bounds = element.getBoundingClientRect(); return { top: bounds.top + Scroll.scroll, bottom: bounds.bottom + Scroll.scroll, normalTop: bounds.top, normalBottom: bounds.bottom, width: bounds.width, height: bounds.height, left: bounds.left, right: bounds.right, wh: Resize.height, ww: Resize.width, offset: bounds.top + Scroll.scroll, centery: Resize.height / 2 - bounds.height / 2 - bounds.top - Scroll.scroll, centerx: -Resize.width / 2 + bounds.left + bounds.width / 2 }; }; // src/modules/sticky-pill.js function sticky_pill_default(element, dataset) { const rect = clientRect(element); let scrollHeight = Number(Scroll.dimensions.scrollHeight); let tl; const resizeUnsubscribe = Resize.add(({ width, height }) => { initStickyPill(); }); const rafUnsubscribe = Raf.add(() => { if (scrollHeight !== Scroll.dimensions.scrollHeight) { initStickyPill(); } }); onMount(() => { initStickyPill(); }); function initStickyPill() { if (tl) { tl.kill(); } const pillDistance = Scroll.dimensions.scrollHeight - rect.normalTop * 2; tl = gsap_default.timeline({ scrollTrigger: { ...scrollTriggerDefaults, trigger: element, endTrigger: document.body, start: "center 20%", end: "bottom bottom" }, defaults: { ease: "none" } }); tl.to(element, { y: "+=" + pillDistance }); scrollHeight = Number(Scroll.dimensions.scrollHeight); } onDestroy(() => { rafUnsubscribe(); resizeUnsubscribe(); tl.kill(); }); } // src/modules/tabs.js var exports_tabs = {}; __export(exports_tabs, { default: () => tabs_default }); function tabs_default(element, dataset) { const realHeader = element.querySelector(".tabs_header:not(.u-cover-absolute)"); const lines = { top: realHeader.querySelector(".tab_line_top"), vert: realHeader.querySelector(".tab_line_vert"), right: realHeader.querySelector(".tab_line_right"), short: realHeader.querySelector(".tab_line_short"), circle: realHeader.querySelector(".g_large_dot"), arrow: realHeader.querySelector(".tab_line_polygon") }; let tl = gsap_default.timeline({ scrollTrigger: { ...scrollTriggerDefaults, trigger: element, markers: isStaging }, defaults: { ease: "none" } }); tl.from(lines.top, { scaleX: 0 }); tl.from(lines.vert, { scaleY: 0 }, ">-=1"); tl.from(lines.right, { scaleX: 0 }); tl.from(lines.short, { scaleY: 0 }); tl.from(lines.circle, { scale: 0.8 }, ">-=1"); tl.to("body", { opacity: 1 }); tl.to(lines.arrow, { y: `+=${lines.vert.clientHeight}` }, 0.2); tl.set(lines.arrow, { rotateZ: 0, y: "-=2px" }, 1.4); tl.to(lines.arrow, { x: `+=${lines.right.clientWidth}` }, 1.4); tl.set(lines.arrow, { rotateZ: 90, x: "-=1px" }, 2.6); tl.to(lines.arrow, { y: `+=${lines.short.clientHeight}` }, 2.6); if (window.innerWidth < 991) return; const cardsList = element.querySelector(".tabs_cards_list"); const cards = Array.from(element.querySelectorAll(".tabs_card")); if (!cardsList || cards.length < 2) return; gsap_default.set(cardsList, { position: "relative" }); gsap_default.set(cards, { position: "relative" }); const GAP = 88; const REVEAL_GAP = 8; let activeIndex = -1; const tweens = []; let stackedMargins = []; function calcMargins() { stackedMargins = cards.map((card, i) => { if (i === 0) return 0; return -(cards[i - 1].offsetHeight - GAP); }); } function applyLayout(animate = false) { const duration = animate ? 0.4 : 0; cards.forEach((card, i) => { const z = i + 1; if (i === 0) { gsap_default.to(card, { zIndex: z, duration: 0 }); return; } const isRevealing = activeIndex !== -1 && i === activeIndex + 1; const mt = isRevealing ? REVEAL_GAP : stackedMargins[i]; const t = gsap_default.to(card, { marginTop: mt, zIndex: z, duration, ease: "power2.out" }); if (animate) tweens.push(t); }); if (animate && tweens.length) { tweens[tweens.length - 1].then(() => Scroll.resize()); } } function setActive(index) { activeIndex = index === activeIndex ? -1 : index; applyLayout(true); } calcMargins(); applyLayout(); function handleEnter(i) { return () => { if (i === activeIndex) return; tweens.push(gsap_default.to(cards[i], { y: "-1rem", duration: 0.3, ease: "power2.out" })); }; } function handleLeave(i) { return () => { if (i === activeIndex) return; tweens.push(gsap_default.to(cards[i], { y: 0, duration: 0.3, ease: "power2.out" })); }; } function handleClick(i) { return () => setActive(i); } const listeners2 = []; cards.forEach((card, i) => { const enter = handleEnter(i); const leave = handleLeave(i); const click = handleClick(i); card.addEventListener("mouseenter", enter); card.addEventListener("mouseleave", leave); card.addEventListener("click", click); listeners2.push({ card, enter, leave, click }); }); const removeResize = Resize.add(() => { calcMargins(); applyLayout(); }); onDestroy(() => { listeners2.forEach(({ card, enter, leave, click }) => { card.removeEventListener("mouseenter", enter); card.removeEventListener("mouseleave", leave); card.removeEventListener("click", click); }); tweens.forEach((t) => t.kill()); tl.kill(); removeResize(); }); } // src/modules/text-content.js var exports_text_content = {}; __export(exports_text_content, { default: () => text_content_default }); function text_content_default(element, dataset) { element.querySelectorAll(".w-richtext p").forEach((p) => { if (p.textContent.trim() === "‍") { p.style.borderTop = "1px solid #DCD5CC"; } }); const tables = document.querySelectorAll("[data-table]"); if (!tables.length) return; const walker = document.createTreeWalker(element.querySelector(".w-richtext"), NodeFilter.SHOW_TEXT, null); const matches2 = []; while (walker.nextNode()) { const node = walker.currentNode; const match = node.textContent.match(/^\[\[table-(\d+)\]\]$/); if (match) { matches2.push({ node, index: parseInt(match[1], 10) }); } } matches2.forEach(({ node, index }) => { const table = tables[index - 1]; if (!table) return; node.parentElement.replaceWith(table); }); Scroll.resize(); } // src/modules/tooltip.js var exports_tooltip = {}; __export(exports_tooltip, { default: () => tooltip_default }); function tooltip_default(element, dataset) { const tooltips = element.querySelectorAll(".lwt_tooltip_wrap"); const images = element.querySelectorAll("img"); function position() { if (window.innerWidth > 767) { tooltips.forEach((t) => t.classList.remove("is-flipped")); return; } tooltips.forEach((t) => { const rect = t.getBoundingClientRect(); if (rect.left < window.innerWidth / 2) { t.classList.add("is-flipped"); } else { t.classList.remove("is-flipped"); } }); } let loaded = 0; const total = images.length; images.forEach((img) => { if (img.complete) { loaded++; } else { img.addEventListener("load", () => { loaded++; if (loaded >= total) position(); }, { once: true }); } }); onMount(() => { position(); }); const unsub = Resize.add(position); onDestroy(() => unsub()); } // src/modules/_/create.ts var modules = { "./../accent-tag.js": exports_accent_tag, "./../accordion-feature.js": exports_accordion_feature, "./../accordion.js": exports_accordion, "./../blog-list.js": exports_blog_list, "./../blog-tags.js": exports_blog_tags, "./../circular-feature-accordion.js": exports_circular_feature_accordion, "./../circular-feature.js": exports_circular_feature, "./../customer-stories-tabs.js": exports_customer_stories_tabs, "./../dots.js": exports_dots, "./../draggable-card-list.js": exports_draggable_card_list, "./../dropdown.js": exports_dropdown, "./../filter.js": exports_filter, "./../hero-video.js": exports_hero_video, "./../home-hero.js": exports_home_hero, "./../image-marquee.js": exports_image_marquee, "./../lined-bg.js": exports_lined_bg, "./../logo-tabs.js": exports_logo_tabs, "./../s-lines.js": exports_s_lines, "./../scrolling-text-block.js": exports_scrolling_text_block, "./../sticky-pill.js": exports_sticky_pill, "./../tabs.js": exports_tabs, "./../text-content.js": exports_text_content, "./../tooltip.js": exports_tooltip }; function createCycles(dataAttribute = "module") { return Array.from(document.querySelectorAll(`[data-${dataAttribute}]`)).map((element) => { const htmlElement = element; const attributeValue = htmlElement.dataset[dataAttribute]; if (htmlElement._moduleInitialized) { return null; } const modulePath = modules[`./../${attributeValue}.ts`] ? `./../${attributeValue}.ts` : `./../${attributeValue}.js`; if (modules[modulePath]) { const moduleFn = modules[modulePath].default; if (typeof moduleFn === "function") { try { htmlElement._moduleInitialized = true; return moduleFn(htmlElement, htmlElement.dataset); } catch (error) { delete htmlElement._moduleInitialized; console.warn(`Failed to call default function for ${dataAttribute} "${attributeValue}":`, error); return null; } } else { console.warn(`Default export is not a function for ${dataAttribute} "${attributeValue}"`); return null; } } else { console.warn(`${dataAttribute} not found: "${attributeValue}"`); return null; } }).filter((item) => item !== null); } // src/modules/_/observe.ts class ObserverManager { static instance; groups = []; constructor() { } static getInstance() { if (!ObserverManager.instance) { ObserverManager.instance = new ObserverManager; } return ObserverManager.instance; } configsMatch(config1, config22) { return config1.root === config22.root && config1.rootMargin === config22.rootMargin; } handleIntersection(entries) { entries.forEach((entry) => { const group = this.groups.find((g) => { return Array.from(g.elements.keys()).includes(entry.target); }); if (!group) return; const element = entry.target; const elementData = group.elements.get(element); if (!elementData) return; const { isIntersecting, intersectionRatio, boundingClientRect } = entry; let direction = -1; if (elementData.lastDirection !== undefined) { direction = isIntersecting ? boundingClientRect.top > 0 ? 1 : -1 : boundingClientRect.top > 0 ? -1 : 1; } elementData.lastDirection = direction; if (isIntersecting) { elementData.callbacks.isIn?.({ entry, direction }); elementData.callbacks.callback?.({ entry, direction, isIn: true }); if (elementData.once) { this.removeElement(element); } } else { elementData.callbacks.isOut?.({ entry, direction }); elementData.callbacks.callback?.({ entry, direction, isIn: false }); } }); } addElement(element, config3, callbacks) { this.removeElement(element); let group = this.groups.find((g) => this.configsMatch(g.config, config3)); if (!group) { const observer = new IntersectionObserver((entries) => this.handleIntersection(entries), { ...config3, threshold: [0] }); group = { config: config3, observer, elements: new Map }; this.groups.push(group); } group.elements.set(element, { callbacks, once: config3.once || false, lastDirection: undefined }); group.observer.observe(element); return group; } removeElement(element) { const group = this.groups.find((g) => g.elements.has(element)); if (!group) return; group.observer.unobserve(element); group.elements.delete(element); if (group.elements.size === 0) { group.observer.disconnect(); this.groups = this.groups.filter((g) => g !== group); } } } class Observe { element; #config; #group; isIn(data) { } isOut(data) { } inView; callback; #lastDirection = null; #wasIntersecting = null; constructor(element, config3 = { root: null, rootMargin: "0px", threshold: 0, autoStart: false, once: false, callback: undefined }) { this.element = element; this.#config = config3; this.inView = false; this.callback = config3.callback || (() => { }); if (config3.autoStart) this.start(); } start() { this.#group = ObserverManager.getInstance().addElement(this.element, this.#config, { isIn: (data) => { this.inView = true; this.isIn?.(data); }, isOut: (data) => { this.inView = false; this.isOut?.(data); }, callback: this.callback }); } stop() { ObserverManager.getInstance().removeElement(this.element); } destroy() { this.stop(); this.#lastDirection = null; this.#wasIntersecting = null; } } // src/utils/math.ts function map(value, low1, high1, low2, high2) { return low2 + (high2 - low2) * (value - low1) / (high1 - low1); } function clamp4(min, max, num) { return Math.min(Math.max(num, min), max); } // src/modules/_/track.ts var DEFAULT_CONFIG = { bounds: [0, 1], top: "bottom", bottom: "top", callback: undefined }; class Track extends Observe { value = 0; init = false; isIn(data) { this.#handleScroll(); } isOut(data) { } bounds; config; resize; handleScroll; #scrollSub; #resizeSub; constructor(element, config3 = {}) { super(element, { autoStart: true, once: false, threshold: 0 }); this.element = element; this.config = { ...DEFAULT_CONFIG, ...config3 }; this.#resize(); this.#scrollSub = Scroll.add(this.#handleScroll.bind(this)); this.#resizeSub = Resize.add(this.#resize.bind(this)); this.init = true; this.#handleScroll(); } #resize = () => { this.bounds = computeBounds(this.element, this.config); this.resize?.(this.bounds); this.#handleScroll(); }; #handleScroll() { if (!this.inView || !this.init) return; this.value = clamp4(0, 1, map(Scroll.scroll, this.bounds.top, this.bounds.bottom, this.config.bounds[0], this.config.bounds[1])); this.handleScroll?.(this.value); this.config.callback?.(this.value); } destroy() { this.config.callback = undefined; this.#scrollSub(); this.#resizeSub(); super.destroy(); } } function computeBounds(el, config3) { const bounds = clientRect(el); const { top: topPos, bottom: bottomPos, wh } = bounds; const centerOffset = wh / 2; bounds.top = topPos - (config3.top === "center" ? centerOffset : config3.top === "bottom" ? wh : 0); bounds.bottom = bottomPos - (config3.bottom === "center" ? centerOffset : config3.bottom === "bottom" ? wh : 0); return bounds; } // src/utils/tick.ts var ENABLE_TICK_LOGGING = true; var tickFirstHit = typeof window !== "undefined" && window.TICK_FIRST_HIT ? window.TICK_FIRST_HIT : null; var jsLoadDelay = performance.now(); var scriptLoadTime = tickFirstHit ? jsLoadDelay - tickFirstHit : null; var pageLoadTime = performance.timeOrigin || (performance.timing && performance.timing.navigationStart ? performance.timing.navigationStart : Date.now()); var startTime = performance.now(); var previousTime = startTime; var isFirstCall = true; var domReadyTime = null; var firstRenderTime = null; var handleDOMContentLoaded = () => { domReadyTime = performance.now(); }; if (typeof document !== "undefined") { if (document.readyState === "complete" || document.readyState === "interactive") { domReadyTime = performance.now(); } else { document.addEventListener("DOMContentLoaded", handleDOMContentLoaded); } if (ENABLE_TICK_LOGGING && "PerformanceObserver" in window) { try { const paintObserver = new PerformanceObserver((list) => { for (const entry of list.getEntries()) { const paintEntry = entry; if (paintEntry.name === "first-contentful-paint" && !firstRenderTime) { firstRenderTime = paintEntry.startTime; } } }); paintObserver.observe({ entryTypes: ["paint"] }); } catch (e) { } } } var webVitalsWorker = null; async function initWorker() { if (typeof Worker === "undefined") return null; try { const workerCode = ` function calculateTBT(longTaskDurations) { return longTaskDurations .filter((duration) => duration > 50) .reduce((sum, duration) => sum + (duration - 50), 0); } self.addEventListener('message', (e) => { const { type, data } = e.data; if (type === 'CALCULATE_TBT') { const tbt = calculateTBT(data); self.postMessage({ type: 'TBT_CALCULATED', data: tbt }); } }); `; const blob = new Blob([workerCode], { type: "application/javascript" }); const workerUrl = URL.createObjectURL(blob); const worker = new Worker(workerUrl); worker.onmessage = (e) => { const { type, data } = e.data; if (type === "TBT_CALCULATED") { webVitals.tbt = data; } }; return worker; } catch (error) { return null; } } initWorker().then((worker) => { webVitalsWorker = worker; }); var webVitals = { fcp: null, lcp: null, fid: null, cls: 0, tbt: 0, tti: null, fmp: null }; function getScoreColor(value, thresholds) { if (value <= thresholds.good) return "#10b981"; if (value <= thresholds.poor) return "#f59e0b"; return "#ef4444"; } function getRating(value, thresholds) { if (value <= thresholds.good) return "good"; if (value <= thresholds.poor) return "needs-improvement"; return "poor"; } if (ENABLE_TICK_LOGGING) { try { const paintEntries = performance.getEntriesByType("paint"); paintEntries.forEach((entry) => { if (entry.name === "first-contentful-paint") { webVitals.fcp = entry.startTime; } }); } catch (e) { } } if (ENABLE_TICK_LOGGING) { try { const paintEntries = performance.getEntriesByType("paint"); paintEntries.forEach((entry) => { if (entry.name === "first-paint") { webVitals.fmp = entry.startTime; } }); } catch (e) { } } var lcpObserver = null; if (ENABLE_TICK_LOGGING && "PerformanceObserver" in window && "observe" in PerformanceObserver.prototype) { try { lcpObserver = new PerformanceObserver((list) => { const entries = list.getEntries(); const lastEntry = entries[entries.length - 1]; if (lastEntry && lastEntry.renderTime) { webVitals.lcp = lastEntry.renderTime || lastEntry.loadTime; } }); lcpObserver.observe({ entryTypes: ["largest-contentful-paint"] }); } catch (e) { } } var clsObserver = null; if (ENABLE_TICK_LOGGING && "PerformanceObserver" in window) { try { clsObserver = new PerformanceObserver((list) => { for (const entry of list.getEntries()) { const layoutEntry = entry; if (!layoutEntry.hadRecentInput && layoutEntry.value) { webVitals.cls += layoutEntry.value; } } }); clsObserver.observe({ entryTypes: ["layout-shift"] }); } catch (e) { } } var fidObserver = null; if (ENABLE_TICK_LOGGING && "PerformanceObserver" in window) { try { fidObserver = new PerformanceObserver((list) => { for (const entry of list.getEntries()) { const fidEntry = entry; if (fidEntry.processingStart && fidEntry.startTime) { webVitals.fid = fidEntry.processingStart - fidEntry.startTime; fidObserver?.disconnect(); } } }); fidObserver.observe({ entryTypes: ["first-input"] }); } catch (e) { } } var longTaskObserver = null; var longTasks = []; if (ENABLE_TICK_LOGGING && "PerformanceObserver" in window) { try { longTaskObserver = new PerformanceObserver((list) => { for (const entry of list.getEntries()) { const longTask = entry; if (longTask.duration > 50) { const blockingTime = longTask.duration - 50; longTasks.push(blockingTime); webVitals.tbt = longTasks.reduce((sum, t) => sum + t, 0); } } }); longTaskObserver.observe({ entryTypes: ["longtask"] }); } catch (e) { } } if (ENABLE_TICK_LOGGING) { try { if (performance.timing) { const timing = performance.timing; const domInteractive = timing.domInteractive - timing.navigationStart; const domComplete = timing.domContentLoadedEventEnd - timing.navigationStart; webVitals.tti = domInteractive > 0 ? domInteractive : domComplete > 0 ? domComplete : null; } else if (performance.getEntriesByType) { const navEntries = performance.getEntriesByType("navigation"); if (navEntries.length > 0) { const nav = navEntries[0]; webVitals.tti = nav.domInteractive > 0 ? nav.domInteractive : nav.domContentLoadedEventEnd; } } } catch (e) { } } var FRAME_BUDGET_60FPS = 16.67; var FRAME_BUDGET = FRAME_BUDGET_60FPS; var LONG_FRAME_THRESHOLD = 50; var animationMetrics = { fps: 0, avgFps: 0, minFps: Infinity, maxFps: 0, frameTime: 0, avgFrameTime: 0, minFrameTime: Infinity, maxFrameTime: 0, droppedFrames: 0, frameBudgetCompliance: 100, smoothnessScore: 100, memoryUsed: null, memoryTotal: null, totalFrames: 0, longFrames: 0 }; var frameTimeHistory = []; var MAX_HISTORY_SIZE = 120; var rafUnsubscribe = null; var frameTrackingActive = false; var frameDropHistory = []; var MAX_FRAME_DROP_HISTORY = 50; var rafFrameStart = null; var rafFrameNumber = 0; var frameDropDetectionEnabled = false; var functionInstrumentationEnabled = false; var instrumentedFunctions = new Map; function updateMemoryMetrics() { if ("memory" in performance && typeof performance.memory !== "undefined") { const memory = performance.memory; animationMetrics.memoryUsed = memory.usedJSHeapSize / 1048576; animationMetrics.memoryTotal = memory.totalJSHeapSize / 1048576; } } function detectFrameDrops() { if (!frameDropDetectionEnabled) return; const now = performance.now(); if (rafFrameStart === null) { rafFrameStart = now; rafFrameNumber = 0; return; } const frameTime = now - rafFrameStart; rafFrameNumber++; const droppedFrameThreshold = FRAME_BUDGET * 1.5; if (frameTime > droppedFrameThreshold) { analyzeFrameDrop(frameTime, rafFrameNumber); } rafFrameStart = now; } function analyzeFrameDrop(frameTime, frameNumber) { const dropInfo = { frameTime, timestamp: performance.now(), frameNumber, slowFunctions: [], performanceMarks: [] }; try { const marks = performance.getEntriesByType("mark"); const measures = performance.getEntriesByType("measure"); const recentThreshold = performance.now() - 100; const recentMarks = marks.filter((m) => m.startTime >= recentThreshold); const recentMeasures = measures.filter((m) => m.startTime >= recentThreshold); recentMeasures.sort((a, b) => b.duration - a.duration); dropInfo.performanceMarks = recentMeasures.slice(0, 10).map((m) => ({ name: m.name, startTime: m.startTime, duration: m.duration })); if (functionInstrumentationEnabled) { const slowFunctions = Array.from(instrumentedFunctions.entries()).map(([name, stats]) => ({ name, avgTime: stats.totalTime / Math.max(stats.callCount, 1), maxTime: stats.maxTime, callCount: stats.callCount })).filter((f) => f.maxTime > 5).sort((a, b) => b.maxTime - a.maxTime).slice(0, 5); dropInfo.slowFunctions = slowFunctions.map((f) => ({ name: f.name, duration: f.maxTime })); } try { throw new Error; } catch (e) { if (e.stack) { dropInfo.stackTrace = e.stack; } } } catch (e) { } frameDropHistory.push(dropInfo); if (frameDropHistory.length > MAX_FRAME_DROP_HISTORY) { frameDropHistory.shift(); } if (ENABLE_TICK_LOGGING && frameDropDetectionEnabled) { console.warn(`%c⚠️ Frame Drop Detected%c Frame #${frameNumber} took ${frameTime.toFixed(2)}ms (budget: ${FRAME_BUDGET.toFixed(2)}ms)`, "background: #ef4444; color: white; padding: 4px 8px; border-radius: 4px; font-weight: bold;", "color: #ef4444; font-weight: bold; margin-left: 8px;"); if (dropInfo.performanceMarks.length > 0) { console.group("Slow Functions (Performance Marks):"); dropInfo.performanceMarks.forEach((mark, i) => { const color = mark.duration > 16 ? "#ef4444" : mark.duration > 8 ? "#f59e0b" : "#6b7280"; console.log(`%c${i + 1}. ${mark.name}%c ${mark.duration.toFixed(2)}ms`, `color: ${color}; font-weight: bold;`, `color: ${color};`); }); console.groupEnd(); } if (dropInfo.slowFunctions.length > 0) { console.group("Slow Functions (Instrumented):"); dropInfo.slowFunctions.forEach((fn, i) => { const color = fn.duration > 16 ? "#ef4444" : fn.duration > 8 ? "#f59e0b" : "#6b7280"; console.log(`%c${i + 1}. ${fn.name}%c ${fn.duration.toFixed(2)}ms`, `color: ${color}; font-weight: bold;`, `color: ${color};`); }); console.groupEnd(); } } } function instrumentFunction(fn, name) { if (!functionInstrumentationEnabled) return fn; const stats = { original: fn, callCount: 0, totalTime: 0, maxTime: 0, minTime: Infinity }; instrumentedFunctions.set(name, stats); return (...args) => { const start = performance.now(); const markName = `fn:${name}`; try { performance.mark(`${markName}:start`); const result = fn(...args); performance.mark(`${markName}:end`); performance.measure(markName, `${markName}:start`, `${markName}:end`); const duration = performance.now() - start; stats.callCount++; stats.totalTime += duration; stats.maxTime = Math.max(stats.maxTime, duration); stats.minTime = Math.min(stats.minTime, duration); try { performance.clearMarks(`${markName}:start`); performance.clearMarks(`${markName}:end`); performance.clearMeasures(markName); } catch (e) { } return result; } catch (error) { const duration = performance.now() - start; stats.callCount++; stats.totalTime += duration; throw error; } }; } function instrumentObjectMethods(obj, prefix = "") { if (!functionInstrumentationEnabled) return; Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).forEach((name) => { const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), name); if (descriptor && typeof descriptor.value === "function" && name !== "constructor") { const original = obj[name]; obj[name] = instrumentFunction(original.bind(obj), `${prefix}.${name}`); } }); } var fpsElement = null; var fpsDisplayVisible = false; var FPS_DISPLAY_STORAGE_KEY = "fps-display-visible"; var fpsFrameCount = 0; var fpsLastTime = 0; function createFpsDisplay() { const div = document.createElement("div"); div.textContent = "FPS: --"; div.style.position = "fixed"; div.style.bottom = "0"; div.style.left = "0"; div.style.backgroundColor = "black"; div.style.color = "white"; div.style.padding = "8px 12px"; div.style.fontFamily = "monospace"; div.style.fontSize = "8px"; div.style.zIndex = "999999"; div.style.pointerEvents = "none"; div.style.display = fpsDisplayVisible ? "block" : "none"; document.body.appendChild(div); return div; } function loadFpsDisplayState() { const saved = localStorage.getItem(FPS_DISPLAY_STORAGE_KEY); if (saved !== null) { fpsDisplayVisible = saved === "true"; } } function saveFpsDisplayState() { localStorage.setItem(FPS_DISPLAY_STORAGE_KEY, String(fpsDisplayVisible)); } function toggleFpsDisplay() { fpsDisplayVisible = !fpsDisplayVisible; if (fpsElement) { fpsElement.style.display = fpsDisplayVisible ? "block" : "none"; } saveFpsDisplayState(); } function updateFpsDisplay() { if (!fpsElement || !fpsDisplayVisible) return; fpsFrameCount++; const currentTime = performance.now(); if (fpsLastTime === 0) { fpsLastTime = currentTime; return; } const elapsedTime = currentTime - fpsLastTime; if (fpsFrameCount >= 10 && elapsedTime > 0) { const fps = Math.round(1000 * fpsFrameCount / elapsedTime); if (fps > 0) { fpsElement.textContent = `FPS: ${fps}`; } fpsFrameCount = 0; fpsLastTime = currentTime; } } var handleFpsToggleKeydown = (e) => { if (e.shiftKey && (e.key === "F" || e.key === "f")) { e.preventDefault(); toggleFpsDisplay(); } }; function initFpsDisplay() { if (typeof document === "undefined" || !document.body) return; loadFpsDisplayState(); fpsElement = createFpsDisplay(); window.addEventListener("keydown", handleFpsToggleKeydown); } function cleanupFpsDisplay() { if (!ENABLE_TICK_LOGGING) return; stopFrameTracking(); if (fpsElement && fpsElement.parentNode) { fpsElement.parentNode.removeChild(fpsElement); fpsElement = null; } fpsFrameCount = 0; fpsLastTime = 0; } function restoreFpsDisplay() { if (typeof document === "undefined" || !document.body) return; if (!ENABLE_TICK_LOGGING) return; if (!fpsElement || !fpsElement.parentNode) { loadFpsDisplayState(); fpsElement = createFpsDisplay(); fpsLastTime = performance.now(); fpsFrameCount = 0; } if (!frameTrackingActive) { startFrameTracking(); } } if (ENABLE_TICK_LOGGING && typeof document !== "undefined") { if (document.body) { initFpsDisplay(); } else { document.addEventListener("DOMContentLoaded", initFpsDisplay); } } function startFrameTracking() { if (frameTrackingActive) return; frameTrackingActive = true; fpsLastTime = performance.now(); fpsFrameCount = 0; rafUnsubscribe = Raf.add(({ deltaTime }) => { if (frameDropDetectionEnabled) { detectFrameDrops(); } const frameTime = deltaTime * 1000; animationMetrics.frameTime = frameTime; animationMetrics.fps = frameTime > 0 ? Math.round(1000 / frameTime) : 0; animationMetrics.minFrameTime = Math.min(animationMetrics.minFrameTime, frameTime); animationMetrics.maxFrameTime = Math.max(animationMetrics.maxFrameTime, frameTime); animationMetrics.minFps = Math.min(animationMetrics.minFps, animationMetrics.fps); animationMetrics.maxFps = Math.max(animationMetrics.maxFps, animationMetrics.fps); if (frameTime > FRAME_BUDGET) { animationMetrics.droppedFrames++; } if (frameTime > LONG_FRAME_THRESHOLD) { animationMetrics.longFrames++; } frameTimeHistory.push(frameTime); if (frameTimeHistory.length > MAX_HISTORY_SIZE) { frameTimeHistory.shift(); } if (frameTimeHistory.length > 0) { const sum = frameTimeHistory.reduce((a, b) => a + b, 0); animationMetrics.avgFrameTime = sum / frameTimeHistory.length; animationMetrics.avgFps = Math.round(1000 / animationMetrics.avgFrameTime); } const framesInBudget = frameTimeHistory.filter((ft) => ft <= FRAME_BUDGET).length; animationMetrics.frameBudgetCompliance = framesInBudget / frameTimeHistory.length * 100; if (frameTimeHistory.length >= 30) { const variance = frameTimeHistory.reduce((acc, ft) => { const diff = ft - animationMetrics.avgFrameTime; return acc + diff * diff; }, 0) / frameTimeHistory.length; const stdDev = Math.sqrt(variance); animationMetrics.smoothnessScore = Math.max(0, Math.min(100, 100 - stdDev / 5 * 50)); } animationMetrics.totalFrames++; updateFpsDisplay(); if (animationMetrics.totalFrames % 60 === 0) { updateMemoryMetrics(); } }); } function stopFrameTracking() { if (rafUnsubscribe !== null) { rafUnsubscribe(); rafUnsubscribe = null; } frameTrackingActive = false; rafFrameStart = null; } if (ENABLE_TICK_LOGGING) { startFrameTracking(); } function resetAnimationMetrics() { animationMetrics = { fps: 0, avgFps: 0, minFps: Infinity, maxFps: 0, frameTime: 0, avgFrameTime: 0, minFrameTime: Infinity, maxFrameTime: 0, droppedFrames: 0, frameBudgetCompliance: 100, smoothnessScore: 100, memoryUsed: null, memoryTotal: null, totalFrames: 0, longFrames: 0 }; frameTimeHistory.length = 0; updateMemoryMetrics(); } function displayAnimationMetrics() { if (!ENABLE_TICK_LOGGING) return; const m = animationMetrics; const fpsColor = getScoreColor(m.avgFps, { good: 55, poor: 30 }); const fpsRating = getRating(m.avgFps, { good: 55, poor: 30 }); console.log(`%cFPS%c ${m.avgFps} (${m.fps} current, ${m.minFps}-${m.maxFps} range) %c(${fpsRating})`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${fpsColor}; font-weight: bold; font-size: 0.85em;`, `color: ${fpsColor}; font-size: 0.85em;`); const frameTimeColor = getScoreColor(m.avgFrameTime, { good: 20, poor: 33.33 }); const frameTimeRating = getRating(m.avgFrameTime, { good: 20, poor: 33.33 }); console.log(`%cFrame Time%c ${m.avgFrameTime.toFixed(2)}ms (${m.minFrameTime.toFixed(2)}-${m.maxFrameTime.toFixed(2)}ms) %c(${frameTimeRating})`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${frameTimeColor}; font-weight: bold; font-size: 0.85em;`, `color: ${frameTimeColor}; font-size: 0.85em;`); const droppedFramesPercent = m.totalFrames > 0 ? m.droppedFrames / m.totalFrames * 100 : 0; const droppedColor = getScoreColor(droppedFramesPercent, { good: 5, poor: 20 }); const droppedRating = getRating(droppedFramesPercent, { good: 5, poor: 20 }); console.log(`%cDropped Frames%c ${m.droppedFrames} (${droppedFramesPercent.toFixed(1)}%) %c(${droppedRating})`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${droppedColor}; font-weight: bold; font-size: 0.85em;`, `color: ${droppedColor}; font-size: 0.85em;`); const complianceColor = getScoreColor(100 - m.frameBudgetCompliance, { good: 5, poor: 20 }); const complianceRating = getRating(100 - m.frameBudgetCompliance, { good: 5, poor: 20 }); console.log(`%cBudget Compliance%c ${m.frameBudgetCompliance.toFixed(1)}% %c(${complianceRating})`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${complianceColor}; font-weight: bold; font-size: 0.85em;`, `color: ${complianceColor}; font-size: 0.85em;`); const smoothnessColor = getScoreColor(100 - m.smoothnessScore, { good: 10, poor: 30 }); const smoothnessRating = getRating(100 - m.smoothnessScore, { good: 10, poor: 30 }); console.log(`%cSmoothness%c ${m.smoothnessScore.toFixed(1)}/100 %c(${smoothnessRating})`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${smoothnessColor}; font-weight: bold; font-size: 0.85em;`, `color: ${smoothnessColor}; font-size: 0.85em;`); if (m.longFrames > 0) { const longFramesPercent = m.totalFrames > 0 ? m.longFrames / m.totalFrames * 100 : 0; const longFramesColor = getScoreColor(longFramesPercent, { good: 1, poor: 5 }); const longFramesRating = getRating(longFramesPercent, { good: 1, poor: 5 }); console.log(`%cLong Frames%c ${m.longFrames} (${longFramesPercent.toFixed(1)}%, >${LONG_FRAME_THRESHOLD}ms) %c(${longFramesRating})`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${longFramesColor}; font-weight: bold; font-size: 0.85em;`, `color: ${longFramesColor}; font-size: 0.85em;`); } if (m.memoryUsed !== null && m.memoryTotal !== null) { const memoryPercent = m.memoryUsed / m.memoryTotal * 100; const memoryColor = getScoreColor(memoryPercent, { good: 50, poor: 80 }); console.log(`%cMemory%c ${m.memoryUsed.toFixed(1)}MB / ${m.memoryTotal.toFixed(1)}MB (${memoryPercent.toFixed(1)}%)`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${memoryColor}; font-weight: bold; font-size: 0.85em;`); } console.log(`%cTotal Frames Tracked%c ${m.totalFrames}`, "background: #8b5cf6; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", "color: #6b7280; font-size: 0.85em;"); } function displayWebVitals() { if (!ENABLE_TICK_LOGGING) return; const fcp = webVitals.fcp; const lcp = webVitals.lcp; const fid = webVitals.fid; const cls = webVitals.cls; const tbt = webVitals.tbt; if (fcp !== null) { const fcpColor = getScoreColor(fcp, { good: 1800, poor: 3000 }); const fcpRating = getRating(fcp, { good: 1800, poor: 3000 }); console.log(`%cFCP%c ${fcp.toFixed(0)}ms %c(${fcpRating})`, "background: #6366f1; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${fcpColor}; font-weight: bold; font-size: 0.85em;`, `color: ${fcpColor}; font-size: 0.85em;`); } if (lcp !== null) { const lcpColor = getScoreColor(lcp, { good: 2500, poor: 4000 }); const lcpRating = getRating(lcp, { good: 2500, poor: 4000 }); console.log(`%cLCP%c ${lcp.toFixed(0)}ms %c(${lcpRating})`, "background: #6366f1; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${lcpColor}; font-weight: bold; font-size: 0.85em;`, `color: ${lcpColor}; font-size: 0.85em;`); } if (fid !== null) { const fidColor = getScoreColor(fid, { good: 100, poor: 300 }); const fidRating = getRating(fid, { good: 100, poor: 300 }); console.log(`%cFID%c ${fid.toFixed(2)}ms %c(${fidRating})`, "background: #6366f1; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${fidColor}; font-weight: bold; font-size: 0.85em;`, `color: ${fidColor}; font-size: 0.85em;`); } const clsColor = getScoreColor(cls, { good: 0.1, poor: 0.25 }); const clsRating = getRating(cls, { good: 0.1, poor: 0.25 }); console.log(`%cCLS%c ${cls.toFixed(3)} %c(${clsRating})`, "background: #6366f1; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${clsColor}; font-weight: bold; font-size: 0.85em;`, `color: ${clsColor}; font-size: 0.85em;`); if (tbt > 0) { const tbtColor = getScoreColor(tbt, { good: 200, poor: 600 }); const tbtRating = getRating(tbt, { good: 200, poor: 600 }); console.log(`%cTBT%c ${tbt.toFixed(0)}ms %c(${tbtRating})`, "background: #6366f1; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold; font-size: 0.85em;", `color: ${tbtColor}; font-weight: bold; font-size: 0.85em;`, `color: ${tbtColor}; font-size: 0.85em;`); } } var tick = { getJsLoadDelay() { return jsLoadDelay; }, getTimeSincePageLoad() { return performance.timeOrigin + performance.now() - pageLoadTime; }, getWebVitals() { return { ...webVitals }; }, showWebVitals() { displayWebVitals(); }, getAnimationMetrics() { return { ...animationMetrics }; }, showAnimationMetrics() { displayAnimationMetrics(); }, resetAnimationMetrics() { resetAnimationMetrics(); }, startFrameTracking() { startFrameTracking(); }, stopFrameTracking() { stopFrameTracking(); }, enableFrameDropDetection(enabled = true) { frameDropDetectionEnabled = enabled; if (enabled && !frameTrackingActive) { startFrameTracking(); } }, disableFrameDropDetection() { frameDropDetectionEnabled = false; }, enableFunctionInstrumentation(enabled = true) { functionInstrumentationEnabled = enabled; }, disableFunctionInstrumentation() { functionInstrumentationEnabled = false; }, instrumentFunction(fn, name) { return instrumentFunction(fn, name); }, instrumentObjectMethods(obj, prefix = "") { instrumentObjectMethods(obj, prefix); }, getFrameDropHistory() { return [...frameDropHistory]; }, getInstrumentedFunctionStats() { return Array.from(instrumentedFunctions.entries()).map(([name, stats]) => ({ name, callCount: stats.callCount, avgTime: stats.totalTime / Math.max(stats.callCount, 1), maxTime: stats.maxTime, minTime: stats.minTime === Infinity ? 0 : stats.minTime, totalTime: stats.totalTime })); }, clearFrameDropHistory() { frameDropHistory.length = 0; }, clearInstrumentedFunctionStats() { instrumentedFunctions.clear(); }, toggleFpsDisplay() { toggleFpsDisplay(); }, showFpsDisplay() { if (!fpsDisplayVisible) { toggleFpsDisplay(); } }, hideFpsDisplay() { if (fpsDisplayVisible) { toggleFpsDisplay(); } }, restoreFpsDisplay() { restoreFpsDisplay(); }, cleanupFpsDisplay() { cleanupFpsDisplay(); }, add(eventName, showVitals = false) { if (!ENABLE_TICK_LOGGING) return; const now = performance.now(); const timeSinceStart = ((now - startTime) / 1000).toFixed(2); const timeSincePrevious = ((now - previousTime) / 1000).toFixed(2); if (isFirstCall) { const jsLoadDelaySeconds = (jsLoadDelay / 1000).toFixed(2); const timingLines = []; timingLines.push(`js → ${jsLoadDelaySeconds}s`); if (scriptLoadTime !== null && scriptLoadTime > 0) { const scriptLoadSeconds = (scriptLoadTime / 1000).toFixed(2); timingLines.push(`eval → ${scriptLoadSeconds}s`); } if (domReadyTime !== null) { const domReadySeconds = ((domReadyTime - startTime) / 1000).toFixed(2); timingLines.push(`DOM → ${domReadySeconds}s`); } if (firstRenderTime !== null) { const renderSeconds = (firstRenderTime / 1000).toFixed(2); timingLines.push(`render → ${renderSeconds}s`); } else if (webVitals.fcp !== null) { const fcpSeconds = (webVitals.fcp / 1000).toFixed(2); timingLines.push(`render → ${fcpSeconds}s`); } console.log(`%c⏱%c${eventName}%c→ ${timeSinceStart}s%c ${timingLines.join(` `)}`, "background: #6366f1; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold;", "background: #374151; color: #e5e7eb; padding: 2px 6px; border-radius: 3px; font-weight: 500;", "color: #10b981; font-weight: bold;", "color: #9ca3af; font-size: 0.85em; font-style: italic;"); if (showVitals) { setTimeout(() => { displayWebVitals(); }, 1000); } isFirstCall = false; } else { console.log(`%c⏱%c${eventName}%c→ ${timeSinceStart}s%c (Δ ${timeSincePrevious}s)`, "background: #6366f1; color: white; padding: 2px 6px; border-radius: 3px; font-weight: bold;", "background: #374151; color: #e5e7eb; padding: 2px 6px; border-radius: 3px; font-weight: 500;", "color: #10b981; font-weight: bold;", "color: #6b7280; font-size: 0.9em;"); if (showVitals) { displayWebVitals(); } } previousTime = now; }, cleanup() { lcpObserver?.disconnect(); clsObserver?.disconnect(); fidObserver?.disconnect(); longTaskObserver?.disconnect(); cleanupFpsDisplay(); document.removeEventListener("DOMContentLoaded", handleDOMContentLoaded); window.removeEventListener("keydown", handleFpsToggleKeydown); } }; if (ENABLE_TICK_LOGGING) { tick.add("start", true); } // src/lib/runHubspotEmbeds.ts function runEmbedScripts(container) { const embeds = container.querySelectorAll(".w-embed"); let cleanup = Array.from(embeds, (embed) => { embed.querySelectorAll("script").forEach((original) => { const fresh = document.createElement("script"); [...original.attributes].forEach((attr) => { fresh.setAttribute(attr.name, attr.value); }); fresh.textContent = original.textContent; original.parentNode.replaceChild(fresh, original); }); const observer = new MutationObserver(() => Scroll.resize()); observer.observe(embed, { childList: true, subtree: true, attributes: true }); return () => observer.disconnect(); }); return function cleanupAll() { cleanup.forEach((e) => { e(); }); }; } // src/lib/pages.ts history.scrollRestoration = "manual"; var PAGES_CONFIG = { links: "a:not([target]):not([href^=\\#]):not([data-taxi-ignore]):not(.w-pagination-wrapper *)", removeOldContent: false, allowInterruption: false, bypassCache: false, enablePrefetch: true }; var PRIORITY_PAGES = [ "/contact", "/solutions", "/blog", "/architecture", "/clay-services", "/gong-services" ]; var embedCleanup = null; var anchorCleanup = null; function setupAnchorLinks() { const links = document.querySelectorAll('a[href^="#"]'); const controllers = []; links.forEach((link) => { const id = link.getAttribute("href").slice(1); if (!id) return; link.removeAttribute("href"); link.setAttribute("data-taxi-ignore", ""); link.dataset.anchor = id; link.style.cursor = "pointer"; const controller = new AbortController; controllers.push(controller); link.addEventListener("click", () => { const target = document.getElementById(id); if (!target) return; Scroll.scrollToAnchor(target); }, { signal: controller.signal }); }); return () => { controllers.forEach((c) => c.abort()); document.querySelectorAll("[data-anchor]").forEach((link) => { link.setAttribute("href", `#${link.dataset.anchor}`); link.removeAttribute("data-taxi-ignore"); delete link.dataset.anchor; link.style.cursor = ""; }); }; } function resetPage(container) { window.scrollTo(0, 0); gsap_default.set(container, { clearProps: "position,top,left,width,height,overflowY,zIndex,xPercent" }); Scroll.toTop(); Scroll.resize(); Scroll.start(); } function getOverlay() { let wrap3 = document.querySelector("[data-transition-wrap]"); let dark = document.querySelector("[data-transition-dark]"); if (!wrap3) { wrap3 = document.createElement("div"); wrap3.setAttribute("data-transition-wrap", ""); Object.assign(wrap3.style, { position: "fixed", inset: "0", pointerEvents: "none", zIndex: "2" }); document.body.appendChild(wrap3); } if (!dark) { dark = document.createElement("div"); dark.setAttribute("data-transition-dark", ""); Object.assign(dark.style, { position: "absolute", inset: "0", background: "#000" }); wrap3.appendChild(dark); } gsap_default.set(dark, { autoAlpha: 0 }); return { wrap: wrap3, dark }; } function runInitial() { createCycles(); runMount(); highlightAnimation(); navigationAnimation().delay(0.8); setNavActiveState(); runPageIn(); anchorCleanup = setupAnchorLinks(); tick.restoreFpsDisplay(); PRIORITY_PAGES.forEach((url) => Pages.preload(url)); } class _Pages extends Core { leavingEl = null; constructor() { super({ ...PAGES_CONFIG, transitions: { default: Transition2 } }); } async transitionOut({ from, trigger: trigger2 }) { tick.cleanupFpsDisplay(); const openMenuBtn = document.querySelector(".w-nav-button.w--open"); if (openMenuBtn) openMenuBtn.click(); anchorCleanup?.(); anchorCleanup = null; Scroll.stop(); await runPageOut(); ScrollTrigger3.getAll().forEach((t) => t.kill()); this.leavingEl = from || null; runDestroy(); Scroll.toTop(); embedCleanup?.(); from?.querySelectorAll('.w-embed iframe[id^="hs-form"]').forEach((el) => el.remove()); if (reduced) { gsap_default.set(from, { autoAlpha: 0 }); this.leavingEl?.remove(); this.leavingEl = null; } } async transitionIn({ to, trigger: trigger2 }) { createCycles(); Scroll.resize(); Resize.force(); tick.restoreFpsDisplay(); const leaving = this.leavingEl; this.leavingEl = null; if (reduced) { gsap_default.set(to, { autoAlpha: 1 }); resetPage(to); await new Promise((resolve) => requestAnimationFrame(resolve)); ScrollTrigger3.refresh(); embedCleanup = runEmbedScripts(to); runMount(); highlightAnimation(); setNavActiveState(); window.FinsweetAttributes?.modules?.list?.restart(); await runPageIn(); anchorCleanup = setupAnchorLinks(); return; } const { wrap: wrap3, dark } = getOverlay(); wrap3.style.display = ""; const contentWidth = document.documentElement.clientWidth; document.documentElement.style.overflow = "hidden"; gsap_default.set(to, { position: "fixed", top: 0, left: 0, width: contentWidth, height: "100dvh", overflowY: "auto", xPercent: 100, zIndex: 3 }); runMount(); highlightAnimation(); setNavActiveState(); window.FinsweetAttributes?.modules?.list?.restart(); const tl = gsap_default.timeline(); const tlDur = 1.2; if (leaving) { tl.to(leaving, { xPercent: -25, duration: tlDur, ease: "parallax", scale: 0.98 }, 0); tl.to(dark, { autoAlpha: 0.6, duration: tlDur, ease: "parallax" }, 0); } tl.to(to, { xPercent: 0, duration: tlDur, ease: "parallax" }, 0); await tl; leaving?.remove(); gsap_default.set(dark, { autoAlpha: 0 }); wrap3.style.display = "none"; document.documentElement.style.overflow = ""; resetPage(to); await new Promise((resolve) => requestAnimationFrame(resolve)); ScrollTrigger3.refresh(); embedCleanup = runEmbedScripts(to); await runPageIn(); anchorCleanup = setupAnchorLinks(); } } var Pages = new _Pages; // src/utils/cls-resize.ts var timeout = null; var DEBOUNCE_MS = 200; if ("PerformanceObserver" in window) { try { const observer = new PerformanceObserver((list) => { for (const entry of list.getEntries()) { if (entry.hadRecentInput) continue; if (timeout) clearTimeout(timeout); timeout = setTimeout(() => { Scroll.resize(); timeout = null; }, DEBOUNCE_MS); } }); observer.observe({ entryTypes: ["layout-shift"] }); } catch { } } // src/lib/hubspot-submit.ts function listenForHubspotSubmit() { window.addEventListener("message", (event) => { if (event.data?.type === "hsFormCallback" && event.data?.eventName === "onFormSubmitted") { console.log("submitted form"); Scroll.toTop(); } }); } // src/app.ts class _App { scroll = Scroll; pages = Pages; constructor() { if (isStaging) { console.log("Runnig in development environment"); } listenForHubspotSubmit(); runInitial(); } } var App = new _App; })(); //# debugId=A2F8A8456B6905C064756E2164756E21