import { followCursor } from "@assets/js/base/tippy"; export default function tippyModifiers(modifiers) { if (modifiers.length === 0) return {}; const config = { plugins: [], }; const getModifierArgument = (modifier) => { return modifiers[modifiers.indexOf(modifier) + 1]; }; if (modifiers.includes("duration")) { config.duration = parseInt(getModifierArgument("duration")); } if (modifiers.includes("delay")) { const delay = getModifierArgument("delay"); config.delay = delay.includes("-") ? delay.split("-").map((n) => parseInt(n)) : parseInt(delay); } if (modifiers.includes("debounce") && config.interactive) { config.interactiveDebounce = parseInt(getModifierArgument("debounce")); } if (modifiers.includes("theme")) { config.theme = getModifierArgument("theme"); } if (modifiers.includes("placement")) { config.placement = getModifierArgument("placement"); } return config; }