exports.ids = [1];
exports.modules = {

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

"use strict";
'use strict';

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

var _skypagerUtil = __webpack_require__(3);

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

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

var decorate = exports.decorate = function decorate(doc) {
  return doc;
};

exports.default = decorate;

/***/ },

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

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.decorate = exports.testDocument = exports.getUtils = exports.getTransforms = exports.transformPresets = exports.rules = undefined;

var _typeof2 = __webpack_require__(36);

var _typeof3 = _interopRequireDefault(_typeof2);

var _toConsumableArray2 = __webpack_require__(4);

var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);

var _extends2 = __webpack_require__(0);

var _extends3 = _interopRequireDefault(_extends2);

var _defineEnumerableProperties2 = __webpack_require__(47);

var _defineEnumerableProperties3 = _interopRequireDefault(_defineEnumerableProperties2);

var _assign = __webpack_require__(14);

var _assign2 = _interopRequireDefault(_assign);

var _keys = __webpack_require__(13);

var _keys2 = _interopRequireDefault(_keys);

var _jsYaml = __webpack_require__(93);

var _jsYaml2 = _interopRequireDefault(_jsYaml);

var _markdown2 = __webpack_require__("./src/transformers/markdown.js");

var _markdown3 = _interopRequireDefault(_markdown2);

var _rehype2 = __webpack_require__("./src/transformers/rehype.js");

var _rehype3 = _interopRequireDefault(_rehype2);

var _retext2 = __webpack_require__("./src/transformers/retext.js");

var _retext3 = _interopRequireDefault(_retext2);

var _skypagerUtil = __webpack_require__(3);

var _string = __webpack_require__(18);

var _unistUtilVisit = __webpack_require__(28);

var _unistUtilVisit2 = _interopRequireDefault(_unistUtilVisit);

var _omit = __webpack_require__(30);

var _omit2 = _interopRequireDefault(_omit);

var _get = __webpack_require__(16);

var _get2 = _interopRequireDefault(_get);

var _lodash = __webpack_require__(6);

var _lodash2 = _interopRequireDefault(_lodash);

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

var rules = exports.rules = [/\.md$/];

var transformPresets = exports.transformPresets = function transformPresets() {
  return {
    markdown: (0, _keys2.default)(_markdown2.profiles),
    rehype: (0, _keys2.default)(_rehype2.profiles),
    retext: (0, _keys2.default)(_retext2.profiles)
  };
};

var getTransforms = exports.getTransforms = function getTransforms() {
  return {
    markdown: __webpack_require__("./src/transformers/markdown.js").default,
    rehype: __webpack_require__("./src/transformers/rehype.js").default,
    retext: __webpack_require__("./src/transformers/retext.js").default
  };
};

var getUtils = exports.getUtils = function getUtils() {
  var loaders = (0, _markdown2.utilLoaders)();

  return (0, _keys2.default)(loaders).reduce(function (memo, key) {
    var _Object$assign2, _mutatorMap;

    return (0, _assign2.default)(memo, (_Object$assign2 = {}, _mutatorMap = {}, _mutatorMap[key] = _mutatorMap[key] || {}, _mutatorMap[key].get = function () {
      return loaders[key]();
    }, (0, _defineEnumerableProperties3.default)(_Object$assign2, _mutatorMap), _Object$assign2));
  }, {});
};

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

