'use strict';
import { isArray } from '../../../../fd-toolbox/types/ensure-type.js';
import { getCellItem } from '../services/table-private-cell.js';
import { getResourceImageDescription } from '../../core/resource-description/resource-description.js';
import { getOptionalPropertyValue } from '../../../../fd-toolbox/objects/property-value.js';

var __defProp=Object['defineProperty'],__name=(_0x265ba1,_0xe96bb9)=>__defProp(_0x265ba1,'name',{'value':_0xe96bb9,'configurable':!![]});async function initBodyCellTooltip(_0x405cb4,_0x5180c7){const _0x18f198=getCellItem(_0x405cb4['row']['item'],_0x405cb4['internalTableColumn']['expandInfo']),_0x19995e=_0x405cb4['internalTableColumn']['expandInfo']?.['resourceMeta'];if(_0x18f198&&isArray(_0x18f198)&&_0x19995e)await handleArrayResource(_0x18f198,_0x19995e,_0x5180c7);else {if(_0x18f198&&!isArray(_0x18f198)&&_0x19995e)await handleSingleResource(_0x18f198,_0x19995e,_0x5180c7);else !_0x19995e&&handlePrimitiveValue(_0x405cb4,_0x5180c7);}}__name(initBodyCellTooltip,'initBodyCellTooltip');async function handleArrayResource(_0xaf148f,_0x4a5f08,_0x1283f5){const _0x350340=[];for(const _0x1dda83 of _0xaf148f){const _0x19678c=await getResourceImageDescription(_0x4a5f08,_0x1dda83);_0x19678c&&_0x350340['push'](_0x19678c['value']);}_0x350340['length']>0x1ad2*-0x1+-0x2069*-0x1+0x1*-0x597&&_0x1283f5(_0x350340);}__name(handleArrayResource,'handleArrayResource');async function handleSingleResource(_0x2e7718,_0x16bdf7,_0x292bfc){const _0x63c669=await getResourceImageDescription(_0x16bdf7,_0x2e7718);_0x63c669&&_0x292bfc([_0x63c669['value']]);}__name(handleSingleResource,'handleSingleResource');function handlePrimitiveValue(_0x11485e,_0x5f7c0d){const _0x147631=_0x11485e['internalTableColumn']['itemPropertyName'];if(!_0x147631)return;const _0x1a80ec=getOptionalPropertyValue(_0x11485e['row']['item'],_0x147631);_0x1a80ec&&_0x5f7c0d([String(_0x1a80ec)]);}__name(handlePrimitiveValue,'handlePrimitiveValue');

export { initBodyCellTooltip };
