import * as __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__ from "../../../../application/schema-initializer/SchemaInitializer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__ from "../../../../data-source/index.mjs";
const useVisibleCollection = ()=>{
    const collection = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollection)();
    return ('view' !== collection.template || (null == collection ? void 0 : collection.writableView)) && 'sql' !== collection.template;
};
const readPrettyFormActionInitializers = new __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__.SchemaInitializer({
    name: 'details:configureActions',
    title: '{{t("Configure actions")}}',
    icon: 'SettingOutlined',
    style: {
        marginLeft: 8
    },
    items: [
        {
            type: 'itemGroup',
            name: 'enableActions',
            title: '{{t("Enable actions")}}',
            children: [
                {
                    title: '{{t("Edit")}}',
                    name: 'edit',
                    Component: 'UpdateActionInitializer',
                    schema: {
                        'x-component': 'Action',
                        'x-decorator': 'ACLActionProvider',
                        'x-component-props': {
                            type: 'primary'
                        }
                    },
                    useVisible: useVisibleCollection
                },
                {
                    title: '{{t("Delete")}}',
                    name: 'delete',
                    Component: 'DestroyActionInitializer',
                    schema: {
                        'x-component': 'Action',
                        'x-decorator': 'ACLActionProvider'
                    },
                    useVisible: useVisibleCollection
                }
            ]
        },
        {
            name: 'divider',
            type: 'divider'
        },
        {
            type: 'subMenu',
            name: 'customize',
            title: '{{t("Customize")}}',
            children: [
                {
                    name: 'popup',
                    title: '{{t("Popup")}}',
                    Component: 'PopupActionInitializer',
                    useComponentProps () {
                        return {
                            'x-component': 'Action'
                        };
                    }
                },
                {
                    name: 'updateRecord',
                    title: '{{t("Update record")}}',
                    Component: 'UpdateRecordActionInitializer',
                    useComponentProps () {
                        return {
                            'x-component': 'Action'
                        };
                    },
                    useVisible: useVisibleCollection
                },
                {
                    name: 'customRequest',
                    title: '{{t("Custom request")}}',
                    Component: 'CustomRequestInitializer',
                    useVisible: useVisibleCollection
                }
            ]
        }
    ]
});
export { readPrettyFormActionInitializers };
