"use strict";
(globalThis["webpackChunk_mometa_editor_example"] = globalThis["webpackChunk_mometa_editor_example"] || []).push([["src_module_render-floating_tsx"],{

/***/ "../src/module/render-floating.tsx":
/*!*****************************************!*\
  !*** ../src/module/render-floating.tsx ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "floatingRender": () => (/* binding */ floatingRender),
/* harmony export */   "DndLayoutManager": () => (/* binding */ DndLayoutManager)
/* harmony export */ });
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ "../../../node_modules/.pnpm/react-dom@17.0.2_react@17.0.2/node_modules/react-dom/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/index.js");
/* harmony import */ var _rcp_use_behaviorsubject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @rcp/use.behaviorsubject */ "../../../node_modules/.pnpm/@rcp+use.behaviorsubject@1.2.2_rxjs@7.5.1/node_modules/@rcp/use.behaviorsubject/dist/es/index.js");
/* harmony import */ var _mometa_runtime_dnd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../mometa/runtime/dnd */ "../src/mometa/runtime/dnd.tsx");
/* harmony import */ var _config_const__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config/const */ "../src/module/config/const.ts");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-dev-runtime */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/jsx-dev-runtime.js");
var _jsxFileName = "/Users/congyu/github/mometa/packages/editor/src/module/render-floating.tsx";







const floatingRender = container => {
  react_dom__WEBPACK_IMPORTED_MODULE_0__.render( /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(DndLayoutManager, {}, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 9,
    columnNumber: 19
  }, undefined), container);
  return () => {
    react_dom__WEBPACK_IMPORTED_MODULE_0__.unmountComponentAtNode(container);
  };
};
function DndLayoutManager() {
  const [wins] = (0,_rcp_use_behaviorsubject__WEBPACK_IMPORTED_MODULE_2__.useBehaviorSubject)(_config_const__WEBPACK_IMPORTED_MODULE_4__.iframeWindowsSubject);
  const doms = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => {
    return wins === null || wins === void 0 ? void 0 : wins.map(w => w.document.body).filter(x => x && x.parentNode);
  }, [wins]);
  return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
    children: doms === null || doms === void 0 ? void 0 : doms.map((dom, i) => /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_mometa_runtime_dnd__WEBPACK_IMPORTED_MODULE_3__.DndLayout, {
      dom: dom
    }, i, false, {
      fileName: _jsxFileName,
      lineNumber: 24,
      columnNumber: 9
    }, this))
  }, void 0, false);
}

/***/ }),

/***/ "../src/mometa/config/const.ts":
/*!*************************************!*\
  !*** ../src/mometa/config/const.ts ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "CLS_PREFIX": () => (/* binding */ CLS_PREFIX),
/* harmony export */   "OpType": () => (/* reexport safe */ _mometa_fs_handler_const__WEBPACK_IMPORTED_MODULE_0__.OpType)
/* harmony export */ });
/* harmony import */ var _mometa_fs_handler_const__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @mometa/fs-handler/const */ "../../fs-handler/src/const.ts");
const CLS_PREFIX = 'mometa-runtime';


/***/ }),

/***/ "../src/mometa/runtime/components/more-button/index.tsx":
/*!**************************************************************!*\
  !*** ../src/mometa/runtime/components/more-button/index.tsx ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var antd_lib_dropdown_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/lib/dropdown/style */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/dropdown/style/index.js");
/* harmony import */ var antd_lib_dropdown_style__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(antd_lib_dropdown_style__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd_lib_dropdown__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd/lib/dropdown */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/dropdown/index.js");
/* harmony import */ var antd_lib_button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/button/style */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/button/style/index.js");
/* harmony import */ var antd_lib_button_style__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd_lib_button_style__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var antd_lib_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd/lib/button */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/button/index.js");
/* harmony import */ var antd_lib_menu_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/lib/menu/style */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/menu/style/index.js");
/* harmony import */ var antd_lib_menu_style__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_menu_style__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd/lib/menu */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/menu/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/index.js");
/* harmony import */ var prefix_classname__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prefix-classname */ "../../../node_modules/.pnpm/prefix-classname@1.0.3/node_modules/prefix-classname/index.js");
/* harmony import */ var prefix_classname__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prefix_classname__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ant-design/icons */ "../../../node_modules/.pnpm/@ant-design+icons@4.7.0_react@17.0.2/node_modules/@ant-design/icons/es/icons/MenuOutlined.js");
/* harmony import */ var _config_const__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../config/const */ "../src/mometa/config/const.ts");
/* harmony import */ var _utils_get_from_main__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../utils/get-from-main */ "../src/mometa/utils/get-from-main.ts");
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./style.scss */ "../src/mometa/runtime/components/more-button/style.scss");
/* harmony import */ var _utils_dom_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../utils/dom-utils */ "../src/mometa/utils/dom-utils.ts");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-dev-runtime */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/jsx-dev-runtime.js");







var _jsxFileName = "/Users/congyu/github/mometa/packages/editor/src/mometa/runtime/components/more-button/index.tsx",
    _this = undefined;






const {
  api
} = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_6__.getSharedFromMain)();




const cn = prefix_classname__WEBPACK_IMPORTED_MODULE_4___default()('');
const c = prefix_classname__WEBPACK_IMPORTED_MODULE_4___default()(`${_config_const__WEBPACK_IMPORTED_MODULE_5__.CLS_PREFIX}-more-button`);
const MoreButton = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.memo(_ref => {
  let {
    className,
    dom,
    menu
  } = _ref;
  const [, setSelectedNode] = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_6__.useSelectedNode)();
  const [paths, setPaths] = react__WEBPACK_IMPORTED_MODULE_3__.useState(null);

  const renderMenuItem = function (_ref2) {
    let {
      mometa: data,
      dom: _dom
    } = _ref2;
    let i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    const isActive = dom.__mometa.getKey() === data.hash;
    return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"].Item, {
      className: c({
        '-active': isActive
      }),
      disabled: isActive,
      onClick: () => {
        setSelectedNode(null);
        _dom.__mometa.selectedKey = data.hash;
        setSelectedNode(_dom);
      },
      children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)("span", {
        children: [!!data.container && '*', data.name]
      }, void 0, true, {
        fileName: _jsxFileName,
        lineNumber: 40,
        columnNumber: 9
      }, _this), !!isActive && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)("span", {
        children: " (\u81EA\u5DF1)"
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 44,
        columnNumber: 24
      }, _this)]
    }, `${data.hash}-${i}`, true, {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 7
    }, _this);
  };

  return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_dropdown__WEBPACK_IMPORTED_MODULE_11__["default"], {
    className: c('__dropdown'),
    overlay: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"], {
      children: [!!menu && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
        children: [menu, /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"].Divider, {}, void 0, false, {
          fileName: _jsxFileName,
          lineNumber: 57,
          columnNumber: 15
        }, undefined)]
      }, void 0, true), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"].SubMenu, {
        title: '选中层级',
        popupOffset: [0, 0],
        children: !!paths && Array.from(paths.keys()).map((groupDom, i) => {
          const list = paths.get(groupDom);

          if (!list.length) {
            return null;
          }

          if (list.length > 1) {
            return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"].ItemGroup, {
              title: `${(0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_8__.getDomName)(groupDom)} (DOM)`,
              children: list.map(renderMenuItem)
            }, `group-${i}`, false, {
              fileName: _jsxFileName,
              lineNumber: 69,
              columnNumber: 21
            }, undefined);
          }

          return renderMenuItem(list[0]);
        })
      }, 'level', false, {
        fileName: _jsxFileName,
        lineNumber: 60,
        columnNumber: 11
      }, undefined), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"].Item, {
        onClick: () => {
          setSelectedNode(null);
        },
        children: "\u53D6\u6D88\u9009\u4E2D"
      }, 'cancel-select', false, {
        fileName: _jsxFileName,
        lineNumber: 78,
        columnNumber: 11
      }, undefined), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"].Divider, {}, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 86,
        columnNumber: 11
      }, undefined), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_10__["default"].Item, {
        onClick: () => {
          return api.handleViewOp('copy', dom);
        },
        children: "\u91CD\u590D\u4E00\u4EFD"
      }, 'copy', false, {
        fileName: _jsxFileName,
        lineNumber: 87,
        columnNumber: 11
      }, undefined)]
    }, void 0, true, {
      fileName: _jsxFileName,
      lineNumber: 53,
      columnNumber: 9
    }, undefined),
    onVisibleChange: v => {
      if (v && !paths) {
        const paths = new Map();

        dom.__mometa.findParents().forEach(data => {
          if (data.dom) {
            const arr = paths.get(data.dom) || [];
            arr.push(data);
            paths.set(data.dom, arr);
          }
        });

        setPaths(paths);
      }
    },
    children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(antd_lib_button__WEBPACK_IMPORTED_MODULE_12__["default"], {
      type: "text",
      size: 'small',
      className: cn(c(), className),
      icon: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_13__["default"], {}, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 112,
        columnNumber: 79
      }, undefined)
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 112,
      columnNumber: 7
    }, undefined)
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 50,
    columnNumber: 5
  }, undefined);
});
MoreButton.defaultProps = {};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MoreButton);

