const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
let __stryke_env_types = require("@stryke/env/types");
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");

//#region src/helpers/source-file-env.ts
function __assignType(fn, args) {
	fn.__type = args;
	return fn;
}
const __ΩTReturned = [
	"TEnv",
	"TReturned",
	"l2&R!RPe#!&qk#%QRb!Pde\"!p'w\"y"
];
function removeEnvPrefix(env) {
	if ((0, __stryke_type_checks_is_string.isString)(env)) {
		let name = __stryke_env_types.ENV_PREFIXES.reduce(__assignType((ret, prefix) => {
			if (ret.startsWith(prefix)) ret = ret.slice(prefix.length);
			return ret;
		}, [
			"ret",
			"prefix",
			"",
			"P\"2!\"2\"\"/#"
		]), env.toUpperCase());
		while (name.startsWith("_")) name = name.slice(1);
		return name;
	}
	return Object.keys(env).reduce(__assignType((ret, key) => {
		const name = removeEnvPrefix(key);
		if (name) ret[name] = env[key];
		return ret;
	}, [
		"ret",
		"key",
		"",
		"P\"2!\"2\"\"/#"
	]), {});
}
removeEnvPrefix.__type = [
	"env",
	() => __ΩTReturned,
	"removeEnvPrefix",
	"P\"2!\"o\"\"/#"
];
function formatEnvField(key) {
	return (0, __stryke_string_format_camel_case.camelCase)(removeEnvPrefix(key));
}
formatEnvField.__type = [
	"key",
	"formatEnvField",
	"P&2!&/\""
];

//#endregion
exports.formatEnvField = formatEnvField;
exports.removeEnvPrefix = removeEnvPrefix;