import { asciiAlpha as e, asciiAlphanumeric as t, markdownLineEnding as n, markdownLineEndingOrSpace as r, markdownSpace as i } from "../../micromark-util-character/index.js";
import { factorySpace as a } from "../../micromark-factory-space/index.js";
//#region ../../node_modules/micromark-core-commonmark/lib/html-text.js
var o = {
	name: "htmlText",
	tokenize: s
};
function s(o, s, c) {
	let l = this, u, d, f;
	return p;
	function p(e) {
		return o.enter("htmlText"), o.enter("htmlTextData"), o.consume(e), m;
	}
	function m(t) {
		return t === 33 ? (o.consume(t), h) : t === 47 ? (o.consume(t), D) : t === 63 ? (o.consume(t), T) : e(t) ? (o.consume(t), A) : c(t);
	}
	function h(t) {
		return t === 45 ? (o.consume(t), g) : t === 91 ? (o.consume(t), d = 0, b) : e(t) ? (o.consume(t), w) : c(t);
	}
	function g(e) {
		return e === 45 ? (o.consume(e), y) : c(e);
	}
	function _(e) {
		return e === null ? c(e) : e === 45 ? (o.consume(e), v) : n(e) ? (f = _, z(e)) : (o.consume(e), _);
	}
	function v(e) {
		return e === 45 ? (o.consume(e), y) : _(e);
	}
	function y(e) {
		return e === 62 ? R(e) : e === 45 ? v(e) : _(e);
	}
	function b(e) {
		return e === "CDATA[".charCodeAt(d++) ? (o.consume(e), d === 6 ? x : b) : c(e);
	}
	function x(e) {
		return e === null ? c(e) : e === 93 ? (o.consume(e), S) : n(e) ? (f = x, z(e)) : (o.consume(e), x);
	}
	function S(e) {
		return e === 93 ? (o.consume(e), C) : x(e);
	}
	function C(e) {
		return e === 62 ? R(e) : e === 93 ? (o.consume(e), C) : x(e);
	}
	function w(e) {
		return e === null || e === 62 ? R(e) : n(e) ? (f = w, z(e)) : (o.consume(e), w);
	}
	function T(e) {
		return e === null ? c(e) : e === 63 ? (o.consume(e), E) : n(e) ? (f = T, z(e)) : (o.consume(e), T);
	}
	function E(e) {
		return e === 62 ? R(e) : T(e);
	}
	function D(t) {
		return e(t) ? (o.consume(t), O) : c(t);
	}
	function O(e) {
		return e === 45 || t(e) ? (o.consume(e), O) : k(e);
	}
	function k(e) {
		return n(e) ? (f = k, z(e)) : i(e) ? (o.consume(e), k) : R(e);
	}
	function A(e) {
		return e === 45 || t(e) ? (o.consume(e), A) : e === 47 || e === 62 || r(e) ? j(e) : c(e);
	}
	function j(t) {
		return t === 47 ? (o.consume(t), R) : t === 58 || t === 95 || e(t) ? (o.consume(t), M) : n(t) ? (f = j, z(t)) : i(t) ? (o.consume(t), j) : R(t);
	}
	function M(e) {
		return e === 45 || e === 46 || e === 58 || e === 95 || t(e) ? (o.consume(e), M) : N(e);
	}
	function N(e) {
		return e === 61 ? (o.consume(e), P) : n(e) ? (f = N, z(e)) : i(e) ? (o.consume(e), N) : j(e);
	}
	function P(e) {
		return e === null || e === 60 || e === 61 || e === 62 || e === 96 ? c(e) : e === 34 || e === 39 ? (o.consume(e), u = e, F) : n(e) ? (f = P, z(e)) : i(e) ? (o.consume(e), P) : (o.consume(e), I);
	}
	function F(e) {
		return e === u ? (o.consume(e), u = void 0, L) : e === null ? c(e) : n(e) ? (f = F, z(e)) : (o.consume(e), F);
	}
	function I(e) {
		return e === null || e === 34 || e === 39 || e === 60 || e === 61 || e === 96 ? c(e) : e === 47 || e === 62 || r(e) ? j(e) : (o.consume(e), I);
	}
	function L(e) {
		return e === 47 || e === 62 || r(e) ? j(e) : c(e);
	}
	function R(e) {
		return e === 62 ? (o.consume(e), o.exit("htmlTextData"), o.exit("htmlText"), s) : c(e);
	}
	function z(e) {
		return o.exit("htmlTextData"), o.enter("lineEnding"), o.consume(e), o.exit("lineEnding"), B;
	}
	function B(e) {
		return i(e) ? a(o, V, "linePrefix", l.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(e) : V(e);
	}
	function V(e) {
		return o.enter("htmlTextData"), f(e);
	}
}
//#endregion
export { o as htmlText };
