UNPKG

motion-plus-vue

Version:

Motion Plus Vue

27 lines (26 loc) 634 B
import { wrap as u } from "motion-v"; import { findCurrentIndexFromInset as g } from "./find-current-index.mjs"; function m(e, t, n, r) { var o; if (t.length === 0) return 0; const d = t[t.length - 1].end + n, h = r ?? e + (((o = t[0]) == null ? void 0 : o.end) ?? 0); let a = g( e, t, d ) + 1, l = 0, f = !1; for (; !f; ) { const { start: s, end: x } = t[u(0, t.length, a)], c = Math.floor(a / t.length) * d; l = s + c, x + c > h ? f = !0 : a++; } return l; } function S(e, t, n, r) { const I = e + t; return m(e, n, r, I); } export { m as findNextItemInset, S as findNextPageInset };