import { markdownLineEnding as e } from "../../micromark-util-character/index.js";
import { factorySpace as t } from "../../micromark-factory-space/index.js";
//#region ../../node_modules/micromark-core-commonmark/lib/code-indented.js
var n = {
	name: "codeIndented",
	tokenize: i
}, r = {
	partial: !0,
	tokenize: a
};
function i(n, i, a) {
	let o = this;
	return s;
	function s(e) {
		return n.enter("codeIndented"), t(n, c, "linePrefix", 5)(e);
	}
	function c(e) {
		let t = o.events[o.events.length - 1];
		return t && t[1].type === "linePrefix" && t[2].sliceSerialize(t[1], !0).length >= 4 ? l(e) : a(e);
	}
	function l(t) {
		return t === null ? d(t) : e(t) ? n.attempt(r, l, d)(t) : (n.enter("codeFlowValue"), u(t));
	}
	function u(t) {
		return t === null || e(t) ? (n.exit("codeFlowValue"), l(t)) : (n.consume(t), u);
	}
	function d(e) {
		return n.exit("codeIndented"), i(e);
	}
}
function a(n, r, i) {
	let a = this;
	return o;
	function o(r) {
		return a.parser.lazy[a.now().line] ? i(r) : e(r) ? (n.enter("lineEnding"), n.consume(r), n.exit("lineEnding"), o) : t(n, s, "linePrefix", 5)(r);
	}
	function s(t) {
		let n = a.events[a.events.length - 1];
		return n && n[1].type === "linePrefix" && n[2].sliceSerialize(n[1], !0).length >= 4 ? r(t) : e(t) ? o(t) : i(t);
	}
}
//#endregion
export { n as codeIndented };
