module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmory imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmory exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		Object.defineProperty(exports, name, {
/******/ 			configurable: false,
/******/ 			enumerable: true,
/******/ 			get: getter
/******/ 		});
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 133);
/******/ })
/************************************************************************/
/******/ ({

/***/ "./src/document-types/babel-es6.js":
/***/ function(module, exports, __webpack_require__) {

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.decorate = exports.transpile = exports.toAST = exports.compile = exports.testDocument = exports.rules = exports.docblockParser = undefined;

var _assign = __webpack_require__(1);

var _assign2 = _interopRequireDefault(_assign);

var _pathMatcher = __webpack_require__(7);

var _pathMatcher2 = _interopRequireDefault(_pathMatcher);

var _pick = __webpack_require__(33);

var _pick2 = _interopRequireDefault(_pick);

var _omit = __webpack_require__(17);

var _omit2 = _interopRequireDefault(_omit);

var _mapValues = __webpack_require__(21);

var _mapValues2 = _interopRequireDefault(_mapValues);

var _omitBy = __webpack_require__(70);

var _omitBy2 = _interopRequireDefault(_omitBy);

var _isEmpty = __webpack_require__(32);

var _isEmpty2 = _interopRequireDefault(_isEmpty);

var _docblockParser = __webpack_require__(19);

var _docblockParser2 = _interopRequireDefault(_docblockParser);

var _entity = __webpack_require__(34);

var _entity2 = _interopRequireDefault(_entity);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var docblockParser = exports.docblockParser = (0, _docblockParser2.default)({
  tags: {
    name: _docblockParser2.default.singleParameterTag
  }
});

var rules = exports.rules = [/\.(js|es6|jsx)$/];

var testDocument = exports.testDocument = function testDocument(doc) {
  return typeof rules.find(function (rule) {
    return (0, _pathMatcher2.default)(rule, doc.fileBaseName);
  }) !== 'undefined';
};

var compile = exports.compile = function compile(code, options) {
  return transpile(code, options).code;
};

var toAST = exports.toAST = function toAST(code, options) {
  return __webpack_require__(27).transform(code, babelOptions(options)).ast;
};

var transpile = exports.transpile = function transpile() {
  var code = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  return __webpack_require__(27).transform(code, babelOptions(options));
};

var decorate = exports.decorate = function decorate(doc) {
  (0, _assign2.default)(doc, {
    toEntity: function toEntity() {
      var exportables = doc.exportables;
      var frontmatter = exportables.frontmatter;

      return (0, _assign2.default)({ id: doc.id }, frontmatter, {
        imports: exportables.imports,
        exports: exportables.exports
      });
    },


    /**
      multilineTilTag
      multilineTilEmptyLineOrTag
      booleanTag
      singleParameterTag
      multiParameterTag(delimiter)
    */
    docblockParser: function docblockParser() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var parser = (0, _docblockParser2.default)({
        tags: (0, _assign2.default)({
          name: _docblockParser2.default.singleParameterTag
        }, options)
      });

      return parser.parse;
    },
    createExportable: function createExportable() {
      var exportable = (0, _entity2.default)({
        id: doc.id,
        file: (0, _omit2.default)(doc.file, 'contents')
      });

      exportable.lazy('babel', function () {
        return doc.transformBabel();
      });
      exportable.lazy('ast', function () {
        return exportable.babel.ast;
      });
      exportable.lazy('code', function () {
        return exportable.babel.code;
      });
      exportable.lazy('meta', function () {
        return exportable.babel.metadata;
      });

      exportable.lazy('commentNodes', function () {
        return exportable.get('ast.comments', []);
      });

      exportable.lazy('imports', function () {
        return exportable.get('babel.metadata.modules.imports', []).map(function (m) {
          return m.source;
        });
      }, true);
      exportable.lazy('exports', function () {
        return exportable.get('babel.metadata.modules.exports.exported', []);
      }, true);

      exportable.getter('contents', function () {
        return doc.readFile().getFileContents();
      });

      exportable.lazy('frontmatter', function () {
        try {
          var result = docblockParser.parse(exportable.get('ast.comments[0].value', "/**\n**/"));
          var _result$tags = result.tags,
              tags = _result$tags === undefined ? {} : _result$tags,
              _result$text = result.text,
              text = _result$text === undefined ? '' : _result$text;

          var values = (0, _mapValues2.default)((0, _assign2.default)({ text: text, id: doc.id }, tags), function (v) {
            return typeof v === 'string' ? v.trim() : v;
          });

          return (0, _omitBy2.default)(values, function (v) {
            return (0, _isEmpty2.default)(v);
          });
        } catch (error) {
          return {};
        }
      }, true);

      return exportable;
    },
    readFrontmatter: function readFrontmatter() {
      return doc.exportables.frontmatter;
    },
    transformBabel: function transformBabel(options) {
      options = options || doc.project.babelRc || { presets: ['skypager'] };
      var code = options.code || doc.file.contents.toString();
      return __webpack_require__(27).transform(code, babelOptions(options));
    }
  });

  doc.lazy('exportables', function () {
    return doc.createExportable();
  });

  return doc;
};

exports.default = decorate;


var babelOptions = function babelOptions(options) {
  return (0, _pick2.default)(options, "filename", "filenameRelative", "presets", "plugins", "parserOpts", "generatorOpts", "highlightCode", "only", "ignore", "auxiliaryCommentBefore", "auxiliaryCommentAfter", "sourceMaps", "inputSourceMap", "sourceMapTarget", "sourceFileName", "sourceRoot", "moduleRoot", "moduleIds", "moduleId", "getModuleId", "resolveModuleSource", "code", "no-babelrc", "ast", "compact", "minified", "comments", "shouldPrintComment", "env", "retainLines", "extends");
};

/***/ },

/***/ 1:
/***/ function(module, exports) {

module.exports = require("babel-runtime/core-js/object/assign");

/***/ },

/***/ 133:
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__("./src/document-types/babel-es6.js");


/***/ },

/***/ 17:
/***/ function(module, exports) {

module.exports = require("lodash/omit");

/***/ },

/***/ 19:
/***/ function(module, exports) {

module.exports = require("docblock-parser");

/***/ },

/***/ 21:
/***/ function(module, exports) {

module.exports = require("lodash/mapValues");

/***/ },

/***/ 27:
/***/ function(module, exports) {

module.exports = require("babel-core");

/***/ },

/***/ 32:
/***/ function(module, exports) {

module.exports = require("lodash/isEmpty");

/***/ },

/***/ 33:
/***/ function(module, exports) {

module.exports = require("lodash/pick");

/***/ },

/***/ 34:
/***/ function(module, exports) {

module.exports = require("skypager-util/lib/entity");

/***/ },

/***/ 7:
/***/ function(module, exports) {

module.exports = require("skypager-util/lib/path-matcher");

/***/ },

/***/ 70:
/***/ function(module, exports) {

module.exports = require("lodash/omitBy");

/***/ }

/******/ });
//# sourceMappingURL=babel-es6.js.map