var decorate = exports.decorate = function decorate(doc) {
  doc.lazy('exportables', function () {
    return doc.createExportable();
  });

  (0, _assign2.default)(doc, {
    createExportable: function createExportable() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var ast = doc.markdown(options.profile || 'parser', options);
      var html = doc.markdown('html', options);

      var exportable = {
        id: doc.id,
        visit: function visit(fn) {
          return (0, _unistUtilVisit2.default)(exportable.ast, fn);
        },

        get file() {
          return (0, _omit2.default)(doc.file, 'contents');
        }
      };

      (0, _skypagerUtil.lazy)(exportable, 'contents', function () {
        return doc.readFile().getFileContents();
      });
      (0, _skypagerUtil.lazy)(exportable, 'ast', function () {
        return ast.parse(exportable.contents);
      });
      (0, _skypagerUtil.lazy)(exportable, 'html', function () {
        return html.stringify(exportable.ast);
      });
      (0, _skypagerUtil.lazy)(exportable, 'frontmatter', function () {
        var _exportable$ast$child = exportable.ast.children;
        var children = _exportable$ast$child === undefined ? [] : _exportable$ast$child;

        var head = children[0] || {};

        return head && head.type === 'yaml' && head.value ? _jsYaml2.default.load(head.value) : {};
      });

      return exportable;
    },
    readFrontmatter: function readFrontmatter() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _options$contents = options.contents;
      var contents = _options$contents === undefined ? doc.getFileContents() : _options$contents;

      var parser = doc.markdown(options.parser || 'parser');

      var _parser$parse = parser.parse(contents);

      var _parser$parse$childre = _parser$parse.children;
      var children = _parser$parse$childre === undefined ? [] : _parser$parse$childre;


      if (children[0] && children[0].type === 'yaml') {
        return _jsYaml2.default.load(children[0].value || '');
      }

      return {};
    },
    retextAnalysis: function retextAnalysis() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var profile = options.profile || 'rehype';
      var parser = doc.markdown(options.parser || 'parser', options);
      var contents = options.contents || doc.getFileContents();
      var ast = options.ast || parser.parse(contents);

      return doc.retext('retext', options).process(ast);
    },
    rehypeDocument: function rehypeDocument() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var parser = doc.markdown(options.parser || 'parser', options);
      var contents = options.contents || doc.getFileContents();
      var ast = options.ast || parser.parse(contents);

      return doc.rehype(profile, options).run(ast);
    },
    remarkAST: function remarkAST() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var profile = options.profile || 'parser';
      var contents = options.contents || this.getFileContents();

      return doc.markdown(profile, options).parse(contents);
    },
    remarkHTML: function remarkHTML() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var profile = options.profile || 'github';
      var parser = options.parser || doc.markdown(profile, options);
      var contents = options.contents || this.getFileContents();
      var ast = options.ast || parser.parse(contents);
      var html = 'html';

      return doc.markdown(html, options).stringify(ast);
    },
    retext: function retext() {
      var profile = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'retext';
      var options = arguments[1];

      return (0, _retext3.default)((0, _extends3.default)({
        profile: profile
      }, options));
    },
    rehype: function rehype() {
      var profile = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rehype';
      var options = arguments[1];

      return (0, _rehype3.default)((0, _extends3.default)({
        profile: profile
      }, options));
    },
    markdown: function markdown() {
      var profile = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'parser';
      var options = arguments[1];

      return (0, _markdown3.default)((0, _extends3.default)({
        profile: profile
      }, options));
    },
    createHeadingsMap: function createHeadingsMap() {
      return this.chain.invoke('selectHeadingNodes').keyBy(function (heading) {
        var node = heading.children.find(function (n) {
          return n.type === 'text';
        });
        var value = node && node.value || '';

        return (0, _string.camelCase)((0, _string.snakeCase)(value));
      }).value();
    },
    stringifyNode: function stringifyNode(node) {
      return __webpack_require__(23)(node);
    },
    getSourceForNode: function getSourceForNode(node) {
      return __webpack_require__(27)(node);
    },
    decorateNode: function decorateNode(node) {
      return (0, _assign2.default)(node, {
        textContent: function textContent() {
          return doc.stringifyNode(node);
        },
        getFinalHeading: function getFinalHeading() {
          return doc.findAllNodesAfter(node, function (n) {
            return n.type === 'heading' && n.depth <= node.depth;
          })[0];
        },
        previousHeading: function previousHeading() {
          return node.getNodesBefore(function (n) {
            return n.type === 'heading';
          }).pop();
        },
        nextHeading: function nextHeading() {
          return node.type === 'heading' ? node.getNextNode(function (n) {
            return n.type === 'heading' && n.depth >= node.depth;
          }) : node.getNextNode(function (n) {
            return n.type === 'heading';
          });
        },
        getNextNode: function getNextNode() {
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }

          return doc.findNodeAfter.apply(doc, [node].concat((0, _toConsumableArray3.default)(args)));
        },
        getNodesAfter: function getNodesAfter() {
          for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }

          return doc.findAllNodesAfter.apply(doc, [node].concat((0, _toConsumableArray3.default)(args)));
        },
        getNodesBefore: function getNodesBefore() {
          for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
            args[_key3] = arguments[_key3];
          }

          return doc.findAllNodesBefore.apply(doc, [node].concat((0, _toConsumableArray3.default)(args)));
        }
      });
    },
    createDocumentFromSection: function createDocumentFromSection(node) {
      var stringify = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

      var startDepth = node.depth;
      var offset = 1 - startDepth;
      var children = doc.extractSectionNodes(node).map(function (child) {
        return child.type === 'heading' ? (0, _extends3.default)({}, child, { depth: child.depth + offset }) : child;
      });

      var newAST = {
        type: 'root',
        children: children
      };

      return newAST;
    },
    extractSectionNodes: function extractSectionNodes(node) {
      var startAt = node.index;
      var finalHeading = node.getFinalHeading();
      var endAt = finalHeading ? finalHeading.index : doc.finalHeading() || Infinity;

      return [node].concat((0, _toConsumableArray3.default)(this.selectNodes('*', function (n) {
        return n.index > startAt && n.index < endAt;
      })));
    },
    inspectOutline: function inspectOutline() {
      var headings = this.selectHeadingNodes();

      return headings.map(function (headingNode) {
        var content = '- ' + headingNode.textContent();
        return _lodash2.default.padStart(content, content.length + (headingNode.depth - 1) * 2);
      }).join("\n");
    },
    headingIndexes: function headingIndexes(depth) {
      return this.chain.invoke('selectHeadingNodes', depth && '[depth=' + depth + ']').sortBy(function (node) {
        return node.position ? node.position.start.line : node.index;
      }).map(function (node) {
        return node.index;
      }).value();
    },
    selectHeadingsByDepth: function selectHeadingsByDepth() {
      var depth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;

      return this.selectHeadingNodes('[depth=' + depth + ']');
    },
    selectOneNode: function selectOneNode(selector) {
      return __webpack_require__(17)(this.ast)(selector)[0];
    },
    selectNodes: function selectNodes() {
      var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '*';
      var testFn = arguments[1];

      var results = __webpack_require__(17)(this.ast)(selector);

      return typeof testFn === 'function' ? results.filter(function (r) {
        return testFn.call(doc, r);
      }) : results;
    },
    selectHeadingNodes: function selectHeadingNodes() {
      var enhance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

      return doc.selectNodes(('heading' + enhance).trim());
    },
    selectCodeBlocks: function selectCodeBlocks() {
      var lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'javascript';
      var enhance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

      return doc.selectNodes(('code[lang=' + lang + ']' + enhance).trim());
    },
    findNodeAfter: function findNodeAfter(node) {
      for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
        args[_key4 - 1] = arguments[_key4];
      }

      return __webpack_require__(24).apply(undefined, [this.ast, node].concat((0, _toConsumableArray3.default)(args)));
    },
    findAllNodesAfter: function findAllNodesAfter(node) {
      for (var _len5 = arguments.length, args = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
        args[_key5 - 1] = arguments[_key5];
      }

      return __webpack_require__(25).apply(undefined, [this.ast, node].concat((0, _toConsumableArray3.default)(args)));
    },
    findAllNodesBefore: function findAllNodesBefore(node) {
      for (var _len6 = arguments.length, args = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
        args[_key6 - 1] = arguments[_key6];
      }

      return __webpack_require__(26).apply(undefined, [this.ast, node].concat((0, _toConsumableArray3.default)(args)));
    },
    nodesIndexedByPosition: function nodesIndexedByPosition() {
      return doc.chain.get('ast.children').keyBy(function (node) {
        return parseInt(node.position.start.line);
      }).value();
    },
    introNodes: function introNodes() {
      var f = this.selectNodes('heading');
      var m = f.find(function (n) {
        return n.depth > 1;
      });

      return m ? m.getNodesBefore().reverse() : this.ast.children;
    },
    titleNode: function titleNode() {
      return this.selectOneNode('heading[depth=1]');
    },
    firstSectionHeadingNode: function firstSectionHeadingNode() {
      return this.selectOneNode('heading[depth=2]');
    },
    sectionHeadingNodes: function sectionHeadingNodes() {
      return this.selectNodes('heading[depth=2]');
    },
    articleHeadingNodes: function articleHeadingNodes() {
      return this.selectNodes('heading[depth=3]');
    },
    subarticleHeadingNodes: function subarticleHeadingNodes() {
      return this.selectNodes('heading').filter(function (n) {
        return n.depth >= 4;
      });
    },
    getNodesBetweenPositions: function getNodesBetweenPositions(alpha, bravo) {
      var start = isNode(alpha) ? alpha.position.start.line : parseInt(alpha);
      var end = isNode(bravo) ? bravo.position.start.line : parseInt(bravo);

      return doc.chain.get('ast.children').filter(function (node) {
        var line = node.position.start.line;


        return line > start && line < end;
      });
    },
    finalNode: function finalNode() {
      return this.chain.get('ast.children', []).last().value();
    },
    getAST: function getAST() {
      return doc.project.cache.fetch('asts:' + doc.cacheKey, function () {
        var _ast = doc.remarkAST();

        return (0, _extends3.default)({}, _ast, {
          children: _ast.children.map(function (n, i) {
            var d = doc.decorateNode(n);
            d.index = i;
            return d;
          })
        });
      });
    }
  });

  doc.lazy('ast', function () {
    return doc.getAST();
  });
  doc.lazy('headingsMap', function () {
    return doc.createHeadingsMap();
  });

  return doc;
};

