"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useStoreConsole = void 0;
var _roomStore = require("../roomStore");
/**
 * Return the current redux state. Mirrors web `useStoreConsole`.
 * Attach to `globalThis.useStoreConsole` only when
 * `config.useStoreConsoleEnabled === true`; clean up otherwise.
 */
const useStoreConsole = () => _roomStore.store.getState();
exports.useStoreConsole = useStoreConsole;
const g = globalThis;
const refresh = () => {
  try {
    const config = _roomStore.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();
_roomStore.store.subscribe(refresh);
//# sourceMappingURL=storeConsole.js.map