"use strict";
/* eslint-disable no-nested-ternary */
/* eslint-disable no-return-assign */
/* eslint-disable sort-exports/sort-exports */
Object.defineProperty(exports, "__esModule", { value: true });
exports.easeInOutBounce = exports.easeOutBounce = exports.easeInBounce = exports.easeInOutBack = exports.easeOutBack = exports.easeInBack = exports.easeInOutExpo = exports.easeOutExpo = exports.easeInExpo = exports.easeInOutQuart = exports.easeOutQuart = exports.easeInQuart = exports.easeInOutQuad = exports.easeOutQuad = exports.easeInQuad = exports.easeInOutElastic = exports.easeOutElastic = exports.easeInElastic = exports.easeInOutCirc = exports.easeOutCirc = exports.easeInCirc = exports.easeInOutQuint = exports.easeOutQuint = exports.easeInQuint = exports.easeInOutCubic = exports.easeOutCubic = exports.easeInCubic = exports.easeInOutSine = exports.easeOutSine = exports.easeInSine = void 0;
/**
 * From: https://easings.net/#easeInSine
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInSine(time) {
    return 1 - Math.cos((time * Math.PI) / 2);
}
exports.easeInSine = easeInSine;
/**
 * From: https://easings.net/#easeOutSine
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutSine(time) {
    return Math.sin((time * Math.PI) / 2);
}
exports.easeOutSine = easeOutSine;
/**
 * From: https://easings.net/#easeInOutSine
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutSine(time) {
    return -(Math.cos(Math.PI * time) - 1) / 2;
}
exports.easeInOutSine = easeInOutSine;
/**
 * From: https://easings.net/#easeInCubic
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInCubic(time) {
    return time * time * time;
}
exports.easeInCubic = easeInCubic;
/**
 * From: https://easings.net/#easeOutCubic
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutCubic(time) {
    return 1 - (1 - time) ** 3;
}
exports.easeOutCubic = easeOutCubic;
/**
 * From: https://easings.net/#easeInOutCubic
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutCubic(time) {
    return time < 0.5 ? 4 * time * time * time : 1 - (-2 * time + 2) ** 3 / 2;
}
exports.easeInOutCubic = easeInOutCubic;
/**
 * From: https://easings.net/#easeInQuint
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInQuint(time) {
    return time * time * time * time * time;
}
exports.easeInQuint = easeInQuint;
/**
 * From: https://easings.net/#easeOutQuint
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutQuint(time) {
    return 1 - (1 - time) ** 5;
}
exports.easeOutQuint = easeOutQuint;
/**
 * From: https://easings.net/#easeInOutQuint
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutQuint(time) {
    return time < 0.5
        ? 16 * time * time * time * time * time
        : 1 - (-2 * time + 2) ** 5 / 2;
}
exports.easeInOutQuint = easeInOutQuint;
/**
 * From: https://easings.net/#easeInCirc
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInCirc(time) {
    return 1 - Math.sqrt(1 - time ** 2);
}
exports.easeInCirc = easeInCirc;
/**
 * From: https://easings.net/#easeOutCirc
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutCirc(time) {
    return Math.sqrt(1 - (time - 1) ** 2);
}
exports.easeOutCirc = easeOutCirc;
/**
 * From: https://easings.net/#easeInOutCirc
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutCirc(time) {
    return time < 0.5
        ? (1 - Math.sqrt(1 - (2 * time) ** 2)) / 2
        : (Math.sqrt(1 - (-2 * time + 2) ** 2) + 1) / 2;
}
exports.easeInOutCirc = easeInOutCirc;
/**
 * From: https://easings.net/#easeInElastic
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInElastic(time) {
    const c4 = (2 * Math.PI) / 3;
    return time === 0
        ? 0
        : time === 1
            ? 1
            : -(2 ** (10 * time - 10)) * Math.sin((time * 10 - 10.75) * c4);
}
exports.easeInElastic = easeInElastic;
/**
 * From: https://easings.net/#easeOutElastic
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutElastic(time) {
    const c4 = (2 * Math.PI) / 3;
    return time === 0
        ? 0
        : time === 1
            ? 1
            : 2 ** (-10 * time) * Math.sin((time * 10 - 0.75) * c4) + 1;
}
exports.easeOutElastic = easeOutElastic;
/**
 * From: https://easings.net/#easeInOutElastic
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutElastic(time) {
    const c5 = (2 * Math.PI) / 4.5;
    return time === 0
        ? 0
        : time === 1
            ? 1
            : time < 0.5
                ? -(2 ** (20 * time - 10) * Math.sin((20 * time - 11.125) * c5)) / 2
                : (2 ** (-20 * time + 10) * Math.sin((20 * time - 11.125) * c5)) / 2 +
                    1;
}
exports.easeInOutElastic = easeInOutElastic;
/**
 * From: https://easings.net/#easeInQuad
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInQuad(time) {
    return time * time;
}
exports.easeInQuad = easeInQuad;
/**
 * From: https://easings.net/#easeOutQuad
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutQuad(time) {
    return 1 - (1 - time) * (1 - time);
}
exports.easeOutQuad = easeOutQuad;
/**
 * From: https://easings.net/#easeInOutQuad
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutQuad(time) {
    return time < 0.5 ? 2 * time * time : 1 - (-2 * time + 2) ** 2 / 2;
}
exports.easeInOutQuad = easeInOutQuad;
/**
 * From: https://easings.net/#easeInQuart
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInQuart(time) {
    return time * time * time * time;
}
exports.easeInQuart = easeInQuart;
/**
 * From: https://easings.net/#easeOutQuart
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutQuart(time) {
    return 1 - (1 - time) ** 4;
}
exports.easeOutQuart = easeOutQuart;
/**
 * From: https://easings.net/#easeInOutQuart
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutQuart(time) {
    return time < 0.5
        ? 8 * time * time * time * time
        : 1 - (-2 * time + 2) ** 4 / 2;
}
exports.easeInOutQuart = easeInOutQuart;
/**
 * From: https://easings.net/#easeInExpo
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInExpo(time) {
    return time === 0 ? 0 : 2 ** (10 * time - 10);
}
exports.easeInExpo = easeInExpo;
/**
 * From: https://easings.net/#easeOutExpo
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutExpo(time) {
    return time === 1 ? 1 : 1 - 2 ** (-10 * time);
}
exports.easeOutExpo = easeOutExpo;
/**
 * From: https://easings.net/#easeInOutExpo
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutExpo(time) {
    return time === 0
        ? 0
        : time === 1
            ? 1
            : time < 0.5
                ? 2 ** (20 * time - 10) / 2
                : (2 - 2 ** (-20 * time + 10)) / 2;
}
exports.easeInOutExpo = easeInOutExpo;
/**
 * From: https://easings.net/#easeInBack
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInBack(time) {
    const c1 = 1.701_58;
    const c3 = c1 + 1;
    return c3 * time * time * time - c1 * time * time;
}
exports.easeInBack = easeInBack;
/**
 * From: https://easings.net/#easeOutBack
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutBack(time) {
    const c1 = 1.701_58;
    const c3 = c1 + 1;
    return 1 + c3 * (time - 1) ** 3 + c1 * (time - 1) ** 2;
}
exports.easeOutBack = easeOutBack;
/**
 * From: https://easings.net/#easeInOutBack
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutBack(time) {
    const c1 = 1.701_58;
    const c2 = c1 * 1.525;
    return time < 0.5
        ? ((2 * time) ** 2 * ((c2 + 1) * 2 * time - c2)) / 2
        : ((2 * time - 2) ** 2 * ((c2 + 1) * (time * 2 - 2) + c2) + 2) / 2;
}
exports.easeInOutBack = easeInOutBack;
/**
 * From: https://easings.net/#easeInBounce
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInBounce(time) {
    return 1 - easeOutBounce(1 - time);
}
exports.easeInBounce = easeInBounce;
/**
 * From: https://easings.net/#easeInOutSine
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeOutBounce(time) {
    const n1 = 7.5625;
    const d1 = 2.75;
    if (time < 1 / d1) {
        return n1 * time * time;
    }
    if (time < 2 / d1) {
        return n1 * (time -= 1.5 / d1) * time + 0.75;
    }
    if (time < 2.5 / d1) {
        return n1 * (time -= 2.25 / d1) * time + 0.9375;
    }
    return n1 * (time -= 2.625 / d1) * time + 0.984_375;
}
exports.easeOutBounce = easeOutBounce;
/**
 * From: https://easings.net/#easeInOutBounce
 *
 * @param time A value between 0 and 1 that represents how far along you are in the transition.
 */
function easeInOutBounce(time) {
    return time < 0.5
        ? (1 - easeOutBounce(1 - 2 * time)) / 2
        : (1 + easeOutBounce(2 * time - 1)) / 2;
}
exports.easeInOutBounce = easeInOutBounce;