exports.default = decorate;


function isNode(obj) {
  return (typeof obj === 'undefined' ? 'undefined' : (0, _typeof3.default)(obj)) === 'object' && typeof obj.type === 'string' && obj.position;
}

/***/ },

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

"use strict";
'use strict';

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

var _assign = __webpack_require__(14);

var _assign2 = _interopRequireDefault(_assign);

var _skypagerUtil = __webpack_require__(3);

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

var rules = exports.rules = [/package.json$/];

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

var decorate = exports.decorate = function decorate(doc) {
  return (0, _assign2.default)(doc, {
    loadProject: function loadProject() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      return doc.project ? doc.project.portfolio.load(doc.file.dirname, { sync: false }) : doc.project;
    }
  });
};

exports.default = decorate;

/***/ },

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

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.markdownPageConfig = exports.formatId = exports.javascriptPageConfig = exports.decorate = exports.testDocument = undefined;

var _extends2 = __webpack_require__(0);

var _extends3 = _interopRequireDefault(_extends2);

var _assign = __webpack_require__(14);

var _assign2 = _interopRequireDefault(_assign);

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

var pathToRegexp = __webpack_require__(132);

var testDocument = exports.testDocument = function testDocument(doc) {
  var project = doc.project;

  var pagesPattern = project.getOption('pages.pattern', '*pages*');

  return pathToRegexp(pagesPattern).test(doc.id);
};