/***/ }),

/***/ "../src/mometa/runtime/dnd.tsx":
/*!*************************************!*\
  !*** ../src/mometa/runtime/dnd.tsx ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "DndUndropableNode": () => (/* binding */ DndUndropableNode),
/* harmony export */   "DndDropableNode": () => (/* binding */ DndDropableNode),
/* harmony export */   "DndLayout": () => (/* binding */ DndLayout)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/index.js");
/* harmony import */ var _utils_emotion_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/emotion-css */ "../src/mometa/utils/emotion-css.ts");
/* harmony import */ var react_dnd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-dnd */ "../../../node_modules/.pnpm/react-dnd@14.0.5_react@17.0.2/node_modules/react-dnd/dist/esm/hooks/useDrop/useDrop.js");
/* harmony import */ var get_window__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! get-window */ "../../../node_modules/.pnpm/get-window@1.1.2/node_modules/get-window/index.js");
/* harmony import */ var get_window__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(get_window__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/dom-utils */ "../src/mometa/utils/dom-utils.ts");
/* harmony import */ var _floating_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./floating-ui */ "../src/mometa/runtime/floating-ui.tsx");
/* harmony import */ var _dom_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dom-api */ "../src/mometa/runtime/dom-api.ts");
/* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./provider */ "../src/mometa/runtime/provider.tsx");
/* harmony import */ var _utils_get_from_main__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/get-from-main */ "../src/mometa/utils/get-from-main.ts");
/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/utils */ "../src/shared/utils.ts");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-dev-runtime */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/jsx-dev-runtime.js");
var _jsxFileName = "/Users/congyu/github/mometa/packages/editor/src/mometa/runtime/dnd.tsx";












const {
  api
} = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_7__.getSharedFromMain)();

function isDropableDom(dom) {
  if (dom.localName === EMPTY_PLACEHOLDER_NAME) {
    return false;
  }

  const res = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.parseReactDomNodeDeep)(dom); // return !!res?.mometa
  // 寻找第一个 fiber 节点 (stateNode === dom)

  let f = res === null || res === void 0 ? void 0 : res.fiber;

  while (f && f.stateNode !== dom) {
    f = f.child;
  }

  return !!f;
}

const EMPTY_PLACEHOLDER_NAME = 'mometa-empty-placeholder';

function useDfsDom(dom) {
  const [domChildren, setDomChildren] = react__WEBPACK_IMPORTED_MODULE_0__.useState([]);
  const domChildrenRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
  domChildrenRef.current = domChildren;
  const getDomChildren = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => {
    if (dom !== null && dom !== void 0 && dom.parentNode) {
      return Array.from((dom === null || dom === void 0 ? void 0 : dom.children) || []);
    }

    return [];
  }, [dom]);
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
    if (!dom) {
      setDomChildren(getDomChildren());
      return;
    }

    const ob = new MutationObserver(records => {
      const newChildren = domChildrenRef.current.slice();
      let isUpdate = false;

      for (const record of records) {
        if (record.removedNodes) {
          // eslint-disable-next-line no-loop-func
          record.removedNodes.forEach(item => {
            const i = newChildren.indexOf(item);

            if (i >= 0) {
              isUpdate = true;
              newChildren.splice(i, 1);
            }
          });
        }

        if (record.addedNodes) {
          // eslint-disable-next-line no-loop-func
          record.addedNodes.forEach(item => {
            const i = newChildren.indexOf(item);

            if (i < 0) {
              isUpdate = true;
              newChildren.push(item);
            }
          });
        }
      }

      if (isUpdate) {
        setDomChildren(newChildren);
      }
    });
    ob.observe(dom, {
      subtree: false,
      attributes: false,
      childList: true
    });
    setDomChildren(getDomChildren());
    return () => {
      ob.disconnect();
    };
  }, [dom, getDomChildren]);
  return [domChildren];
}

const DndUndropableNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.memo(_ref => {
  let {
    dom
  } = _ref;
  const [domChildren] = useDfsDom(dom);

  if (!(dom !== null && dom !== void 0 && dom.parentNode)) {
    return null;
  }

  return (
    /*#__PURE__*/
    // eslint-disable-next-line react/jsx-no-useless-fragment
    (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
      children: domChildren === null || domChildren === void 0 ? void 0 : domChildren.map((child, key) =>
      /*#__PURE__*/
      // eslint-disable-next-line react/no-array-index-key
      (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(DndNode, {
        dom: child
      }, key, false, {
        fileName: _jsxFileName,
        lineNumber: 103,
        columnNumber: 9
      }, undefined))
    }, void 0, false)
  );
});
const DndNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.memo(function (_ref2) {
  let {
    dom
  } = _ref2;

  if (dom && dom.parentNode) {
    return isDropableDom(dom) ? /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(DndDropableNode, {
      dom: dom
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 111,
      columnNumber: 33
    }, this) : /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(DndUndropableNode, {
      dom: dom
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 111,
      columnNumber: 65
    }, this);
  }

  return null;
});

function useMometaDomInject(dom) {
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
    var _dom$removeAttribute;

    if (!dom) {
      return;
    }

    const mometaApi = dom.__mometa = new _dom_api__WEBPACK_IMPORTED_MODULE_5__.MometaDomApi(dom);
    (_dom$removeAttribute = dom.removeAttribute) === null || _dom$removeAttribute === void 0 ? void 0 : _dom$removeAttribute.call(dom, '__mometa');

    if (dom.dataset) {
      dom.dataset.mometaKey = mometaApi.getKey();
    }

    return () => {
      var _dom$dataset;

      (_dom$dataset = dom.dataset) === null || _dom$dataset === void 0 ? true : delete _dom$dataset.mometaKey;
      delete dom.__mometa;
    };
  }, [dom]);
}

const DndDropableNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.memo(_ref3 => {
  let {
    dom
  } = _ref3;
  const [overingNode, setOveringNode] = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_7__.useOveringNode)();
  const [selNode, setSelNode] = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_7__.useSelectedNode)();
  const isSelected = selNode === dom && !!dom;
  const offset = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
    if ((0,_shared_utils__WEBPACK_IMPORTED_MODULE_8__.isInIframe)()) {
      return [0, 0];
    }

    const rect = get_window__WEBPACK_IMPORTED_MODULE_2___default()(dom).frameElement.getBoundingClientRect();
    return [rect.x, rect.y];
  }, [dom]);
  const overingUiRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
  const [{
    canSelect
  }] = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_7__.useHeaderStatus)();
  const [str, drop] = (0,react_dnd__WEBPACK_IMPORTED_MODULE_10__.useDrop)(() => ({
    accept: ['asset', 'dom'],

    drop(item, monitor) {
      if (monitor.isOver({
        shallow: true
      }) && overingUiRef.current) {
        var _matchedDom$dataset, _matchedDom$dataset2;

        const _clientOffset = monitor.getClientOffset();

        const clientOffset = {
          x: offset[0] + _clientOffset.x,
          y: offset[1] + _clientOffset.y
        };
        const children = overingUiRef.current.children;
        const matchedDom = Array.from(children).find(dom => {
          const rect = dom.getBoundingClientRect();

          if (clientOffset.x >= rect.x && clientOffset.x <= rect.x + rect.width && clientOffset.y >= rect.y && clientOffset.y <= rect.y + rect.height) {
            return true;
          }
        });
        const itemType = monitor.getItemType();
        console.log('itemType', {
          itemType,
          item,
          pos: matchedDom === null || matchedDom === void 0 ? void 0 : (_matchedDom$dataset = matchedDom.dataset) === null || _matchedDom$dataset === void 0 ? void 0 : _matchedDom$dataset.pos
        });

        if (matchedDom !== null && matchedDom !== void 0 && (_matchedDom$dataset2 = matchedDom.dataset) !== null && _matchedDom$dataset2 !== void 0 && _matchedDom$dataset2.pos) {
          if (itemType === 'asset') {
            var _matchedDom$dataset3;

            return api.handleViewOp('insert-asset', dom, {
              asset: item.data,
              direction: matchedDom === null || matchedDom === void 0 ? void 0 : (_matchedDom$dataset3 = matchedDom.dataset) === null || _matchedDom$dataset3 === void 0 ? void 0 : _matchedDom$dataset3.pos
            });
          } else if (itemType === 'dom') {
            var _matchedDom$dataset4;

            return api.handleViewOp('move-dom', item, {
              toDom: dom,
              direction: matchedDom === null || matchedDom === void 0 ? void 0 : (_matchedDom$dataset4 = matchedDom.dataset) === null || _matchedDom$dataset4 === void 0 ? void 0 : _matchedDom$dataset4.pos
            });
          }
        }
      }
    },

    collect: monitor => {
      if (!canSelect) {
        return JSON.stringify({
          isOverCurrent: false,
          isOver: false
        });
      }

      const itemType = monitor.getItemType();
      const item = monitor.getItem();
      let isOverCurrent = false;

      if (itemType !== 'dom') {
        isOverCurrent = monitor.isOver({
          shallow: true
        });
      } else {
        // dom 下只能允许同名文件内移动 & 不同 dom
        isOverCurrent = item !== dom && monitor.isOver({
          shallow: true
        }) && !!(item !== null && item !== void 0 && item.__mometa) && item.__mometa.getMometaData().filename === dom.__mometa.getMometaData().filename;
      } // dnd 在 window.parent 环境中，当前 useDrog 在 iframe 环境中，使用 collect 返回 object，对比会出现不匹配的情况
      // {}.valueOf !== window.parent.Object.prototype.valueOf


      return JSON.stringify({
        isOverCurrent,
        isOver: monitor.isOver()
      });
    }
  }), [dom, isSelected, offset, canSelect]);
  const {
    isOverCurrent,
    isOver
  } = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => JSON.parse(str), [str]); // eslint-disable-next-line consistent-return

  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
    if (isOver) {
      return (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.addCss)(dom, _utils_emotion_css__WEBPACK_IMPORTED_MODULE_1__.css`
          ${EMPTY_PLACEHOLDER_NAME} {
            display: block !important;
          }
        `);
    }
  }, [isOver, dom]);
  const [isEnter, setIsEnter] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);
  useMometaDomInject(dom); // eslint-disable-next-line consistent-return

  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (!dom || !dom.__mometa) {
      return;
    }

    if (canSelect) {
      setIsEnter(overingNode === dom);

      const enterHandler = evt => {
        setOveringNode(dom);
        evt.stopPropagation();
      };

      const leaveHandler = evt => {
        if (dom === overingNode) {
          setOveringNode(null);
          evt.stopPropagation();
        }
      };

      dom.addEventListener('mouseover', enterHandler);
      dom.addEventListener('mouseout', leaveHandler);
      const disposes = [dom.__mometa.preventDefaultPop('click', true), dom.__mometa.preventDefaultPop('mousedown', true), dom.__mometa.preventDefaultPop('keydown', true), dom.__mometa.preventDefaultPop('keypress', true), dom.__mometa.preventDefaultPop('beforeinput', true)];
      return () => {
        dom.removeEventListener('mouseover', enterHandler);
        dom.removeEventListener('mouseout', leaveHandler);
        disposes.forEach(fn => fn());
      };
    }

    setSelNode(null);
    setOveringNode(null);
    setIsEnter(false);
  }, [dom, canSelect, setIsEnter, overingNode, setOveringNode, setSelNode]);
  const dropRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
  dropRef.current = drop;
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
    if (!dom) {
      return;
    }

    dropRef.current(dom);
  }, [dom]);

  if (!(dom !== null && dom !== void 0 && dom.parentNode)) {
    return null;
  }

  return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
    children: [(isEnter || isSelected || isOverCurrent) && !!dom && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(_floating_ui__WEBPACK_IMPORTED_MODULE_4__.OveringFloat, {
      ref: overingUiRef,
      isOverCurrent: isOverCurrent,
      onSelect: () => setSelNode(dom),
      isSelected: isSelected,
      dom: dom
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 290,
      columnNumber: 9
    }, undefined), !!dom && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(DndUndropableNode, {
      dom: dom
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 298,
      columnNumber: 17
    }, undefined)]
  }, void 0, true);
});
function DndLayout(_ref4) {
  let {
    dom
  } = _ref4;
  return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(_provider__WEBPACK_IMPORTED_MODULE_6__.Provider, {
    dom: dom,
    children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(DndNode, {
      dom: dom
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 306,
      columnNumber: 7
    }, this)
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 305,
    columnNumber: 5
  }, this);
}

/***/ }),

/***/ "../src/mometa/runtime/dom-api.ts":
/*!****************************************!*\
  !*** ../src/mometa/runtime/dom-api.ts ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MometaDomApi": () => (/* binding */ MometaDomApi),
/* harmony export */   "useProxyEvents": () => (/* binding */ useProxyEvents)
/* harmony export */ });
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ "../../../node_modules/.pnpm/events@3.3.0/node_modules/events/events.js");
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/index.js");
/* harmony import */ var get_window__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! get-window */ "../../../node_modules/.pnpm/get-window@1.1.2/node_modules/get-window/index.js");
/* harmony import */ var get_window__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(get_window__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/dom-utils */ "../src/mometa/utils/dom-utils.ts");





const findClosest = (from, isPass) => {
  let t = from;

  while (t) {
    if (isPass(t)) {
      return t;
    }

    t = t.parentElement;
  }
};

const findClosestFiber = (from, isPass) => {
  let t = from;

  while (t) {
    const res = isPass(t);

    if (res === true) {
      return t;
    }

    if (res) {
      t = res;
    }

    t = t.return;
  }
};

class MometaDomApi extends events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter {
  constructor(dom) {
    super();
    this.dom = dom;
    this.selectedKey = null;

    this._preventDefault = evt => {
      // React SyntheticEvent
      // if (evt.nativeEvent) {
      //   return
      // }
      const closestPass = findClosest(evt.target, x => x.__mometa && !x.__mometa.preventEvent);

      if (closestPass) {
        closestPass.__mometa.emit(evt.type, evt);
      }

      evt.stopPropagation();
      evt.preventDefault();
    };

    this.preventEvent = true;
  }

  preventDefaultPop(event, options) {
    this.dom.addEventListener(event, this._preventDefault, options);
    return () => {
      this.dom.removeEventListener(event, this._preventDefault, options);
    };
  }

  getMometaList() {
    const parents = new Set();
    const data = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.parseReactDomNodeDeep)(this.dom);

