import "@js-temporal/polyfill";
import "urlpattern-polyfill";
globalThis.addEventListener = () => {};
import { a as red, i as buildMessage, l as AssertionError, n as diffStr, r as diff, s as format } from "./assert_equals-Ew3jOFa3.mjs";
import "./assert_rejects-CJC9ThS-.mjs";
import "./assert_is_error-C50x8tnw.mjs";
import "./assert_throws-BIL7gChy.mjs";
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
/**
* Make an assertion that actual is not null or undefined.
* If not then throw.
*
* @example Usage
* ```ts no-eval
* import { assertExists } from "@std/assert/assert-exists";
*
* assertExists("something"); // Doesn't throw
* assertExists(undefined); // Throws
* ```
*
* @typeParam T The type of the actual value.
* @param actual The actual value to check.
* @param msg The optional message to include in the error if the assertion fails.
*/ function assertExists(actual, msg) {
	if (actual === void 0 || actual === null) {
		msg = `Expected actual: "${actual}" to not be null or undefined${msg ? `: ${msg}` : "."}`;
		throw new AssertionError(msg);
	}
}
//#endregion
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js
/**
* Make an assertion that `actual` is greater than or equal to `expected`.
* If not then throw.
*
* @example Usage
* ```ts no-eval
* import { assertGreaterOrEqual } from "@std/assert/assert-greater-or-equal";
*
* assertGreaterOrEqual(2, 1); // Doesn't throw
* assertGreaterOrEqual(1, 1); // Doesn't throw
* assertGreaterOrEqual(0, 1); // Throws
* ```
*
* @typeParam T The type of the values to compare.
* @param actual The actual value to compare.
* @param expected The expected value to compare.
* @param msg The optional message to display if the assertion fails.
*/ function assertGreaterOrEqual(actual, expected, msg) {
	if (actual >= expected) return;
	const actualString = format(actual);
	const expectedString = format(expected);
	throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
}
//#endregion
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater.js
/**
* Make an assertion that `actual` is greater than `expected`.
* If not then throw.
*
* @example Usage
* ```ts no-eval
* import { assertGreater } from "@std/assert/assert-greater";
*
* assertGreater(2, 1); // Doesn't throw
* assertGreater(1, 1); // Throws
* assertGreater(0, 1); // Throws
* ```
*
* @typeParam T The type of the values to compare.
* @param actual The actual value to compare.
* @param expected The expected value to compare.
* @param msg The optional message to display if the assertion fails.
*/ function assertGreater(actual, expected, msg) {
	if (actual > expected) return;
	const actualString = format(actual);
	const expectedString = format(expected);
	throw new AssertionError(msg ?? `Expect ${actualString} > ${expectedString}`);
}
//#endregion
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_strict_equals.js
/**
* Make an assertion that `actual` and `expected` are equal using
* {@linkcode Object.is} for equality comparison. If not, then throw.
*
* @example Usage
* ```ts no-eval
* import { assertStrictEquals } from "@std/assert/assert-strict-equals";
*
* const a = {};
* const b = a;
* assertStrictEquals(a, b); // Doesn't throw
*
* const c = {};
* const d = {};
* assertStrictEquals(c, d); // Throws
* ```
*
* @typeParam T The type of the expected value.
* @param actual The actual value to compare.
* @param expected The expected value to compare.
* @param msg The optional message to display if the assertion fails.
*/ function assertStrictEquals(actual, expected, msg) {
	if (Object.is(actual, expected)) return;
	const msgSuffix = msg ? `: ${msg}` : ".";
	let message;
	const actualString = format(actual);
	const expectedString = format(expected);
	if (actualString === expectedString) message = `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(actualString.split("\n").map((l) => `    ${l}`).join("\n"))}\n`;
	else {
		const stringDiff = typeof actual === "string" && typeof expected === "string";
		message = `Values are not strictly equal${msgSuffix}\n${buildMessage(stringDiff ? diffStr(actual, expected) : diff(actualString.split("\n"), expectedString.split("\n")), { stringDiff }).join("\n")}`;
	}
	throw new AssertionError(message);
}
//#endregion
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_string_includes.js
/**
* Make an assertion that actual includes expected. If not
* then throw.
*
* @example Usage
* ```ts no-eval
* import { assertStringIncludes } from "@std/assert/assert-string-includes";
*
* assertStringIncludes("Hello", "ello"); // Doesn't throw
* assertStringIncludes("Hello", "world"); // Throws
* ```
*
* @param actual The actual string to check for inclusion.
* @param expected The expected string to check for inclusion.
* @param msg The optional message to display if the assertion fails.
*/ function assertStringIncludes(actual, expected, msg) {
	if (!actual.includes(expected)) {
		msg = `Expected actual: "${actual}" to contain: "${expected}"${msg ? `: ${msg}` : "."}`;
		throw new AssertionError(msg);
	}
}
//#endregion
export { assertExists as a, assertGreaterOrEqual as i, assertStrictEquals as n, assertGreater as r, assertStringIncludes as t };
