import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { element } from 'ember-element-helper';
import { eq } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';

const EuiFlexItem = setComponentTemplate(precompileTemplate(`
  {{#let (argOrDefault @tagName "div") as |tagName|}}
    {{#if (eq tagName "div")}}
      <div
        class={{classNames componentName="EuiFlexItem" grow=@grow}}
        ...attributes
      >
        {{yield}}
      </div>
    {{else if (eq tagName "span")}}
      <span
        class={{classNames componentName="EuiFlexItem" grow=@grow}}
        ...attributes
      >
        {{yield}}
      </span>
    {{else}}
      {{#let (element tagName) as |TagElement|}}
        <TagElement
          class={{classNames componentName="EuiFlexItem" grow=@grow}}
          ...attributes
        >
          {{yield}}
        </TagElement>
      {{/let}}
    {{/if}}
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    eq,
    classNames,
    element
  })
}), templateOnly("eui-flex-item", "EuiFlexItem"));

export { EuiFlexItem as default };
//# sourceMappingURL=eui-flex-item.js.map
