'use strict';
import { searchResultParams } from '../../../fd-toolbox/constants/search-result-constants.js';
import { getSearchableResourceResults, getSearchScreensResult } from './search-result.js';
import { apiOkResponse } from '../../meta/server/web/responses.js';
import { isPromiseFulfilled } from '../../../fd-toolbox/lib/utils.js';

var __defProp=Object['defineProperty'],__name=(_0x243ae7,_0xc1ba28)=>__defProp(_0x243ae7,'name',{'value':_0xc1ba28,'configurable':!![]});async function getSearchResultRoute(_0xa87627){const _0x1786b6=new URL(_0xa87627['url']),_0x40135b=_0x1786b6['searchParams']['get'](searchResultParams['querySearch'])??'',_0x1f9cc2=_0x1786b6['searchParams']['get'](searchResultParams['filterSearch']),_0x5afa73=_0x1f9cc2?_0x1f9cc2['split'](','):[],_0x54aba8=getSearchableResourceResults(_0x40135b,_0x5afa73),_0x34d114=getSearchScreensResult(_0x40135b,_0x5afa73),[_0xe053b7,_0x576120]=await Promise['allSettled']([_0x54aba8,_0x34d114]);return apiOkResponse({'searchableResources':isPromiseFulfilled(_0xe053b7)?_0xe053b7['value']:[],'screens':isPromiseFulfilled(_0x576120)?_0x576120['value']:[]});}__name(getSearchResultRoute,'getSearchResultRoute');

export { getSearchResultRoute };
