function xt(c, n) {
  for (var i = 0; i < n.length; i++) {
    var t = n[i];
    t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(c, t.key, t);
  }
}
function mt(c, n, i) {
  return n && xt(c.prototype, n), c;
}
/*!
 * Observer 3.13.0
 * 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 h, le, v, E, X, I, st, L, Z, ut, T, b, gt, ft = function() {
  return h || typeof window != "undefined" && (h = window.gsap) && h.registerPlugin && h;
}, dt = 1, V = [], m = [], J = [], K = Date.now, we = function(n, i) {
  return i;
}, bt = function() {
  var n = Z.core, i = n.bridge || {}, t = n._scrollers, l = n._proxies;
  t.push.apply(t, m), l.push.apply(l, J), m = t, J = l, we = function(g, r) {
    return i[g](r);
  };
}, Dt = function(n, i) {
  return ~J.indexOf(n) && J[J.indexOf(n) + 1][i];
}, Q = function(n) {
  return !!~ut.indexOf(n);
}, _ = function(n, i, t, l, u) {
  return n.addEventListener(i, t, {
    passive: l !== !1,
    capture: !!u
  });
}, p = function(n, i, t, l) {
  return n.removeEventListener(i, t, !!l);
}, ae = "scrollLeft", ce = "scrollTop", Te = function() {
  return T && T.isPressed || m.cache++;
}, se = function(n, i) {
  var t = function l(u) {
    if (u || u === 0) {
      dt && (v.history.scrollRestoration = "manual");
      var g = T && T.isPressed;
      u = l.v = Math.round(u) || (T && T.iOS ? 1 : 0), n(u), l.cacheID = m.cache, g && we("ss", u);
    } else (i || m.cache !== l.cacheID || we("ref")) && (l.cacheID = m.cache, l.v = n());
    return l.v + l.offset;
  };
  return t.offset = 0, n && t;
}, ue = {
  s: ae,
  p: "left",
  p2: "Left",
  os: "right",
  os2: "Right",
  d: "width",
  d2: "Width",
  a: "x",
  sc: se(function(c) {
    return arguments.length ? v.scrollTo(c, ge.sc()) : v.pageXOffset || E[ae] || X[ae] || I[ae] || 0;
  })
}, ge = {
  s: ce,
  p: "top",
  p2: "Top",
  os: "bottom",
  os2: "Bottom",
  d: "height",
  d2: "Height",
  a: "y",
  op: ue,
  sc: se(function(c) {
    return arguments.length ? v.scrollTo(ue.sc(), c) : v.pageYOffset || E[ce] || X[ce] || I[ce] || 0;
  })
}, wt = function(n, i) {
  return (i && i._ctx && i._ctx.selector || h.utils.toArray)(n)[0] || (typeof n == "string" && h.config().nullTargetWarn !== !1 ? console.warn("Element not found:", n) : null);
}, Tt = function(n, i) {
  for (var t = i.length; t--; )
    if (i[t] === n || i[t].contains(n))
      return !0;
  return !1;
}, at = function(n, i) {
  var t = i.s, l = i.sc;
  Q(n) && (n = E.scrollingElement || X);
  var u = m.indexOf(n), g = l === ge.sc ? 1 : 2;
  !~u && (u = m.push(n) - 1), m[u + g] || _(n, "scroll", Te);
  var r = m[u + g], D = r || (m[u + g] = se(Dt(n, t), !0) || (Q(n) ? l : se(function(M) {
    return arguments.length ? n[t] = M : n[t];
  })));
  return D.target = n, r || (D.smooth = h.getProperty(n, "scrollBehavior") === "smooth"), D;
}, ct = function(n, i, t) {
  var l = n, u = n, g = K(), r = g, D = i || 50, M = Math.max(500, D * 3), P = function(x, N) {
    var w = K();
    N || w - g > D ? (u = l, l = x, r = g, g = w) : t ? l += x : l = u + (x - u) / (w - r) * (g - r);
  }, S = function() {
    u = l = t ? 0 : l, r = g = 0;
  }, fe = function(x) {
    var N = r, w = u, z = K();
    return (x || x === 0) && x !== l && P(x), g === r || z - r > M ? 0 : (l + (t ? w : -w)) / ((t ? z : g) - N) * 1e3;
  };
  return {
    update: P,
    reset: S,
    getVelocity: fe
  };
}, j = function(n, i) {
  return i && !n._gsapAllow && n.preventDefault(), n.changedTouches ? n.changedTouches[0] : n;
}, lt = function(n) {
  var i = Math.max.apply(Math, n), t = Math.min.apply(Math, n);
  return Math.abs(i) >= Math.abs(t) ? i : t;
}, ht = function() {
  Z = h.core.globals().ScrollTrigger, Z && Z.core && bt();
}, pt = function(n) {
  return h = n || ft(), !le && h && typeof document != "undefined" && document.body && (v = window, E = document, X = E.documentElement, I = E.body, ut = [v, E, X, I], h.utils.clamp, gt = h.core.context || function() {
  }, L = "onpointerenter" in I ? "pointer" : "mouse", st = k.isTouch = v.matchMedia && v.matchMedia("(hover: none), (pointer: coarse)").matches ? 1 : "ontouchstart" in v || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ? 2 : 0, b = k.eventTypes = ("ontouchstart" in X ? "touchstart,touchmove,touchcancel,touchend" : "onpointerdown" in X ? "pointerdown,pointermove,pointercancel,pointerup" : "mousedown,mousemove,mouseup,mouseup").split(","), setTimeout(function() {
    return dt = 0;
  }, 500), ht(), le = 1), le;
};
ue.op = ge;
m.cache = 0;
var k = /* @__PURE__ */ (function() {
  function c(i) {
    this.init(i);
  }
  var n = c.prototype;
  return n.init = function(t) {
    le || pt(h) || console.warn("Please gsap.registerPlugin(Observer)"), Z || ht();
    var l = t.tolerance, u = t.dragMinimum, g = t.type, r = t.target, D = t.lineHeight, M = t.debounce, P = t.preventDefault, S = t.onStop, fe = t.onStopDelay, Y = t.ignore, x = t.wheelSpeed, N = t.event, w = t.onDragStart, z = t.onDragEnd, ke = t.onDrag, Me = t.onPress, Pe = t.onRelease, Se = t.onRight, Ye = t.onLeft, Ce = t.onUp, Ee = t.onDown, Xe = t.onChangeX, Oe = t.onChangeY, Ge = t.onChange, Ae = t.onToggleX, Fe = t.onToggleY, He = t.onHover, Le = t.onHoverEnd, de = t.onMove, Re = t.ignoreCheck, R = t.isNormalizer, We = t.onGestureStart, Ve = t.onGestureEnd, Ie = t.onWheel, Ne = t.onEnable, ze = t.onDisable, Be = t.onClick, $ = t.scrollSpeed, W = t.capture, qe = t.allowClicks, _t = t.lockAxis, Ue = t.onLockAxis;
    this.target = r = wt(r) || X, this.vars = t, Y && (Y = h.utils.toArray(Y)), l = l || 1e-9, u = u || 0, x = x || 1, $ = $ || 1, g = g || "wheel,touch,pointer", M = M !== !1, D || (D = parseFloat(v.getComputedStyle(I).lineHeight) || 22);
    var B, O, G, ee, he, pe, q, e = this, _e = 0, ye = 0, te = t.passive || !P && t.passive !== !1, ne = at(r, ue), oe = at(r, ge), ve = ne(), xe = oe(), yt = ~g.indexOf("touch") && !~g.indexOf("pointer") && b[0] === "pointerdown", re = Q(r), d = r.ownerDocument || E, A = [0, 0, 0], F = [0, 0, 0], je = 0, Ze = function() {
      return je = K();
    }, H = function(o, s) {
      return (e.event = o) && Y && Tt(o.target, Y) || s && yt && o.pointerType !== "touch" || Re && Re(o, s);
    }, vt = function() {
      e._vx.reset(), e._vy.reset(), O.pause(), S && S(e);
    }, U = function() {
      var o = e.deltaX = lt(A), s = e.deltaY = lt(F), f = Math.abs(o) >= l, y = Math.abs(s) >= l;
      Ge && (f || y) && Ge(e, o, s, A, F), f && (Se && e.deltaX > 0 && Se(e), Ye && e.deltaX < 0 && Ye(e), Xe && Xe(e), Ae && e.deltaX < 0 != _e < 0 && Ae(e), _e = e.deltaX, A[0] = A[1] = A[2] = 0), y && (Ee && e.deltaY > 0 && Ee(e), Ce && e.deltaY < 0 && Ce(e), Oe && Oe(e), Fe && e.deltaY < 0 != ye < 0 && Fe(e), ye = e.deltaY, F[0] = F[1] = F[2] = 0), (ee || G) && (de && de(e), G && (w && G === 1 && w(e), ke && ke(e), G = 0), ee = !1), pe && !(pe = !1) && Ue && Ue(e), he && (Ie(e), he = !1), B = 0;
    }, Je = function(o, s, f) {
      A[f] += o, F[f] += s, e._vx.update(o), e._vy.update(s), M ? B || (B = requestAnimationFrame(U)) : U();
    }, Ke = function(o, s) {
      _t && !q && (e.axis = q = Math.abs(o) > Math.abs(s) ? "x" : "y", pe = !0), q !== "y" && (A[2] += o, e._vx.update(o, !0)), q !== "x" && (F[2] += s, e._vy.update(s, !0)), M ? B || (B = requestAnimationFrame(U)) : U();
    }, me = function(o) {
      if (!H(o, 1)) {
        o = j(o, P);
        var s = o.clientX, f = o.clientY, y = s - e.x, C = f - e.y, De = e.isDragging;
        e.x = s, e.y = f, (De || (y || C) && (Math.abs(e.startX - s) >= u || Math.abs(e.startY - f) >= u)) && (G = De ? 2 : 1, De || (e.isDragging = !0), Ke(y, C));
      }
    }, be = e.onPress = function(a) {
      H(a, 1) || a && a.button || (e.axis = q = null, O.pause(), e.isPressed = !0, a = j(a), _e = ye = 0, e.startX = e.x = a.clientX, e.startY = e.y = a.clientY, e._vx.reset(), e._vy.reset(), _(R ? r : d, b[1], me, te, !0), e.deltaX = e.deltaY = 0, Me && Me(e));
    }, ie = e.onRelease = function(a) {
      if (!H(a, 1)) {
        p(R ? r : d, b[1], me, !0);
        var o = !isNaN(e.y - e.startY), s = e.isDragging, f = s && (Math.abs(e.x - e.startX) > 3 || Math.abs(e.y - e.startY) > 3), y = j(a);
        !f && o && (e._vx.reset(), e._vy.reset(), P && qe && h.delayedCall(0.08, function() {
          if (K() - je > 300 && !a.defaultPrevented) {
            if (a.target.click)
              a.target.click();
            else if (d.createEvent) {
              var C = d.createEvent("MouseEvents");
              C.initMouseEvent("click", !0, !0, v, 1, y.screenX, y.screenY, y.clientX, y.clientY, !1, !1, !1, !1, 0, null), a.target.dispatchEvent(C);
            }
          }
        })), e.isDragging = e.isGesturing = e.isPressed = !1, S && s && !R && O.restart(!0), G && U(), z && s && z(e), Pe && Pe(e, f);
      }
    }, Qe = function(o) {
      return o.touches && o.touches.length > 1 && (e.isGesturing = !0) && We(o, e.isDragging);
    }, $e = function() {
      return (e.isGesturing = !1) || Ve(e);
    }, et = function(o) {
      if (!H(o)) {
        var s = ne(), f = oe();
        Je((s - ve) * $, (f - xe) * $, 1), ve = s, xe = f, S && O.restart(!0);
      }
    }, tt = function(o) {
      if (!H(o)) {
        o = j(o, P), Ie && (he = !0);
        var s = (o.deltaMode === 1 ? D : o.deltaMode === 2 ? v.innerHeight : 1) * x;
        Je(o.deltaX * s, o.deltaY * s, 0), S && !R && O.restart(!0);
      }
    }, nt = function(o) {
      if (!H(o)) {
        var s = o.clientX, f = o.clientY, y = s - e.x, C = f - e.y;
        e.x = s, e.y = f, ee = !0, S && O.restart(!0), (y || C) && Ke(y, C);
      }
    }, ot = function(o) {
      e.event = o, He(e);
    }, rt = function(o) {
      e.event = o, Le(e);
    }, it = function(o) {
      return H(o) || j(o, P) && Be(e);
    };
    O = e._dc = h.delayedCall(fe || 0.25, vt).pause(), e.deltaX = e.deltaY = 0, e._vx = ct(0, 50, !0), e._vy = ct(0, 50, !0), e.scrollX = ne, e.scrollY = oe, e.isDragging = e.isGesturing = e.isPressed = !1, gt(this), e.enable = function(a) {
      return e.isEnabled || (_(re ? d : r, "scroll", Te), g.indexOf("scroll") >= 0 && _(re ? d : r, "scroll", et, te, W), g.indexOf("wheel") >= 0 && _(r, "wheel", tt, te, W), (g.indexOf("touch") >= 0 && st || g.indexOf("pointer") >= 0) && (_(r, b[0], be, te, W), _(d, b[2], ie), _(d, b[3], ie), qe && _(r, "click", Ze, !0, !0), Be && _(r, "click", it), We && _(d, "gesturestart", Qe), Ve && _(d, "gestureend", $e), He && _(r, L + "enter", ot), Le && _(r, L + "leave", rt), de && _(r, L + "move", nt)), e.isEnabled = !0, e.isDragging = e.isGesturing = e.isPressed = ee = G = !1, e._vx.reset(), e._vy.reset(), ve = ne(), xe = oe(), a && a.type && be(a), Ne && Ne(e)), e;
    }, e.disable = function() {
      e.isEnabled && (V.filter(function(a) {
        return a !== e && Q(a.target);
      }).length || p(re ? d : r, "scroll", Te), e.isPressed && (e._vx.reset(), e._vy.reset(), p(R ? r : d, b[1], me, !0)), p(re ? d : r, "scroll", et, W), p(r, "wheel", tt, W), p(r, b[0], be, W), p(d, b[2], ie), p(d, b[3], ie), p(r, "click", Ze, !0), p(r, "click", it), p(d, "gesturestart", Qe), p(d, "gestureend", $e), p(r, L + "enter", ot), p(r, L + "leave", rt), p(r, L + "move", nt), e.isEnabled = e.isPressed = e.isDragging = !1, ze && ze(e));
    }, e.kill = e.revert = function() {
      e.disable();
      var a = V.indexOf(e);
      a >= 0 && V.splice(a, 1), T === e && (T = 0);
    }, V.push(e), R && Q(r) && (T = e), e.enable(N);
  }, mt(c, [{
    key: "velocityX",
    get: function() {
      return this._vx.getVelocity();
    }
  }, {
    key: "velocityY",
    get: function() {
      return this._vy.getVelocity();
    }
  }]), c;
})();
k.version = "3.13.0";
k.create = function(c) {
  return new k(c);
};
k.register = pt;
k.getAll = function() {
  return V.slice();
};
k.getById = function(c) {
  return V.filter(function(n) {
    return n.vars.id === c;
  })[0];
};
ft() && h.registerPlugin(k);
export {
  k as Observer,
  Dt as _getProxyProp,
  at as _getScrollFunc,
  wt as _getTarget,
  ct as _getVelocityProp,
  ue as _horizontal,
  Q as _isViewport,
  J as _proxies,
  m as _scrollers,
  ge as _vertical,
  k as default
};
