"use strict";
/* Socket Lib - Built with esbuild */
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 arrays_exports = {};
__export(arrays_exports, {
  arrayChunk: () => arrayChunk,
  arrayUnique: () => arrayUnique,
  isArray: () => isArray,
  joinAnd: () => joinAnd,
  joinOr: () => joinOr
});
module.exports = __toCommonJS(arrays_exports);
let _conjunctionFormatter;
// @__NO_SIDE_EFFECTS__
function getConjunctionFormatter() {
  if (_conjunctionFormatter === void 0) {
    _conjunctionFormatter = new Intl.ListFormat("en", {
      style: "long",
      // "and" lists.
      type: "conjunction"
    });
  }
  return _conjunctionFormatter;
}
let _disjunctionFormatter;
// @__NO_SIDE_EFFECTS__
function getDisjunctionFormatter() {
  if (_disjunctionFormatter === void 0) {
    _disjunctionFormatter = new Intl.ListFormat("en", {
      style: "long",
      // "or" lists.
      type: "disjunction"
    });
  }
  return _disjunctionFormatter;
}
// @__NO_SIDE_EFFECTS__
function arrayChunk(arr, size) {
  const chunkSize = size ?? 2;
  if (chunkSize <= 0) {
    throw new Error("Chunk size must be greater than 0");
  }
  const { length } = arr;
  const actualChunkSize = Math.min(length, chunkSize);
  const chunks = [];
  for (let i = 0; i < length; i += actualChunkSize) {
    chunks.push(arr.slice(i, i + actualChunkSize));
  }
  return chunks;
}
// @__NO_SIDE_EFFECTS__
function arrayUnique(arr) {
  return [...new Set(arr)];
}
const isArray = Array.isArray;
// @__NO_SIDE_EFFECTS__
function joinAnd(arr) {
  return (/* @__PURE__ */ getConjunctionFormatter()).format(arr);
}
// @__NO_SIDE_EFFECTS__
function joinOr(arr) {
  return (/* @__PURE__ */ getDisjunctionFormatter()).format(arr);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  arrayChunk,
  arrayUnique,
  isArray,
  joinAnd,
  joinOr
});