    if (data !== null && data !== void 0 && data.fiber) {
      findClosestFiber(data.fiber, f => {
        f = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.getLatestFiber)(f);

        while (f && !((_f$_debugSource = f._debugSource) !== null && _f$_debugSource !== void 0 && _f$_debugSource.__mometa)) {
          var _f$_debugSource;

          f = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.getLatestFiber)(f.return);
        }

        let t = f;

        while (t && !(t.stateNode instanceof get_window__WEBPACK_IMPORTED_MODULE_2___default()(this.dom).HTMLElement)) {
          t = t.child;
        }

        if (t) {
          var _getLatestFiber$_debu;

          // if (t.stateNode !== this.dom) {
          //   return true
          // }
          parents.add((_getLatestFiber$_debu = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.getLatestFiber)(f)._debugSource) === null || _getLatestFiber$_debu === void 0 ? void 0 : _getLatestFiber$_debu.__mometa);
        }

        return f;
      });
    }

    return Array.from(parents.values());
  }

  getMometaData() {
    var _list$find;

    const list = this.getMometaList();
    return (_list$find = list.find(x => x.hash === this.selectedKey)) !== null && _list$find !== void 0 ? _list$find : list[0];
  }

  getKey() {
    var _this$getMometaData;

    return (_this$getMometaData = this.getMometaData()) === null || _this$getMometaData === void 0 ? void 0 : _this$getMometaData.hash;
  }

  findParents() {
    const parents = [];
    const data = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.parseReactDomNodeDeep)(this.dom);

    if (data !== null && data !== void 0 && data.fiber) {
      findClosestFiber(data.fiber, f => {
        f = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.getLatestFiber)(f);

        while (f && !((_f$_debugSource2 = f._debugSource) !== null && _f$_debugSource2 !== void 0 && _f$_debugSource2.__mometa)) {
          var _f$_debugSource2;

          f = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.getLatestFiber)(f.return);
        }

        let t = f;

        while (t && !(t.stateNode instanceof get_window__WEBPACK_IMPORTED_MODULE_2___default()(this.dom).HTMLElement)) {
          t = t.child;
        }

        if (t) {
          var _getLatestFiber$_debu2;

          parents.push({
            dom: t.stateNode,
            mometa: (_getLatestFiber$_debu2 = (0,_utils_dom_utils__WEBPACK_IMPORTED_MODULE_3__.getLatestFiber)(f)._debugSource) === null || _getLatestFiber$_debu2 === void 0 ? void 0 : _getLatestFiber$_debu2.__mometa
          });
        }

        return f;
      });
    }

    return parents;
  }

}

/**
 * 为了不修改原有 dom 事件，使用自定义的发布订阅模拟实现 dom 事件
 * @param dom
 * @param events
 */
function useProxyEvents(dom, events) {
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!events) {
      return () => {};
    }

    const disposes = [];

    for (const [name, fn] of Object.entries(events)) {
      let tName = name.toLowerCase();
      tName = tName.replace(/^on/, '').replace(/capture$/, '');

      dom.__mometa.addListener(tName, fn);

      disposes.push(() => {
        var _dom$__mometa;

        (_dom$__mometa = dom.__mometa) === null || _dom$__mometa === void 0 ? void 0 : _dom$__mometa.removeListener(tName, fn);
      });
    }

    return () => {
      disposes.forEach(fn => fn());
    };
  }, [dom, events]);
}

/***/ }),

/***/ "../src/mometa/runtime/floating-ui.tsx":
/*!*********************************************!*\
  !*** ../src/mometa/runtime/floating-ui.tsx ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FloatingUi": () => (/* binding */ FloatingUi),
/* harmony export */   "OveringFloat": () => (/* binding */ OveringFloat)
/* harmony export */ });
/* harmony import */ var antd_lib_menu_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/lib/menu/style */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/menu/style/index.js");
/* harmony import */ var antd_lib_menu_style__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(antd_lib_menu_style__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd_lib_menu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! antd/lib/menu */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/menu/index.js");
/* harmony import */ var antd_lib_tooltip_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/tooltip/style */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/tooltip/style/index.js");
/* harmony import */ var antd_lib_tooltip_style__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd_lib_tooltip_style__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var antd_lib_tooltip__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd/lib/tooltip */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/tooltip/index.js");
/* harmony import */ var antd_lib_button_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/lib/button/style */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/button/style/index.js");
/* harmony import */ var antd_lib_button_style__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_button_style__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var antd_lib_button__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd/lib/button */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/button/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "../../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js");
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! lodash-es */ "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pick.js");
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! lodash-es */ "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/omit.js");
/* harmony import */ var _floating_ui_dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @floating-ui/dom */ "../../../node_modules/.pnpm/@floating-ui+dom@0.1.10/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js");
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ant-design/icons */ "../../../node_modules/.pnpm/@ant-design+icons@4.7.0_react@17.0.2/node_modules/@ant-design/icons/es/icons/ArrowUpOutlined.js");
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ant-design/icons */ "../../../node_modules/.pnpm/@ant-design+icons@4.7.0_react@17.0.2/node_modules/@ant-design/icons/es/icons/ArrowDownOutlined.js");
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ant-design/icons */ "../../../node_modules/.pnpm/@ant-design+icons@4.7.0_react@17.0.2/node_modules/@ant-design/icons/es/icons/DeleteOutlined.js");
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @ant-design/icons */ "../../../node_modules/.pnpm/@ant-design+icons@4.7.0_react@17.0.2/node_modules/@ant-design/icons/es/icons/DragOutlined.js");
/* harmony import */ var _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/emotion-css */ "../src/mometa/utils/emotion-css.ts");
/* harmony import */ var _rcp_use_persistfn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @rcp/use.persistfn */ "../../../node_modules/.pnpm/@rcp+use.persistfn@1.0.4/node_modules/@rcp/use.persistfn/dist/es/index.js");
/* harmony import */ var _dom_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dom-api */ "../src/mometa/runtime/dom-api.ts");
/* harmony import */ var _rcp_c_preventfastop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @rcp/c.preventfastop */ "../../../node_modules/.pnpm/@rcp+c.preventfastop@1.2.2/node_modules/@rcp/c.preventfastop/dist/es/index.js");
/* harmony import */ var _components_more_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/more-button */ "../src/mometa/runtime/components/more-button/index.tsx");
/* harmony import */ var react_dnd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react-dnd */ "../../../node_modules/.pnpm/react-dnd@14.0.5_react@17.0.2/node_modules/react-dnd/dist/esm/hooks/useDrag/useDrag.js");
/* harmony import */ var _utils_get_from_main__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/get-from-main */ "../src/mometa/utils/get-from-main.ts");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-dev-runtime */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/jsx-dev-runtime.js");






var _jsxFileName = "/Users/congyu/github/mometa/packages/editor/src/mometa/runtime/floating-ui.tsx";














const {
  api
} = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_10__.getSharedFromMain)();

function usePosition(dom) {
  const [data, setData] = react__WEBPACK_IMPORTED_MODULE_3__.useState({
    isReady: false,
    rect: {
      width: 0,
      height: 0,
      x: 0,
      y: 0
    }
  });
  const [shouldHide, setShouldHide] = react__WEBPACK_IMPORTED_MODULE_3__.useState(false);
  react__WEBPACK_IMPORTED_MODULE_3__.useEffect(() => {
    if (!dom) {
      return;
    }

    const updatePos = () => {
      const rect = dom.getBoundingClientRect();
      setData({
        rect,
        isReady: true
      });
    };

    updatePos();
    const parents = (0,_floating_ui_dom__WEBPACK_IMPORTED_MODULE_12__.getScrollParents)(dom);
    const reset = (0,lodash_es__WEBPACK_IMPORTED_MODULE_13__["default"])(() => {
      setShouldHide(false);
      updatePos();
    }, 500);

    const debouncedUpdate = () => {
      setShouldHide(true);
      reset();
    };

    parents.forEach(par => {
      par.addEventListener('resize', debouncedUpdate);
      par.addEventListener('scroll', debouncedUpdate);
    });
    return () => {
      parents.forEach(par => {
        par.removeEventListener('resize', debouncedUpdate);
        par.removeEventListener('scroll', debouncedUpdate);
      });
    };
  }, [dom]);
  return {
    shouldHide,
    ...data
  };
}