var decorate = exports.decorate = function decorate(doc) {

  (0, _assign2.default)(doc, {
    buildPageConfig: function buildPageConfig() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if (doc.fileExtname === '.md') {
        return markdownPageConfig(doc);
      } else if (doc.fileExtname === '.js') {
        return javascriptPageConfig(doc);
      }
    }
  });

  return doc;
};

var javascriptPageConfig = exports.javascriptPageConfig = function javascriptPageConfig(doc) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _options$buildRoute = options.buildRoute;
  var buildRoute = _options$buildRoute === undefined ? function (v) {
    return v;
  } : _options$buildRoute;
  var _options$publicRoot = options.publicRoot;
  var publicRoot = _options$publicRoot === undefined ? /.*pages\/?/ : _options$publicRoot;


  return {
    id: doc.id,
    idParts: doc.idParts,
    baseRelativePath: doc.baseRelativePath,
    isIndex: doc.isIndex,
    route: buildRoute(formatId(doc.id)).replace(publicRoot, '/'),
    meta: {
      id: doc.id,
      cacheKey: doc.cacheKey,
      lastModified: doc.get('file.stat.mtime')
    }
  };
};

var formatId = exports.formatId = function formatId(id) {
  return id.replace(/index.*$/, '').replace(/\/$/, '');
};

