return u()}());case'"':return x?(u(),a("string",e)):void(e+=u());case"'":return x?void(e+=u()):(u(),a("string",e));case`
`:case"\r":throw E(u());case"\u2028":case"\u2029":D=A,console.warn(`JSON11: '${P(D)}' in strings is not valid ECMAScript; consider escaping`);break;case void 0:throw E(u())}var D;e+=u()},start(){switch(A){case"{":case"[":return a("punctuator",u());case void 0:return a("eof")}C="value"},beforePropertyName(){switch(A){case"$":case"_":return e=u(),void(C="identifierName");case"\\":return u(),void(C="identifierNameStartEscape");case"}":return a("punctuator",u());case'"':case"'":return x=u()==='"',void(C="string")}if(T(A))return e+=u(),void(C="identifierName");throw E(u())},afterPropertyName(){if(A===":")return a("punctuator",u());throw E(u())},beforePropertyValue(){C="value"},afterPropertyValue(){switch(A){case",":case"}":return a("punctuator",u())}throw E(u())},beforeArrayValue(){if(A==="]")return a("punctuator",u());C="value"},afterArrayValue(){switch(A){case",":case"]":return a("punctuator",u())}throw E(u())},end(){throw E(u())}},L={start(){if(r.type==="eof")throw o();B()},beforePropertyName(){switch(r.type){case"identifier":case"string":return S=r.value,void(p="afterPropertyName");case"punctuator":return void F();case"eof":throw o()}},afterPropertyName(){if(r.type==="eof")throw o();p="beforePropertyValue"},beforePropertyValue(){if(r.type==="eof")throw o();B()},beforeArrayValue(){if(r.type==="eof")throw o();r.type!=="punctuator"||r.value!=="]"?B():F()},afterPropertyValue(){if(r.type==="eof")throw o();switch(r.value){case",":return void(p="beforePropertyName");case"}":F()}},afterArrayValue(){if(r.type==="eof")throw o();switch(r.value){case",":return void(p="beforeArrayValue");case"]":F()}},end(){}};do r=j(),L[p]();while(r.type!=="eof");return typeof s=="function"?function D(t,c,k){const y=t[c];if(y!=null&&typeof y=="object")if(Array.isArray(y))for(let _=0;_<y.length;_++){const M=String(_),G=D(y,M,k);Object.defineProperty(y,M,{value:G,writable:!0,enumerable:!0,configurable:!0})}else for(const _ in y){const M=D(y,_,k);M===void 0?delete y[_]:Object.defineProperty(y,_,{value:M,writable:!0,enumerable:!0,configurable:!0})}return k.call(t,c,y)}({"":O},"",s):O;function j(){for(C="default",e="",x=!1,f=1;;){A=g();const D=J[C]();if(D)return D}}function g(){if(w[$])return String.fromCodePoint(w.codePointAt($))}function u(){const D=g();return D===`
`?(v++,h=0):D?h+=D.length:h++,D&&($+=D.length),D}function a(D,t){return{type:D,value:t,line:v,column:h}}function b(D,t){const c=D*Number(t);if(V!=null&&V.withLongNumerals&&(c>Number.MAX_SAFE_INTEGER||c<Number.MIN_SAFE_INTEGER))try{return a("bigint",BigInt(D)*BigInt(t))}catch(k){console.warn(k)}return a("numeric",c)}function N(D){for(const t of D){if(g()!==t)throw E(u());u()}}function n(){let D="",t=4;for(;t-- >0;){const c=g();if(!z(c))throw E(u());D+=u()}return String.fromCodePoint(parseInt(D,16))}function B(){let D;switch(r.type){case"punctuator":switch(r.value){case"{":D={};break;case"[":D=[]}break;case"null":case"boolean":case"numeric":case"string":case"bigint":D=r.value}if(O===void 0)O=D;else{const t=m[m.length-1];Array.isArray(t)?t.push(D):Object.defineProperty(t,S,{value:D,writable:!0,enumerable:!0,configurable:!0})}if(D!==null&&typeof D=="object")m.push(D),p=Array.isArray(D)?"beforeArrayValue":"beforePropertyName";else{const t=m[m.length-1];p=t==null?"end":Array.isArray(t)?"afterArrayValue":"afterPropertyValue"}}function F(){m.pop();const D=m[m.length-1];p=D==null?"end":Array.isArray(D)?"afterArrayValue":"afterPropertyValue"}function E(D){return d(D===void 0?`JSON11: invalid end of input at ${v}:${h}`:`JSON11: invalid character '${P(D)}' at ${v}:${h}`)}function o(){return d(`JSON11: invalid end of input at ${v}:${h}`)}function l(){return h-=5,d(`JSON11: invalid identifier character at ${v}:${h}`)}function P(D){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","	":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[D])return t[D];if(D<" "){const c=D.charCodeAt(0).toString(16);return"\\x"+("00"+c).substring(c.length)}return D}function d(D){const t=new SyntaxError(D);return Object.defineProperty(t,"lineNumber",{value:v,writable:!0,enumerable:!0,configurable:!0}),Object.defineProperty(t,"columnNumber",{value:h,writable:!0,enumerable:!0,configurable:!0}),t}},exports.stringify=function(i,s,V,r){var g,u,a,b,N;const S=[];let O,C,e,x,f,A="",w="",p=function(n){if(n.length===0)return j(n);const B=String.fromCodePoint(n.codePointAt(0));if(!T(B))return j(n);for(let F=B.length;F<n.length;F++)if(!q(String.fromCodePoint(n.codePointAt(F))))return j(n);return n},m="";const $={"'":.1,'"':.2};if(s==null||typeof s!="object"||Array.isArray(s)){if(typeof s=="function")C=s;else if(Array.isArray(s)){O=[];const n=new Set;for(const B of s){const F=(g=B==null?void 0:B.toString)==null?void 0:g.call(B);F!==void 0&&n.add(F)}O=[...n]}w=J(V),e=(a=(u=r==null?void 0:r.quote)==null?void 0:u.trim)==null?void 0:a.call(u),(r==null?void 0:r.quoteNames)===!0&&(p=j),x=r==null?void 0:r.withBigInt,f=(r==null?void 0:r.withLegacyEscapes)===!0,r!=null&&r.trailingComma&&(m=",")}else w=J(s.space),s.trailingComma&&(m=","),e=(N=(b=s.quote)==null?void 0:b.trim)==null?void 0:N.call(b),s.quoteNames===!0&&(p=j),typeof s.replacer=="function"&&(C=s.replacer),x=s.withBigInt,f=s.withLegacyEscapes===!0;const v={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","	":"\\t","\v":f?"\\v":"\\u000b","\0":f?"\\0":"\\u0000","\u2028":"\\u2028","\u2029":"\\u2029"},h=f?"\\x00":"\\u0000";return L("",{"":i});function J(n){if(typeof n=="number"||n instanceof Number){const B=Number(n);if(isFinite(B)&&B>0)return" ".repeat(Math.min(10,Math.floor(B)))}else if(typeof n=="string"||n instanceof String)return n.substring(0,10);return""}function L(n,B){let F=B[n];switch(F!=null&&(typeof F.toJSON11=="function"?F=F.toJSON11(n):typeof F.toJSON5=="function"?F=F.toJSON5(n):typeof F.toJSON=="function"&&(F=F.toJSON(n))),C&&(F=C.call(B,n,F)),F instanceof Number?F=Number(F):F instanceof String?F=String(F):F instanceof Boolean&&(F=F.valueOf()),F){case null:return"null";case!0:return"true";case!1:return"false"}return typeof F=="string"?j(F):typeof F=="number"?String(F):typeof F=="bigint"?F.toString()+(x===!1?"":"n"):typeof F=="object"?Array.isArray(F)?function(E){if(S.includes(E))throw TypeError("Converting circular structure to JSON11");S.push(E);let o=A;A+=w;let l,P=[];for(let d=0;d<E.length;d++){const D=L(String(d),E);P.push(D!==void 0?D:"null")}if(P.length===0)l="[]";else if(w==="")l="["+P.join(",")+"]";else{let d=P.join(`,
`+A);l=`[
`+A+d+m+`
`+o+"]"}return S.pop(),A=o,l}(F):function(E){if(S.includes(E))throw TypeError("Converting circular structure to JSON11");S.push(E);let o=A;A+=w;let l,P=O||Object.keys(E),d=[];for(const D of P){const t=L(D,E);if(t!==void 0){let c=p(D)+":";w!==""&&(c+=" "),c+=t,d.push(c)}}if(d.length===0)l="{}";else{let D;w===""?(D=d.join(","),l="{"+D+"}"):(D=d.join(`,
`+A),l=`{
`+A+D+m+`
`+o+"}")}return S.pop(),A=o,l}(F):void 0}function j(n){let B="";for(let E=0;E<n.length;E++){const o=n[E];switch(o){case"'":case'"':$[o]++,B+=o;continue;case"\0":if(I(n[E+1])){B+=h;continue}}if(v[o])B+=v[o];else if(o<" "){let l=o.charCodeAt(0).toString(16);B+=f?"\\x"+("00"+l).substring(l.length):"\\u"+l.padStart(4,"0")}else B+=o}const F=e||Object.keys($).reduce((E,o)=>$[E]<$[o]?E:o);return B=B.replace(new RegExp(F,"g"),v[F]),F+B+F}};
//# sourceMappingURL=index.min.cjs.map
