"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__, {
    useCollectionField_deprecated: ()=>useCollectionField_deprecated
});
const index_js_namespaceObject = require("../../api-client/index.js");
const CollectionFieldProvider_js_namespaceObject = require("../../data-source/collection-field/CollectionFieldProvider.js");
const external_record_provider_index_js_namespaceObject = require("../../record-provider/index.js");
const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
const external_useCollection_deprecated_js_namespaceObject = require("./useCollection_deprecated.js");
const useCollectionField_deprecated = ()=>{
    const collection = (0, external_useCollection_deprecated_js_namespaceObject.useCollection_deprecated)();
    const record = (0, external_record_provider_index_js_namespaceObject.useRecord)();
    const api = (0, index_js_namespaceObject.useAPIClient)();
    const compile = (0, external_schema_component_index_js_namespaceObject.useCompile)();
    const ctx = (0, CollectionFieldProvider_js_namespaceObject.useCollectionField)();
    if (!ctx) return {};
    const resourceName = "".concat((null == ctx ? void 0 : ctx.collectionName) || (null == collection ? void 0 : collection.name), ".").concat(ctx.name);
    const resource = null == api ? void 0 : api.resource(resourceName, record[ctx.sourceKey]);
    return {
        ...ctx,
        uiSchema: compile(ctx.uiSchema),
        resource
    };
};
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
});
