//#region .svelte-kit/adapter-bun/chunks/format.js
/** @type {import('$env/static/public').PUBLIC_MODE} */
var PUBLIC_MODE = "ONLINE";
var HttpClient = class {
	_baseUrl;
	_baseOptions;
	_middlewares;
	constructor(baseUrl, options) {
		this._baseUrl = baseUrl;
		this._baseOptions = options ?? { headers: { "Content-Type": "application/json" } };
		this._middlewares = [];
	}
	get(path, options) {
		return this._applyMiddlewares(path, options, (newPath, newOptions) => {
			return this._request(newPath, {
				...newOptions,
				method: "GET"
			});
		});
	}
	post(path, body, options) {
		return this._applyMiddlewares(path, options, (newPath, newOptions) => {
			return this._request(newPath, {
				...newOptions,
				method: "POST",
				body
			});
		});
	}
	put(path, body, options) {
		return this._applyMiddlewares(path, options, (newPath, newOptions) => {
			return this._request(newPath, {
				...newOptions,
				method: "PUT",
				body
			});
		});
	}
	patch(path, body, options) {
		return this._applyMiddlewares(path, options, async (newPath, newOptions) => {
			return this._request(newPath, {
				...newOptions,
				method: "PATCH",
				body
			});
		});
	}
	delete(path, options) {
		return this._applyMiddlewares(path, options, (newPath, newOptions) => {
			return this._request(newPath, {
				...newOptions,
				method: "DELETE"
			});
		});
	}
	useMiddlewares(...middlewares) {
		for (const middleware of middlewares) this._middlewares.push(middleware);
		return this;
	}
	_request(path, request) {
		return fetch(path, request);
	}
	_applyMiddlewares(path, options, callback) {
		const baseParams = {
			path,
			fullPath: this._getUrl(path),
			options: {
				...this._baseOptions,
				...options
			}
		};
		const middlewares = this._middlewares.slice();
		let response;
		const execution = async (params) => {
			if (!params) params = baseParams;
			const middleware = middlewares.shift();
			if (!middleware) response = await callback(params.fullPath, params.options);
			else response = await middleware(params, execution) ?? response;
			return response;
		};
		return execution(baseParams);
	}
	_getUrl(path) {
		return `${this._baseUrl}${path}`;
	}
};
var WordList = class {
	words;
	constructor(words) {
		this.words = words;
	}
	toKebab() {
		return this.words.join("-");
	}
	toPascal() {
		return this.words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
	}
	toCamel() {
		return this.words.map((word, i) => i === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1)).join("");
	}
	toSnake() {
		return this.words.join("_");
	}
};
var toWords = (str) => {
	return str.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().split(/\s+/).filter(Boolean);
};
var fromKebab = (str) => new WordList(str.split("-"));
var fromPascal = (str) => new WordList(str.split(/(?=[A-Z])/).map((word) => word.toLowerCase()));
var fromCamel = (str) => new WordList(str.split(/(?=[A-Z])/).map((word) => word.toLowerCase()));
var fromSnake = (str) => new WordList(str.split("_"));
var fromAll = (str) => new WordList(toWords(str).map((word) => word.toLowerCase()));
var formatFrom = {
	kebab: fromKebab,
	pascal: fromPascal,
	camel: fromCamel,
	snake: fromSnake,
	all: fromAll
};
//#endregion
export { PUBLIC_MODE as n, formatFrom as r, HttpClient as t };

//# sourceMappingURL=format-DGOlJxF5.js.map