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

import { getIEVersion } from './helper.mjs';
import '../../../_chunks/dep-e091cfd9.mjs';
import '../../../_chunks/dep-cfcedf47.mjs';
import '../../../_chunks/dep-b6a73f93.mjs';
import '../../../_chunks/dep-55846619.mjs';
import '../../../_chunks/dep-eb20e23f.mjs';
import '../../../_chunks/dep-b4041200.mjs';
import '../../../_chunks/dep-1cf2b129.mjs';
import '../../../_chunks/dep-a0b4a044.mjs';
import '../../../_chunks/dep-c959a6fb.mjs';
import '../../../_chunks/dep-e3b14d70.mjs';
import '../../../_chunks/dep-66d6733b.mjs';
import '../../../_chunks/dep-c31e1d9e.mjs';
import '../../../_chunks/dep-6f89b77e.mjs';
import '../../../_chunks/dep-30451c48.mjs';
import '../../../_chunks/dep-6eea369f.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