var markdownPageConfig = exports.markdownPageConfig = function markdownPageConfig(doc) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var frontmatter = doc.exportables.frontmatter;
  var _options$publicRoot2 = options.publicRoot;
  var publicRoot = _options$publicRoot2 === undefined ? /.*pages\/?/ : _options$publicRoot2;
  var _options$buildRoute2 = options.buildRoute;
  var buildRoute = _options$buildRoute2 === undefined ? function (v) {
    return v;
  } : _options$buildRoute2;


  return {
    id: doc.id,
    route: buildRoute(frontmatter.route || formatId(doc.id)).replace(publicRoot, '/'),
    idParts: doc.idParts,
    baseRelativePath: doc.baseRelativePath,
    isIndex: doc.isIndex,
    meta: (0, _extends3.default)({
      id: doc.id,
      cacheKey: doc.cacheKey
    }, frontmatter)
  };
};

/***/ },

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

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.markdown = exports.javascript = exports.decorate = exports.testDocument = exports.rules = undefined;

var _markdown = __webpack_require__("./src/document-types/markdown.js");

var _skypagerUtil = __webpack_require__(3);

var rules = exports.rules = [/.*\.(test|spec).*\.(md|js)$/i];

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

var decorate = exports.decorate = function decorate(doc) {
  if (doc.isJavascript) {
    doc = javascript(doc);
  }

  if (doc.isMarkdown) {
    doc = markdown(doc);
  }

  return doc;
};

var javascript = exports.javascript = function javascript(doc) {
  return doc;
};

var markdown = exports.markdown = function markdown(doc) {
  return doc;
};

/***/ },

/***/ "./src/transformers/markdown.js":
/***/ function(module, exports, __webpack_require__) {

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.utilLoaders = exports.addons = exports.profiles = exports.github = exports.stringifier = exports.html = exports.parser = exports.comments = exports.standard = exports.applyTo = undefined;

var _remark = __webpack_require__(37);

var _remark2 = _interopRequireDefault(_remark);

var _remarkCommentBlocks = __webpack_require__(62);

var _remarkCommentBlocks2 = _interopRequireDefault(_remarkCommentBlocks);

var _remarkCommentConfig = __webpack_require__(63);

var _remarkCommentConfig2 = _interopRequireDefault(_remarkCommentConfig);

var _remarkHtml = __webpack_require__(66);

var _remarkHtml2 = _interopRequireDefault(_remarkHtml);

var _remarkSlug = __webpack_require__(72);

var _remarkSlug2 = _interopRequireDefault(_remarkSlug);

var _remarkSqueezeParagraphs = __webpack_require__(73);

var _remarkSqueezeParagraphs2 = _interopRequireDefault(_remarkSqueezeParagraphs);

var _remarkYamlAnnotations = __webpack_require__(79);

var _remarkYamlAnnotations2 = _interopRequireDefault(_remarkYamlAnnotations);

var _remarkStringify = __webpack_require__(74);

var _remarkStringify2 = _interopRequireDefault(_remarkStringify);

var _remarkNormalizeHeadings = __webpack_require__(68);

var _remarkNormalizeHeadings2 = _interopRequireDefault(_remarkNormalizeHeadings);

var _remarkGithub = __webpack_require__(65);

var _remarkGithub2 = _interopRequireDefault(_remarkGithub);

var _remarkToc = __webpack_require__(76);

var _remarkToc2 = _interopRequireDefault(_remarkToc);

var _remarkAutolinkHeadings = __webpack_require__(61);

var _remarkAutolinkHeadings2 = _interopRequireDefault(_remarkAutolinkHeadings);

var _remarkContributors = __webpack_require__(64);

var _remarkContributors2 = _interopRequireDefault(_remarkContributors);

var _remarkLicense = __webpack_require__(67);

var _remarkLicense2 = _interopRequireDefault(_remarkLicense);

var _remarkStripBadges = __webpack_require__(75);

var _remarkStripBadges2 = _interopRequireDefault(_remarkStripBadges);

var _remarkUsage = __webpack_require__(77);

var _remarkUsage2 = _interopRequireDefault(_remarkUsage);

var _remarkValidateLinks = __webpack_require__(78);

var _remarkValidateLinks2 = _interopRequireDefault(_remarkValidateLinks);

var _remarkParse = __webpack_require__(69);

var _remarkParse2 = _interopRequireDefault(_remarkParse);

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

/**
 * Run a remark parser profile with optional add-ons. Available profiles
 * can be found @see profiles and addOns @see addOns
 *
 * @param {Object} options - the options object
 * @param {String} options.profile - which parser profile to use?
 * @param {Array} options.addOns - which addons to include?
 */
exports.default = function () {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _options$profile = options.profile;
  var profile = _options$profile === undefined ? 'parser' : _options$profile;
  var _options$addOns = options.addOns;
  var addOns = _options$addOns === undefined ? [] : _options$addOns;

  var unified = profiles[profile] || parser;

  return addOns.reduce(function (memo, addon) {
    return addons[addOn] ? memo.use(addons[addOn]) : memo;
  }, unified(options));
};

var applyTo = exports.applyTo = function applyTo(input, options) {
  var _options$method = options.method;
  var method = _options$method === undefined ? 'parse' : _options$method;
  var _options$parser = options.parser;
  var parser = _options$parser === undefined ? 'github' : _options$parser;

  return profiles[parser](options)[method](input);
};

var standard = exports.standard = function standard() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return (0, _remark2.default)().use(_remarkCommentConfig2.default).use(_remarkNormalizeHeadings2.default).use(_remarkSqueezeParagraphs2.default).use(_remarkSlug2.default).use(_remarkYamlAnnotations2.default).use(_remarkAutolinkHeadings2.default);
};

