text: "use strict";
  
  var _react = require("react");
  
  var _react2 = _interopRequireDefault(_react);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  exports.onRenderBody = function (_ref, pluginOptions) {
    var setHeadComponents = _ref.setHeadComponents;
  
    var offsetY = 0;
    if (pluginOptions.offsetY) {
      offsetY = pluginOptions.offsetY;
    }
  
    var styles = "\n    .anchor {\n      float: left;\n      padding-right: 4px;\n      margin-left: -20px;\n    }\n    h1 .anchor svg,\n    h2 .anchor svg,\n    h3 .anchor svg,\n    h4 .anchor svg,\n    h5 .anchor svg,\n    h6 .anchor svg {\n      visibility: hidden;\n    }\n    h1:hover .anchor svg,\n    h2:hover .anchor svg,\n    h3:hover .anchor svg,\n    h4:hover .anchor svg,\n    h5:hover .anchor svg,\n    h6:hover .anchor svg {\n      visibility: visible;\n    }\n  ";
  
    var script = "\n    document.addEventListener(\"DOMContentLoaded\", function(event) {\n      var hash = window.decodeURI(location.hash.replace('#', ''))\n      if (hash !== '') {\n        var element = document.getElementById(hash)\n        if (element) {\n          var offset = element.offsetTop\n          // Wait for the browser to finish rendering before scrolling.\n          setTimeout((function() {\n            window.scrollTo(0, offset - " + offsetY + ")\n          }), 0)\n        }\n      }\n    })\n  ";
  
    return setHeadComponents([_react2.default.createElement(
      "style",
      { key: "gatsby-remark-autolink-headers-style", type: "text/css" },
      styles
    ), _react2.default.createElement("script", {
      key: "gatsby-remark-autolink-headers-script",
      dangerouslySetInnerHTML: { __html: script }
    })]);
  };