import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../../application/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__ from "../../../application/schema-settings/SchemaSettings.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__ from "../../../schema-component/antd/action/Action.Designer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__createSubmitActionSettings_mjs__ from "./createSubmitActionSettings.mjs";
const updateSubmitActionSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__.SchemaSettings({
    name: 'actionSettings:updateSubmit',
    items: [
        {
            name: 'editButton',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.ButtonEditor,
            useComponentProps () {
                const { buttonEditorProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
                return buttonEditorProps;
            }
        },
        {
            name: 'secondConfirmation',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.SecondConFirm
        },
        {
            name: 'afterSuccessfulSubmission',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.AfterSuccess
        },
        {
            name: 'workflowConfig',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.WorkflowConfig,
            useVisible () {
                var _fieldSchema_xactionsettings;
                const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
                return (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.isValid)(null == fieldSchema ? void 0 : null === (_fieldSchema_xactionsettings = fieldSchema['x-action-settings']) || void 0 === _fieldSchema_xactionsettings ? void 0 : _fieldSchema_xactionsettings.triggerWorkflows);
            }
        },
        {
            name: 'remove',
            sort: 100,
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.RemoveButton,
            useComponentProps () {
                const { removeButtonProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
                return removeButtonProps;
            }
        }
    ]
});
const submitActionSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__.SchemaSettings({
    name: 'actionSettings:submit',
    items: [
        {
            name: 'editButton',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.ButtonEditor,
            useComponentProps () {
                const { buttonEditorProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
                return buttonEditorProps;
            }
        },
        {
            name: 'secondConfirmation',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.SecondConFirm
        },
        {
            name: 'workflowConfig',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.WorkflowConfig,
            useVisible () {
                var _fieldSchema_xactionsettings;
                const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
                return (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.isValid)(null == fieldSchema ? void 0 : null === (_fieldSchema_xactionsettings = fieldSchema['x-action-settings']) || void 0 === _fieldSchema_xactionsettings ? void 0 : _fieldSchema_xactionsettings.triggerWorkflows);
            }
        },
        {
            name: 'saveMode',
            Component: __WEBPACK_EXTERNAL_MODULE__createSubmitActionSettings_mjs__.SaveMode,
            useVisible () {
                var _fieldSchema_parent;
                const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
                return 'submit' === fieldSchema['x-action'] && (null === (_fieldSchema_parent = fieldSchema.parent) || void 0 === _fieldSchema_parent ? void 0 : _fieldSchema_parent['x-initializer']) === 'createForm:configureActions';
            }
        },
        {
            name: 'remove',
            sort: 100,
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.RemoveButton,
            useComponentProps () {
                const { removeButtonProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
                return removeButtonProps;
            }
        }
    ]
});
export { submitActionSettings, updateSubmitActionSettings };