var comments = exports.comments = function comments() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return standard(options).use(_remarkCommentBlocks2.default);
};

var parser = exports.parser = function parser() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return standard(options).use(_remarkParse2.default);
};

var html = exports.html = function html() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return standard(options).use(_remarkHtml2.default);
};

var stringifier = exports.stringifier = function stringifier() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return standard(options).use(_remarkStringify2.default);
};

var github = exports.github = function github() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return standard(options).use(_remarkGithub2.default).use(_remarkAutolinkHeadings2.default);
};

var profiles = exports.profiles = {
  parser: parser,
  standard: standard,
  comments: comments,
  github: github,
  html: html,
  stringifier: stringifier
};

var addons = exports.addons = {
  contributors: _remarkContributors2.default,
  license: _remarkLicense2.default,
  stripBadges: _remarkStripBadges2.default,
  usage: _remarkUsage2.default,
  validateLinks: _remarkValidateLinks2.default,
  toc: _remarkToc2.default
};

var utilLoaders = exports.utilLoaders = function utilLoaders() {
  return {
    filter: function filter() {
      return __webpack_require__(40);
    },
    findAfter: function findAfter() {
      return __webpack_require__(24);
    },
    findAllAfter: function findAllAfter() {
      return __webpack_require__(25);
    },
    findAllBefore: function findAllBefore() {
      return __webpack_require__(26);
    },
    index: function index() {
      return __webpack_require__(41);
    },
    map: function map() {
      return __webpack_require__(42);
    },
    parents: function parents() {
      return __webpack_require__(43);
    },
    position: function position() {
      return __webpack_require__(44);
    },
    removePosition: function removePosition() {
      return __webpack_require__(45);
    },
    select: function select() {
      return __webpack_require__(17);
    },
    source: function source() {
      return __webpack_require__(27);
    },
    visit: function visit() {
      return __webpack_require__(28);
    },
    reporter: function reporter() {
      return __webpack_require__(46);
    },
    rehypeDocument: function rehypeDocument() {
      return __webpack_require__(39);
    },
    docblockParser: function docblockParser() {
      return __webpack_require__(22);
    },
    toString: function toString() {
      return __webpack_require__(23);
    }
  };
};

/***/ },