const FloatingUi = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.forwardRef(function FloatingUi(_ref, ref) {
  let {
    centerBottomElement,
    centerTopElement,
    rightTopElement,
    rightBottomElement,
    leftTopElement,
    children,
    dom,
    ...props
  } = _ref;
  const {
    isReady,
    shouldHide,
    rect
  } = usePosition(dom);
  const handlerKeys = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => {
    return Object.keys(props).filter(n => /^on[A-Z]/.test(n));
  }, [props]);
  const events = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => (0,lodash_es__WEBPACK_IMPORTED_MODULE_14__["default"])(props, handlerKeys), [handlerKeys, props]);
  (0,_dom_api__WEBPACK_IMPORTED_MODULE_7__.useProxyEvents)(dom, events);
  return !!isReady && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
    ref: ref,
    style: {
      position: 'absolute',
      left: rect.x,
      top: rect.y,
      width: rect.width,
      minHeight: rect.height,
      display: shouldHide ? 'none' : ''
    },
    ...(0,lodash_es__WEBPACK_IMPORTED_MODULE_15__["default"])(props, handlerKeys),
    children: [children, !!leftTopElement && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
      className: _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
              display: flex;
              transform: translateY(-100%);
              position: absolute;
              top: 0px;
              left: -1px;
            `,
      children: leftTopElement
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 104,
      columnNumber: 11
    }, this), !!rightTopElement && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
      className: _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
              display: flex;
              transform: translateY(-100%);
              position: absolute;
              top: 0px;
              right: -1px;
            `,
      children: rightTopElement
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 117,
      columnNumber: 11
    }, this), !!rightBottomElement && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
      className: _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
              display: flex;
              transform: translateY(100%);
              position: absolute;
              bottom: 0;
              right: -1px;
            `,
      children: rightBottomElement
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 130,
      columnNumber: 11
    }, this), !!centerTopElement && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
      className: _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
              display: flex;
              transform: translate(-50%, -100%);
              position: absolute;
              top: 0px;
              left: 50%;
              display: flex;
              width: 100%;
              align-items: center;
              justify-content: center;
            `,
      children: centerTopElement
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 143,
      columnNumber: 11
    }, this), !!centerBottomElement && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
      className: _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
              display: flex;
              transform: translate(-50%, 100%);
              position: absolute;
              bottom: 0px;
              left: 50%;
              display: flex;
              width: 100%;
              align-items: center;
              justify-content: center;
            `,
      children: centerBottomElement
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 160,
      columnNumber: 11
    }, this)]
  }, void 0, true, {
    fileName: _jsxFileName,
    lineNumber: 90,
    columnNumber: 7
  }, this);
});
const OveringFloat = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.forwardRef(function OveringFloat(_ref2, ref) {
  var _dom$__mometa;

  let {
    isOverCurrent,
    isSelected,
    onDeselect,
    onSelect,
    dom,
    ...props
  } = _ref2;
  react__WEBPACK_IMPORTED_MODULE_3__.useEffect(() => {
    dom.__mometa.preventEvent = false;
    return () => {
      if (dom !== null && dom !== void 0 && dom.__mometa) {
        dom.__mometa.preventEvent = true;
      }
    };
  }, [dom]);
  const data = (_dom$__mometa = dom.__mometa) === null || _dom$__mometa === void 0 ? void 0 : _dom$__mometa.getMometaData();
  const [dataStr, drag, preview] = (0,react_dnd__WEBPACK_IMPORTED_MODULE_16__.useDrag)(() => ({
    type: 'dom',
    item: dom,
    end: (item, monitor) => {},
    collect: monitor => JSON.stringify({
      isDragging: monitor.isDragging()
    })
  }), [dom]);
  const {
    isDragging
  } = react__WEBPACK_IMPORTED_MODULE_3__.useMemo(() => JSON.parse(dataStr), [dataStr]);
  const onClickFn = (0,_rcp_use_persistfn__WEBPACK_IMPORTED_MODULE_6__["default"])(evt => {
    // eslint-disable-next-line no-unused-expressions
    onSelect === null || onSelect === void 0 ? void 0 : onSelect();
  });
  const color = isSelected ? '#5185EC' : '#6F97E7';
  const commonCss = _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
    display: flex;
    align-items: center;
    color: #fff;
    background-color: ${color};
    height: 21px;
    padding: 0 4px;
    font-size: 12px;
    pointer-events: auto;
    border-radius: 3px 3px 0 0;
  `;
  const btnCss = _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
    display: inline-flex;
    cursor: pointer;
    margin-left: 2px;
    margin-right: 2px;
    width: 15px !important;
    height: 17px !important;
    line-height: 1 !important;

    &::before {
      background: transparent !important;
    }
    .anticon {
      color: #fff !important;
    }
  `;
  const opHandler = (0,_rcp_use_persistfn__WEBPACK_IMPORTED_MODULE_6__["default"])(async opType => {
    return api.handleViewOp(opType, dom);
  });
  const {
    rect
  } = usePosition(dom);

  if (!dom || !data) {
    return null;
  }

  const commonOverCls = _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
    min-height: 25px;
    color: rgb(161, 160, 160);
    font-style: italic;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: rgba(96, 125, 217, 0.3);
    border: 1px dashed rgba(47, 84, 235, 0.8);

    margin-left: -1px;
    margin-right: -1px;
    width: calc(100% + 2px);
  `;
  const widthGte = true; //rect.width >= rect.height

  const flagElem = /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
    ref: preview,
    className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(commonCss),
    title: data.text,
    children: [!!data.container && '*', data.name || 'Unknown']
  }, void 0, true, {
    fileName: _jsxFileName,
    lineNumber: 282,
    columnNumber: 5
  }, this);

  const opElement = /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
    children: [!!data.previousSibling && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_tooltip__WEBPACK_IMPORTED_MODULE_17__["default"], {
      title: '上移',
      children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_rcp_c_preventfastop__WEBPACK_IMPORTED_MODULE_8__.PreventFastClick, {
        className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(btnCss),
        onClick: () => opHandler('up'),
        children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_button__WEBPACK_IMPORTED_MODULE_18__["default"], {
          type: 'text',
          size: 'small',
          icon: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_19__["default"], {}, void 0, false, {
            fileName: _jsxFileName,
            lineNumber: 294,
            columnNumber: 56
          }, this)
        }, void 0, false, {
          fileName: _jsxFileName,
          lineNumber: 294,
          columnNumber: 13
        }, this)
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 293,
        columnNumber: 11
      }, this)
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 291,
      columnNumber: 9
    }, this), !!data.nextSibling && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_tooltip__WEBPACK_IMPORTED_MODULE_17__["default"], {
      title: '下移',
      children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_rcp_c_preventfastop__WEBPACK_IMPORTED_MODULE_8__.PreventFastClick, {
        className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(btnCss),
        onClick: () => opHandler('down'),
        children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_button__WEBPACK_IMPORTED_MODULE_18__["default"], {
          type: 'text',
          size: 'small',
          icon: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_20__["default"], {}, void 0, false, {
            fileName: _jsxFileName,
            lineNumber: 302,
            columnNumber: 56
          }, this)
        }, void 0, false, {
          fileName: _jsxFileName,
          lineNumber: 302,
          columnNumber: 13
        }, this)
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 301,
        columnNumber: 11
      }, this)
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 299,
      columnNumber: 9
    }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_tooltip__WEBPACK_IMPORTED_MODULE_17__["default"], {
      title: '删除',
      children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_rcp_c_preventfastop__WEBPACK_IMPORTED_MODULE_8__.PreventFastClick, {
        className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(btnCss),
        onClick: () => opHandler('del'),
        children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_button__WEBPACK_IMPORTED_MODULE_18__["default"], {
          type: 'text',
          size: 'small',
          icon: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_21__["default"], {
            title: '删除'
          }, void 0, false, {
            fileName: _jsxFileName,
            lineNumber: 309,
            columnNumber: 54
          }, this)
        }, void 0, false, {
          fileName: _jsxFileName,
          lineNumber: 309,
          columnNumber: 11
        }, this)
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 308,
        columnNumber: 9
      }, this)
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 306,
      columnNumber: 7
    }, this)]
  }, void 0, true);

  const dragElem = /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_tooltip__WEBPACK_IMPORTED_MODULE_17__["default"], {
    title: '按住并拖动来进行移动；暂时只允许同名文件内移动',
    children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_rcp_c_preventfastop__WEBPACK_IMPORTED_MODULE_8__.PreventFastClick, {
      className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(btnCss),
      onClick: () => opHandler('moving'),
      children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_button__WEBPACK_IMPORTED_MODULE_18__["default"], {
        ref: drag,
        type: 'text',
        size: 'small',
        icon: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_22__["default"], {}, void 0, false, {
          fileName: _jsxFileName,
          lineNumber: 319,
          columnNumber: 63
        }, this),
        title: ''
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 319,
        columnNumber: 9
      }, this)
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 318,
      columnNumber: 7
    }, this)
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 316,
    columnNumber: 5
  }, this);

  const isSimple = rect.width < 230;
  const shouldShowOp = !isDragging && isSelected && !isOverCurrent;
  return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(FloatingUi, {
    ref: ref,
    leftTopElement: !isDragging && flagElem,
    rightBottomElement: isSimple && shouldShowOp && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(commonCss, _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
                border-radius: 0 0 3px 3px;
              `),
      children: [dragElem, /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_components_more_button__WEBPACK_IMPORTED_MODULE_9__["default"], {
        className: btnCss,
        dom: dom,
        menu: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
          children: [!!data.previousSibling && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_23__["default"].Item, {
            onClick: () => opHandler('up'),
            children: "\u4E0A\u79FB"
          }, void 0, false, {
            fileName: _jsxFileName,
            lineNumber: 348,
            columnNumber: 46
          }, this), !!data.nextSibling && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_23__["default"].Item, {
            onClick: () => opHandler('down'),
            children: "\u4E0B\u79FB"
          }, void 0, false, {
            fileName: _jsxFileName,
            lineNumber: 349,
            columnNumber: 42
          }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(antd_lib_menu__WEBPACK_IMPORTED_MODULE_23__["default"].Item, {
            danger: true,
            onClick: () => opHandler('del'),
            children: "\u5220\u9664"
          }, void 0, false, {
            fileName: _jsxFileName,
            lineNumber: 350,
            columnNumber: 19
          }, this)]
        }, void 0, true)
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 343,
        columnNumber: 13
      }, this)]
    }, void 0, true, {
      fileName: _jsxFileName,
      lineNumber: 334,
      columnNumber: 11
    }, this),
    rightTopElement: !isSimple && shouldShowOp && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(commonCss),
      children: [dragElem, opElement, /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(_components_more_button__WEBPACK_IMPORTED_MODULE_9__["default"], {
        className: btnCss,
        dom: dom
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 365,
        columnNumber: 13
      }, this)]
    }, void 0, true, {
      fileName: _jsxFileName,
      lineNumber: 362,
      columnNumber: 11
    }, this),
    dom: dom,
    className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(_utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
        pointer-events: none; !important;
        display: flex;
        flex-direction: ${widthGte ? 'row' : 'column'};
      `, isDragging && _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
            background-color: rgba(96, 125, 217, 0.3);
          `, !isOverCurrent && _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`outline: ${isSelected ? '1px solid ' + color : '1px dashed ' + color}; !important;`),
    onClick: onClickFn,
    children: !!isOverCurrent && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
        "data-pos": 'up',
        className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(commonOverCls, _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
                background-color: rgba(95, 217, 129, 0.3);
                flex: 2;
              `),
        children: "\u653E\u7F6E\u5728\u4E0A"
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 386,
        columnNumber: 11
      }, this), !data.selfClosed && /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
        "data-pos": 'child',
        className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(commonOverCls, _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
                  flex: 3;
                `, widthGte ? _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
                      border-left: none !important;
                      border-right: none !important;
                    ` : _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
                      border-top: none !important;
                      border-bottom: none !important;
                    `),
        children: "\u653E\u7F6E\u5728\u8FD9"
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 399,
        columnNumber: 13
      }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxDEV)("div", {
        "data-pos": 'down',
        className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(commonOverCls, _utils_emotion_css__WEBPACK_IMPORTED_MODULE_5__.css`
                background-color: rgba(89, 214, 219, 0.3);
                flex: 2;
              `),
        children: "\u653E\u7F6E\u5728\u4E0B"
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 420,
        columnNumber: 11
      }, this)]
    }, void 0, true)
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 328,
    columnNumber: 5
  }, this);
});

/***/ }),

/***/ "../src/mometa/runtime/provider.tsx":
/*!******************************************!*\
  !*** ../src/mometa/runtime/provider.tsx ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Provider": () => (/* binding */ Provider)
/* harmony export */ });
/* harmony import */ var antd_lib_config_provider_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/lib/config-provider/style */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/config-provider/style/index.js");
/* harmony import */ var antd_lib_config_provider_style__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(antd_lib_config_provider_style__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd_lib_config_provider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd/lib/config-provider */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/config-provider/index.js");
/* harmony import */ var _rcp_use_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rcp/use.shared */ "../../../node_modules/.pnpm/@rcp+use.shared@1.1.5/node_modules/@rcp/use.shared/dist/es/index.js");
/* harmony import */ var antd_lib_locale_zh_CN__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd/lib/locale/zh_CN */ "../../../node_modules/.pnpm/antd@4.18.2_react@17.0.2/node_modules/antd/lib/locale/zh_CN.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/index.js");
/* harmony import */ var react_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-dnd */ "../../../node_modules/.pnpm/react-dnd@14.0.5_react@17.0.2/node_modules/react-dnd/dist/esm/core/DndProvider.js");
/* harmony import */ var get_window__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! get-window */ "../../../node_modules/.pnpm/get-window@1.1.2/node_modules/get-window/index.js");
/* harmony import */ var get_window__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(get_window__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils_get_from_main__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/get-from-main */ "../src/mometa/utils/get-from-main.ts");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-dev-runtime */ "../../../node_modules/.pnpm/react@17.0.2/node_modules/react/jsx-dev-runtime.js");


var _jsxFileName = "/Users/congyu/github/mometa/packages/editor/src/mometa/runtime/provider.tsx";







const {
  _sharedMap,
  _sharedUpdateMap,
  ddManager
} = (0,_utils_get_from_main__WEBPACK_IMPORTED_MODULE_4__.getSharedFromMain)();
function Provider(_ref) {
  let {
    children,
    dom
  } = _ref;
  react__WEBPACK_IMPORTED_MODULE_2__.useLayoutEffect(() => {
    const bk = ddManager.getBackend();
    const win = get_window__WEBPACK_IMPORTED_MODULE_3___default()(dom);
    bk.addEventListeners(win);
    return () => {
      bk.removeEventListeners(win);
    };
  }, [ddManager]);
  return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(_rcp_use_shared__WEBPACK_IMPORTED_MODULE_1__.SharedProvider, {
    _internal: {
      valuesMap: _sharedMap,
      updateMap: _sharedUpdateMap
    },
    children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(antd_lib_config_provider__WEBPACK_IMPORTED_MODULE_6__["default"], {
      locale: antd_lib_locale_zh_CN__WEBPACK_IMPORTED_MODULE_7__["default"],
      prefixCls: 'mmt-ant',
      children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_dnd__WEBPACK_IMPORTED_MODULE_8__.DndProvider, {
        manager: ddManager,
        children: children
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 24,
        columnNumber: 9
      }, this)
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 23,
      columnNumber: 7
    }, this)
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 22,
    columnNumber: 5
  }, this);
}

/***/ }),

/***/ "../src/mometa/utils/dom-utils.ts":
/*!****************************************!*\
  !*** ../src/mometa/utils/dom-utils.ts ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "setStyle": () => (/* binding */ setStyle),
/* harmony export */   "addCss": () => (/* binding */ addCss),
/* harmony export */   "parseReactDomNodeDeep": () => (/* binding */ parseReactDomNodeDeep),
/* harmony export */   "getLatestFiber": () => (/* binding */ getLatestFiber),
/* harmony export */   "parseReactDomNode": () => (/* binding */ parseReactDomNode),
/* harmony export */   "getDomName": () => (/* binding */ getDomName)
/* harmony export */ });
/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pick.js");

function setStyle(dom, style) {
  const styleKeys = Object.keys(style);
  const cachedStyle = (0,lodash_es__WEBPACK_IMPORTED_MODULE_0__["default"])(dom.style, styleKeys);
  Object.assign(dom.style, style);
  return () => {
    Object.assign(dom.style, cachedStyle);
  };
}
function addCss(dom, cls) {
  dom.classList.add(cls);
  return () => {
    dom.classList.remove(cls);
  };
}
function parseReactDomNodeDeep(dom) {
  while (dom) {
    const data = parseReactDomNode(dom);

    if (!data) {
      dom = dom.parentElement;
      continue;
    }

    if (!!data.mometa) {
      return data;
    }

    if (data.fiber) {
      let fiber = data.fiber;

      while (fiber && !((_fiber = fiber) !== null && _fiber !== void 0 && (_fiber$_debugSource = _fiber._debugSource) !== null && _fiber$_debugSource !== void 0 && _fiber$_debugSource.__mometa)) {
        var _fiber, _fiber$_debugSource;

        fiber = fiber.return;
      }

      if (fiber) {
        var _fiber$_debugSource2;

        return {
          mometa: (_fiber$_debugSource2 = fiber._debugSource) === null || _fiber$_debugSource2 === void 0 ? void 0 : _fiber$_debugSource2.__mometa,
          fiber
        };
      }
    }

    dom = dom.parentElement;
  }
}
function getLatestFiber(f) {
  if (!f) {
    return f;
  }

  if (f.alternate) {
    return f.alternate.actualStartTime > f.actualStartTime ? f.alternate : f;
  }

  return f;
}
const domMap = new WeakMap();
function parseReactDomNode(dom) {
  var _dom$fiberName2, _dom$fiberName2$_debu, _dom$propName3;

  const cachedName = domMap.get(dom);

  if (cachedName) {
    var _dom$propName, _dom$fiberName, _dom$fiberName$_debug;

    const {
      fiberName,
      propName
    } = cachedName;

    if (propName && (_dom$propName = dom[propName]) !== null && _dom$propName !== void 0 && _dom$propName.__mometa) {
      var _dom$propName2;

      return {
        fiber: !!fiberName && getLatestFiber(dom[fiberName]),
        mometa: (_dom$propName2 = dom[propName]) === null || _dom$propName2 === void 0 ? void 0 : _dom$propName2.__mometa
      };
    }

    if (fiberName && (_dom$fiberName = dom[fiberName]) !== null && _dom$fiberName !== void 0 && (_dom$fiberName$_debug = _dom$fiberName._debugSource) !== null && _dom$fiberName$_debug !== void 0 && _dom$fiberName$_debug.__mometa) {
      var _getLatestFiber, _getLatestFiber$_debu;

      return {
        fiber: getLatestFiber(dom[cachedName === null || cachedName === void 0 ? void 0 : cachedName.fiberName]),
        mometa: (_getLatestFiber = getLatestFiber(dom[cachedName === null || cachedName === void 0 ? void 0 : cachedName.fiberName])) === null || _getLatestFiber === void 0 ? void 0 : (_getLatestFiber$_debu = _getLatestFiber._debugSource) === null || _getLatestFiber$_debu === void 0 ? void 0 : _getLatestFiber$_debu.__mometa
      };
    }
  }

  const fiberName = Object.keys(dom).find(name => /^__reactFiber\$.+$/.test(name));

  if (fiberName && (_dom$fiberName2 = dom[fiberName]) !== null && _dom$fiberName2 !== void 0 && (_dom$fiberName2$_debu = _dom$fiberName2._debugSource) !== null && _dom$fiberName2$_debu !== void 0 && _dom$fiberName2$_debu.__mometa) {
    var _getLatestFiber2, _getLatestFiber2$_deb;

    domMap.set(dom, {
      fiberName
    });
    return {
      fiber: getLatestFiber(dom[fiberName]),
      mometa: (_getLatestFiber2 = getLatestFiber(dom[fiberName])) === null || _getLatestFiber2 === void 0 ? void 0 : (_getLatestFiber2$_deb = _getLatestFiber2._debugSource) === null || _getLatestFiber2$_deb === void 0 ? void 0 : _getLatestFiber2$_deb.__mometa
    };
  }

  const propName = Object.keys(dom).find(name => /^__reactProps\$.+$/.test(name));

  if (propName && (_dom$propName3 = dom[propName]) !== null && _dom$propName3 !== void 0 && _dom$propName3.__mometa) {
    var _dom$propName4;

    domMap.set(dom, {
      propName,
      fiberName
    });
    return {
      fiber: !!fiberName && dom[fiberName],
      mometa: (_dom$propName4 = dom[propName]) === null || _dom$propName4 === void 0 ? void 0 : _dom$propName4.__mometa
    };
  }

  if (fiberName) {
    return {
      fiber: dom[fiberName]
    };
  }
}
function getDomName(dom) {
  var _dom$getAttribute;

  let name = dom.localName;

  if (dom.getAttribute('id')) {
    name += `#${dom.getAttribute('id')}`;
    return name;
  }

  if ((_dom$getAttribute = dom.getAttribute('class')) !== null && _dom$getAttribute !== void 0 && _dom$getAttribute.trim()) {
    name += `.${Array.from(dom.classList.entries()).join('.')}`;
  }

  return name;
}

