import{r as $e}from"./character-entities-legacy-BSd6ekHp.js";import{r as Fe}from"./character-reference-invalid-AKrgFUtc.js";import{r as Re}from"./is-decimal-Bg2oiju0.js";import{r as He}from"./is-hexadecimal-yh8m6GRc.js";import{r as Se}from"./is-alphanumerical-_oBzrqVk.js";var z,se;function Ue(){if(se)return z;se=1;var m,D=59;z=F;function F(I){var A="&"+I+";",u;return m=m||document.createElement("i"),m.innerHTML=A,u=m.textContent,u.charCodeAt(u.length-1)===D&&I!=="semi"||u===A?!1:u}return z}var B,ve;function We(){if(ve)return B;ve=1;var m=$e,D=Fe,F=Re(),I=He(),A=Se(),u=Ue();B=qe;var de={}.hasOwnProperty,y=String.fromCharCode,me=Function.prototype,G={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},ue=9,J=10,he=12,xe=32,K=38,pe=59,Ce=60,be=61,we=35,ye=88,Ee=120,ge=65533,E="named",R="hexadecimal",H="decimal",S={};S[R]=16,S[H]=10;var P={};P[E]=A,P[H]=F,P[R]=I;var Q=1,V=2,Y=3,Z=4,ee=5,U=6,re=7,s={};s[Q]="Named character references must be terminated by a semicolon",s[V]="Numeric character references must be terminated by a semicolon",s[Y]="Named character references cannot be empty",s[Z]="Numeric character references cannot be empty",s[ee]="Named character references must be known",s[U]="Numeric character references cannot be disallowed",s[re]="Numeric character references cannot be outside the permissible Unicode range";function qe(e,t){var i={},g,h;t||(t={});for(h in G)g=t[h],i[h]=g??G[h];return(i.position.indent||i.position.start)&&(i.indent=i.position.indent||[],i.position=i.position.start),Ae(e,i)}function Ae(e,t){var i=t.additional,g=t.nonTerminated,h=t.text,ae=t.reference,ne=t.warning,ke=t.textContext,De=t.referenceContext,Ie=t.warningContext,X=t.position,Pe=t.indent||[],j=e.length,v=0,te=-1,x=X.column||1,ie=X.line||1,p="",L=[],q,M,C,f,d,a,r,o,_,O,b,N,w,c,fe,T,$,l,n;for(typeof i=="string"&&(i=i.charCodeAt(0)),T=k(),o=ne?_e:me,v--,j++;++v65535&&(a-=65536,O+=y(a>>>10|55296),a=56320|a&1023),a=O+y(a))):c!==E&&o(Z,l)),a?(oe(),T=k(),v=n-1,x+=n-w+1,L.push(a),$=k(),$.offset++,ae&&ae.call(De,a,{start:T,end:$},e.slice(w-1,n)),T=$):(f=e.slice(w-1,n),p+=f,x+=f.length,v=n-1)}else d===10&&(ie++,te++,x=0),d===d?(p+=y(d),x++):oe();return L.join("");function k(){return{line:ie,column:x,offset:v+(X.offset||0)}}function _e(le,ce){var W=k();W.column+=ce,W.offset+=ce,ne.call(Ie,s[le],W,le)}function oe(){p&&(L.push(p),h&&h.call(ke,p,{start:T,end:k()}),p="")}}function Ne(e){return e>=55296&&e<=57343||e>1114111}function Te(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}return B}export{We as r};