import { canUseDOM } from '../../../utils/canUseDOM.js';

var clearSelection = function clearSelection() {
  if (!canUseDOM) {
    return;
  }
  var doc = document;
  if (window.getSelection) {
    var _window$getSelection;
    (_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges();
  } else if (doc.selection) {
    doc.selection.empty();
  }
};

export { clearSelection };
