function F(i, m) {
  let t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), r = !1, n = !1;
  const a = /* @__PURE__ */ new WeakSet();
  let f = {
    delta: 0,
    timestamp: 0,
    isProcessing: !1
  };
  function l(e) {
    a.has(e) && (o.schedule(e), i()), e(f);
  }
  const o = {
    /**
     * Schedule a process to run on the next frame.
     */
    schedule: (e, d = !1, u = !1) => {
      const c = u && r ? t : s;
      return d && a.add(e), c.add(e), e;
    },
    /**
     * Cancel the provided callback from running on the next frame.
     */
    cancel: (e) => {
      s.delete(e), a.delete(e);
    },
    /**
     * Execute all schedule callbacks.
     */
    process: (e) => {
      if (f = e, r) {
        n = !0;
        return;
      }
      r = !0;
      const d = t;
      t = s, s = d, t.forEach(l), t.clear(), r = !1, n && (n = !1, o.process(e));
    }
  };
  return o;
}
export {
  F as createRenderStep
};
//# sourceMappingURL=render-step.es.js.map