/***/ }),

/***/ "../src/mometa/utils/emotion-css.ts":
/*!******************************************!*\
  !*** ../src/mometa/utils/emotion-css.ts ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "refresh": () => (/* binding */ refresh),
/* harmony export */   "injectGlobal": () => (/* binding */ injectGlobal),
/* harmony export */   "css": () => (/* binding */ css)
/* harmony export */ });
/* harmony import */ var _emotion_css_create_instance_dist_emotion_css_create_instance_esm_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/css/create-instance/dist/emotion-css-create-instance.esm.js */ "../../../node_modules/.pnpm/@emotion+css@11.7.1_@babel+core@7.16.7/node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js");

const mod = (0,_emotion_css_create_instance_dist_emotion_css_create_instance_esm_js__WEBPACK_IMPORTED_MODULE_0__["default"])({
  key: 'mometa-css'
});
function refresh() {
  mod.flush();
}
const injectGlobal = function () {
  return mod.injectGlobal.apply(mod, arguments);
};
refresh();
const css = function () {
  return mod.css.apply(this, arguments);
};

/***/ }),

/***/ "../src/mometa/utils/get-from-main.ts":
/*!********************************************!*\
  !*** ../src/mometa/utils/get-from-main.ts ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "getSharedFromMain": () => (/* binding */ getSharedFromMain),
