"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__, {
    useOperatorList: ()=>useOperatorList
});
const external_react_namespaceObject = require("react");
const schema_namespaceObject = require("@tachybase/schema");
const index_js_namespaceObject = require("../../../collection-manager/index.js");
const useOperatorList = ()=>{
    const schema = (0, schema_namespaceObject.useFieldSchema)();
    const { name } = (0, index_js_namespaceObject.useCollection_deprecated)();
    const { getCollectionFields, getInterface } = (0, index_js_namespaceObject.useCollectionManager_deprecated)();
    const res = (0, external_react_namespaceObject.useMemo)(()=>{
        var _schema_xdesignerprops, _getInterface_filterable, _getInterface;
        const fieldInterface = null === (_schema_xdesignerprops = schema['x-designer-props']) || void 0 === _schema_xdesignerprops ? void 0 : _schema_xdesignerprops.interface;
        const collectionFields = getCollectionFields(name);
        if (fieldInterface) {
            var _getInterface_filterable1, _getInterface1;
            return (null === (_getInterface1 = getInterface(fieldInterface)) || void 0 === _getInterface1 ? void 0 : null === (_getInterface_filterable1 = _getInterface1.filterable) || void 0 === _getInterface_filterable1 ? void 0 : _getInterface_filterable1.operators) || [];
        }
        const field = collectionFields.find((item)=>item.name === schema.name);
        return (null === (_getInterface = getInterface(null == field ? void 0 : field.interface)) || void 0 === _getInterface ? void 0 : null === (_getInterface_filterable = _getInterface.filterable) || void 0 === _getInterface_filterable ? void 0 : _getInterface_filterable.operators) || [];
    }, [
        schema.name
    ]);
    return res;
};
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
});
