"use strict";
var __webpack_require__ = {};
(()=>{
    __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__, {
    pageTabSettings: ()=>pageTabSettings
});
const external_antd_namespaceObject = require("antd");
const external_react_i18next_namespaceObject = require("react-i18next");
const SchemaSettings_js_namespaceObject = require("../../../application/schema-settings/SchemaSettings.js");
const index_js_namespaceObject = require("../../../application/schema-toolbar/index.js");
const external_hooks_index_js_namespaceObject = require("../../hooks/index.js");
const pageTabSettings = new SchemaSettings_js_namespaceObject.SchemaSettings({
    name: 'PageTabSettings',
    items: [
        {
            name: 'edit',
            type: 'modal',
            useComponentProps () {
                const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
                const { schema } = (0, index_js_namespaceObject.useSchemaToolbar)();
                const { dn } = (0, external_hooks_index_js_namespaceObject.useDesignable)();
                return {
                    title: t('Edit'),
                    schema: {
                        type: 'object',
                        title: t('Edit tab'),
                        properties: {
                            title: {
                                title: t('Tab name'),
                                required: true,
                                'x-decorator': 'FormItem',
                                'x-component': 'Input',
                                'x-component-props': {}
                            },
                            icon: {
                                title: t('Icon'),
                                'x-decorator': 'FormItem',
                                'x-component': 'IconPicker',
                                'x-component-props': {}
                            }
                        }
                    },
                    initialValues: {
                        title: schema.title,
                        icon: schema['x-icon']
                    },
                    onSubmit: (param)=>{
                        let { title, icon } = param;
                        schema.title = title;
                        schema['x-icon'] = icon;
                        dn.emit('patch', {
                            schema: {
                                ['x-uid']: schema['x-uid'],
                                title,
                                'x-icon': icon
                            }
                        });
                        dn.refresh();
                    }
                };
            }
        },
        {
            name: 'divider',
            type: 'divider'
        },
        {
            name: 'delete',
            type: 'item',
            useComponentProps () {
                const { modal } = external_antd_namespaceObject.App.useApp();
                const { dn } = (0, external_hooks_index_js_namespaceObject.useDesignable)();
                const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
                const { schema } = (0, index_js_namespaceObject.useSchemaToolbar)();
                return {
                    title: t('Delete'),
                    eventKey: 'remove',
                    onClick () {
                        modal.confirm({
                            title: t('Delete block'),
                            content: t('Are you sure you want to delete it?'),
                            ...confirm,
                            onOk () {
                                dn.remove(schema);
                            }
                        });
                    },
                    children: t('Delete')
                };
            }
        }
    ]
});
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
});
