"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getGuidelineTypeFromKey = void 0;
/**
 * Returns the type of guideline based on a guideline key and a collection of guidelines
 */
var getGuidelineTypeFromKey = exports.getGuidelineTypeFromKey = function getGuidelineTypeFromKey(keys, guidelines) {
  if (guidelines.length === 0) {
    return 'none';
  }

  // Check for default guidelines on key
  if (keys.some(function (key) {
    return ['grid_', 'wide_', 'full_width'].some(function (defaultGuideline) {
      return key.indexOf(defaultGuideline) >= 0;
    });
  })) {
    return 'default';
  }

  // Check for temporary guidelines
  if (keys.some(function (key) {
    return ['media_'].some(function (temoporaryGuideline) {
      return key.indexOf(temoporaryGuideline) >= 0;
    });
  })) {
    return 'temporary';
  }

  // Check for relative guidelines
  if (keys.some(function (key) {
    return ['relative_'].some(function (relativeGuideline) {
      return key.indexOf(relativeGuideline) >= 0;
    });
  })) {
    return 'relative';
  }
  return 'none';
};