import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_components_SchemaInitializerChildren_mjs__ from "../../application/schema-initializer/components/SchemaInitializerChildren.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__ from "../../application/schema-initializer/SchemaInitializer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../schema-component/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__utils_mjs__ from "../utils.mjs";
const ParentCollectionFields = ()=>{
    const inheritFields = (0, __WEBPACK_EXTERNAL_MODULE__utils_mjs__.useInheritsFormItemInitializerFields)({
        component: 'AssignedField'
    });
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const compile = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
    if (!(null == inheritFields ? void 0 : inheritFields.length)) return null;
    const res = [];
    inheritFields.forEach((inherit)=>{
        Object.values(inherit)[0].length && res.push({
            type: 'itemGroup',
            divider: true,
            title: t("Parent collection fields") + '(' + compile("".concat(Object.keys(inherit)[0])) + ')',
            children: Object.values(inherit)[0]
        });
    });
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_initializer_components_SchemaInitializerChildren_mjs__.SchemaInitializerChildren, {
        children: res
    });
};
const customFormItemInitializers = new __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__.SchemaInitializer({
    name: 'assignFieldValuesForm:configureFields',
    wrap: __WEBPACK_EXTERNAL_MODULE__utils_mjs__.gridRowColWrap,
    icon: 'SettingOutlined',
    title: '{{t("Configure fields")}}',
    items: [
        {
            type: 'itemGroup',
            title: '{{t("Configure fields")}}',
            name: 'configureFields',
            useChildren: __WEBPACK_EXTERNAL_MODULE__utils_mjs__.useCustomFormItemInitializerFields
        },
        {
            name: 'parentCollectionFields',
            Component: ParentCollectionFields
        }
    ]
});
export { customFormItemInitializers };
