import { useLottie as b } from "./index-use-lottie.js";
import { useLottieInteractivity as A } from "./index-use-lottie-interactivity.js";
import { useEffect as D } from "react";
const j = (e) => {
  var i;
  const {
    style: s,
    interactivity: t,
    ...a
  } = e, {
    View: r,
    play: m,
    stop: f,
    pause: l,
    setSpeed: u,
    goToAndStop: c,
    goToAndPlay: d,
    setDirection: p,
    playSegments: g,
    setSubframe: L,
    getDuration: R,
    destroy: S,
    animationContainerRef: o,
    animationLoaded: y,
    animationItem: n
  } = b(a, s);
  return D(() => {
    e.lottieRef && (e.lottieRef.current = {
      play: m,
      stop: f,
      pause: l,
      setSpeed: u,
      goToAndPlay: d,
      goToAndStop: c,
      setDirection: p,
      playSegments: g,
      setSubframe: L,
      getDuration: R,
      destroy: S,
      animationContainerRef: o,
      animationLoaded: y,
      animationItem: n
    });
  }, [(i = e.lottieRef) == null ? void 0 : i.current]), A({
    lottieObj: {
      View: r,
      animationContainerRef: o,
      animationItem: n
    },
    actions: (t == null ? void 0 : t.actions) ?? [],
    mode: (t == null ? void 0 : t.mode) ?? "scroll"
  });
};
export {
  j as LottieBase
};