/* harmony export */   "useSelectedNode": () => (/* binding */ useSelectedNode),
/* harmony export */   "useOveringNode": () => (/* binding */ useOveringNode),
/* harmony export */   "useHeaderStatus": () => (/* binding */ useHeaderStatus),
/* harmony export */   "useLocationAction": () => (/* binding */ useLocationAction)
/* harmony export */ });
/* harmony import */ var _rcp_use_behaviorsubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rcp/use.behaviorsubject */ "../../../node_modules/.pnpm/@rcp+use.behaviorsubject@1.2.2_rxjs@7.5.1/node_modules/@rcp/use.behaviorsubject/dist/es/index.js");
/* harmony import */ var _shared_pipe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/pipe */ "../src/shared/pipe.ts");


function getSharedFromMain() {
  var _getByRemoteById;

  const shared = (_getByRemoteById = (0,_shared_pipe__WEBPACK_IMPORTED_MODULE_1__.getByRemoteById)('shared', 'main')) !== null && _getByRemoteById !== void 0 ? _getByRemoteById : (0,_shared_pipe__WEBPACK_IMPORTED_MODULE_1__.getInLocal)('shared');

  if (!shared) {
    throw new Error(`未找到来自父窗口共享资源`);
  }

  return shared;
}
function useSelectedNode() {
  const {
    selectedNodeSubject
  } = getSharedFromMain();
  return (0,_rcp_use_behaviorsubject__WEBPACK_IMPORTED_MODULE_0__.useBehaviorSubject)(selectedNodeSubject);
}
function useOveringNode() {
  const {
    overingNodeSubject
  } = getSharedFromMain();
  return (0,_rcp_use_behaviorsubject__WEBPACK_IMPORTED_MODULE_0__.useBehaviorSubject)(overingNodeSubject);
}
function useHeaderStatus() {
  const {
    headerStatusSubject
  } = getSharedFromMain();
  return (0,_rcp_use_behaviorsubject__WEBPACK_IMPORTED_MODULE_0__.useBehaviorSubject)(headerStatusSubject);
}
function useLocationAction() {
  const {
    locationActionSubject
  } = getSharedFromMain();
  return (0,_rcp_use_behaviorsubject__WEBPACK_IMPORTED_MODULE_0__.useBehaviorSubject)(locationActionSubject);
}

