public static function getParameters($component, $prepareParams = [], $arCurrentValues, $selectOnlyListed = false)
    {
        $additionalComponentParams = [];

        $componentParams = \CComponentUtil::GetComponentProps($component, $arCurrentValues);

        if ($componentParams === false)
        {
            throw new Main\LoaderException('Failed loading parameters for ' . $component);
        }

        if (!empty($prepareParams))
        {
            foreach ($componentParams['PARAMETERS'] as $code => &$params)
            {
                if ($prepareParams[$code]['DELETE'] || ($selectOnlyListed === true && !isset($prepareParams[$code])))
                {
                    unset($componentParams['PARAMETERS'][$code]);
                    continue;
                }

                if ($prepareParams[$code]['MOVE'])
                {
                    $params['PARENT'] = $prepareParams[$code]['MOVE'];
                }

                if ($prepareParams[$code]['NAME'])
                {
                    $params['NAME'] = $prepareParams[$code]['NAME'];
                }

                if ($prepareParams[$code]['RENAME'])
                {
                    $additionalComponentParams[$prepareParams[$code]['RENAME']] = $params;

                    unset($componentParams['PARAMETERS'][$code]);
                }
            }

            unset($params);

            $componentParams['PARAMETERS'] = array_replace_recursive($componentParams['PARAMETERS'], $additionalComponentParams);
        }

        return $componentParams;
    }