/***/ "./src/transformers/rehype.js":
/***/ function(module, exports, __webpack_require__) {

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.profiles = exports.nestedSections = exports.rehype = exports.applyTo = undefined;

var _markdown = __webpack_require__("./src/transformers/markdown.js");

var _remarkRehype = __webpack_require__(70);

var _remarkRehype2 = _interopRequireDefault(_remarkRehype);

var _rehypeStringify = __webpack_require__(60);

var _rehypeStringify2 = _interopRequireDefault(_rehypeStringify);

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

exports.default = function () {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _options$profile = options.profile;
  var profile = _options$profile === undefined ? 'default' : _options$profile;

  return (profiles[profile] || nestedSections)(options);
};

var applyTo = exports.applyTo = function applyTo(input, options) {
  var _options$method = options.method;
  var method = _options$method === undefined ? 'parse' : _options$method;
  var _options$parser = options.parser;
  var parser = _options$parser === undefined ? 'nested' : _options$parser;

  return profiles[parser](options)[method](input);
};

var rehype = exports.rehype = function rehype() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return (0, _markdown.parser)(options).use(_remarkRehype2.default).use(_rehypeStringify2.default);
};

var nestedSections = exports.nestedSections = function nestedSections() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return rehype(options).use(function () {
    return nestSections;
  }).use(_rehypeStringify2.default);
};

var profiles = exports.profiles = {
  default: nestedSections,
  nested: nestedSections,
  standard: rehype
};

/* eslint-disable */

// Thanks to titus @wooorm the author of remark / retext / rehype for this!
var nestSections = function nestSections(tree) {
  var result = [];
  var section = void 0;
  var article = void 0;

  tree.children.forEach(function (child) {
    var ctx;

    if (child.tagName === 'h2') {
      ctx = result;
      article = null;
      section = child = h('section', [child]);
    } else if (child.tagName === 'h3') {
      ctx = section ? section.children : result;
      article = child = h('article', [child]);
    } else {
      ctx = (article || section || {}).children || result;
    }

    ctx.push(child);
  });

  tree.children = [h('main', result)];
};

/***/ },

/***/ "./src/transformers/retext.js":
/***/ function(module, exports, __webpack_require__) {

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.applyTo = exports.profiles = exports.retext = undefined;

var _remark = __webpack_require__(37);

var _remark2 = _interopRequireDefault(_remark);

var _unified = __webpack_require__(82);

var _unified2 = _interopRequireDefault(_unified);

var _remarkRetext = __webpack_require__(71);

var _remarkRetext2 = _interopRequireDefault(_remarkRetext);

var _retextEnglish = __webpack_require__(80);

var _retextEnglish2 = _interopRequireDefault(_retextEnglish);

var _retextKeywords = __webpack_require__(81);

var _retextKeywords2 = _interopRequireDefault(_retextKeywords);

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

var retext = exports.retext = function retext() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return (0, _unified2.default)().use((0, _remark2.default)()).use(_remarkRetext2.default, (0, _unified2.default)().use(_retextEnglish2.default).use(_retextKeywords2.default));
};

exports.default = function () {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _options$profile = options.profile;
  var profile = _options$profile === undefined ? 'default' : _options$profile;

  return (profiles[profile] || retext)(options);
};

var profiles = exports.profiles = {
  default: retext,
  retext: retext
};

var applyTo = exports.applyTo = function applyTo(input, options) {
  var _options$method = options.method;
  var method = _options$method === undefined ? 'parse' : _options$method;
  var _options$parser = options.parser;
  var parser = _options$parser === undefined ? 'retext' : _options$parser;

  return profiles[parser](options)[method](input);
};

/***/ },

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

var map = {
	"./babel-es6.js": "./src/document-types/babel-es6.js",
	"./markdown.js": "./src/document-types/markdown.js",
	"./packageManifest.js": "./src/document-types/packageManifest.js",
	"./page-config.js": "./src/document-types/page-config.js",
	"./spec.js": "./src/document-types/spec.js"
};
function webpackContext(req) {
	return __webpack_require__(webpackContextResolve(req));
};
function webpackContextResolve(req) {
	var id = map[req];
	if(!(id + 1)) // check for number
		throw new Error("Cannot find module '" + req + "'.");
	return id;
};
webpackContext.keys = function webpackContextKeys() {
	return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = 126;


/***/ }

};;