import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__ from "react-hotkeys-hook";
import * as __WEBPACK_EXTERNAL_MODULE__icon_index_mjs__ from "../../icon/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../schema-component/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__context_menu_index_mjs__ from "../context-menu/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__ai_chat_index_mjs__ from "./ai-chat/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__calculator_CalculatorProvider_mjs__ from "./calculator/CalculatorProvider.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__search_and_jump_index_mjs__ from "./search-and-jump/index.mjs";
const AssistantProvider = (param)=>{
    let { children } = param;
    const { designable, setDesignable } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
    const { visible, setVisible } = (0, __WEBPACK_EXTERNAL_MODULE__calculator_CalculatorProvider_mjs__.useCalculator)();
    const { setOpen } = (0, __WEBPACK_EXTERNAL_MODULE__search_and_jump_index_mjs__.useSearchAndJump)();
    const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
    (0, __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__.useHotkeys)('Ctrl+Shift+U', ()=>setDesignable(!designable), [
        designable
    ]);
    (0, __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__.useHotkeys)('Ctrl+K', ()=>setOpen((open)=>!open), []);
    (0, __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__.useHotkeys)('Cmd+K', ()=>setOpen((open)=>!open), []);
    const { contextMenuEnabled, setContextMenuEnable } = (0, __WEBPACK_EXTERNAL_MODULE__context_menu_index_mjs__.useContextMenu)();
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
        children: [
            children,
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ai_chat_index_mjs__["default"], {
                mRef: ref,
                onGenerateLoad: async (msg)=>true,
                onReloadWrite: ()=>{}
            }),
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton.Group, {
                trigger: "hover",
                type: "default",
                style: {
                    right: 24,
                    zIndex: 1250
                },
                icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.ToolOutlined, {}),
                children: [
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
                        icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.SearchOutlined, {}),
                        onClick: ()=>setOpen(true)
                    }),
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
                        icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__icon_index_mjs__.Icon, {
                            type: "Design"
                        }),
                        type: designable ? 'primary' : 'default',
                        onClick: ()=>setDesignable(!designable)
                    }),
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
                        type: visible ? 'primary' : 'default',
                        icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.CalculatorOutlined, {}),
                        onClick: ()=>{
                            setVisible((visible)=>!visible);
                        }
                    }),
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
                        icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.CommentOutlined, {}),
                        onClick: ()=>{
                            var _ref_current;
                            null === (_ref_current = ref.current) || void 0 === _ref_current || _ref_current.openModal();
                        }
                    }),
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
                        type: contextMenuEnabled ? 'primary' : 'default',
                        icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.ToolOutlined, {
                            onClick: ()=>setContextMenuEnable(!contextMenuEnabled)
                        })
                    })
                ]
            })
        ]
    });
};
export { AssistantProvider };
