import { isBreakpointsForPrefixType, isFlexWrapType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { FlexWrap } from '../../../constants/ui';
import { ResponsiveClassStringFormatter } from './responsive-class-string-formatter';
/**
 * A class for format FlexWrapType with BreakpointsForPrefixType to CSS class string
 *
 * @augments ResponsiveClassStringFormatter
 */
class ResponsiveFlexWrapFormatter extends ResponsiveClassStringFormatter {
  /**
   * This function takes a FlexWrapType and a breakpoint and returns CSS class string.
   *
   * @param {FlexWrapType} input - FlexWrapType input
   * @param {BreakpointsForPrefixType} [breakpoint] - Breakpoints for prefix of the class
   * @returns {string} - A string.
   */
  formatToken(input, breakpoint) {
    const prefix = isBreakpointsForPrefixType(breakpoint) ? `${breakpoint}:` : '';
    if (isFlexWrapType(input)) {
      return `${prefix}v-flex-${input}`;
    }
    else {
      LogUtility.warn(`The flex flexWrap value ${input} is invalid, it must be a value of: `, FlexWrap);
      return '';
    }
  }
}
export default new ResponsiveFlexWrapFormatter();
