import { jsx as r } from "react/jsx-runtime";
import { useMemo as p } from "react";
import { DocumentProvider as P } from "../contexts/RPDocumentContext.js";
import { DocumentPasswordProvider as a } from "../contexts/DocumentPasswordContext.js";
import { RPController as f } from "./RPController.js";
import { LoaderProvider as s } from "../contexts/LoaderContext.js";
import { ToolComponentProvider as h } from "../contexts/ToolComponentContext.js";
import { IconToolProvider as v } from "../contexts/IconToolContext.js";
import { OtherToolProvider as u } from "../contexts/OtherToolContext.js";
const M = (t) => {
  const { children: i, src: o, characterMap: m, onLoaded: n, onLoadError: d, loaderImage: c, ...l } = t, e = p(() => typeof o == "string" ? o : `${Date.now()}`, [o]);
  return /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(
    P,
    {
      src: o,
      characterMap: m,
      onLoaded: n,
      onLoadError: d,
      children: /* @__PURE__ */ r(f, { ...l, children: /* @__PURE__ */ r(s, { loaderImage: c, children: /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r(u, { children: i }) }) }) }, e) }, e)
    },
    e
  ) });
};
export {
  M as RPProvider
};
