/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

import { getIEVersion } from './helper.mjs';
import '../../../_chunks/dep-bf1e33c8.mjs';
import '../../../_chunks/dep-b8d7992c.mjs';
import '../../../_chunks/dep-60fae668.mjs';
import '../../../_chunks/dep-84acf3c2.mjs';
import '../../../_chunks/dep-2db7b3ec.mjs';
import '../../../_chunks/dep-255303ba.mjs';
import '../../../_chunks/dep-876fb3ec.mjs';
import '../../../_chunks/dep-eba0ea6e.mjs';
import '../../../_chunks/dep-469b4ae0.mjs';
import '../../../_chunks/dep-b57180d0.mjs';
import '../../../_chunks/dep-c8d7b6b4.mjs';
import '../../../_chunks/dep-3da99438.mjs';
import '../../../_chunks/dep-ed5ebb35.mjs';
import '../../../_chunks/dep-78847b2e.mjs';
import '../../../_chunks/dep-3f21269a.mjs';

function getScrollbarWidthWithCSS() {
  var defaultScrollbarWidth = 6;
  if (typeof navigator === "undefined" || !navigator) return defaultScrollbarWidth;
  if (/(Chrome|Safari)/i.test(navigator.userAgent)) return defaultScrollbarWidth;
  var scrollDiv = document.createElement("div");
  scrollDiv.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";
  document.body.appendChild(scrollDiv);
  var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  document.body.removeChild(scrollDiv);
  if (/Firefox/.test(navigator.userAgent)) {
    scrollbarWidth -= 4;
  }
  if (getIEVersion() <= 11) {
    scrollbarWidth = 12;
  }
  return scrollbarWidth;
}
function getScrollbarWidth() {
  var scrollDiv = document.createElement("div");
  scrollDiv.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";
  document.body.appendChild(scrollDiv);
  var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  document.body.removeChild(scrollDiv);
  return scrollbarWidth;
}

export { getScrollbarWidth, getScrollbarWidthWithCSS };
//# sourceMappingURL=getScrollbarWidth.mjs.map
