import o from "../../../@babel/runtime/helpers/esm/slicedToArray.mjs";
import { useState as A, useRef as L, useEffect as l } from "react";
import S from "./useValueTexts.mjs";
function _(s, t) {
  var f = t.formatList, m = t.generateConfig, c = t.locale, g = A(null), r = o(g, 2), d = r[0], a = r[1], n = L(null);
  function u(e) {
    var p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
    if (cancelAnimationFrame(n.current), p) {
      a(e);
      return;
    }
    n.current = requestAnimationFrame(function() {
      a(e);
    });
  }
  var v = S(d, {
    formatList: f,
    generateConfig: m,
    locale: c
  }), V = o(v, 2), x = V[1];
  function T(e) {
    u(e);
  }
  function i() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
    u(null, e);
  }
  return l(function() {
    i(!0);
  }, [s]), l(function() {
    return function() {
      return cancelAnimationFrame(n.current);
    };
  }, []), [x, T, i];
}
export {
  _ as default
};
