"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = function(module) {
        var getter = module && module.__esModule ? function() {
            return module['default'];
        } : function() {
            return module;
        };
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    AssistantProvider: ()=>AssistantProvider
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_react_namespaceObject = require("react");
const icons_namespaceObject = require("@ant-design/icons");
const external_antd_namespaceObject = require("antd");
const external_react_hotkeys_hook_namespaceObject = require("react-hotkeys-hook");
const index_js_namespaceObject = require("../../icon/index.js");
const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
const external_context_menu_index_js_namespaceObject = require("../context-menu/index.js");
const external_ai_chat_index_js_namespaceObject = require("./ai-chat/index.js");
var external_ai_chat_index_js_default = /*#__PURE__*/ __webpack_require__.n(external_ai_chat_index_js_namespaceObject);
const CalculatorProvider_js_namespaceObject = require("./calculator/CalculatorProvider.js");
const external_search_and_jump_index_js_namespaceObject = require("./search-and-jump/index.js");
const AssistantProvider = (param)=>{
    let { children } = param;
    const { designable, setDesignable } = (0, external_schema_component_index_js_namespaceObject.useDesignable)();
    const { visible, setVisible } = (0, CalculatorProvider_js_namespaceObject.useCalculator)();
    const { setOpen } = (0, external_search_and_jump_index_js_namespaceObject.useSearchAndJump)();
    const ref = (0, external_react_namespaceObject.useRef)();
    (0, external_react_hotkeys_hook_namespaceObject.useHotkeys)('Ctrl+Shift+U', ()=>setDesignable(!designable), [
        designable
    ]);
    (0, external_react_hotkeys_hook_namespaceObject.useHotkeys)('Ctrl+K', ()=>setOpen((open)=>!open), []);
    (0, external_react_hotkeys_hook_namespaceObject.useHotkeys)('Cmd+K', ()=>setOpen((open)=>!open), []);
    const { contextMenuEnabled, setContextMenuEnable } = (0, external_context_menu_index_js_namespaceObject.useContextMenu)();
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
        children: [
            children,
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ai_chat_index_js_default(), {
                mRef: ref,
                onGenerateLoad: async (msg)=>true,
                onReloadWrite: ()=>{}
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.FloatButton.Group, {
                trigger: "hover",
                type: "default",
                style: {
                    right: 24,
                    zIndex: 1250
                },
                icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ToolOutlined, {}),
                children: [
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
                        icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.SearchOutlined, {}),
                        onClick: ()=>setOpen(true)
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
                        icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.Icon, {
                            type: "Design"
                        }),
                        type: designable ? 'primary' : 'default',
                        onClick: ()=>setDesignable(!designable)
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
                        type: visible ? 'primary' : 'default',
                        icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CalculatorOutlined, {}),
                        onClick: ()=>{
                            setVisible((visible)=>!visible);
                        }
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
                        icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CommentOutlined, {}),
                        onClick: ()=>{
                            var _ref_current;
                            null === (_ref_current = ref.current) || void 0 === _ref_current || _ref_current.openModal();
                        }
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
                        type: contextMenuEnabled ? 'primary' : 'default',
                        icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ToolOutlined, {
                            onClick: ()=>setContextMenuEnable(!contextMenuEnabled)
                        })
                    })
                ]
            })
        ]
    });
};
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
