import { encodeCharacterReference } from "../util/encode-character-reference.js";
import { encodeInfo } from "../util/encode-info.js";
import { checkStrong } from "../util/check-strong.js";
strong.peek = strongPeek;
function strong(r, i, a, o) {
	let s = checkStrong(a), c = a.enter("strong"), l = a.createTracker(o), u = l.move(s + s), d = l.move(a.containerPhrasing(r, {
		after: s,
		before: u,
		...l.current()
	})), f = d.charCodeAt(0), p = encodeInfo(o.before.charCodeAt(o.before.length - 1), f, s);
	p.inside && (d = encodeCharacterReference(f) + d.slice(1));
	let m = d.charCodeAt(d.length - 1), h = encodeInfo(o.after.charCodeAt(0), m, s);
	h.inside && (d = d.slice(0, -1) + encodeCharacterReference(m));
	let g = l.move(s + s);
	return c(), a.attentionEncodeSurroundingInfo = {
		after: h.outside,
		before: p.outside
	}, u + d + g;
}
function strongPeek(e, t, n) {
	return n.options.strong || "*";
}
export { strong };
