import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
import * as __WEBPACK_EXTERNAL_MODULE__block_provider_index_mjs__ from "../../../block-provider/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__ from "./useBaseVariable.mjs";
const useFormVariable = (param)=>{
    let { collectionName, collectionField, schema, noDisabled, targetFieldSchema } = param;
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const result = (0, __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__.useBaseVariable)({
        collectionField,
        uiSchema: schema,
        targetFieldSchema,
        maxDepth: 4,
        name: '$nForm',
        title: t('Current form'),
        collectionName: collectionName,
        noDisabled,
        returnFields: (fields, option)=>fields
    });
    return result;
};
const useCurrentFormVariable = function() {
    let { collectionField, schema, noDisabled, targetFieldSchema, form: _form } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const { form, collectionName } = (0, __WEBPACK_EXTERNAL_MODULE__block_provider_index_mjs__.useFormBlockContext)();
    const currentFormSettings = (0, __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__.useBaseVariable)({
        collectionField,
        uiSchema: schema,
        targetFieldSchema,
        maxDepth: 4,
        name: '$nForm',
        title: t('Current form'),
        collectionName: collectionName,
        noDisabled,
        returnFields: (fields, option)=>fields
    });
    const formInstance = _form || form;
    return {
        currentFormSettings,
        currentFormCtx: null == formInstance ? void 0 : formInstance.values,
        shouldDisplayCurrentForm: formInstance && !formInstance.readPretty
    };
};
export { useCurrentFormVariable, useFormVariable };
