"use strict";

import { store } from '../roomStore';

/**
 * Return the current redux state. Mirrors web `useStoreConsole`.
 * Attach to `globalThis.useStoreConsole` only when
 * `config.useStoreConsoleEnabled === true`; clean up otherwise.
 */
export const useStoreConsole = () => store.getState();
const g = globalThis;
const refresh = () => {
  try {
    const config = store.getState().chatSettingStore?.config;
    if (config?.useStoreConsoleEnabled === true) {
      g.useStoreConsole = useStoreConsole;
    } else if (g.useStoreConsole) {
      delete g.useStoreConsole;
    }
  } catch {
    // ignore — state may not be ready yet
  }
};
refresh();
store.subscribe(refresh);
//# sourceMappingURL=storeConsole.js.map