"use strict";
/* Socket Lib - Built with esbuild */
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var natural_exports = {};
__export(natural_exports, {
  localeCompare: () => localeCompare,
  naturalCompare: () => naturalCompare,
  naturalSorter: () => naturalSorter
});
module.exports = __toCommonJS(natural_exports);
var import_internal = require("./_internal");
let _localeCompare;
let _naturalCompare;
let _naturalSorter;
// @__NO_SIDE_EFFECTS__
function localeCompare(x, y) {
  if (_localeCompare === void 0) {
    _localeCompare = new Intl.Collator().compare;
  }
  return _localeCompare(x, y);
}
// @__NO_SIDE_EFFECTS__
function naturalCompare(x, y) {
  if (_naturalCompare === void 0) {
    _naturalCompare = new Intl.Collator(
      // The `undefined` locale means it uses the default locale of the user's
      // environment.
      void 0,
      {
        // Enables numeric sorting: numbers in strings are compared by value,
        // e.g. 'file2' comes before 'file10' as numbers and not 'file10' before
        // 'file2' as plain text.
        numeric: true,
        // Makes the comparison case-insensitive and ignores diacritics, e.g.
        // 'a', 'A', and 'á' are treated as equivalent.
        sensitivity: "base"
      }
    ).compare;
  }
  return _naturalCompare(x, y);
}
// @__NO_SIDE_EFFECTS__
function naturalSorter(arrayToSort) {
  if (_naturalSorter === void 0) {
    const fastSort = (0, import_internal.getFastSort)();
    _naturalSorter = fastSort.createNewSortInstance({
      comparer: naturalCompare
    });
  }
  return _naturalSorter(arrayToSort);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  localeCompare,
  naturalCompare,
  naturalSorter
});
