"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// 是 iframe 环境
const hot_1 = require("../shared/hot");
const get_from_main_1 = require("./utils/get-from-main");
const { iframeWindowsSubject, selectedNodeSubject, overingNodeSubject } = (0, get_from_main_1.getSharedFromMain)();
// const handleChanged = (v) => {
//   if (!document.body) {
//     return
//   }
//   const bodyCls = css`
//     padding: 30px 10px;
//   `
//   if (v?.canSelect) {
//     document.body.classList.add(bodyCls)
//   } else {
//     document.body.classList.remove(bodyCls)
//   }
// }
// headerStatusSubject.subscribe(handleChanged)
// handleChanged(headerStatusSubject.value)
selectedNodeSubject.next(null);
overingNodeSubject.next(null);
(0, hot_1.addUpdateCallbackListener)((moduleExports, moduleId, webpackHot, refreshOverlay, isTest) => {
    // Update selectedNodeSubject for render
    const prev = selectedNodeSubject.value;
    selectedNodeSubject.next(null);
    if (prev === null || prev === void 0 ? void 0 : prev.parentNode) {
        selectedNodeSubject.next(prev);
    }
});
setTimeout(() => {
    iframeWindowsSubject.next(iframeWindowsSubject.value.concat([window]));
});
// const rawRender = require('$mometa-external:react-dom').render
// // @ts-ignore
// require('$mometa-external:react-dom').render = function _render(...argv) {
//   const [elem, dom, cb] = argv
//   return rawRender.apply(this, [
//     elem,
//     dom,
//     function () {
//       return cb?.apply(this, arguments)
//     }
//   ])
// }
//# sourceMappingURL=render-register.js.map