import { markdownSpace } from "../../micromark-util-character/index.js";
import { factorySpace } from "../../micromark-factory-space/index.js";
const blockQuote = {
	continuation: { tokenize: tokenizeBlockQuoteContinuation },
	exit,
	name: "blockQuote",
	tokenize: tokenizeBlockQuoteStart
};
function tokenizeBlockQuoteStart(t, n, r) {
	let i = this;
	return a;
	function a(e) {
		if (e === 62) {
			let n = i.containerState;
			return n.open ||= (t.enter("blockQuote", { _container: !0 }), !0), t.enter("blockQuotePrefix"), t.enter("blockQuoteMarker"), t.consume(e), t.exit("blockQuoteMarker"), o;
		}
		return r(e);
	}
	function o(r) {
		return markdownSpace(r) ? (t.enter("blockQuotePrefixWhitespace"), t.consume(r), t.exit("blockQuotePrefixWhitespace"), t.exit("blockQuotePrefix"), n) : (t.exit("blockQuotePrefix"), n(r));
	}
}
function tokenizeBlockQuoteContinuation(r, i, a) {
	let o = this;
	return s;
	function s(n) {
		return markdownSpace(n) ? factorySpace(r, c, "linePrefix", o.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(n) : c(n);
	}
	function c(e) {
		return r.attempt(blockQuote, i, a)(e);
	}
}
function exit(e) {
	e.exit("blockQuote");
}
export { blockQuote };
