/**
 * @since Last modified: 2024-01-18 16:17:08
 * @function elState
 * @description Determine the state of the node.
 * @param {getEl} elem - Node or node selector.
 * @returns  {object} - Return state object,include properties:isExist,isVirtual,isHidden and isUncalc.
 * @see {@link https://codepen.io/axui/pen/PoVxWrd|demo @ codepen}
 * @example
 * ax.elState('#demo');
 * <!--return { isExist:true, isVirtual:true, isHidden:false, isCalc:false,isUncalc: true }-->
 */
'use strict';
import getEl from './getEl';
const elState = (elem: any) => {
    let dom = getEl(elem),
        style = getComputedStyle(elem),
        isExist = dom ? true : false,
        isVirtual = isExist && !style.display,
        isHidden = isExist && (style.display === 'none' || style.visibility === 'hidden'),
        isCalc = isExist && style.display && style.display !== 'none',
        isVisible = isCalc && style.visibility === 'visible';
    return { isExist, isVirtual, isHidden, isVisible, isCalc, isUncalc: !isExist || isVirtual || isHidden }
}
export default elState;
