"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    default: ()=>useLocalVariables_rslib_entry_
});
const external_react_namespaceObject = require("react");
const index_js_namespaceObject = require("../../data-source/index.js");
const useBlockCollection_js_namespaceObject = require("../../schema-settings/VariableInput/hooks/useBlockCollection.js");
const useDateVariable_js_namespaceObject = require("../../schema-settings/VariableInput/hooks/useDateVariable.js");
const useFormVariable_js_namespaceObject = require("../../schema-settings/VariableInput/hooks/useFormVariable.js");
const useIterationVariable_js_namespaceObject = require("../../schema-settings/VariableInput/hooks/useIterationVariable.js");
const useParentRecordVariable_js_namespaceObject = require("../../schema-settings/VariableInput/hooks/useParentRecordVariable.js");
const usePopupVariable_js_namespaceObject = require("../../schema-settings/VariableInput/hooks/usePopupVariable.js");
const useRecordVariable_js_namespaceObject = require("../../schema-settings/VariableInput/hooks/useRecordVariable.js");
const useLocalVariables = (props)=>{
    const { currentObjectCtx, shouldDisplayCurrentObject } = (0, useIterationVariable_js_namespaceObject.useCurrentObjectVariable)();
    const { currentRecordCtx, collectionName: collectionNameOfRecord } = (0, useRecordVariable_js_namespaceObject.useCurrentRecordVariable)();
    const { popupRecordCtx, collectionName: collectionNameOfPopupRecord } = (0, usePopupVariable_js_namespaceObject.usePopupVariable)();
    const { currentParentRecordCtx, collectionName: collectionNameOfParentRecord } = (0, useParentRecordVariable_js_namespaceObject.useCurrentParentRecordVariable)();
    const { datetimeCtx } = (0, useDateVariable_js_namespaceObject.useDatetimeVariable)();
    const { currentFormCtx } = (0, useFormVariable_js_namespaceObject.useCurrentFormVariable)({
        form: null == props ? void 0 : props.currentForm
    });
    const collection = (0, index_js_namespaceObject.useCollection)();
    let { name } = (0, useBlockCollection_js_namespaceObject.useBlockCollection)();
    if (null == props ? void 0 : props.collectionName) name = props.collectionName;
    return (0, external_react_namespaceObject.useMemo)(()=>[
            {
                name: '$nRecord',
                ctx: currentRecordCtx,
                collectionName: collectionNameOfRecord
            },
            {
                name: '$nParentRecord',
                ctx: currentParentRecordCtx,
                collectionName: collectionNameOfParentRecord
            },
            {
                name: '$nPopupRecord',
                ctx: popupRecordCtx,
                collectionName: collectionNameOfPopupRecord
            },
            {
                name: '$nForm',
                ctx: currentFormCtx,
                collectionName: name
            },
            {
                name: '$nDate',
                ctx: datetimeCtx
            },
            shouldDisplayCurrentObject && {
                name: '$iteration',
                ctx: currentObjectCtx,
                collectionName: null == collection ? void 0 : collection.name
            }
        ].filter(Boolean), [
        currentRecordCtx,
        collectionNameOfRecord,
        name,
        currentFormCtx,
        currentParentRecordCtx,
        collectionNameOfParentRecord,
        popupRecordCtx,
        collectionNameOfPopupRecord,
        datetimeCtx,
        shouldDisplayCurrentObject,
        currentObjectCtx,
        null == collection ? void 0 : collection.name
    ]);
};
const useLocalVariables_rslib_entry_ = useLocalVariables;
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
