"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_versions__internal = require('./_internal.js');

//#region src/versions/compare.ts
/**
* @file Version comparison operators aligned with `node:smol-versions` (the
*   C++-accelerated multi-ecosystem version helper shipped by the smol Node
*   binary). The same names + signatures also match the vendored `semver` JS
*   lib — both impls expose this surface, so we pick one at module load (`impl
*   = smol ?? semver`) and each export just forwards to it.
*
*   - `compare(a, b)` — returns `-1 | 0 | 1` (undefined on invalid input)
*   - `eq(a, b)`, `neq(a, b)` — equality / inequality
*   - `lt(a, b)`, `lte(a, b)` — less-than / less-or-equal
*   - `gt(a, b)`, `gte(a, b)` — greater-than / greater-or-equal
*   - `sort(versions)` — ascending sort
*   - `rsort(versions)` — descending sort `compare()` swallows the smol/semver
*     "invalid version" throw into `undefined` for the caller's convenience;
*     all other ops surface whatever the underlying impl returns. The vendored
*     `semver` export has no `neq` helper, so when we fall back to it we route
*     `neq` through `!eq` to match smol's semantics.
*/
/**
* Compare two semantic version strings.
*
* @returns -1 if a < b, 0 if a === b, 1 if a > b, or undefined if invalid.
*/
function compare(a, b) {
	try {
		return require_versions__internal.impl.compare(a, b);
	} catch {
		return;
	}
}
/**
* Check if a equals b.
*/
const eq = require_versions__internal.impl.eq.bind(require_versions__internal.impl);
/**
* Check if a does not equal b.
*/
/* c8 ignore start - smol-versions exposes .neq, so the bind arm is taken;
the polyfill fallback fires only on a hypothetical impl that lacks .neq. */
const neq = typeof require_versions__internal.impl.neq === "function" ? require_versions__internal.impl.neq.bind(require_versions__internal.impl) : (a, b) => !require_versions__internal.impl.eq(a, b);
/* c8 ignore stop */
/**
* Check if a is greater than b.
*/
const gt = require_versions__internal.impl.gt.bind(require_versions__internal.impl);
/**
* Check if a is greater than or equal to b.
*/
const gte = require_versions__internal.impl.gte.bind(require_versions__internal.impl);
/**
* Check if a is less than b.
*/
const lt = require_versions__internal.impl.lt.bind(require_versions__internal.impl);
/**
* Check if a is less than or equal to b.
*/
const lte = require_versions__internal.impl.lte.bind(require_versions__internal.impl);
/**
* Sort versions in descending order.
*/
function rsort(versions) {
	return require_versions__internal.impl.rsort([...versions]);
}
/**
* Sort versions in ascending order. The input is spread so callers can pass a
* `readonly string[]` even when the impl mutates internally.
*/
function sort(versions) {
	return require_versions__internal.impl.sort([...versions]);
}

//#endregion
exports.compare = compare;
exports.eq = eq;
exports.gt = gt;
exports.gte = gte;
exports.lt = lt;
exports.lte = lte;
exports.neq = neq;
exports.rsort = rsort;
exports.sort = sort;