'use strict';
import { searchProps } from '../../common/resources/search.resource.js';
import { logErrorRaw } from '../../../fd-toolbox/logging/loggers.js';
import { createError } from '../../../fd-toolbox/errors/errors.js';
import { searchAcrossResources } from '../../meta/server/meta-core/crud/search.js';
import { getFilterValue } from '../../meta/server/api/odata/odata-filters.js';
import { searchErrors } from '../../meta/constants/search-constants.js';

var __defProp=Object['defineProperty'],__name=(_0xc31dff,_0x573e12)=>__defProp(_0xc31dff,'name',{'value':_0x573e12,'configurable':!![]});async function get(_0x35a9ad){const _0x19a321=getFilterValue(_0x35a9ad,searchProps['searchQuery']);let _0x197c4a=[];if(!_0x19a321)logErrorRaw(createError(searchErrors['searchQueryRequired']));else {const _0x5d0a49=getFilterValue(_0x35a9ad,searchProps['resourceNames']),_0x57d3c5=_0x5d0a49?.['slice'](-0x163d*0x1+-0xe09+-0x1*-0x2447,-(0x2503*-0x1+0x8b8+0x1c4c))['split'](',');!_0x57d3c5?logErrorRaw(createError(searchErrors['resourceNamesRequired'])):_0x197c4a=await searchAcrossResources(_0x19a321,_0x57d3c5);}return _0x197c4a;}__name(get,'get');

export { get as getSearch };
