import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../../../application/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_initializer_items_DataBlockInitializer_mjs__ from "../../../../schema-initializer/items/DataBlockInitializer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__createFilterCollapseBlockSchema_mjs__ from "./createFilterCollapseBlockSchema.mjs";
const FilterCollapseBlockInitializer = (param)=>{
    let { filterCollections, onlyCurrentDataSource, hideChildrenIfSingleCollection } = param;
    const itemConfig = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaInitializerItem)();
    const { insert } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaInitializer)();
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_initializer_items_DataBlockInitializer_mjs__.DataBlockInitializer, {
        ...itemConfig,
        onlyCurrentDataSource: onlyCurrentDataSource,
        icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.TableOutlined, {}),
        componentType: 'FilterCollapse',
        onCreateBlockSchema: async (param)=>{
            let { item } = param;
            const schema = (0, __WEBPACK_EXTERNAL_MODULE__createFilterCollapseBlockSchema_mjs__.createCollapseBlockSchema)({
                dataSource: item.dataSource,
                collectionName: item.collectionName || item.name,
                blockType: 'filter'
            });
            insert(schema);
        },
        filter: filterCollections,
        hideChildrenIfSingleCollection: hideChildrenIfSingleCollection
    });
};
export { FilterCollapseBlockInitializer };
