//#region src/domains/run/utils/user-properties.ts
function parseInkeepJsonHeader(header, opts) {
	if (!header) return void 0;
	try {
		const parsed = JSON.parse(header);
		if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) return parsed;
		opts?.logger?.warn({
			headerName: opts?.headerName,
			valueType: Array.isArray(parsed) ? "array" : typeof parsed
		}, "Inkeep JSON header parsed but is not a plain object; ignoring");
		return;
	} catch (err) {
		opts?.logger?.warn({
			headerName: opts?.headerName,
			error: err instanceof Error ? err.message : String(err)
		}, "Failed to parse Inkeep JSON header; ignoring");
		return;
	}
}
function isAutoMintIdentity(v) {
	if (!v) return false;
	const t = v.identificationType;
	return t === "ANONYMOUS" || t === "COOKIED";
}
function stripIdentificationType(v) {
	if (!v) return v;
	const { identificationType: _drop, ...rest } = v;
	return rest;
}

//#endregion
export { isAutoMintIdentity, parseInkeepJsonHeader, stripIdentificationType };