"use strict";

Liferay.Loader.define("site-navigation-item-selector-web$dom-helpers@5.2.0/cjs/scrollbarSize", ['module', 'exports', 'require', '@site-navigation-item-selector-web$babel/runtime/helpers/interopRequireDefault', './canUseDOM'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    var _interopRequireDefault = require("@site-navigation-item-selector-web$babel/runtime/helpers/interopRequireDefault");

    exports.__esModule = true;
    exports.default = scrollbarSize;

    var _canUseDOM = _interopRequireDefault(require("./canUseDOM"));

    var size;

    function scrollbarSize(recalc) {
      if (!size && size !== 0 || recalc) {
        if (_canUseDOM.default) {
          var scrollDiv = document.createElement('div');
          scrollDiv.style.position = 'absolute';
          scrollDiv.style.top = '-9999px';
          scrollDiv.style.width = '50px';
          scrollDiv.style.height = '50px';
          scrollDiv.style.overflow = 'scroll';
          document.body.appendChild(scrollDiv);
          size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
          document.body.removeChild(scrollDiv);
        }
      }

      return size;
    }

    module.exports = exports["default"];
  }
});
//# sourceMappingURL=scrollbarSize.js.map