/***/ }),

/***/ "../src/shared/utils.ts":
/*!******************************!*\
  !*** ../src/shared/utils.ts ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "isInIframe": () => (/* binding */ isInIframe),
/* harmony export */   "lazy": () => (/* binding */ lazy)
/* harmony export */ });
function isInIframe() {
  return window.parent && window.parent !== window;
}
function lazy(fn) {
  let isCalled = false;
  let v; // @ts-ignore

  return () => {
    if (!isCalled) {
      isCalled = true;
      v = fn();
    }

    return v;
  };
}

/***/ }),

/***/ "../../../node_modules/.pnpm/mini-css-extract-plugin@2.4.6_webpack@5.65.0/node_modules/mini-css-extract-plugin/dist/loader.js??ruleSet[1].rules[1].oneOf[8].use[1]!../../../node_modules/.pnpm/css-loader@6.5.1_webpack@5.65.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[2]!../../../node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.5+webpack@5.65.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[3]!../../../node_modules/.pnpm/resolve-url-loader@4.0.0/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[8].use[4]!../../../node_modules/.pnpm/sass-loader@12.4.0_webpack@5.65.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[5]!../src/mometa/runtime/components/more-button/style.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../node_modules/.pnpm/mini-css-extract-plugin@2.4.6_webpack@5.65.0/node_modules/mini-css-extract-plugin/dist/loader.js??ruleSet[1].rules[1].oneOf[8].use[1]!../../../node_modules/.pnpm/css-loader@6.5.1_webpack@5.65.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[2]!../../../node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.5+webpack@5.65.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[3]!../../../node_modules/.pnpm/resolve-url-loader@4.0.0/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[8].use[4]!../../../node_modules/.pnpm/sass-loader@12.4.0_webpack@5.65.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[5]!../src/mometa/runtime/components/more-button/style.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
// extracted by mini-css-extract-plugin
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({});

/***/ }),

/***/ "../src/mometa/runtime/components/more-button/style.scss":
/*!***************************************************************!*\
  !*** ../src/mometa/runtime/components/more-button/style.scss ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../node_modules/.pnpm/style-loader@3.3.1_webpack@5.65.0/node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_pnpm_mini_css_extract_plugin_2_4_6_webpack_5_65_0_node_modules_mini_css_extract_plugin_dist_loader_js_ruleSet_1_rules_1_oneOf_8_use_1_node_modules_pnpm_css_loader_6_5_1_webpack_5_65_0_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_2_node_modules_pnpm_postcss_loader_6_2_1_postcss_8_4_5_webpack_5_65_0_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_3_node_modules_pnpm_resolve_url_loader_4_0_0_node_modules_resolve_url_loader_index_js_ruleSet_1_rules_1_oneOf_8_use_4_node_modules_pnpm_sass_loader_12_4_0_webpack_5_65_0_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_5_style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../../../node_modules/.pnpm/mini-css-extract-plugin@2.4.6_webpack@5.65.0/node_modules/mini-css-extract-plugin/dist/loader.js??ruleSet[1].rules[1].oneOf[8].use[1]!../../../../../../../node_modules/.pnpm/css-loader@6.5.1_webpack@5.65.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[2]!../../../../../../../node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.5+webpack@5.65.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[3]!../../../../../../../node_modules/.pnpm/resolve-url-loader@4.0.0/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[8].use[4]!../../../../../../../node_modules/.pnpm/sass-loader@12.4.0_webpack@5.65.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[5]!./style.scss */ "../../../node_modules/.pnpm/mini-css-extract-plugin@2.4.6_webpack@5.65.0/node_modules/mini-css-extract-plugin/dist/loader.js??ruleSet[1].rules[1].oneOf[8].use[1]!../../../node_modules/.pnpm/css-loader@6.5.1_webpack@5.65.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[2]!../../../node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.5+webpack@5.65.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[3]!../../../node_modules/.pnpm/resolve-url-loader@4.0.0/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[8].use[4]!../../../node_modules/.pnpm/sass-loader@12.4.0_webpack@5.65.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[8].use[5]!../src/mometa/runtime/components/more-button/style.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_pnpm_style_loader_3_3_1_webpack_5_65_0_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_pnpm_mini_css_extract_plugin_2_4_6_webpack_5_65_0_node_modules_mini_css_extract_plugin_dist_loader_js_ruleSet_1_rules_1_oneOf_8_use_1_node_modules_pnpm_css_loader_6_5_1_webpack_5_65_0_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_2_node_modules_pnpm_postcss_loader_6_2_1_postcss_8_4_5_webpack_5_65_0_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_3_node_modules_pnpm_resolve_url_loader_4_0_0_node_modules_resolve_url_loader_index_js_ruleSet_1_rules_1_oneOf_8_use_4_node_modules_pnpm_sass_loader_12_4_0_webpack_5_65_0_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_5_style_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_pnpm_mini_css_extract_plugin_2_4_6_webpack_5_65_0_node_modules_mini_css_extract_plugin_dist_loader_js_ruleSet_1_rules_1_oneOf_8_use_1_node_modules_pnpm_css_loader_6_5_1_webpack_5_65_0_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_2_node_modules_pnpm_postcss_loader_6_2_1_postcss_8_4_5_webpack_5_65_0_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_3_node_modules_pnpm_resolve_url_loader_4_0_0_node_modules_resolve_url_loader_index_js_ruleSet_1_rules_1_oneOf_8_use_4_node_modules_pnpm_sass_loader_12_4_0_webpack_5_65_0_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_5_style_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_pnpm_mini_css_extract_plugin_2_4_6_webpack_5_65_0_node_modules_mini_css_extract_plugin_dist_loader_js_ruleSet_1_rules_1_oneOf_8_use_1_node_modules_pnpm_css_loader_6_5_1_webpack_5_65_0_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_2_node_modules_pnpm_postcss_loader_6_2_1_postcss_8_4_5_webpack_5_65_0_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_3_node_modules_pnpm_resolve_url_loader_4_0_0_node_modules_resolve_url_loader_index_js_ruleSet_1_rules_1_oneOf_8_use_4_node_modules_pnpm_sass_loader_12_4_0_webpack_5_65_0_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_5_style_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_pnpm_mini_css_extract_plugin_2_4_6_webpack_5_65_0_node_modules_mini_css_extract_plugin_dist_loader_js_ruleSet_1_rules_1_oneOf_8_use_1_node_modules_pnpm_css_loader_6_5_1_webpack_5_65_0_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_2_node_modules_pnpm_postcss_loader_6_2_1_postcss_8_4_5_webpack_5_65_0_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_3_node_modules_pnpm_resolve_url_loader_4_0_0_node_modules_resolve_url_loader_index_js_ruleSet_1_rules_1_oneOf_8_use_4_node_modules_pnpm_sass_loader_12_4_0_webpack_5_65_0_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_oneOf_8_use_5_style_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ })

}]);
//# sourceMappingURL=src_module_render-floating_tsx.chunk.js.map