'use strict';
import { elements } from '../../../fd-toolbox/constants/elements.js';
import { resourceListViewModes } from '../../../fd-toolbox/enums/enums.js';
import { filterListOrientations } from '../filtering/filter-list-positions.js';
import { ResourceList } from './ResourceList.js';
import { isValidElement } from 'react';
import { jsBasicTypes } from '../../../base-repo/constants/basic-types.js';
import { commonLowerCaseWords } from '../../../base-repo/constants/internal-common-strings.js';

var __defProp=Object['defineProperty'],__name=(_0x53192b,_0x385c2e)=>__defProp(_0x53192b,'name',{'value':_0x385c2e,'configurable':!![]});const layoutSlots={'resourceFilterList':'ResourceFilterListSlot','tableOrCardList':'TableOrCardListSlot'};const reactComponentTypePropertyNames={'name':commonLowerCaseWords['name']};function getResourceListId(_0x3f6e9c){return _0x3f6e9c+ResourceList['displayName'];}__name(getResourceListId,'getResourceListId');function convertODataFilterArrayToIndexedObject(_0xdb837f){if(!_0xdb837f)return {};const _0x2bc3d8={};for(const _0x197ddb of _0xdb837f){_0x197ddb['leftSide']&&(_0x2bc3d8[_0x197ddb['leftSide']]=_0x197ddb);}return _0x2bc3d8;}__name(convertODataFilterArrayToIndexedObject,'convertODataFilterArrayToIndexedObject');function getInitialFiltersToUse(_0x310310,_0x297bb0){return _0x310310??convertODataFilterArrayToIndexedObject(_0x297bb0);}__name(getInitialFiltersToUse,'getInitialFiltersToUse');function isFilterListOrientationVertical(_0x1ce26c){return _0x1ce26c['resourceFilterListConfig']?.['orientation']===filterListOrientations['vertical'];}__name(isFilterListOrientationVertical,'isFilterListOrientationVertical');function shouldDisplayCardList(_0x197f2b){return _0x197f2b===resourceListViewModes['cards'];}__name(shouldDisplayCardList,'shouldDisplayCardList');function getResourceListTableId(_0x3e6d15){return elements['resourceList']['resourceListId']+_0x3e6d15+elements['table']['tableElementId'];}__name(getResourceListTableId,'getResourceListTableId');function shouldDisplayFilterList(_0x46a338,_0x3ed10b,_0x1109a4){return _0x46a338&&_0x3ed10b&&!_0x1109a4;}__name(shouldDisplayFilterList,'shouldDisplayFilterList');function isResourceListDropdownMenuVisible(_0x25fda7,_0x337b0a){return !!_0x25fda7&&!!_0x337b0a;}__name(isResourceListDropdownMenuVisible,'isResourceListDropdownMenuVisible');function getLayoutItemKey(_0x2fd766){const _0x126c9c=_0x2fd766['elements']['map'](_0x56252e=>{let _0x15f578='layout-item';typeof _0x56252e===jsBasicTypes['string']&&(_0x15f578=String(_0x56252e));if(isValidElement(_0x56252e)){if(typeof _0x56252e['key']===jsBasicTypes['string'])_0x15f578=String(_0x56252e['key']);else {if(typeof _0x56252e['key']===jsBasicTypes['number']||typeof _0x56252e['key']===jsBasicTypes['bigint'])_0x15f578=''+_0x56252e['key'];else {if(typeof _0x56252e['type']==='string')_0x15f578=_0x56252e['type'];else {if('displayName'in _0x56252e['type']&&typeof _0x56252e['type']['displayName']===jsBasicTypes['string'])_0x15f578=String(_0x56252e['type']['displayName']);else reactComponentTypePropertyNames['name']in _0x56252e['type']&&typeof _0x56252e['type']['name']===jsBasicTypes['string']&&(_0x15f578=_0x56252e['type']['name']);}}}}return _0x15f578;});return [_0x2fd766['name'],_0x2fd766['className'],_0x2fd766['priority']?.['toString'](),..._0x126c9c]['filter'](Boolean)['join']('_');}__name(getLayoutItemKey,'getLayoutItemKey');

export { convertODataFilterArrayToIndexedObject, getInitialFiltersToUse, getLayoutItemKey, getResourceListId, getResourceListTableId, isFilterListOrientationVertical, isResourceListDropdownMenuVisible, layoutSlots, shouldDisplayCardList, shouldDisplayFilterList };
