import { helper } from '@ember/component/helper';
import { assert } from '@ember/debug';
import mapping from '../utils/css-mappings/index.js';

function inlineStyles(_, params) {
  const {
    componentName,
    componentArgs = {},
    ...properties
  } = params;
  let componentStyles = {};
  if (componentName) {
    assert(`Could not find component ${componentName} in cssMappings.`, mapping[componentName]);
    assert(`Could not find inlineStyles in ${componentName}'s cssMapping.`, mapping[componentName]?.inlineStyles);
    componentStyles = mapping[componentName]?.inlineStyles?.(componentArgs) || {};
  }
  let finalProperties = {
    ...properties,
    ...componentStyles
  };
  for (let property in finalProperties) {
    if (property === 'background-image' && finalProperties[property] !== 'none') {
      finalProperties[property] = `url(${finalProperties[property]})`;
    } else {
      finalProperties[property] = `${finalProperties[property]}`;
    }
  }
  return finalProperties;
}
var inlineStyles$1 = helper(inlineStyles);

export { inlineStyles$1 as default, inlineStyles };
//# sourceMappingURL=inline-styles.js.map
