import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
import * as __WEBPACK_EXTERNAL_MODULE__data_source_data_source_DataSourceManager_mjs__ from "../../../data-source/data-source/DataSourceManager.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__user_index_mjs__ from "../../../user/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__ from "./useBaseVariable.mjs";
const useUserVariable = (param)=>{
    let { collectionField, uiSchema, noDisabled, targetFieldSchema, maxDepth = 3 } = param;
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const result = (0, __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__.useBaseVariable)({
        collectionField,
        uiSchema,
        maxDepth,
        name: '$user',
        title: t('Current user'),
        collectionName: 'users',
        dataSource: __WEBPACK_EXTERNAL_MODULE__data_source_data_source_DataSourceManager_mjs__.DEFAULT_DATA_SOURCE_KEY,
        noDisabled,
        targetFieldSchema
    });
    return result;
};
const useCurrentUserVariable = function() {
    let { collectionField, uiSchema, noDisabled, targetFieldSchema, maxDepth = 3 } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    var _data_data;
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const data = (0, __WEBPACK_EXTERNAL_MODULE__user_index_mjs__.useCurrentUserContext)();
    const currentUserSettings = (0, __WEBPACK_EXTERNAL_MODULE__useBaseVariable_mjs__.useBaseVariable)({
        collectionField,
        uiSchema,
        maxDepth,
        name: '$user',
        title: t('Current user'),
        collectionName: 'users',
        noDisabled,
        targetFieldSchema
    });
    return {
        currentUserSettings,
        currentUserCtx: null == data ? void 0 : null === (_data_data = data.data) || void 0 === _data_data ? void 0 : _data_data.data
    };
};
export { useCurrentUserVariable, useUserVariable };
