text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.messages = exports.ruleName = undefined;
  
  exports.default = function (expectation) {
    return function (root, result) {
      var validOptions = (0, _utils.validateOptions)(result, ruleName, {
        actual: expectation,
        possible: ["lower", "upper"]
      });
      if (!validOptions) {
        return;
      }
  
      root.walkAtRules(/^media$/i, function (atRule) {
        (0, _postcssMediaQueryParser2.default)(atRule.params).walk(/^media-feature$/i, function (mediaFeatureNode) {
          var parent = mediaFeatureNode.parent,
              sourceIndex = mediaFeatureNode.sourceIndex,
              value = mediaFeatureNode.value;
  
  
          if ((0, _utils.isRangeContextMediaFeature)(parent.value) || !(0, _utils.isStandardSyntaxMediaFeatureName)(value) || (0, _utils.isCustomMediaQuery)(value)) {
            return;
          }
  
          var expectedFeatureName = expectation === "lower" ? value.toLowerCase() : value.toUpperCase();
  
          if (value === expectedFeatureName) {
            return;
          }
  
          (0, _utils.report)({
            index: (0, _utils.atRuleParamIndex)(atRule) + sourceIndex,
            message: messages.expected(value, expectedFeatureName),
            node: atRule,
            ruleName: ruleName,
            result: result
          });
        });
      });
    };
  };
  
  var _utils = require("../../utils");
  
  var _postcssMediaQueryParser = require("postcss-media-query-parser");
  
  var _postcssMediaQueryParser2 = _interopRequireDefault(_postcssMediaQueryParser);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var ruleName = exports.ruleName = "media-feature-name-case";
  
  var messages = (0, _utils.ruleMessages)(ruleName, {
    expected: function expected(actual, _expected) {
      return "Expected \"" + actual + "\" to be \"" + _expected + "\"";
    }
  });
  
  exports.messages = messages;