@agentica/chat 0.18.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,7 +107,7 @@ only one thing due to lack of specificity or homogeneity of candidate functions.
107
107
 
108
108
  Additionally, if you A.I. agent wants to cancel same function multiply, you can
109
109
  do it by assigning the same function name multiply in the \`functions\` property.`,validate:(()=>{const o=G=>Array.isArray(G.functions)&&G.functions.every(J=>typeof J=="object"&&J!==null&&h(J)),h=G=>typeof G.reason=="string"&&typeof G.name=="string",b=(G,J,U=!0)=>[(Array.isArray(G.functions)||B(U,{path:J+".functions",expected:"Array<___IChatFunctionReference>",value:G.functions}))&&G.functions.map((nt,at)=>(typeof nt=="object"&&nt!==null||B(U,{path:J+".functions["+at+"]",expected:"___IChatFunctionReference",value:nt}))&&k(nt,J+".functions["+at+"]",U)||B(U,{path:J+".functions["+at+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||B(U,{path:J+".functions",expected:"Array<___IChatFunctionReference>",value:G.functions})].every(nt=>nt),k=(G,J,U=!0)=>[typeof G.reason=="string"||B(U,{path:J+".reason",expected:"string",value:G.reason}),typeof G.name=="string"||B(U,{path:J+".name",expected:"string",value:G.name})].every(nt=>nt),O=G=>typeof G=="object"&&G!==null&&o(G);let P,B;return G=>{if(O(G)===!1){P=[],B=nP(P),((U,nt,at=!0)=>(typeof U=="object"&&U!==null||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:U}))&&b(U,nt+"",!0)||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:U}))(G,"$input",!0);const J=P.length===0;return J?{success:J,data:G}:{success:J,errors:P,data:G}}return{success:!0,data:G}}})()}]};async function oDn(o){var P;if(o.operations.divided===void 0)return Emt(o,o.operations.array,0);const h=o.operations.divided.map(()=>[]),b=[],k=await Promise.all(o.operations.divided.map(async(B,G)=>Emt({...o,stack:h[G],dispatch:async J=>{b.push(J)}},B,0)));if(h.every(B=>B.length===0))return k[0];if((((P=o.config)==null?void 0:P.eliticism)??nT.ELITICISM)===!0)return Emt(o,h.flat().map(B=>o.operations.group.get(B.operation.controller.name).get(B.operation.function.name)),0);const O=sbt({id:ejt(),selections:[]});for(const B of b)B.type==="select"&&(O.selections.push(B.selection),ajt(o,{name:B.selection.operation.name,reason:B.selection.reason}));return[O]}async function Emt(o,h,b,k){var J,U,nt,at;const O=await o.request("cancel",{messages:[{role:"system",content:Gj.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(h.map(it=>({name:it.name,description:it.function.description,...it.protocol==="http"?{method:it.function.method,path:it.function.path,tags:it.function.tags}:{}})))},...o.histories.map(Uj).flat(),{role:"user",content:o.prompt.text},{role:"system",content:((nt=(U=(J=o.config)==null?void 0:J.systemPrompt)==null?void 0:U.cancel)==null?void 0:nt.call(U,o.histories))??eP.CANCEL},...sDn(k??[])],tools:aDn.functions.map(it=>({type:"function",function:{name:it.name,description:it.description,parameters:it.parameters}})),tool_choice:"auto",parallel_tool_calls:!0}),P=await Z8.readAll(O),B=p6.merge(P);if(b++<(((at=o.config)==null?void 0:at.retry)??nT.RETRY)){const it=[];for(const st of B.choices)for(const tt of st.message.tool_calls??[]){if(tt.function.name!=="cancelFunctions")continue;const Et=JSON.parse(tt.function.arguments),Lt=(()=>{const Dt=Wn=>Array.isArray(Wn.functions)&&Wn.functions.every(cr=>typeof cr=="object"&&cr!==null&&ae(cr)),ae=Wn=>typeof Wn.reason=="string"&&typeof Wn.name=="string",qt=(Wn,cr,ar=!0)=>[(Array.isArray(Wn.functions)||Mn(ar,{path:cr+".functions",expected:"Array<___IChatFunctionReference>",value:Wn.functions}))&&Wn.functions.map((bn,Vn)=>(typeof bn=="object"&&bn!==null||Mn(ar,{path:cr+".functions["+Vn+"]",expected:"___IChatFunctionReference",value:bn}))&&_e(bn,cr+".functions["+Vn+"]",ar)||Mn(ar,{path:cr+".functions["+Vn+"]",expected:"___IChatFunctionReference",value:bn})).every(bn=>bn)||Mn(ar,{path:cr+".functions",expected:"Array<___IChatFunctionReference>",value:Wn.functions})].every(bn=>bn),_e=(Wn,cr,ar=!0)=>[typeof Wn.reason=="string"||Mn(ar,{path:cr+".reason",expected:"string",value:Wn.reason}),typeof Wn.name=="string"||Mn(ar,{path:cr+".name",expected:"string",value:Wn.name})].every(bn=>bn),gn=Wn=>typeof Wn=="object"&&Wn!==null&&Dt(Wn);let ge,Mn;return Wn=>{if(gn(Wn)===!1){ge=[],Mn=nP(ge),((ar,bn,Vn=!0)=>(typeof ar=="object"&&ar!==null||Mn(!0,{path:bn+"",expected:"__IChatFunctionReference.IProps",value:ar}))&&qt(ar,bn+"",!0)||Mn(!0,{path:bn+"",expected:"__IChatFunctionReference.IProps",value:ar}))(Wn,"$input",!0);const cr=ge.length===0;return cr?{success:cr,data:Wn}:{success:cr,errors:ge,data:Wn}}return{success:!0,data:Wn}}})()(Et);Lt.success===!1&&it.push({id:tt.id,name:tt.function.name,validation:Lt})}if(it.length>0)return Emt(o,h,b,it)}const G=[];for(const it of B.choices)if(it.message.tool_calls!=null)for(const st of it.message.tool_calls){if(st.type!=="function"||st.function.name!=="cancelFunctions")continue;const tt=(()=>{const Lt=qt=>Array.isArray(qt.functions)&&qt.functions.every(_e=>typeof _e=="object"&&_e!==null&&Dt(_e)),Dt=qt=>typeof qt.reason=="string"&&typeof qt.name=="string",ae=qt=>typeof qt=="object"&&qt!==null&&Lt(qt);return qt=>(qt=JSON.parse(qt),ae(qt)?qt:null)})()(st.function.arguments);if(tt===null)continue;const Et=sbt({id:st.id,selections:[]});for(const Lt of tt.functions){const Dt=ajt(o,Lt);Dt!==null&&Et.selections.push(Dt)}Et.selections.length!==0&&G.push(Et)}return G}function sDn(o){return o.map(h=>[{role:"assistant",tool_calls:[{type:"function",id:h.id,function:{name:h.name,arguments:JSON.stringify(h.validation.data)}}]},{role:"tool",content:JSON.stringify(h.validation.errors),tool_call_id:h.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
110
- `)}]).flat()}class cDn{constructor(){this.queue=[],this.resolvers=[],this.closeResolvers=[],this.emptyResolvers=[],this.closed=!1}enqueue(h){var b;this.queue.push(h),this.resolvers.length>0&&((b=this.resolvers.shift())==null||b({value:this.queue.shift(),done:!1}))}async dequeue(){return this.queue.length>0?{value:this.queue.shift(),done:!1}:this.closed?(this.emptyResolvers.length>0&&(this.emptyResolvers.forEach(h=>h()),this.emptyResolvers=[]),{value:void 0,done:!0}):new Promise(h=>this.resolvers.push(h))}isEmpty(){return this.queue.length===0}isClosed(){return this.closed}done(){return this.isClosed()&&this.isEmpty()}close(){var h;for(this.closed=!0;this.resolvers.length>0;)(h=this.resolvers.shift())==null||h({value:void 0,done:!0});this.closeResolvers.forEach(b=>b())}async waitUntilEmpty(){return this.isEmpty()?Promise.resolve():new Promise(h=>{this.emptyResolvers.push(h)})}async waitClosed(){return this.isClosed()?Promise.resolve():new Promise(h=>{this.closeResolvers.push(h)})}}class M7e{constructor(){this.queue=new cDn,this.consumer=new ReadableStream({pull:async h=>{const{value:b,done:k}=await this.queue.dequeue();if(k===!0){h.close();return}h.enqueue(b)}})}produce(h){this.queue.enqueue(h)}close(){this.queue.close()}done(){return this.queue.done()}async waitClosed(){await this.queue.waitClosed()}async waitUntilEmpty(){await this.queue.waitUntilEmpty()}}async function uDn(o,h){var B,G,J;if(h.length===0)return[];const b=await o.request("describe",{messages:[{role:"system",content:Gj.write(o.config)},...h.map(Uj).flat(),{role:"system",content:((J=(G=(B=o.config)==null?void 0:B.systemPrompt)==null?void 0:G.describe)==null?void 0:J.call(G,h))??eP.DESCRIBE}]}),k=[],O=await Z8.reduce(b,async(U,nt)=>{const at=await U,it=st=>{for(const tt of st){if(tt.finish_reason!=null){k[tt.index].mpsc.close();continue}if(tt.delta.content==null)continue;if(k[tt.index]!=null){k[tt.index].content+=tt.delta.content,k[tt.index].mpsc.produce(tt.delta.content);continue}const Et=new M7e;k[tt.index]={content:tt.delta.content,mpsc:Et},Et.produce(tt.delta.content),o.dispatch(ELn({executes:h,stream:ubt(Et.consumer.getReader()),done:()=>Et.done(),get:()=>{var Lt;return((Lt=k[tt.index])==null?void 0:Lt.content)??""},join:async()=>(await Et.waitClosed(),k[tt.index].content)})).catch(()=>{})}};return at.object==="chat.completion.chunk"?(it([at,nt].flatMap(st=>st.choices)),p6.merge([at,nt])):(it(nt.choices),p6.accumulate(at,nt))});if(O==null)throw new Error("No completion received");return O.choices.map(U=>U.message.role==="assistant"?U.message.content:null).filter(U=>U!==null).map(U=>T7e({executes:h,text:U}))}const smt=[{name:"getApiFunctions",parameters:{description:"Current Type: {@link object}",type:"object",properties:{},required:[],additionalProperties:!1,$defs:{RecordstringIChatGptSchema:{description:"Construct a type with a set of properties K of type T",type:"object",properties:{},required:[],additionalProperties:{$ref:"#/$defs/IChatGptSchema"}},IChatGptSchema:{title:"Type schema info of the ChatGPT",description:`Type schema info of the ChatGPT.
110
+ `)}]).flat()}class cDn extends Error{constructor(h){super(h),this.name="AsyncQueueClosedError"}}class uDn{constructor(){this.queue=[],this.resolvers=[],this.closeResolvers=[],this.emptyResolvers=[],this.closed=!1}enqueue(h){var b;if(this.closed){console.error(new cDn("Cannot enqueue item: queue is closed."));return}this.queue.push(h),this.resolvers.length>0&&((b=this.resolvers.shift())==null||b({value:this.queue.shift(),done:!1}))}async dequeue(){const h=this.isEmpty()?this.isClosed()?{value:void 0,done:!0}:null:{value:this.queue.shift(),done:!1};return this.isEmpty()&&this.emptyResolvers.length!==0&&(this.emptyResolvers.forEach(b=>b()),this.emptyResolvers=[]),h!==null?h:new Promise(b=>this.resolvers.push(b))}isEmpty(){return this.queue.length===0}isClosed(){return this.closed}done(){return this.isClosed()&&this.isEmpty()}close(){var h;for(this.closed=!0;this.resolvers.length>0;)(h=this.resolvers.shift())==null||h({value:void 0,done:!0});this.closeResolvers.forEach(b=>b())}async waitUntilEmpty(){return this.isEmpty()?Promise.resolve():new Promise(h=>{this.emptyResolvers.push(h)})}async waitClosed(){return this.isClosed()?Promise.resolve():new Promise(h=>{this.closeResolvers.push(h)})}}class M7e{constructor(){this.queue=new uDn,this.consumer=new ReadableStream({pull:async h=>{const{value:b,done:k}=await this.queue.dequeue();if(k===!0){h.close();return}h.enqueue(b)}})}produce(h){this.queue.enqueue(h)}close(){this.queue.close()}done(){return this.queue.done()}async waitClosed(){await this.queue.waitClosed()}async waitUntilEmpty(){await this.queue.waitUntilEmpty()}}async function lDn(o,h){var B,G,J;if(h.length===0)return[];const b=await o.request("describe",{messages:[{role:"system",content:Gj.write(o.config)},...h.map(Uj).flat(),{role:"system",content:((J=(G=(B=o.config)==null?void 0:B.systemPrompt)==null?void 0:G.describe)==null?void 0:J.call(G,h))??eP.DESCRIBE}]}),k=[],O=await Z8.reduce(b,async(U,nt)=>{const at=await U,it=st=>{for(const tt of st){if(tt.finish_reason!=null){k[tt.index].mpsc.close();continue}if(tt.delta.content==null)continue;if(k[tt.index]!=null){k[tt.index].content+=tt.delta.content,k[tt.index].mpsc.produce(tt.delta.content);continue}const Et=new M7e;k[tt.index]={content:tt.delta.content,mpsc:Et},Et.produce(tt.delta.content),o.dispatch(ELn({executes:h,stream:ubt(Et.consumer.getReader()),done:()=>Et.done(),get:()=>{var Lt;return((Lt=k[tt.index])==null?void 0:Lt.content)??""},join:async()=>(await Et.waitClosed(),k[tt.index].content)})).catch(()=>{})}};return at.object==="chat.completion.chunk"?(it([at,nt].flatMap(st=>st.choices)),p6.merge([at,nt])):(it(nt.choices),p6.accumulate(at,nt))});if(O==null)throw new Error("No completion received");return O.choices.map(U=>U.message.role==="assistant"?U.message.content:null).filter(U=>U!==null).map(U=>T7e({executes:h,text:U}))}const smt=[{name:"getApiFunctions",parameters:{description:"Current Type: {@link object}",type:"object",properties:{},required:[],additionalProperties:!1,$defs:{RecordstringIChatGptSchema:{description:"Construct a type with a set of properties K of type T",type:"object",properties:{},required:[],additionalProperties:{$ref:"#/$defs/IChatGptSchema"}},IChatGptSchema:{title:"Type schema info of the ChatGPT",description:`Type schema info of the ChatGPT.
111
111
 
112
112
  \`IChatGptSchema\` is a type schema info of the ChatGPT function calling.
113
113
 
@@ -3175,7 +3175,7 @@ call this \`getApiFunctions()\` to get the list of candidate API functions
3175
3175
  provided from this application.
3176
3176
 
3177
3177
  Also, user just wants to list up every remote API functions that can be
3178
- called from the backend server, utilize this function too.`,validate:(()=>{const o=P=>!0,h=(P,B,G=!0)=>!0,b=P=>typeof P=="object"&&P!==null&&Array.isArray(P)===!1&&o();let k,O;return P=>{if(b(P)===!1){k=[],O=nP(k),((G,J,U=!0)=>(typeof G=="object"&&G!==null&&Array.isArray(G)===!1||O(!0,{path:J+"",expected:"object",value:G}))&&h(G,J+"",!0)||O(!0,{path:J+"",expected:"object",value:G}))(P,"$input",!0);const B=k.length===0;return B?{success:B,data:P}:{success:B,errors:k,data:P}}return{success:!0,data:P}}})()}][0];async function lDn(o){var P,B,G;const h=await o.request("initialize",{messages:[{role:"system",content:Gj.write(o.config)},...o.histories.map(Uj).flat(),{role:"user",content:o.prompt.text},{role:"system",content:((G=(B=(P=o.config)==null?void 0:P.systemPrompt)==null?void 0:B.initialize)==null?void 0:G.call(B,o.histories))??eP.INITIALIZE}],tools:[{type:"function",function:{name:smt.name,description:smt.description,parameters:smt.parameters}}],tool_choice:"auto",parallel_tool_calls:!1}),b=[],k=await Z8.reduce(h,async(J,U)=>{const nt=await J,at=it=>{var st;for(const tt of it){if(tt.finish_reason!=null){(st=b[tt.index])==null||st.mpsc.close();continue}if(tt.delta.content==null||tt.delta.content.length===0)continue;if(b[tt.index]!=null){b[tt.index].content+=tt.delta.content,b[tt.index].mpsc.produce(tt.delta.content);continue}const Et=new M7e;b[tt.index]={content:tt.delta.content,mpsc:Et},Et.produce(tt.delta.content),o.dispatch(cbt({role:"assistant",stream:ubt(Et.consumer.getReader()),done:()=>Et.done(),get:()=>b[tt.index].content,join:async()=>(await Et.waitClosed(),b[tt.index].content)})).catch(()=>{})}};return nt.object==="chat.completion.chunk"?(at([nt,U].flatMap(it=>it.choices)),p6.merge([nt,U])):(at(U.choices),p6.accumulate(nt,U))});if(k===null)throw new Error("No completion received");const O=[];for(const J of k.choices)J.message.role==="assistant"&&J.message.content!=null&&J.message.content.length!==0&&O.push(PX({role:"assistant",text:J.message.content}));return k.choices.some(J=>J.message.tool_calls!=null&&J.message.tool_calls.some(U=>U.type==="function"&&U.function.name===smt.name))&&await o.initialize(),O}async function D7e(o,h){const b=o.operations.flat.get(h.name);if(b===void 0)return null;const k=qj({operation:b,reason:h.reason});return o.stack.push(k),o.dispatch(xLn({selection:k})).catch(()=>{}),b}const hDn={functions:[{name:"selectFunctions",parameters:{description:` Properties of the function
3178
+ called from the backend server, utilize this function too.`,validate:(()=>{const o=P=>!0,h=(P,B,G=!0)=>!0,b=P=>typeof P=="object"&&P!==null&&Array.isArray(P)===!1&&o();let k,O;return P=>{if(b(P)===!1){k=[],O=nP(k),((G,J,U=!0)=>(typeof G=="object"&&G!==null&&Array.isArray(G)===!1||O(!0,{path:J+"",expected:"object",value:G}))&&h(G,J+"",!0)||O(!0,{path:J+"",expected:"object",value:G}))(P,"$input",!0);const B=k.length===0;return B?{success:B,data:P}:{success:B,errors:k,data:P}}return{success:!0,data:P}}})()}][0];async function hDn(o){var P,B,G;const h=await o.request("initialize",{messages:[{role:"system",content:Gj.write(o.config)},...o.histories.map(Uj).flat(),{role:"user",content:o.prompt.text},{role:"system",content:((G=(B=(P=o.config)==null?void 0:P.systemPrompt)==null?void 0:B.initialize)==null?void 0:G.call(B,o.histories))??eP.INITIALIZE}],tools:[{type:"function",function:{name:smt.name,description:smt.description,parameters:smt.parameters}}],tool_choice:"auto",parallel_tool_calls:!1}),b=[],k=await Z8.reduce(h,async(J,U)=>{const nt=await J,at=it=>{var st;for(const tt of it){if(tt.finish_reason!=null){(st=b[tt.index])==null||st.mpsc.close();continue}if(tt.delta.content==null||tt.delta.content.length===0)continue;if(b[tt.index]!=null){b[tt.index].content+=tt.delta.content,b[tt.index].mpsc.produce(tt.delta.content);continue}const Et=new M7e;b[tt.index]={content:tt.delta.content,mpsc:Et},Et.produce(tt.delta.content),o.dispatch(cbt({role:"assistant",stream:ubt(Et.consumer.getReader()),done:()=>Et.done(),get:()=>b[tt.index].content,join:async()=>(await Et.waitClosed(),b[tt.index].content)})).catch(()=>{})}};return nt.object==="chat.completion.chunk"?(at([nt,U].flatMap(it=>it.choices)),p6.merge([nt,U])):(at(U.choices),p6.accumulate(nt,U))});if(k===null)throw new Error("No completion received");const O=[];for(const J of k.choices)J.message.role==="assistant"&&J.message.content!=null&&J.message.content.length!==0&&O.push(PX({role:"assistant",text:J.message.content}));return k.choices.some(J=>J.message.tool_calls!=null&&J.message.tool_calls.some(U=>U.type==="function"&&U.function.name===smt.name))&&await o.initialize(),O}async function D7e(o,h){const b=o.operations.flat.get(h.name);if(b===void 0)return null;const k=qj({operation:b,reason:h.reason});return o.stack.push(k),o.dispatch(xLn({selection:k})).catch(()=>{}),b}const fDn={functions:[{name:"selectFunctions",parameters:{description:` Properties of the function
3179
3179
 
3180
3180
  ------------------------------
3181
3181
 
@@ -3195,17 +3195,17 @@ them all into the \`functions\` property.
3195
3195
  Also, if you A.I. agent can't specify a specific function to call due to lack
3196
3196
  of specificity or homogeneity of candidate functions, just assign all of them
3197
3197
  by in the\` functions\` property\` too. Instead, when you A.I. agent can specify
3198
- a specific function to call, the others would be eliminated.`,validate:(()=>{const o=G=>Array.isArray(G.functions)&&G.functions.every(J=>typeof J=="object"&&J!==null&&h(J)),h=G=>typeof G.reason=="string"&&typeof G.name=="string",b=(G,J,U=!0)=>[(Array.isArray(G.functions)||B(U,{path:J+".functions",expected:"Array<___IChatFunctionReference>",value:G.functions}))&&G.functions.map((nt,at)=>(typeof nt=="object"&&nt!==null||B(U,{path:J+".functions["+at+"]",expected:"___IChatFunctionReference",value:nt}))&&k(nt,J+".functions["+at+"]",U)||B(U,{path:J+".functions["+at+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||B(U,{path:J+".functions",expected:"Array<___IChatFunctionReference>",value:G.functions})].every(nt=>nt),k=(G,J,U=!0)=>[typeof G.reason=="string"||B(U,{path:J+".reason",expected:"string",value:G.reason}),typeof G.name=="string"||B(U,{path:J+".name",expected:"string",value:G.name})].every(nt=>nt),O=G=>typeof G=="object"&&G!==null&&o(G);let P,B;return G=>{if(O(G)===!1){P=[],B=nP(P),((U,nt,at=!0)=>(typeof U=="object"&&U!==null||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:U}))&&b(U,nt+"",!0)||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:U}))(G,"$input",!0);const J=P.length===0;return J?{success:J,data:G}:{success:J,errors:P,data:G}}return{success:!0,data:G}}})()}]};async function fDn(o){var P;if(o.operations.divided===void 0)return Tmt(o,o.operations.array,0);const h=o.operations.divided.map(()=>[]),b=[],k=await Promise.all(o.operations.divided.map(async(B,G)=>Tmt({...o,stack:h[G],dispatch:async J=>{b.push(J)}},B,0)));if(h.every(B=>B.length===0))return k[0];if((((P=o.config)==null?void 0:P.eliticism)??nT.ELITICISM)===!0)return Tmt(o,h.flat().map(B=>o.operations.group.get(B.operation.controller.name).get(B.operation.function.name)),0);const O=obt({id:ejt(),selections:[]});for(const B of b)B.type==="select"&&(O.selections.push(B.selection),await D7e(o,{name:B.selection.operation.name,reason:B.selection.reason}));return[O]}async function Tmt(o,h,b,k){var J,U,nt,at;const O=await o.request("select",{messages:[{role:"system",content:Gj.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(h.map(it=>({name:it.name,description:it.function.description,...it.protocol==="http"?{method:it.function.method,path:it.function.path,tags:it.function.tags}:{}})))},...o.histories.map(Uj).flat(),{role:"user",content:o.prompt.text},{role:"system",content:((nt=(U=(J=o.config)==null?void 0:J.systemPrompt)==null?void 0:U.select)==null?void 0:nt.call(U,o.histories))??eP.SELECT},...dDn(k??[])],tools:hDn.functions.map(it=>({type:"function",function:{name:it.name,description:it.description,parameters:it.parameters}})),tool_choice:"auto",parallel_tool_calls:!1}),P=await Z8.readAll(O),B=p6.merge(P);if(b++<(((at=o.config)==null?void 0:at.retry)??nT.RETRY)){const it=[];for(const st of B.choices)for(const tt of st.message.tool_calls??[]){if(tt.function.name!=="selectFunctions")continue;const Et=JSON.parse(tt.function.arguments),Lt=(()=>{const Dt=Wn=>Array.isArray(Wn.functions)&&Wn.functions.every(cr=>typeof cr=="object"&&cr!==null&&ae(cr)),ae=Wn=>typeof Wn.reason=="string"&&typeof Wn.name=="string",qt=(Wn,cr,ar=!0)=>[(Array.isArray(Wn.functions)||Mn(ar,{path:cr+".functions",expected:"Array<___IChatFunctionReference>",value:Wn.functions}))&&Wn.functions.map((bn,Vn)=>(typeof bn=="object"&&bn!==null||Mn(ar,{path:cr+".functions["+Vn+"]",expected:"___IChatFunctionReference",value:bn}))&&_e(bn,cr+".functions["+Vn+"]",ar)||Mn(ar,{path:cr+".functions["+Vn+"]",expected:"___IChatFunctionReference",value:bn})).every(bn=>bn)||Mn(ar,{path:cr+".functions",expected:"Array<___IChatFunctionReference>",value:Wn.functions})].every(bn=>bn),_e=(Wn,cr,ar=!0)=>[typeof Wn.reason=="string"||Mn(ar,{path:cr+".reason",expected:"string",value:Wn.reason}),typeof Wn.name=="string"||Mn(ar,{path:cr+".name",expected:"string",value:Wn.name})].every(bn=>bn),gn=Wn=>typeof Wn=="object"&&Wn!==null&&Dt(Wn);let ge,Mn;return Wn=>{if(gn(Wn)===!1){ge=[],Mn=nP(ge),((ar,bn,Vn=!0)=>(typeof ar=="object"&&ar!==null||Mn(!0,{path:bn+"",expected:"__IChatFunctionReference.IProps",value:ar}))&&qt(ar,bn+"",!0)||Mn(!0,{path:bn+"",expected:"__IChatFunctionReference.IProps",value:ar}))(Wn,"$input",!0);const cr=ge.length===0;return cr?{success:cr,data:Wn}:{success:cr,errors:ge,data:Wn}}return{success:!0,data:Wn}}})()(Et);Lt.success===!1&&it.push({id:tt.id,name:tt.function.name,validation:Lt})}if(it.length>0)return Tmt(o,h,b,it)}const G=[];for(const it of B.choices){if(it.message.tool_calls!=null)for(const st of it.message.tool_calls){if(st.type!=="function"||st.function.name!=="selectFunctions")continue;const tt=(()=>{const Lt=qt=>Array.isArray(qt.functions)&&qt.functions.every(_e=>typeof _e=="object"&&_e!==null&&Dt(_e)),Dt=qt=>typeof qt.reason=="string"&&typeof qt.name=="string",ae=qt=>typeof qt=="object"&&qt!==null&&Lt(qt);return qt=>(qt=JSON.parse(qt),ae(qt)?qt:null)})()(st.function.arguments);if(tt===null)continue;const Et=obt({id:st.id,selections:[]});for(const Lt of tt.functions){const Dt=await D7e(o,Lt);Dt!==null&&Et.selections.push(qj({operation:Dt,reason:Lt.reason}))}Et.selections.length!==0&&G.push(Et)}if(it.message.role==="assistant"&&it.message.content!=null&&it.message.content.length!==0){const st=PX({role:"assistant",text:it.message.content});G.push(st),o.dispatch(cbt({role:"assistant",stream:ijt(st.text),join:async()=>Promise.resolve(st.text),done:()=>!0,get:()=>st.text})).catch(()=>{})}}return G}function dDn(o){return o.map(h=>[{role:"assistant",tool_calls:[{type:"function",id:h.id,function:{name:h.name,arguments:JSON.stringify(h.validation.data)}}]},{role:"tool",content:JSON.stringify(h.validation.errors),tool_call_id:h.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
3199
- `)}]).flat()}function pDn(o){return async h=>{const b=[];if(h.ready()===!1){if((o==null?void 0:o.initialize)===null)await h.initialize();else if(b.push(...await((o==null?void 0:o.initialize)??lDn)(h)),h.ready()===!1)return b}if(h.stack.length!==0&&b.push(...await((o==null?void 0:o.cancel)??oDn)(h)),b.push(...await((o==null?void 0:o.select)??fDn)(h)),h.stack.length===0)return b;for(;;){const k=await((o==null?void 0:o.call)??XMn)(h,h.stack.map(P=>P.operation));b.push(...k);const O=k.filter(P=>P.type==="execute");if(b.push(...await((o==null?void 0:o.describe)??uDn)(h,O)),O.length===0||h.stack.length===0)break}return b}}function gDn(o){if(o.history.type==="text")return R7e({history:o.history});if(o.history.type==="select")return B7e({operations:o.operations,history:o.history});if(o.history.type==="cancel")return j7e({operations:o.operations,history:o.history});if(o.history.type==="execute")return ojt({operations:o.operations,history:o.history});if(o.history.type==="describe")return F7e({operations:o.operations,history:o.history});throw new Error("Invalid prompt type.")}function R7e(o){return PX(o.history)}function B7e(o){return obt({id:o.history.id,selections:o.history.selections.map(h=>qj({operation:sjt({operations:o.operations,input:h.operation}),reason:h.reason}))})}function j7e(o){return sbt({id:o.history.id,selections:o.history.selections.map(h=>qj({operation:sjt({operations:o.operations,input:h.operation}),reason:h.reason}))})}function ojt(o){return eT({id:o.history.id,operation:sjt({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value})}function F7e(o){return T7e({text:o.history.text,executes:o.history.executes.map(h=>ojt({operations:o.operations,history:h}))})}function sjt(o){var b;const h=(b=o.operations.get(o.input.controller))==null?void 0:b.get(o.input.function);if(h===void 0)throw new Error(`No operation found: (controller: ${o.input.controller}, function: ${o.input.function})`);return h}const mDn={transform:gDn,transformText:R7e,transformSelect:B7e,transformCancel:j7e,transformExecute:ojt,transformDescribe:F7e};class $7e{constructor(h){var b,k;this.props=h,this.operations_=dLn.compose({controllers:h.controllers,config:h.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(h.histories??[]).map(O=>mDn.transform({operations:this.operations_.group,history:O})),this.token_usage_=lX.zero(),this.ready_=!1,this.executor_=typeof((b=h.config)==null?void 0:b.executor)=="function"?h.config.executor:pDn(((k=h.config)==null?void 0:k.executor)??null)}clone(){var h;return new $7e({...this.props,histories:(h=this.props.histories)==null?void 0:h.slice()})}async conversate(h){const b=PX({role:"user",text:h});this.dispatch(cbt({role:"user",stream:ijt(h),done:()=>!0,get:()=>h,join:async()=>Promise.resolve(h)})).catch(()=>{});const k=await this.executor_(this.getContext({prompt:b,usage:this.token_usage_}));return this.histories_.push(b,...k),[b,...k]}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getControllers(){return this.props.controllers}getOperations(){return this.operations_.array}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(h){const b=async k=>this.dispatch(k);return{operations:this.operations_,config:this.props.config,histories:this.histories_,stack:this.stack_,ready:()=>this.ready_,prompt:h.prompt,dispatch:async k=>this.dispatch(k),request:async(k,O)=>{const P=TLn({source:k,body:{...O,model:this.props.vendor.model,stream:!0,stream_options:{include_usage:!0}},options:this.props.vendor.options});await b(P);const B=await this.props.vendor.api.chat.completions.create(P.body,P.options),[G,J]=Z8.transform(B.toReadableStream(),st=>p6.transformCompletionChunk(st)).tee(),[U,nt]=J.tee();(async()=>{const st=U.getReader();for(;;){const tt=await st.read();if(tt.done)break;tt.value.usage!=null&&gLn.aggregate({kind:k,completionUsage:tt.value.usage,usage:h.usage})}})().catch(()=>{});const[at,it]=G.tee();return await b({type:"response",source:k,stream:ubt(at.getReader()),body:P.body,options:P.options,join:async()=>{const st=await Z8.readAll(it);return p6.merge(st)}}),nt},initialize:async()=>{this.ready_=!0,await b(vLn())}}}on(h,b){return E7e(this.listeners_,h,()=>new Set).add(b),this}off(h,b){const k=this.listeners_.get(h);return k!==void 0&&(k.delete(b),k.size===0&&this.listeners_.delete(h)),this}async dispatch(h){const b=this.listeners_.get(h.type);b!==void 0&&await Promise.all(Array.from(b).map(async k=>{try{await k(h)}catch{}}))}}const fBt="RFC3986",dBt={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:o=>String(o)},bDn="RFC1738",yDn=Array.isArray,o6=(()=>{const o=[];for(let h=0;h<256;++h)o.push("%"+((h<16?"0":"")+h.toString(16)).toUpperCase());return o})(),rRt=1024,wDn=(o,h,b,k,O)=>{if(o.length===0)return o;let P=o;if(typeof o=="symbol"?P=Symbol.prototype.toString.call(o):typeof o!="string"&&(P=String(o)),b==="iso-8859-1")return escape(P).replace(/%u[0-9a-f]{4}/gi,function(G){return"%26%23"+parseInt(G.slice(2),16)+"%3B"});let B="";for(let G=0;G<P.length;G+=rRt){const J=P.length>=rRt?P.slice(G,G+rRt):P,U=[];for(let nt=0;nt<J.length;++nt){let at=J.charCodeAt(nt);if(at===45||at===46||at===95||at===126||at>=48&&at<=57||at>=65&&at<=90||at>=97&&at<=122||O===bDn&&(at===40||at===41)){U[U.length]=J.charAt(nt);continue}if(at<128){U[U.length]=o6[at];continue}if(at<2048){U[U.length]=o6[192|at>>6]+o6[128|at&63];continue}if(at<55296||at>=57344){U[U.length]=o6[224|at>>12]+o6[128|at>>6&63]+o6[128|at&63];continue}nt+=1,at=65536+((at&1023)<<10|J.charCodeAt(nt)&1023),U[U.length]=o6[240|at>>18]+o6[128|at>>12&63]+o6[128|at>>6&63]+o6[128|at&63]}B+=U.join("")}return B};function vDn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function J8e(o,h){if(yDn(o)){const b=[];for(let k=0;k<o.length;k+=1)b.push(h(o[k]));return b}return h(o)}const xDn=Object.prototype.hasOwnProperty,H7e={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,h){return String(o)+"["+h+"]"},repeat(o){return String(o)}},c6=Array.isArray,kDn=Array.prototype.push,z7e=function(o,h){kDn.apply(o,c6(h)?h:[h])},_Dn=Date.prototype.toISOString,Jp={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:wDn,encodeValuesOnly:!1,format:fBt,formatter:dBt[fBt],indices:!1,serializeDate(o){return _Dn.call(o)},skipNulls:!1,strictNullHandling:!1};function EDn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const iRt={};function U7e(o,h,b,k,O,P,B,G,J,U,nt,at,it,st,tt,Et,Lt,Dt){let ae=o,qt=Dt,_e=0,gn=!1;for(;(qt=qt.get(iRt))!==void 0&&!gn;){const ar=qt.get(o);if(_e+=1,typeof ar<"u"){if(ar===_e)throw new RangeError("Cyclic object value");gn=!0}typeof qt.get(iRt)>"u"&&(_e=0)}if(typeof U=="function"?ae=U(h,ae):ae instanceof Date?ae=it==null?void 0:it(ae):b==="comma"&&c6(ae)&&(ae=J8e(ae,function(ar){return ar instanceof Date?it==null?void 0:it(ar):ar})),ae===null){if(P)return J&&!Et?J(h,Jp.encoder,Lt,"key",st):h;ae=""}if(EDn(ae)||vDn(ae)){if(J){const ar=Et?h:J(h,Jp.encoder,Lt,"key",st);return[(tt==null?void 0:tt(ar))+"="+(tt==null?void 0:tt(J(ae,Jp.encoder,Lt,"value",st)))]}return[(tt==null?void 0:tt(h))+"="+(tt==null?void 0:tt(String(ae)))]}const ge=[];if(typeof ae>"u")return ge;let Mn;if(b==="comma"&&c6(ae))Et&&J&&(ae=J8e(ae,J)),Mn=[{value:ae.length>0?ae.join(",")||null:void 0}];else if(c6(U))Mn=U;else{const ar=Object.keys(ae);Mn=nt?ar.sort(nt):ar}const Wn=G?String(h).replace(/\./g,"%2E"):String(h),cr=k&&c6(ae)&&ae.length===1?Wn+"[]":Wn;if(O&&c6(ae)&&ae.length===0)return cr+"[]";for(let ar=0;ar<Mn.length;++ar){const bn=Mn[ar],Vn=typeof bn=="object"&&typeof bn.value<"u"?bn.value:ae[bn];if(B&&Vn===null)continue;const hi=at&&G?bn.replace(/\./g,"%2E"):bn,$n=c6(ae)?typeof b=="function"?b(cr,hi):cr:cr+(at?"."+hi:"["+hi+"]");Dt.set(o,_e);const Vt=new WeakMap;Vt.set(iRt,Dt),z7e(ge,U7e(Vn,$n,b,k,O,P,B,G,b==="comma"&&Et&&c6(ae)?null:J,U,nt,at,it,st,tt,Et,Lt,Vt))}return ge}function TDn(o=Jp){if(typeof o.allowEmptyArrays<"u"&&typeof o.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof o.encodeDotInKeys<"u"&&typeof o.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(o.encoder!==null&&typeof o.encoder<"u"&&typeof o.encoder!="function")throw new TypeError("Encoder has to be a function.");const h=o.charset||Jp.charset;if(typeof o.charset<"u"&&o.charset!=="utf-8"&&o.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let b=fBt;if(typeof o.format<"u"){if(!xDn.call(dBt,o.format))throw new TypeError("Unknown format option provided.");b=o.format}const k=dBt[b];let O=Jp.filter;(typeof o.filter=="function"||c6(o.filter))&&(O=o.filter);let P;if(o.arrayFormat&&o.arrayFormat in H7e?P=o.arrayFormat:"indices"in o?P=o.indices?"indices":"repeat":P=Jp.arrayFormat,"commaRoundTrip"in o&&typeof o.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const B=typeof o.allowDots>"u"?o.encodeDotInKeys?!0:Jp.allowDots:!!o.allowDots;return{addQueryPrefix:typeof o.addQueryPrefix=="boolean"?o.addQueryPrefix:Jp.addQueryPrefix,allowDots:B,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:Jp.allowEmptyArrays,arrayFormat:P,charset:h,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:Jp.charsetSentinel,commaRoundTrip:!!o.commaRoundTrip,delimiter:typeof o.delimiter>"u"?Jp.delimiter:o.delimiter,encode:typeof o.encode=="boolean"?o.encode:Jp.encode,encodeDotInKeys:typeof o.encodeDotInKeys=="boolean"?o.encodeDotInKeys:Jp.encodeDotInKeys,encoder:typeof o.encoder=="function"?o.encoder:Jp.encoder,encodeValuesOnly:typeof o.encodeValuesOnly=="boolean"?o.encodeValuesOnly:Jp.encodeValuesOnly,filter:O,format:b,formatter:k,serializeDate:typeof o.serializeDate=="function"?o.serializeDate:Jp.serializeDate,skipNulls:typeof o.skipNulls=="boolean"?o.skipNulls:Jp.skipNulls,sort:typeof o.sort=="function"?o.sort:null,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:Jp.strictNullHandling}}function SDn(o,h={}){let b=o;const k=TDn(h);let O,P;typeof k.filter=="function"?(P=k.filter,b=P("",b)):c6(k.filter)&&(P=k.filter,O=P);const B=[];if(typeof b!="object"||b===null)return"";const G=H7e[k.arrayFormat],J=G==="comma"&&k.commaRoundTrip;O||(O=Object.keys(b)),k.sort&&O.sort(k.sort);const U=new WeakMap;for(let it=0;it<O.length;++it){const st=O[it];k.skipNulls&&b[st]===null||z7e(B,U7e(b[st],st,G,J,k.allowEmptyArrays,k.strictNullHandling,k.skipNulls,k.encodeDotInKeys,k.encode?k.encoder:null,k.filter,k.sort,k.allowDots,k.serializeDate,k.format,k.formatter,k.encodeValuesOnly,k.charset,U))}const nt=B.join(k.delimiter);let at=k.addQueryPrefix===!0?"?":"";return k.charsetSentinel&&(k.charset==="iso-8859-1"?at+="utf8=%26%2310003%3B&":at+="utf8=%E2%9C%93&"),nt.length>0?at+nt:""}const xj="4.91.1";let X8e=!1,hX,G7e,q7e,pBt,W7e,K7e,V7e,Y7e,J7e;function IDn(o,h={auto:!1}){if(X8e)throw new Error(`you must \`import 'openai/shims/${o.kind}'\` before importing anything else from openai`);if(hX)throw new Error(`can't \`import 'openai/shims/${o.kind}'\` after \`import 'openai/shims/${hX}'\``);X8e=h.auto,hX=o.kind,G7e=o.fetch,q7e=o.FormData,pBt=o.File,W7e=o.ReadableStream,K7e=o.getMultipartRequestOptions,V7e=o.getDefaultAgent,Y7e=o.fileFromPath,J7e=o.isFsReadStream}class CDn{constructor(h){this.body=h}get[Symbol.toStringTag](){return"MultipartBody"}}function ADn({manuallyImported:o}={}){const h=o?"You may need to use polyfills":"Add one of these imports before your first `import … from 'openai'`:\n- `import 'openai/shims/node'` (if you're running on Node)\n- `import 'openai/shims/web'` (otherwise)\n";let b,k,O,P;try{b=fetch,k=Request,O=Response,P=Headers}catch(B){throw new Error(`this environment is missing the following Web Fetch API type: ${B.message}. ${h}`)}return{kind:"web",fetch:b,Request:k,Response:O,Headers:P,FormData:typeof FormData<"u"?FormData:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${h}`)}},Blob:typeof Blob<"u"?Blob:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${h}`)}},File:typeof File<"u"?File:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${h}`)}},ReadableStream:typeof ReadableStream<"u"?ReadableStream:class{constructor(){throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${h}`)}},getMultipartRequestOptions:async(B,G)=>({...G,body:new CDn(B)}),getDefaultAgent:B=>{},fileFromPath:()=>{throw new Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:B=>!1}}const X7e=()=>{hX||IDn(ADn(),{auto:!0})};X7e();class Cs extends Error{}class Ig extends Cs{constructor(h,b,k,O){super(`${Ig.makeMessage(h,b,k)}`),this.status=h,this.headers=O,this.request_id=O==null?void 0:O["x-request-id"],this.error=b;const P=b;this.code=P==null?void 0:P.code,this.param=P==null?void 0:P.param,this.type=P==null?void 0:P.type}static makeMessage(h,b,k){const O=b!=null&&b.message?typeof b.message=="string"?b.message:JSON.stringify(b.message):b?JSON.stringify(b):k;return h&&O?`${h} ${O}`:h?`${h} status code (no body)`:O||"(no status code or body)"}static generate(h,b,k,O){if(!h||!O)return new lbt({message:k,cause:mBt(b)});const P=b==null?void 0:b.error;return h===400?new Q7e(h,P,k,O):h===401?new Z7e(h,P,k,O):h===403?new t9e(h,P,k,O):h===404?new e9e(h,P,k,O):h===409?new n9e(h,P,k,O):h===422?new r9e(h,P,k,O):h===429?new i9e(h,P,k,O):h>=500?new a9e(h,P,k,O):new Ig(h,P,k,O)}}class x3 extends Ig{constructor({message:h}={}){super(void 0,void 0,h||"Request was aborted.",void 0)}}class lbt extends Ig{constructor({message:h,cause:b}){super(void 0,void 0,h||"Connection error.",void 0),b&&(this.cause=b)}}class cjt extends lbt{constructor({message:h}={}){super({message:h??"Request timed out."})}}class Q7e extends Ig{}class Z7e extends Ig{}class t9e extends Ig{}class e9e extends Ig{}class n9e extends Ig{}class r9e extends Ig{}class i9e extends Ig{}class a9e extends Ig{}class o9e extends Cs{constructor(){super("Could not parse response content as the length limit was reached")}}class s9e extends Cs{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var cmt=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},jN=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},gw;class hbt{constructor(){gw.set(this,void 0),this.buffer=new Uint8Array,cmt(this,gw,null,"f")}decode(h){if(h==null)return[];const b=h instanceof ArrayBuffer?new Uint8Array(h):typeof h=="string"?new TextEncoder().encode(h):h;let k=new Uint8Array(this.buffer.length+b.length);k.set(this.buffer),k.set(b,this.buffer.length),this.buffer=k;const O=[];let P;for(;(P=ODn(this.buffer,jN(this,gw,"f")))!=null;){if(P.carriage&&jN(this,gw,"f")==null){cmt(this,gw,P.index,"f");continue}if(jN(this,gw,"f")!=null&&(P.index!==jN(this,gw,"f")+1||P.carriage)){O.push(this.decodeText(this.buffer.slice(0,jN(this,gw,"f")-1))),this.buffer=this.buffer.slice(jN(this,gw,"f")),cmt(this,gw,null,"f");continue}const B=jN(this,gw,"f")!==null?P.preceding-1:P.preceding,G=this.decodeText(this.buffer.slice(0,B));O.push(G),this.buffer=this.buffer.slice(P.index),cmt(this,gw,null,"f")}return O}decodeText(h){if(h==null)return"";if(typeof h=="string")return h;if(typeof Buffer<"u"){if(h instanceof Buffer)return h.toString();if(h instanceof Uint8Array)return Buffer.from(h).toString();throw new Cs(`Unexpected: received non-Uint8Array (${h.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if(typeof TextDecoder<"u"){if(h instanceof Uint8Array||h instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(h);throw new Cs(`Unexpected: received non-Uint8Array/ArrayBuffer (${h.constructor.name}) in a web platform. Please report this error.`)}throw new Cs("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode(`
3198
+ a specific function to call, the others would be eliminated.`,validate:(()=>{const o=G=>Array.isArray(G.functions)&&G.functions.every(J=>typeof J=="object"&&J!==null&&h(J)),h=G=>typeof G.reason=="string"&&typeof G.name=="string",b=(G,J,U=!0)=>[(Array.isArray(G.functions)||B(U,{path:J+".functions",expected:"Array<___IChatFunctionReference>",value:G.functions}))&&G.functions.map((nt,at)=>(typeof nt=="object"&&nt!==null||B(U,{path:J+".functions["+at+"]",expected:"___IChatFunctionReference",value:nt}))&&k(nt,J+".functions["+at+"]",U)||B(U,{path:J+".functions["+at+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||B(U,{path:J+".functions",expected:"Array<___IChatFunctionReference>",value:G.functions})].every(nt=>nt),k=(G,J,U=!0)=>[typeof G.reason=="string"||B(U,{path:J+".reason",expected:"string",value:G.reason}),typeof G.name=="string"||B(U,{path:J+".name",expected:"string",value:G.name})].every(nt=>nt),O=G=>typeof G=="object"&&G!==null&&o(G);let P,B;return G=>{if(O(G)===!1){P=[],B=nP(P),((U,nt,at=!0)=>(typeof U=="object"&&U!==null||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:U}))&&b(U,nt+"",!0)||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:U}))(G,"$input",!0);const J=P.length===0;return J?{success:J,data:G}:{success:J,errors:P,data:G}}return{success:!0,data:G}}})()}]};async function dDn(o){var P;if(o.operations.divided===void 0)return Tmt(o,o.operations.array,0);const h=o.operations.divided.map(()=>[]),b=[],k=await Promise.all(o.operations.divided.map(async(B,G)=>Tmt({...o,stack:h[G],dispatch:async J=>{b.push(J)}},B,0)));if(h.every(B=>B.length===0))return k[0];if((((P=o.config)==null?void 0:P.eliticism)??nT.ELITICISM)===!0)return Tmt(o,h.flat().map(B=>o.operations.group.get(B.operation.controller.name).get(B.operation.function.name)),0);const O=obt({id:ejt(),selections:[]});for(const B of b)B.type==="select"&&(O.selections.push(B.selection),await D7e(o,{name:B.selection.operation.name,reason:B.selection.reason}));return[O]}async function Tmt(o,h,b,k){var J,U,nt,at;const O=await o.request("select",{messages:[{role:"system",content:Gj.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(h.map(it=>({name:it.name,description:it.function.description,...it.protocol==="http"?{method:it.function.method,path:it.function.path,tags:it.function.tags}:{}})))},...o.histories.map(Uj).flat(),{role:"user",content:o.prompt.text},{role:"system",content:((nt=(U=(J=o.config)==null?void 0:J.systemPrompt)==null?void 0:U.select)==null?void 0:nt.call(U,o.histories))??eP.SELECT},...pDn(k??[])],tools:fDn.functions.map(it=>({type:"function",function:{name:it.name,description:it.description,parameters:it.parameters}})),tool_choice:"auto",parallel_tool_calls:!1}),P=await Z8.readAll(O),B=p6.merge(P);if(b++<(((at=o.config)==null?void 0:at.retry)??nT.RETRY)){const it=[];for(const st of B.choices)for(const tt of st.message.tool_calls??[]){if(tt.function.name!=="selectFunctions")continue;const Et=JSON.parse(tt.function.arguments),Lt=(()=>{const Dt=Wn=>Array.isArray(Wn.functions)&&Wn.functions.every(cr=>typeof cr=="object"&&cr!==null&&ae(cr)),ae=Wn=>typeof Wn.reason=="string"&&typeof Wn.name=="string",qt=(Wn,cr,ar=!0)=>[(Array.isArray(Wn.functions)||Mn(ar,{path:cr+".functions",expected:"Array<___IChatFunctionReference>",value:Wn.functions}))&&Wn.functions.map((bn,Vn)=>(typeof bn=="object"&&bn!==null||Mn(ar,{path:cr+".functions["+Vn+"]",expected:"___IChatFunctionReference",value:bn}))&&_e(bn,cr+".functions["+Vn+"]",ar)||Mn(ar,{path:cr+".functions["+Vn+"]",expected:"___IChatFunctionReference",value:bn})).every(bn=>bn)||Mn(ar,{path:cr+".functions",expected:"Array<___IChatFunctionReference>",value:Wn.functions})].every(bn=>bn),_e=(Wn,cr,ar=!0)=>[typeof Wn.reason=="string"||Mn(ar,{path:cr+".reason",expected:"string",value:Wn.reason}),typeof Wn.name=="string"||Mn(ar,{path:cr+".name",expected:"string",value:Wn.name})].every(bn=>bn),gn=Wn=>typeof Wn=="object"&&Wn!==null&&Dt(Wn);let ge,Mn;return Wn=>{if(gn(Wn)===!1){ge=[],Mn=nP(ge),((ar,bn,Vn=!0)=>(typeof ar=="object"&&ar!==null||Mn(!0,{path:bn+"",expected:"__IChatFunctionReference.IProps",value:ar}))&&qt(ar,bn+"",!0)||Mn(!0,{path:bn+"",expected:"__IChatFunctionReference.IProps",value:ar}))(Wn,"$input",!0);const cr=ge.length===0;return cr?{success:cr,data:Wn}:{success:cr,errors:ge,data:Wn}}return{success:!0,data:Wn}}})()(Et);Lt.success===!1&&it.push({id:tt.id,name:tt.function.name,validation:Lt})}if(it.length>0)return Tmt(o,h,b,it)}const G=[];for(const it of B.choices){if(it.message.tool_calls!=null)for(const st of it.message.tool_calls){if(st.type!=="function"||st.function.name!=="selectFunctions")continue;const tt=(()=>{const Lt=qt=>Array.isArray(qt.functions)&&qt.functions.every(_e=>typeof _e=="object"&&_e!==null&&Dt(_e)),Dt=qt=>typeof qt.reason=="string"&&typeof qt.name=="string",ae=qt=>typeof qt=="object"&&qt!==null&&Lt(qt);return qt=>(qt=JSON.parse(qt),ae(qt)?qt:null)})()(st.function.arguments);if(tt===null)continue;const Et=obt({id:st.id,selections:[]});for(const Lt of tt.functions){const Dt=await D7e(o,Lt);Dt!==null&&Et.selections.push(qj({operation:Dt,reason:Lt.reason}))}Et.selections.length!==0&&G.push(Et)}if(it.message.role==="assistant"&&it.message.content!=null&&it.message.content.length!==0){const st=PX({role:"assistant",text:it.message.content});G.push(st),o.dispatch(cbt({role:"assistant",stream:ijt(st.text),join:async()=>Promise.resolve(st.text),done:()=>!0,get:()=>st.text})).catch(()=>{})}}return G}function pDn(o){return o.map(h=>[{role:"assistant",tool_calls:[{type:"function",id:h.id,function:{name:h.name,arguments:JSON.stringify(h.validation.data)}}]},{role:"tool",content:JSON.stringify(h.validation.errors),tool_call_id:h.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
3199
+ `)}]).flat()}function gDn(o){return async h=>{const b=[];if(h.ready()===!1){if((o==null?void 0:o.initialize)===null)await h.initialize();else if(b.push(...await((o==null?void 0:o.initialize)??hDn)(h)),h.ready()===!1)return b}if(h.stack.length!==0&&b.push(...await((o==null?void 0:o.cancel)??oDn)(h)),b.push(...await((o==null?void 0:o.select)??dDn)(h)),h.stack.length===0)return b;for(;;){const k=await((o==null?void 0:o.call)??XMn)(h,h.stack.map(P=>P.operation));b.push(...k);const O=k.filter(P=>P.type==="execute");if(b.push(...await((o==null?void 0:o.describe)??lDn)(h,O)),O.length===0||h.stack.length===0)break}return b}}function mDn(o){if(o.history.type==="text")return R7e({history:o.history});if(o.history.type==="select")return B7e({operations:o.operations,history:o.history});if(o.history.type==="cancel")return j7e({operations:o.operations,history:o.history});if(o.history.type==="execute")return ojt({operations:o.operations,history:o.history});if(o.history.type==="describe")return F7e({operations:o.operations,history:o.history});throw new Error("Invalid prompt type.")}function R7e(o){return PX(o.history)}function B7e(o){return obt({id:o.history.id,selections:o.history.selections.map(h=>qj({operation:sjt({operations:o.operations,input:h.operation}),reason:h.reason}))})}function j7e(o){return sbt({id:o.history.id,selections:o.history.selections.map(h=>qj({operation:sjt({operations:o.operations,input:h.operation}),reason:h.reason}))})}function ojt(o){return eT({id:o.history.id,operation:sjt({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value})}function F7e(o){return T7e({text:o.history.text,executes:o.history.executes.map(h=>ojt({operations:o.operations,history:h}))})}function sjt(o){var b;const h=(b=o.operations.get(o.input.controller))==null?void 0:b.get(o.input.function);if(h===void 0)throw new Error(`No operation found: (controller: ${o.input.controller}, function: ${o.input.function})`);return h}const bDn={transform:mDn,transformText:R7e,transformSelect:B7e,transformCancel:j7e,transformExecute:ojt,transformDescribe:F7e};class $7e{constructor(h){var b,k;this.props=h,this.operations_=dLn.compose({controllers:h.controllers,config:h.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(h.histories??[]).map(O=>bDn.transform({operations:this.operations_.group,history:O})),this.token_usage_=lX.zero(),this.ready_=!1,this.executor_=typeof((b=h.config)==null?void 0:b.executor)=="function"?h.config.executor:gDn(((k=h.config)==null?void 0:k.executor)??null)}clone(){var h;return new $7e({...this.props,histories:(h=this.props.histories)==null?void 0:h.slice()})}async conversate(h){const b=PX({role:"user",text:h});this.dispatch(cbt({role:"user",stream:ijt(h),done:()=>!0,get:()=>h,join:async()=>Promise.resolve(h)})).catch(()=>{});const k=await this.executor_(this.getContext({prompt:b,usage:this.token_usage_}));return this.histories_.push(b,...k),[b,...k]}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getControllers(){return this.props.controllers}getOperations(){return this.operations_.array}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(h){const b=async k=>this.dispatch(k);return{operations:this.operations_,config:this.props.config,histories:this.histories_,stack:this.stack_,ready:()=>this.ready_,prompt:h.prompt,dispatch:async k=>this.dispatch(k),request:async(k,O)=>{const P=TLn({source:k,body:{...O,model:this.props.vendor.model,stream:!0,stream_options:{include_usage:!0}},options:this.props.vendor.options});await b(P);const B=await this.props.vendor.api.chat.completions.create(P.body,P.options),[G,J]=Z8.transform(B.toReadableStream(),st=>p6.transformCompletionChunk(st)).tee(),[U,nt]=J.tee();(async()=>{const st=U.getReader();for(;;){const tt=await st.read();if(tt.done)break;tt.value.usage!=null&&gLn.aggregate({kind:k,completionUsage:tt.value.usage,usage:h.usage})}})().catch(()=>{});const[at,it]=G.tee();return await b({type:"response",source:k,stream:ubt(at.getReader()),body:P.body,options:P.options,join:async()=>{const st=await Z8.readAll(it);return p6.merge(st)}}),nt},initialize:async()=>{this.ready_=!0,await b(vLn())}}}on(h,b){return E7e(this.listeners_,h,()=>new Set).add(b),this}off(h,b){const k=this.listeners_.get(h);return k!==void 0&&(k.delete(b),k.size===0&&this.listeners_.delete(h)),this}async dispatch(h){const b=this.listeners_.get(h.type);b!==void 0&&await Promise.all(Array.from(b).map(async k=>{try{await k(h)}catch{}}))}}const fBt="RFC3986",dBt={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:o=>String(o)},yDn="RFC1738",wDn=Array.isArray,o6=(()=>{const o=[];for(let h=0;h<256;++h)o.push("%"+((h<16?"0":"")+h.toString(16)).toUpperCase());return o})(),rRt=1024,vDn=(o,h,b,k,O)=>{if(o.length===0)return o;let P=o;if(typeof o=="symbol"?P=Symbol.prototype.toString.call(o):typeof o!="string"&&(P=String(o)),b==="iso-8859-1")return escape(P).replace(/%u[0-9a-f]{4}/gi,function(G){return"%26%23"+parseInt(G.slice(2),16)+"%3B"});let B="";for(let G=0;G<P.length;G+=rRt){const J=P.length>=rRt?P.slice(G,G+rRt):P,U=[];for(let nt=0;nt<J.length;++nt){let at=J.charCodeAt(nt);if(at===45||at===46||at===95||at===126||at>=48&&at<=57||at>=65&&at<=90||at>=97&&at<=122||O===yDn&&(at===40||at===41)){U[U.length]=J.charAt(nt);continue}if(at<128){U[U.length]=o6[at];continue}if(at<2048){U[U.length]=o6[192|at>>6]+o6[128|at&63];continue}if(at<55296||at>=57344){U[U.length]=o6[224|at>>12]+o6[128|at>>6&63]+o6[128|at&63];continue}nt+=1,at=65536+((at&1023)<<10|J.charCodeAt(nt)&1023),U[U.length]=o6[240|at>>18]+o6[128|at>>12&63]+o6[128|at>>6&63]+o6[128|at&63]}B+=U.join("")}return B};function xDn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function J8e(o,h){if(wDn(o)){const b=[];for(let k=0;k<o.length;k+=1)b.push(h(o[k]));return b}return h(o)}const kDn=Object.prototype.hasOwnProperty,H7e={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,h){return String(o)+"["+h+"]"},repeat(o){return String(o)}},c6=Array.isArray,_Dn=Array.prototype.push,z7e=function(o,h){_Dn.apply(o,c6(h)?h:[h])},EDn=Date.prototype.toISOString,Jp={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:vDn,encodeValuesOnly:!1,format:fBt,formatter:dBt[fBt],indices:!1,serializeDate(o){return EDn.call(o)},skipNulls:!1,strictNullHandling:!1};function TDn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const iRt={};function U7e(o,h,b,k,O,P,B,G,J,U,nt,at,it,st,tt,Et,Lt,Dt){let ae=o,qt=Dt,_e=0,gn=!1;for(;(qt=qt.get(iRt))!==void 0&&!gn;){const ar=qt.get(o);if(_e+=1,typeof ar<"u"){if(ar===_e)throw new RangeError("Cyclic object value");gn=!0}typeof qt.get(iRt)>"u"&&(_e=0)}if(typeof U=="function"?ae=U(h,ae):ae instanceof Date?ae=it==null?void 0:it(ae):b==="comma"&&c6(ae)&&(ae=J8e(ae,function(ar){return ar instanceof Date?it==null?void 0:it(ar):ar})),ae===null){if(P)return J&&!Et?J(h,Jp.encoder,Lt,"key",st):h;ae=""}if(TDn(ae)||xDn(ae)){if(J){const ar=Et?h:J(h,Jp.encoder,Lt,"key",st);return[(tt==null?void 0:tt(ar))+"="+(tt==null?void 0:tt(J(ae,Jp.encoder,Lt,"value",st)))]}return[(tt==null?void 0:tt(h))+"="+(tt==null?void 0:tt(String(ae)))]}const ge=[];if(typeof ae>"u")return ge;let Mn;if(b==="comma"&&c6(ae))Et&&J&&(ae=J8e(ae,J)),Mn=[{value:ae.length>0?ae.join(",")||null:void 0}];else if(c6(U))Mn=U;else{const ar=Object.keys(ae);Mn=nt?ar.sort(nt):ar}const Wn=G?String(h).replace(/\./g,"%2E"):String(h),cr=k&&c6(ae)&&ae.length===1?Wn+"[]":Wn;if(O&&c6(ae)&&ae.length===0)return cr+"[]";for(let ar=0;ar<Mn.length;++ar){const bn=Mn[ar],Vn=typeof bn=="object"&&typeof bn.value<"u"?bn.value:ae[bn];if(B&&Vn===null)continue;const hi=at&&G?bn.replace(/\./g,"%2E"):bn,$n=c6(ae)?typeof b=="function"?b(cr,hi):cr:cr+(at?"."+hi:"["+hi+"]");Dt.set(o,_e);const Vt=new WeakMap;Vt.set(iRt,Dt),z7e(ge,U7e(Vn,$n,b,k,O,P,B,G,b==="comma"&&Et&&c6(ae)?null:J,U,nt,at,it,st,tt,Et,Lt,Vt))}return ge}function SDn(o=Jp){if(typeof o.allowEmptyArrays<"u"&&typeof o.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof o.encodeDotInKeys<"u"&&typeof o.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(o.encoder!==null&&typeof o.encoder<"u"&&typeof o.encoder!="function")throw new TypeError("Encoder has to be a function.");const h=o.charset||Jp.charset;if(typeof o.charset<"u"&&o.charset!=="utf-8"&&o.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let b=fBt;if(typeof o.format<"u"){if(!kDn.call(dBt,o.format))throw new TypeError("Unknown format option provided.");b=o.format}const k=dBt[b];let O=Jp.filter;(typeof o.filter=="function"||c6(o.filter))&&(O=o.filter);let P;if(o.arrayFormat&&o.arrayFormat in H7e?P=o.arrayFormat:"indices"in o?P=o.indices?"indices":"repeat":P=Jp.arrayFormat,"commaRoundTrip"in o&&typeof o.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const B=typeof o.allowDots>"u"?o.encodeDotInKeys?!0:Jp.allowDots:!!o.allowDots;return{addQueryPrefix:typeof o.addQueryPrefix=="boolean"?o.addQueryPrefix:Jp.addQueryPrefix,allowDots:B,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:Jp.allowEmptyArrays,arrayFormat:P,charset:h,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:Jp.charsetSentinel,commaRoundTrip:!!o.commaRoundTrip,delimiter:typeof o.delimiter>"u"?Jp.delimiter:o.delimiter,encode:typeof o.encode=="boolean"?o.encode:Jp.encode,encodeDotInKeys:typeof o.encodeDotInKeys=="boolean"?o.encodeDotInKeys:Jp.encodeDotInKeys,encoder:typeof o.encoder=="function"?o.encoder:Jp.encoder,encodeValuesOnly:typeof o.encodeValuesOnly=="boolean"?o.encodeValuesOnly:Jp.encodeValuesOnly,filter:O,format:b,formatter:k,serializeDate:typeof o.serializeDate=="function"?o.serializeDate:Jp.serializeDate,skipNulls:typeof o.skipNulls=="boolean"?o.skipNulls:Jp.skipNulls,sort:typeof o.sort=="function"?o.sort:null,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:Jp.strictNullHandling}}function IDn(o,h={}){let b=o;const k=SDn(h);let O,P;typeof k.filter=="function"?(P=k.filter,b=P("",b)):c6(k.filter)&&(P=k.filter,O=P);const B=[];if(typeof b!="object"||b===null)return"";const G=H7e[k.arrayFormat],J=G==="comma"&&k.commaRoundTrip;O||(O=Object.keys(b)),k.sort&&O.sort(k.sort);const U=new WeakMap;for(let it=0;it<O.length;++it){const st=O[it];k.skipNulls&&b[st]===null||z7e(B,U7e(b[st],st,G,J,k.allowEmptyArrays,k.strictNullHandling,k.skipNulls,k.encodeDotInKeys,k.encode?k.encoder:null,k.filter,k.sort,k.allowDots,k.serializeDate,k.format,k.formatter,k.encodeValuesOnly,k.charset,U))}const nt=B.join(k.delimiter);let at=k.addQueryPrefix===!0?"?":"";return k.charsetSentinel&&(k.charset==="iso-8859-1"?at+="utf8=%26%2310003%3B&":at+="utf8=%E2%9C%93&"),nt.length>0?at+nt:""}const xj="4.91.1";let X8e=!1,hX,G7e,q7e,pBt,W7e,K7e,V7e,Y7e,J7e;function CDn(o,h={auto:!1}){if(X8e)throw new Error(`you must \`import 'openai/shims/${o.kind}'\` before importing anything else from openai`);if(hX)throw new Error(`can't \`import 'openai/shims/${o.kind}'\` after \`import 'openai/shims/${hX}'\``);X8e=h.auto,hX=o.kind,G7e=o.fetch,q7e=o.FormData,pBt=o.File,W7e=o.ReadableStream,K7e=o.getMultipartRequestOptions,V7e=o.getDefaultAgent,Y7e=o.fileFromPath,J7e=o.isFsReadStream}class ADn{constructor(h){this.body=h}get[Symbol.toStringTag](){return"MultipartBody"}}function ODn({manuallyImported:o}={}){const h=o?"You may need to use polyfills":"Add one of these imports before your first `import … from 'openai'`:\n- `import 'openai/shims/node'` (if you're running on Node)\n- `import 'openai/shims/web'` (otherwise)\n";let b,k,O,P;try{b=fetch,k=Request,O=Response,P=Headers}catch(B){throw new Error(`this environment is missing the following Web Fetch API type: ${B.message}. ${h}`)}return{kind:"web",fetch:b,Request:k,Response:O,Headers:P,FormData:typeof FormData<"u"?FormData:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${h}`)}},Blob:typeof Blob<"u"?Blob:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${h}`)}},File:typeof File<"u"?File:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${h}`)}},ReadableStream:typeof ReadableStream<"u"?ReadableStream:class{constructor(){throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${h}`)}},getMultipartRequestOptions:async(B,G)=>({...G,body:new ADn(B)}),getDefaultAgent:B=>{},fileFromPath:()=>{throw new Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:B=>!1}}const X7e=()=>{hX||CDn(ODn(),{auto:!0})};X7e();class Cs extends Error{}class Ig extends Cs{constructor(h,b,k,O){super(`${Ig.makeMessage(h,b,k)}`),this.status=h,this.headers=O,this.request_id=O==null?void 0:O["x-request-id"],this.error=b;const P=b;this.code=P==null?void 0:P.code,this.param=P==null?void 0:P.param,this.type=P==null?void 0:P.type}static makeMessage(h,b,k){const O=b!=null&&b.message?typeof b.message=="string"?b.message:JSON.stringify(b.message):b?JSON.stringify(b):k;return h&&O?`${h} ${O}`:h?`${h} status code (no body)`:O||"(no status code or body)"}static generate(h,b,k,O){if(!h||!O)return new lbt({message:k,cause:mBt(b)});const P=b==null?void 0:b.error;return h===400?new Q7e(h,P,k,O):h===401?new Z7e(h,P,k,O):h===403?new t9e(h,P,k,O):h===404?new e9e(h,P,k,O):h===409?new n9e(h,P,k,O):h===422?new r9e(h,P,k,O):h===429?new i9e(h,P,k,O):h>=500?new a9e(h,P,k,O):new Ig(h,P,k,O)}}class x3 extends Ig{constructor({message:h}={}){super(void 0,void 0,h||"Request was aborted.",void 0)}}class lbt extends Ig{constructor({message:h,cause:b}){super(void 0,void 0,h||"Connection error.",void 0),b&&(this.cause=b)}}class cjt extends lbt{constructor({message:h}={}){super({message:h??"Request timed out."})}}class Q7e extends Ig{}class Z7e extends Ig{}class t9e extends Ig{}class e9e extends Ig{}class n9e extends Ig{}class r9e extends Ig{}class i9e extends Ig{}class a9e extends Ig{}class o9e extends Cs{constructor(){super("Could not parse response content as the length limit was reached")}}class s9e extends Cs{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var cmt=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},jN=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},gw;class hbt{constructor(){gw.set(this,void 0),this.buffer=new Uint8Array,cmt(this,gw,null,"f")}decode(h){if(h==null)return[];const b=h instanceof ArrayBuffer?new Uint8Array(h):typeof h=="string"?new TextEncoder().encode(h):h;let k=new Uint8Array(this.buffer.length+b.length);k.set(this.buffer),k.set(b,this.buffer.length),this.buffer=k;const O=[];let P;for(;(P=NDn(this.buffer,jN(this,gw,"f")))!=null;){if(P.carriage&&jN(this,gw,"f")==null){cmt(this,gw,P.index,"f");continue}if(jN(this,gw,"f")!=null&&(P.index!==jN(this,gw,"f")+1||P.carriage)){O.push(this.decodeText(this.buffer.slice(0,jN(this,gw,"f")-1))),this.buffer=this.buffer.slice(jN(this,gw,"f")),cmt(this,gw,null,"f");continue}const B=jN(this,gw,"f")!==null?P.preceding-1:P.preceding,G=this.decodeText(this.buffer.slice(0,B));O.push(G),this.buffer=this.buffer.slice(P.index),cmt(this,gw,null,"f")}return O}decodeText(h){if(h==null)return"";if(typeof h=="string")return h;if(typeof Buffer<"u"){if(h instanceof Buffer)return h.toString();if(h instanceof Uint8Array)return Buffer.from(h).toString();throw new Cs(`Unexpected: received non-Uint8Array (${h.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if(typeof TextDecoder<"u"){if(h instanceof Uint8Array||h instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(h);throw new Cs(`Unexpected: received non-Uint8Array/ArrayBuffer (${h.constructor.name}) in a web platform. Please report this error.`)}throw new Cs("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode(`
3200
3200
  `):[]}}gw=new WeakMap;hbt.NEWLINE_CHARS=new Set([`
3201
- `,"\r"]);hbt.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function ODn(o,h){for(let O=h??0;O<o.length;O++){if(o[O]===10)return{preceding:O,index:O+1,carriage:!1};if(o[O]===13)return{preceding:O,index:O+1,carriage:!0}}return null}function NDn(o){for(let k=0;k<o.length-1;k++){if(o[k]===10&&o[k+1]===10||o[k]===13&&o[k+1]===13)return k+2;if(o[k]===13&&o[k+1]===10&&k+3<o.length&&o[k+2]===13&&o[k+3]===10)return k+4}return-1}function c9e(o){if(o[Symbol.asyncIterator])return o;const h=o.getReader();return{async next(){try{const b=await h.read();return b!=null&&b.done&&h.releaseLock(),b}catch(b){throw h.releaseLock(),b}},async return(){const b=h.cancel();return h.releaseLock(),await b,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}class f6{constructor(h,b){this.iterator=h,this.controller=b}static fromSSEResponse(h,b){let k=!1;async function*O(){if(k)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");k=!0;let P=!1;try{for await(const B of PDn(h,b))if(!P){if(B.data.startsWith("[DONE]")){P=!0;continue}if(B.event===null||B.event.startsWith("response.")||B.event.startsWith("transcript.")){let G;try{G=JSON.parse(B.data)}catch(J){throw console.error("Could not parse message into JSON:",B.data),console.error("From chunk:",B.raw),J}if(G&&G.error)throw new Ig(void 0,G.error,void 0,g9e(h.headers));yield G}else{let G;try{G=JSON.parse(B.data)}catch(J){throw console.error("Could not parse message into JSON:",B.data),console.error("From chunk:",B.raw),J}if(B.event=="error")throw new Ig(void 0,G.error,G.message,void 0);yield{event:B.event,data:G}}}P=!0}catch(B){if(B instanceof Error&&B.name==="AbortError")return;throw B}finally{P||b.abort()}}return new f6(O,b)}static fromReadableStream(h,b){let k=!1;async function*O(){const B=new hbt,G=c9e(h);for await(const J of G)for(const U of B.decode(J))yield U;for(const J of B.flush())yield J}async function*P(){if(k)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");k=!0;let B=!1;try{for await(const G of O())B||G&&(yield JSON.parse(G));B=!0}catch(G){if(G instanceof Error&&G.name==="AbortError")return;throw G}finally{B||b.abort()}}return new f6(P,b)}[Symbol.asyncIterator](){return this.iterator()}tee(){const h=[],b=[],k=this.iterator(),O=P=>({next:()=>{if(P.length===0){const B=k.next();h.push(B),b.push(B)}return P.shift()}});return[new f6(()=>O(h),this.controller),new f6(()=>O(b),this.controller)]}toReadableStream(){const h=this;let b;const k=new TextEncoder;return new W7e({async start(){b=h[Symbol.asyncIterator]()},async pull(O){try{const{value:P,done:B}=await b.next();if(B)return O.close();const G=k.encode(JSON.stringify(P)+`
3202
- `);O.enqueue(G)}catch(P){O.error(P)}},async cancel(){var O;await((O=b.return)==null?void 0:O.call(b))}})}}async function*PDn(o,h){if(!o.body)throw h.abort(),new Cs("Attempted to iterate over a response with no body");const b=new MDn,k=new hbt,O=c9e(o.body);for await(const P of LDn(O))for(const B of k.decode(P)){const G=b.decode(B);G&&(yield G)}for(const P of k.flush()){const B=b.decode(P);B&&(yield B)}}async function*LDn(o){let h=new Uint8Array;for await(const b of o){if(b==null)continue;const k=b instanceof ArrayBuffer?new Uint8Array(b):typeof b=="string"?new TextEncoder().encode(b):b;let O=new Uint8Array(h.length+k.length);O.set(h),O.set(k,h.length),h=O;let P;for(;(P=NDn(h))!==-1;)yield h.slice(0,P),h=h.slice(P)}h.length>0&&(yield h)}class MDn{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(h){if(h.endsWith("\r")&&(h=h.substring(0,h.length-1)),!h){if(!this.event&&!this.data.length)return null;const P={event:this.event,data:this.data.join(`
3203
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],P}if(this.chunks.push(h),h.startsWith(":"))return null;let[b,k,O]=DDn(h,":");return O.startsWith(" ")&&(O=O.substring(1)),b==="event"?this.event=O:b==="data"&&this.data.push(O),null}}function DDn(o,h){const b=o.indexOf(h);return b!==-1?[o.substring(0,b),h,o.substring(b+h.length)]:[o,"",""]}const u9e=o=>o!=null&&typeof o=="object"&&typeof o.url=="string"&&typeof o.blob=="function",l9e=o=>o!=null&&typeof o=="object"&&typeof o.name=="string"&&typeof o.lastModified=="number"&&fbt(o),fbt=o=>o!=null&&typeof o=="object"&&typeof o.size=="number"&&typeof o.type=="string"&&typeof o.text=="function"&&typeof o.slice=="function"&&typeof o.arrayBuffer=="function",RDn=o=>l9e(o)||u9e(o)||J7e(o);async function h9e(o,h,b){var O;if(o=await o,l9e(o))return o;if(u9e(o)){const P=await o.blob();h||(h=new URL(o.url).pathname.split(/[\\/]/).pop()??"unknown_file");const B=fbt(P)?[await P.arrayBuffer()]:[P];return new pBt(B,h,b)}const k=await BDn(o);if(h||(h=FDn(o)??"unknown_file"),!(b!=null&&b.type)){const P=(O=k[0])==null?void 0:O.type;typeof P=="string"&&(b={...b,type:P})}return new pBt(k,h,b)}async function BDn(o){var b;let h=[];if(typeof o=="string"||ArrayBuffer.isView(o)||o instanceof ArrayBuffer)h.push(o);else if(fbt(o))h.push(await o.arrayBuffer());else if($Dn(o))for await(const k of o)h.push(k);else throw new Error(`Unexpected data type: ${typeof o}; constructor: ${(b=o==null?void 0:o.constructor)==null?void 0:b.name}; props: ${jDn(o)}`);return h}function jDn(o){return`[${Object.getOwnPropertyNames(o).map(b=>`"${b}"`).join(", ")}]`}function FDn(o){var h;return aRt(o.name)||aRt(o.filename)||((h=aRt(o.path))==null?void 0:h.split(/[\\/]/).pop())}const aRt=o=>{if(typeof o=="string")return o;if(typeof Buffer<"u"&&o instanceof Buffer)return String(o)},$Dn=o=>o!=null&&typeof o=="object"&&typeof o[Symbol.asyncIterator]=="function",Q8e=o=>o&&typeof o=="object"&&o.body&&o[Symbol.toStringTag]==="MultipartBody",Fj=async o=>{const h=await HDn(o.body);return K7e(h,o)},HDn=async o=>{const h=new q7e;return await Promise.all(Object.entries(o||{}).map(([b,k])=>gBt(h,b,k))),h},gBt=async(o,h,b)=>{if(b!==void 0){if(b==null)throw new TypeError(`Received null for "${h}"; to pass null in FormData, you must use the string 'null'`);if(typeof b=="string"||typeof b=="number"||typeof b=="boolean")o.append(h,String(b));else if(RDn(b)){const k=await h9e(b);o.append(h,k)}else if(Array.isArray(b))await Promise.all(b.map(k=>gBt(o,h+"[]",k)));else if(typeof b=="object")await Promise.all(Object.entries(b).map(([k,O])=>gBt(o,`${h}[${k}]`,O)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${b} instead`)}};var Ij={},zDn=function(o,h,b,k,O){if(typeof h=="function"?o!==h||!0:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return h.set(o,b),b},UDn=function(o,h,b,k){if(typeof h=="function"?o!==h||!0:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},umt;X7e();async function f9e(o){var B;const{response:h}=o;if(o.options.stream)return Y8("response",h.status,h.url,h.headers,h.body),o.options.__streamClass?o.options.__streamClass.fromSSEResponse(h,o.controller):f6.fromSSEResponse(h,o.controller);if(h.status===204)return null;if(o.options.__binaryResponse)return h;const b=h.headers.get("content-type"),k=(B=b==null?void 0:b.split(";")[0])==null?void 0:B.trim();if((k==null?void 0:k.includes("application/json"))||(k==null?void 0:k.endsWith("+json"))){const G=await h.json();return Y8("response",h.status,h.url,h.headers,G),d9e(G,h)}const P=await h.text();return Y8("response",h.status,h.url,h.headers,P),P}function d9e(o,h){return!o||typeof o!="object"||Array.isArray(o)?o:Object.defineProperty(o,"_request_id",{value:h.headers.get("x-request-id"),enumerable:!1})}class dbt extends Promise{constructor(h,b=f9e){super(k=>{k(null)}),this.responsePromise=h,this.parseResponse=b}_thenUnwrap(h){return new dbt(this.responsePromise,async b=>d9e(h(await this.parseResponse(b),b),b.response))}asResponse(){return this.responsePromise.then(h=>h.response)}async withResponse(){const[h,b]=await Promise.all([this.parse(),this.asResponse()]);return{data:h,response:b,request_id:b.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(h,b){return this.parse().then(h,b)}catch(h){return this.parse().catch(h)}finally(h){return this.parse().finally(h)}}class GDn{constructor({baseURL:h,maxRetries:b=2,timeout:k=6e5,httpAgent:O,fetch:P}){this.baseURL=h,this.maxRetries=oRt("maxRetries",b),this.timeout=oRt("timeout",k),this.httpAgent=O,this.fetch=P??G7e}authHeaders(h){return{}}defaultHeaders(h){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...YDn(),...this.authHeaders(h)}}validateHeaders(h,b){}defaultIdempotencyKey(){return`stainless-node-retry-${ZDn()}`}get(h,b){return this.methodRequest("get",h,b)}post(h,b){return this.methodRequest("post",h,b)}patch(h,b){return this.methodRequest("patch",h,b)}put(h,b){return this.methodRequest("put",h,b)}delete(h,b){return this.methodRequest("delete",h,b)}methodRequest(h,b,k){return this.request(Promise.resolve(k).then(async O=>{const P=O&&fbt(O==null?void 0:O.body)?new DataView(await O.body.arrayBuffer()):(O==null?void 0:O.body)instanceof DataView?O.body:(O==null?void 0:O.body)instanceof ArrayBuffer?new DataView(O.body):O&&ArrayBuffer.isView(O==null?void 0:O.body)?new DataView(O.body.buffer):O==null?void 0:O.body;return{method:h,path:b,...O,body:P}}))}getAPIList(h,b,k){return this.requestAPIList(b,{method:"get",path:h,...k})}calculateContentLength(h){if(typeof h=="string"){if(typeof Buffer<"u")return Buffer.byteLength(h,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(h).length.toString()}else if(ArrayBuffer.isView(h))return h.byteLength.toString();return null}buildRequest(h,{retryCount:b=0}={}){var tt;h={...h};const{method:k,path:O,query:P,headers:B={}}=h,G=ArrayBuffer.isView(h.body)||h.__binaryRequest&&typeof h.body=="string"?h.body:Q8e(h.body)?h.body.body:h.body?JSON.stringify(h.body,null,2):null,J=this.calculateContentLength(G),U=this.buildURL(O,P);"timeout"in h&&oRt("timeout",h.timeout),h.timeout=h.timeout??this.timeout;const nt=h.httpAgent??this.httpAgent??V7e(U),at=h.timeout+1e3;typeof((tt=nt==null?void 0:nt.options)==null?void 0:tt.timeout)=="number"&&at>(nt.options.timeout??0)&&(nt.options.timeout=at),this.idempotencyHeader&&k!=="get"&&(h.idempotencyKey||(h.idempotencyKey=this.defaultIdempotencyKey()),B[this.idempotencyHeader]=h.idempotencyKey);const it=this.buildHeaders({options:h,headers:B,contentLength:J,retryCount:b});return{req:{method:k,...G&&{body:G},headers:it,...nt&&{agent:nt},signal:h.signal??null},url:U,timeout:h.timeout}}buildHeaders({options:h,headers:b,contentLength:k,retryCount:O}){const P={};k&&(P["content-length"]=k);const B=this.defaultHeaders(h);return nCe(P,B),nCe(P,b),Q8e(h.body)&&hX!=="node"&&delete P["content-type"],hmt(B,"x-stainless-retry-count")===void 0&&hmt(b,"x-stainless-retry-count")===void 0&&(P["x-stainless-retry-count"]=String(O)),hmt(B,"x-stainless-timeout")===void 0&&hmt(b,"x-stainless-timeout")===void 0&&h.timeout&&(P["x-stainless-timeout"]=String(h.timeout)),this.validateHeaders(P,b),P}async prepareOptions(h){}async prepareRequest(h,{url:b,options:k}){}parseHeaders(h){return h?Symbol.iterator in h?Object.fromEntries(Array.from(h).map(b=>[...b])):{...h}:{}}makeStatusError(h,b,k,O){return Ig.generate(h,b,k,O)}request(h,b=null){return new dbt(this.makeRequest(h,b))}async makeRequest(h,b){var at,it;const k=await h,O=k.maxRetries??this.maxRetries;b==null&&(b=O),await this.prepareOptions(k);const{req:P,url:B,timeout:G}=this.buildRequest(k,{retryCount:O-b});if(await this.prepareRequest(P,{url:B,options:k}),Y8("request",B,k,P.headers),(at=k.signal)!=null&&at.aborted)throw new x3;const J=new AbortController,U=await this.fetchWithTimeout(B,P,G,J).catch(mBt);if(U instanceof Error){if((it=k.signal)!=null&&it.aborted)throw new x3;if(b)return this.retryRequest(k,b);throw U.name==="AbortError"?new cjt:new lbt({cause:U})}const nt=g9e(U.headers);if(!U.ok){if(b&&this.shouldRetry(U)){const ae=`retrying, ${b} attempts remaining`;return Y8(`response (error; ${ae})`,U.status,B,nt),this.retryRequest(k,b,nt)}const st=await U.text().catch(ae=>mBt(ae).message),tt=JDn(st),Et=tt?void 0:st;throw Y8(`response (error; ${b?"(error; no more retries left)":"(error; not retryable)"})`,U.status,B,nt,Et),this.makeStatusError(U.status,tt,Et,nt)}return{response:U,options:k,controller:J}}requestAPIList(h,b){const k=this.makeRequest(b,null);return new qDn(this,k,h)}buildURL(h,b){const k=QDn(h)?new URL(h):new URL(this.baseURL+(this.baseURL.endsWith("/")&&h.startsWith("/")?h.slice(1):h)),O=this.defaultQuery();return m9e(O)||(b={...O,...b}),typeof b=="object"&&b&&!Array.isArray(b)&&(k.search=this.stringifyQuery(b)),k.toString()}stringifyQuery(h){return Object.entries(h).filter(([b,k])=>typeof k<"u").map(([b,k])=>{if(typeof k=="string"||typeof k=="number"||typeof k=="boolean")return`${encodeURIComponent(b)}=${encodeURIComponent(k)}`;if(k===null)return`${encodeURIComponent(b)}=`;throw new Cs(`Cannot stringify type ${typeof k}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(h,b,k,O){const{signal:P,...B}=b||{};P&&P.addEventListener("abort",()=>O.abort());const G=setTimeout(()=>O.abort(),k),J={signal:O.signal,...B};return J.method&&(J.method=J.method.toUpperCase()),this.fetch.call(void 0,h,J).finally(()=>{clearTimeout(G)})}shouldRetry(h){const b=h.headers.get("x-should-retry");return b==="true"?!0:b==="false"?!1:h.status===408||h.status===409||h.status===429||h.status>=500}async retryRequest(h,b,k){let O;const P=k==null?void 0:k["retry-after-ms"];if(P){const G=parseFloat(P);Number.isNaN(G)||(O=G)}const B=k==null?void 0:k["retry-after"];if(B&&!O){const G=parseFloat(B);Number.isNaN(G)?O=Date.parse(B)-Date.now():O=G*1e3}if(!(O&&0<=O&&O<60*1e3)){const G=h.maxRetries??this.maxRetries;O=this.calculateDefaultRetryTimeoutMillis(b,G)}return await LX(O),this.makeRequest(h,b-1)}calculateDefaultRetryTimeoutMillis(h,b){const P=b-h,B=Math.min(.5*Math.pow(2,P),8),G=1-Math.random()*.25;return B*G*1e3}getUserAgent(){return`${this.constructor.name}/JS ${xj}`}}class p9e{constructor(h,b,k,O){umt.set(this,void 0),zDn(this,umt,h),this.options=O,this.response=b,this.body=k}hasNextPage(){return this.getPaginatedItems().length?this.nextPageInfo()!=null:!1}async getNextPage(){const h=this.nextPageInfo();if(!h)throw new Cs("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");const b={...this.options};if("params"in h&&typeof b.query=="object")b.query={...b.query,...h.params};else if("url"in h){const k=[...Object.entries(b.query||{}),...h.url.searchParams.entries()];for(const[O,P]of k)h.url.searchParams.set(O,P);b.query=void 0,b.path=h.url.toString()}return await UDn(this,umt,"f").requestAPIList(this.constructor,b)}async*iterPages(){let h=this;for(yield h;h.hasNextPage();)h=await h.getNextPage(),yield h}async*[(umt=new WeakMap,Symbol.asyncIterator)](){for await(const h of this.iterPages())for(const b of h.getPaginatedItems())yield b}}class qDn extends dbt{constructor(h,b,k){super(b,async O=>new k(h,O.response,await f9e(O),O.options))}async*[Symbol.asyncIterator](){const h=await this;for await(const b of h)yield b}}const g9e=o=>new Proxy(Object.fromEntries(o.entries()),{get(h,b){const k=b.toString();return h[k.toLowerCase()]||h[k]}}),WDn={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},$0=o=>typeof o=="object"&&o!==null&&!m9e(o)&&Object.keys(o).every(h=>b9e(WDn,h)),KDn=()=>{var h;if(typeof Deno<"u"&&Deno.build!=null)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":tCe(Deno.build.os),"X-Stainless-Arch":Z8e(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:((h=Deno.version)==null?void 0:h.deno)??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":process.version};if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":tCe(process.platform),"X-Stainless-Arch":Z8e(process.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":process.version};const o=VDn();return o?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${o.browser}`,"X-Stainless-Runtime-Version":o.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function VDn(){if(typeof navigator>"u"||!navigator)return null;const o=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:h,pattern:b}of o){const k=b.exec(navigator.userAgent);if(k){const O=k[1]||0,P=k[2]||0,B=k[3]||0;return{browser:h,version:`${O}.${P}.${B}`}}}return null}const Z8e=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",tCe=o=>(o=o.toLowerCase(),o.includes("ios")?"iOS":o==="android"?"Android":o==="darwin"?"MacOS":o==="win32"?"Windows":o==="freebsd"?"FreeBSD":o==="openbsd"?"OpenBSD":o==="linux"?"Linux":o?`Other:${o}`:"Unknown");let eCe;const YDn=()=>eCe??(eCe=KDn()),JDn=o=>{try{return JSON.parse(o)}catch{return}},XDn=/^[a-z][a-z0-9+.-]*:/i,QDn=o=>XDn.test(o),LX=o=>new Promise(h=>setTimeout(h,o)),oRt=(o,h)=>{if(typeof h!="number"||!Number.isInteger(h))throw new Cs(`${o} must be an integer`);if(h<0)throw new Cs(`${o} must be a positive integer`);return h},mBt=o=>{if(o instanceof Error)return o;if(typeof o=="object"&&o!==null)try{return new Error(JSON.stringify(o))}catch{}return new Error(o)},lmt=o=>{var h,b,k,O;if(typeof process<"u")return((h=Ij==null?void 0:Ij[o])==null?void 0:h.trim())??void 0;if(typeof Deno<"u")return(O=(k=(b=Deno.env)==null?void 0:b.get)==null?void 0:k.call(b,o))==null?void 0:O.trim()};function m9e(o){if(!o)return!0;for(const h in o)return!1;return!0}function b9e(o,h){return Object.prototype.hasOwnProperty.call(o,h)}function nCe(o,h){for(const b in h){if(!b9e(h,b))continue;const k=b.toLowerCase();if(!k)continue;const O=h[b];O===null?delete o[k]:O!==void 0&&(o[k]=O)}}const rCe=new Set(["authorization","api-key"]);function Y8(o,...h){if(typeof process<"u"&&(Ij==null?void 0:Ij.DEBUG)==="true"){const b=h.map(k=>{if(!k)return k;if(k.headers){const P={...k,headers:{...k.headers}};for(const B in k.headers)rCe.has(B.toLowerCase())&&(P.headers[B]="REDACTED");return P}let O=null;for(const P in k)rCe.has(P.toLowerCase())&&(O??(O={...k}),O[P]="REDACTED");return O??k});console.log(`OpenAI:DEBUG:${o}`,...b)}}const ZDn=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const h=Math.random()*16|0;return(o==="x"?h:h&3|8).toString(16)}),tRn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",eRn=o=>typeof(o==null?void 0:o.get)=="function",hmt=(o,h)=>{var k;const b=h.toLowerCase();if(eRn(o)){const O=((k=h[0])==null?void 0:k.toUpperCase())+h.substring(1).replace(/([^\w])(\w)/g,(P,B,G)=>B+G.toUpperCase());for(const P of[h,b,h.toUpperCase(),O]){const B=o.get(P);if(B)return B}}for(const[O,P]of Object.entries(o))if(O.toLowerCase()===b)return Array.isArray(P)?(P.length<=1||console.warn(`Received ${P.length} entries for the ${h} header, using the first entry.`),P[0]):P},nRn=o=>{if(typeof Buffer<"u")return Array.from(new Float32Array(Buffer.from(o,"base64").buffer));{const h=atob(o),b=h.length,k=new Uint8Array(b);for(let O=0;O<b;O++)k[O]=h.charCodeAt(O);return Array.from(new Float32Array(k.buffer))}};function sRt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}class ujt extends p9e{constructor(h,b,k,O){super(h,b,k,O),this.data=k.data||[],this.object=k.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class Y2 extends p9e{constructor(h,b,k,O){super(h,b,k,O),this.data=k.data||[],this.has_more=k.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageParams(){const h=this.nextPageInfo();if(!h)return null;if("params"in h)return h.params;const b=Object.fromEntries(h.url.searchParams);return Object.keys(b).length?b:null}nextPageInfo(){var k;const h=this.getPaginatedItems();if(!h.length)return null;const b=(k=h[h.length-1])==null?void 0:k.id;return b?{params:{after:b}}:null}}class tl{constructor(h){this._client=h}}let y9e=class extends tl{list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/chat/completions/${h}/messages`,rRn,{query:b,...k})}},pbt=class extends tl{constructor(){super(...arguments),this.messages=new y9e(this._client)}create(h,b){return this._client.post("/chat/completions",{body:h,...b,stream:h.stream??!1})}retrieve(h,b){return this._client.get(`/chat/completions/${h}`,b)}update(h,b,k){return this._client.post(`/chat/completions/${h}`,{body:b,...k})}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/chat/completions",gbt,{query:h,...b})}del(h,b){return this._client.delete(`/chat/completions/${h}`,b)}};class gbt extends Y2{}class rRn extends Y2{}pbt.ChatCompletionsPage=gbt;pbt.Messages=y9e;let mbt=class extends tl{constructor(){super(...arguments),this.completions=new pbt(this._client)}};mbt.Completions=pbt;mbt.ChatCompletionsPage=gbt;class w9e extends tl{create(h,b){return this._client.post("/audio/speech",{body:h,...b,headers:{Accept:"application/octet-stream",...b==null?void 0:b.headers},__binaryResponse:!0})}}class v9e extends tl{create(h,b){return this._client.post("/audio/transcriptions",Fj({body:h,...b,stream:h.stream??!1,__metadata:{model:h.model}}))}}class x9e extends tl{create(h,b){return this._client.post("/audio/translations",Fj({body:h,...b,__metadata:{model:h.model}}))}}class MX extends tl{constructor(){super(...arguments),this.transcriptions=new v9e(this._client),this.translations=new x9e(this._client),this.speech=new w9e(this._client)}}MX.Transcriptions=v9e;MX.Translations=x9e;MX.Speech=w9e;class ljt extends tl{create(h,b){return this._client.post("/batches",{body:h,...b})}retrieve(h,b){return this._client.get(`/batches/${h}`,b)}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/batches",hjt,{query:h,...b})}cancel(h,b){return this._client.post(`/batches/${h}/cancel`,b)}}class hjt extends Y2{}ljt.BatchesPage=hjt;class fjt extends tl{create(h,b){return this._client.post("/assistants",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}retrieve(h,b){return this._client.get(`/assistants/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}update(h,b,k){return this._client.post(`/assistants/${h}`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/assistants",djt,{query:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}del(h,b){return this._client.delete(`/assistants/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}}class djt extends Y2{}fjt.AssistantsPage=djt;function iCe(o){return typeof o.parse=="function"}const Cj=o=>(o==null?void 0:o.role)==="assistant",k9e=o=>(o==null?void 0:o.role)==="function",_9e=o=>(o==null?void 0:o.role)==="tool";var H5=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},gd=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},bBt,Smt,Imt,eX,nX,Cmt,rX,ZE,iX,Umt,Gmt,kj,E9e;class pjt{constructor(){bBt.add(this),this.controller=new AbortController,Smt.set(this,void 0),Imt.set(this,()=>{}),eX.set(this,()=>{}),nX.set(this,void 0),Cmt.set(this,()=>{}),rX.set(this,()=>{}),ZE.set(this,{}),iX.set(this,!1),Umt.set(this,!1),Gmt.set(this,!1),kj.set(this,!1),H5(this,Smt,new Promise((h,b)=>{H5(this,Imt,h,"f"),H5(this,eX,b,"f")}),"f"),H5(this,nX,new Promise((h,b)=>{H5(this,Cmt,h,"f"),H5(this,rX,b,"f")}),"f"),gd(this,Smt,"f").catch(()=>{}),gd(this,nX,"f").catch(()=>{})}_run(h){setTimeout(()=>{h().then(()=>{this._emitFinal(),this._emit("end")},gd(this,bBt,"m",E9e).bind(this))},0)}_connected(){this.ended||(gd(this,Imt,"f").call(this),this._emit("connect"))}get ended(){return gd(this,iX,"f")}get errored(){return gd(this,Umt,"f")}get aborted(){return gd(this,Gmt,"f")}abort(){this.controller.abort()}on(h,b){return(gd(this,ZE,"f")[h]||(gd(this,ZE,"f")[h]=[])).push({listener:b}),this}off(h,b){const k=gd(this,ZE,"f")[h];if(!k)return this;const O=k.findIndex(P=>P.listener===b);return O>=0&&k.splice(O,1),this}once(h,b){return(gd(this,ZE,"f")[h]||(gd(this,ZE,"f")[h]=[])).push({listener:b,once:!0}),this}emitted(h){return new Promise((b,k)=>{H5(this,kj,!0,"f"),h!=="error"&&this.once("error",k),this.once(h,b)})}async done(){H5(this,kj,!0,"f"),await gd(this,nX,"f")}_emit(h,...b){if(gd(this,iX,"f"))return;h==="end"&&(H5(this,iX,!0,"f"),gd(this,Cmt,"f").call(this));const k=gd(this,ZE,"f")[h];if(k&&(gd(this,ZE,"f")[h]=k.filter(O=>!O.once),k.forEach(({listener:O})=>O(...b))),h==="abort"){const O=b[0];!gd(this,kj,"f")&&!(k!=null&&k.length)&&Promise.reject(O),gd(this,eX,"f").call(this,O),gd(this,rX,"f").call(this,O),this._emit("end");return}if(h==="error"){const O=b[0];!gd(this,kj,"f")&&!(k!=null&&k.length)&&Promise.reject(O),gd(this,eX,"f").call(this,O),gd(this,rX,"f").call(this,O),this._emit("end")}}_emitFinal(){}}Smt=new WeakMap,Imt=new WeakMap,eX=new WeakMap,nX=new WeakMap,Cmt=new WeakMap,rX=new WeakMap,ZE=new WeakMap,iX=new WeakMap,Umt=new WeakMap,Gmt=new WeakMap,kj=new WeakMap,bBt=new WeakSet,E9e=function(h){if(H5(this,Umt,!0,"f"),h instanceof Error&&h.name==="AbortError"&&(h=new x3),h instanceof x3)return H5(this,Gmt,!0,"f"),this._emit("abort",h);if(h instanceof Cs)return this._emit("error",h);if(h instanceof Error){const b=new Cs(h.message);return b.cause=h,this._emit("error",b)}return this._emit("error",new Cs(String(h)))};function gjt(o){return(o==null?void 0:o.$brand)==="auto-parseable-response-format"}function DX(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function iRn(o,h){return!h||!T9e(h)?{...o,choices:o.choices.map(b=>({...b,message:{...b.message,parsed:null,...b.message.tool_calls?{tool_calls:b.message.tool_calls}:void 0}}))}:mjt(o,h)}function mjt(o,h){const b=o.choices.map(k=>{var O;if(k.finish_reason==="length")throw new o9e;if(k.finish_reason==="content_filter")throw new s9e;return{...k,message:{...k.message,...k.message.tool_calls?{tool_calls:((O=k.message.tool_calls)==null?void 0:O.map(P=>oRn(h,P)))??void 0}:void 0,parsed:k.message.content&&!k.message.refusal?aRn(h,k.message.content):null}}});return{...o,choices:b}}function aRn(o,h){var b,k;return((b=o.response_format)==null?void 0:b.type)!=="json_schema"?null:((k=o.response_format)==null?void 0:k.type)==="json_schema"?"$parseRaw"in o.response_format?o.response_format.$parseRaw(h):JSON.parse(h):null}function oRn(o,h){var k;const b=(k=o.tools)==null?void 0:k.find(O=>{var P;return((P=O.function)==null?void 0:P.name)===h.function.name});return{...h,function:{...h.function,parsed_arguments:DX(b)?b.$parseRaw(h.function.arguments):b!=null&&b.function.strict?JSON.parse(h.function.arguments):null}}}function sRn(o,h){var k;if(!o)return!1;const b=(k=o.tools)==null?void 0:k.find(O=>{var P;return((P=O.function)==null?void 0:P.name)===h.function.name});return DX(b)||(b==null?void 0:b.function.strict)||!1}function T9e(o){var h;return gjt(o.response_format)?!0:((h=o.tools)==null?void 0:h.some(b=>DX(b)||b.type==="function"&&b.function.strict===!0))??!1}function cRn(o){for(const h of o??[]){if(h.type!=="function")throw new Cs(`Currently only \`function\` tool types support auto-parsing; Received \`${h.type}\``);if(h.function.strict!==!0)throw new Cs(`The \`${h.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var G2=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},bm,yBt,qmt,wBt,vBt,xBt,S9e,kBt;const aCe=10;class I9e extends pjt{constructor(){super(...arguments),bm.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(h){var k;this._chatCompletions.push(h),this._emit("chatCompletion",h);const b=(k=h.choices[0])==null?void 0:k.message;return b&&this._addMessage(b),h}_addMessage(h,b=!0){if("content"in h||(h.content=null),this.messages.push(h),b){if(this._emit("message",h),(k9e(h)||_9e(h))&&h.content)this._emit("functionCallResult",h.content);else if(Cj(h)&&h.function_call)this._emit("functionCall",h.function_call);else if(Cj(h)&&h.tool_calls)for(const k of h.tool_calls)k.type==="function"&&this._emit("functionCall",k.function)}}async finalChatCompletion(){await this.done();const h=this._chatCompletions[this._chatCompletions.length-1];if(!h)throw new Cs("stream ended without producing a ChatCompletion");return h}async finalContent(){return await this.done(),G2(this,bm,"m",yBt).call(this)}async finalMessage(){return await this.done(),G2(this,bm,"m",qmt).call(this)}async finalFunctionCall(){return await this.done(),G2(this,bm,"m",wBt).call(this)}async finalFunctionCallResult(){return await this.done(),G2(this,bm,"m",vBt).call(this)}async totalUsage(){return await this.done(),G2(this,bm,"m",xBt).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const h=this._chatCompletions[this._chatCompletions.length-1];h&&this._emit("finalChatCompletion",h);const b=G2(this,bm,"m",qmt).call(this);b&&this._emit("finalMessage",b);const k=G2(this,bm,"m",yBt).call(this);k&&this._emit("finalContent",k);const O=G2(this,bm,"m",wBt).call(this);O&&this._emit("finalFunctionCall",O);const P=G2(this,bm,"m",vBt).call(this);P!=null&&this._emit("finalFunctionCallResult",P),this._chatCompletions.some(B=>B.usage)&&this._emit("totalUsage",G2(this,bm,"m",xBt).call(this))}async _createChatCompletion(h,b,k){const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort())),G2(this,bm,"m",S9e).call(this,b);const P=await h.chat.completions.create({...b,stream:!1},{...k,signal:this.controller.signal});return this._connected(),this._addChatCompletion(mjt(P,b))}async _runChatCompletion(h,b,k){for(const O of b.messages)this._addMessage(O,!1);return await this._createChatCompletion(h,b,k)}async _runFunctions(h,b,k){var it;const O="function",{function_call:P="auto",stream:B,...G}=b,J=typeof P!="string"&&(P==null?void 0:P.name),{maxChatCompletions:U=aCe}=k||{},nt={};for(const st of b.functions)nt[st.name||st.function.name]=st;const at=b.functions.map(st=>({name:st.name||st.function.name,parameters:st.parameters,description:st.description}));for(const st of b.messages)this._addMessage(st,!1);for(let st=0;st<U;++st){const Et=(it=(await this._createChatCompletion(h,{...G,function_call:P,functions:at,messages:[...this.messages]},k)).choices[0])==null?void 0:it.message;if(!Et)throw new Cs("missing message in ChatCompletion response");if(!Et.function_call)return;const{name:Lt,arguments:Dt}=Et.function_call,ae=nt[Lt];if(ae){if(J&&J!==Lt){const ge=`Invalid function_call: ${JSON.stringify(Lt)}. ${JSON.stringify(J)} requested. Please try again`;this._addMessage({role:O,name:Lt,content:ge});continue}}else{const ge=`Invalid function_call: ${JSON.stringify(Lt)}. Available options are: ${at.map(Mn=>JSON.stringify(Mn.name)).join(", ")}. Please try again`;this._addMessage({role:O,name:Lt,content:ge});continue}let qt;try{qt=iCe(ae)?await ae.parse(Dt):Dt}catch(ge){this._addMessage({role:O,name:Lt,content:ge instanceof Error?ge.message:String(ge)});continue}const _e=await ae.function(qt,this),gn=G2(this,bm,"m",kBt).call(this,_e);if(this._addMessage({role:O,name:Lt,content:gn}),J)return}}async _runTools(h,b,k){var st,tt,Et;const O="tool",{tool_choice:P="auto",stream:B,...G}=b,J=typeof P!="string"&&((st=P==null?void 0:P.function)==null?void 0:st.name),{maxChatCompletions:U=aCe}=k||{},nt=b.tools.map(Lt=>{if(DX(Lt)){if(!Lt.$callback)throw new Cs("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Lt.$callback,name:Lt.function.name,description:Lt.function.description||"",parameters:Lt.function.parameters,parse:Lt.$parseRaw,strict:!0}}}return Lt}),at={};for(const Lt of nt)Lt.type==="function"&&(at[Lt.function.name||Lt.function.function.name]=Lt.function);const it="tools"in b?nt.map(Lt=>Lt.type==="function"?{type:"function",function:{name:Lt.function.name||Lt.function.function.name,parameters:Lt.function.parameters,description:Lt.function.description,strict:Lt.function.strict}}:Lt):void 0;for(const Lt of b.messages)this._addMessage(Lt,!1);for(let Lt=0;Lt<U;++Lt){const ae=(tt=(await this._createChatCompletion(h,{...G,tool_choice:P,tools:it,messages:[...this.messages]},k)).choices[0])==null?void 0:tt.message;if(!ae)throw new Cs("missing message in ChatCompletion response");if(!((Et=ae.tool_calls)!=null&&Et.length))return;for(const qt of ae.tool_calls){if(qt.type!=="function")continue;const _e=qt.id,{name:gn,arguments:ge}=qt.function,Mn=at[gn];if(Mn){if(J&&J!==gn){const bn=`Invalid tool_call: ${JSON.stringify(gn)}. ${JSON.stringify(J)} requested. Please try again`;this._addMessage({role:O,tool_call_id:_e,content:bn});continue}}else{const bn=`Invalid tool_call: ${JSON.stringify(gn)}. Available options are: ${Object.keys(at).map(Vn=>JSON.stringify(Vn)).join(", ")}. Please try again`;this._addMessage({role:O,tool_call_id:_e,content:bn});continue}let Wn;try{Wn=iCe(Mn)?await Mn.parse(ge):ge}catch(bn){const Vn=bn instanceof Error?bn.message:String(bn);this._addMessage({role:O,tool_call_id:_e,content:Vn});continue}const cr=await Mn.function(Wn,this),ar=G2(this,bm,"m",kBt).call(this,cr);if(this._addMessage({role:O,tool_call_id:_e,content:ar}),J)return}}}}bm=new WeakSet,yBt=function(){return G2(this,bm,"m",qmt).call(this).content??null},qmt=function(){let h=this.messages.length;for(;h-- >0;){const b=this.messages[h];if(Cj(b)){const{function_call:k,...O}=b,P={...O,content:b.content??null,refusal:b.refusal??null};return k&&(P.function_call=k),P}}throw new Cs("stream ended without producing a ChatCompletionMessage with role=assistant")},wBt=function(){var h,b;for(let k=this.messages.length-1;k>=0;k--){const O=this.messages[k];if(Cj(O)&&(O!=null&&O.function_call))return O.function_call;if(Cj(O)&&((h=O==null?void 0:O.tool_calls)!=null&&h.length))return(b=O.tool_calls.at(-1))==null?void 0:b.function}},vBt=function(){for(let h=this.messages.length-1;h>=0;h--){const b=this.messages[h];if(k9e(b)&&b.content!=null||_9e(b)&&b.content!=null&&typeof b.content=="string"&&this.messages.some(k=>{var O;return k.role==="assistant"&&((O=k.tool_calls)==null?void 0:O.some(P=>P.type==="function"&&P.id===b.tool_call_id))}))return b.content}},xBt=function(){const h={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:b}of this._chatCompletions)b&&(h.completion_tokens+=b.completion_tokens,h.prompt_tokens+=b.prompt_tokens,h.total_tokens+=b.total_tokens);return h},S9e=function(h){if(h.n!=null&&h.n>1)throw new Cs("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},kBt=function(h){return typeof h=="string"?h:h===void 0?"undefined":JSON.stringify(h)};class TX extends I9e{static runFunctions(h,b,k){const O=new TX,P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runFunctions"}};return O._run(()=>O._runFunctions(h,b,P)),O}static runTools(h,b,k){const O=new TX,P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runTools"}};return O._run(()=>O._runTools(h,b,P)),O}_addMessage(h,b=!0){super._addMessage(h,b),Cj(h)&&h.content&&this._emit("content",h.content)}}const C9e=1,A9e=2,O9e=4,N9e=8,P9e=16,L9e=32,M9e=64,D9e=128,R9e=256,B9e=D9e|R9e,j9e=P9e|L9e|B9e|M9e,F9e=C9e|A9e|j9e,$9e=O9e|N9e,uRn=F9e|$9e,B0={STR:C9e,NUM:A9e,ARR:O9e,OBJ:N9e,NULL:P9e,BOOL:L9e,NAN:M9e,INFINITY:D9e,MINUS_INFINITY:R9e,INF:B9e,SPECIAL:j9e,ATOM:F9e,COLLECTION:$9e,ALL:uRn};class lRn extends Error{}class hRn extends Error{}function fRn(o,h=B0.ALL){if(typeof o!="string")throw new TypeError(`expecting str, got ${typeof o}`);if(!o.trim())throw new Error(`${o} is empty`);return dRn(o.trim(),h)}const dRn=(o,h)=>{const b=o.length;let k=0;const O=it=>{throw new lRn(`${it} at position ${k}`)},P=it=>{throw new hRn(`${it} at position ${k}`)},B=()=>(at(),k>=b&&O("Unexpected end of input"),o[k]==='"'?G():o[k]==="{"?J():o[k]==="["?U():o.substring(k,k+4)==="null"||B0.NULL&h&&b-k<4&&"null".startsWith(o.substring(k))?(k+=4,null):o.substring(k,k+4)==="true"||B0.BOOL&h&&b-k<4&&"true".startsWith(o.substring(k))?(k+=4,!0):o.substring(k,k+5)==="false"||B0.BOOL&h&&b-k<5&&"false".startsWith(o.substring(k))?(k+=5,!1):o.substring(k,k+8)==="Infinity"||B0.INFINITY&h&&b-k<8&&"Infinity".startsWith(o.substring(k))?(k+=8,1/0):o.substring(k,k+9)==="-Infinity"||B0.MINUS_INFINITY&h&&1<b-k&&b-k<9&&"-Infinity".startsWith(o.substring(k))?(k+=9,-1/0):o.substring(k,k+3)==="NaN"||B0.NAN&h&&b-k<3&&"NaN".startsWith(o.substring(k))?(k+=3,NaN):nt()),G=()=>{const it=k;let st=!1;for(k++;k<b&&(o[k]!=='"'||st&&o[k-1]==="\\");)st=o[k]==="\\"?!st:!1,k++;if(o.charAt(k)=='"')try{return JSON.parse(o.substring(it,++k-Number(st)))}catch(tt){P(String(tt))}else if(B0.STR&h)try{return JSON.parse(o.substring(it,k-Number(st))+'"')}catch{return JSON.parse(o.substring(it,o.lastIndexOf("\\"))+'"')}O("Unterminated string literal")},J=()=>{k++,at();const it={};try{for(;o[k]!=="}";){if(at(),k>=b&&B0.OBJ&h)return it;const st=G();at(),k++;try{const tt=B();Object.defineProperty(it,st,{value:tt,writable:!0,enumerable:!0,configurable:!0})}catch(tt){if(B0.OBJ&h)return it;throw tt}at(),o[k]===","&&k++}}catch{if(B0.OBJ&h)return it;O("Expected '}' at end of object")}return k++,it},U=()=>{k++;const it=[];try{for(;o[k]!=="]";)it.push(B()),at(),o[k]===","&&k++}catch{if(B0.ARR&h)return it;O("Expected ']' at end of array")}return k++,it},nt=()=>{if(k===0){o==="-"&&B0.NUM&h&&O("Not sure what '-' is");try{return JSON.parse(o)}catch(st){if(B0.NUM&h)try{return o[o.length-1]==="."?JSON.parse(o.substring(0,o.lastIndexOf("."))):JSON.parse(o.substring(0,o.lastIndexOf("e")))}catch{}P(String(st))}}const it=k;for(o[k]==="-"&&k++;o[k]&&!",]}".includes(o[k]);)k++;k==b&&!(B0.NUM&h)&&O("Unterminated number literal");try{return JSON.parse(o.substring(it,k))}catch{o.substring(it,k)==="-"&&B0.NUM&h&&O("Not sure what '-' is");try{return JSON.parse(o.substring(it,o.lastIndexOf("e")))}catch(tt){P(String(tt))}}},at=()=>{for(;k<b&&`
3204
- \r `.includes(o[k]);)k++};return B()},oCe=o=>fRn(o,B0.ALL^B0.NUM);var dj=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},Ph=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},Yp,QE,pj,F8,cRt,fmt,uRt,lRt,hRt,dmt,fRt,sCe;class SX extends I9e{constructor(h){super(),Yp.add(this),QE.set(this,void 0),pj.set(this,void 0),F8.set(this,void 0),dj(this,QE,h,"f"),dj(this,pj,[],"f")}get currentChatCompletionSnapshot(){return Ph(this,F8,"f")}static fromReadableStream(h){const b=new SX(null);return b._run(()=>b._fromReadableStream(h)),b}static createChatCompletion(h,b,k){const O=new SX(b);return O._run(()=>O._runChatCompletion(h,{...b,stream:!0},{...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"stream"}})),O}async _createChatCompletion(h,b,k){var B;super._createChatCompletion;const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort())),Ph(this,Yp,"m",cRt).call(this);const P=await h.chat.completions.create({...b,stream:!0},{...k,signal:this.controller.signal});this._connected();for await(const G of P)Ph(this,Yp,"m",uRt).call(this,G);if((B=P.controller.signal)!=null&&B.aborted)throw new x3;return this._addChatCompletion(Ph(this,Yp,"m",dmt).call(this))}async _fromReadableStream(h,b){var B;const k=b==null?void 0:b.signal;k&&(k.aborted&&this.controller.abort(),k.addEventListener("abort",()=>this.controller.abort())),Ph(this,Yp,"m",cRt).call(this),this._connected();const O=f6.fromReadableStream(h,this.controller);let P;for await(const G of O)P&&P!==G.id&&this._addChatCompletion(Ph(this,Yp,"m",dmt).call(this)),Ph(this,Yp,"m",uRt).call(this,G),P=G.id;if((B=O.controller.signal)!=null&&B.aborted)throw new x3;return this._addChatCompletion(Ph(this,Yp,"m",dmt).call(this))}[(QE=new WeakMap,pj=new WeakMap,F8=new WeakMap,Yp=new WeakSet,cRt=function(){this.ended||dj(this,F8,void 0,"f")},fmt=function(b){let k=Ph(this,pj,"f")[b.index];return k||(k={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},Ph(this,pj,"f")[b.index]=k,k)},uRt=function(b){var O,P,B,G,J,U,nt,at,it,st,tt,Et,Lt,Dt,ae;if(this.ended)return;const k=Ph(this,Yp,"m",sCe).call(this,b);this._emit("chunk",b,k);for(const qt of b.choices){const _e=k.choices[qt.index];qt.delta.content!=null&&((O=_e.message)==null?void 0:O.role)==="assistant"&&((P=_e.message)!=null&&P.content)&&(this._emit("content",qt.delta.content,_e.message.content),this._emit("content.delta",{delta:qt.delta.content,snapshot:_e.message.content,parsed:_e.message.parsed})),qt.delta.refusal!=null&&((B=_e.message)==null?void 0:B.role)==="assistant"&&((G=_e.message)!=null&&G.refusal)&&this._emit("refusal.delta",{delta:qt.delta.refusal,snapshot:_e.message.refusal}),((J=qt.logprobs)==null?void 0:J.content)!=null&&((U=_e.message)==null?void 0:U.role)==="assistant"&&this._emit("logprobs.content.delta",{content:(nt=qt.logprobs)==null?void 0:nt.content,snapshot:((at=_e.logprobs)==null?void 0:at.content)??[]}),((it=qt.logprobs)==null?void 0:it.refusal)!=null&&((st=_e.message)==null?void 0:st.role)==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:(tt=qt.logprobs)==null?void 0:tt.refusal,snapshot:((Et=_e.logprobs)==null?void 0:Et.refusal)??[]});const gn=Ph(this,Yp,"m",fmt).call(this,_e);_e.finish_reason&&(Ph(this,Yp,"m",hRt).call(this,_e),gn.current_tool_call_index!=null&&Ph(this,Yp,"m",lRt).call(this,_e,gn.current_tool_call_index));for(const ge of qt.delta.tool_calls??[])gn.current_tool_call_index!==ge.index&&(Ph(this,Yp,"m",hRt).call(this,_e),gn.current_tool_call_index!=null&&Ph(this,Yp,"m",lRt).call(this,_e,gn.current_tool_call_index)),gn.current_tool_call_index=ge.index;for(const ge of qt.delta.tool_calls??[]){const Mn=(Lt=_e.message.tool_calls)==null?void 0:Lt[ge.index];Mn!=null&&Mn.type&&((Mn==null?void 0:Mn.type)==="function"?this._emit("tool_calls.function.arguments.delta",{name:(Dt=Mn.function)==null?void 0:Dt.name,index:ge.index,arguments:Mn.function.arguments,parsed_arguments:Mn.function.parsed_arguments,arguments_delta:((ae=ge.function)==null?void 0:ae.arguments)??""}):(Mn==null||Mn.type,void 0))}}},lRt=function(b,k){var B,G,J;if(Ph(this,Yp,"m",fmt).call(this,b).done_tool_calls.has(k))return;const P=(B=b.message.tool_calls)==null?void 0:B[k];if(!P)throw new Error("no tool call snapshot");if(!P.type)throw new Error("tool call snapshot missing `type`");if(P.type==="function"){const U=(J=(G=Ph(this,QE,"f"))==null?void 0:G.tools)==null?void 0:J.find(nt=>nt.type==="function"&&nt.function.name===P.function.name);this._emit("tool_calls.function.arguments.done",{name:P.function.name,index:k,arguments:P.function.arguments,parsed_arguments:DX(U)?U.$parseRaw(P.function.arguments):U!=null&&U.function.strict?JSON.parse(P.function.arguments):null})}else P.type},hRt=function(b){var O,P;const k=Ph(this,Yp,"m",fmt).call(this,b);if(b.message.content&&!k.content_done){k.content_done=!0;const B=Ph(this,Yp,"m",fRt).call(this);this._emit("content.done",{content:b.message.content,parsed:B?B.$parseRaw(b.message.content):null})}b.message.refusal&&!k.refusal_done&&(k.refusal_done=!0,this._emit("refusal.done",{refusal:b.message.refusal})),(O=b.logprobs)!=null&&O.content&&!k.logprobs_content_done&&(k.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:b.logprobs.content})),(P=b.logprobs)!=null&&P.refusal&&!k.logprobs_refusal_done&&(k.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:b.logprobs.refusal}))},dmt=function(){if(this.ended)throw new Cs("stream has ended, this shouldn't happen");const b=Ph(this,F8,"f");if(!b)throw new Cs("request ended without sending any chunks");return dj(this,F8,void 0,"f"),dj(this,pj,[],"f"),pRn(b,Ph(this,QE,"f"))},fRt=function(){var k;const b=(k=Ph(this,QE,"f"))==null?void 0:k.response_format;return gjt(b)?b:null},sCe=function(b){var k,O,P,B;let G=Ph(this,F8,"f");const{choices:J,...U}=b;G?Object.assign(G,U):G=dj(this,F8,{...U,choices:[]},"f");for(const{delta:nt,finish_reason:at,index:it,logprobs:st=null,...tt}of b.choices){let Et=G.choices[it];if(Et||(Et=G.choices[it]={finish_reason:at,index:it,message:{},logprobs:st,...tt}),st)if(!Et.logprobs)Et.logprobs=Object.assign({},st);else{const{content:ge,refusal:Mn,...Wn}=st;Object.assign(Et.logprobs,Wn),ge&&((k=Et.logprobs).content??(k.content=[]),Et.logprobs.content.push(...ge)),Mn&&((O=Et.logprobs).refusal??(O.refusal=[]),Et.logprobs.refusal.push(...Mn))}if(at&&(Et.finish_reason=at,Ph(this,QE,"f")&&T9e(Ph(this,QE,"f")))){if(at==="length")throw new o9e;if(at==="content_filter")throw new s9e}if(Object.assign(Et,tt),!nt)continue;const{content:Lt,refusal:Dt,function_call:ae,role:qt,tool_calls:_e,...gn}=nt;if(Object.assign(Et.message,gn),Dt&&(Et.message.refusal=(Et.message.refusal||"")+Dt),qt&&(Et.message.role=qt),ae&&(Et.message.function_call?(ae.name&&(Et.message.function_call.name=ae.name),ae.arguments&&((P=Et.message.function_call).arguments??(P.arguments=""),Et.message.function_call.arguments+=ae.arguments)):Et.message.function_call=ae),Lt&&(Et.message.content=(Et.message.content||"")+Lt,!Et.message.refusal&&Ph(this,Yp,"m",fRt).call(this)&&(Et.message.parsed=oCe(Et.message.content))),_e){Et.message.tool_calls||(Et.message.tool_calls=[]);for(const{index:ge,id:Mn,type:Wn,function:cr,...ar}of _e){const bn=(B=Et.message.tool_calls)[ge]??(B[ge]={});Object.assign(bn,ar),Mn&&(bn.id=Mn),Wn&&(bn.type=Wn),cr&&(bn.function??(bn.function={name:cr.name??"",arguments:""})),cr!=null&&cr.name&&(bn.function.name=cr.name),cr!=null&&cr.arguments&&(bn.function.arguments+=cr.arguments,sRn(Ph(this,QE,"f"),bn)&&(bn.function.parsed_arguments=oCe(bn.function.arguments)))}}}return G},Symbol.asyncIterator)](){const h=[],b=[];let k=!1;return this.on("chunk",O=>{const P=b.shift();P?P.resolve(O):h.push(O)}),this.on("end",()=>{k=!0;for(const O of b)O.resolve(void 0);b.length=0}),this.on("abort",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),this.on("error",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),{next:async()=>h.length?{value:h.shift(),done:!1}:k?{value:void 0,done:!0}:new Promise((P,B)=>b.push({resolve:P,reject:B})).then(P=>P?{value:P,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new f6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function pRn(o,h){const{id:b,choices:k,created:O,model:P,system_fingerprint:B,...G}=o,J={...G,id:b,choices:k.map(({message:U,finish_reason:nt,index:at,logprobs:it,...st})=>{if(!nt)throw new Cs(`missing finish_reason for choice ${at}`);const{content:tt=null,function_call:Et,tool_calls:Lt,...Dt}=U,ae=U.role;if(!ae)throw new Cs(`missing role for choice ${at}`);if(Et){const{arguments:qt,name:_e}=Et;if(qt==null)throw new Cs(`missing function_call.arguments for choice ${at}`);if(!_e)throw new Cs(`missing function_call.name for choice ${at}`);return{...st,message:{content:tt,function_call:{arguments:qt,name:_e},role:ae,refusal:U.refusal??null},finish_reason:nt,index:at,logprobs:it}}return Lt?{...st,index:at,finish_reason:nt,logprobs:it,message:{...Dt,role:ae,content:tt,refusal:U.refusal??null,tool_calls:Lt.map((qt,_e)=>{const{function:gn,type:ge,id:Mn,...Wn}=qt,{arguments:cr,name:ar,...bn}=gn||{};if(Mn==null)throw new Cs(`missing choices[${at}].tool_calls[${_e}].id
3201
+ `,"\r"]);hbt.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function NDn(o,h){for(let O=h??0;O<o.length;O++){if(o[O]===10)return{preceding:O,index:O+1,carriage:!1};if(o[O]===13)return{preceding:O,index:O+1,carriage:!0}}return null}function PDn(o){for(let k=0;k<o.length-1;k++){if(o[k]===10&&o[k+1]===10||o[k]===13&&o[k+1]===13)return k+2;if(o[k]===13&&o[k+1]===10&&k+3<o.length&&o[k+2]===13&&o[k+3]===10)return k+4}return-1}function c9e(o){if(o[Symbol.asyncIterator])return o;const h=o.getReader();return{async next(){try{const b=await h.read();return b!=null&&b.done&&h.releaseLock(),b}catch(b){throw h.releaseLock(),b}},async return(){const b=h.cancel();return h.releaseLock(),await b,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}class f6{constructor(h,b){this.iterator=h,this.controller=b}static fromSSEResponse(h,b){let k=!1;async function*O(){if(k)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");k=!0;let P=!1;try{for await(const B of LDn(h,b))if(!P){if(B.data.startsWith("[DONE]")){P=!0;continue}if(B.event===null||B.event.startsWith("response.")||B.event.startsWith("transcript.")){let G;try{G=JSON.parse(B.data)}catch(J){throw console.error("Could not parse message into JSON:",B.data),console.error("From chunk:",B.raw),J}if(G&&G.error)throw new Ig(void 0,G.error,void 0,g9e(h.headers));yield G}else{let G;try{G=JSON.parse(B.data)}catch(J){throw console.error("Could not parse message into JSON:",B.data),console.error("From chunk:",B.raw),J}if(B.event=="error")throw new Ig(void 0,G.error,G.message,void 0);yield{event:B.event,data:G}}}P=!0}catch(B){if(B instanceof Error&&B.name==="AbortError")return;throw B}finally{P||b.abort()}}return new f6(O,b)}static fromReadableStream(h,b){let k=!1;async function*O(){const B=new hbt,G=c9e(h);for await(const J of G)for(const U of B.decode(J))yield U;for(const J of B.flush())yield J}async function*P(){if(k)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");k=!0;let B=!1;try{for await(const G of O())B||G&&(yield JSON.parse(G));B=!0}catch(G){if(G instanceof Error&&G.name==="AbortError")return;throw G}finally{B||b.abort()}}return new f6(P,b)}[Symbol.asyncIterator](){return this.iterator()}tee(){const h=[],b=[],k=this.iterator(),O=P=>({next:()=>{if(P.length===0){const B=k.next();h.push(B),b.push(B)}return P.shift()}});return[new f6(()=>O(h),this.controller),new f6(()=>O(b),this.controller)]}toReadableStream(){const h=this;let b;const k=new TextEncoder;return new W7e({async start(){b=h[Symbol.asyncIterator]()},async pull(O){try{const{value:P,done:B}=await b.next();if(B)return O.close();const G=k.encode(JSON.stringify(P)+`
3202
+ `);O.enqueue(G)}catch(P){O.error(P)}},async cancel(){var O;await((O=b.return)==null?void 0:O.call(b))}})}}async function*LDn(o,h){if(!o.body)throw h.abort(),new Cs("Attempted to iterate over a response with no body");const b=new DDn,k=new hbt,O=c9e(o.body);for await(const P of MDn(O))for(const B of k.decode(P)){const G=b.decode(B);G&&(yield G)}for(const P of k.flush()){const B=b.decode(P);B&&(yield B)}}async function*MDn(o){let h=new Uint8Array;for await(const b of o){if(b==null)continue;const k=b instanceof ArrayBuffer?new Uint8Array(b):typeof b=="string"?new TextEncoder().encode(b):b;let O=new Uint8Array(h.length+k.length);O.set(h),O.set(k,h.length),h=O;let P;for(;(P=PDn(h))!==-1;)yield h.slice(0,P),h=h.slice(P)}h.length>0&&(yield h)}class DDn{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(h){if(h.endsWith("\r")&&(h=h.substring(0,h.length-1)),!h){if(!this.event&&!this.data.length)return null;const P={event:this.event,data:this.data.join(`
3203
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],P}if(this.chunks.push(h),h.startsWith(":"))return null;let[b,k,O]=RDn(h,":");return O.startsWith(" ")&&(O=O.substring(1)),b==="event"?this.event=O:b==="data"&&this.data.push(O),null}}function RDn(o,h){const b=o.indexOf(h);return b!==-1?[o.substring(0,b),h,o.substring(b+h.length)]:[o,"",""]}const u9e=o=>o!=null&&typeof o=="object"&&typeof o.url=="string"&&typeof o.blob=="function",l9e=o=>o!=null&&typeof o=="object"&&typeof o.name=="string"&&typeof o.lastModified=="number"&&fbt(o),fbt=o=>o!=null&&typeof o=="object"&&typeof o.size=="number"&&typeof o.type=="string"&&typeof o.text=="function"&&typeof o.slice=="function"&&typeof o.arrayBuffer=="function",BDn=o=>l9e(o)||u9e(o)||J7e(o);async function h9e(o,h,b){var O;if(o=await o,l9e(o))return o;if(u9e(o)){const P=await o.blob();h||(h=new URL(o.url).pathname.split(/[\\/]/).pop()??"unknown_file");const B=fbt(P)?[await P.arrayBuffer()]:[P];return new pBt(B,h,b)}const k=await jDn(o);if(h||(h=$Dn(o)??"unknown_file"),!(b!=null&&b.type)){const P=(O=k[0])==null?void 0:O.type;typeof P=="string"&&(b={...b,type:P})}return new pBt(k,h,b)}async function jDn(o){var b;let h=[];if(typeof o=="string"||ArrayBuffer.isView(o)||o instanceof ArrayBuffer)h.push(o);else if(fbt(o))h.push(await o.arrayBuffer());else if(HDn(o))for await(const k of o)h.push(k);else throw new Error(`Unexpected data type: ${typeof o}; constructor: ${(b=o==null?void 0:o.constructor)==null?void 0:b.name}; props: ${FDn(o)}`);return h}function FDn(o){return`[${Object.getOwnPropertyNames(o).map(b=>`"${b}"`).join(", ")}]`}function $Dn(o){var h;return aRt(o.name)||aRt(o.filename)||((h=aRt(o.path))==null?void 0:h.split(/[\\/]/).pop())}const aRt=o=>{if(typeof o=="string")return o;if(typeof Buffer<"u"&&o instanceof Buffer)return String(o)},HDn=o=>o!=null&&typeof o=="object"&&typeof o[Symbol.asyncIterator]=="function",Q8e=o=>o&&typeof o=="object"&&o.body&&o[Symbol.toStringTag]==="MultipartBody",Fj=async o=>{const h=await zDn(o.body);return K7e(h,o)},zDn=async o=>{const h=new q7e;return await Promise.all(Object.entries(o||{}).map(([b,k])=>gBt(h,b,k))),h},gBt=async(o,h,b)=>{if(b!==void 0){if(b==null)throw new TypeError(`Received null for "${h}"; to pass null in FormData, you must use the string 'null'`);if(typeof b=="string"||typeof b=="number"||typeof b=="boolean")o.append(h,String(b));else if(BDn(b)){const k=await h9e(b);o.append(h,k)}else if(Array.isArray(b))await Promise.all(b.map(k=>gBt(o,h+"[]",k)));else if(typeof b=="object")await Promise.all(Object.entries(b).map(([k,O])=>gBt(o,`${h}[${k}]`,O)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${b} instead`)}};var Ij={},UDn=function(o,h,b,k,O){if(typeof h=="function"?o!==h||!0:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return h.set(o,b),b},GDn=function(o,h,b,k){if(typeof h=="function"?o!==h||!0:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},umt;X7e();async function f9e(o){var B;const{response:h}=o;if(o.options.stream)return Y8("response",h.status,h.url,h.headers,h.body),o.options.__streamClass?o.options.__streamClass.fromSSEResponse(h,o.controller):f6.fromSSEResponse(h,o.controller);if(h.status===204)return null;if(o.options.__binaryResponse)return h;const b=h.headers.get("content-type"),k=(B=b==null?void 0:b.split(";")[0])==null?void 0:B.trim();if((k==null?void 0:k.includes("application/json"))||(k==null?void 0:k.endsWith("+json"))){const G=await h.json();return Y8("response",h.status,h.url,h.headers,G),d9e(G,h)}const P=await h.text();return Y8("response",h.status,h.url,h.headers,P),P}function d9e(o,h){return!o||typeof o!="object"||Array.isArray(o)?o:Object.defineProperty(o,"_request_id",{value:h.headers.get("x-request-id"),enumerable:!1})}class dbt extends Promise{constructor(h,b=f9e){super(k=>{k(null)}),this.responsePromise=h,this.parseResponse=b}_thenUnwrap(h){return new dbt(this.responsePromise,async b=>d9e(h(await this.parseResponse(b),b),b.response))}asResponse(){return this.responsePromise.then(h=>h.response)}async withResponse(){const[h,b]=await Promise.all([this.parse(),this.asResponse()]);return{data:h,response:b,request_id:b.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(h,b){return this.parse().then(h,b)}catch(h){return this.parse().catch(h)}finally(h){return this.parse().finally(h)}}class qDn{constructor({baseURL:h,maxRetries:b=2,timeout:k=6e5,httpAgent:O,fetch:P}){this.baseURL=h,this.maxRetries=oRt("maxRetries",b),this.timeout=oRt("timeout",k),this.httpAgent=O,this.fetch=P??G7e}authHeaders(h){return{}}defaultHeaders(h){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...JDn(),...this.authHeaders(h)}}validateHeaders(h,b){}defaultIdempotencyKey(){return`stainless-node-retry-${tRn()}`}get(h,b){return this.methodRequest("get",h,b)}post(h,b){return this.methodRequest("post",h,b)}patch(h,b){return this.methodRequest("patch",h,b)}put(h,b){return this.methodRequest("put",h,b)}delete(h,b){return this.methodRequest("delete",h,b)}methodRequest(h,b,k){return this.request(Promise.resolve(k).then(async O=>{const P=O&&fbt(O==null?void 0:O.body)?new DataView(await O.body.arrayBuffer()):(O==null?void 0:O.body)instanceof DataView?O.body:(O==null?void 0:O.body)instanceof ArrayBuffer?new DataView(O.body):O&&ArrayBuffer.isView(O==null?void 0:O.body)?new DataView(O.body.buffer):O==null?void 0:O.body;return{method:h,path:b,...O,body:P}}))}getAPIList(h,b,k){return this.requestAPIList(b,{method:"get",path:h,...k})}calculateContentLength(h){if(typeof h=="string"){if(typeof Buffer<"u")return Buffer.byteLength(h,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(h).length.toString()}else if(ArrayBuffer.isView(h))return h.byteLength.toString();return null}buildRequest(h,{retryCount:b=0}={}){var tt;h={...h};const{method:k,path:O,query:P,headers:B={}}=h,G=ArrayBuffer.isView(h.body)||h.__binaryRequest&&typeof h.body=="string"?h.body:Q8e(h.body)?h.body.body:h.body?JSON.stringify(h.body,null,2):null,J=this.calculateContentLength(G),U=this.buildURL(O,P);"timeout"in h&&oRt("timeout",h.timeout),h.timeout=h.timeout??this.timeout;const nt=h.httpAgent??this.httpAgent??V7e(U),at=h.timeout+1e3;typeof((tt=nt==null?void 0:nt.options)==null?void 0:tt.timeout)=="number"&&at>(nt.options.timeout??0)&&(nt.options.timeout=at),this.idempotencyHeader&&k!=="get"&&(h.idempotencyKey||(h.idempotencyKey=this.defaultIdempotencyKey()),B[this.idempotencyHeader]=h.idempotencyKey);const it=this.buildHeaders({options:h,headers:B,contentLength:J,retryCount:b});return{req:{method:k,...G&&{body:G},headers:it,...nt&&{agent:nt},signal:h.signal??null},url:U,timeout:h.timeout}}buildHeaders({options:h,headers:b,contentLength:k,retryCount:O}){const P={};k&&(P["content-length"]=k);const B=this.defaultHeaders(h);return nCe(P,B),nCe(P,b),Q8e(h.body)&&hX!=="node"&&delete P["content-type"],hmt(B,"x-stainless-retry-count")===void 0&&hmt(b,"x-stainless-retry-count")===void 0&&(P["x-stainless-retry-count"]=String(O)),hmt(B,"x-stainless-timeout")===void 0&&hmt(b,"x-stainless-timeout")===void 0&&h.timeout&&(P["x-stainless-timeout"]=String(h.timeout)),this.validateHeaders(P,b),P}async prepareOptions(h){}async prepareRequest(h,{url:b,options:k}){}parseHeaders(h){return h?Symbol.iterator in h?Object.fromEntries(Array.from(h).map(b=>[...b])):{...h}:{}}makeStatusError(h,b,k,O){return Ig.generate(h,b,k,O)}request(h,b=null){return new dbt(this.makeRequest(h,b))}async makeRequest(h,b){var at,it;const k=await h,O=k.maxRetries??this.maxRetries;b==null&&(b=O),await this.prepareOptions(k);const{req:P,url:B,timeout:G}=this.buildRequest(k,{retryCount:O-b});if(await this.prepareRequest(P,{url:B,options:k}),Y8("request",B,k,P.headers),(at=k.signal)!=null&&at.aborted)throw new x3;const J=new AbortController,U=await this.fetchWithTimeout(B,P,G,J).catch(mBt);if(U instanceof Error){if((it=k.signal)!=null&&it.aborted)throw new x3;if(b)return this.retryRequest(k,b);throw U.name==="AbortError"?new cjt:new lbt({cause:U})}const nt=g9e(U.headers);if(!U.ok){if(b&&this.shouldRetry(U)){const ae=`retrying, ${b} attempts remaining`;return Y8(`response (error; ${ae})`,U.status,B,nt),this.retryRequest(k,b,nt)}const st=await U.text().catch(ae=>mBt(ae).message),tt=XDn(st),Et=tt?void 0:st;throw Y8(`response (error; ${b?"(error; no more retries left)":"(error; not retryable)"})`,U.status,B,nt,Et),this.makeStatusError(U.status,tt,Et,nt)}return{response:U,options:k,controller:J}}requestAPIList(h,b){const k=this.makeRequest(b,null);return new WDn(this,k,h)}buildURL(h,b){const k=ZDn(h)?new URL(h):new URL(this.baseURL+(this.baseURL.endsWith("/")&&h.startsWith("/")?h.slice(1):h)),O=this.defaultQuery();return m9e(O)||(b={...O,...b}),typeof b=="object"&&b&&!Array.isArray(b)&&(k.search=this.stringifyQuery(b)),k.toString()}stringifyQuery(h){return Object.entries(h).filter(([b,k])=>typeof k<"u").map(([b,k])=>{if(typeof k=="string"||typeof k=="number"||typeof k=="boolean")return`${encodeURIComponent(b)}=${encodeURIComponent(k)}`;if(k===null)return`${encodeURIComponent(b)}=`;throw new Cs(`Cannot stringify type ${typeof k}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(h,b,k,O){const{signal:P,...B}=b||{};P&&P.addEventListener("abort",()=>O.abort());const G=setTimeout(()=>O.abort(),k),J={signal:O.signal,...B};return J.method&&(J.method=J.method.toUpperCase()),this.fetch.call(void 0,h,J).finally(()=>{clearTimeout(G)})}shouldRetry(h){const b=h.headers.get("x-should-retry");return b==="true"?!0:b==="false"?!1:h.status===408||h.status===409||h.status===429||h.status>=500}async retryRequest(h,b,k){let O;const P=k==null?void 0:k["retry-after-ms"];if(P){const G=parseFloat(P);Number.isNaN(G)||(O=G)}const B=k==null?void 0:k["retry-after"];if(B&&!O){const G=parseFloat(B);Number.isNaN(G)?O=Date.parse(B)-Date.now():O=G*1e3}if(!(O&&0<=O&&O<60*1e3)){const G=h.maxRetries??this.maxRetries;O=this.calculateDefaultRetryTimeoutMillis(b,G)}return await LX(O),this.makeRequest(h,b-1)}calculateDefaultRetryTimeoutMillis(h,b){const P=b-h,B=Math.min(.5*Math.pow(2,P),8),G=1-Math.random()*.25;return B*G*1e3}getUserAgent(){return`${this.constructor.name}/JS ${xj}`}}class p9e{constructor(h,b,k,O){umt.set(this,void 0),UDn(this,umt,h),this.options=O,this.response=b,this.body=k}hasNextPage(){return this.getPaginatedItems().length?this.nextPageInfo()!=null:!1}async getNextPage(){const h=this.nextPageInfo();if(!h)throw new Cs("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");const b={...this.options};if("params"in h&&typeof b.query=="object")b.query={...b.query,...h.params};else if("url"in h){const k=[...Object.entries(b.query||{}),...h.url.searchParams.entries()];for(const[O,P]of k)h.url.searchParams.set(O,P);b.query=void 0,b.path=h.url.toString()}return await GDn(this,umt,"f").requestAPIList(this.constructor,b)}async*iterPages(){let h=this;for(yield h;h.hasNextPage();)h=await h.getNextPage(),yield h}async*[(umt=new WeakMap,Symbol.asyncIterator)](){for await(const h of this.iterPages())for(const b of h.getPaginatedItems())yield b}}class WDn extends dbt{constructor(h,b,k){super(b,async O=>new k(h,O.response,await f9e(O),O.options))}async*[Symbol.asyncIterator](){const h=await this;for await(const b of h)yield b}}const g9e=o=>new Proxy(Object.fromEntries(o.entries()),{get(h,b){const k=b.toString();return h[k.toLowerCase()]||h[k]}}),KDn={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},$0=o=>typeof o=="object"&&o!==null&&!m9e(o)&&Object.keys(o).every(h=>b9e(KDn,h)),VDn=()=>{var h;if(typeof Deno<"u"&&Deno.build!=null)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":tCe(Deno.build.os),"X-Stainless-Arch":Z8e(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:((h=Deno.version)==null?void 0:h.deno)??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":process.version};if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":tCe(process.platform),"X-Stainless-Arch":Z8e(process.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":process.version};const o=YDn();return o?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${o.browser}`,"X-Stainless-Runtime-Version":o.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xj,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function YDn(){if(typeof navigator>"u"||!navigator)return null;const o=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:h,pattern:b}of o){const k=b.exec(navigator.userAgent);if(k){const O=k[1]||0,P=k[2]||0,B=k[3]||0;return{browser:h,version:`${O}.${P}.${B}`}}}return null}const Z8e=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",tCe=o=>(o=o.toLowerCase(),o.includes("ios")?"iOS":o==="android"?"Android":o==="darwin"?"MacOS":o==="win32"?"Windows":o==="freebsd"?"FreeBSD":o==="openbsd"?"OpenBSD":o==="linux"?"Linux":o?`Other:${o}`:"Unknown");let eCe;const JDn=()=>eCe??(eCe=VDn()),XDn=o=>{try{return JSON.parse(o)}catch{return}},QDn=/^[a-z][a-z0-9+.-]*:/i,ZDn=o=>QDn.test(o),LX=o=>new Promise(h=>setTimeout(h,o)),oRt=(o,h)=>{if(typeof h!="number"||!Number.isInteger(h))throw new Cs(`${o} must be an integer`);if(h<0)throw new Cs(`${o} must be a positive integer`);return h},mBt=o=>{if(o instanceof Error)return o;if(typeof o=="object"&&o!==null)try{return new Error(JSON.stringify(o))}catch{}return new Error(o)},lmt=o=>{var h,b,k,O;if(typeof process<"u")return((h=Ij==null?void 0:Ij[o])==null?void 0:h.trim())??void 0;if(typeof Deno<"u")return(O=(k=(b=Deno.env)==null?void 0:b.get)==null?void 0:k.call(b,o))==null?void 0:O.trim()};function m9e(o){if(!o)return!0;for(const h in o)return!1;return!0}function b9e(o,h){return Object.prototype.hasOwnProperty.call(o,h)}function nCe(o,h){for(const b in h){if(!b9e(h,b))continue;const k=b.toLowerCase();if(!k)continue;const O=h[b];O===null?delete o[k]:O!==void 0&&(o[k]=O)}}const rCe=new Set(["authorization","api-key"]);function Y8(o,...h){if(typeof process<"u"&&(Ij==null?void 0:Ij.DEBUG)==="true"){const b=h.map(k=>{if(!k)return k;if(k.headers){const P={...k,headers:{...k.headers}};for(const B in k.headers)rCe.has(B.toLowerCase())&&(P.headers[B]="REDACTED");return P}let O=null;for(const P in k)rCe.has(P.toLowerCase())&&(O??(O={...k}),O[P]="REDACTED");return O??k});console.log(`OpenAI:DEBUG:${o}`,...b)}}const tRn=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const h=Math.random()*16|0;return(o==="x"?h:h&3|8).toString(16)}),eRn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",nRn=o=>typeof(o==null?void 0:o.get)=="function",hmt=(o,h)=>{var k;const b=h.toLowerCase();if(nRn(o)){const O=((k=h[0])==null?void 0:k.toUpperCase())+h.substring(1).replace(/([^\w])(\w)/g,(P,B,G)=>B+G.toUpperCase());for(const P of[h,b,h.toUpperCase(),O]){const B=o.get(P);if(B)return B}}for(const[O,P]of Object.entries(o))if(O.toLowerCase()===b)return Array.isArray(P)?(P.length<=1||console.warn(`Received ${P.length} entries for the ${h} header, using the first entry.`),P[0]):P},rRn=o=>{if(typeof Buffer<"u")return Array.from(new Float32Array(Buffer.from(o,"base64").buffer));{const h=atob(o),b=h.length,k=new Uint8Array(b);for(let O=0;O<b;O++)k[O]=h.charCodeAt(O);return Array.from(new Float32Array(k.buffer))}};function sRt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}class ujt extends p9e{constructor(h,b,k,O){super(h,b,k,O),this.data=k.data||[],this.object=k.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class Y2 extends p9e{constructor(h,b,k,O){super(h,b,k,O),this.data=k.data||[],this.has_more=k.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageParams(){const h=this.nextPageInfo();if(!h)return null;if("params"in h)return h.params;const b=Object.fromEntries(h.url.searchParams);return Object.keys(b).length?b:null}nextPageInfo(){var k;const h=this.getPaginatedItems();if(!h.length)return null;const b=(k=h[h.length-1])==null?void 0:k.id;return b?{params:{after:b}}:null}}class tl{constructor(h){this._client=h}}let y9e=class extends tl{list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/chat/completions/${h}/messages`,iRn,{query:b,...k})}},pbt=class extends tl{constructor(){super(...arguments),this.messages=new y9e(this._client)}create(h,b){return this._client.post("/chat/completions",{body:h,...b,stream:h.stream??!1})}retrieve(h,b){return this._client.get(`/chat/completions/${h}`,b)}update(h,b,k){return this._client.post(`/chat/completions/${h}`,{body:b,...k})}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/chat/completions",gbt,{query:h,...b})}del(h,b){return this._client.delete(`/chat/completions/${h}`,b)}};class gbt extends Y2{}class iRn extends Y2{}pbt.ChatCompletionsPage=gbt;pbt.Messages=y9e;let mbt=class extends tl{constructor(){super(...arguments),this.completions=new pbt(this._client)}};mbt.Completions=pbt;mbt.ChatCompletionsPage=gbt;class w9e extends tl{create(h,b){return this._client.post("/audio/speech",{body:h,...b,headers:{Accept:"application/octet-stream",...b==null?void 0:b.headers},__binaryResponse:!0})}}class v9e extends tl{create(h,b){return this._client.post("/audio/transcriptions",Fj({body:h,...b,stream:h.stream??!1,__metadata:{model:h.model}}))}}class x9e extends tl{create(h,b){return this._client.post("/audio/translations",Fj({body:h,...b,__metadata:{model:h.model}}))}}class MX extends tl{constructor(){super(...arguments),this.transcriptions=new v9e(this._client),this.translations=new x9e(this._client),this.speech=new w9e(this._client)}}MX.Transcriptions=v9e;MX.Translations=x9e;MX.Speech=w9e;class ljt extends tl{create(h,b){return this._client.post("/batches",{body:h,...b})}retrieve(h,b){return this._client.get(`/batches/${h}`,b)}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/batches",hjt,{query:h,...b})}cancel(h,b){return this._client.post(`/batches/${h}/cancel`,b)}}class hjt extends Y2{}ljt.BatchesPage=hjt;class fjt extends tl{create(h,b){return this._client.post("/assistants",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}retrieve(h,b){return this._client.get(`/assistants/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}update(h,b,k){return this._client.post(`/assistants/${h}`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/assistants",djt,{query:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}del(h,b){return this._client.delete(`/assistants/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}}class djt extends Y2{}fjt.AssistantsPage=djt;function iCe(o){return typeof o.parse=="function"}const Cj=o=>(o==null?void 0:o.role)==="assistant",k9e=o=>(o==null?void 0:o.role)==="function",_9e=o=>(o==null?void 0:o.role)==="tool";var H5=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},gd=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},bBt,Smt,Imt,eX,nX,Cmt,rX,ZE,iX,Umt,Gmt,kj,E9e;class pjt{constructor(){bBt.add(this),this.controller=new AbortController,Smt.set(this,void 0),Imt.set(this,()=>{}),eX.set(this,()=>{}),nX.set(this,void 0),Cmt.set(this,()=>{}),rX.set(this,()=>{}),ZE.set(this,{}),iX.set(this,!1),Umt.set(this,!1),Gmt.set(this,!1),kj.set(this,!1),H5(this,Smt,new Promise((h,b)=>{H5(this,Imt,h,"f"),H5(this,eX,b,"f")}),"f"),H5(this,nX,new Promise((h,b)=>{H5(this,Cmt,h,"f"),H5(this,rX,b,"f")}),"f"),gd(this,Smt,"f").catch(()=>{}),gd(this,nX,"f").catch(()=>{})}_run(h){setTimeout(()=>{h().then(()=>{this._emitFinal(),this._emit("end")},gd(this,bBt,"m",E9e).bind(this))},0)}_connected(){this.ended||(gd(this,Imt,"f").call(this),this._emit("connect"))}get ended(){return gd(this,iX,"f")}get errored(){return gd(this,Umt,"f")}get aborted(){return gd(this,Gmt,"f")}abort(){this.controller.abort()}on(h,b){return(gd(this,ZE,"f")[h]||(gd(this,ZE,"f")[h]=[])).push({listener:b}),this}off(h,b){const k=gd(this,ZE,"f")[h];if(!k)return this;const O=k.findIndex(P=>P.listener===b);return O>=0&&k.splice(O,1),this}once(h,b){return(gd(this,ZE,"f")[h]||(gd(this,ZE,"f")[h]=[])).push({listener:b,once:!0}),this}emitted(h){return new Promise((b,k)=>{H5(this,kj,!0,"f"),h!=="error"&&this.once("error",k),this.once(h,b)})}async done(){H5(this,kj,!0,"f"),await gd(this,nX,"f")}_emit(h,...b){if(gd(this,iX,"f"))return;h==="end"&&(H5(this,iX,!0,"f"),gd(this,Cmt,"f").call(this));const k=gd(this,ZE,"f")[h];if(k&&(gd(this,ZE,"f")[h]=k.filter(O=>!O.once),k.forEach(({listener:O})=>O(...b))),h==="abort"){const O=b[0];!gd(this,kj,"f")&&!(k!=null&&k.length)&&Promise.reject(O),gd(this,eX,"f").call(this,O),gd(this,rX,"f").call(this,O),this._emit("end");return}if(h==="error"){const O=b[0];!gd(this,kj,"f")&&!(k!=null&&k.length)&&Promise.reject(O),gd(this,eX,"f").call(this,O),gd(this,rX,"f").call(this,O),this._emit("end")}}_emitFinal(){}}Smt=new WeakMap,Imt=new WeakMap,eX=new WeakMap,nX=new WeakMap,Cmt=new WeakMap,rX=new WeakMap,ZE=new WeakMap,iX=new WeakMap,Umt=new WeakMap,Gmt=new WeakMap,kj=new WeakMap,bBt=new WeakSet,E9e=function(h){if(H5(this,Umt,!0,"f"),h instanceof Error&&h.name==="AbortError"&&(h=new x3),h instanceof x3)return H5(this,Gmt,!0,"f"),this._emit("abort",h);if(h instanceof Cs)return this._emit("error",h);if(h instanceof Error){const b=new Cs(h.message);return b.cause=h,this._emit("error",b)}return this._emit("error",new Cs(String(h)))};function gjt(o){return(o==null?void 0:o.$brand)==="auto-parseable-response-format"}function DX(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function aRn(o,h){return!h||!T9e(h)?{...o,choices:o.choices.map(b=>({...b,message:{...b.message,parsed:null,...b.message.tool_calls?{tool_calls:b.message.tool_calls}:void 0}}))}:mjt(o,h)}function mjt(o,h){const b=o.choices.map(k=>{var O;if(k.finish_reason==="length")throw new o9e;if(k.finish_reason==="content_filter")throw new s9e;return{...k,message:{...k.message,...k.message.tool_calls?{tool_calls:((O=k.message.tool_calls)==null?void 0:O.map(P=>sRn(h,P)))??void 0}:void 0,parsed:k.message.content&&!k.message.refusal?oRn(h,k.message.content):null}}});return{...o,choices:b}}function oRn(o,h){var b,k;return((b=o.response_format)==null?void 0:b.type)!=="json_schema"?null:((k=o.response_format)==null?void 0:k.type)==="json_schema"?"$parseRaw"in o.response_format?o.response_format.$parseRaw(h):JSON.parse(h):null}function sRn(o,h){var k;const b=(k=o.tools)==null?void 0:k.find(O=>{var P;return((P=O.function)==null?void 0:P.name)===h.function.name});return{...h,function:{...h.function,parsed_arguments:DX(b)?b.$parseRaw(h.function.arguments):b!=null&&b.function.strict?JSON.parse(h.function.arguments):null}}}function cRn(o,h){var k;if(!o)return!1;const b=(k=o.tools)==null?void 0:k.find(O=>{var P;return((P=O.function)==null?void 0:P.name)===h.function.name});return DX(b)||(b==null?void 0:b.function.strict)||!1}function T9e(o){var h;return gjt(o.response_format)?!0:((h=o.tools)==null?void 0:h.some(b=>DX(b)||b.type==="function"&&b.function.strict===!0))??!1}function uRn(o){for(const h of o??[]){if(h.type!=="function")throw new Cs(`Currently only \`function\` tool types support auto-parsing; Received \`${h.type}\``);if(h.function.strict!==!0)throw new Cs(`The \`${h.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var G2=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},bm,yBt,qmt,wBt,vBt,xBt,S9e,kBt;const aCe=10;class I9e extends pjt{constructor(){super(...arguments),bm.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(h){var k;this._chatCompletions.push(h),this._emit("chatCompletion",h);const b=(k=h.choices[0])==null?void 0:k.message;return b&&this._addMessage(b),h}_addMessage(h,b=!0){if("content"in h||(h.content=null),this.messages.push(h),b){if(this._emit("message",h),(k9e(h)||_9e(h))&&h.content)this._emit("functionCallResult",h.content);else if(Cj(h)&&h.function_call)this._emit("functionCall",h.function_call);else if(Cj(h)&&h.tool_calls)for(const k of h.tool_calls)k.type==="function"&&this._emit("functionCall",k.function)}}async finalChatCompletion(){await this.done();const h=this._chatCompletions[this._chatCompletions.length-1];if(!h)throw new Cs("stream ended without producing a ChatCompletion");return h}async finalContent(){return await this.done(),G2(this,bm,"m",yBt).call(this)}async finalMessage(){return await this.done(),G2(this,bm,"m",qmt).call(this)}async finalFunctionCall(){return await this.done(),G2(this,bm,"m",wBt).call(this)}async finalFunctionCallResult(){return await this.done(),G2(this,bm,"m",vBt).call(this)}async totalUsage(){return await this.done(),G2(this,bm,"m",xBt).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const h=this._chatCompletions[this._chatCompletions.length-1];h&&this._emit("finalChatCompletion",h);const b=G2(this,bm,"m",qmt).call(this);b&&this._emit("finalMessage",b);const k=G2(this,bm,"m",yBt).call(this);k&&this._emit("finalContent",k);const O=G2(this,bm,"m",wBt).call(this);O&&this._emit("finalFunctionCall",O);const P=G2(this,bm,"m",vBt).call(this);P!=null&&this._emit("finalFunctionCallResult",P),this._chatCompletions.some(B=>B.usage)&&this._emit("totalUsage",G2(this,bm,"m",xBt).call(this))}async _createChatCompletion(h,b,k){const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort())),G2(this,bm,"m",S9e).call(this,b);const P=await h.chat.completions.create({...b,stream:!1},{...k,signal:this.controller.signal});return this._connected(),this._addChatCompletion(mjt(P,b))}async _runChatCompletion(h,b,k){for(const O of b.messages)this._addMessage(O,!1);return await this._createChatCompletion(h,b,k)}async _runFunctions(h,b,k){var it;const O="function",{function_call:P="auto",stream:B,...G}=b,J=typeof P!="string"&&(P==null?void 0:P.name),{maxChatCompletions:U=aCe}=k||{},nt={};for(const st of b.functions)nt[st.name||st.function.name]=st;const at=b.functions.map(st=>({name:st.name||st.function.name,parameters:st.parameters,description:st.description}));for(const st of b.messages)this._addMessage(st,!1);for(let st=0;st<U;++st){const Et=(it=(await this._createChatCompletion(h,{...G,function_call:P,functions:at,messages:[...this.messages]},k)).choices[0])==null?void 0:it.message;if(!Et)throw new Cs("missing message in ChatCompletion response");if(!Et.function_call)return;const{name:Lt,arguments:Dt}=Et.function_call,ae=nt[Lt];if(ae){if(J&&J!==Lt){const ge=`Invalid function_call: ${JSON.stringify(Lt)}. ${JSON.stringify(J)} requested. Please try again`;this._addMessage({role:O,name:Lt,content:ge});continue}}else{const ge=`Invalid function_call: ${JSON.stringify(Lt)}. Available options are: ${at.map(Mn=>JSON.stringify(Mn.name)).join(", ")}. Please try again`;this._addMessage({role:O,name:Lt,content:ge});continue}let qt;try{qt=iCe(ae)?await ae.parse(Dt):Dt}catch(ge){this._addMessage({role:O,name:Lt,content:ge instanceof Error?ge.message:String(ge)});continue}const _e=await ae.function(qt,this),gn=G2(this,bm,"m",kBt).call(this,_e);if(this._addMessage({role:O,name:Lt,content:gn}),J)return}}async _runTools(h,b,k){var st,tt,Et;const O="tool",{tool_choice:P="auto",stream:B,...G}=b,J=typeof P!="string"&&((st=P==null?void 0:P.function)==null?void 0:st.name),{maxChatCompletions:U=aCe}=k||{},nt=b.tools.map(Lt=>{if(DX(Lt)){if(!Lt.$callback)throw new Cs("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Lt.$callback,name:Lt.function.name,description:Lt.function.description||"",parameters:Lt.function.parameters,parse:Lt.$parseRaw,strict:!0}}}return Lt}),at={};for(const Lt of nt)Lt.type==="function"&&(at[Lt.function.name||Lt.function.function.name]=Lt.function);const it="tools"in b?nt.map(Lt=>Lt.type==="function"?{type:"function",function:{name:Lt.function.name||Lt.function.function.name,parameters:Lt.function.parameters,description:Lt.function.description,strict:Lt.function.strict}}:Lt):void 0;for(const Lt of b.messages)this._addMessage(Lt,!1);for(let Lt=0;Lt<U;++Lt){const ae=(tt=(await this._createChatCompletion(h,{...G,tool_choice:P,tools:it,messages:[...this.messages]},k)).choices[0])==null?void 0:tt.message;if(!ae)throw new Cs("missing message in ChatCompletion response");if(!((Et=ae.tool_calls)!=null&&Et.length))return;for(const qt of ae.tool_calls){if(qt.type!=="function")continue;const _e=qt.id,{name:gn,arguments:ge}=qt.function,Mn=at[gn];if(Mn){if(J&&J!==gn){const bn=`Invalid tool_call: ${JSON.stringify(gn)}. ${JSON.stringify(J)} requested. Please try again`;this._addMessage({role:O,tool_call_id:_e,content:bn});continue}}else{const bn=`Invalid tool_call: ${JSON.stringify(gn)}. Available options are: ${Object.keys(at).map(Vn=>JSON.stringify(Vn)).join(", ")}. Please try again`;this._addMessage({role:O,tool_call_id:_e,content:bn});continue}let Wn;try{Wn=iCe(Mn)?await Mn.parse(ge):ge}catch(bn){const Vn=bn instanceof Error?bn.message:String(bn);this._addMessage({role:O,tool_call_id:_e,content:Vn});continue}const cr=await Mn.function(Wn,this),ar=G2(this,bm,"m",kBt).call(this,cr);if(this._addMessage({role:O,tool_call_id:_e,content:ar}),J)return}}}}bm=new WeakSet,yBt=function(){return G2(this,bm,"m",qmt).call(this).content??null},qmt=function(){let h=this.messages.length;for(;h-- >0;){const b=this.messages[h];if(Cj(b)){const{function_call:k,...O}=b,P={...O,content:b.content??null,refusal:b.refusal??null};return k&&(P.function_call=k),P}}throw new Cs("stream ended without producing a ChatCompletionMessage with role=assistant")},wBt=function(){var h,b;for(let k=this.messages.length-1;k>=0;k--){const O=this.messages[k];if(Cj(O)&&(O!=null&&O.function_call))return O.function_call;if(Cj(O)&&((h=O==null?void 0:O.tool_calls)!=null&&h.length))return(b=O.tool_calls.at(-1))==null?void 0:b.function}},vBt=function(){for(let h=this.messages.length-1;h>=0;h--){const b=this.messages[h];if(k9e(b)&&b.content!=null||_9e(b)&&b.content!=null&&typeof b.content=="string"&&this.messages.some(k=>{var O;return k.role==="assistant"&&((O=k.tool_calls)==null?void 0:O.some(P=>P.type==="function"&&P.id===b.tool_call_id))}))return b.content}},xBt=function(){const h={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:b}of this._chatCompletions)b&&(h.completion_tokens+=b.completion_tokens,h.prompt_tokens+=b.prompt_tokens,h.total_tokens+=b.total_tokens);return h},S9e=function(h){if(h.n!=null&&h.n>1)throw new Cs("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},kBt=function(h){return typeof h=="string"?h:h===void 0?"undefined":JSON.stringify(h)};class TX extends I9e{static runFunctions(h,b,k){const O=new TX,P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runFunctions"}};return O._run(()=>O._runFunctions(h,b,P)),O}static runTools(h,b,k){const O=new TX,P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runTools"}};return O._run(()=>O._runTools(h,b,P)),O}_addMessage(h,b=!0){super._addMessage(h,b),Cj(h)&&h.content&&this._emit("content",h.content)}}const C9e=1,A9e=2,O9e=4,N9e=8,P9e=16,L9e=32,M9e=64,D9e=128,R9e=256,B9e=D9e|R9e,j9e=P9e|L9e|B9e|M9e,F9e=C9e|A9e|j9e,$9e=O9e|N9e,lRn=F9e|$9e,B0={STR:C9e,NUM:A9e,ARR:O9e,OBJ:N9e,NULL:P9e,BOOL:L9e,NAN:M9e,INFINITY:D9e,MINUS_INFINITY:R9e,INF:B9e,SPECIAL:j9e,ATOM:F9e,COLLECTION:$9e,ALL:lRn};class hRn extends Error{}class fRn extends Error{}function dRn(o,h=B0.ALL){if(typeof o!="string")throw new TypeError(`expecting str, got ${typeof o}`);if(!o.trim())throw new Error(`${o} is empty`);return pRn(o.trim(),h)}const pRn=(o,h)=>{const b=o.length;let k=0;const O=it=>{throw new hRn(`${it} at position ${k}`)},P=it=>{throw new fRn(`${it} at position ${k}`)},B=()=>(at(),k>=b&&O("Unexpected end of input"),o[k]==='"'?G():o[k]==="{"?J():o[k]==="["?U():o.substring(k,k+4)==="null"||B0.NULL&h&&b-k<4&&"null".startsWith(o.substring(k))?(k+=4,null):o.substring(k,k+4)==="true"||B0.BOOL&h&&b-k<4&&"true".startsWith(o.substring(k))?(k+=4,!0):o.substring(k,k+5)==="false"||B0.BOOL&h&&b-k<5&&"false".startsWith(o.substring(k))?(k+=5,!1):o.substring(k,k+8)==="Infinity"||B0.INFINITY&h&&b-k<8&&"Infinity".startsWith(o.substring(k))?(k+=8,1/0):o.substring(k,k+9)==="-Infinity"||B0.MINUS_INFINITY&h&&1<b-k&&b-k<9&&"-Infinity".startsWith(o.substring(k))?(k+=9,-1/0):o.substring(k,k+3)==="NaN"||B0.NAN&h&&b-k<3&&"NaN".startsWith(o.substring(k))?(k+=3,NaN):nt()),G=()=>{const it=k;let st=!1;for(k++;k<b&&(o[k]!=='"'||st&&o[k-1]==="\\");)st=o[k]==="\\"?!st:!1,k++;if(o.charAt(k)=='"')try{return JSON.parse(o.substring(it,++k-Number(st)))}catch(tt){P(String(tt))}else if(B0.STR&h)try{return JSON.parse(o.substring(it,k-Number(st))+'"')}catch{return JSON.parse(o.substring(it,o.lastIndexOf("\\"))+'"')}O("Unterminated string literal")},J=()=>{k++,at();const it={};try{for(;o[k]!=="}";){if(at(),k>=b&&B0.OBJ&h)return it;const st=G();at(),k++;try{const tt=B();Object.defineProperty(it,st,{value:tt,writable:!0,enumerable:!0,configurable:!0})}catch(tt){if(B0.OBJ&h)return it;throw tt}at(),o[k]===","&&k++}}catch{if(B0.OBJ&h)return it;O("Expected '}' at end of object")}return k++,it},U=()=>{k++;const it=[];try{for(;o[k]!=="]";)it.push(B()),at(),o[k]===","&&k++}catch{if(B0.ARR&h)return it;O("Expected ']' at end of array")}return k++,it},nt=()=>{if(k===0){o==="-"&&B0.NUM&h&&O("Not sure what '-' is");try{return JSON.parse(o)}catch(st){if(B0.NUM&h)try{return o[o.length-1]==="."?JSON.parse(o.substring(0,o.lastIndexOf("."))):JSON.parse(o.substring(0,o.lastIndexOf("e")))}catch{}P(String(st))}}const it=k;for(o[k]==="-"&&k++;o[k]&&!",]}".includes(o[k]);)k++;k==b&&!(B0.NUM&h)&&O("Unterminated number literal");try{return JSON.parse(o.substring(it,k))}catch{o.substring(it,k)==="-"&&B0.NUM&h&&O("Not sure what '-' is");try{return JSON.parse(o.substring(it,o.lastIndexOf("e")))}catch(tt){P(String(tt))}}},at=()=>{for(;k<b&&`
3204
+ \r `.includes(o[k]);)k++};return B()},oCe=o=>dRn(o,B0.ALL^B0.NUM);var dj=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},Ph=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},Yp,QE,pj,F8,cRt,fmt,uRt,lRt,hRt,dmt,fRt,sCe;class SX extends I9e{constructor(h){super(),Yp.add(this),QE.set(this,void 0),pj.set(this,void 0),F8.set(this,void 0),dj(this,QE,h,"f"),dj(this,pj,[],"f")}get currentChatCompletionSnapshot(){return Ph(this,F8,"f")}static fromReadableStream(h){const b=new SX(null);return b._run(()=>b._fromReadableStream(h)),b}static createChatCompletion(h,b,k){const O=new SX(b);return O._run(()=>O._runChatCompletion(h,{...b,stream:!0},{...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"stream"}})),O}async _createChatCompletion(h,b,k){var B;super._createChatCompletion;const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort())),Ph(this,Yp,"m",cRt).call(this);const P=await h.chat.completions.create({...b,stream:!0},{...k,signal:this.controller.signal});this._connected();for await(const G of P)Ph(this,Yp,"m",uRt).call(this,G);if((B=P.controller.signal)!=null&&B.aborted)throw new x3;return this._addChatCompletion(Ph(this,Yp,"m",dmt).call(this))}async _fromReadableStream(h,b){var B;const k=b==null?void 0:b.signal;k&&(k.aborted&&this.controller.abort(),k.addEventListener("abort",()=>this.controller.abort())),Ph(this,Yp,"m",cRt).call(this),this._connected();const O=f6.fromReadableStream(h,this.controller);let P;for await(const G of O)P&&P!==G.id&&this._addChatCompletion(Ph(this,Yp,"m",dmt).call(this)),Ph(this,Yp,"m",uRt).call(this,G),P=G.id;if((B=O.controller.signal)!=null&&B.aborted)throw new x3;return this._addChatCompletion(Ph(this,Yp,"m",dmt).call(this))}[(QE=new WeakMap,pj=new WeakMap,F8=new WeakMap,Yp=new WeakSet,cRt=function(){this.ended||dj(this,F8,void 0,"f")},fmt=function(b){let k=Ph(this,pj,"f")[b.index];return k||(k={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},Ph(this,pj,"f")[b.index]=k,k)},uRt=function(b){var O,P,B,G,J,U,nt,at,it,st,tt,Et,Lt,Dt,ae;if(this.ended)return;const k=Ph(this,Yp,"m",sCe).call(this,b);this._emit("chunk",b,k);for(const qt of b.choices){const _e=k.choices[qt.index];qt.delta.content!=null&&((O=_e.message)==null?void 0:O.role)==="assistant"&&((P=_e.message)!=null&&P.content)&&(this._emit("content",qt.delta.content,_e.message.content),this._emit("content.delta",{delta:qt.delta.content,snapshot:_e.message.content,parsed:_e.message.parsed})),qt.delta.refusal!=null&&((B=_e.message)==null?void 0:B.role)==="assistant"&&((G=_e.message)!=null&&G.refusal)&&this._emit("refusal.delta",{delta:qt.delta.refusal,snapshot:_e.message.refusal}),((J=qt.logprobs)==null?void 0:J.content)!=null&&((U=_e.message)==null?void 0:U.role)==="assistant"&&this._emit("logprobs.content.delta",{content:(nt=qt.logprobs)==null?void 0:nt.content,snapshot:((at=_e.logprobs)==null?void 0:at.content)??[]}),((it=qt.logprobs)==null?void 0:it.refusal)!=null&&((st=_e.message)==null?void 0:st.role)==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:(tt=qt.logprobs)==null?void 0:tt.refusal,snapshot:((Et=_e.logprobs)==null?void 0:Et.refusal)??[]});const gn=Ph(this,Yp,"m",fmt).call(this,_e);_e.finish_reason&&(Ph(this,Yp,"m",hRt).call(this,_e),gn.current_tool_call_index!=null&&Ph(this,Yp,"m",lRt).call(this,_e,gn.current_tool_call_index));for(const ge of qt.delta.tool_calls??[])gn.current_tool_call_index!==ge.index&&(Ph(this,Yp,"m",hRt).call(this,_e),gn.current_tool_call_index!=null&&Ph(this,Yp,"m",lRt).call(this,_e,gn.current_tool_call_index)),gn.current_tool_call_index=ge.index;for(const ge of qt.delta.tool_calls??[]){const Mn=(Lt=_e.message.tool_calls)==null?void 0:Lt[ge.index];Mn!=null&&Mn.type&&((Mn==null?void 0:Mn.type)==="function"?this._emit("tool_calls.function.arguments.delta",{name:(Dt=Mn.function)==null?void 0:Dt.name,index:ge.index,arguments:Mn.function.arguments,parsed_arguments:Mn.function.parsed_arguments,arguments_delta:((ae=ge.function)==null?void 0:ae.arguments)??""}):(Mn==null||Mn.type,void 0))}}},lRt=function(b,k){var B,G,J;if(Ph(this,Yp,"m",fmt).call(this,b).done_tool_calls.has(k))return;const P=(B=b.message.tool_calls)==null?void 0:B[k];if(!P)throw new Error("no tool call snapshot");if(!P.type)throw new Error("tool call snapshot missing `type`");if(P.type==="function"){const U=(J=(G=Ph(this,QE,"f"))==null?void 0:G.tools)==null?void 0:J.find(nt=>nt.type==="function"&&nt.function.name===P.function.name);this._emit("tool_calls.function.arguments.done",{name:P.function.name,index:k,arguments:P.function.arguments,parsed_arguments:DX(U)?U.$parseRaw(P.function.arguments):U!=null&&U.function.strict?JSON.parse(P.function.arguments):null})}else P.type},hRt=function(b){var O,P;const k=Ph(this,Yp,"m",fmt).call(this,b);if(b.message.content&&!k.content_done){k.content_done=!0;const B=Ph(this,Yp,"m",fRt).call(this);this._emit("content.done",{content:b.message.content,parsed:B?B.$parseRaw(b.message.content):null})}b.message.refusal&&!k.refusal_done&&(k.refusal_done=!0,this._emit("refusal.done",{refusal:b.message.refusal})),(O=b.logprobs)!=null&&O.content&&!k.logprobs_content_done&&(k.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:b.logprobs.content})),(P=b.logprobs)!=null&&P.refusal&&!k.logprobs_refusal_done&&(k.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:b.logprobs.refusal}))},dmt=function(){if(this.ended)throw new Cs("stream has ended, this shouldn't happen");const b=Ph(this,F8,"f");if(!b)throw new Cs("request ended without sending any chunks");return dj(this,F8,void 0,"f"),dj(this,pj,[],"f"),gRn(b,Ph(this,QE,"f"))},fRt=function(){var k;const b=(k=Ph(this,QE,"f"))==null?void 0:k.response_format;return gjt(b)?b:null},sCe=function(b){var k,O,P,B;let G=Ph(this,F8,"f");const{choices:J,...U}=b;G?Object.assign(G,U):G=dj(this,F8,{...U,choices:[]},"f");for(const{delta:nt,finish_reason:at,index:it,logprobs:st=null,...tt}of b.choices){let Et=G.choices[it];if(Et||(Et=G.choices[it]={finish_reason:at,index:it,message:{},logprobs:st,...tt}),st)if(!Et.logprobs)Et.logprobs=Object.assign({},st);else{const{content:ge,refusal:Mn,...Wn}=st;Object.assign(Et.logprobs,Wn),ge&&((k=Et.logprobs).content??(k.content=[]),Et.logprobs.content.push(...ge)),Mn&&((O=Et.logprobs).refusal??(O.refusal=[]),Et.logprobs.refusal.push(...Mn))}if(at&&(Et.finish_reason=at,Ph(this,QE,"f")&&T9e(Ph(this,QE,"f")))){if(at==="length")throw new o9e;if(at==="content_filter")throw new s9e}if(Object.assign(Et,tt),!nt)continue;const{content:Lt,refusal:Dt,function_call:ae,role:qt,tool_calls:_e,...gn}=nt;if(Object.assign(Et.message,gn),Dt&&(Et.message.refusal=(Et.message.refusal||"")+Dt),qt&&(Et.message.role=qt),ae&&(Et.message.function_call?(ae.name&&(Et.message.function_call.name=ae.name),ae.arguments&&((P=Et.message.function_call).arguments??(P.arguments=""),Et.message.function_call.arguments+=ae.arguments)):Et.message.function_call=ae),Lt&&(Et.message.content=(Et.message.content||"")+Lt,!Et.message.refusal&&Ph(this,Yp,"m",fRt).call(this)&&(Et.message.parsed=oCe(Et.message.content))),_e){Et.message.tool_calls||(Et.message.tool_calls=[]);for(const{index:ge,id:Mn,type:Wn,function:cr,...ar}of _e){const bn=(B=Et.message.tool_calls)[ge]??(B[ge]={});Object.assign(bn,ar),Mn&&(bn.id=Mn),Wn&&(bn.type=Wn),cr&&(bn.function??(bn.function={name:cr.name??"",arguments:""})),cr!=null&&cr.name&&(bn.function.name=cr.name),cr!=null&&cr.arguments&&(bn.function.arguments+=cr.arguments,cRn(Ph(this,QE,"f"),bn)&&(bn.function.parsed_arguments=oCe(bn.function.arguments)))}}}return G},Symbol.asyncIterator)](){const h=[],b=[];let k=!1;return this.on("chunk",O=>{const P=b.shift();P?P.resolve(O):h.push(O)}),this.on("end",()=>{k=!0;for(const O of b)O.resolve(void 0);b.length=0}),this.on("abort",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),this.on("error",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),{next:async()=>h.length?{value:h.shift(),done:!1}:k?{value:void 0,done:!0}:new Promise((P,B)=>b.push({resolve:P,reject:B})).then(P=>P?{value:P,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new f6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function gRn(o,h){const{id:b,choices:k,created:O,model:P,system_fingerprint:B,...G}=o,J={...G,id:b,choices:k.map(({message:U,finish_reason:nt,index:at,logprobs:it,...st})=>{if(!nt)throw new Cs(`missing finish_reason for choice ${at}`);const{content:tt=null,function_call:Et,tool_calls:Lt,...Dt}=U,ae=U.role;if(!ae)throw new Cs(`missing role for choice ${at}`);if(Et){const{arguments:qt,name:_e}=Et;if(qt==null)throw new Cs(`missing function_call.arguments for choice ${at}`);if(!_e)throw new Cs(`missing function_call.name for choice ${at}`);return{...st,message:{content:tt,function_call:{arguments:qt,name:_e},role:ae,refusal:U.refusal??null},finish_reason:nt,index:at,logprobs:it}}return Lt?{...st,index:at,finish_reason:nt,logprobs:it,message:{...Dt,role:ae,content:tt,refusal:U.refusal??null,tool_calls:Lt.map((qt,_e)=>{const{function:gn,type:ge,id:Mn,...Wn}=qt,{arguments:cr,name:ar,...bn}=gn||{};if(Mn==null)throw new Cs(`missing choices[${at}].tool_calls[${_e}].id
3205
3205
  ${pmt(o)}`);if(ge==null)throw new Cs(`missing choices[${at}].tool_calls[${_e}].type
3206
3206
  ${pmt(o)}`);if(ar==null)throw new Cs(`missing choices[${at}].tool_calls[${_e}].function.name
3207
3207
  ${pmt(o)}`);if(cr==null)throw new Cs(`missing choices[${at}].tool_calls[${_e}].function.arguments
3208
- ${pmt(o)}`);return{...Wn,id:Mn,type:ge,function:{...bn,name:ar,arguments:cr}}})}}:{...st,message:{...Dt,content:tt,role:ae,refusal:U.refusal??null},finish_reason:nt,index:at,logprobs:it}}),created:O,model:P,object:"chat.completion",...B?{system_fingerprint:B}:{}};return iRn(J,h)}function pmt(o){return JSON.stringify(o)}class Aj extends SX{static fromReadableStream(h){const b=new Aj(null);return b._run(()=>b._fromReadableStream(h)),b}static runFunctions(h,b,k){const O=new Aj(null),P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runFunctions"}};return O._run(()=>O._runFunctions(h,b,P)),O}static runTools(h,b,k){const O=new Aj(b),P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runTools"}};return O._run(()=>O._runTools(h,b,P)),O}}let H9e=class extends tl{parse(h,b){return cRn(h.tools),this._client.chat.completions.create(h,{...b,headers:{...b==null?void 0:b.headers,"X-Stainless-Helper-Method":"beta.chat.completions.parse"}})._thenUnwrap(k=>mjt(k,h))}runFunctions(h,b){return h.stream?Aj.runFunctions(this._client,h,b):TX.runFunctions(this._client,h,b)}runTools(h,b){return h.stream?Aj.runTools(this._client,h,b):TX.runTools(this._client,h,b)}stream(h,b){return SX.createChatCompletion(this._client,h,b)}};class _Bt extends tl{constructor(){super(...arguments),this.completions=new H9e(this._client)}}(function(o){o.Completions=H9e})(_Bt||(_Bt={}));class z9e extends tl{create(h,b){return this._client.post("/realtime/sessions",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}}class U9e extends tl{create(h,b){return this._client.post("/realtime/transcription_sessions",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}}class bbt extends tl{constructor(){super(...arguments),this.sessions=new z9e(this._client),this.transcriptionSessions=new U9e(this._client)}}bbt.Sessions=z9e;bbt.TranscriptionSessions=U9e;var zo=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},dw=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},Tg,EBt,u6,Amt,z5,GN,Ej,HN,Wmt,yw,Omt,Nmt,fX,aX,oX,cCe,uCe,lCe,hCe,fCe,dCe,pCe;class U5 extends pjt{constructor(){super(...arguments),Tg.add(this),EBt.set(this,[]),u6.set(this,{}),Amt.set(this,{}),z5.set(this,void 0),GN.set(this,void 0),Ej.set(this,void 0),HN.set(this,void 0),Wmt.set(this,void 0),yw.set(this,void 0),Omt.set(this,void 0),Nmt.set(this,void 0),fX.set(this,void 0)}[(EBt=new WeakMap,u6=new WeakMap,Amt=new WeakMap,z5=new WeakMap,GN=new WeakMap,Ej=new WeakMap,HN=new WeakMap,Wmt=new WeakMap,yw=new WeakMap,Omt=new WeakMap,Nmt=new WeakMap,fX=new WeakMap,Tg=new WeakSet,Symbol.asyncIterator)](){const h=[],b=[];let k=!1;return this.on("event",O=>{const P=b.shift();P?P.resolve(O):h.push(O)}),this.on("end",()=>{k=!0;for(const O of b)O.resolve(void 0);b.length=0}),this.on("abort",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),this.on("error",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),{next:async()=>h.length?{value:h.shift(),done:!1}:k?{value:void 0,done:!0}:new Promise((P,B)=>b.push({resolve:P,reject:B})).then(P=>P?{value:P,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(h){const b=new U5;return b._run(()=>b._fromReadableStream(h)),b}async _fromReadableStream(h,b){var P;const k=b==null?void 0:b.signal;k&&(k.aborted&&this.controller.abort(),k.addEventListener("abort",()=>this.controller.abort())),this._connected();const O=f6.fromReadableStream(h,this.controller);for await(const B of O)zo(this,Tg,"m",aX).call(this,B);if((P=O.controller.signal)!=null&&P.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}toReadableStream(){return new f6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(h,b,k,O,P){const B=new U5;return B._run(()=>B._runToolAssistantStream(h,b,k,O,{...P,headers:{...P==null?void 0:P.headers,"X-Stainless-Helper-Method":"stream"}})),B}async _createToolAssistantStream(h,b,k,O,P){var U;const B=P==null?void 0:P.signal;B&&(B.aborted&&this.controller.abort(),B.addEventListener("abort",()=>this.controller.abort()));const G={...O,stream:!0},J=await h.submitToolOutputs(b,k,G,{...P,signal:this.controller.signal});this._connected();for await(const nt of J)zo(this,Tg,"m",aX).call(this,nt);if((U=J.controller.signal)!=null&&U.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}static createThreadAssistantStream(h,b,k){const O=new U5;return O._run(()=>O._threadAssistantStream(h,b,{...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"stream"}})),O}static createAssistantStream(h,b,k,O){const P=new U5;return P._run(()=>P._runAssistantStream(h,b,k,{...O,headers:{...O==null?void 0:O.headers,"X-Stainless-Helper-Method":"stream"}})),P}currentEvent(){return zo(this,Omt,"f")}currentRun(){return zo(this,Nmt,"f")}currentMessageSnapshot(){return zo(this,z5,"f")}currentRunStepSnapshot(){return zo(this,fX,"f")}async finalRunSteps(){return await this.done(),Object.values(zo(this,u6,"f"))}async finalMessages(){return await this.done(),Object.values(zo(this,Amt,"f"))}async finalRun(){if(await this.done(),!zo(this,GN,"f"))throw Error("Final run was not received.");return zo(this,GN,"f")}async _createThreadAssistantStream(h,b,k){var G;const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort()));const P={...b,stream:!0},B=await h.createAndRun(P,{...k,signal:this.controller.signal});this._connected();for await(const J of B)zo(this,Tg,"m",aX).call(this,J);if((G=B.controller.signal)!=null&&G.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}async _createAssistantStream(h,b,k,O){var J;const P=O==null?void 0:O.signal;P&&(P.aborted&&this.controller.abort(),P.addEventListener("abort",()=>this.controller.abort()));const B={...k,stream:!0},G=await h.create(b,B,{...O,signal:this.controller.signal});this._connected();for await(const U of G)zo(this,Tg,"m",aX).call(this,U);if((J=G.controller.signal)!=null&&J.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}static accumulateDelta(h,b){for(const[k,O]of Object.entries(b)){if(!h.hasOwnProperty(k)){h[k]=O;continue}let P=h[k];if(P==null){h[k]=O;continue}if(k==="index"||k==="type"){h[k]=O;continue}if(typeof P=="string"&&typeof O=="string")P+=O;else if(typeof P=="number"&&typeof O=="number")P+=O;else if(sRt(P)&&sRt(O))P=this.accumulateDelta(P,O);else if(Array.isArray(P)&&Array.isArray(O)){if(P.every(B=>typeof B=="string"||typeof B=="number")){P.push(...O);continue}for(const B of O){if(!sRt(B))throw new Error(`Expected array delta entry to be an object but got: ${B}`);const G=B.index;if(G==null)throw console.error(B),new Error("Expected array delta entry to have an `index` property");if(typeof G!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${G}`);const J=P[G];J==null?P.push(B):P[G]=this.accumulateDelta(J,B)}continue}else throw Error(`Unhandled record type: ${k}, deltaValue: ${O}, accValue: ${P}`);h[k]=P}return h}_addRun(h){return h}async _threadAssistantStream(h,b,k){return await this._createThreadAssistantStream(b,h,k)}async _runAssistantStream(h,b,k,O){return await this._createAssistantStream(b,h,k,O)}async _runToolAssistantStream(h,b,k,O,P){return await this._createToolAssistantStream(k,h,b,O,P)}}aX=function(h){if(!this.ended)switch(dw(this,Omt,h,"f"),zo(this,Tg,"m",lCe).call(this,h),h.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":zo(this,Tg,"m",pCe).call(this,h);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":zo(this,Tg,"m",uCe).call(this,h);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":zo(this,Tg,"m",cCe).call(this,h);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},oX=function(){if(this.ended)throw new Cs("stream has ended, this shouldn't happen");if(!zo(this,GN,"f"))throw Error("Final run has not been received");return zo(this,GN,"f")},cCe=function(h){const[b,k]=zo(this,Tg,"m",fCe).call(this,h,zo(this,z5,"f"));dw(this,z5,b,"f"),zo(this,Amt,"f")[b.id]=b;for(const O of k){const P=b.content[O.index];(P==null?void 0:P.type)=="text"&&this._emit("textCreated",P.text)}switch(h.event){case"thread.message.created":this._emit("messageCreated",h.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",h.data.delta,b),h.data.delta.content)for(const O of h.data.delta.content){if(O.type=="text"&&O.text){let P=O.text,B=b.content[O.index];if(B&&B.type=="text")this._emit("textDelta",P,B.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(O.index!=zo(this,Ej,"f")){if(zo(this,HN,"f"))switch(zo(this,HN,"f").type){case"text":this._emit("textDone",zo(this,HN,"f").text,zo(this,z5,"f"));break;case"image_file":this._emit("imageFileDone",zo(this,HN,"f").image_file,zo(this,z5,"f"));break}dw(this,Ej,O.index,"f")}dw(this,HN,b.content[O.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(zo(this,Ej,"f")!==void 0){const O=h.data.content[zo(this,Ej,"f")];if(O)switch(O.type){case"image_file":this._emit("imageFileDone",O.image_file,zo(this,z5,"f"));break;case"text":this._emit("textDone",O.text,zo(this,z5,"f"));break}}zo(this,z5,"f")&&this._emit("messageDone",h.data),dw(this,z5,void 0,"f")}},uCe=function(h){const b=zo(this,Tg,"m",hCe).call(this,h);switch(dw(this,fX,b,"f"),h.event){case"thread.run.step.created":this._emit("runStepCreated",h.data);break;case"thread.run.step.delta":const k=h.data.delta;if(k.step_details&&k.step_details.type=="tool_calls"&&k.step_details.tool_calls&&b.step_details.type=="tool_calls")for(const P of k.step_details.tool_calls)P.index==zo(this,Wmt,"f")?this._emit("toolCallDelta",P,b.step_details.tool_calls[P.index]):(zo(this,yw,"f")&&this._emit("toolCallDone",zo(this,yw,"f")),dw(this,Wmt,P.index,"f"),dw(this,yw,b.step_details.tool_calls[P.index],"f"),zo(this,yw,"f")&&this._emit("toolCallCreated",zo(this,yw,"f")));this._emit("runStepDelta",h.data.delta,b);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":dw(this,fX,void 0,"f"),h.data.step_details.type=="tool_calls"&&zo(this,yw,"f")&&(this._emit("toolCallDone",zo(this,yw,"f")),dw(this,yw,void 0,"f")),this._emit("runStepDone",h.data,b);break}},lCe=function(h){zo(this,EBt,"f").push(h),this._emit("event",h)},hCe=function(h){switch(h.event){case"thread.run.step.created":return zo(this,u6,"f")[h.data.id]=h.data,h.data;case"thread.run.step.delta":let b=zo(this,u6,"f")[h.data.id];if(!b)throw Error("Received a RunStepDelta before creation of a snapshot");let k=h.data;if(k.delta){const O=U5.accumulateDelta(b,k.delta);zo(this,u6,"f")[h.data.id]=O}return zo(this,u6,"f")[h.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":zo(this,u6,"f")[h.data.id]=h.data;break}if(zo(this,u6,"f")[h.data.id])return zo(this,u6,"f")[h.data.id];throw new Error("No snapshot available")},fCe=function(h,b){let k=[];switch(h.event){case"thread.message.created":return[h.data,k];case"thread.message.delta":if(!b)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let O=h.data;if(O.delta.content)for(const P of O.delta.content)if(P.index in b.content){let B=b.content[P.index];b.content[P.index]=zo(this,Tg,"m",dCe).call(this,P,B)}else b.content[P.index]=P,k.push(P);return[b,k];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(b)return[b,k];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},dCe=function(h,b){return U5.accumulateDelta(b,h)},pCe=function(h){switch(dw(this,Nmt,h.data,"f"),h.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":dw(this,GN,h.data,"f"),zo(this,yw,"f")&&(this._emit("toolCallDone",zo(this,yw,"f")),dw(this,yw,void 0,"f"));break}};class bjt extends tl{create(h,b,k){return this._client.post(`/threads/${h}/messages`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}retrieve(h,b,k){return this._client.get(`/threads/${h}/messages/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}update(h,b,k,O){return this._client.post(`/threads/${h}/messages/${b}`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/threads/${h}/messages`,yjt,{query:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}del(h,b,k){return this._client.delete(`/threads/${h}/messages/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}}class yjt extends Y2{}bjt.MessagesPage=yjt;class wjt extends tl{retrieve(h,b,k,O={},P){return $0(O)?this.retrieve(h,b,k,{},O):this._client.get(`/threads/${h}/runs/${b}/steps/${k}`,{query:O,...P,headers:{"OpenAI-Beta":"assistants=v2",...P==null?void 0:P.headers}})}list(h,b,k={},O){return $0(k)?this.list(h,b,{},k):this._client.getAPIList(`/threads/${h}/runs/${b}/steps`,vjt,{query:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}}class vjt extends Y2{}wjt.RunStepsPage=vjt;class RX extends tl{constructor(){super(...arguments),this.steps=new wjt(this._client)}create(h,b,k){const{include:O,...P}=b;return this._client.post(`/threads/${h}/runs`,{query:{include:O},body:P,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers},stream:b.stream??!1})}retrieve(h,b,k){return this._client.get(`/threads/${h}/runs/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}update(h,b,k,O){return this._client.post(`/threads/${h}/runs/${b}`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/threads/${h}/runs`,xjt,{query:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}cancel(h,b,k){return this._client.post(`/threads/${h}/runs/${b}/cancel`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}async createAndPoll(h,b,k){const O=await this.create(h,b,k);return await this.poll(h,O.id,k)}createAndStream(h,b,k){return U5.createAssistantStream(h,this._client.beta.threads.runs,b,k)}async poll(h,b,k){const O={...k==null?void 0:k.headers,"X-Stainless-Poll-Helper":"true"};for(k!=null&&k.pollIntervalMs&&(O["X-Stainless-Custom-Poll-Interval"]=k.pollIntervalMs.toString());;){const{data:P,response:B}=await this.retrieve(h,b,{...k,headers:{...k==null?void 0:k.headers,...O}}).withResponse();switch(P.status){case"queued":case"in_progress":case"cancelling":let G=5e3;if(k!=null&&k.pollIntervalMs)G=k.pollIntervalMs;else{const J=B.headers.get("openai-poll-after-ms");if(J){const U=parseInt(J);isNaN(U)||(G=U)}}await LX(G);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return P}}}stream(h,b,k){return U5.createAssistantStream(h,this._client.beta.threads.runs,b,k)}submitToolOutputs(h,b,k,O){return this._client.post(`/threads/${h}/runs/${b}/submit_tool_outputs`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers},stream:k.stream??!1})}async submitToolOutputsAndPoll(h,b,k,O){const P=await this.submitToolOutputs(h,b,k,O);return await this.poll(h,P.id,O)}submitToolOutputsStream(h,b,k,O){return U5.createToolAssistantStream(h,b,this._client.beta.threads.runs,k,O)}}class xjt extends Y2{}RX.RunsPage=xjt;RX.Steps=wjt;RX.RunStepsPage=vjt;class Wj extends tl{constructor(){super(...arguments),this.runs=new RX(this._client),this.messages=new bjt(this._client)}create(h={},b){return $0(h)?this.create({},h):this._client.post("/threads",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}retrieve(h,b){return this._client.get(`/threads/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}update(h,b,k){return this._client.post(`/threads/${h}`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}del(h,b){return this._client.delete(`/threads/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}createAndRun(h,b){return this._client.post("/threads/runs",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers},stream:h.stream??!1})}async createAndRunPoll(h,b){const k=await this.createAndRun(h,b);return await this.runs.poll(k.thread_id,k.id,b)}createAndRunStream(h,b){return U5.createThreadAssistantStream(h,this._client.beta.threads,b)}}Wj.Runs=RX;Wj.RunsPage=xjt;Wj.Messages=bjt;Wj.MessagesPage=yjt;class Kj extends tl{constructor(){super(...arguments),this.realtime=new bbt(this._client),this.chat=new _Bt(this._client),this.assistants=new fjt(this._client),this.threads=new Wj(this._client)}}Kj.Realtime=bbt;Kj.Assistants=fjt;Kj.AssistantsPage=djt;Kj.Threads=Wj;class G9e extends tl{create(h,b){return this._client.post("/completions",{body:h,...b,stream:h.stream??!1})}}class q9e extends tl{create(h,b){const k=!!h.encoding_format;let O=k?h.encoding_format:"base64";k&&Y8("Request","User defined encoding_format:",h.encoding_format);const P=this._client.post("/embeddings",{body:{...h,encoding_format:O},...b});return k?P:(Y8("response","Decoding base64 embeddings to float32 array"),P._thenUnwrap(B=>(B&&B.data&&B.data.forEach(G=>{const J=G.embedding;G.embedding=nRn(J)}),B)))}}let kjt=class extends tl{create(h,b){return this._client.post("/files",Fj({body:h,...b}))}retrieve(h,b){return this._client.get(`/files/${h}`,b)}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/files",_jt,{query:h,...b})}del(h,b){return this._client.delete(`/files/${h}`,b)}content(h,b){return this._client.get(`/files/${h}/content`,{...b,headers:{Accept:"application/binary",...b==null?void 0:b.headers},__binaryResponse:!0})}retrieveContent(h,b){return this._client.get(`/files/${h}/content`,b)}async waitForProcessing(h,{pollInterval:b=5e3,maxWait:k=30*60*1e3}={}){const O=new Set(["processed","error","deleted"]),P=Date.now();let B=await this.retrieve(h);for(;!B.status||!O.has(B.status);)if(await LX(b),B=await this.retrieve(h),Date.now()-P>k)throw new cjt({message:`Giving up on waiting for file ${h} to finish processing after ${k} milliseconds.`});return B}};class _jt extends Y2{}kjt.FileObjectsPage=_jt;class Ejt extends tl{list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/fine_tuning/jobs/${h}/checkpoints`,Tjt,{query:b,...k})}}class Tjt extends Y2{}Ejt.FineTuningJobCheckpointsPage=Tjt;class Vj extends tl{constructor(){super(...arguments),this.checkpoints=new Ejt(this._client)}create(h,b){return this._client.post("/fine_tuning/jobs",{body:h,...b})}retrieve(h,b){return this._client.get(`/fine_tuning/jobs/${h}`,b)}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/fine_tuning/jobs",Sjt,{query:h,...b})}cancel(h,b){return this._client.post(`/fine_tuning/jobs/${h}/cancel`,b)}listEvents(h,b={},k){return $0(b)?this.listEvents(h,{},b):this._client.getAPIList(`/fine_tuning/jobs/${h}/events`,Ijt,{query:b,...k})}}class Sjt extends Y2{}class Ijt extends Y2{}Vj.FineTuningJobsPage=Sjt;Vj.FineTuningJobEventsPage=Ijt;Vj.Checkpoints=Ejt;Vj.FineTuningJobCheckpointsPage=Tjt;class BX extends tl{constructor(){super(...arguments),this.jobs=new Vj(this._client)}}BX.Jobs=Vj;BX.FineTuningJobsPage=Sjt;BX.FineTuningJobEventsPage=Ijt;class W9e extends tl{createVariation(h,b){return this._client.post("/images/variations",Fj({body:h,...b}))}edit(h,b){return this._client.post("/images/edits",Fj({body:h,...b}))}generate(h,b){return this._client.post("/images/generations",{body:h,...b})}}class Cjt extends tl{retrieve(h,b){return this._client.get(`/models/${h}`,b)}list(h){return this._client.getAPIList("/models",Ajt,h)}del(h,b){return this._client.delete(`/models/${h}`,b)}}class Ajt extends ujt{}Cjt.ModelsPage=Ajt;class K9e extends tl{create(h,b){return this._client.post("/moderations",{body:h,...b})}}function gRn(o,h){return!h||!bRn(h)?{...o,output_parsed:null,output:o.output.map(b=>b.type==="function_call"?{...b,parsed_arguments:null}:b.type==="message"?{...b,content:b.content.map(k=>({...k,parsed:null}))}:b)}:V9e(o,h)}function V9e(o,h){const b=o.output.map(O=>{if(O.type==="function_call")return{...O,parsed_arguments:vRn(h,O)};if(O.type==="message"){const P=O.content.map(B=>B.type==="output_text"?{...B,parsed:mRn(h,B.text)}:B);return{...O,content:P}}return O}),k=Object.assign({},o,{output:b});return Object.getOwnPropertyDescriptor(o,"output_text")||Y9e(k),Object.defineProperty(k,"output_parsed",{enumerable:!0,get(){for(const O of k.output)if(O.type==="message"){for(const P of O.content)if(P.type==="output_text"&&P.parsed!==null)return P.parsed}return null}}),k}function mRn(o,h){var b,k,O,P;return((k=(b=o.text)==null?void 0:b.format)==null?void 0:k.type)!=="json_schema"?null:"$parseRaw"in((O=o.text)==null?void 0:O.format)?((P=o.text)==null?void 0:P.format).$parseRaw(h):JSON.parse(h)}function bRn(o){var h;return!!gjt((h=o.text)==null?void 0:h.format)}function yRn(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function wRn(o,h){return o.find(b=>b.type==="function"&&b.name===h)}function vRn(o,h){const b=wRn(o.tools??[],h.name);return{...h,...h,parsed_arguments:yRn(b)?b.$parseRaw(h.arguments):b!=null&&b.strict?JSON.parse(h.arguments):null}}function Y9e(o){const h=[];for(const b of o.output)if(b.type==="message")for(const k of b.content)k.type==="output_text"&&h.push(k.text);o.output_text=h.join("")}class J9e extends tl{list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/responses/${h}/input_items`,kRn,{query:b,...k})}}var gj=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},$8=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},mj,gmt,H8,mmt,gCe,mCe,bCe,yCe;class Ojt extends pjt{constructor(h){super(),mj.add(this),gmt.set(this,void 0),H8.set(this,void 0),mmt.set(this,void 0),gj(this,gmt,h,"f")}static createResponse(h,b,k){const O=new Ojt(b);return O._run(()=>O._createResponse(h,b,{...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"stream"}})),O}async _createResponse(h,b,k){var B;const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort())),$8(this,mj,"m",gCe).call(this);const P=await h.responses.create({...b,stream:!0},{...k,signal:this.controller.signal});this._connected();for await(const G of P)$8(this,mj,"m",mCe).call(this,G);if((B=P.controller.signal)!=null&&B.aborted)throw new x3;return $8(this,mj,"m",bCe).call(this)}[(gmt=new WeakMap,H8=new WeakMap,mmt=new WeakMap,mj=new WeakSet,gCe=function(){this.ended||gj(this,H8,void 0,"f")},mCe=function(b){if(this.ended)return;const k=$8(this,mj,"m",yCe).call(this,b);switch(this._emit("event",b),b.type){case"response.output_text.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);if(O.type==="message"){const P=O.content[b.content_index];if(!P)throw new Cs(`missing content at index ${b.content_index}`);if(P.type!=="output_text")throw new Cs(`expected content to be 'output_text', got ${P.type}`);this._emit("response.output_text.delta",{...b,snapshot:P.text})}break}case"response.function_call_arguments.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);O.type==="function_call"&&this._emit("response.function_call_arguments.delta",{...b,snapshot:O.arguments});break}default:this._emit(b.type,b);break}},bCe=function(){if(this.ended)throw new Cs("stream has ended, this shouldn't happen");const b=$8(this,H8,"f");if(!b)throw new Cs("request ended without sending any events");gj(this,H8,void 0,"f");const k=xRn(b,$8(this,gmt,"f"));return gj(this,mmt,k,"f"),k},yCe=function(b){let k=$8(this,H8,"f");if(!k){if(b.type!=="response.created")throw new Cs(`When snapshot hasn't been set yet, expected 'response.created' event, got ${b.type}`);return k=gj(this,H8,b.response,"f"),k}switch(b.type){case"response.output_item.added":{k.output.push(b.item);break}case"response.content_part.added":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);O.type==="message"&&O.content.push(b.part);break}case"response.output_text.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);if(O.type==="message"){const P=O.content[b.content_index];if(!P)throw new Cs(`missing content at index ${b.content_index}`);if(P.type!=="output_text")throw new Cs(`expected content to be 'output_text', got ${P.type}`);P.text+=b.delta}break}case"response.function_call_arguments.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);O.type==="function_call"&&(O.arguments+=b.delta);break}case"response.completed":{gj(this,H8,b.response,"f");break}}return k},Symbol.asyncIterator)](){const h=[],b=[];let k=!1;return this.on("event",O=>{const P=b.shift();P?P.resolve(O):h.push(O)}),this.on("end",()=>{k=!0;for(const O of b)O.resolve(void 0);b.length=0}),this.on("abort",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),this.on("error",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),{next:async()=>h.length?{value:h.shift(),done:!1}:k?{value:void 0,done:!0}:new Promise((P,B)=>b.push({resolve:P,reject:B})).then(P=>P?{value:P,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const h=$8(this,mmt,"f");if(!h)throw new Cs("stream ended without producing a ChatCompletion");return h}}function xRn(o,h){return gRn(o,h)}class Njt extends tl{constructor(){super(...arguments),this.inputItems=new J9e(this._client)}create(h,b){return this._client.post("/responses",{body:h,...b,stream:h.stream??!1})._thenUnwrap(k=>("object"in k&&k.object==="response"&&Y9e(k),k))}retrieve(h,b={},k){return $0(b)?this.retrieve(h,{},b):this._client.get(`/responses/${h}`,{query:b,...k})}del(h,b){return this._client.delete(`/responses/${h}`,{...b,headers:{Accept:"*/*",...b==null?void 0:b.headers}})}parse(h,b){return this._client.responses.create(h,b)._thenUnwrap(k=>V9e(k,h))}stream(h,b){return Ojt.createResponse(this._client,h,b)}}class kRn extends Y2{}Njt.InputItems=J9e;class X9e extends tl{create(h,b,k){return this._client.post(`/uploads/${h}/parts`,Fj({body:b,...k}))}}class Pjt extends tl{constructor(){super(...arguments),this.parts=new X9e(this._client)}create(h,b){return this._client.post("/uploads",{body:h,...b})}cancel(h,b){return this._client.post(`/uploads/${h}/cancel`,b)}complete(h,b,k){return this._client.post(`/uploads/${h}/complete`,{body:b,...k})}}Pjt.Parts=X9e;const _Rn=async o=>{const h=await Promise.allSettled(o),b=h.filter(O=>O.status==="rejected");if(b.length){for(const O of b)console.error(O.reason);throw new Error(`${b.length} promise(s) failed - see the above errors`)}const k=[];for(const O of h)O.status==="fulfilled"&&k.push(O.value);return k};class ybt extends tl{create(h,b,k){return this._client.post(`/vector_stores/${h}/files`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}retrieve(h,b,k){return this._client.get(`/vector_stores/${h}/files/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}update(h,b,k,O){return this._client.post(`/vector_stores/${h}/files/${b}`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/vector_stores/${h}/files`,wbt,{query:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}del(h,b,k){return this._client.delete(`/vector_stores/${h}/files/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}async createAndPoll(h,b,k){const O=await this.create(h,b,k);return await this.poll(h,O.id,k)}async poll(h,b,k){const O={...k==null?void 0:k.headers,"X-Stainless-Poll-Helper":"true"};for(k!=null&&k.pollIntervalMs&&(O["X-Stainless-Custom-Poll-Interval"]=k.pollIntervalMs.toString());;){const P=await this.retrieve(h,b,{...k,headers:O}).withResponse(),B=P.data;switch(B.status){case"in_progress":let G=5e3;if(k!=null&&k.pollIntervalMs)G=k.pollIntervalMs;else{const J=P.response.headers.get("openai-poll-after-ms");if(J){const U=parseInt(J);isNaN(U)||(G=U)}}await LX(G);break;case"failed":case"completed":return B}}}async upload(h,b,k){const O=await this._client.files.create({file:b,purpose:"assistants"},k);return this.create(h,{file_id:O.id},k)}async uploadAndPoll(h,b,k){const O=await this.upload(h,b,k);return await this.poll(h,O.id,k)}content(h,b,k){return this._client.getAPIList(`/vector_stores/${h}/files/${b}/content`,Ljt,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}}class wbt extends Y2{}class Ljt extends ujt{}ybt.VectorStoreFilesPage=wbt;ybt.FileContentResponsesPage=Ljt;class Q9e extends tl{create(h,b,k){return this._client.post(`/vector_stores/${h}/file_batches`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}retrieve(h,b,k){return this._client.get(`/vector_stores/${h}/file_batches/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}cancel(h,b,k){return this._client.post(`/vector_stores/${h}/file_batches/${b}/cancel`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}async createAndPoll(h,b,k){const O=await this.create(h,b);return await this.poll(h,O.id,k)}listFiles(h,b,k={},O){return $0(k)?this.listFiles(h,b,{},k):this._client.getAPIList(`/vector_stores/${h}/file_batches/${b}/files`,wbt,{query:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}async poll(h,b,k){const O={...k==null?void 0:k.headers,"X-Stainless-Poll-Helper":"true"};for(k!=null&&k.pollIntervalMs&&(O["X-Stainless-Custom-Poll-Interval"]=k.pollIntervalMs.toString());;){const{data:P,response:B}=await this.retrieve(h,b,{...k,headers:O}).withResponse();switch(P.status){case"in_progress":let G=5e3;if(k!=null&&k.pollIntervalMs)G=k.pollIntervalMs;else{const J=B.headers.get("openai-poll-after-ms");if(J){const U=parseInt(J);isNaN(U)||(G=U)}}await LX(G);break;case"failed":case"cancelled":case"completed":return P}}}async uploadAndPoll(h,{files:b,fileIds:k=[]},O){if(b==null||b.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const P=(O==null?void 0:O.maxConcurrency)??5,B=Math.min(P,b.length),G=this._client,J=b.values(),U=[...k];async function nt(it){for(let st of it){const tt=await G.files.create({file:st,purpose:"assistants"},O);U.push(tt.id)}}const at=Array(B).fill(J).map(nt);return await _Rn(at),await this.createAndPoll(h,{file_ids:U})}}class eC extends tl{constructor(){super(...arguments),this.files=new ybt(this._client),this.fileBatches=new Q9e(this._client)}create(h,b){return this._client.post("/vector_stores",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}retrieve(h,b){return this._client.get(`/vector_stores/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}update(h,b,k){return this._client.post(`/vector_stores/${h}`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/vector_stores",Mjt,{query:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}del(h,b){return this._client.delete(`/vector_stores/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}search(h,b,k){return this._client.getAPIList(`/vector_stores/${h}/search`,Djt,{body:b,method:"post",...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}}class Mjt extends Y2{}class Djt extends ujt{}eC.VectorStoresPage=Mjt;eC.VectorStoreSearchResponsesPage=Djt;eC.Files=ybt;eC.VectorStoreFilesPage=wbt;eC.FileContentResponsesPage=Ljt;eC.FileBatches=Q9e;var Z9e;class ku extends GDn{constructor({baseURL:h=lmt("OPENAI_BASE_URL"),apiKey:b=lmt("OPENAI_API_KEY"),organization:k=lmt("OPENAI_ORG_ID")??null,project:O=lmt("OPENAI_PROJECT_ID")??null,...P}={}){if(b===void 0)throw new Cs("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");const B={apiKey:b,organization:k,project:O,...P,baseURL:h||"https://api.openai.com/v1"};if(!B.dangerouslyAllowBrowser&&tRn())throw new Cs(`It looks like you're running in a browser-like environment.
3208
+ ${pmt(o)}`);return{...Wn,id:Mn,type:ge,function:{...bn,name:ar,arguments:cr}}})}}:{...st,message:{...Dt,content:tt,role:ae,refusal:U.refusal??null},finish_reason:nt,index:at,logprobs:it}}),created:O,model:P,object:"chat.completion",...B?{system_fingerprint:B}:{}};return aRn(J,h)}function pmt(o){return JSON.stringify(o)}class Aj extends SX{static fromReadableStream(h){const b=new Aj(null);return b._run(()=>b._fromReadableStream(h)),b}static runFunctions(h,b,k){const O=new Aj(null),P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runFunctions"}};return O._run(()=>O._runFunctions(h,b,P)),O}static runTools(h,b,k){const O=new Aj(b),P={...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"runTools"}};return O._run(()=>O._runTools(h,b,P)),O}}let H9e=class extends tl{parse(h,b){return uRn(h.tools),this._client.chat.completions.create(h,{...b,headers:{...b==null?void 0:b.headers,"X-Stainless-Helper-Method":"beta.chat.completions.parse"}})._thenUnwrap(k=>mjt(k,h))}runFunctions(h,b){return h.stream?Aj.runFunctions(this._client,h,b):TX.runFunctions(this._client,h,b)}runTools(h,b){return h.stream?Aj.runTools(this._client,h,b):TX.runTools(this._client,h,b)}stream(h,b){return SX.createChatCompletion(this._client,h,b)}};class _Bt extends tl{constructor(){super(...arguments),this.completions=new H9e(this._client)}}(function(o){o.Completions=H9e})(_Bt||(_Bt={}));class z9e extends tl{create(h,b){return this._client.post("/realtime/sessions",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}}class U9e extends tl{create(h,b){return this._client.post("/realtime/transcription_sessions",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}}class bbt extends tl{constructor(){super(...arguments),this.sessions=new z9e(this._client),this.transcriptionSessions=new U9e(this._client)}}bbt.Sessions=z9e;bbt.TranscriptionSessions=U9e;var zo=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},dw=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},Tg,EBt,u6,Amt,z5,GN,Ej,HN,Wmt,yw,Omt,Nmt,fX,aX,oX,cCe,uCe,lCe,hCe,fCe,dCe,pCe;class U5 extends pjt{constructor(){super(...arguments),Tg.add(this),EBt.set(this,[]),u6.set(this,{}),Amt.set(this,{}),z5.set(this,void 0),GN.set(this,void 0),Ej.set(this,void 0),HN.set(this,void 0),Wmt.set(this,void 0),yw.set(this,void 0),Omt.set(this,void 0),Nmt.set(this,void 0),fX.set(this,void 0)}[(EBt=new WeakMap,u6=new WeakMap,Amt=new WeakMap,z5=new WeakMap,GN=new WeakMap,Ej=new WeakMap,HN=new WeakMap,Wmt=new WeakMap,yw=new WeakMap,Omt=new WeakMap,Nmt=new WeakMap,fX=new WeakMap,Tg=new WeakSet,Symbol.asyncIterator)](){const h=[],b=[];let k=!1;return this.on("event",O=>{const P=b.shift();P?P.resolve(O):h.push(O)}),this.on("end",()=>{k=!0;for(const O of b)O.resolve(void 0);b.length=0}),this.on("abort",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),this.on("error",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),{next:async()=>h.length?{value:h.shift(),done:!1}:k?{value:void 0,done:!0}:new Promise((P,B)=>b.push({resolve:P,reject:B})).then(P=>P?{value:P,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(h){const b=new U5;return b._run(()=>b._fromReadableStream(h)),b}async _fromReadableStream(h,b){var P;const k=b==null?void 0:b.signal;k&&(k.aborted&&this.controller.abort(),k.addEventListener("abort",()=>this.controller.abort())),this._connected();const O=f6.fromReadableStream(h,this.controller);for await(const B of O)zo(this,Tg,"m",aX).call(this,B);if((P=O.controller.signal)!=null&&P.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}toReadableStream(){return new f6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(h,b,k,O,P){const B=new U5;return B._run(()=>B._runToolAssistantStream(h,b,k,O,{...P,headers:{...P==null?void 0:P.headers,"X-Stainless-Helper-Method":"stream"}})),B}async _createToolAssistantStream(h,b,k,O,P){var U;const B=P==null?void 0:P.signal;B&&(B.aborted&&this.controller.abort(),B.addEventListener("abort",()=>this.controller.abort()));const G={...O,stream:!0},J=await h.submitToolOutputs(b,k,G,{...P,signal:this.controller.signal});this._connected();for await(const nt of J)zo(this,Tg,"m",aX).call(this,nt);if((U=J.controller.signal)!=null&&U.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}static createThreadAssistantStream(h,b,k){const O=new U5;return O._run(()=>O._threadAssistantStream(h,b,{...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"stream"}})),O}static createAssistantStream(h,b,k,O){const P=new U5;return P._run(()=>P._runAssistantStream(h,b,k,{...O,headers:{...O==null?void 0:O.headers,"X-Stainless-Helper-Method":"stream"}})),P}currentEvent(){return zo(this,Omt,"f")}currentRun(){return zo(this,Nmt,"f")}currentMessageSnapshot(){return zo(this,z5,"f")}currentRunStepSnapshot(){return zo(this,fX,"f")}async finalRunSteps(){return await this.done(),Object.values(zo(this,u6,"f"))}async finalMessages(){return await this.done(),Object.values(zo(this,Amt,"f"))}async finalRun(){if(await this.done(),!zo(this,GN,"f"))throw Error("Final run was not received.");return zo(this,GN,"f")}async _createThreadAssistantStream(h,b,k){var G;const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort()));const P={...b,stream:!0},B=await h.createAndRun(P,{...k,signal:this.controller.signal});this._connected();for await(const J of B)zo(this,Tg,"m",aX).call(this,J);if((G=B.controller.signal)!=null&&G.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}async _createAssistantStream(h,b,k,O){var J;const P=O==null?void 0:O.signal;P&&(P.aborted&&this.controller.abort(),P.addEventListener("abort",()=>this.controller.abort()));const B={...k,stream:!0},G=await h.create(b,B,{...O,signal:this.controller.signal});this._connected();for await(const U of G)zo(this,Tg,"m",aX).call(this,U);if((J=G.controller.signal)!=null&&J.aborted)throw new x3;return this._addRun(zo(this,Tg,"m",oX).call(this))}static accumulateDelta(h,b){for(const[k,O]of Object.entries(b)){if(!h.hasOwnProperty(k)){h[k]=O;continue}let P=h[k];if(P==null){h[k]=O;continue}if(k==="index"||k==="type"){h[k]=O;continue}if(typeof P=="string"&&typeof O=="string")P+=O;else if(typeof P=="number"&&typeof O=="number")P+=O;else if(sRt(P)&&sRt(O))P=this.accumulateDelta(P,O);else if(Array.isArray(P)&&Array.isArray(O)){if(P.every(B=>typeof B=="string"||typeof B=="number")){P.push(...O);continue}for(const B of O){if(!sRt(B))throw new Error(`Expected array delta entry to be an object but got: ${B}`);const G=B.index;if(G==null)throw console.error(B),new Error("Expected array delta entry to have an `index` property");if(typeof G!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${G}`);const J=P[G];J==null?P.push(B):P[G]=this.accumulateDelta(J,B)}continue}else throw Error(`Unhandled record type: ${k}, deltaValue: ${O}, accValue: ${P}`);h[k]=P}return h}_addRun(h){return h}async _threadAssistantStream(h,b,k){return await this._createThreadAssistantStream(b,h,k)}async _runAssistantStream(h,b,k,O){return await this._createAssistantStream(b,h,k,O)}async _runToolAssistantStream(h,b,k,O,P){return await this._createToolAssistantStream(k,h,b,O,P)}}aX=function(h){if(!this.ended)switch(dw(this,Omt,h,"f"),zo(this,Tg,"m",lCe).call(this,h),h.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":zo(this,Tg,"m",pCe).call(this,h);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":zo(this,Tg,"m",uCe).call(this,h);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":zo(this,Tg,"m",cCe).call(this,h);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},oX=function(){if(this.ended)throw new Cs("stream has ended, this shouldn't happen");if(!zo(this,GN,"f"))throw Error("Final run has not been received");return zo(this,GN,"f")},cCe=function(h){const[b,k]=zo(this,Tg,"m",fCe).call(this,h,zo(this,z5,"f"));dw(this,z5,b,"f"),zo(this,Amt,"f")[b.id]=b;for(const O of k){const P=b.content[O.index];(P==null?void 0:P.type)=="text"&&this._emit("textCreated",P.text)}switch(h.event){case"thread.message.created":this._emit("messageCreated",h.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",h.data.delta,b),h.data.delta.content)for(const O of h.data.delta.content){if(O.type=="text"&&O.text){let P=O.text,B=b.content[O.index];if(B&&B.type=="text")this._emit("textDelta",P,B.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(O.index!=zo(this,Ej,"f")){if(zo(this,HN,"f"))switch(zo(this,HN,"f").type){case"text":this._emit("textDone",zo(this,HN,"f").text,zo(this,z5,"f"));break;case"image_file":this._emit("imageFileDone",zo(this,HN,"f").image_file,zo(this,z5,"f"));break}dw(this,Ej,O.index,"f")}dw(this,HN,b.content[O.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(zo(this,Ej,"f")!==void 0){const O=h.data.content[zo(this,Ej,"f")];if(O)switch(O.type){case"image_file":this._emit("imageFileDone",O.image_file,zo(this,z5,"f"));break;case"text":this._emit("textDone",O.text,zo(this,z5,"f"));break}}zo(this,z5,"f")&&this._emit("messageDone",h.data),dw(this,z5,void 0,"f")}},uCe=function(h){const b=zo(this,Tg,"m",hCe).call(this,h);switch(dw(this,fX,b,"f"),h.event){case"thread.run.step.created":this._emit("runStepCreated",h.data);break;case"thread.run.step.delta":const k=h.data.delta;if(k.step_details&&k.step_details.type=="tool_calls"&&k.step_details.tool_calls&&b.step_details.type=="tool_calls")for(const P of k.step_details.tool_calls)P.index==zo(this,Wmt,"f")?this._emit("toolCallDelta",P,b.step_details.tool_calls[P.index]):(zo(this,yw,"f")&&this._emit("toolCallDone",zo(this,yw,"f")),dw(this,Wmt,P.index,"f"),dw(this,yw,b.step_details.tool_calls[P.index],"f"),zo(this,yw,"f")&&this._emit("toolCallCreated",zo(this,yw,"f")));this._emit("runStepDelta",h.data.delta,b);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":dw(this,fX,void 0,"f"),h.data.step_details.type=="tool_calls"&&zo(this,yw,"f")&&(this._emit("toolCallDone",zo(this,yw,"f")),dw(this,yw,void 0,"f")),this._emit("runStepDone",h.data,b);break}},lCe=function(h){zo(this,EBt,"f").push(h),this._emit("event",h)},hCe=function(h){switch(h.event){case"thread.run.step.created":return zo(this,u6,"f")[h.data.id]=h.data,h.data;case"thread.run.step.delta":let b=zo(this,u6,"f")[h.data.id];if(!b)throw Error("Received a RunStepDelta before creation of a snapshot");let k=h.data;if(k.delta){const O=U5.accumulateDelta(b,k.delta);zo(this,u6,"f")[h.data.id]=O}return zo(this,u6,"f")[h.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":zo(this,u6,"f")[h.data.id]=h.data;break}if(zo(this,u6,"f")[h.data.id])return zo(this,u6,"f")[h.data.id];throw new Error("No snapshot available")},fCe=function(h,b){let k=[];switch(h.event){case"thread.message.created":return[h.data,k];case"thread.message.delta":if(!b)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let O=h.data;if(O.delta.content)for(const P of O.delta.content)if(P.index in b.content){let B=b.content[P.index];b.content[P.index]=zo(this,Tg,"m",dCe).call(this,P,B)}else b.content[P.index]=P,k.push(P);return[b,k];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(b)return[b,k];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},dCe=function(h,b){return U5.accumulateDelta(b,h)},pCe=function(h){switch(dw(this,Nmt,h.data,"f"),h.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":dw(this,GN,h.data,"f"),zo(this,yw,"f")&&(this._emit("toolCallDone",zo(this,yw,"f")),dw(this,yw,void 0,"f"));break}};class bjt extends tl{create(h,b,k){return this._client.post(`/threads/${h}/messages`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}retrieve(h,b,k){return this._client.get(`/threads/${h}/messages/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}update(h,b,k,O){return this._client.post(`/threads/${h}/messages/${b}`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/threads/${h}/messages`,yjt,{query:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}del(h,b,k){return this._client.delete(`/threads/${h}/messages/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}}class yjt extends Y2{}bjt.MessagesPage=yjt;class wjt extends tl{retrieve(h,b,k,O={},P){return $0(O)?this.retrieve(h,b,k,{},O):this._client.get(`/threads/${h}/runs/${b}/steps/${k}`,{query:O,...P,headers:{"OpenAI-Beta":"assistants=v2",...P==null?void 0:P.headers}})}list(h,b,k={},O){return $0(k)?this.list(h,b,{},k):this._client.getAPIList(`/threads/${h}/runs/${b}/steps`,vjt,{query:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}}class vjt extends Y2{}wjt.RunStepsPage=vjt;class RX extends tl{constructor(){super(...arguments),this.steps=new wjt(this._client)}create(h,b,k){const{include:O,...P}=b;return this._client.post(`/threads/${h}/runs`,{query:{include:O},body:P,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers},stream:b.stream??!1})}retrieve(h,b,k){return this._client.get(`/threads/${h}/runs/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}update(h,b,k,O){return this._client.post(`/threads/${h}/runs/${b}`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/threads/${h}/runs`,xjt,{query:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}cancel(h,b,k){return this._client.post(`/threads/${h}/runs/${b}/cancel`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}async createAndPoll(h,b,k){const O=await this.create(h,b,k);return await this.poll(h,O.id,k)}createAndStream(h,b,k){return U5.createAssistantStream(h,this._client.beta.threads.runs,b,k)}async poll(h,b,k){const O={...k==null?void 0:k.headers,"X-Stainless-Poll-Helper":"true"};for(k!=null&&k.pollIntervalMs&&(O["X-Stainless-Custom-Poll-Interval"]=k.pollIntervalMs.toString());;){const{data:P,response:B}=await this.retrieve(h,b,{...k,headers:{...k==null?void 0:k.headers,...O}}).withResponse();switch(P.status){case"queued":case"in_progress":case"cancelling":let G=5e3;if(k!=null&&k.pollIntervalMs)G=k.pollIntervalMs;else{const J=B.headers.get("openai-poll-after-ms");if(J){const U=parseInt(J);isNaN(U)||(G=U)}}await LX(G);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return P}}}stream(h,b,k){return U5.createAssistantStream(h,this._client.beta.threads.runs,b,k)}submitToolOutputs(h,b,k,O){return this._client.post(`/threads/${h}/runs/${b}/submit_tool_outputs`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers},stream:k.stream??!1})}async submitToolOutputsAndPoll(h,b,k,O){const P=await this.submitToolOutputs(h,b,k,O);return await this.poll(h,P.id,O)}submitToolOutputsStream(h,b,k,O){return U5.createToolAssistantStream(h,b,this._client.beta.threads.runs,k,O)}}class xjt extends Y2{}RX.RunsPage=xjt;RX.Steps=wjt;RX.RunStepsPage=vjt;class Wj extends tl{constructor(){super(...arguments),this.runs=new RX(this._client),this.messages=new bjt(this._client)}create(h={},b){return $0(h)?this.create({},h):this._client.post("/threads",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}retrieve(h,b){return this._client.get(`/threads/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}update(h,b,k){return this._client.post(`/threads/${h}`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}del(h,b){return this._client.delete(`/threads/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}createAndRun(h,b){return this._client.post("/threads/runs",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers},stream:h.stream??!1})}async createAndRunPoll(h,b){const k=await this.createAndRun(h,b);return await this.runs.poll(k.thread_id,k.id,b)}createAndRunStream(h,b){return U5.createThreadAssistantStream(h,this._client.beta.threads,b)}}Wj.Runs=RX;Wj.RunsPage=xjt;Wj.Messages=bjt;Wj.MessagesPage=yjt;class Kj extends tl{constructor(){super(...arguments),this.realtime=new bbt(this._client),this.chat=new _Bt(this._client),this.assistants=new fjt(this._client),this.threads=new Wj(this._client)}}Kj.Realtime=bbt;Kj.Assistants=fjt;Kj.AssistantsPage=djt;Kj.Threads=Wj;class G9e extends tl{create(h,b){return this._client.post("/completions",{body:h,...b,stream:h.stream??!1})}}class q9e extends tl{create(h,b){const k=!!h.encoding_format;let O=k?h.encoding_format:"base64";k&&Y8("Request","User defined encoding_format:",h.encoding_format);const P=this._client.post("/embeddings",{body:{...h,encoding_format:O},...b});return k?P:(Y8("response","Decoding base64 embeddings to float32 array"),P._thenUnwrap(B=>(B&&B.data&&B.data.forEach(G=>{const J=G.embedding;G.embedding=rRn(J)}),B)))}}let kjt=class extends tl{create(h,b){return this._client.post("/files",Fj({body:h,...b}))}retrieve(h,b){return this._client.get(`/files/${h}`,b)}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/files",_jt,{query:h,...b})}del(h,b){return this._client.delete(`/files/${h}`,b)}content(h,b){return this._client.get(`/files/${h}/content`,{...b,headers:{Accept:"application/binary",...b==null?void 0:b.headers},__binaryResponse:!0})}retrieveContent(h,b){return this._client.get(`/files/${h}/content`,b)}async waitForProcessing(h,{pollInterval:b=5e3,maxWait:k=30*60*1e3}={}){const O=new Set(["processed","error","deleted"]),P=Date.now();let B=await this.retrieve(h);for(;!B.status||!O.has(B.status);)if(await LX(b),B=await this.retrieve(h),Date.now()-P>k)throw new cjt({message:`Giving up on waiting for file ${h} to finish processing after ${k} milliseconds.`});return B}};class _jt extends Y2{}kjt.FileObjectsPage=_jt;class Ejt extends tl{list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/fine_tuning/jobs/${h}/checkpoints`,Tjt,{query:b,...k})}}class Tjt extends Y2{}Ejt.FineTuningJobCheckpointsPage=Tjt;class Vj extends tl{constructor(){super(...arguments),this.checkpoints=new Ejt(this._client)}create(h,b){return this._client.post("/fine_tuning/jobs",{body:h,...b})}retrieve(h,b){return this._client.get(`/fine_tuning/jobs/${h}`,b)}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/fine_tuning/jobs",Sjt,{query:h,...b})}cancel(h,b){return this._client.post(`/fine_tuning/jobs/${h}/cancel`,b)}listEvents(h,b={},k){return $0(b)?this.listEvents(h,{},b):this._client.getAPIList(`/fine_tuning/jobs/${h}/events`,Ijt,{query:b,...k})}}class Sjt extends Y2{}class Ijt extends Y2{}Vj.FineTuningJobsPage=Sjt;Vj.FineTuningJobEventsPage=Ijt;Vj.Checkpoints=Ejt;Vj.FineTuningJobCheckpointsPage=Tjt;class BX extends tl{constructor(){super(...arguments),this.jobs=new Vj(this._client)}}BX.Jobs=Vj;BX.FineTuningJobsPage=Sjt;BX.FineTuningJobEventsPage=Ijt;class W9e extends tl{createVariation(h,b){return this._client.post("/images/variations",Fj({body:h,...b}))}edit(h,b){return this._client.post("/images/edits",Fj({body:h,...b}))}generate(h,b){return this._client.post("/images/generations",{body:h,...b})}}class Cjt extends tl{retrieve(h,b){return this._client.get(`/models/${h}`,b)}list(h){return this._client.getAPIList("/models",Ajt,h)}del(h,b){return this._client.delete(`/models/${h}`,b)}}class Ajt extends ujt{}Cjt.ModelsPage=Ajt;class K9e extends tl{create(h,b){return this._client.post("/moderations",{body:h,...b})}}function mRn(o,h){return!h||!yRn(h)?{...o,output_parsed:null,output:o.output.map(b=>b.type==="function_call"?{...b,parsed_arguments:null}:b.type==="message"?{...b,content:b.content.map(k=>({...k,parsed:null}))}:b)}:V9e(o,h)}function V9e(o,h){const b=o.output.map(O=>{if(O.type==="function_call")return{...O,parsed_arguments:xRn(h,O)};if(O.type==="message"){const P=O.content.map(B=>B.type==="output_text"?{...B,parsed:bRn(h,B.text)}:B);return{...O,content:P}}return O}),k=Object.assign({},o,{output:b});return Object.getOwnPropertyDescriptor(o,"output_text")||Y9e(k),Object.defineProperty(k,"output_parsed",{enumerable:!0,get(){for(const O of k.output)if(O.type==="message"){for(const P of O.content)if(P.type==="output_text"&&P.parsed!==null)return P.parsed}return null}}),k}function bRn(o,h){var b,k,O,P;return((k=(b=o.text)==null?void 0:b.format)==null?void 0:k.type)!=="json_schema"?null:"$parseRaw"in((O=o.text)==null?void 0:O.format)?((P=o.text)==null?void 0:P.format).$parseRaw(h):JSON.parse(h)}function yRn(o){var h;return!!gjt((h=o.text)==null?void 0:h.format)}function wRn(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function vRn(o,h){return o.find(b=>b.type==="function"&&b.name===h)}function xRn(o,h){const b=vRn(o.tools??[],h.name);return{...h,...h,parsed_arguments:wRn(b)?b.$parseRaw(h.arguments):b!=null&&b.strict?JSON.parse(h.arguments):null}}function Y9e(o){const h=[];for(const b of o.output)if(b.type==="message")for(const k of b.content)k.type==="output_text"&&h.push(k.text);o.output_text=h.join("")}class J9e extends tl{list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/responses/${h}/input_items`,_Rn,{query:b,...k})}}var gj=function(o,h,b,k,O){if(k==="m")throw new TypeError("Private method is not writable");if(k==="a"&&!O)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?o!==h||!O:!h.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return k==="a"?O.call(o,b):O?O.value=b:h.set(o,b),b},$8=function(o,h,b,k){if(b==="a"&&!k)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?o!==h||!k:!h.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?k:b==="a"?k.call(o):k?k.value:h.get(o)},mj,gmt,H8,mmt,gCe,mCe,bCe,yCe;class Ojt extends pjt{constructor(h){super(),mj.add(this),gmt.set(this,void 0),H8.set(this,void 0),mmt.set(this,void 0),gj(this,gmt,h,"f")}static createResponse(h,b,k){const O=new Ojt(b);return O._run(()=>O._createResponse(h,b,{...k,headers:{...k==null?void 0:k.headers,"X-Stainless-Helper-Method":"stream"}})),O}async _createResponse(h,b,k){var B;const O=k==null?void 0:k.signal;O&&(O.aborted&&this.controller.abort(),O.addEventListener("abort",()=>this.controller.abort())),$8(this,mj,"m",gCe).call(this);const P=await h.responses.create({...b,stream:!0},{...k,signal:this.controller.signal});this._connected();for await(const G of P)$8(this,mj,"m",mCe).call(this,G);if((B=P.controller.signal)!=null&&B.aborted)throw new x3;return $8(this,mj,"m",bCe).call(this)}[(gmt=new WeakMap,H8=new WeakMap,mmt=new WeakMap,mj=new WeakSet,gCe=function(){this.ended||gj(this,H8,void 0,"f")},mCe=function(b){if(this.ended)return;const k=$8(this,mj,"m",yCe).call(this,b);switch(this._emit("event",b),b.type){case"response.output_text.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);if(O.type==="message"){const P=O.content[b.content_index];if(!P)throw new Cs(`missing content at index ${b.content_index}`);if(P.type!=="output_text")throw new Cs(`expected content to be 'output_text', got ${P.type}`);this._emit("response.output_text.delta",{...b,snapshot:P.text})}break}case"response.function_call_arguments.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);O.type==="function_call"&&this._emit("response.function_call_arguments.delta",{...b,snapshot:O.arguments});break}default:this._emit(b.type,b);break}},bCe=function(){if(this.ended)throw new Cs("stream has ended, this shouldn't happen");const b=$8(this,H8,"f");if(!b)throw new Cs("request ended without sending any events");gj(this,H8,void 0,"f");const k=kRn(b,$8(this,gmt,"f"));return gj(this,mmt,k,"f"),k},yCe=function(b){let k=$8(this,H8,"f");if(!k){if(b.type!=="response.created")throw new Cs(`When snapshot hasn't been set yet, expected 'response.created' event, got ${b.type}`);return k=gj(this,H8,b.response,"f"),k}switch(b.type){case"response.output_item.added":{k.output.push(b.item);break}case"response.content_part.added":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);O.type==="message"&&O.content.push(b.part);break}case"response.output_text.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);if(O.type==="message"){const P=O.content[b.content_index];if(!P)throw new Cs(`missing content at index ${b.content_index}`);if(P.type!=="output_text")throw new Cs(`expected content to be 'output_text', got ${P.type}`);P.text+=b.delta}break}case"response.function_call_arguments.delta":{const O=k.output[b.output_index];if(!O)throw new Cs(`missing output at index ${b.output_index}`);O.type==="function_call"&&(O.arguments+=b.delta);break}case"response.completed":{gj(this,H8,b.response,"f");break}}return k},Symbol.asyncIterator)](){const h=[],b=[];let k=!1;return this.on("event",O=>{const P=b.shift();P?P.resolve(O):h.push(O)}),this.on("end",()=>{k=!0;for(const O of b)O.resolve(void 0);b.length=0}),this.on("abort",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),this.on("error",O=>{k=!0;for(const P of b)P.reject(O);b.length=0}),{next:async()=>h.length?{value:h.shift(),done:!1}:k?{value:void 0,done:!0}:new Promise((P,B)=>b.push({resolve:P,reject:B})).then(P=>P?{value:P,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const h=$8(this,mmt,"f");if(!h)throw new Cs("stream ended without producing a ChatCompletion");return h}}function kRn(o,h){return mRn(o,h)}class Njt extends tl{constructor(){super(...arguments),this.inputItems=new J9e(this._client)}create(h,b){return this._client.post("/responses",{body:h,...b,stream:h.stream??!1})._thenUnwrap(k=>("object"in k&&k.object==="response"&&Y9e(k),k))}retrieve(h,b={},k){return $0(b)?this.retrieve(h,{},b):this._client.get(`/responses/${h}`,{query:b,...k})}del(h,b){return this._client.delete(`/responses/${h}`,{...b,headers:{Accept:"*/*",...b==null?void 0:b.headers}})}parse(h,b){return this._client.responses.create(h,b)._thenUnwrap(k=>V9e(k,h))}stream(h,b){return Ojt.createResponse(this._client,h,b)}}class _Rn extends Y2{}Njt.InputItems=J9e;class X9e extends tl{create(h,b,k){return this._client.post(`/uploads/${h}/parts`,Fj({body:b,...k}))}}class Pjt extends tl{constructor(){super(...arguments),this.parts=new X9e(this._client)}create(h,b){return this._client.post("/uploads",{body:h,...b})}cancel(h,b){return this._client.post(`/uploads/${h}/cancel`,b)}complete(h,b,k){return this._client.post(`/uploads/${h}/complete`,{body:b,...k})}}Pjt.Parts=X9e;const ERn=async o=>{const h=await Promise.allSettled(o),b=h.filter(O=>O.status==="rejected");if(b.length){for(const O of b)console.error(O.reason);throw new Error(`${b.length} promise(s) failed - see the above errors`)}const k=[];for(const O of h)O.status==="fulfilled"&&k.push(O.value);return k};class ybt extends tl{create(h,b,k){return this._client.post(`/vector_stores/${h}/files`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}retrieve(h,b,k){return this._client.get(`/vector_stores/${h}/files/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}update(h,b,k,O){return this._client.post(`/vector_stores/${h}/files/${b}`,{body:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}list(h,b={},k){return $0(b)?this.list(h,{},b):this._client.getAPIList(`/vector_stores/${h}/files`,wbt,{query:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}del(h,b,k){return this._client.delete(`/vector_stores/${h}/files/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}async createAndPoll(h,b,k){const O=await this.create(h,b,k);return await this.poll(h,O.id,k)}async poll(h,b,k){const O={...k==null?void 0:k.headers,"X-Stainless-Poll-Helper":"true"};for(k!=null&&k.pollIntervalMs&&(O["X-Stainless-Custom-Poll-Interval"]=k.pollIntervalMs.toString());;){const P=await this.retrieve(h,b,{...k,headers:O}).withResponse(),B=P.data;switch(B.status){case"in_progress":let G=5e3;if(k!=null&&k.pollIntervalMs)G=k.pollIntervalMs;else{const J=P.response.headers.get("openai-poll-after-ms");if(J){const U=parseInt(J);isNaN(U)||(G=U)}}await LX(G);break;case"failed":case"completed":return B}}}async upload(h,b,k){const O=await this._client.files.create({file:b,purpose:"assistants"},k);return this.create(h,{file_id:O.id},k)}async uploadAndPoll(h,b,k){const O=await this.upload(h,b,k);return await this.poll(h,O.id,k)}content(h,b,k){return this._client.getAPIList(`/vector_stores/${h}/files/${b}/content`,Ljt,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}}class wbt extends Y2{}class Ljt extends ujt{}ybt.VectorStoreFilesPage=wbt;ybt.FileContentResponsesPage=Ljt;class Q9e extends tl{create(h,b,k){return this._client.post(`/vector_stores/${h}/file_batches`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}retrieve(h,b,k){return this._client.get(`/vector_stores/${h}/file_batches/${b}`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}cancel(h,b,k){return this._client.post(`/vector_stores/${h}/file_batches/${b}/cancel`,{...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}async createAndPoll(h,b,k){const O=await this.create(h,b);return await this.poll(h,O.id,k)}listFiles(h,b,k={},O){return $0(k)?this.listFiles(h,b,{},k):this._client.getAPIList(`/vector_stores/${h}/file_batches/${b}/files`,wbt,{query:k,...O,headers:{"OpenAI-Beta":"assistants=v2",...O==null?void 0:O.headers}})}async poll(h,b,k){const O={...k==null?void 0:k.headers,"X-Stainless-Poll-Helper":"true"};for(k!=null&&k.pollIntervalMs&&(O["X-Stainless-Custom-Poll-Interval"]=k.pollIntervalMs.toString());;){const{data:P,response:B}=await this.retrieve(h,b,{...k,headers:O}).withResponse();switch(P.status){case"in_progress":let G=5e3;if(k!=null&&k.pollIntervalMs)G=k.pollIntervalMs;else{const J=B.headers.get("openai-poll-after-ms");if(J){const U=parseInt(J);isNaN(U)||(G=U)}}await LX(G);break;case"failed":case"cancelled":case"completed":return P}}}async uploadAndPoll(h,{files:b,fileIds:k=[]},O){if(b==null||b.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const P=(O==null?void 0:O.maxConcurrency)??5,B=Math.min(P,b.length),G=this._client,J=b.values(),U=[...k];async function nt(it){for(let st of it){const tt=await G.files.create({file:st,purpose:"assistants"},O);U.push(tt.id)}}const at=Array(B).fill(J).map(nt);return await ERn(at),await this.createAndPoll(h,{file_ids:U})}}class eC extends tl{constructor(){super(...arguments),this.files=new ybt(this._client),this.fileBatches=new Q9e(this._client)}create(h,b){return this._client.post("/vector_stores",{body:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}retrieve(h,b){return this._client.get(`/vector_stores/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}update(h,b,k){return this._client.post(`/vector_stores/${h}`,{body:b,...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}list(h={},b){return $0(h)?this.list({},h):this._client.getAPIList("/vector_stores",Mjt,{query:h,...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}del(h,b){return this._client.delete(`/vector_stores/${h}`,{...b,headers:{"OpenAI-Beta":"assistants=v2",...b==null?void 0:b.headers}})}search(h,b,k){return this._client.getAPIList(`/vector_stores/${h}/search`,Djt,{body:b,method:"post",...k,headers:{"OpenAI-Beta":"assistants=v2",...k==null?void 0:k.headers}})}}class Mjt extends Y2{}class Djt extends ujt{}eC.VectorStoresPage=Mjt;eC.VectorStoreSearchResponsesPage=Djt;eC.Files=ybt;eC.VectorStoreFilesPage=wbt;eC.FileContentResponsesPage=Ljt;eC.FileBatches=Q9e;var Z9e;class ku extends qDn{constructor({baseURL:h=lmt("OPENAI_BASE_URL"),apiKey:b=lmt("OPENAI_API_KEY"),organization:k=lmt("OPENAI_ORG_ID")??null,project:O=lmt("OPENAI_PROJECT_ID")??null,...P}={}){if(b===void 0)throw new Cs("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");const B={apiKey:b,organization:k,project:O,...P,baseURL:h||"https://api.openai.com/v1"};if(!B.dangerouslyAllowBrowser&&eRn())throw new Cs(`It looks like you're running in a browser-like environment.
3209
3209
 
3210
3210
  This is disabled by default, as it risks exposing your secret API credentials to attackers.
3211
3211
  If you understand the risks and have appropriate mitigations in place,
@@ -3214,22 +3214,22 @@ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
3214
3214
  new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
3215
3215
 
3216
3216
  https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
3217
- `);super({baseURL:B.baseURL,timeout:B.timeout??6e5,httpAgent:B.httpAgent,maxRetries:B.maxRetries,fetch:B.fetch}),this.completions=new G9e(this),this.chat=new mbt(this),this.embeddings=new q9e(this),this.files=new kjt(this),this.images=new W9e(this),this.audio=new MX(this),this.moderations=new K9e(this),this.models=new Cjt(this),this.fineTuning=new BX(this),this.vectorStores=new eC(this),this.beta=new Kj(this),this.batches=new ljt(this),this.uploads=new Pjt(this),this.responses=new Njt(this),this._options=B,this.apiKey=b,this.organization=k,this.project=O}defaultQuery(){return this._options.defaultQuery}defaultHeaders(h){return{...super.defaultHeaders(h),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project,...this._options.defaultHeaders}}authHeaders(h){return{Authorization:`Bearer ${this.apiKey}`}}stringifyQuery(h){return SDn(h,{arrayFormat:"brackets"})}}Z9e=ku;ku.OpenAI=Z9e;ku.DEFAULT_TIMEOUT=6e5;ku.OpenAIError=Cs;ku.APIError=Ig;ku.APIConnectionError=lbt;ku.APIConnectionTimeoutError=cjt;ku.APIUserAbortError=x3;ku.NotFoundError=e9e;ku.ConflictError=n9e;ku.RateLimitError=i9e;ku.BadRequestError=Q7e;ku.AuthenticationError=Z7e;ku.InternalServerError=a9e;ku.PermissionDeniedError=t9e;ku.UnprocessableEntityError=r9e;ku.toFile=h9e;ku.fileFromPath=Y7e;ku.Completions=G9e;ku.Chat=mbt;ku.ChatCompletionsPage=gbt;ku.Embeddings=q9e;ku.Files=kjt;ku.FileObjectsPage=_jt;ku.Images=W9e;ku.Audio=MX;ku.Moderations=K9e;ku.Models=Cjt;ku.ModelsPage=Ajt;ku.FineTuning=BX;ku.VectorStores=eC;ku.VectorStoresPage=Mjt;ku.VectorStoreSearchResponsesPage=Djt;ku.Beta=Kj;ku.Batches=ljt;ku.BatchesPage=hjt;ku.Uploads=Pjt;ku.Responses=Njt;const wCe=K5(pe.jsx("path",{d:"M3 4V1h2v3h3v2H5v3H3V6H0V4zm3 6V7h3V4h7l1.83 2H21c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V10zm7 9c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5m-3.2-5c0 1.77 1.43 3.2 3.2 3.2s3.2-1.43 3.2-3.2-1.43-3.2-3.2-3.2-3.2 1.43-3.2 3.2"}),"AddAPhoto"),ERn=K5([pe.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),pe.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong"),TRn=K5(pe.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send");function SRn(o,h){if(o.match(/^[a-z]+:\/\//i))return o;if(o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i))return o;const b=document.implementation.createHTMLDocument(),k=b.createElement("base"),O=b.createElement("a");return b.head.appendChild(k),b.body.appendChild(O),h&&(k.href=h),O.href=o,O.href}const IRn=(()=>{let o=0;const h=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(o+=1,`u${h()}${o}`)})();function J8(o){const h=[];for(let b=0,k=o.length;b<k;b++)h.push(o[b]);return h}let bj=null;function tOe(o={}){return bj||(o.includeStyleProperties?(bj=o.includeStyleProperties,bj):(bj=J8(window.getComputedStyle(document.documentElement)),bj))}function Kmt(o,h){const k=(o.ownerDocument.defaultView||window).getComputedStyle(o).getPropertyValue(h);return k?parseFloat(k.replace("px","")):0}function CRn(o){const h=Kmt(o,"border-left-width"),b=Kmt(o,"border-right-width");return o.clientWidth+h+b}function ARn(o){const h=Kmt(o,"border-top-width"),b=Kmt(o,"border-bottom-width");return o.clientHeight+h+b}function eOe(o,h={}){const b=h.width||CRn(o),k=h.height||ARn(o);return{width:b,height:k}}function ORn(){let o,h;try{h=process}catch{}const b=h&&h.env?h.env.devicePixelRatio:null;return b&&(o=parseInt(b,10),Number.isNaN(o)&&(o=1)),o||window.devicePixelRatio||1}const pw=16384;function NRn(o){(o.width>pw||o.height>pw)&&(o.width>pw&&o.height>pw?o.width>o.height?(o.height*=pw/o.width,o.width=pw):(o.width*=pw/o.height,o.height=pw):o.width>pw?(o.height*=pw/o.width,o.width=pw):(o.width*=pw/o.height,o.height=pw))}function Vmt(o){return new Promise((h,b)=>{const k=new Image;k.onload=()=>{k.decode().then(()=>{requestAnimationFrame(()=>h(k))})},k.onerror=b,k.crossOrigin="anonymous",k.decoding="async",k.src=o})}async function PRn(o){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(o)).then(encodeURIComponent).then(h=>`data:image/svg+xml;charset=utf-8,${h}`)}async function LRn(o,h,b){const k="http://www.w3.org/2000/svg",O=document.createElementNS(k,"svg"),P=document.createElementNS(k,"foreignObject");return O.setAttribute("width",`${h}`),O.setAttribute("height",`${b}`),O.setAttribute("viewBox",`0 0 ${h} ${b}`),P.setAttribute("width","100%"),P.setAttribute("height","100%"),P.setAttribute("x","0"),P.setAttribute("y","0"),P.setAttribute("externalResourcesRequired","true"),O.appendChild(P),P.appendChild(o),PRn(O)}const W2=(o,h)=>{if(o instanceof h)return!0;const b=Object.getPrototypeOf(o);return b===null?!1:b.constructor.name===h.name||W2(b,h)};function MRn(o){const h=o.getPropertyValue("content");return`${o.cssText} content: '${h.replace(/'|"/g,"")}';`}function DRn(o,h){return tOe(h).map(b=>{const k=o.getPropertyValue(b),O=o.getPropertyPriority(b);return`${b}: ${k}${O?" !important":""};`}).join(" ")}function RRn(o,h,b,k){const O=`.${o}:${h}`,P=b.cssText?MRn(b):DRn(b,k);return document.createTextNode(`${O}{${P}}`)}function vCe(o,h,b,k){const O=window.getComputedStyle(o,b),P=O.getPropertyValue("content");if(P===""||P==="none")return;const B=IRn();try{h.className=`${h.className} ${B}`}catch{return}const G=document.createElement("style");G.appendChild(RRn(B,b,O,k)),h.appendChild(G)}function BRn(o,h,b){vCe(o,h,":before",b),vCe(o,h,":after",b)}const xCe="application/font-woff",kCe="image/jpeg",jRn={woff:xCe,woff2:xCe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:kCe,jpeg:kCe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function FRn(o){const h=/\.([^./]*?)$/g.exec(o);return h?h[1]:""}function Rjt(o){const h=FRn(o).toLowerCase();return jRn[h]||""}function $Rn(o){return o.split(/,/)[1]}function TBt(o){return o.search(/^(data:)/)!==-1}function HRn(o,h){return`data:${h};base64,${o}`}async function nOe(o,h,b){const k=await fetch(o,h);if(k.status===404)throw new Error(`Resource "${k.url}" not found`);const O=await k.blob();return new Promise((P,B)=>{const G=new FileReader;G.onerror=B,G.onloadend=()=>{try{P(b({res:k,result:G.result}))}catch(J){B(J)}},G.readAsDataURL(O)})}const dRt={};function zRn(o,h,b){let k=o.replace(/\?.*/,"");return b&&(k=o),/ttf|otf|eot|woff2?/i.test(k)&&(k=k.replace(/.*\//,"")),h?`[${h}]${k}`:k}async function Bjt(o,h,b){const k=zRn(o,h,b.includeQueryParams);if(dRt[k]!=null)return dRt[k];b.cacheBust&&(o+=(/\?/.test(o)?"&":"?")+new Date().getTime());let O;try{const P=await nOe(o,b.fetchRequestInit,({res:B,result:G})=>(h||(h=B.headers.get("Content-Type")||""),$Rn(G)));O=HRn(P,h)}catch(P){O=b.imagePlaceholder||"";let B=`Failed to fetch resource: ${o}`;P&&(B=typeof P=="string"?P:P.message),B&&console.warn(B)}return dRt[k]=O,O}async function URn(o){const h=o.toDataURL();return h==="data:,"?o.cloneNode(!1):Vmt(h)}async function GRn(o,h){if(o.currentSrc){const P=document.createElement("canvas"),B=P.getContext("2d");P.width=o.clientWidth,P.height=o.clientHeight,B==null||B.drawImage(o,0,0,P.width,P.height);const G=P.toDataURL();return Vmt(G)}const b=o.poster,k=Rjt(b),O=await Bjt(b,k,h);return Vmt(O)}async function qRn(o,h){var b;try{if(!((b=o==null?void 0:o.contentDocument)===null||b===void 0)&&b.body)return await vbt(o.contentDocument.body,h,!0)}catch{}return o.cloneNode(!1)}async function WRn(o,h){return W2(o,HTMLCanvasElement)?URn(o):W2(o,HTMLVideoElement)?GRn(o,h):W2(o,HTMLIFrameElement)?qRn(o,h):o.cloneNode(rOe(o))}const KRn=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SLOT",rOe=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SVG";async function VRn(o,h,b){var k,O;if(rOe(h))return h;let P=[];return KRn(o)&&o.assignedNodes?P=J8(o.assignedNodes()):W2(o,HTMLIFrameElement)&&(!((k=o.contentDocument)===null||k===void 0)&&k.body)?P=J8(o.contentDocument.body.childNodes):P=J8(((O=o.shadowRoot)!==null&&O!==void 0?O:o).childNodes),P.length===0||W2(o,HTMLVideoElement)||await P.reduce((B,G)=>B.then(()=>vbt(G,b)).then(J=>{J&&h.appendChild(J)}),Promise.resolve()),h}function YRn(o,h,b){const k=h.style;if(!k)return;const O=window.getComputedStyle(o);O.cssText?(k.cssText=O.cssText,k.transformOrigin=O.transformOrigin):tOe(b).forEach(P=>{let B=O.getPropertyValue(P);P==="font-size"&&B.endsWith("px")&&(B=`${Math.floor(parseFloat(B.substring(0,B.length-2)))-.1}px`),W2(o,HTMLIFrameElement)&&P==="display"&&B==="inline"&&(B="block"),P==="d"&&h.getAttribute("d")&&(B=`path(${h.getAttribute("d")})`),k.setProperty(P,B,O.getPropertyPriority(P))})}function JRn(o,h){W2(o,HTMLTextAreaElement)&&(h.innerHTML=o.value),W2(o,HTMLInputElement)&&h.setAttribute("value",o.value)}function XRn(o,h){if(W2(o,HTMLSelectElement)){const b=h,k=Array.from(b.children).find(O=>o.value===O.getAttribute("value"));k&&k.setAttribute("selected","")}}function QRn(o,h,b){return W2(h,Element)&&(YRn(o,h,b),BRn(o,h,b),JRn(o,h),XRn(o,h)),h}async function ZRn(o,h){const b=o.querySelectorAll?o.querySelectorAll("use"):[];if(b.length===0)return o;const k={};for(let P=0;P<b.length;P++){const G=b[P].getAttribute("xlink:href");if(G){const J=o.querySelector(G),U=document.querySelector(G);!J&&U&&!k[G]&&(k[G]=await vbt(U,h,!0))}}const O=Object.values(k);if(O.length){const P="http://www.w3.org/1999/xhtml",B=document.createElementNS(P,"svg");B.setAttribute("xmlns",P),B.style.position="absolute",B.style.width="0",B.style.height="0",B.style.overflow="hidden",B.style.display="none";const G=document.createElementNS(P,"defs");B.appendChild(G);for(let J=0;J<O.length;J++)G.appendChild(O[J]);o.appendChild(B)}return o}async function vbt(o,h,b){return!b&&h.filter&&!h.filter(o)?null:Promise.resolve(o).then(k=>WRn(k,h)).then(k=>VRn(o,k,h)).then(k=>QRn(o,k,h)).then(k=>ZRn(k,h))}const iOe=/url\((['"]?)([^'"]+?)\1\)/g,tBn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,eBn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function nBn(o){const h=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${h})(['"]?\\))`,"g")}function rBn(o){const h=[];return o.replace(iOe,(b,k,O)=>(h.push(O),b)),h.filter(b=>!TBt(b))}async function iBn(o,h,b,k,O){try{const P=b?SRn(h,b):h,B=Rjt(h);let G;return O||(G=await Bjt(P,B,k)),o.replace(nBn(h),`$1${G}$3`)}catch{}return o}function aBn(o,{preferredFontFormat:h}){return h?o.replace(eBn,b=>{for(;;){const[k,,O]=tBn.exec(b)||[];if(!O)return"";if(O===h)return`src: ${k};`}}):o}function aOe(o){return o.search(iOe)!==-1}async function oOe(o,h,b){if(!aOe(o))return o;const k=aBn(o,b);return rBn(k).reduce((P,B)=>P.then(G=>iBn(G,B,h,b)),Promise.resolve(k))}async function yj(o,h,b){var k;const O=(k=h.style)===null||k===void 0?void 0:k.getPropertyValue(o);if(O){const P=await oOe(O,null,b);return h.style.setProperty(o,P,h.style.getPropertyPriority(o)),!0}return!1}async function oBn(o,h){await yj("background",o,h)||await yj("background-image",o,h),await yj("mask",o,h)||await yj("-webkit-mask",o,h)||await yj("mask-image",o,h)||await yj("-webkit-mask-image",o,h)}async function sBn(o,h){const b=W2(o,HTMLImageElement);if(!(b&&!TBt(o.src))&&!(W2(o,SVGImageElement)&&!TBt(o.href.baseVal)))return;const k=b?o.src:o.href.baseVal,O=await Bjt(k,Rjt(k),h);await new Promise((P,B)=>{o.onload=P,o.onerror=h.onImageErrorHandler?(...J)=>{try{P(h.onImageErrorHandler(...J))}catch(U){B(U)}}:B;const G=o;G.decode&&(G.decode=P),G.loading==="lazy"&&(G.loading="eager"),b?(o.srcset="",o.src=O):o.href.baseVal=O})}async function cBn(o,h){const k=J8(o.childNodes).map(O=>sOe(O,h));await Promise.all(k).then(()=>o)}async function sOe(o,h){W2(o,Element)&&(await oBn(o,h),await sBn(o,h),await cBn(o,h))}function uBn(o,h){const{style:b}=o;h.backgroundColor&&(b.backgroundColor=h.backgroundColor),h.width&&(b.width=`${h.width}px`),h.height&&(b.height=`${h.height}px`);const k=h.style;return k!=null&&Object.keys(k).forEach(O=>{b[O]=k[O]}),o}const _Ce={};async function ECe(o){let h=_Ce[o];if(h!=null)return h;const k=await(await fetch(o)).text();return h={url:o,cssText:k},_Ce[o]=h,h}async function TCe(o,h){let b=o.cssText;const k=/url\(["']?([^"')]+)["']?\)/g,P=(b.match(/url\([^)]+\)/g)||[]).map(async B=>{let G=B.replace(k,"$1");return G.startsWith("https://")||(G=new URL(G,o.url).href),nOe(G,h.fetchRequestInit,({result:J})=>(b=b.replace(B,`url(${J})`),[B,J]))});return Promise.all(P).then(()=>b)}function SCe(o){if(o==null)return[];const h=[],b=/(\/\*[\s\S]*?\*\/)/gi;let k=o.replace(b,"");const O=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const J=O.exec(k);if(J===null)break;h.push(J[0])}k=k.replace(O,"");const P=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,B="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",G=new RegExp(B,"gi");for(;;){let J=P.exec(k);if(J===null){if(J=G.exec(k),J===null)break;P.lastIndex=G.lastIndex}else G.lastIndex=P.lastIndex;h.push(J[0])}return h}async function lBn(o,h){const b=[],k=[];return o.forEach(O=>{if("cssRules"in O)try{J8(O.cssRules||[]).forEach((P,B)=>{if(P.type===CSSRule.IMPORT_RULE){let G=B+1;const J=P.href,U=ECe(J).then(nt=>TCe(nt,h)).then(nt=>SCe(nt).forEach(at=>{try{O.insertRule(at,at.startsWith("@import")?G+=1:O.cssRules.length)}catch(it){console.error("Error inserting rule from remote css",{rule:at,error:it})}})).catch(nt=>{console.error("Error loading remote css",nt.toString())});k.push(U)}})}catch(P){const B=o.find(G=>G.href==null)||document.styleSheets[0];O.href!=null&&k.push(ECe(O.href).then(G=>TCe(G,h)).then(G=>SCe(G).forEach(J=>{B.insertRule(J,B.cssRules.length)})).catch(G=>{console.error("Error loading remote stylesheet",G)})),console.error("Error inlining remote css file",P)}}),Promise.all(k).then(()=>(o.forEach(O=>{if("cssRules"in O)try{J8(O.cssRules||[]).forEach(P=>{b.push(P)})}catch(P){console.error(`Error while reading CSS rules from ${O.href}`,P)}}),b))}function hBn(o){return o.filter(h=>h.type===CSSRule.FONT_FACE_RULE).filter(h=>aOe(h.style.getPropertyValue("src")))}async function fBn(o,h){if(o.ownerDocument==null)throw new Error("Provided element is not within a Document");const b=J8(o.ownerDocument.styleSheets),k=await lBn(b,h);return hBn(k)}function cOe(o){return o.trim().replace(/["']/g,"")}function dBn(o){const h=new Set;function b(k){(k.style.fontFamily||getComputedStyle(k).fontFamily).split(",").forEach(P=>{h.add(cOe(P))}),Array.from(k.children).forEach(P=>{P instanceof HTMLElement&&b(P)})}return b(o),h}async function pBn(o,h){const b=await fBn(o,h),k=dBn(o);return(await Promise.all(b.filter(P=>k.has(cOe(P.style.fontFamily))).map(P=>{const B=P.parentStyleSheet?P.parentStyleSheet.href:null;return oOe(P.cssText,B,h)}))).join(`
3218
- `)}async function gBn(o,h){const b=h.fontEmbedCSS!=null?h.fontEmbedCSS:h.skipFonts?null:await pBn(o,h);if(b){const k=document.createElement("style"),O=document.createTextNode(b);k.appendChild(O),o.firstChild?o.insertBefore(k,o.firstChild):o.appendChild(k)}}async function mBn(o,h={}){const{width:b,height:k}=eOe(o,h),O=await vbt(o,h,!0);return await gBn(O,h),await sOe(O,h),uBn(O,h),await LRn(O,b,k)}async function bBn(o,h={}){const{width:b,height:k}=eOe(o,h),O=await mBn(o,h),P=await Vmt(O),B=document.createElement("canvas"),G=B.getContext("2d"),J=h.pixelRatio||ORn(),U=h.canvasWidth||b,nt=h.canvasHeight||k;return B.width=U*J,B.height=nt*J,h.skipAutoScale||NRn(B),B.style.width=`${U}`,B.style.height=`${nt}`,h.backgroundColor&&(G.fillStyle=h.backgroundColor,G.fillRect(0,0,B.width,B.height)),G.drawImage(P,0,0,B.width,B.height),B}async function yBn(o,h={}){return(await bBn(o,h)).toDataURL()}const uOe=K5(pe.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");function ICe(o){const h=[],b=String(o||"");let k=b.indexOf(","),O=0,P=!1;for(;!P;){k===-1&&(k=b.length,P=!0);const B=b.slice(O,k).trim();(B||!P)&&h.push(B),O=k+1,k=b.indexOf(",",O)}return h}function jjt(o,h){const b=h||{};return(o[o.length-1]===""?[...o,""]:o).join((b.padRight?" ":"")+","+(b.padLeft===!1?"":" ")).trim()}const wBn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vBn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xBn={};function CCe(o,h){return(xBn.jsx?vBn:wBn).test(o)}const kBn=/[ \t\n\f\r]/g;function xbt(o){return typeof o=="object"?o.type==="text"?ACe(o.value):!1:ACe(o)}function ACe(o){return o.replace(kBn,"")===""}let jX=class{constructor(h,b,k){this.normal=b,this.property=h,k&&(this.space=k)}};jX.prototype.normal={};jX.prototype.property={};jX.prototype.space=void 0;function lOe(o,h){const b={},k={};for(const O of o)Object.assign(b,O.property),Object.assign(k,O.normal);return new jX(b,k,h)}function IX(o){return o.toLowerCase()}let J2=class{constructor(h,b){this.attribute=b,this.property=h}};J2.prototype.attribute="";J2.prototype.booleanish=!1;J2.prototype.boolean=!1;J2.prototype.commaOrSpaceSeparated=!1;J2.prototype.commaSeparated=!1;J2.prototype.defined=!1;J2.prototype.mustUseProperty=!1;J2.prototype.number=!1;J2.prototype.overloadedBoolean=!1;J2.prototype.property="";J2.prototype.spaceSeparated=!1;J2.prototype.space=void 0;let _Bn=0;const Mc=rP(),ap=rP(),hOe=rP(),ua=rP(),nf=rP(),Oj=rP(),mw=rP();function rP(){return 2**++_Bn}const SBt=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mc,booleanish:ap,commaOrSpaceSeparated:mw,commaSeparated:Oj,number:ua,overloadedBoolean:hOe,spaceSeparated:nf},Symbol.toStringTag,{value:"Module"})),pRt=Object.keys(SBt);let Fjt=class extends J2{constructor(h,b,k,O){let P=-1;if(super(h,b),OCe(this,"space",O),typeof k=="number")for(;++P<pRt.length;){const B=pRt[P];OCe(this,pRt[P],(k&SBt[B])===SBt[B])}}};Fjt.prototype.defined=!0;function OCe(o,h,b){b&&(o[h]=b)}function Yj(o){const h={},b={};for(const[k,O]of Object.entries(o.properties)){const P=new Fjt(k,o.transform(o.attributes||{},k),O,o.space);o.mustUseProperty&&o.mustUseProperty.includes(k)&&(P.mustUseProperty=!0),h[k]=P,b[IX(k)]=k,b[IX(P.attribute)]=k}return new jX(h,b,o.space)}const fOe=Yj({properties:{ariaActiveDescendant:null,ariaAtomic:ap,ariaAutoComplete:null,ariaBusy:ap,ariaChecked:ap,ariaColCount:ua,ariaColIndex:ua,ariaColSpan:ua,ariaControls:nf,ariaCurrent:null,ariaDescribedBy:nf,ariaDetails:null,ariaDisabled:ap,ariaDropEffect:nf,ariaErrorMessage:null,ariaExpanded:ap,ariaFlowTo:nf,ariaGrabbed:ap,ariaHasPopup:null,ariaHidden:ap,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nf,ariaLevel:ua,ariaLive:null,ariaModal:ap,ariaMultiLine:ap,ariaMultiSelectable:ap,ariaOrientation:null,ariaOwns:nf,ariaPlaceholder:null,ariaPosInSet:ua,ariaPressed:ap,ariaReadOnly:ap,ariaRelevant:null,ariaRequired:ap,ariaRoleDescription:nf,ariaRowCount:ua,ariaRowIndex:ua,ariaRowSpan:ua,ariaSelected:ap,ariaSetSize:ua,ariaSort:null,ariaValueMax:ua,ariaValueMin:ua,ariaValueNow:ua,ariaValueText:null,role:null},transform(o,h){return h==="role"?h:"aria-"+h.slice(4).toLowerCase()}});function dOe(o,h){return h in o?o[h]:h}function pOe(o,h){return dOe(o,h.toLowerCase())}const EBn=Yj({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oj,acceptCharset:nf,accessKey:nf,action:null,allow:null,allowFullScreen:Mc,allowPaymentRequest:Mc,allowUserMedia:Mc,alt:null,as:null,async:Mc,autoCapitalize:null,autoComplete:nf,autoFocus:Mc,autoPlay:Mc,blocking:nf,capture:null,charSet:null,checked:Mc,cite:null,className:nf,cols:ua,colSpan:null,content:null,contentEditable:ap,controls:Mc,controlsList:nf,coords:ua|Oj,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mc,defer:Mc,dir:null,dirName:null,disabled:Mc,download:hOe,draggable:ap,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mc,formTarget:null,headers:nf,height:ua,hidden:Mc,high:ua,href:null,hrefLang:null,htmlFor:nf,httpEquiv:nf,id:null,imageSizes:null,imageSrcSet:null,inert:Mc,inputMode:null,integrity:null,is:null,isMap:Mc,itemId:null,itemProp:nf,itemRef:nf,itemScope:Mc,itemType:nf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mc,low:ua,manifest:null,max:null,maxLength:ua,media:null,method:null,min:null,minLength:ua,multiple:Mc,muted:Mc,name:null,nonce:null,noModule:Mc,noValidate:Mc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Mc,optimum:ua,pattern:null,ping:nf,placeholder:null,playsInline:Mc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mc,referrerPolicy:null,rel:nf,required:Mc,reversed:Mc,rows:ua,rowSpan:ua,sandbox:nf,scope:null,scoped:Mc,seamless:Mc,selected:Mc,shadowRootClonable:Mc,shadowRootDelegatesFocus:Mc,shadowRootMode:null,shape:null,size:ua,sizes:null,slot:null,span:ua,spellCheck:ap,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ua,step:null,style:null,tabIndex:ua,target:null,title:null,translate:null,type:null,typeMustMatch:Mc,useMap:null,value:ap,width:ua,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nf,axis:null,background:null,bgColor:null,border:ua,borderColor:null,bottomMargin:ua,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mc,declare:Mc,event:null,face:null,frame:null,frameBorder:null,hSpace:ua,leftMargin:ua,link:null,longDesc:null,lowSrc:null,marginHeight:ua,marginWidth:ua,noResize:Mc,noHref:Mc,noShade:Mc,noWrap:Mc,object:null,profile:null,prompt:null,rev:null,rightMargin:ua,rules:null,scheme:null,scrolling:ap,standby:null,summary:null,text:null,topMargin:ua,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ua,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mc,disableRemotePlayback:Mc,prefix:null,property:null,results:ua,security:null,unselectable:null},space:"html",transform:pOe}),TBn=Yj({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mw,accentHeight:ua,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ua,amplitude:ua,arabicForm:null,ascent:ua,attributeName:null,attributeType:null,azimuth:ua,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ua,by:null,calcMode:null,capHeight:ua,className:nf,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ua,diffuseConstant:ua,direction:null,display:null,dur:null,divisor:ua,dominantBaseline:null,download:Mc,dx:null,dy:null,edgeMode:null,editable:null,elevation:ua,enableBackground:null,end:null,event:null,exponent:ua,externalResourcesRequired:null,fill:null,fillOpacity:ua,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Oj,g2:Oj,glyphName:Oj,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ua,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ua,horizOriginX:ua,horizOriginY:ua,id:null,ideographic:ua,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ua,k:ua,k1:ua,k2:ua,k3:ua,k4:ua,kernelMatrix:mw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ua,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ua,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ua,overlineThickness:ua,paintOrder:null,panose1:null,path:null,pathLength:ua,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ua,pointsAtY:ua,pointsAtZ:ua,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mw,rev:mw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mw,requiredFeatures:mw,requiredFonts:mw,requiredFormats:mw,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ua,specularExponent:ua,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ua,strikethroughThickness:ua,string:null,stroke:null,strokeDashArray:mw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ua,strokeOpacity:ua,strokeWidth:null,style:null,surfaceScale:ua,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mw,tabIndex:ua,tableValues:null,target:null,targetX:ua,targetY:ua,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ua,underlineThickness:ua,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ua,values:null,vAlphabetic:ua,vMathematical:ua,vectorEffect:null,vHanging:ua,vIdeographic:ua,version:null,vertAdvY:ua,vertOriginX:ua,vertOriginY:ua,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ua,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dOe}),gOe=Yj({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(o,h){return"xlink:"+h.slice(5).toLowerCase()}}),mOe=Yj({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pOe}),bOe=Yj({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(o,h){return"xml:"+h.slice(3).toLowerCase()}}),SBn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},IBn=/[A-Z]/g,NCe=/-[a-z]/g,CBn=/^data[-\w.:]+$/i;function kbt(o,h){const b=IX(h);let k=h,O=J2;if(b in o.normal)return o.property[o.normal[b]];if(b.length>4&&b.slice(0,4)==="data"&&CBn.test(h)){if(h.charAt(4)==="-"){const P=h.slice(5).replace(NCe,OBn);k="data"+P.charAt(0).toUpperCase()+P.slice(1)}else{const P=h.slice(4);if(!NCe.test(P)){let B=P.replace(IBn,ABn);B.charAt(0)!=="-"&&(B="-"+B),h="data"+B}}O=Fjt}return new O(k,h)}function ABn(o){return"-"+o.toLowerCase()}function OBn(o){return o.charAt(1).toUpperCase()}const FX=lOe([fOe,EBn,gOe,mOe,bOe],"html"),nC=lOe([fOe,TBn,gOe,mOe,bOe],"svg");function PCe(o){const h=String(o||"").trim();return h?h.split(/[ \t\n\r\f]+/g):[]}function $jt(o){return o.join(" ").trim()}var Hjt={},LCe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NBn=/\n/g,PBn=/^\s*/,LBn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,MBn=/^:\s*/,DBn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,RBn=/^[;\s]*/,BBn=/^\s+|\s+$/g,jBn=`
3219
- `,MCe="/",DCe="*",zN="",FBn="comment",$Bn="declaration",HBn=function(o,h){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];h=h||{};var b=1,k=1;function O(tt){var Et=tt.match(NBn);Et&&(b+=Et.length);var Lt=tt.lastIndexOf(jBn);k=~Lt?tt.length-Lt:k+tt.length}function P(){var tt={line:b,column:k};return function(Et){return Et.position=new B(tt),U(),Et}}function B(tt){this.start=tt,this.end={line:b,column:k},this.source=h.source}B.prototype.content=o;function G(tt){var Et=new Error(h.source+":"+b+":"+k+": "+tt);if(Et.reason=tt,Et.filename=h.source,Et.line=b,Et.column=k,Et.source=o,!h.silent)throw Et}function J(tt){var Et=tt.exec(o);if(Et){var Lt=Et[0];return O(Lt),o=o.slice(Lt.length),Et}}function U(){J(PBn)}function nt(tt){var Et;for(tt=tt||[];Et=at();)Et!==!1&&tt.push(Et);return tt}function at(){var tt=P();if(!(MCe!=o.charAt(0)||DCe!=o.charAt(1))){for(var Et=2;zN!=o.charAt(Et)&&(DCe!=o.charAt(Et)||MCe!=o.charAt(Et+1));)++Et;if(Et+=2,zN===o.charAt(Et-1))return G("End of comment missing");var Lt=o.slice(2,Et-2);return k+=2,O(Lt),o=o.slice(Et),k+=2,tt({type:FBn,comment:Lt})}}function it(){var tt=P(),Et=J(LBn);if(Et){if(at(),!J(MBn))return G("property missing ':'");var Lt=J(DBn),Dt=tt({type:$Bn,property:RCe(Et[0].replace(LCe,zN)),value:Lt?RCe(Lt[0].replace(LCe,zN)):zN});return J(RBn),Dt}}function st(){var tt=[];nt(tt);for(var Et;Et=it();)Et!==!1&&(tt.push(Et),nt(tt));return tt}return U(),st()};function RCe(o){return o?o.replace(BBn,zN):zN}var zBn=ww&&ww.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Hjt,"__esModule",{value:!0});Hjt.default=GBn;var UBn=zBn(HBn);function GBn(o,h){var b=null;if(!o||typeof o!="string")return b;var k=(0,UBn.default)(o),O=typeof h=="function";return k.forEach(function(P){if(P.type==="declaration"){var B=P.property,G=P.value;O?h(B,G,P):G&&(b=b||{},b[B]=G)}}),b}var _bt={};Object.defineProperty(_bt,"__esModule",{value:!0});_bt.camelCase=void 0;var qBn=/^--[a-zA-Z0-9_-]+$/,WBn=/-([a-z])/g,KBn=/^[^-]+$/,VBn=/^-(webkit|moz|ms|o|khtml)-/,YBn=/^-(ms)-/,JBn=function(o){return!o||KBn.test(o)||qBn.test(o)},XBn=function(o,h){return h.toUpperCase()},BCe=function(o,h){return"".concat(h,"-")},QBn=function(o,h){return h===void 0&&(h={}),JBn(o)?o:(o=o.toLowerCase(),h.reactCompat?o=o.replace(YBn,BCe):o=o.replace(VBn,BCe),o.replace(WBn,XBn))};_bt.camelCase=QBn;var ZBn=ww&&ww.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},tjn=ZBn(Hjt),ejn=_bt;function IBt(o,h){var b={};return!o||typeof o!="string"||(0,tjn.default)(o,function(k,O){k&&O&&(b[(0,ejn.camelCase)(k,h)]=O)}),b}IBt.default=IBt;var njn=IBt;const rjn=e7e(njn),Ebt=yOe("end"),b6=yOe("start");function yOe(o){return h;function h(b){const k=b&&b.position&&b.position[o]||{};if(typeof k.line=="number"&&k.line>0&&typeof k.column=="number"&&k.column>0)return{line:k.line,column:k.column,offset:typeof k.offset=="number"&&k.offset>-1?k.offset:void 0}}}function ijn(o){const h=b6(o),b=Ebt(o);if(h&&b)return{start:h,end:b}}function dX(o){return!o||typeof o!="object"?"":"position"in o||"type"in o?jCe(o.position):"start"in o||"end"in o?jCe(o):"line"in o||"column"in o?CBt(o):""}function CBt(o){return FCe(o&&o.line)+":"+FCe(o&&o.column)}function jCe(o){return CBt(o&&o.start)+"-"+CBt(o&&o.end)}function FCe(o){return o&&typeof o=="number"?o:1}class wm extends Error{constructor(h,b,k){super(),typeof b=="string"&&(k=b,b=void 0);let O="",P={},B=!1;if(b&&("line"in b&&"column"in b?P={place:b}:"start"in b&&"end"in b?P={place:b}:"type"in b?P={ancestors:[b],place:b.position}:P={...b}),typeof h=="string"?O=h:!P.cause&&h&&(B=!0,O=h.message,P.cause=h),!P.ruleId&&!P.source&&typeof k=="string"){const J=k.indexOf(":");J===-1?P.ruleId=k:(P.source=k.slice(0,J),P.ruleId=k.slice(J+1))}if(!P.place&&P.ancestors&&P.ancestors){const J=P.ancestors[P.ancestors.length-1];J&&(P.place=J.position)}const G=P.place&&"start"in P.place?P.place.start:P.place;this.ancestors=P.ancestors||void 0,this.cause=P.cause||void 0,this.column=G?G.column:void 0,this.fatal=void 0,this.file,this.message=O,this.line=G?G.line:void 0,this.name=dX(P.place)||"1:1",this.place=P.place||void 0,this.reason=this.message,this.ruleId=P.ruleId||void 0,this.source=P.source||void 0,this.stack=B&&P.cause&&typeof P.cause.stack=="string"?P.cause.stack:"",this.actual,this.expected,this.note,this.url}}wm.prototype.file="";wm.prototype.name="";wm.prototype.reason="";wm.prototype.message="";wm.prototype.stack="";wm.prototype.column=void 0;wm.prototype.line=void 0;wm.prototype.ancestors=void 0;wm.prototype.cause=void 0;wm.prototype.fatal=void 0;wm.prototype.place=void 0;wm.prototype.ruleId=void 0;wm.prototype.source=void 0;const zjt={}.hasOwnProperty,ajn=new Map,ojn=/[A-Z]/g,sjn=new Set(["table","tbody","thead","tfoot","tr"]),cjn=new Set(["td","th"]),wOe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ujn(o,h){if(!h||h.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const b=h.filePath||void 0;let k;if(h.development){if(typeof h.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");k=bjn(b,h.jsxDEV)}else{if(typeof h.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof h.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");k=mjn(b,h.jsx,h.jsxs)}const O={Fragment:h.Fragment,ancestors:[],components:h.components||{},create:k,elementAttributeNameCase:h.elementAttributeNameCase||"react",evaluater:h.createEvaluater?h.createEvaluater():void 0,filePath:b,ignoreInvalidStyle:h.ignoreInvalidStyle||!1,passKeys:h.passKeys!==!1,passNode:h.passNode||!1,schema:h.space==="svg"?nC:FX,stylePropertyNameCase:h.stylePropertyNameCase||"dom",tableCellAlignToStyle:h.tableCellAlignToStyle!==!1},P=vOe(O,o,void 0);return P&&typeof P!="string"?P:O.create(o,O.Fragment,{children:P||void 0},void 0)}function vOe(o,h,b){if(h.type==="element")return ljn(o,h,b);if(h.type==="mdxFlowExpression"||h.type==="mdxTextExpression")return hjn(o,h);if(h.type==="mdxJsxFlowElement"||h.type==="mdxJsxTextElement")return djn(o,h,b);if(h.type==="mdxjsEsm")return fjn(o,h);if(h.type==="root")return pjn(o,h,b);if(h.type==="text")return gjn(o,h)}function ljn(o,h,b){const k=o.schema;let O=k;h.tagName.toLowerCase()==="svg"&&k.space==="html"&&(O=nC,o.schema=O),o.ancestors.push(h);const P=kOe(o,h.tagName,!1),B=yjn(o,h);let G=Gjt(o,h);return sjn.has(h.tagName)&&(G=G.filter(function(J){return typeof J=="string"?!xbt(J):!0})),xOe(o,B,P,h),Ujt(B,G),o.ancestors.pop(),o.schema=k,o.create(h,P,B,b)}function hjn(o,h){if(h.data&&h.data.estree&&o.evaluater){const k=h.data.estree.body[0];return k.type,o.evaluater.evaluateExpression(k.expression)}CX(o,h.position)}function fjn(o,h){if(h.data&&h.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(h.data.estree);CX(o,h.position)}function djn(o,h,b){const k=o.schema;let O=k;h.name==="svg"&&k.space==="html"&&(O=nC,o.schema=O),o.ancestors.push(h);const P=h.name===null?o.Fragment:kOe(o,h.name,!0),B=wjn(o,h),G=Gjt(o,h);return xOe(o,B,P,h),Ujt(B,G),o.ancestors.pop(),o.schema=k,o.create(h,P,B,b)}function pjn(o,h,b){const k={};return Ujt(k,Gjt(o,h)),o.create(h,o.Fragment,k,b)}function gjn(o,h){return h.value}function xOe(o,h,b,k){typeof b!="string"&&b!==o.Fragment&&o.passNode&&(h.node=k)}function Ujt(o,h){if(h.length>0){const b=h.length>1?h:h[0];b&&(o.children=b)}}function mjn(o,h,b){return k;function k(O,P,B,G){const U=Array.isArray(B.children)?b:h;return G?U(P,B,G):U(P,B)}}function bjn(o,h){return b;function b(k,O,P,B){const G=Array.isArray(P.children),J=b6(k);return h(O,P,B,G,{columnNumber:J?J.column-1:void 0,fileName:o,lineNumber:J?J.line:void 0},void 0)}}function yjn(o,h){const b={};let k,O;for(O in h.properties)if(O!=="children"&&zjt.call(h.properties,O)){const P=vjn(o,O,h.properties[O]);if(P){const[B,G]=P;o.tableCellAlignToStyle&&B==="align"&&typeof G=="string"&&cjn.has(h.tagName)?k=G:b[B]=G}}if(k){const P=b.style||(b.style={});P[o.stylePropertyNameCase==="css"?"text-align":"textAlign"]=k}return b}function wjn(o,h){const b={};for(const k of h.attributes)if(k.type==="mdxJsxExpressionAttribute")if(k.data&&k.data.estree&&o.evaluater){const P=k.data.estree.body[0];P.type;const B=P.expression;B.type;const G=B.properties[0];G.type,Object.assign(b,o.evaluater.evaluateExpression(G.argument))}else CX(o,h.position);else{const O=k.name;let P;if(k.value&&typeof k.value=="object")if(k.value.data&&k.value.data.estree&&o.evaluater){const G=k.value.data.estree.body[0];G.type,P=o.evaluater.evaluateExpression(G.expression)}else CX(o,h.position);else P=k.value===null?!0:k.value;b[O]=P}return b}function Gjt(o,h){const b=[];let k=-1;const O=o.passKeys?new Map:ajn;for(;++k<h.children.length;){const P=h.children[k];let B;if(o.passKeys){const J=P.type==="element"?P.tagName:P.type==="mdxJsxFlowElement"||P.type==="mdxJsxTextElement"?P.name:void 0;if(J){const U=O.get(J)||0;B=J+"-"+U,O.set(J,U+1)}}const G=vOe(o,P,B);G!==void 0&&b.push(G)}return b}function vjn(o,h,b){const k=kbt(o.schema,h);if(!(b==null||typeof b=="number"&&Number.isNaN(b))){if(Array.isArray(b)&&(b=k.commaSeparated?jjt(b):$jt(b)),k.property==="style"){let O=typeof b=="object"?b:xjn(o,String(b));return o.stylePropertyNameCase==="css"&&(O=kjn(O)),["style",O]}return[o.elementAttributeNameCase==="react"&&k.space?SBn[k.property]||k.property:k.attribute,b]}}function xjn(o,h){try{return rjn(h,{reactCompat:!0})}catch(b){if(o.ignoreInvalidStyle)return{};const k=b,O=new wm("Cannot parse `style` attribute",{ancestors:o.ancestors,cause:k,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw O.file=o.filePath||void 0,O.url=wOe+"#cannot-parse-style-attribute",O}}function kOe(o,h,b){let k;if(!b)k={type:"Literal",value:h};else if(h.includes(".")){const O=h.split(".");let P=-1,B;for(;++P<O.length;){const G=CCe(O[P])?{type:"Identifier",name:O[P]}:{type:"Literal",value:O[P]};B=B?{type:"MemberExpression",object:B,property:G,computed:!!(P&&G.type==="Literal"),optional:!1}:G}k=B}else k=CCe(h)&&!/^[a-z]/.test(h)?{type:"Identifier",name:h}:{type:"Literal",value:h};if(k.type==="Literal"){const O=k.value;return zjt.call(o.components,O)?o.components[O]:O}if(o.evaluater)return o.evaluater.evaluateExpression(k);CX(o)}function CX(o,h){const b=new wm("Cannot handle MDX estrees without `createEvaluater`",{ancestors:o.ancestors,place:h,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw b.file=o.filePath||void 0,b.url=wOe+"#cannot-handle-mdx-estrees-without-createevaluater",b}function kjn(o){const h={};let b;for(b in o)zjt.call(o,b)&&(h[_jn(b)]=o[b]);return h}function _jn(o){let h=o.replace(ojn,Ejn);return h.slice(0,3)==="ms-"&&(h="-"+h),h}function Ejn(o){return"-"+o.toLowerCase()}const gRt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Tjn={};function Sjn(o,h){const b=Tjn,k=typeof b.includeImageAlt=="boolean"?b.includeImageAlt:!0,O=typeof b.includeHtml=="boolean"?b.includeHtml:!0;return _Oe(o,k,O)}function _Oe(o,h,b){if(Ijn(o)){if("value"in o)return o.type==="html"&&!b?"":o.value;if(h&&"alt"in o&&o.alt)return o.alt;if("children"in o)return $Ce(o.children,h,b)}return Array.isArray(o)?$Ce(o,h,b):""}function $Ce(o,h,b){const k=[];let O=-1;for(;++O<o.length;)k[O]=_Oe(o[O],h,b);return k.join("")}function Ijn(o){return!!(o&&typeof o=="object")}const HCe=document.createElement("i");function qjt(o){const h="&"+o+";";HCe.innerHTML=h;const b=HCe.textContent;return b.charCodeAt(b.length-1)===59&&o!=="semi"||b===h?!1:b}function g6(o,h,b,k){const O=o.length;let P=0,B;if(h<0?h=-h>O?0:O+h:h=h>O?O:h,b=b>0?b:0,k.length<1e4)B=Array.from(k),B.unshift(h,b),o.splice(...B);else for(b&&o.splice(h,b);P<k.length;)B=k.slice(P,P+1e4),B.unshift(h,0),o.splice(...B),P+=1e4,h+=1e4}function y3(o,h){return o.length>0?(g6(o,o.length,0,h),o):h}const zCe={}.hasOwnProperty;function Cjn(o){const h={};let b=-1;for(;++b<o.length;)Ajn(h,o[b]);return h}function Ajn(o,h){let b;for(b in h){const O=(zCe.call(o,b)?o[b]:void 0)||(o[b]={}),P=h[b];let B;if(P)for(B in P){zCe.call(O,B)||(O[B]=[]);const G=P[B];Ojn(O[B],Array.isArray(G)?G:G?[G]:[])}}}function Ojn(o,h){let b=-1;const k=[];for(;++b<h.length;)(h[b].add==="after"?o:k).push(h[b]);g6(o,0,0,k)}function EOe(o,h){const b=Number.parseInt(o,h);return b<9||b===11||b>13&&b<32||b>126&&b<160||b>55295&&b<57344||b>64975&&b<65008||(b&65535)===65535||(b&65535)===65534||b>1114111?"�":String.fromCodePoint(b)}function Nj(o){return o.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const h6=rC(/[A-Za-z]/),vw=rC(/[\dA-Za-z]/),Njn=rC(/[#-'*+\--9=?A-Z^-~]/);function ABt(o){return o!==null&&(o<32||o===127)}const OBt=rC(/\d/),Pjn=rC(/[\dA-Fa-f]/),Ljn=rC(/[!-/:-@[-`{-~]/);function Ys(o){return o!==null&&o<-2}function K2(o){return o!==null&&(o<0||o===32)}function Fl(o){return o===-2||o===-1||o===32}const Mjn=rC(new RegExp("\\p{P}|\\p{S}","u")),Djn=rC(/\s/);function rC(o){return h;function h(b){return b!==null&&b>-1&&o.test(String.fromCharCode(b))}}function Jj(o){const h=[];let b=-1,k=0,O=0;for(;++b<o.length;){const P=o.charCodeAt(b);let B="";if(P===37&&vw(o.charCodeAt(b+1))&&vw(o.charCodeAt(b+2)))O=2;else if(P<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(P))||(B=String.fromCharCode(P));else if(P>55295&&P<57344){const G=o.charCodeAt(b+1);P<56320&&G>56319&&G<57344?(B=String.fromCharCode(P,G),O=1):B="�"}else B=String.fromCharCode(P);B&&(h.push(o.slice(k,b),encodeURIComponent(B)),k=b+O+1,B=""),O&&(b+=O,O=0)}return h.join("")+o.slice(k)}function af(o,h,b,k){const O=k?k-1:Number.POSITIVE_INFINITY;let P=0;return B;function B(J){return Fl(J)?(o.enter(b),G(J)):h(J)}function G(J){return Fl(J)&&P++<O?(o.consume(J),G):(o.exit(b),h(J))}}const Rjn={tokenize:Bjn};function Bjn(o){const h=o.attempt(this.parser.constructs.contentInitial,k,O);let b;return h;function k(G){if(G===null){o.consume(G);return}return o.enter("lineEnding"),o.consume(G),o.exit("lineEnding"),af(o,h,"linePrefix")}function O(G){return o.enter("paragraph"),P(G)}function P(G){const J=o.enter("chunkText",{contentType:"text",previous:b});return b&&(b.next=J),b=J,B(G)}function B(G){if(G===null){o.exit("chunkText"),o.exit("paragraph"),o.consume(G);return}return Ys(G)?(o.consume(G),o.exit("chunkText"),P):(o.consume(G),B)}}const jjn={tokenize:Fjn},UCe={tokenize:$jn};function Fjn(o){const h=this,b=[];let k=0,O,P,B;return G;function G(qt){if(k<b.length){const _e=b[k];return h.containerState=_e[1],o.attempt(_e[0].continuation,J,U)(qt)}return U(qt)}function J(qt){if(k++,h.containerState._closeFlow){h.containerState._closeFlow=void 0,O&&ae();const _e=h.events.length;let gn=_e,ge;for(;gn--;)if(h.events[gn][0]==="exit"&&h.events[gn][1].type==="chunkFlow"){ge=h.events[gn][1].end;break}Dt(k);let Mn=_e;for(;Mn<h.events.length;)h.events[Mn][1].end={...ge},Mn++;return g6(h.events,gn+1,0,h.events.slice(_e)),h.events.length=Mn,U(qt)}return G(qt)}function U(qt){if(k===b.length){if(!O)return it(qt);if(O.currentConstruct&&O.currentConstruct.concrete)return tt(qt);h.interrupt=!!(O.currentConstruct&&!O._gfmTableDynamicInterruptHack)}return h.containerState={},o.check(UCe,nt,at)(qt)}function nt(qt){return O&&ae(),Dt(k),it(qt)}function at(qt){return h.parser.lazy[h.now().line]=k!==b.length,B=h.now().offset,tt(qt)}function it(qt){return h.containerState={},o.attempt(UCe,st,tt)(qt)}function st(qt){return k++,b.push([h.currentConstruct,h.containerState]),it(qt)}function tt(qt){if(qt===null){O&&ae(),Dt(0),o.consume(qt);return}return O=O||h.parser.flow(h.now()),o.enter("chunkFlow",{_tokenizer:O,contentType:"flow",previous:P}),Et(qt)}function Et(qt){if(qt===null){Lt(o.exit("chunkFlow"),!0),Dt(0),o.consume(qt);return}return Ys(qt)?(o.consume(qt),Lt(o.exit("chunkFlow")),k=0,h.interrupt=void 0,G):(o.consume(qt),Et)}function Lt(qt,_e){const gn=h.sliceStream(qt);if(_e&&gn.push(null),qt.previous=P,P&&(P.next=qt),P=qt,O.defineSkip(qt.start),O.write(gn),h.parser.lazy[qt.start.line]){let ge=O.events.length;for(;ge--;)if(O.events[ge][1].start.offset<B&&(!O.events[ge][1].end||O.events[ge][1].end.offset>B))return;const Mn=h.events.length;let Wn=Mn,cr,ar;for(;Wn--;)if(h.events[Wn][0]==="exit"&&h.events[Wn][1].type==="chunkFlow"){if(cr){ar=h.events[Wn][1].end;break}cr=!0}for(Dt(k),ge=Mn;ge<h.events.length;)h.events[ge][1].end={...ar},ge++;g6(h.events,Wn+1,0,h.events.slice(Mn)),h.events.length=ge}}function Dt(qt){let _e=b.length;for(;_e-- >qt;){const gn=b[_e];h.containerState=gn[1],gn[0].exit.call(h,o)}b.length=qt}function ae(){O.write([null]),P=void 0,O=void 0,h.containerState._closeFlow=void 0}}function $jn(o,h,b){return af(o,o.attempt(this.parser.constructs.document,h,b),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function GCe(o){if(o===null||K2(o)||Djn(o))return 1;if(Mjn(o))return 2}function Wjt(o,h,b){const k=[];let O=-1;for(;++O<o.length;){const P=o[O].resolveAll;P&&!k.includes(P)&&(h=P(h,b),k.push(P))}return h}const NBt={name:"attention",resolveAll:Hjn,tokenize:zjn};function Hjn(o,h){let b=-1,k,O,P,B,G,J,U,nt;for(;++b<o.length;)if(o[b][0]==="enter"&&o[b][1].type==="attentionSequence"&&o[b][1]._close){for(k=b;k--;)if(o[k][0]==="exit"&&o[k][1].type==="attentionSequence"&&o[k][1]._open&&h.sliceSerialize(o[k][1]).charCodeAt(0)===h.sliceSerialize(o[b][1]).charCodeAt(0)){if((o[k][1]._close||o[b][1]._open)&&(o[b][1].end.offset-o[b][1].start.offset)%3&&!((o[k][1].end.offset-o[k][1].start.offset+o[b][1].end.offset-o[b][1].start.offset)%3))continue;J=o[k][1].end.offset-o[k][1].start.offset>1&&o[b][1].end.offset-o[b][1].start.offset>1?2:1;const at={...o[k][1].end},it={...o[b][1].start};qCe(at,-J),qCe(it,J),B={type:J>1?"strongSequence":"emphasisSequence",start:at,end:{...o[k][1].end}},G={type:J>1?"strongSequence":"emphasisSequence",start:{...o[b][1].start},end:it},P={type:J>1?"strongText":"emphasisText",start:{...o[k][1].end},end:{...o[b][1].start}},O={type:J>1?"strong":"emphasis",start:{...B.start},end:{...G.end}},o[k][1].end={...B.start},o[b][1].start={...G.end},U=[],o[k][1].end.offset-o[k][1].start.offset&&(U=y3(U,[["enter",o[k][1],h],["exit",o[k][1],h]])),U=y3(U,[["enter",O,h],["enter",B,h],["exit",B,h],["enter",P,h]]),U=y3(U,Wjt(h.parser.constructs.insideSpan.null,o.slice(k+1,b),h)),U=y3(U,[["exit",P,h],["enter",G,h],["exit",G,h],["exit",O,h]]),o[b][1].end.offset-o[b][1].start.offset?(nt=2,U=y3(U,[["enter",o[b][1],h],["exit",o[b][1],h]])):nt=0,g6(o,k-1,b-k+3,U),b=k+U.length-nt-2;break}}for(b=-1;++b<o.length;)o[b][1].type==="attentionSequence"&&(o[b][1].type="data");return o}function zjn(o,h){const b=this.parser.constructs.attentionMarkers.null,k=this.previous,O=GCe(k);let P;return B;function B(J){return P=J,o.enter("attentionSequence"),G(J)}function G(J){if(J===P)return o.consume(J),G;const U=o.exit("attentionSequence"),nt=GCe(J),at=!nt||nt===2&&O||b.includes(J),it=!O||O===2&&nt||b.includes(k);return U._open=!!(P===42?at:at&&(O||!it)),U._close=!!(P===42?it:it&&(nt||!at)),h(J)}}function qCe(o,h){o.column+=h,o.offset+=h,o._bufferIndex+=h}const Ujn={name:"autolink",tokenize:Gjn};function Gjn(o,h,b){let k=0;return O;function O(st){return o.enter("autolink"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.enter("autolinkProtocol"),P}function P(st){return h6(st)?(o.consume(st),B):st===64?b(st):U(st)}function B(st){return st===43||st===45||st===46||vw(st)?(k=1,G(st)):U(st)}function G(st){return st===58?(o.consume(st),k=0,J):(st===43||st===45||st===46||vw(st))&&k++<32?(o.consume(st),G):(k=0,U(st))}function J(st){return st===62?(o.exit("autolinkProtocol"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),h):st===null||st===32||st===60||ABt(st)?b(st):(o.consume(st),J)}function U(st){return st===64?(o.consume(st),nt):Njn(st)?(o.consume(st),U):b(st)}function nt(st){return vw(st)?at(st):b(st)}function at(st){return st===46?(o.consume(st),k=0,nt):st===62?(o.exit("autolinkProtocol").type="autolinkEmail",o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),h):it(st)}function it(st){if((st===45||vw(st))&&k++<63){const tt=st===45?it:at;return o.consume(st),tt}return b(st)}}const Tbt={partial:!0,tokenize:qjn};function qjn(o,h,b){return k;function k(P){return Fl(P)?af(o,O,"linePrefix")(P):O(P)}function O(P){return P===null||Ys(P)?h(P):b(P)}}const TOe={continuation:{tokenize:Kjn},exit:Vjn,name:"blockQuote",tokenize:Wjn};function Wjn(o,h,b){const k=this;return O;function O(B){if(B===62){const G=k.containerState;return G.open||(o.enter("blockQuote",{_container:!0}),G.open=!0),o.enter("blockQuotePrefix"),o.enter("blockQuoteMarker"),o.consume(B),o.exit("blockQuoteMarker"),P}return b(B)}function P(B){return Fl(B)?(o.enter("blockQuotePrefixWhitespace"),o.consume(B),o.exit("blockQuotePrefixWhitespace"),o.exit("blockQuotePrefix"),h):(o.exit("blockQuotePrefix"),h(B))}}function Kjn(o,h,b){const k=this;return O;function O(B){return Fl(B)?af(o,P,"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):P(B)}function P(B){return o.attempt(TOe,h,b)(B)}}function Vjn(o){o.exit("blockQuote")}const SOe={name:"characterEscape",tokenize:Yjn};function Yjn(o,h,b){return k;function k(P){return o.enter("characterEscape"),o.enter("escapeMarker"),o.consume(P),o.exit("escapeMarker"),O}function O(P){return Ljn(P)?(o.enter("characterEscapeValue"),o.consume(P),o.exit("characterEscapeValue"),o.exit("characterEscape"),h):b(P)}}const IOe={name:"characterReference",tokenize:Jjn};function Jjn(o,h,b){const k=this;let O=0,P,B;return G;function G(at){return o.enter("characterReference"),o.enter("characterReferenceMarker"),o.consume(at),o.exit("characterReferenceMarker"),J}function J(at){return at===35?(o.enter("characterReferenceMarkerNumeric"),o.consume(at),o.exit("characterReferenceMarkerNumeric"),U):(o.enter("characterReferenceValue"),P=31,B=vw,nt(at))}function U(at){return at===88||at===120?(o.enter("characterReferenceMarkerHexadecimal"),o.consume(at),o.exit("characterReferenceMarkerHexadecimal"),o.enter("characterReferenceValue"),P=6,B=Pjn,nt):(o.enter("characterReferenceValue"),P=7,B=OBt,nt(at))}function nt(at){if(at===59&&O){const it=o.exit("characterReferenceValue");return B===vw&&!qjt(k.sliceSerialize(it))?b(at):(o.enter("characterReferenceMarker"),o.consume(at),o.exit("characterReferenceMarker"),o.exit("characterReference"),h)}return B(at)&&O++<P?(o.consume(at),nt):b(at)}}const WCe={partial:!0,tokenize:Qjn},KCe={concrete:!0,name:"codeFenced",tokenize:Xjn};function Xjn(o,h,b){const k=this,O={partial:!0,tokenize:gn};let P=0,B=0,G;return J;function J(ge){return U(ge)}function U(ge){const Mn=k.events[k.events.length-1];return P=Mn&&Mn[1].type==="linePrefix"?Mn[2].sliceSerialize(Mn[1],!0).length:0,G=ge,o.enter("codeFenced"),o.enter("codeFencedFence"),o.enter("codeFencedFenceSequence"),nt(ge)}function nt(ge){return ge===G?(B++,o.consume(ge),nt):B<3?b(ge):(o.exit("codeFencedFenceSequence"),Fl(ge)?af(o,at,"whitespace")(ge):at(ge))}function at(ge){return ge===null||Ys(ge)?(o.exit("codeFencedFence"),k.interrupt?h(ge):o.check(WCe,Et,_e)(ge)):(o.enter("codeFencedFenceInfo"),o.enter("chunkString",{contentType:"string"}),it(ge))}function it(ge){return ge===null||Ys(ge)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),at(ge)):Fl(ge)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),af(o,st,"whitespace")(ge)):ge===96&&ge===G?b(ge):(o.consume(ge),it)}function st(ge){return ge===null||Ys(ge)?at(ge):(o.enter("codeFencedFenceMeta"),o.enter("chunkString",{contentType:"string"}),tt(ge))}function tt(ge){return ge===null||Ys(ge)?(o.exit("chunkString"),o.exit("codeFencedFenceMeta"),at(ge)):ge===96&&ge===G?b(ge):(o.consume(ge),tt)}function Et(ge){return o.attempt(O,_e,Lt)(ge)}function Lt(ge){return o.enter("lineEnding"),o.consume(ge),o.exit("lineEnding"),Dt}function Dt(ge){return P>0&&Fl(ge)?af(o,ae,"linePrefix",P+1)(ge):ae(ge)}function ae(ge){return ge===null||Ys(ge)?o.check(WCe,Et,_e)(ge):(o.enter("codeFlowValue"),qt(ge))}function qt(ge){return ge===null||Ys(ge)?(o.exit("codeFlowValue"),ae(ge)):(o.consume(ge),qt)}function _e(ge){return o.exit("codeFenced"),h(ge)}function gn(ge,Mn,Wn){let cr=0;return ar;function ar(Vt){return ge.enter("lineEnding"),ge.consume(Vt),ge.exit("lineEnding"),bn}function bn(Vt){return ge.enter("codeFencedFence"),Fl(Vt)?af(ge,Vn,"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Vt):Vn(Vt)}function Vn(Vt){return Vt===G?(ge.enter("codeFencedFenceSequence"),hi(Vt)):Wn(Vt)}function hi(Vt){return Vt===G?(cr++,ge.consume(Vt),hi):cr>=B?(ge.exit("codeFencedFenceSequence"),Fl(Vt)?af(ge,$n,"whitespace")(Vt):$n(Vt)):Wn(Vt)}function $n(Vt){return Vt===null||Ys(Vt)?(ge.exit("codeFencedFence"),Mn(Vt)):Wn(Vt)}}}function Qjn(o,h,b){const k=this;return O;function O(B){return B===null?b(B):(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),P)}function P(B){return k.parser.lazy[k.now().line]?b(B):h(B)}}const mRt={name:"codeIndented",tokenize:tFn},Zjn={partial:!0,tokenize:eFn};function tFn(o,h,b){const k=this;return O;function O(U){return o.enter("codeIndented"),af(o,P,"linePrefix",5)(U)}function P(U){const nt=k.events[k.events.length-1];return nt&&nt[1].type==="linePrefix"&&nt[2].sliceSerialize(nt[1],!0).length>=4?B(U):b(U)}function B(U){return U===null?J(U):Ys(U)?o.attempt(Zjn,B,J)(U):(o.enter("codeFlowValue"),G(U))}function G(U){return U===null||Ys(U)?(o.exit("codeFlowValue"),B(U)):(o.consume(U),G)}function J(U){return o.exit("codeIndented"),h(U)}}function eFn(o,h,b){const k=this;return O;function O(B){return k.parser.lazy[k.now().line]?b(B):Ys(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),O):af(o,P,"linePrefix",5)(B)}function P(B){const G=k.events[k.events.length-1];return G&&G[1].type==="linePrefix"&&G[2].sliceSerialize(G[1],!0).length>=4?h(B):Ys(B)?O(B):b(B)}}const nFn={name:"codeText",previous:iFn,resolve:rFn,tokenize:aFn};function rFn(o){let h=o.length-4,b=3,k,O;if((o[b][1].type==="lineEnding"||o[b][1].type==="space")&&(o[h][1].type==="lineEnding"||o[h][1].type==="space")){for(k=b;++k<h;)if(o[k][1].type==="codeTextData"){o[b][1].type="codeTextPadding",o[h][1].type="codeTextPadding",b+=2,h-=2;break}}for(k=b-1,h++;++k<=h;)O===void 0?k!==h&&o[k][1].type!=="lineEnding"&&(O=k):(k===h||o[k][1].type==="lineEnding")&&(o[O][1].type="codeTextData",k!==O+2&&(o[O][1].end=o[k-1][1].end,o.splice(O+2,k-O-2),h-=k-O-2,k=O+2),O=void 0);return o}function iFn(o){return o!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aFn(o,h,b){let k=0,O,P;return B;function B(at){return o.enter("codeText"),o.enter("codeTextSequence"),G(at)}function G(at){return at===96?(o.consume(at),k++,G):(o.exit("codeTextSequence"),J(at))}function J(at){return at===null?b(at):at===32?(o.enter("space"),o.consume(at),o.exit("space"),J):at===96?(P=o.enter("codeTextSequence"),O=0,nt(at)):Ys(at)?(o.enter("lineEnding"),o.consume(at),o.exit("lineEnding"),J):(o.enter("codeTextData"),U(at))}function U(at){return at===null||at===32||at===96||Ys(at)?(o.exit("codeTextData"),J(at)):(o.consume(at),U)}function nt(at){return at===96?(o.consume(at),O++,nt):O===k?(o.exit("codeTextSequence"),o.exit("codeText"),h(at)):(P.type="codeTextData",U(at))}}class oFn{constructor(h){this.left=h?[...h]:[],this.right=[]}get(h){if(h<0||h>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+h+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return h<this.left.length?this.left[h]:this.right[this.right.length-h+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(h,b){const k=b??Number.POSITIVE_INFINITY;return k<this.left.length?this.left.slice(h,k):h>this.left.length?this.right.slice(this.right.length-k+this.left.length,this.right.length-h+this.left.length).reverse():this.left.slice(h).concat(this.right.slice(this.right.length-k+this.left.length).reverse())}splice(h,b,k){const O=b||0;this.setCursor(Math.trunc(h));const P=this.right.splice(this.right.length-O,Number.POSITIVE_INFINITY);return k&&YJ(this.left,k),P.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(h){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(h)}pushMany(h){this.setCursor(Number.POSITIVE_INFINITY),YJ(this.left,h)}unshift(h){this.setCursor(0),this.right.push(h)}unshiftMany(h){this.setCursor(0),YJ(this.right,h.reverse())}setCursor(h){if(!(h===this.left.length||h>this.left.length&&this.right.length===0||h<0&&this.left.length===0))if(h<this.left.length){const b=this.left.splice(h,Number.POSITIVE_INFINITY);YJ(this.right,b.reverse())}else{const b=this.right.splice(this.left.length+this.right.length-h,Number.POSITIVE_INFINITY);YJ(this.left,b.reverse())}}}function YJ(o,h){let b=0;if(h.length<1e4)o.push(...h);else for(;b<h.length;)o.push(...h.slice(b,b+1e4)),b+=1e4}function COe(o){const h={};let b=-1,k,O,P,B,G,J,U;const nt=new oFn(o);for(;++b<nt.length;){for(;b in h;)b=h[b];if(k=nt.get(b),b&&k[1].type==="chunkFlow"&&nt.get(b-1)[1].type==="listItemPrefix"&&(J=k[1]._tokenizer.events,P=0,P<J.length&&J[P][1].type==="lineEndingBlank"&&(P+=2),P<J.length&&J[P][1].type==="content"))for(;++P<J.length&&J[P][1].type!=="content";)J[P][1].type==="chunkText"&&(J[P][1]._isInFirstContentOfListItem=!0,P++);if(k[0]==="enter")k[1].contentType&&(Object.assign(h,sFn(nt,b)),b=h[b],U=!0);else if(k[1]._container){for(P=b,O=void 0;P--;)if(B=nt.get(P),B[1].type==="lineEnding"||B[1].type==="lineEndingBlank")B[0]==="enter"&&(O&&(nt.get(O)[1].type="lineEndingBlank"),B[1].type="lineEnding",O=P);else if(!(B[1].type==="linePrefix"||B[1].type==="listItemIndent"))break;O&&(k[1].end={...nt.get(O)[1].start},G=nt.slice(O,b),G.unshift(k),nt.splice(O,b-O+1,G))}}return g6(o,0,Number.POSITIVE_INFINITY,nt.slice(0)),!U}function sFn(o,h){const b=o.get(h)[1],k=o.get(h)[2];let O=h-1;const P=[];let B=b._tokenizer;B||(B=k.parser[b.contentType](b.start),b._contentTypeTextTrailing&&(B._contentTypeTextTrailing=!0));const G=B.events,J=[],U={};let nt,at,it=-1,st=b,tt=0,Et=0;const Lt=[Et];for(;st;){for(;o.get(++O)[1]!==st;);P.push(O),st._tokenizer||(nt=k.sliceStream(st),st.next||nt.push(null),at&&B.defineSkip(st.start),st._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=!0),B.write(nt),st._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=void 0)),at=st,st=st.next}for(st=b;++it<G.length;)G[it][0]==="exit"&&G[it-1][0]==="enter"&&G[it][1].type===G[it-1][1].type&&G[it][1].start.line!==G[it][1].end.line&&(Et=it+1,Lt.push(Et),st._tokenizer=void 0,st.previous=void 0,st=st.next);for(B.events=[],st?(st._tokenizer=void 0,st.previous=void 0):Lt.pop(),it=Lt.length;it--;){const Dt=G.slice(Lt[it],Lt[it+1]),ae=P.pop();J.push([ae,ae+Dt.length-1]),o.splice(ae,2,Dt)}for(J.reverse(),it=-1;++it<J.length;)U[tt+J[it][0]]=tt+J[it][1],tt+=J[it][1]-J[it][0]-1;return U}const cFn={resolve:lFn,tokenize:hFn},uFn={partial:!0,tokenize:fFn};function lFn(o){return COe(o),o}function hFn(o,h){let b;return k;function k(G){return o.enter("content"),b=o.enter("chunkContent",{contentType:"content"}),O(G)}function O(G){return G===null?P(G):Ys(G)?o.check(uFn,B,P)(G):(o.consume(G),O)}function P(G){return o.exit("chunkContent"),o.exit("content"),h(G)}function B(G){return o.consume(G),o.exit("chunkContent"),b.next=o.enter("chunkContent",{contentType:"content",previous:b}),b=b.next,O}}function fFn(o,h,b){const k=this;return O;function O(B){return o.exit("chunkContent"),o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),af(o,P,"linePrefix")}function P(B){if(B===null||Ys(B))return b(B);const G=k.events[k.events.length-1];return!k.parser.constructs.disable.null.includes("codeIndented")&&G&&G[1].type==="linePrefix"&&G[2].sliceSerialize(G[1],!0).length>=4?h(B):o.interrupt(k.parser.constructs.flow,b,h)(B)}}function AOe(o,h,b,k,O,P,B,G,J){const U=J||Number.POSITIVE_INFINITY;let nt=0;return at;function at(Dt){return Dt===60?(o.enter(k),o.enter(O),o.enter(P),o.consume(Dt),o.exit(P),it):Dt===null||Dt===32||Dt===41||ABt(Dt)?b(Dt):(o.enter(k),o.enter(B),o.enter(G),o.enter("chunkString",{contentType:"string"}),Et(Dt))}function it(Dt){return Dt===62?(o.enter(P),o.consume(Dt),o.exit(P),o.exit(O),o.exit(k),h):(o.enter(G),o.enter("chunkString",{contentType:"string"}),st(Dt))}function st(Dt){return Dt===62?(o.exit("chunkString"),o.exit(G),it(Dt)):Dt===null||Dt===60||Ys(Dt)?b(Dt):(o.consume(Dt),Dt===92?tt:st)}function tt(Dt){return Dt===60||Dt===62||Dt===92?(o.consume(Dt),st):st(Dt)}function Et(Dt){return!nt&&(Dt===null||Dt===41||K2(Dt))?(o.exit("chunkString"),o.exit(G),o.exit(B),o.exit(k),h(Dt)):nt<U&&Dt===40?(o.consume(Dt),nt++,Et):Dt===41?(o.consume(Dt),nt--,Et):Dt===null||Dt===32||Dt===40||ABt(Dt)?b(Dt):(o.consume(Dt),Dt===92?Lt:Et)}function Lt(Dt){return Dt===40||Dt===41||Dt===92?(o.consume(Dt),Et):Et(Dt)}}function OOe(o,h,b,k,O,P){const B=this;let G=0,J;return U;function U(st){return o.enter(k),o.enter(O),o.consume(st),o.exit(O),o.enter(P),nt}function nt(st){return G>999||st===null||st===91||st===93&&!J||st===94&&!G&&"_hiddenFootnoteSupport"in B.parser.constructs?b(st):st===93?(o.exit(P),o.enter(O),o.consume(st),o.exit(O),o.exit(k),h):Ys(st)?(o.enter("lineEnding"),o.consume(st),o.exit("lineEnding"),nt):(o.enter("chunkString",{contentType:"string"}),at(st))}function at(st){return st===null||st===91||st===93||Ys(st)||G++>999?(o.exit("chunkString"),nt(st)):(o.consume(st),J||(J=!Fl(st)),st===92?it:at)}function it(st){return st===91||st===92||st===93?(o.consume(st),G++,at):at(st)}}function NOe(o,h,b,k,O,P){let B;return G;function G(it){return it===34||it===39||it===40?(o.enter(k),o.enter(O),o.consume(it),o.exit(O),B=it===40?41:it,J):b(it)}function J(it){return it===B?(o.enter(O),o.consume(it),o.exit(O),o.exit(k),h):(o.enter(P),U(it))}function U(it){return it===B?(o.exit(P),J(B)):it===null?b(it):Ys(it)?(o.enter("lineEnding"),o.consume(it),o.exit("lineEnding"),af(o,U,"linePrefix")):(o.enter("chunkString",{contentType:"string"}),nt(it))}function nt(it){return it===B||it===null||Ys(it)?(o.exit("chunkString"),U(it)):(o.consume(it),it===92?at:nt)}function at(it){return it===B||it===92?(o.consume(it),nt):nt(it)}}function pX(o,h){let b;return k;function k(O){return Ys(O)?(o.enter("lineEnding"),o.consume(O),o.exit("lineEnding"),b=!0,k):Fl(O)?af(o,k,b?"linePrefix":"lineSuffix")(O):h(O)}}const dFn={name:"definition",tokenize:gFn},pFn={partial:!0,tokenize:mFn};function gFn(o,h,b){const k=this;let O;return P;function P(st){return o.enter("definition"),B(st)}function B(st){return OOe.call(k,o,G,b,"definitionLabel","definitionLabelMarker","definitionLabelString")(st)}function G(st){return O=Nj(k.sliceSerialize(k.events[k.events.length-1][1]).slice(1,-1)),st===58?(o.enter("definitionMarker"),o.consume(st),o.exit("definitionMarker"),J):b(st)}function J(st){return K2(st)?pX(o,U)(st):U(st)}function U(st){return AOe(o,nt,b,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(st)}function nt(st){return o.attempt(pFn,at,at)(st)}function at(st){return Fl(st)?af(o,it,"whitespace")(st):it(st)}function it(st){return st===null||Ys(st)?(o.exit("definition"),k.parser.defined.push(O),h(st)):b(st)}}function mFn(o,h,b){return k;function k(G){return K2(G)?pX(o,O)(G):b(G)}function O(G){return NOe(o,P,b,"definitionTitle","definitionTitleMarker","definitionTitleString")(G)}function P(G){return Fl(G)?af(o,B,"whitespace")(G):B(G)}function B(G){return G===null||Ys(G)?h(G):b(G)}}const bFn={name:"hardBreakEscape",tokenize:yFn};function yFn(o,h,b){return k;function k(P){return o.enter("hardBreakEscape"),o.consume(P),O}function O(P){return Ys(P)?(o.exit("hardBreakEscape"),h(P)):b(P)}}const wFn={name:"headingAtx",resolve:vFn,tokenize:xFn};function vFn(o,h){let b=o.length-2,k=3,O,P;return o[k][1].type==="whitespace"&&(k+=2),b-2>k&&o[b][1].type==="whitespace"&&(b-=2),o[b][1].type==="atxHeadingSequence"&&(k===b-1||b-4>k&&o[b-2][1].type==="whitespace")&&(b-=k+1===b?2:4),b>k&&(O={type:"atxHeadingText",start:o[k][1].start,end:o[b][1].end},P={type:"chunkText",start:o[k][1].start,end:o[b][1].end,contentType:"text"},g6(o,k,b-k+1,[["enter",O,h],["enter",P,h],["exit",P,h],["exit",O,h]])),o}function xFn(o,h,b){let k=0;return O;function O(nt){return o.enter("atxHeading"),P(nt)}function P(nt){return o.enter("atxHeadingSequence"),B(nt)}function B(nt){return nt===35&&k++<6?(o.consume(nt),B):nt===null||K2(nt)?(o.exit("atxHeadingSequence"),G(nt)):b(nt)}function G(nt){return nt===35?(o.enter("atxHeadingSequence"),J(nt)):nt===null||Ys(nt)?(o.exit("atxHeading"),h(nt)):Fl(nt)?af(o,G,"whitespace")(nt):(o.enter("atxHeadingText"),U(nt))}function J(nt){return nt===35?(o.consume(nt),J):(o.exit("atxHeadingSequence"),G(nt))}function U(nt){return nt===null||nt===35||K2(nt)?(o.exit("atxHeadingText"),G(nt)):(o.consume(nt),U)}}const kFn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],VCe=["pre","script","style","textarea"],_Fn={concrete:!0,name:"htmlFlow",resolveTo:SFn,tokenize:IFn},EFn={partial:!0,tokenize:AFn},TFn={partial:!0,tokenize:CFn};function SFn(o){let h=o.length;for(;h--&&!(o[h][0]==="enter"&&o[h][1].type==="htmlFlow"););return h>1&&o[h-2][1].type==="linePrefix"&&(o[h][1].start=o[h-2][1].start,o[h+1][1].start=o[h-2][1].start,o.splice(h-2,2)),o}function IFn(o,h,b){const k=this;let O,P,B,G,J;return U;function U(Je){return nt(Je)}function nt(Je){return o.enter("htmlFlow"),o.enter("htmlFlowData"),o.consume(Je),at}function at(Je){return Je===33?(o.consume(Je),it):Je===47?(o.consume(Je),P=!0,Et):Je===63?(o.consume(Je),O=3,k.interrupt?h:Be):h6(Je)?(o.consume(Je),B=String.fromCharCode(Je),Lt):b(Je)}function it(Je){return Je===45?(o.consume(Je),O=2,st):Je===91?(o.consume(Je),O=5,G=0,tt):h6(Je)?(o.consume(Je),O=4,k.interrupt?h:Be):b(Je)}function st(Je){return Je===45?(o.consume(Je),k.interrupt?h:Be):b(Je)}function tt(Je){const Xs="CDATA[";return Je===Xs.charCodeAt(G++)?(o.consume(Je),G===Xs.length?k.interrupt?h:Vn:tt):b(Je)}function Et(Je){return h6(Je)?(o.consume(Je),B=String.fromCharCode(Je),Lt):b(Je)}function Lt(Je){if(Je===null||Je===47||Je===62||K2(Je)){const Xs=Je===47,_o=B.toLowerCase();return!Xs&&!P&&VCe.includes(_o)?(O=1,k.interrupt?h(Je):Vn(Je)):kFn.includes(B.toLowerCase())?(O=6,Xs?(o.consume(Je),Dt):k.interrupt?h(Je):Vn(Je)):(O=7,k.interrupt&&!k.parser.lazy[k.now().line]?b(Je):P?ae(Je):qt(Je))}return Je===45||vw(Je)?(o.consume(Je),B+=String.fromCharCode(Je),Lt):b(Je)}function Dt(Je){return Je===62?(o.consume(Je),k.interrupt?h:Vn):b(Je)}function ae(Je){return Fl(Je)?(o.consume(Je),ae):ar(Je)}function qt(Je){return Je===47?(o.consume(Je),ar):Je===58||Je===95||h6(Je)?(o.consume(Je),_e):Fl(Je)?(o.consume(Je),qt):ar(Je)}function _e(Je){return Je===45||Je===46||Je===58||Je===95||vw(Je)?(o.consume(Je),_e):gn(Je)}function gn(Je){return Je===61?(o.consume(Je),ge):Fl(Je)?(o.consume(Je),gn):qt(Je)}function ge(Je){return Je===null||Je===60||Je===61||Je===62||Je===96?b(Je):Je===34||Je===39?(o.consume(Je),J=Je,Mn):Fl(Je)?(o.consume(Je),ge):Wn(Je)}function Mn(Je){return Je===J?(o.consume(Je),J=null,cr):Je===null||Ys(Je)?b(Je):(o.consume(Je),Mn)}function Wn(Je){return Je===null||Je===34||Je===39||Je===47||Je===60||Je===61||Je===62||Je===96||K2(Je)?gn(Je):(o.consume(Je),Wn)}function cr(Je){return Je===47||Je===62||Fl(Je)?qt(Je):b(Je)}function ar(Je){return Je===62?(o.consume(Je),bn):b(Je)}function bn(Je){return Je===null||Ys(Je)?Vn(Je):Fl(Je)?(o.consume(Je),bn):b(Je)}function Vn(Je){return Je===45&&O===2?(o.consume(Je),Ye):Je===60&&O===1?(o.consume(Je),jn):Je===62&&O===4?(o.consume(Je),Js):Je===63&&O===3?(o.consume(Je),Be):Je===93&&O===5?(o.consume(Je),rr):Ys(Je)&&(O===6||O===7)?(o.exit("htmlFlowData"),o.check(EFn,el,hi)(Je)):Je===null||Ys(Je)?(o.exit("htmlFlowData"),hi(Je)):(o.consume(Je),Vn)}function hi(Je){return o.check(TFn,$n,el)(Je)}function $n(Je){return o.enter("lineEnding"),o.consume(Je),o.exit("lineEnding"),Vt}function Vt(Je){return Je===null||Ys(Je)?hi(Je):(o.enter("htmlFlowData"),Vn(Je))}function Ye(Je){return Je===45?(o.consume(Je),Be):Vn(Je)}function jn(Je){return Je===47?(o.consume(Je),B="",er):Vn(Je)}function er(Je){if(Je===62){const Xs=B.toLowerCase();return VCe.includes(Xs)?(o.consume(Je),Js):Vn(Je)}return h6(Je)&&B.length<8?(o.consume(Je),B+=String.fromCharCode(Je),er):Vn(Je)}function rr(Je){return Je===93?(o.consume(Je),Be):Vn(Je)}function Be(Je){return Je===62?(o.consume(Je),Js):Je===45&&O===2?(o.consume(Je),Be):Vn(Je)}function Js(Je){return Je===null||Ys(Je)?(o.exit("htmlFlowData"),el(Je)):(o.consume(Je),Js)}function el(Je){return o.exit("htmlFlow"),h(Je)}}function CFn(o,h,b){const k=this;return O;function O(B){return Ys(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),P):b(B)}function P(B){return k.parser.lazy[k.now().line]?b(B):h(B)}}function AFn(o,h,b){return k;function k(O){return o.enter("lineEnding"),o.consume(O),o.exit("lineEnding"),o.attempt(Tbt,h,b)}}const OFn={name:"htmlText",tokenize:NFn};function NFn(o,h,b){const k=this;let O,P,B;return G;function G(Be){return o.enter("htmlText"),o.enter("htmlTextData"),o.consume(Be),J}function J(Be){return Be===33?(o.consume(Be),U):Be===47?(o.consume(Be),gn):Be===63?(o.consume(Be),qt):h6(Be)?(o.consume(Be),Wn):b(Be)}function U(Be){return Be===45?(o.consume(Be),nt):Be===91?(o.consume(Be),P=0,tt):h6(Be)?(o.consume(Be),ae):b(Be)}function nt(Be){return Be===45?(o.consume(Be),st):b(Be)}function at(Be){return Be===null?b(Be):Be===45?(o.consume(Be),it):Ys(Be)?(B=at,jn(Be)):(o.consume(Be),at)}function it(Be){return Be===45?(o.consume(Be),st):at(Be)}function st(Be){return Be===62?Ye(Be):Be===45?it(Be):at(Be)}function tt(Be){const Js="CDATA[";return Be===Js.charCodeAt(P++)?(o.consume(Be),P===Js.length?Et:tt):b(Be)}function Et(Be){return Be===null?b(Be):Be===93?(o.consume(Be),Lt):Ys(Be)?(B=Et,jn(Be)):(o.consume(Be),Et)}function Lt(Be){return Be===93?(o.consume(Be),Dt):Et(Be)}function Dt(Be){return Be===62?Ye(Be):Be===93?(o.consume(Be),Dt):Et(Be)}function ae(Be){return Be===null||Be===62?Ye(Be):Ys(Be)?(B=ae,jn(Be)):(o.consume(Be),ae)}function qt(Be){return Be===null?b(Be):Be===63?(o.consume(Be),_e):Ys(Be)?(B=qt,jn(Be)):(o.consume(Be),qt)}function _e(Be){return Be===62?Ye(Be):qt(Be)}function gn(Be){return h6(Be)?(o.consume(Be),ge):b(Be)}function ge(Be){return Be===45||vw(Be)?(o.consume(Be),ge):Mn(Be)}function Mn(Be){return Ys(Be)?(B=Mn,jn(Be)):Fl(Be)?(o.consume(Be),Mn):Ye(Be)}function Wn(Be){return Be===45||vw(Be)?(o.consume(Be),Wn):Be===47||Be===62||K2(Be)?cr(Be):b(Be)}function cr(Be){return Be===47?(o.consume(Be),Ye):Be===58||Be===95||h6(Be)?(o.consume(Be),ar):Ys(Be)?(B=cr,jn(Be)):Fl(Be)?(o.consume(Be),cr):Ye(Be)}function ar(Be){return Be===45||Be===46||Be===58||Be===95||vw(Be)?(o.consume(Be),ar):bn(Be)}function bn(Be){return Be===61?(o.consume(Be),Vn):Ys(Be)?(B=bn,jn(Be)):Fl(Be)?(o.consume(Be),bn):cr(Be)}function Vn(Be){return Be===null||Be===60||Be===61||Be===62||Be===96?b(Be):Be===34||Be===39?(o.consume(Be),O=Be,hi):Ys(Be)?(B=Vn,jn(Be)):Fl(Be)?(o.consume(Be),Vn):(o.consume(Be),$n)}function hi(Be){return Be===O?(o.consume(Be),O=void 0,Vt):Be===null?b(Be):Ys(Be)?(B=hi,jn(Be)):(o.consume(Be),hi)}function $n(Be){return Be===null||Be===34||Be===39||Be===60||Be===61||Be===96?b(Be):Be===47||Be===62||K2(Be)?cr(Be):(o.consume(Be),$n)}function Vt(Be){return Be===47||Be===62||K2(Be)?cr(Be):b(Be)}function Ye(Be){return Be===62?(o.consume(Be),o.exit("htmlTextData"),o.exit("htmlText"),h):b(Be)}function jn(Be){return o.exit("htmlTextData"),o.enter("lineEnding"),o.consume(Be),o.exit("lineEnding"),er}function er(Be){return Fl(Be)?af(o,rr,"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Be):rr(Be)}function rr(Be){return o.enter("htmlTextData"),B(Be)}}const Kjt={name:"labelEnd",resolveAll:DFn,resolveTo:RFn,tokenize:BFn},PFn={tokenize:jFn},LFn={tokenize:FFn},MFn={tokenize:$Fn};function DFn(o){let h=-1;const b=[];for(;++h<o.length;){const k=o[h][1];if(b.push(o[h]),k.type==="labelImage"||k.type==="labelLink"||k.type==="labelEnd"){const O=k.type==="labelImage"?4:2;k.type="data",h+=O}}return o.length!==b.length&&g6(o,0,o.length,b),o}function RFn(o,h){let b=o.length,k=0,O,P,B,G;for(;b--;)if(O=o[b][1],P){if(O.type==="link"||O.type==="labelLink"&&O._inactive)break;o[b][0]==="enter"&&O.type==="labelLink"&&(O._inactive=!0)}else if(B){if(o[b][0]==="enter"&&(O.type==="labelImage"||O.type==="labelLink")&&!O._balanced&&(P=b,O.type!=="labelLink")){k=2;break}}else O.type==="labelEnd"&&(B=b);const J={type:o[P][1].type==="labelLink"?"link":"image",start:{...o[P][1].start},end:{...o[o.length-1][1].end}},U={type:"label",start:{...o[P][1].start},end:{...o[B][1].end}},nt={type:"labelText",start:{...o[P+k+2][1].end},end:{...o[B-2][1].start}};return G=[["enter",J,h],["enter",U,h]],G=y3(G,o.slice(P+1,P+k+3)),G=y3(G,[["enter",nt,h]]),G=y3(G,Wjt(h.parser.constructs.insideSpan.null,o.slice(P+k+4,B-3),h)),G=y3(G,[["exit",nt,h],o[B-2],o[B-1],["exit",U,h]]),G=y3(G,o.slice(B+1)),G=y3(G,[["exit",J,h]]),g6(o,P,o.length,G),o}function BFn(o,h,b){const k=this;let O=k.events.length,P,B;for(;O--;)if((k.events[O][1].type==="labelImage"||k.events[O][1].type==="labelLink")&&!k.events[O][1]._balanced){P=k.events[O][1];break}return G;function G(it){return P?P._inactive?at(it):(B=k.parser.defined.includes(Nj(k.sliceSerialize({start:P.end,end:k.now()}))),o.enter("labelEnd"),o.enter("labelMarker"),o.consume(it),o.exit("labelMarker"),o.exit("labelEnd"),J):b(it)}function J(it){return it===40?o.attempt(PFn,nt,B?nt:at)(it):it===91?o.attempt(LFn,nt,B?U:at)(it):B?nt(it):at(it)}function U(it){return o.attempt(MFn,nt,at)(it)}function nt(it){return h(it)}function at(it){return P._balanced=!0,b(it)}}function jFn(o,h,b){return k;function k(at){return o.enter("resource"),o.enter("resourceMarker"),o.consume(at),o.exit("resourceMarker"),O}function O(at){return K2(at)?pX(o,P)(at):P(at)}function P(at){return at===41?nt(at):AOe(o,B,G,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(at)}function B(at){return K2(at)?pX(o,J)(at):nt(at)}function G(at){return b(at)}function J(at){return at===34||at===39||at===40?NOe(o,U,b,"resourceTitle","resourceTitleMarker","resourceTitleString")(at):nt(at)}function U(at){return K2(at)?pX(o,nt)(at):nt(at)}function nt(at){return at===41?(o.enter("resourceMarker"),o.consume(at),o.exit("resourceMarker"),o.exit("resource"),h):b(at)}}function FFn(o,h,b){const k=this;return O;function O(G){return OOe.call(k,o,P,B,"reference","referenceMarker","referenceString")(G)}function P(G){return k.parser.defined.includes(Nj(k.sliceSerialize(k.events[k.events.length-1][1]).slice(1,-1)))?h(G):b(G)}function B(G){return b(G)}}function $Fn(o,h,b){return k;function k(P){return o.enter("reference"),o.enter("referenceMarker"),o.consume(P),o.exit("referenceMarker"),O}function O(P){return P===93?(o.enter("referenceMarker"),o.consume(P),o.exit("referenceMarker"),o.exit("reference"),h):b(P)}}const HFn={name:"labelStartImage",resolveAll:Kjt.resolveAll,tokenize:zFn};function zFn(o,h,b){const k=this;return O;function O(G){return o.enter("labelImage"),o.enter("labelImageMarker"),o.consume(G),o.exit("labelImageMarker"),P}function P(G){return G===91?(o.enter("labelMarker"),o.consume(G),o.exit("labelMarker"),o.exit("labelImage"),B):b(G)}function B(G){return G===94&&"_hiddenFootnoteSupport"in k.parser.constructs?b(G):h(G)}}const UFn={name:"labelStartLink",resolveAll:Kjt.resolveAll,tokenize:GFn};function GFn(o,h,b){const k=this;return O;function O(B){return o.enter("labelLink"),o.enter("labelMarker"),o.consume(B),o.exit("labelMarker"),o.exit("labelLink"),P}function P(B){return B===94&&"_hiddenFootnoteSupport"in k.parser.constructs?b(B):h(B)}}const bRt={name:"lineEnding",tokenize:qFn};function qFn(o,h){return b;function b(k){return o.enter("lineEnding"),o.consume(k),o.exit("lineEnding"),af(o,h,"linePrefix")}}const Pmt={name:"thematicBreak",tokenize:WFn};function WFn(o,h,b){let k=0,O;return P;function P(U){return o.enter("thematicBreak"),B(U)}function B(U){return O=U,G(U)}function G(U){return U===O?(o.enter("thematicBreakSequence"),J(U)):k>=3&&(U===null||Ys(U))?(o.exit("thematicBreak"),h(U)):b(U)}function J(U){return U===O?(o.consume(U),k++,J):(o.exit("thematicBreakSequence"),Fl(U)?af(o,G,"whitespace")(U):G(U))}}const q2={continuation:{tokenize:JFn},exit:QFn,name:"list",tokenize:YFn},KFn={partial:!0,tokenize:ZFn},VFn={partial:!0,tokenize:XFn};function YFn(o,h,b){const k=this,O=k.events[k.events.length-1];let P=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,B=0;return G;function G(st){const tt=k.containerState.type||(st===42||st===43||st===45?"listUnordered":"listOrdered");if(tt==="listUnordered"?!k.containerState.marker||st===k.containerState.marker:OBt(st)){if(k.containerState.type||(k.containerState.type=tt,o.enter(tt,{_container:!0})),tt==="listUnordered")return o.enter("listItemPrefix"),st===42||st===45?o.check(Pmt,b,U)(st):U(st);if(!k.interrupt||st===49)return o.enter("listItemPrefix"),o.enter("listItemValue"),J(st)}return b(st)}function J(st){return OBt(st)&&++B<10?(o.consume(st),J):(!k.interrupt||B<2)&&(k.containerState.marker?st===k.containerState.marker:st===41||st===46)?(o.exit("listItemValue"),U(st)):b(st)}function U(st){return o.enter("listItemMarker"),o.consume(st),o.exit("listItemMarker"),k.containerState.marker=k.containerState.marker||st,o.check(Tbt,k.interrupt?b:nt,o.attempt(KFn,it,at))}function nt(st){return k.containerState.initialBlankLine=!0,P++,it(st)}function at(st){return Fl(st)?(o.enter("listItemPrefixWhitespace"),o.consume(st),o.exit("listItemPrefixWhitespace"),it):b(st)}function it(st){return k.containerState.size=P+k.sliceSerialize(o.exit("listItemPrefix"),!0).length,h(st)}}function JFn(o,h,b){const k=this;return k.containerState._closeFlow=void 0,o.check(Tbt,O,P);function O(G){return k.containerState.furtherBlankLines=k.containerState.furtherBlankLines||k.containerState.initialBlankLine,af(o,h,"listItemIndent",k.containerState.size+1)(G)}function P(G){return k.containerState.furtherBlankLines||!Fl(G)?(k.containerState.furtherBlankLines=void 0,k.containerState.initialBlankLine=void 0,B(G)):(k.containerState.furtherBlankLines=void 0,k.containerState.initialBlankLine=void 0,o.attempt(VFn,h,B)(G))}function B(G){return k.containerState._closeFlow=!0,k.interrupt=void 0,af(o,o.attempt(q2,h,b),"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G)}}function XFn(o,h,b){const k=this;return af(o,O,"listItemIndent",k.containerState.size+1);function O(P){const B=k.events[k.events.length-1];return B&&B[1].type==="listItemIndent"&&B[2].sliceSerialize(B[1],!0).length===k.containerState.size?h(P):b(P)}}function QFn(o){o.exit(this.containerState.type)}function ZFn(o,h,b){const k=this;return af(o,O,"listItemPrefixWhitespace",k.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function O(P){const B=k.events[k.events.length-1];return!Fl(P)&&B&&B[1].type==="listItemPrefixWhitespace"?h(P):b(P)}}const YCe={name:"setextUnderline",resolveTo:t$n,tokenize:e$n};function t$n(o,h){let b=o.length,k,O,P;for(;b--;)if(o[b][0]==="enter"){if(o[b][1].type==="content"){k=b;break}o[b][1].type==="paragraph"&&(O=b)}else o[b][1].type==="content"&&o.splice(b,1),!P&&o[b][1].type==="definition"&&(P=b);const B={type:"setextHeading",start:{...o[k][1].start},end:{...o[o.length-1][1].end}};return o[O][1].type="setextHeadingText",P?(o.splice(O,0,["enter",B,h]),o.splice(P+1,0,["exit",o[k][1],h]),o[k][1].end={...o[P][1].end}):o[k][1]=B,o.push(["exit",B,h]),o}function e$n(o,h,b){const k=this;let O;return P;function P(U){let nt=k.events.length,at;for(;nt--;)if(k.events[nt][1].type!=="lineEnding"&&k.events[nt][1].type!=="linePrefix"&&k.events[nt][1].type!=="content"){at=k.events[nt][1].type==="paragraph";break}return!k.parser.lazy[k.now().line]&&(k.interrupt||at)?(o.enter("setextHeadingLine"),O=U,B(U)):b(U)}function B(U){return o.enter("setextHeadingLineSequence"),G(U)}function G(U){return U===O?(o.consume(U),G):(o.exit("setextHeadingLineSequence"),Fl(U)?af(o,J,"lineSuffix")(U):J(U))}function J(U){return U===null||Ys(U)?(o.exit("setextHeadingLine"),h(U)):b(U)}}const n$n={tokenize:r$n};function r$n(o){const h=this,b=o.attempt(Tbt,k,o.attempt(this.parser.constructs.flowInitial,O,af(o,o.attempt(this.parser.constructs.flow,O,o.attempt(cFn,O)),"linePrefix")));return b;function k(P){if(P===null){o.consume(P);return}return o.enter("lineEndingBlank"),o.consume(P),o.exit("lineEndingBlank"),h.currentConstruct=void 0,b}function O(P){if(P===null){o.consume(P);return}return o.enter("lineEnding"),o.consume(P),o.exit("lineEnding"),h.currentConstruct=void 0,b}}const i$n={resolveAll:LOe()},a$n=POe("string"),o$n=POe("text");function POe(o){return{resolveAll:LOe(o==="text"?s$n:void 0),tokenize:h};function h(b){const k=this,O=this.parser.constructs[o],P=b.attempt(O,B,G);return B;function B(nt){return U(nt)?P(nt):G(nt)}function G(nt){if(nt===null){b.consume(nt);return}return b.enter("data"),b.consume(nt),J}function J(nt){return U(nt)?(b.exit("data"),P(nt)):(b.consume(nt),J)}function U(nt){if(nt===null)return!0;const at=O[nt];let it=-1;if(at)for(;++it<at.length;){const st=at[it];if(!st.previous||st.previous.call(k,k.previous))return!0}return!1}}}function LOe(o){return h;function h(b,k){let O=-1,P;for(;++O<=b.length;)P===void 0?b[O]&&b[O][1].type==="data"&&(P=O,O++):(!b[O]||b[O][1].type!=="data")&&(O!==P+2&&(b[P][1].end=b[O-1][1].end,b.splice(P+2,O-P-2),O=P+2),P=void 0);return o?o(b,k):b}}function s$n(o,h){let b=0;for(;++b<=o.length;)if((b===o.length||o[b][1].type==="lineEnding")&&o[b-1][1].type==="data"){const k=o[b-1][1],O=h.sliceStream(k);let P=O.length,B=-1,G=0,J;for(;P--;){const U=O[P];if(typeof U=="string"){for(B=U.length;U.charCodeAt(B-1)===32;)G++,B--;if(B)break;B=-1}else if(U===-2)J=!0,G++;else if(U!==-1){P++;break}}if(h._contentTypeTextTrailing&&b===o.length&&(G=0),G){const U={type:b===o.length||J||G<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:P?B:k.start._bufferIndex+B,_index:k.start._index+P,line:k.end.line,column:k.end.column-G,offset:k.end.offset-G},end:{...k.end}};k.end={...U.start},k.start.offset===k.end.offset?Object.assign(k,U):(o.splice(b,0,["enter",U,h],["exit",U,h]),b+=2)}b++}return o}const c$n={42:q2,43:q2,45:q2,48:q2,49:q2,50:q2,51:q2,52:q2,53:q2,54:q2,55:q2,56:q2,57:q2,62:TOe},u$n={91:dFn},l$n={[-2]:mRt,[-1]:mRt,32:mRt},h$n={35:wFn,42:Pmt,45:[YCe,Pmt],60:_Fn,61:YCe,95:Pmt,96:KCe,126:KCe},f$n={38:IOe,92:SOe},d$n={[-5]:bRt,[-4]:bRt,[-3]:bRt,33:HFn,38:IOe,42:NBt,60:[Ujn,OFn],91:UFn,92:[bFn,SOe],93:Kjt,95:NBt,96:nFn},p$n={null:[NBt,i$n]},g$n={null:[42,95]},m$n={null:[]},b$n=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:g$n,contentInitial:u$n,disable:m$n,document:c$n,flow:h$n,flowInitial:l$n,insideSpan:p$n,string:f$n,text:d$n},Symbol.toStringTag,{value:"Module"}));function y$n(o,h,b){let k={_bufferIndex:-1,_index:0,line:b&&b.line||1,column:b&&b.column||1,offset:b&&b.offset||0};const O={},P=[];let B=[],G=[];const J={attempt:Mn(gn),check:Mn(ge),consume:ae,enter:qt,exit:_e,interrupt:Mn(ge,{interrupt:!0})},U={code:null,containerState:{},defineSkip:Et,events:[],now:tt,parser:o,previous:null,sliceSerialize:it,sliceStream:st,write:at};let nt=h.tokenize.call(U,J);return h.resolveAll&&P.push(h),U;function at(bn){return B=y3(B,bn),Lt(),B[B.length-1]!==null?[]:(Wn(h,0),U.events=Wjt(P,U.events,U),U.events)}function it(bn,Vn){return v$n(st(bn),Vn)}function st(bn){return w$n(B,bn)}function tt(){const{_bufferIndex:bn,_index:Vn,line:hi,column:$n,offset:Vt}=k;return{_bufferIndex:bn,_index:Vn,line:hi,column:$n,offset:Vt}}function Et(bn){O[bn.line]=bn.column,ar()}function Lt(){let bn;for(;k._index<B.length;){const Vn=B[k._index];if(typeof Vn=="string")for(bn=k._index,k._bufferIndex<0&&(k._bufferIndex=0);k._index===bn&&k._bufferIndex<Vn.length;)Dt(Vn.charCodeAt(k._bufferIndex));else Dt(Vn)}}function Dt(bn){nt=nt(bn)}function ae(bn){Ys(bn)?(k.line++,k.column=1,k.offset+=bn===-3?2:1,ar()):bn!==-1&&(k.column++,k.offset++),k._bufferIndex<0?k._index++:(k._bufferIndex++,k._bufferIndex===B[k._index].length&&(k._bufferIndex=-1,k._index++)),U.previous=bn}function qt(bn,Vn){const hi=Vn||{};return hi.type=bn,hi.start=tt(),U.events.push(["enter",hi,U]),G.push(hi),hi}function _e(bn){const Vn=G.pop();return Vn.end=tt(),U.events.push(["exit",Vn,U]),Vn}function gn(bn,Vn){Wn(bn,Vn.from)}function ge(bn,Vn){Vn.restore()}function Mn(bn,Vn){return hi;function hi($n,Vt,Ye){let jn,er,rr,Be;return Array.isArray($n)?el($n):"tokenize"in $n?el([$n]):Js($n);function Js(Na){return Bs;function Bs(Du){const lu=Du!==null&&Na[Du],Lo=Du!==null&&Na.null,uc=[...Array.isArray(lu)?lu:lu?[lu]:[],...Array.isArray(Lo)?Lo:Lo?[Lo]:[]];return el(uc)(Du)}}function el(Na){return jn=Na,er=0,Na.length===0?Ye:Je(Na[er])}function Je(Na){return Bs;function Bs(Du){return Be=cr(),rr=Na,Na.partial||(U.currentConstruct=Na),Na.name&&U.parser.constructs.disable.null.includes(Na.name)?_o():Na.tokenize.call(Vn?Object.assign(Object.create(U),Vn):U,J,Xs,_o)(Du)}}function Xs(Na){return bn(rr,Be),Vt}function _o(Na){return Be.restore(),++er<jn.length?Je(jn[er]):Ye}}}function Wn(bn,Vn){bn.resolveAll&&!P.includes(bn)&&P.push(bn),bn.resolve&&g6(U.events,Vn,U.events.length-Vn,bn.resolve(U.events.slice(Vn),U)),bn.resolveTo&&(U.events=bn.resolveTo(U.events,U))}function cr(){const bn=tt(),Vn=U.previous,hi=U.currentConstruct,$n=U.events.length,Vt=Array.from(G);return{from:$n,restore:Ye};function Ye(){k=bn,U.previous=Vn,U.currentConstruct=hi,U.events.length=$n,G=Vt,ar()}}function ar(){k.line in O&&k.column<2&&(k.column=O[k.line],k.offset+=O[k.line]-1)}}function w$n(o,h){const b=h.start._index,k=h.start._bufferIndex,O=h.end._index,P=h.end._bufferIndex;let B;if(b===O)B=[o[b].slice(k,P)];else{if(B=o.slice(b,O),k>-1){const G=B[0];typeof G=="string"?B[0]=G.slice(k):B.shift()}P>0&&B.push(o[O].slice(0,P))}return B}function v$n(o,h){let b=-1;const k=[];let O;for(;++b<o.length;){const P=o[b];let B;if(typeof P=="string")B=P;else switch(P){case-5:{B="\r";break}case-4:{B=`
3217
+ `);super({baseURL:B.baseURL,timeout:B.timeout??6e5,httpAgent:B.httpAgent,maxRetries:B.maxRetries,fetch:B.fetch}),this.completions=new G9e(this),this.chat=new mbt(this),this.embeddings=new q9e(this),this.files=new kjt(this),this.images=new W9e(this),this.audio=new MX(this),this.moderations=new K9e(this),this.models=new Cjt(this),this.fineTuning=new BX(this),this.vectorStores=new eC(this),this.beta=new Kj(this),this.batches=new ljt(this),this.uploads=new Pjt(this),this.responses=new Njt(this),this._options=B,this.apiKey=b,this.organization=k,this.project=O}defaultQuery(){return this._options.defaultQuery}defaultHeaders(h){return{...super.defaultHeaders(h),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project,...this._options.defaultHeaders}}authHeaders(h){return{Authorization:`Bearer ${this.apiKey}`}}stringifyQuery(h){return IDn(h,{arrayFormat:"brackets"})}}Z9e=ku;ku.OpenAI=Z9e;ku.DEFAULT_TIMEOUT=6e5;ku.OpenAIError=Cs;ku.APIError=Ig;ku.APIConnectionError=lbt;ku.APIConnectionTimeoutError=cjt;ku.APIUserAbortError=x3;ku.NotFoundError=e9e;ku.ConflictError=n9e;ku.RateLimitError=i9e;ku.BadRequestError=Q7e;ku.AuthenticationError=Z7e;ku.InternalServerError=a9e;ku.PermissionDeniedError=t9e;ku.UnprocessableEntityError=r9e;ku.toFile=h9e;ku.fileFromPath=Y7e;ku.Completions=G9e;ku.Chat=mbt;ku.ChatCompletionsPage=gbt;ku.Embeddings=q9e;ku.Files=kjt;ku.FileObjectsPage=_jt;ku.Images=W9e;ku.Audio=MX;ku.Moderations=K9e;ku.Models=Cjt;ku.ModelsPage=Ajt;ku.FineTuning=BX;ku.VectorStores=eC;ku.VectorStoresPage=Mjt;ku.VectorStoreSearchResponsesPage=Djt;ku.Beta=Kj;ku.Batches=ljt;ku.BatchesPage=hjt;ku.Uploads=Pjt;ku.Responses=Njt;const wCe=K5(pe.jsx("path",{d:"M3 4V1h2v3h3v2H5v3H3V6H0V4zm3 6V7h3V4h7l1.83 2H21c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V10zm7 9c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5m-3.2-5c0 1.77 1.43 3.2 3.2 3.2s3.2-1.43 3.2-3.2-1.43-3.2-3.2-3.2-3.2 1.43-3.2 3.2"}),"AddAPhoto"),TRn=K5([pe.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),pe.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong"),SRn=K5(pe.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send");function IRn(o,h){if(o.match(/^[a-z]+:\/\//i))return o;if(o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i))return o;const b=document.implementation.createHTMLDocument(),k=b.createElement("base"),O=b.createElement("a");return b.head.appendChild(k),b.body.appendChild(O),h&&(k.href=h),O.href=o,O.href}const CRn=(()=>{let o=0;const h=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(o+=1,`u${h()}${o}`)})();function J8(o){const h=[];for(let b=0,k=o.length;b<k;b++)h.push(o[b]);return h}let bj=null;function tOe(o={}){return bj||(o.includeStyleProperties?(bj=o.includeStyleProperties,bj):(bj=J8(window.getComputedStyle(document.documentElement)),bj))}function Kmt(o,h){const k=(o.ownerDocument.defaultView||window).getComputedStyle(o).getPropertyValue(h);return k?parseFloat(k.replace("px","")):0}function ARn(o){const h=Kmt(o,"border-left-width"),b=Kmt(o,"border-right-width");return o.clientWidth+h+b}function ORn(o){const h=Kmt(o,"border-top-width"),b=Kmt(o,"border-bottom-width");return o.clientHeight+h+b}function eOe(o,h={}){const b=h.width||ARn(o),k=h.height||ORn(o);return{width:b,height:k}}function NRn(){let o,h;try{h=process}catch{}const b=h&&h.env?h.env.devicePixelRatio:null;return b&&(o=parseInt(b,10),Number.isNaN(o)&&(o=1)),o||window.devicePixelRatio||1}const pw=16384;function PRn(o){(o.width>pw||o.height>pw)&&(o.width>pw&&o.height>pw?o.width>o.height?(o.height*=pw/o.width,o.width=pw):(o.width*=pw/o.height,o.height=pw):o.width>pw?(o.height*=pw/o.width,o.width=pw):(o.width*=pw/o.height,o.height=pw))}function Vmt(o){return new Promise((h,b)=>{const k=new Image;k.onload=()=>{k.decode().then(()=>{requestAnimationFrame(()=>h(k))})},k.onerror=b,k.crossOrigin="anonymous",k.decoding="async",k.src=o})}async function LRn(o){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(o)).then(encodeURIComponent).then(h=>`data:image/svg+xml;charset=utf-8,${h}`)}async function MRn(o,h,b){const k="http://www.w3.org/2000/svg",O=document.createElementNS(k,"svg"),P=document.createElementNS(k,"foreignObject");return O.setAttribute("width",`${h}`),O.setAttribute("height",`${b}`),O.setAttribute("viewBox",`0 0 ${h} ${b}`),P.setAttribute("width","100%"),P.setAttribute("height","100%"),P.setAttribute("x","0"),P.setAttribute("y","0"),P.setAttribute("externalResourcesRequired","true"),O.appendChild(P),P.appendChild(o),LRn(O)}const W2=(o,h)=>{if(o instanceof h)return!0;const b=Object.getPrototypeOf(o);return b===null?!1:b.constructor.name===h.name||W2(b,h)};function DRn(o){const h=o.getPropertyValue("content");return`${o.cssText} content: '${h.replace(/'|"/g,"")}';`}function RRn(o,h){return tOe(h).map(b=>{const k=o.getPropertyValue(b),O=o.getPropertyPriority(b);return`${b}: ${k}${O?" !important":""};`}).join(" ")}function BRn(o,h,b,k){const O=`.${o}:${h}`,P=b.cssText?DRn(b):RRn(b,k);return document.createTextNode(`${O}{${P}}`)}function vCe(o,h,b,k){const O=window.getComputedStyle(o,b),P=O.getPropertyValue("content");if(P===""||P==="none")return;const B=CRn();try{h.className=`${h.className} ${B}`}catch{return}const G=document.createElement("style");G.appendChild(BRn(B,b,O,k)),h.appendChild(G)}function jRn(o,h,b){vCe(o,h,":before",b),vCe(o,h,":after",b)}const xCe="application/font-woff",kCe="image/jpeg",FRn={woff:xCe,woff2:xCe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:kCe,jpeg:kCe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function $Rn(o){const h=/\.([^./]*?)$/g.exec(o);return h?h[1]:""}function Rjt(o){const h=$Rn(o).toLowerCase();return FRn[h]||""}function HRn(o){return o.split(/,/)[1]}function TBt(o){return o.search(/^(data:)/)!==-1}function zRn(o,h){return`data:${h};base64,${o}`}async function nOe(o,h,b){const k=await fetch(o,h);if(k.status===404)throw new Error(`Resource "${k.url}" not found`);const O=await k.blob();return new Promise((P,B)=>{const G=new FileReader;G.onerror=B,G.onloadend=()=>{try{P(b({res:k,result:G.result}))}catch(J){B(J)}},G.readAsDataURL(O)})}const dRt={};function URn(o,h,b){let k=o.replace(/\?.*/,"");return b&&(k=o),/ttf|otf|eot|woff2?/i.test(k)&&(k=k.replace(/.*\//,"")),h?`[${h}]${k}`:k}async function Bjt(o,h,b){const k=URn(o,h,b.includeQueryParams);if(dRt[k]!=null)return dRt[k];b.cacheBust&&(o+=(/\?/.test(o)?"&":"?")+new Date().getTime());let O;try{const P=await nOe(o,b.fetchRequestInit,({res:B,result:G})=>(h||(h=B.headers.get("Content-Type")||""),HRn(G)));O=zRn(P,h)}catch(P){O=b.imagePlaceholder||"";let B=`Failed to fetch resource: ${o}`;P&&(B=typeof P=="string"?P:P.message),B&&console.warn(B)}return dRt[k]=O,O}async function GRn(o){const h=o.toDataURL();return h==="data:,"?o.cloneNode(!1):Vmt(h)}async function qRn(o,h){if(o.currentSrc){const P=document.createElement("canvas"),B=P.getContext("2d");P.width=o.clientWidth,P.height=o.clientHeight,B==null||B.drawImage(o,0,0,P.width,P.height);const G=P.toDataURL();return Vmt(G)}const b=o.poster,k=Rjt(b),O=await Bjt(b,k,h);return Vmt(O)}async function WRn(o,h){var b;try{if(!((b=o==null?void 0:o.contentDocument)===null||b===void 0)&&b.body)return await vbt(o.contentDocument.body,h,!0)}catch{}return o.cloneNode(!1)}async function KRn(o,h){return W2(o,HTMLCanvasElement)?GRn(o):W2(o,HTMLVideoElement)?qRn(o,h):W2(o,HTMLIFrameElement)?WRn(o,h):o.cloneNode(rOe(o))}const VRn=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SLOT",rOe=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SVG";async function YRn(o,h,b){var k,O;if(rOe(h))return h;let P=[];return VRn(o)&&o.assignedNodes?P=J8(o.assignedNodes()):W2(o,HTMLIFrameElement)&&(!((k=o.contentDocument)===null||k===void 0)&&k.body)?P=J8(o.contentDocument.body.childNodes):P=J8(((O=o.shadowRoot)!==null&&O!==void 0?O:o).childNodes),P.length===0||W2(o,HTMLVideoElement)||await P.reduce((B,G)=>B.then(()=>vbt(G,b)).then(J=>{J&&h.appendChild(J)}),Promise.resolve()),h}function JRn(o,h,b){const k=h.style;if(!k)return;const O=window.getComputedStyle(o);O.cssText?(k.cssText=O.cssText,k.transformOrigin=O.transformOrigin):tOe(b).forEach(P=>{let B=O.getPropertyValue(P);P==="font-size"&&B.endsWith("px")&&(B=`${Math.floor(parseFloat(B.substring(0,B.length-2)))-.1}px`),W2(o,HTMLIFrameElement)&&P==="display"&&B==="inline"&&(B="block"),P==="d"&&h.getAttribute("d")&&(B=`path(${h.getAttribute("d")})`),k.setProperty(P,B,O.getPropertyPriority(P))})}function XRn(o,h){W2(o,HTMLTextAreaElement)&&(h.innerHTML=o.value),W2(o,HTMLInputElement)&&h.setAttribute("value",o.value)}function QRn(o,h){if(W2(o,HTMLSelectElement)){const b=h,k=Array.from(b.children).find(O=>o.value===O.getAttribute("value"));k&&k.setAttribute("selected","")}}function ZRn(o,h,b){return W2(h,Element)&&(JRn(o,h,b),jRn(o,h,b),XRn(o,h),QRn(o,h)),h}async function tBn(o,h){const b=o.querySelectorAll?o.querySelectorAll("use"):[];if(b.length===0)return o;const k={};for(let P=0;P<b.length;P++){const G=b[P].getAttribute("xlink:href");if(G){const J=o.querySelector(G),U=document.querySelector(G);!J&&U&&!k[G]&&(k[G]=await vbt(U,h,!0))}}const O=Object.values(k);if(O.length){const P="http://www.w3.org/1999/xhtml",B=document.createElementNS(P,"svg");B.setAttribute("xmlns",P),B.style.position="absolute",B.style.width="0",B.style.height="0",B.style.overflow="hidden",B.style.display="none";const G=document.createElementNS(P,"defs");B.appendChild(G);for(let J=0;J<O.length;J++)G.appendChild(O[J]);o.appendChild(B)}return o}async function vbt(o,h,b){return!b&&h.filter&&!h.filter(o)?null:Promise.resolve(o).then(k=>KRn(k,h)).then(k=>YRn(o,k,h)).then(k=>ZRn(o,k,h)).then(k=>tBn(k,h))}const iOe=/url\((['"]?)([^'"]+?)\1\)/g,eBn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,nBn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function rBn(o){const h=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${h})(['"]?\\))`,"g")}function iBn(o){const h=[];return o.replace(iOe,(b,k,O)=>(h.push(O),b)),h.filter(b=>!TBt(b))}async function aBn(o,h,b,k,O){try{const P=b?IRn(h,b):h,B=Rjt(h);let G;return O||(G=await Bjt(P,B,k)),o.replace(rBn(h),`$1${G}$3`)}catch{}return o}function oBn(o,{preferredFontFormat:h}){return h?o.replace(nBn,b=>{for(;;){const[k,,O]=eBn.exec(b)||[];if(!O)return"";if(O===h)return`src: ${k};`}}):o}function aOe(o){return o.search(iOe)!==-1}async function oOe(o,h,b){if(!aOe(o))return o;const k=oBn(o,b);return iBn(k).reduce((P,B)=>P.then(G=>aBn(G,B,h,b)),Promise.resolve(k))}async function yj(o,h,b){var k;const O=(k=h.style)===null||k===void 0?void 0:k.getPropertyValue(o);if(O){const P=await oOe(O,null,b);return h.style.setProperty(o,P,h.style.getPropertyPriority(o)),!0}return!1}async function sBn(o,h){await yj("background",o,h)||await yj("background-image",o,h),await yj("mask",o,h)||await yj("-webkit-mask",o,h)||await yj("mask-image",o,h)||await yj("-webkit-mask-image",o,h)}async function cBn(o,h){const b=W2(o,HTMLImageElement);if(!(b&&!TBt(o.src))&&!(W2(o,SVGImageElement)&&!TBt(o.href.baseVal)))return;const k=b?o.src:o.href.baseVal,O=await Bjt(k,Rjt(k),h);await new Promise((P,B)=>{o.onload=P,o.onerror=h.onImageErrorHandler?(...J)=>{try{P(h.onImageErrorHandler(...J))}catch(U){B(U)}}:B;const G=o;G.decode&&(G.decode=P),G.loading==="lazy"&&(G.loading="eager"),b?(o.srcset="",o.src=O):o.href.baseVal=O})}async function uBn(o,h){const k=J8(o.childNodes).map(O=>sOe(O,h));await Promise.all(k).then(()=>o)}async function sOe(o,h){W2(o,Element)&&(await sBn(o,h),await cBn(o,h),await uBn(o,h))}function lBn(o,h){const{style:b}=o;h.backgroundColor&&(b.backgroundColor=h.backgroundColor),h.width&&(b.width=`${h.width}px`),h.height&&(b.height=`${h.height}px`);const k=h.style;return k!=null&&Object.keys(k).forEach(O=>{b[O]=k[O]}),o}const _Ce={};async function ECe(o){let h=_Ce[o];if(h!=null)return h;const k=await(await fetch(o)).text();return h={url:o,cssText:k},_Ce[o]=h,h}async function TCe(o,h){let b=o.cssText;const k=/url\(["']?([^"')]+)["']?\)/g,P=(b.match(/url\([^)]+\)/g)||[]).map(async B=>{let G=B.replace(k,"$1");return G.startsWith("https://")||(G=new URL(G,o.url).href),nOe(G,h.fetchRequestInit,({result:J})=>(b=b.replace(B,`url(${J})`),[B,J]))});return Promise.all(P).then(()=>b)}function SCe(o){if(o==null)return[];const h=[],b=/(\/\*[\s\S]*?\*\/)/gi;let k=o.replace(b,"");const O=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const J=O.exec(k);if(J===null)break;h.push(J[0])}k=k.replace(O,"");const P=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,B="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",G=new RegExp(B,"gi");for(;;){let J=P.exec(k);if(J===null){if(J=G.exec(k),J===null)break;P.lastIndex=G.lastIndex}else G.lastIndex=P.lastIndex;h.push(J[0])}return h}async function hBn(o,h){const b=[],k=[];return o.forEach(O=>{if("cssRules"in O)try{J8(O.cssRules||[]).forEach((P,B)=>{if(P.type===CSSRule.IMPORT_RULE){let G=B+1;const J=P.href,U=ECe(J).then(nt=>TCe(nt,h)).then(nt=>SCe(nt).forEach(at=>{try{O.insertRule(at,at.startsWith("@import")?G+=1:O.cssRules.length)}catch(it){console.error("Error inserting rule from remote css",{rule:at,error:it})}})).catch(nt=>{console.error("Error loading remote css",nt.toString())});k.push(U)}})}catch(P){const B=o.find(G=>G.href==null)||document.styleSheets[0];O.href!=null&&k.push(ECe(O.href).then(G=>TCe(G,h)).then(G=>SCe(G).forEach(J=>{B.insertRule(J,B.cssRules.length)})).catch(G=>{console.error("Error loading remote stylesheet",G)})),console.error("Error inlining remote css file",P)}}),Promise.all(k).then(()=>(o.forEach(O=>{if("cssRules"in O)try{J8(O.cssRules||[]).forEach(P=>{b.push(P)})}catch(P){console.error(`Error while reading CSS rules from ${O.href}`,P)}}),b))}function fBn(o){return o.filter(h=>h.type===CSSRule.FONT_FACE_RULE).filter(h=>aOe(h.style.getPropertyValue("src")))}async function dBn(o,h){if(o.ownerDocument==null)throw new Error("Provided element is not within a Document");const b=J8(o.ownerDocument.styleSheets),k=await hBn(b,h);return fBn(k)}function cOe(o){return o.trim().replace(/["']/g,"")}function pBn(o){const h=new Set;function b(k){(k.style.fontFamily||getComputedStyle(k).fontFamily).split(",").forEach(P=>{h.add(cOe(P))}),Array.from(k.children).forEach(P=>{P instanceof HTMLElement&&b(P)})}return b(o),h}async function gBn(o,h){const b=await dBn(o,h),k=pBn(o);return(await Promise.all(b.filter(P=>k.has(cOe(P.style.fontFamily))).map(P=>{const B=P.parentStyleSheet?P.parentStyleSheet.href:null;return oOe(P.cssText,B,h)}))).join(`
3218
+ `)}async function mBn(o,h){const b=h.fontEmbedCSS!=null?h.fontEmbedCSS:h.skipFonts?null:await gBn(o,h);if(b){const k=document.createElement("style"),O=document.createTextNode(b);k.appendChild(O),o.firstChild?o.insertBefore(k,o.firstChild):o.appendChild(k)}}async function bBn(o,h={}){const{width:b,height:k}=eOe(o,h),O=await vbt(o,h,!0);return await mBn(O,h),await sOe(O,h),lBn(O,h),await MRn(O,b,k)}async function yBn(o,h={}){const{width:b,height:k}=eOe(o,h),O=await bBn(o,h),P=await Vmt(O),B=document.createElement("canvas"),G=B.getContext("2d"),J=h.pixelRatio||NRn(),U=h.canvasWidth||b,nt=h.canvasHeight||k;return B.width=U*J,B.height=nt*J,h.skipAutoScale||PRn(B),B.style.width=`${U}`,B.style.height=`${nt}`,h.backgroundColor&&(G.fillStyle=h.backgroundColor,G.fillRect(0,0,B.width,B.height)),G.drawImage(P,0,0,B.width,B.height),B}async function wBn(o,h={}){return(await yBn(o,h)).toDataURL()}const uOe=K5(pe.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");function ICe(o){const h=[],b=String(o||"");let k=b.indexOf(","),O=0,P=!1;for(;!P;){k===-1&&(k=b.length,P=!0);const B=b.slice(O,k).trim();(B||!P)&&h.push(B),O=k+1,k=b.indexOf(",",O)}return h}function jjt(o,h){const b=h||{};return(o[o.length-1]===""?[...o,""]:o).join((b.padRight?" ":"")+","+(b.padLeft===!1?"":" ")).trim()}const vBn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xBn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kBn={};function CCe(o,h){return(kBn.jsx?xBn:vBn).test(o)}const _Bn=/[ \t\n\f\r]/g;function xbt(o){return typeof o=="object"?o.type==="text"?ACe(o.value):!1:ACe(o)}function ACe(o){return o.replace(_Bn,"")===""}let jX=class{constructor(h,b,k){this.normal=b,this.property=h,k&&(this.space=k)}};jX.prototype.normal={};jX.prototype.property={};jX.prototype.space=void 0;function lOe(o,h){const b={},k={};for(const O of o)Object.assign(b,O.property),Object.assign(k,O.normal);return new jX(b,k,h)}function IX(o){return o.toLowerCase()}let J2=class{constructor(h,b){this.attribute=b,this.property=h}};J2.prototype.attribute="";J2.prototype.booleanish=!1;J2.prototype.boolean=!1;J2.prototype.commaOrSpaceSeparated=!1;J2.prototype.commaSeparated=!1;J2.prototype.defined=!1;J2.prototype.mustUseProperty=!1;J2.prototype.number=!1;J2.prototype.overloadedBoolean=!1;J2.prototype.property="";J2.prototype.spaceSeparated=!1;J2.prototype.space=void 0;let EBn=0;const Mc=rP(),ap=rP(),hOe=rP(),ua=rP(),nf=rP(),Oj=rP(),mw=rP();function rP(){return 2**++EBn}const SBt=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mc,booleanish:ap,commaOrSpaceSeparated:mw,commaSeparated:Oj,number:ua,overloadedBoolean:hOe,spaceSeparated:nf},Symbol.toStringTag,{value:"Module"})),pRt=Object.keys(SBt);let Fjt=class extends J2{constructor(h,b,k,O){let P=-1;if(super(h,b),OCe(this,"space",O),typeof k=="number")for(;++P<pRt.length;){const B=pRt[P];OCe(this,pRt[P],(k&SBt[B])===SBt[B])}}};Fjt.prototype.defined=!0;function OCe(o,h,b){b&&(o[h]=b)}function Yj(o){const h={},b={};for(const[k,O]of Object.entries(o.properties)){const P=new Fjt(k,o.transform(o.attributes||{},k),O,o.space);o.mustUseProperty&&o.mustUseProperty.includes(k)&&(P.mustUseProperty=!0),h[k]=P,b[IX(k)]=k,b[IX(P.attribute)]=k}return new jX(h,b,o.space)}const fOe=Yj({properties:{ariaActiveDescendant:null,ariaAtomic:ap,ariaAutoComplete:null,ariaBusy:ap,ariaChecked:ap,ariaColCount:ua,ariaColIndex:ua,ariaColSpan:ua,ariaControls:nf,ariaCurrent:null,ariaDescribedBy:nf,ariaDetails:null,ariaDisabled:ap,ariaDropEffect:nf,ariaErrorMessage:null,ariaExpanded:ap,ariaFlowTo:nf,ariaGrabbed:ap,ariaHasPopup:null,ariaHidden:ap,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nf,ariaLevel:ua,ariaLive:null,ariaModal:ap,ariaMultiLine:ap,ariaMultiSelectable:ap,ariaOrientation:null,ariaOwns:nf,ariaPlaceholder:null,ariaPosInSet:ua,ariaPressed:ap,ariaReadOnly:ap,ariaRelevant:null,ariaRequired:ap,ariaRoleDescription:nf,ariaRowCount:ua,ariaRowIndex:ua,ariaRowSpan:ua,ariaSelected:ap,ariaSetSize:ua,ariaSort:null,ariaValueMax:ua,ariaValueMin:ua,ariaValueNow:ua,ariaValueText:null,role:null},transform(o,h){return h==="role"?h:"aria-"+h.slice(4).toLowerCase()}});function dOe(o,h){return h in o?o[h]:h}function pOe(o,h){return dOe(o,h.toLowerCase())}const TBn=Yj({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oj,acceptCharset:nf,accessKey:nf,action:null,allow:null,allowFullScreen:Mc,allowPaymentRequest:Mc,allowUserMedia:Mc,alt:null,as:null,async:Mc,autoCapitalize:null,autoComplete:nf,autoFocus:Mc,autoPlay:Mc,blocking:nf,capture:null,charSet:null,checked:Mc,cite:null,className:nf,cols:ua,colSpan:null,content:null,contentEditable:ap,controls:Mc,controlsList:nf,coords:ua|Oj,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mc,defer:Mc,dir:null,dirName:null,disabled:Mc,download:hOe,draggable:ap,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mc,formTarget:null,headers:nf,height:ua,hidden:Mc,high:ua,href:null,hrefLang:null,htmlFor:nf,httpEquiv:nf,id:null,imageSizes:null,imageSrcSet:null,inert:Mc,inputMode:null,integrity:null,is:null,isMap:Mc,itemId:null,itemProp:nf,itemRef:nf,itemScope:Mc,itemType:nf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mc,low:ua,manifest:null,max:null,maxLength:ua,media:null,method:null,min:null,minLength:ua,multiple:Mc,muted:Mc,name:null,nonce:null,noModule:Mc,noValidate:Mc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Mc,optimum:ua,pattern:null,ping:nf,placeholder:null,playsInline:Mc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mc,referrerPolicy:null,rel:nf,required:Mc,reversed:Mc,rows:ua,rowSpan:ua,sandbox:nf,scope:null,scoped:Mc,seamless:Mc,selected:Mc,shadowRootClonable:Mc,shadowRootDelegatesFocus:Mc,shadowRootMode:null,shape:null,size:ua,sizes:null,slot:null,span:ua,spellCheck:ap,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ua,step:null,style:null,tabIndex:ua,target:null,title:null,translate:null,type:null,typeMustMatch:Mc,useMap:null,value:ap,width:ua,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nf,axis:null,background:null,bgColor:null,border:ua,borderColor:null,bottomMargin:ua,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mc,declare:Mc,event:null,face:null,frame:null,frameBorder:null,hSpace:ua,leftMargin:ua,link:null,longDesc:null,lowSrc:null,marginHeight:ua,marginWidth:ua,noResize:Mc,noHref:Mc,noShade:Mc,noWrap:Mc,object:null,profile:null,prompt:null,rev:null,rightMargin:ua,rules:null,scheme:null,scrolling:ap,standby:null,summary:null,text:null,topMargin:ua,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ua,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mc,disableRemotePlayback:Mc,prefix:null,property:null,results:ua,security:null,unselectable:null},space:"html",transform:pOe}),SBn=Yj({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mw,accentHeight:ua,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ua,amplitude:ua,arabicForm:null,ascent:ua,attributeName:null,attributeType:null,azimuth:ua,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ua,by:null,calcMode:null,capHeight:ua,className:nf,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ua,diffuseConstant:ua,direction:null,display:null,dur:null,divisor:ua,dominantBaseline:null,download:Mc,dx:null,dy:null,edgeMode:null,editable:null,elevation:ua,enableBackground:null,end:null,event:null,exponent:ua,externalResourcesRequired:null,fill:null,fillOpacity:ua,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Oj,g2:Oj,glyphName:Oj,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ua,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ua,horizOriginX:ua,horizOriginY:ua,id:null,ideographic:ua,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ua,k:ua,k1:ua,k2:ua,k3:ua,k4:ua,kernelMatrix:mw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ua,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ua,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ua,overlineThickness:ua,paintOrder:null,panose1:null,path:null,pathLength:ua,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ua,pointsAtY:ua,pointsAtZ:ua,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mw,rev:mw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mw,requiredFeatures:mw,requiredFonts:mw,requiredFormats:mw,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ua,specularExponent:ua,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ua,strikethroughThickness:ua,string:null,stroke:null,strokeDashArray:mw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ua,strokeOpacity:ua,strokeWidth:null,style:null,surfaceScale:ua,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mw,tabIndex:ua,tableValues:null,target:null,targetX:ua,targetY:ua,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ua,underlineThickness:ua,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ua,values:null,vAlphabetic:ua,vMathematical:ua,vectorEffect:null,vHanging:ua,vIdeographic:ua,version:null,vertAdvY:ua,vertOriginX:ua,vertOriginY:ua,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ua,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dOe}),gOe=Yj({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(o,h){return"xlink:"+h.slice(5).toLowerCase()}}),mOe=Yj({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pOe}),bOe=Yj({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(o,h){return"xml:"+h.slice(3).toLowerCase()}}),IBn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},CBn=/[A-Z]/g,NCe=/-[a-z]/g,ABn=/^data[-\w.:]+$/i;function kbt(o,h){const b=IX(h);let k=h,O=J2;if(b in o.normal)return o.property[o.normal[b]];if(b.length>4&&b.slice(0,4)==="data"&&ABn.test(h)){if(h.charAt(4)==="-"){const P=h.slice(5).replace(NCe,NBn);k="data"+P.charAt(0).toUpperCase()+P.slice(1)}else{const P=h.slice(4);if(!NCe.test(P)){let B=P.replace(CBn,OBn);B.charAt(0)!=="-"&&(B="-"+B),h="data"+B}}O=Fjt}return new O(k,h)}function OBn(o){return"-"+o.toLowerCase()}function NBn(o){return o.charAt(1).toUpperCase()}const FX=lOe([fOe,TBn,gOe,mOe,bOe],"html"),nC=lOe([fOe,SBn,gOe,mOe,bOe],"svg");function PCe(o){const h=String(o||"").trim();return h?h.split(/[ \t\n\r\f]+/g):[]}function $jt(o){return o.join(" ").trim()}var Hjt={},LCe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,PBn=/\n/g,LBn=/^\s*/,MBn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,DBn=/^:\s*/,RBn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,BBn=/^[;\s]*/,jBn=/^\s+|\s+$/g,FBn=`
3219
+ `,MCe="/",DCe="*",zN="",$Bn="comment",HBn="declaration",zBn=function(o,h){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];h=h||{};var b=1,k=1;function O(tt){var Et=tt.match(PBn);Et&&(b+=Et.length);var Lt=tt.lastIndexOf(FBn);k=~Lt?tt.length-Lt:k+tt.length}function P(){var tt={line:b,column:k};return function(Et){return Et.position=new B(tt),U(),Et}}function B(tt){this.start=tt,this.end={line:b,column:k},this.source=h.source}B.prototype.content=o;function G(tt){var Et=new Error(h.source+":"+b+":"+k+": "+tt);if(Et.reason=tt,Et.filename=h.source,Et.line=b,Et.column=k,Et.source=o,!h.silent)throw Et}function J(tt){var Et=tt.exec(o);if(Et){var Lt=Et[0];return O(Lt),o=o.slice(Lt.length),Et}}function U(){J(LBn)}function nt(tt){var Et;for(tt=tt||[];Et=at();)Et!==!1&&tt.push(Et);return tt}function at(){var tt=P();if(!(MCe!=o.charAt(0)||DCe!=o.charAt(1))){for(var Et=2;zN!=o.charAt(Et)&&(DCe!=o.charAt(Et)||MCe!=o.charAt(Et+1));)++Et;if(Et+=2,zN===o.charAt(Et-1))return G("End of comment missing");var Lt=o.slice(2,Et-2);return k+=2,O(Lt),o=o.slice(Et),k+=2,tt({type:$Bn,comment:Lt})}}function it(){var tt=P(),Et=J(MBn);if(Et){if(at(),!J(DBn))return G("property missing ':'");var Lt=J(RBn),Dt=tt({type:HBn,property:RCe(Et[0].replace(LCe,zN)),value:Lt?RCe(Lt[0].replace(LCe,zN)):zN});return J(BBn),Dt}}function st(){var tt=[];nt(tt);for(var Et;Et=it();)Et!==!1&&(tt.push(Et),nt(tt));return tt}return U(),st()};function RCe(o){return o?o.replace(jBn,zN):zN}var UBn=ww&&ww.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Hjt,"__esModule",{value:!0});Hjt.default=qBn;var GBn=UBn(zBn);function qBn(o,h){var b=null;if(!o||typeof o!="string")return b;var k=(0,GBn.default)(o),O=typeof h=="function";return k.forEach(function(P){if(P.type==="declaration"){var B=P.property,G=P.value;O?h(B,G,P):G&&(b=b||{},b[B]=G)}}),b}var _bt={};Object.defineProperty(_bt,"__esModule",{value:!0});_bt.camelCase=void 0;var WBn=/^--[a-zA-Z0-9_-]+$/,KBn=/-([a-z])/g,VBn=/^[^-]+$/,YBn=/^-(webkit|moz|ms|o|khtml)-/,JBn=/^-(ms)-/,XBn=function(o){return!o||VBn.test(o)||WBn.test(o)},QBn=function(o,h){return h.toUpperCase()},BCe=function(o,h){return"".concat(h,"-")},ZBn=function(o,h){return h===void 0&&(h={}),XBn(o)?o:(o=o.toLowerCase(),h.reactCompat?o=o.replace(JBn,BCe):o=o.replace(YBn,BCe),o.replace(KBn,QBn))};_bt.camelCase=ZBn;var tjn=ww&&ww.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},ejn=tjn(Hjt),njn=_bt;function IBt(o,h){var b={};return!o||typeof o!="string"||(0,ejn.default)(o,function(k,O){k&&O&&(b[(0,njn.camelCase)(k,h)]=O)}),b}IBt.default=IBt;var rjn=IBt;const ijn=e7e(rjn),Ebt=yOe("end"),b6=yOe("start");function yOe(o){return h;function h(b){const k=b&&b.position&&b.position[o]||{};if(typeof k.line=="number"&&k.line>0&&typeof k.column=="number"&&k.column>0)return{line:k.line,column:k.column,offset:typeof k.offset=="number"&&k.offset>-1?k.offset:void 0}}}function ajn(o){const h=b6(o),b=Ebt(o);if(h&&b)return{start:h,end:b}}function dX(o){return!o||typeof o!="object"?"":"position"in o||"type"in o?jCe(o.position):"start"in o||"end"in o?jCe(o):"line"in o||"column"in o?CBt(o):""}function CBt(o){return FCe(o&&o.line)+":"+FCe(o&&o.column)}function jCe(o){return CBt(o&&o.start)+"-"+CBt(o&&o.end)}function FCe(o){return o&&typeof o=="number"?o:1}class wm extends Error{constructor(h,b,k){super(),typeof b=="string"&&(k=b,b=void 0);let O="",P={},B=!1;if(b&&("line"in b&&"column"in b?P={place:b}:"start"in b&&"end"in b?P={place:b}:"type"in b?P={ancestors:[b],place:b.position}:P={...b}),typeof h=="string"?O=h:!P.cause&&h&&(B=!0,O=h.message,P.cause=h),!P.ruleId&&!P.source&&typeof k=="string"){const J=k.indexOf(":");J===-1?P.ruleId=k:(P.source=k.slice(0,J),P.ruleId=k.slice(J+1))}if(!P.place&&P.ancestors&&P.ancestors){const J=P.ancestors[P.ancestors.length-1];J&&(P.place=J.position)}const G=P.place&&"start"in P.place?P.place.start:P.place;this.ancestors=P.ancestors||void 0,this.cause=P.cause||void 0,this.column=G?G.column:void 0,this.fatal=void 0,this.file,this.message=O,this.line=G?G.line:void 0,this.name=dX(P.place)||"1:1",this.place=P.place||void 0,this.reason=this.message,this.ruleId=P.ruleId||void 0,this.source=P.source||void 0,this.stack=B&&P.cause&&typeof P.cause.stack=="string"?P.cause.stack:"",this.actual,this.expected,this.note,this.url}}wm.prototype.file="";wm.prototype.name="";wm.prototype.reason="";wm.prototype.message="";wm.prototype.stack="";wm.prototype.column=void 0;wm.prototype.line=void 0;wm.prototype.ancestors=void 0;wm.prototype.cause=void 0;wm.prototype.fatal=void 0;wm.prototype.place=void 0;wm.prototype.ruleId=void 0;wm.prototype.source=void 0;const zjt={}.hasOwnProperty,ojn=new Map,sjn=/[A-Z]/g,cjn=new Set(["table","tbody","thead","tfoot","tr"]),ujn=new Set(["td","th"]),wOe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ljn(o,h){if(!h||h.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const b=h.filePath||void 0;let k;if(h.development){if(typeof h.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");k=yjn(b,h.jsxDEV)}else{if(typeof h.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof h.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");k=bjn(b,h.jsx,h.jsxs)}const O={Fragment:h.Fragment,ancestors:[],components:h.components||{},create:k,elementAttributeNameCase:h.elementAttributeNameCase||"react",evaluater:h.createEvaluater?h.createEvaluater():void 0,filePath:b,ignoreInvalidStyle:h.ignoreInvalidStyle||!1,passKeys:h.passKeys!==!1,passNode:h.passNode||!1,schema:h.space==="svg"?nC:FX,stylePropertyNameCase:h.stylePropertyNameCase||"dom",tableCellAlignToStyle:h.tableCellAlignToStyle!==!1},P=vOe(O,o,void 0);return P&&typeof P!="string"?P:O.create(o,O.Fragment,{children:P||void 0},void 0)}function vOe(o,h,b){if(h.type==="element")return hjn(o,h,b);if(h.type==="mdxFlowExpression"||h.type==="mdxTextExpression")return fjn(o,h);if(h.type==="mdxJsxFlowElement"||h.type==="mdxJsxTextElement")return pjn(o,h,b);if(h.type==="mdxjsEsm")return djn(o,h);if(h.type==="root")return gjn(o,h,b);if(h.type==="text")return mjn(o,h)}function hjn(o,h,b){const k=o.schema;let O=k;h.tagName.toLowerCase()==="svg"&&k.space==="html"&&(O=nC,o.schema=O),o.ancestors.push(h);const P=kOe(o,h.tagName,!1),B=wjn(o,h);let G=Gjt(o,h);return cjn.has(h.tagName)&&(G=G.filter(function(J){return typeof J=="string"?!xbt(J):!0})),xOe(o,B,P,h),Ujt(B,G),o.ancestors.pop(),o.schema=k,o.create(h,P,B,b)}function fjn(o,h){if(h.data&&h.data.estree&&o.evaluater){const k=h.data.estree.body[0];return k.type,o.evaluater.evaluateExpression(k.expression)}CX(o,h.position)}function djn(o,h){if(h.data&&h.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(h.data.estree);CX(o,h.position)}function pjn(o,h,b){const k=o.schema;let O=k;h.name==="svg"&&k.space==="html"&&(O=nC,o.schema=O),o.ancestors.push(h);const P=h.name===null?o.Fragment:kOe(o,h.name,!0),B=vjn(o,h),G=Gjt(o,h);return xOe(o,B,P,h),Ujt(B,G),o.ancestors.pop(),o.schema=k,o.create(h,P,B,b)}function gjn(o,h,b){const k={};return Ujt(k,Gjt(o,h)),o.create(h,o.Fragment,k,b)}function mjn(o,h){return h.value}function xOe(o,h,b,k){typeof b!="string"&&b!==o.Fragment&&o.passNode&&(h.node=k)}function Ujt(o,h){if(h.length>0){const b=h.length>1?h:h[0];b&&(o.children=b)}}function bjn(o,h,b){return k;function k(O,P,B,G){const U=Array.isArray(B.children)?b:h;return G?U(P,B,G):U(P,B)}}function yjn(o,h){return b;function b(k,O,P,B){const G=Array.isArray(P.children),J=b6(k);return h(O,P,B,G,{columnNumber:J?J.column-1:void 0,fileName:o,lineNumber:J?J.line:void 0},void 0)}}function wjn(o,h){const b={};let k,O;for(O in h.properties)if(O!=="children"&&zjt.call(h.properties,O)){const P=xjn(o,O,h.properties[O]);if(P){const[B,G]=P;o.tableCellAlignToStyle&&B==="align"&&typeof G=="string"&&ujn.has(h.tagName)?k=G:b[B]=G}}if(k){const P=b.style||(b.style={});P[o.stylePropertyNameCase==="css"?"text-align":"textAlign"]=k}return b}function vjn(o,h){const b={};for(const k of h.attributes)if(k.type==="mdxJsxExpressionAttribute")if(k.data&&k.data.estree&&o.evaluater){const P=k.data.estree.body[0];P.type;const B=P.expression;B.type;const G=B.properties[0];G.type,Object.assign(b,o.evaluater.evaluateExpression(G.argument))}else CX(o,h.position);else{const O=k.name;let P;if(k.value&&typeof k.value=="object")if(k.value.data&&k.value.data.estree&&o.evaluater){const G=k.value.data.estree.body[0];G.type,P=o.evaluater.evaluateExpression(G.expression)}else CX(o,h.position);else P=k.value===null?!0:k.value;b[O]=P}return b}function Gjt(o,h){const b=[];let k=-1;const O=o.passKeys?new Map:ojn;for(;++k<h.children.length;){const P=h.children[k];let B;if(o.passKeys){const J=P.type==="element"?P.tagName:P.type==="mdxJsxFlowElement"||P.type==="mdxJsxTextElement"?P.name:void 0;if(J){const U=O.get(J)||0;B=J+"-"+U,O.set(J,U+1)}}const G=vOe(o,P,B);G!==void 0&&b.push(G)}return b}function xjn(o,h,b){const k=kbt(o.schema,h);if(!(b==null||typeof b=="number"&&Number.isNaN(b))){if(Array.isArray(b)&&(b=k.commaSeparated?jjt(b):$jt(b)),k.property==="style"){let O=typeof b=="object"?b:kjn(o,String(b));return o.stylePropertyNameCase==="css"&&(O=_jn(O)),["style",O]}return[o.elementAttributeNameCase==="react"&&k.space?IBn[k.property]||k.property:k.attribute,b]}}function kjn(o,h){try{return ijn(h,{reactCompat:!0})}catch(b){if(o.ignoreInvalidStyle)return{};const k=b,O=new wm("Cannot parse `style` attribute",{ancestors:o.ancestors,cause:k,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw O.file=o.filePath||void 0,O.url=wOe+"#cannot-parse-style-attribute",O}}function kOe(o,h,b){let k;if(!b)k={type:"Literal",value:h};else if(h.includes(".")){const O=h.split(".");let P=-1,B;for(;++P<O.length;){const G=CCe(O[P])?{type:"Identifier",name:O[P]}:{type:"Literal",value:O[P]};B=B?{type:"MemberExpression",object:B,property:G,computed:!!(P&&G.type==="Literal"),optional:!1}:G}k=B}else k=CCe(h)&&!/^[a-z]/.test(h)?{type:"Identifier",name:h}:{type:"Literal",value:h};if(k.type==="Literal"){const O=k.value;return zjt.call(o.components,O)?o.components[O]:O}if(o.evaluater)return o.evaluater.evaluateExpression(k);CX(o)}function CX(o,h){const b=new wm("Cannot handle MDX estrees without `createEvaluater`",{ancestors:o.ancestors,place:h,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw b.file=o.filePath||void 0,b.url=wOe+"#cannot-handle-mdx-estrees-without-createevaluater",b}function _jn(o){const h={};let b;for(b in o)zjt.call(o,b)&&(h[Ejn(b)]=o[b]);return h}function Ejn(o){let h=o.replace(sjn,Tjn);return h.slice(0,3)==="ms-"&&(h="-"+h),h}function Tjn(o){return"-"+o.toLowerCase()}const gRt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Sjn={};function Ijn(o,h){const b=Sjn,k=typeof b.includeImageAlt=="boolean"?b.includeImageAlt:!0,O=typeof b.includeHtml=="boolean"?b.includeHtml:!0;return _Oe(o,k,O)}function _Oe(o,h,b){if(Cjn(o)){if("value"in o)return o.type==="html"&&!b?"":o.value;if(h&&"alt"in o&&o.alt)return o.alt;if("children"in o)return $Ce(o.children,h,b)}return Array.isArray(o)?$Ce(o,h,b):""}function $Ce(o,h,b){const k=[];let O=-1;for(;++O<o.length;)k[O]=_Oe(o[O],h,b);return k.join("")}function Cjn(o){return!!(o&&typeof o=="object")}const HCe=document.createElement("i");function qjt(o){const h="&"+o+";";HCe.innerHTML=h;const b=HCe.textContent;return b.charCodeAt(b.length-1)===59&&o!=="semi"||b===h?!1:b}function g6(o,h,b,k){const O=o.length;let P=0,B;if(h<0?h=-h>O?0:O+h:h=h>O?O:h,b=b>0?b:0,k.length<1e4)B=Array.from(k),B.unshift(h,b),o.splice(...B);else for(b&&o.splice(h,b);P<k.length;)B=k.slice(P,P+1e4),B.unshift(h,0),o.splice(...B),P+=1e4,h+=1e4}function y3(o,h){return o.length>0?(g6(o,o.length,0,h),o):h}const zCe={}.hasOwnProperty;function Ajn(o){const h={};let b=-1;for(;++b<o.length;)Ojn(h,o[b]);return h}function Ojn(o,h){let b;for(b in h){const O=(zCe.call(o,b)?o[b]:void 0)||(o[b]={}),P=h[b];let B;if(P)for(B in P){zCe.call(O,B)||(O[B]=[]);const G=P[B];Njn(O[B],Array.isArray(G)?G:G?[G]:[])}}}function Njn(o,h){let b=-1;const k=[];for(;++b<h.length;)(h[b].add==="after"?o:k).push(h[b]);g6(o,0,0,k)}function EOe(o,h){const b=Number.parseInt(o,h);return b<9||b===11||b>13&&b<32||b>126&&b<160||b>55295&&b<57344||b>64975&&b<65008||(b&65535)===65535||(b&65535)===65534||b>1114111?"�":String.fromCodePoint(b)}function Nj(o){return o.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const h6=rC(/[A-Za-z]/),vw=rC(/[\dA-Za-z]/),Pjn=rC(/[#-'*+\--9=?A-Z^-~]/);function ABt(o){return o!==null&&(o<32||o===127)}const OBt=rC(/\d/),Ljn=rC(/[\dA-Fa-f]/),Mjn=rC(/[!-/:-@[-`{-~]/);function Ys(o){return o!==null&&o<-2}function K2(o){return o!==null&&(o<0||o===32)}function Fl(o){return o===-2||o===-1||o===32}const Djn=rC(new RegExp("\\p{P}|\\p{S}","u")),Rjn=rC(/\s/);function rC(o){return h;function h(b){return b!==null&&b>-1&&o.test(String.fromCharCode(b))}}function Jj(o){const h=[];let b=-1,k=0,O=0;for(;++b<o.length;){const P=o.charCodeAt(b);let B="";if(P===37&&vw(o.charCodeAt(b+1))&&vw(o.charCodeAt(b+2)))O=2;else if(P<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(P))||(B=String.fromCharCode(P));else if(P>55295&&P<57344){const G=o.charCodeAt(b+1);P<56320&&G>56319&&G<57344?(B=String.fromCharCode(P,G),O=1):B="�"}else B=String.fromCharCode(P);B&&(h.push(o.slice(k,b),encodeURIComponent(B)),k=b+O+1,B=""),O&&(b+=O,O=0)}return h.join("")+o.slice(k)}function af(o,h,b,k){const O=k?k-1:Number.POSITIVE_INFINITY;let P=0;return B;function B(J){return Fl(J)?(o.enter(b),G(J)):h(J)}function G(J){return Fl(J)&&P++<O?(o.consume(J),G):(o.exit(b),h(J))}}const Bjn={tokenize:jjn};function jjn(o){const h=o.attempt(this.parser.constructs.contentInitial,k,O);let b;return h;function k(G){if(G===null){o.consume(G);return}return o.enter("lineEnding"),o.consume(G),o.exit("lineEnding"),af(o,h,"linePrefix")}function O(G){return o.enter("paragraph"),P(G)}function P(G){const J=o.enter("chunkText",{contentType:"text",previous:b});return b&&(b.next=J),b=J,B(G)}function B(G){if(G===null){o.exit("chunkText"),o.exit("paragraph"),o.consume(G);return}return Ys(G)?(o.consume(G),o.exit("chunkText"),P):(o.consume(G),B)}}const Fjn={tokenize:$jn},UCe={tokenize:Hjn};function $jn(o){const h=this,b=[];let k=0,O,P,B;return G;function G(qt){if(k<b.length){const _e=b[k];return h.containerState=_e[1],o.attempt(_e[0].continuation,J,U)(qt)}return U(qt)}function J(qt){if(k++,h.containerState._closeFlow){h.containerState._closeFlow=void 0,O&&ae();const _e=h.events.length;let gn=_e,ge;for(;gn--;)if(h.events[gn][0]==="exit"&&h.events[gn][1].type==="chunkFlow"){ge=h.events[gn][1].end;break}Dt(k);let Mn=_e;for(;Mn<h.events.length;)h.events[Mn][1].end={...ge},Mn++;return g6(h.events,gn+1,0,h.events.slice(_e)),h.events.length=Mn,U(qt)}return G(qt)}function U(qt){if(k===b.length){if(!O)return it(qt);if(O.currentConstruct&&O.currentConstruct.concrete)return tt(qt);h.interrupt=!!(O.currentConstruct&&!O._gfmTableDynamicInterruptHack)}return h.containerState={},o.check(UCe,nt,at)(qt)}function nt(qt){return O&&ae(),Dt(k),it(qt)}function at(qt){return h.parser.lazy[h.now().line]=k!==b.length,B=h.now().offset,tt(qt)}function it(qt){return h.containerState={},o.attempt(UCe,st,tt)(qt)}function st(qt){return k++,b.push([h.currentConstruct,h.containerState]),it(qt)}function tt(qt){if(qt===null){O&&ae(),Dt(0),o.consume(qt);return}return O=O||h.parser.flow(h.now()),o.enter("chunkFlow",{_tokenizer:O,contentType:"flow",previous:P}),Et(qt)}function Et(qt){if(qt===null){Lt(o.exit("chunkFlow"),!0),Dt(0),o.consume(qt);return}return Ys(qt)?(o.consume(qt),Lt(o.exit("chunkFlow")),k=0,h.interrupt=void 0,G):(o.consume(qt),Et)}function Lt(qt,_e){const gn=h.sliceStream(qt);if(_e&&gn.push(null),qt.previous=P,P&&(P.next=qt),P=qt,O.defineSkip(qt.start),O.write(gn),h.parser.lazy[qt.start.line]){let ge=O.events.length;for(;ge--;)if(O.events[ge][1].start.offset<B&&(!O.events[ge][1].end||O.events[ge][1].end.offset>B))return;const Mn=h.events.length;let Wn=Mn,cr,ar;for(;Wn--;)if(h.events[Wn][0]==="exit"&&h.events[Wn][1].type==="chunkFlow"){if(cr){ar=h.events[Wn][1].end;break}cr=!0}for(Dt(k),ge=Mn;ge<h.events.length;)h.events[ge][1].end={...ar},ge++;g6(h.events,Wn+1,0,h.events.slice(Mn)),h.events.length=ge}}function Dt(qt){let _e=b.length;for(;_e-- >qt;){const gn=b[_e];h.containerState=gn[1],gn[0].exit.call(h,o)}b.length=qt}function ae(){O.write([null]),P=void 0,O=void 0,h.containerState._closeFlow=void 0}}function Hjn(o,h,b){return af(o,o.attempt(this.parser.constructs.document,h,b),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function GCe(o){if(o===null||K2(o)||Rjn(o))return 1;if(Djn(o))return 2}function Wjt(o,h,b){const k=[];let O=-1;for(;++O<o.length;){const P=o[O].resolveAll;P&&!k.includes(P)&&(h=P(h,b),k.push(P))}return h}const NBt={name:"attention",resolveAll:zjn,tokenize:Ujn};function zjn(o,h){let b=-1,k,O,P,B,G,J,U,nt;for(;++b<o.length;)if(o[b][0]==="enter"&&o[b][1].type==="attentionSequence"&&o[b][1]._close){for(k=b;k--;)if(o[k][0]==="exit"&&o[k][1].type==="attentionSequence"&&o[k][1]._open&&h.sliceSerialize(o[k][1]).charCodeAt(0)===h.sliceSerialize(o[b][1]).charCodeAt(0)){if((o[k][1]._close||o[b][1]._open)&&(o[b][1].end.offset-o[b][1].start.offset)%3&&!((o[k][1].end.offset-o[k][1].start.offset+o[b][1].end.offset-o[b][1].start.offset)%3))continue;J=o[k][1].end.offset-o[k][1].start.offset>1&&o[b][1].end.offset-o[b][1].start.offset>1?2:1;const at={...o[k][1].end},it={...o[b][1].start};qCe(at,-J),qCe(it,J),B={type:J>1?"strongSequence":"emphasisSequence",start:at,end:{...o[k][1].end}},G={type:J>1?"strongSequence":"emphasisSequence",start:{...o[b][1].start},end:it},P={type:J>1?"strongText":"emphasisText",start:{...o[k][1].end},end:{...o[b][1].start}},O={type:J>1?"strong":"emphasis",start:{...B.start},end:{...G.end}},o[k][1].end={...B.start},o[b][1].start={...G.end},U=[],o[k][1].end.offset-o[k][1].start.offset&&(U=y3(U,[["enter",o[k][1],h],["exit",o[k][1],h]])),U=y3(U,[["enter",O,h],["enter",B,h],["exit",B,h],["enter",P,h]]),U=y3(U,Wjt(h.parser.constructs.insideSpan.null,o.slice(k+1,b),h)),U=y3(U,[["exit",P,h],["enter",G,h],["exit",G,h],["exit",O,h]]),o[b][1].end.offset-o[b][1].start.offset?(nt=2,U=y3(U,[["enter",o[b][1],h],["exit",o[b][1],h]])):nt=0,g6(o,k-1,b-k+3,U),b=k+U.length-nt-2;break}}for(b=-1;++b<o.length;)o[b][1].type==="attentionSequence"&&(o[b][1].type="data");return o}function Ujn(o,h){const b=this.parser.constructs.attentionMarkers.null,k=this.previous,O=GCe(k);let P;return B;function B(J){return P=J,o.enter("attentionSequence"),G(J)}function G(J){if(J===P)return o.consume(J),G;const U=o.exit("attentionSequence"),nt=GCe(J),at=!nt||nt===2&&O||b.includes(J),it=!O||O===2&&nt||b.includes(k);return U._open=!!(P===42?at:at&&(O||!it)),U._close=!!(P===42?it:it&&(nt||!at)),h(J)}}function qCe(o,h){o.column+=h,o.offset+=h,o._bufferIndex+=h}const Gjn={name:"autolink",tokenize:qjn};function qjn(o,h,b){let k=0;return O;function O(st){return o.enter("autolink"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.enter("autolinkProtocol"),P}function P(st){return h6(st)?(o.consume(st),B):st===64?b(st):U(st)}function B(st){return st===43||st===45||st===46||vw(st)?(k=1,G(st)):U(st)}function G(st){return st===58?(o.consume(st),k=0,J):(st===43||st===45||st===46||vw(st))&&k++<32?(o.consume(st),G):(k=0,U(st))}function J(st){return st===62?(o.exit("autolinkProtocol"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),h):st===null||st===32||st===60||ABt(st)?b(st):(o.consume(st),J)}function U(st){return st===64?(o.consume(st),nt):Pjn(st)?(o.consume(st),U):b(st)}function nt(st){return vw(st)?at(st):b(st)}function at(st){return st===46?(o.consume(st),k=0,nt):st===62?(o.exit("autolinkProtocol").type="autolinkEmail",o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),h):it(st)}function it(st){if((st===45||vw(st))&&k++<63){const tt=st===45?it:at;return o.consume(st),tt}return b(st)}}const Tbt={partial:!0,tokenize:Wjn};function Wjn(o,h,b){return k;function k(P){return Fl(P)?af(o,O,"linePrefix")(P):O(P)}function O(P){return P===null||Ys(P)?h(P):b(P)}}const TOe={continuation:{tokenize:Vjn},exit:Yjn,name:"blockQuote",tokenize:Kjn};function Kjn(o,h,b){const k=this;return O;function O(B){if(B===62){const G=k.containerState;return G.open||(o.enter("blockQuote",{_container:!0}),G.open=!0),o.enter("blockQuotePrefix"),o.enter("blockQuoteMarker"),o.consume(B),o.exit("blockQuoteMarker"),P}return b(B)}function P(B){return Fl(B)?(o.enter("blockQuotePrefixWhitespace"),o.consume(B),o.exit("blockQuotePrefixWhitespace"),o.exit("blockQuotePrefix"),h):(o.exit("blockQuotePrefix"),h(B))}}function Vjn(o,h,b){const k=this;return O;function O(B){return Fl(B)?af(o,P,"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):P(B)}function P(B){return o.attempt(TOe,h,b)(B)}}function Yjn(o){o.exit("blockQuote")}const SOe={name:"characterEscape",tokenize:Jjn};function Jjn(o,h,b){return k;function k(P){return o.enter("characterEscape"),o.enter("escapeMarker"),o.consume(P),o.exit("escapeMarker"),O}function O(P){return Mjn(P)?(o.enter("characterEscapeValue"),o.consume(P),o.exit("characterEscapeValue"),o.exit("characterEscape"),h):b(P)}}const IOe={name:"characterReference",tokenize:Xjn};function Xjn(o,h,b){const k=this;let O=0,P,B;return G;function G(at){return o.enter("characterReference"),o.enter("characterReferenceMarker"),o.consume(at),o.exit("characterReferenceMarker"),J}function J(at){return at===35?(o.enter("characterReferenceMarkerNumeric"),o.consume(at),o.exit("characterReferenceMarkerNumeric"),U):(o.enter("characterReferenceValue"),P=31,B=vw,nt(at))}function U(at){return at===88||at===120?(o.enter("characterReferenceMarkerHexadecimal"),o.consume(at),o.exit("characterReferenceMarkerHexadecimal"),o.enter("characterReferenceValue"),P=6,B=Ljn,nt):(o.enter("characterReferenceValue"),P=7,B=OBt,nt(at))}function nt(at){if(at===59&&O){const it=o.exit("characterReferenceValue");return B===vw&&!qjt(k.sliceSerialize(it))?b(at):(o.enter("characterReferenceMarker"),o.consume(at),o.exit("characterReferenceMarker"),o.exit("characterReference"),h)}return B(at)&&O++<P?(o.consume(at),nt):b(at)}}const WCe={partial:!0,tokenize:Zjn},KCe={concrete:!0,name:"codeFenced",tokenize:Qjn};function Qjn(o,h,b){const k=this,O={partial:!0,tokenize:gn};let P=0,B=0,G;return J;function J(ge){return U(ge)}function U(ge){const Mn=k.events[k.events.length-1];return P=Mn&&Mn[1].type==="linePrefix"?Mn[2].sliceSerialize(Mn[1],!0).length:0,G=ge,o.enter("codeFenced"),o.enter("codeFencedFence"),o.enter("codeFencedFenceSequence"),nt(ge)}function nt(ge){return ge===G?(B++,o.consume(ge),nt):B<3?b(ge):(o.exit("codeFencedFenceSequence"),Fl(ge)?af(o,at,"whitespace")(ge):at(ge))}function at(ge){return ge===null||Ys(ge)?(o.exit("codeFencedFence"),k.interrupt?h(ge):o.check(WCe,Et,_e)(ge)):(o.enter("codeFencedFenceInfo"),o.enter("chunkString",{contentType:"string"}),it(ge))}function it(ge){return ge===null||Ys(ge)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),at(ge)):Fl(ge)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),af(o,st,"whitespace")(ge)):ge===96&&ge===G?b(ge):(o.consume(ge),it)}function st(ge){return ge===null||Ys(ge)?at(ge):(o.enter("codeFencedFenceMeta"),o.enter("chunkString",{contentType:"string"}),tt(ge))}function tt(ge){return ge===null||Ys(ge)?(o.exit("chunkString"),o.exit("codeFencedFenceMeta"),at(ge)):ge===96&&ge===G?b(ge):(o.consume(ge),tt)}function Et(ge){return o.attempt(O,_e,Lt)(ge)}function Lt(ge){return o.enter("lineEnding"),o.consume(ge),o.exit("lineEnding"),Dt}function Dt(ge){return P>0&&Fl(ge)?af(o,ae,"linePrefix",P+1)(ge):ae(ge)}function ae(ge){return ge===null||Ys(ge)?o.check(WCe,Et,_e)(ge):(o.enter("codeFlowValue"),qt(ge))}function qt(ge){return ge===null||Ys(ge)?(o.exit("codeFlowValue"),ae(ge)):(o.consume(ge),qt)}function _e(ge){return o.exit("codeFenced"),h(ge)}function gn(ge,Mn,Wn){let cr=0;return ar;function ar(Vt){return ge.enter("lineEnding"),ge.consume(Vt),ge.exit("lineEnding"),bn}function bn(Vt){return ge.enter("codeFencedFence"),Fl(Vt)?af(ge,Vn,"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Vt):Vn(Vt)}function Vn(Vt){return Vt===G?(ge.enter("codeFencedFenceSequence"),hi(Vt)):Wn(Vt)}function hi(Vt){return Vt===G?(cr++,ge.consume(Vt),hi):cr>=B?(ge.exit("codeFencedFenceSequence"),Fl(Vt)?af(ge,$n,"whitespace")(Vt):$n(Vt)):Wn(Vt)}function $n(Vt){return Vt===null||Ys(Vt)?(ge.exit("codeFencedFence"),Mn(Vt)):Wn(Vt)}}}function Zjn(o,h,b){const k=this;return O;function O(B){return B===null?b(B):(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),P)}function P(B){return k.parser.lazy[k.now().line]?b(B):h(B)}}const mRt={name:"codeIndented",tokenize:eFn},tFn={partial:!0,tokenize:nFn};function eFn(o,h,b){const k=this;return O;function O(U){return o.enter("codeIndented"),af(o,P,"linePrefix",5)(U)}function P(U){const nt=k.events[k.events.length-1];return nt&&nt[1].type==="linePrefix"&&nt[2].sliceSerialize(nt[1],!0).length>=4?B(U):b(U)}function B(U){return U===null?J(U):Ys(U)?o.attempt(tFn,B,J)(U):(o.enter("codeFlowValue"),G(U))}function G(U){return U===null||Ys(U)?(o.exit("codeFlowValue"),B(U)):(o.consume(U),G)}function J(U){return o.exit("codeIndented"),h(U)}}function nFn(o,h,b){const k=this;return O;function O(B){return k.parser.lazy[k.now().line]?b(B):Ys(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),O):af(o,P,"linePrefix",5)(B)}function P(B){const G=k.events[k.events.length-1];return G&&G[1].type==="linePrefix"&&G[2].sliceSerialize(G[1],!0).length>=4?h(B):Ys(B)?O(B):b(B)}}const rFn={name:"codeText",previous:aFn,resolve:iFn,tokenize:oFn};function iFn(o){let h=o.length-4,b=3,k,O;if((o[b][1].type==="lineEnding"||o[b][1].type==="space")&&(o[h][1].type==="lineEnding"||o[h][1].type==="space")){for(k=b;++k<h;)if(o[k][1].type==="codeTextData"){o[b][1].type="codeTextPadding",o[h][1].type="codeTextPadding",b+=2,h-=2;break}}for(k=b-1,h++;++k<=h;)O===void 0?k!==h&&o[k][1].type!=="lineEnding"&&(O=k):(k===h||o[k][1].type==="lineEnding")&&(o[O][1].type="codeTextData",k!==O+2&&(o[O][1].end=o[k-1][1].end,o.splice(O+2,k-O-2),h-=k-O-2,k=O+2),O=void 0);return o}function aFn(o){return o!==96||this.events[this.events.length-1][1].type==="characterEscape"}function oFn(o,h,b){let k=0,O,P;return B;function B(at){return o.enter("codeText"),o.enter("codeTextSequence"),G(at)}function G(at){return at===96?(o.consume(at),k++,G):(o.exit("codeTextSequence"),J(at))}function J(at){return at===null?b(at):at===32?(o.enter("space"),o.consume(at),o.exit("space"),J):at===96?(P=o.enter("codeTextSequence"),O=0,nt(at)):Ys(at)?(o.enter("lineEnding"),o.consume(at),o.exit("lineEnding"),J):(o.enter("codeTextData"),U(at))}function U(at){return at===null||at===32||at===96||Ys(at)?(o.exit("codeTextData"),J(at)):(o.consume(at),U)}function nt(at){return at===96?(o.consume(at),O++,nt):O===k?(o.exit("codeTextSequence"),o.exit("codeText"),h(at)):(P.type="codeTextData",U(at))}}class sFn{constructor(h){this.left=h?[...h]:[],this.right=[]}get(h){if(h<0||h>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+h+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return h<this.left.length?this.left[h]:this.right[this.right.length-h+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(h,b){const k=b??Number.POSITIVE_INFINITY;return k<this.left.length?this.left.slice(h,k):h>this.left.length?this.right.slice(this.right.length-k+this.left.length,this.right.length-h+this.left.length).reverse():this.left.slice(h).concat(this.right.slice(this.right.length-k+this.left.length).reverse())}splice(h,b,k){const O=b||0;this.setCursor(Math.trunc(h));const P=this.right.splice(this.right.length-O,Number.POSITIVE_INFINITY);return k&&YJ(this.left,k),P.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(h){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(h)}pushMany(h){this.setCursor(Number.POSITIVE_INFINITY),YJ(this.left,h)}unshift(h){this.setCursor(0),this.right.push(h)}unshiftMany(h){this.setCursor(0),YJ(this.right,h.reverse())}setCursor(h){if(!(h===this.left.length||h>this.left.length&&this.right.length===0||h<0&&this.left.length===0))if(h<this.left.length){const b=this.left.splice(h,Number.POSITIVE_INFINITY);YJ(this.right,b.reverse())}else{const b=this.right.splice(this.left.length+this.right.length-h,Number.POSITIVE_INFINITY);YJ(this.left,b.reverse())}}}function YJ(o,h){let b=0;if(h.length<1e4)o.push(...h);else for(;b<h.length;)o.push(...h.slice(b,b+1e4)),b+=1e4}function COe(o){const h={};let b=-1,k,O,P,B,G,J,U;const nt=new sFn(o);for(;++b<nt.length;){for(;b in h;)b=h[b];if(k=nt.get(b),b&&k[1].type==="chunkFlow"&&nt.get(b-1)[1].type==="listItemPrefix"&&(J=k[1]._tokenizer.events,P=0,P<J.length&&J[P][1].type==="lineEndingBlank"&&(P+=2),P<J.length&&J[P][1].type==="content"))for(;++P<J.length&&J[P][1].type!=="content";)J[P][1].type==="chunkText"&&(J[P][1]._isInFirstContentOfListItem=!0,P++);if(k[0]==="enter")k[1].contentType&&(Object.assign(h,cFn(nt,b)),b=h[b],U=!0);else if(k[1]._container){for(P=b,O=void 0;P--;)if(B=nt.get(P),B[1].type==="lineEnding"||B[1].type==="lineEndingBlank")B[0]==="enter"&&(O&&(nt.get(O)[1].type="lineEndingBlank"),B[1].type="lineEnding",O=P);else if(!(B[1].type==="linePrefix"||B[1].type==="listItemIndent"))break;O&&(k[1].end={...nt.get(O)[1].start},G=nt.slice(O,b),G.unshift(k),nt.splice(O,b-O+1,G))}}return g6(o,0,Number.POSITIVE_INFINITY,nt.slice(0)),!U}function cFn(o,h){const b=o.get(h)[1],k=o.get(h)[2];let O=h-1;const P=[];let B=b._tokenizer;B||(B=k.parser[b.contentType](b.start),b._contentTypeTextTrailing&&(B._contentTypeTextTrailing=!0));const G=B.events,J=[],U={};let nt,at,it=-1,st=b,tt=0,Et=0;const Lt=[Et];for(;st;){for(;o.get(++O)[1]!==st;);P.push(O),st._tokenizer||(nt=k.sliceStream(st),st.next||nt.push(null),at&&B.defineSkip(st.start),st._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=!0),B.write(nt),st._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=void 0)),at=st,st=st.next}for(st=b;++it<G.length;)G[it][0]==="exit"&&G[it-1][0]==="enter"&&G[it][1].type===G[it-1][1].type&&G[it][1].start.line!==G[it][1].end.line&&(Et=it+1,Lt.push(Et),st._tokenizer=void 0,st.previous=void 0,st=st.next);for(B.events=[],st?(st._tokenizer=void 0,st.previous=void 0):Lt.pop(),it=Lt.length;it--;){const Dt=G.slice(Lt[it],Lt[it+1]),ae=P.pop();J.push([ae,ae+Dt.length-1]),o.splice(ae,2,Dt)}for(J.reverse(),it=-1;++it<J.length;)U[tt+J[it][0]]=tt+J[it][1],tt+=J[it][1]-J[it][0]-1;return U}const uFn={resolve:hFn,tokenize:fFn},lFn={partial:!0,tokenize:dFn};function hFn(o){return COe(o),o}function fFn(o,h){let b;return k;function k(G){return o.enter("content"),b=o.enter("chunkContent",{contentType:"content"}),O(G)}function O(G){return G===null?P(G):Ys(G)?o.check(lFn,B,P)(G):(o.consume(G),O)}function P(G){return o.exit("chunkContent"),o.exit("content"),h(G)}function B(G){return o.consume(G),o.exit("chunkContent"),b.next=o.enter("chunkContent",{contentType:"content",previous:b}),b=b.next,O}}function dFn(o,h,b){const k=this;return O;function O(B){return o.exit("chunkContent"),o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),af(o,P,"linePrefix")}function P(B){if(B===null||Ys(B))return b(B);const G=k.events[k.events.length-1];return!k.parser.constructs.disable.null.includes("codeIndented")&&G&&G[1].type==="linePrefix"&&G[2].sliceSerialize(G[1],!0).length>=4?h(B):o.interrupt(k.parser.constructs.flow,b,h)(B)}}function AOe(o,h,b,k,O,P,B,G,J){const U=J||Number.POSITIVE_INFINITY;let nt=0;return at;function at(Dt){return Dt===60?(o.enter(k),o.enter(O),o.enter(P),o.consume(Dt),o.exit(P),it):Dt===null||Dt===32||Dt===41||ABt(Dt)?b(Dt):(o.enter(k),o.enter(B),o.enter(G),o.enter("chunkString",{contentType:"string"}),Et(Dt))}function it(Dt){return Dt===62?(o.enter(P),o.consume(Dt),o.exit(P),o.exit(O),o.exit(k),h):(o.enter(G),o.enter("chunkString",{contentType:"string"}),st(Dt))}function st(Dt){return Dt===62?(o.exit("chunkString"),o.exit(G),it(Dt)):Dt===null||Dt===60||Ys(Dt)?b(Dt):(o.consume(Dt),Dt===92?tt:st)}function tt(Dt){return Dt===60||Dt===62||Dt===92?(o.consume(Dt),st):st(Dt)}function Et(Dt){return!nt&&(Dt===null||Dt===41||K2(Dt))?(o.exit("chunkString"),o.exit(G),o.exit(B),o.exit(k),h(Dt)):nt<U&&Dt===40?(o.consume(Dt),nt++,Et):Dt===41?(o.consume(Dt),nt--,Et):Dt===null||Dt===32||Dt===40||ABt(Dt)?b(Dt):(o.consume(Dt),Dt===92?Lt:Et)}function Lt(Dt){return Dt===40||Dt===41||Dt===92?(o.consume(Dt),Et):Et(Dt)}}function OOe(o,h,b,k,O,P){const B=this;let G=0,J;return U;function U(st){return o.enter(k),o.enter(O),o.consume(st),o.exit(O),o.enter(P),nt}function nt(st){return G>999||st===null||st===91||st===93&&!J||st===94&&!G&&"_hiddenFootnoteSupport"in B.parser.constructs?b(st):st===93?(o.exit(P),o.enter(O),o.consume(st),o.exit(O),o.exit(k),h):Ys(st)?(o.enter("lineEnding"),o.consume(st),o.exit("lineEnding"),nt):(o.enter("chunkString",{contentType:"string"}),at(st))}function at(st){return st===null||st===91||st===93||Ys(st)||G++>999?(o.exit("chunkString"),nt(st)):(o.consume(st),J||(J=!Fl(st)),st===92?it:at)}function it(st){return st===91||st===92||st===93?(o.consume(st),G++,at):at(st)}}function NOe(o,h,b,k,O,P){let B;return G;function G(it){return it===34||it===39||it===40?(o.enter(k),o.enter(O),o.consume(it),o.exit(O),B=it===40?41:it,J):b(it)}function J(it){return it===B?(o.enter(O),o.consume(it),o.exit(O),o.exit(k),h):(o.enter(P),U(it))}function U(it){return it===B?(o.exit(P),J(B)):it===null?b(it):Ys(it)?(o.enter("lineEnding"),o.consume(it),o.exit("lineEnding"),af(o,U,"linePrefix")):(o.enter("chunkString",{contentType:"string"}),nt(it))}function nt(it){return it===B||it===null||Ys(it)?(o.exit("chunkString"),U(it)):(o.consume(it),it===92?at:nt)}function at(it){return it===B||it===92?(o.consume(it),nt):nt(it)}}function pX(o,h){let b;return k;function k(O){return Ys(O)?(o.enter("lineEnding"),o.consume(O),o.exit("lineEnding"),b=!0,k):Fl(O)?af(o,k,b?"linePrefix":"lineSuffix")(O):h(O)}}const pFn={name:"definition",tokenize:mFn},gFn={partial:!0,tokenize:bFn};function mFn(o,h,b){const k=this;let O;return P;function P(st){return o.enter("definition"),B(st)}function B(st){return OOe.call(k,o,G,b,"definitionLabel","definitionLabelMarker","definitionLabelString")(st)}function G(st){return O=Nj(k.sliceSerialize(k.events[k.events.length-1][1]).slice(1,-1)),st===58?(o.enter("definitionMarker"),o.consume(st),o.exit("definitionMarker"),J):b(st)}function J(st){return K2(st)?pX(o,U)(st):U(st)}function U(st){return AOe(o,nt,b,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(st)}function nt(st){return o.attempt(gFn,at,at)(st)}function at(st){return Fl(st)?af(o,it,"whitespace")(st):it(st)}function it(st){return st===null||Ys(st)?(o.exit("definition"),k.parser.defined.push(O),h(st)):b(st)}}function bFn(o,h,b){return k;function k(G){return K2(G)?pX(o,O)(G):b(G)}function O(G){return NOe(o,P,b,"definitionTitle","definitionTitleMarker","definitionTitleString")(G)}function P(G){return Fl(G)?af(o,B,"whitespace")(G):B(G)}function B(G){return G===null||Ys(G)?h(G):b(G)}}const yFn={name:"hardBreakEscape",tokenize:wFn};function wFn(o,h,b){return k;function k(P){return o.enter("hardBreakEscape"),o.consume(P),O}function O(P){return Ys(P)?(o.exit("hardBreakEscape"),h(P)):b(P)}}const vFn={name:"headingAtx",resolve:xFn,tokenize:kFn};function xFn(o,h){let b=o.length-2,k=3,O,P;return o[k][1].type==="whitespace"&&(k+=2),b-2>k&&o[b][1].type==="whitespace"&&(b-=2),o[b][1].type==="atxHeadingSequence"&&(k===b-1||b-4>k&&o[b-2][1].type==="whitespace")&&(b-=k+1===b?2:4),b>k&&(O={type:"atxHeadingText",start:o[k][1].start,end:o[b][1].end},P={type:"chunkText",start:o[k][1].start,end:o[b][1].end,contentType:"text"},g6(o,k,b-k+1,[["enter",O,h],["enter",P,h],["exit",P,h],["exit",O,h]])),o}function kFn(o,h,b){let k=0;return O;function O(nt){return o.enter("atxHeading"),P(nt)}function P(nt){return o.enter("atxHeadingSequence"),B(nt)}function B(nt){return nt===35&&k++<6?(o.consume(nt),B):nt===null||K2(nt)?(o.exit("atxHeadingSequence"),G(nt)):b(nt)}function G(nt){return nt===35?(o.enter("atxHeadingSequence"),J(nt)):nt===null||Ys(nt)?(o.exit("atxHeading"),h(nt)):Fl(nt)?af(o,G,"whitespace")(nt):(o.enter("atxHeadingText"),U(nt))}function J(nt){return nt===35?(o.consume(nt),J):(o.exit("atxHeadingSequence"),G(nt))}function U(nt){return nt===null||nt===35||K2(nt)?(o.exit("atxHeadingText"),G(nt)):(o.consume(nt),U)}}const _Fn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],VCe=["pre","script","style","textarea"],EFn={concrete:!0,name:"htmlFlow",resolveTo:IFn,tokenize:CFn},TFn={partial:!0,tokenize:OFn},SFn={partial:!0,tokenize:AFn};function IFn(o){let h=o.length;for(;h--&&!(o[h][0]==="enter"&&o[h][1].type==="htmlFlow"););return h>1&&o[h-2][1].type==="linePrefix"&&(o[h][1].start=o[h-2][1].start,o[h+1][1].start=o[h-2][1].start,o.splice(h-2,2)),o}function CFn(o,h,b){const k=this;let O,P,B,G,J;return U;function U(Je){return nt(Je)}function nt(Je){return o.enter("htmlFlow"),o.enter("htmlFlowData"),o.consume(Je),at}function at(Je){return Je===33?(o.consume(Je),it):Je===47?(o.consume(Je),P=!0,Et):Je===63?(o.consume(Je),O=3,k.interrupt?h:Be):h6(Je)?(o.consume(Je),B=String.fromCharCode(Je),Lt):b(Je)}function it(Je){return Je===45?(o.consume(Je),O=2,st):Je===91?(o.consume(Je),O=5,G=0,tt):h6(Je)?(o.consume(Je),O=4,k.interrupt?h:Be):b(Je)}function st(Je){return Je===45?(o.consume(Je),k.interrupt?h:Be):b(Je)}function tt(Je){const Xs="CDATA[";return Je===Xs.charCodeAt(G++)?(o.consume(Je),G===Xs.length?k.interrupt?h:Vn:tt):b(Je)}function Et(Je){return h6(Je)?(o.consume(Je),B=String.fromCharCode(Je),Lt):b(Je)}function Lt(Je){if(Je===null||Je===47||Je===62||K2(Je)){const Xs=Je===47,_o=B.toLowerCase();return!Xs&&!P&&VCe.includes(_o)?(O=1,k.interrupt?h(Je):Vn(Je)):_Fn.includes(B.toLowerCase())?(O=6,Xs?(o.consume(Je),Dt):k.interrupt?h(Je):Vn(Je)):(O=7,k.interrupt&&!k.parser.lazy[k.now().line]?b(Je):P?ae(Je):qt(Je))}return Je===45||vw(Je)?(o.consume(Je),B+=String.fromCharCode(Je),Lt):b(Je)}function Dt(Je){return Je===62?(o.consume(Je),k.interrupt?h:Vn):b(Je)}function ae(Je){return Fl(Je)?(o.consume(Je),ae):ar(Je)}function qt(Je){return Je===47?(o.consume(Je),ar):Je===58||Je===95||h6(Je)?(o.consume(Je),_e):Fl(Je)?(o.consume(Je),qt):ar(Je)}function _e(Je){return Je===45||Je===46||Je===58||Je===95||vw(Je)?(o.consume(Je),_e):gn(Je)}function gn(Je){return Je===61?(o.consume(Je),ge):Fl(Je)?(o.consume(Je),gn):qt(Je)}function ge(Je){return Je===null||Je===60||Je===61||Je===62||Je===96?b(Je):Je===34||Je===39?(o.consume(Je),J=Je,Mn):Fl(Je)?(o.consume(Je),ge):Wn(Je)}function Mn(Je){return Je===J?(o.consume(Je),J=null,cr):Je===null||Ys(Je)?b(Je):(o.consume(Je),Mn)}function Wn(Je){return Je===null||Je===34||Je===39||Je===47||Je===60||Je===61||Je===62||Je===96||K2(Je)?gn(Je):(o.consume(Je),Wn)}function cr(Je){return Je===47||Je===62||Fl(Je)?qt(Je):b(Je)}function ar(Je){return Je===62?(o.consume(Je),bn):b(Je)}function bn(Je){return Je===null||Ys(Je)?Vn(Je):Fl(Je)?(o.consume(Je),bn):b(Je)}function Vn(Je){return Je===45&&O===2?(o.consume(Je),Ye):Je===60&&O===1?(o.consume(Je),jn):Je===62&&O===4?(o.consume(Je),Js):Je===63&&O===3?(o.consume(Je),Be):Je===93&&O===5?(o.consume(Je),rr):Ys(Je)&&(O===6||O===7)?(o.exit("htmlFlowData"),o.check(TFn,el,hi)(Je)):Je===null||Ys(Je)?(o.exit("htmlFlowData"),hi(Je)):(o.consume(Je),Vn)}function hi(Je){return o.check(SFn,$n,el)(Je)}function $n(Je){return o.enter("lineEnding"),o.consume(Je),o.exit("lineEnding"),Vt}function Vt(Je){return Je===null||Ys(Je)?hi(Je):(o.enter("htmlFlowData"),Vn(Je))}function Ye(Je){return Je===45?(o.consume(Je),Be):Vn(Je)}function jn(Je){return Je===47?(o.consume(Je),B="",er):Vn(Je)}function er(Je){if(Je===62){const Xs=B.toLowerCase();return VCe.includes(Xs)?(o.consume(Je),Js):Vn(Je)}return h6(Je)&&B.length<8?(o.consume(Je),B+=String.fromCharCode(Je),er):Vn(Je)}function rr(Je){return Je===93?(o.consume(Je),Be):Vn(Je)}function Be(Je){return Je===62?(o.consume(Je),Js):Je===45&&O===2?(o.consume(Je),Be):Vn(Je)}function Js(Je){return Je===null||Ys(Je)?(o.exit("htmlFlowData"),el(Je)):(o.consume(Je),Js)}function el(Je){return o.exit("htmlFlow"),h(Je)}}function AFn(o,h,b){const k=this;return O;function O(B){return Ys(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),P):b(B)}function P(B){return k.parser.lazy[k.now().line]?b(B):h(B)}}function OFn(o,h,b){return k;function k(O){return o.enter("lineEnding"),o.consume(O),o.exit("lineEnding"),o.attempt(Tbt,h,b)}}const NFn={name:"htmlText",tokenize:PFn};function PFn(o,h,b){const k=this;let O,P,B;return G;function G(Be){return o.enter("htmlText"),o.enter("htmlTextData"),o.consume(Be),J}function J(Be){return Be===33?(o.consume(Be),U):Be===47?(o.consume(Be),gn):Be===63?(o.consume(Be),qt):h6(Be)?(o.consume(Be),Wn):b(Be)}function U(Be){return Be===45?(o.consume(Be),nt):Be===91?(o.consume(Be),P=0,tt):h6(Be)?(o.consume(Be),ae):b(Be)}function nt(Be){return Be===45?(o.consume(Be),st):b(Be)}function at(Be){return Be===null?b(Be):Be===45?(o.consume(Be),it):Ys(Be)?(B=at,jn(Be)):(o.consume(Be),at)}function it(Be){return Be===45?(o.consume(Be),st):at(Be)}function st(Be){return Be===62?Ye(Be):Be===45?it(Be):at(Be)}function tt(Be){const Js="CDATA[";return Be===Js.charCodeAt(P++)?(o.consume(Be),P===Js.length?Et:tt):b(Be)}function Et(Be){return Be===null?b(Be):Be===93?(o.consume(Be),Lt):Ys(Be)?(B=Et,jn(Be)):(o.consume(Be),Et)}function Lt(Be){return Be===93?(o.consume(Be),Dt):Et(Be)}function Dt(Be){return Be===62?Ye(Be):Be===93?(o.consume(Be),Dt):Et(Be)}function ae(Be){return Be===null||Be===62?Ye(Be):Ys(Be)?(B=ae,jn(Be)):(o.consume(Be),ae)}function qt(Be){return Be===null?b(Be):Be===63?(o.consume(Be),_e):Ys(Be)?(B=qt,jn(Be)):(o.consume(Be),qt)}function _e(Be){return Be===62?Ye(Be):qt(Be)}function gn(Be){return h6(Be)?(o.consume(Be),ge):b(Be)}function ge(Be){return Be===45||vw(Be)?(o.consume(Be),ge):Mn(Be)}function Mn(Be){return Ys(Be)?(B=Mn,jn(Be)):Fl(Be)?(o.consume(Be),Mn):Ye(Be)}function Wn(Be){return Be===45||vw(Be)?(o.consume(Be),Wn):Be===47||Be===62||K2(Be)?cr(Be):b(Be)}function cr(Be){return Be===47?(o.consume(Be),Ye):Be===58||Be===95||h6(Be)?(o.consume(Be),ar):Ys(Be)?(B=cr,jn(Be)):Fl(Be)?(o.consume(Be),cr):Ye(Be)}function ar(Be){return Be===45||Be===46||Be===58||Be===95||vw(Be)?(o.consume(Be),ar):bn(Be)}function bn(Be){return Be===61?(o.consume(Be),Vn):Ys(Be)?(B=bn,jn(Be)):Fl(Be)?(o.consume(Be),bn):cr(Be)}function Vn(Be){return Be===null||Be===60||Be===61||Be===62||Be===96?b(Be):Be===34||Be===39?(o.consume(Be),O=Be,hi):Ys(Be)?(B=Vn,jn(Be)):Fl(Be)?(o.consume(Be),Vn):(o.consume(Be),$n)}function hi(Be){return Be===O?(o.consume(Be),O=void 0,Vt):Be===null?b(Be):Ys(Be)?(B=hi,jn(Be)):(o.consume(Be),hi)}function $n(Be){return Be===null||Be===34||Be===39||Be===60||Be===61||Be===96?b(Be):Be===47||Be===62||K2(Be)?cr(Be):(o.consume(Be),$n)}function Vt(Be){return Be===47||Be===62||K2(Be)?cr(Be):b(Be)}function Ye(Be){return Be===62?(o.consume(Be),o.exit("htmlTextData"),o.exit("htmlText"),h):b(Be)}function jn(Be){return o.exit("htmlTextData"),o.enter("lineEnding"),o.consume(Be),o.exit("lineEnding"),er}function er(Be){return Fl(Be)?af(o,rr,"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Be):rr(Be)}function rr(Be){return o.enter("htmlTextData"),B(Be)}}const Kjt={name:"labelEnd",resolveAll:RFn,resolveTo:BFn,tokenize:jFn},LFn={tokenize:FFn},MFn={tokenize:$Fn},DFn={tokenize:HFn};function RFn(o){let h=-1;const b=[];for(;++h<o.length;){const k=o[h][1];if(b.push(o[h]),k.type==="labelImage"||k.type==="labelLink"||k.type==="labelEnd"){const O=k.type==="labelImage"?4:2;k.type="data",h+=O}}return o.length!==b.length&&g6(o,0,o.length,b),o}function BFn(o,h){let b=o.length,k=0,O,P,B,G;for(;b--;)if(O=o[b][1],P){if(O.type==="link"||O.type==="labelLink"&&O._inactive)break;o[b][0]==="enter"&&O.type==="labelLink"&&(O._inactive=!0)}else if(B){if(o[b][0]==="enter"&&(O.type==="labelImage"||O.type==="labelLink")&&!O._balanced&&(P=b,O.type!=="labelLink")){k=2;break}}else O.type==="labelEnd"&&(B=b);const J={type:o[P][1].type==="labelLink"?"link":"image",start:{...o[P][1].start},end:{...o[o.length-1][1].end}},U={type:"label",start:{...o[P][1].start},end:{...o[B][1].end}},nt={type:"labelText",start:{...o[P+k+2][1].end},end:{...o[B-2][1].start}};return G=[["enter",J,h],["enter",U,h]],G=y3(G,o.slice(P+1,P+k+3)),G=y3(G,[["enter",nt,h]]),G=y3(G,Wjt(h.parser.constructs.insideSpan.null,o.slice(P+k+4,B-3),h)),G=y3(G,[["exit",nt,h],o[B-2],o[B-1],["exit",U,h]]),G=y3(G,o.slice(B+1)),G=y3(G,[["exit",J,h]]),g6(o,P,o.length,G),o}function jFn(o,h,b){const k=this;let O=k.events.length,P,B;for(;O--;)if((k.events[O][1].type==="labelImage"||k.events[O][1].type==="labelLink")&&!k.events[O][1]._balanced){P=k.events[O][1];break}return G;function G(it){return P?P._inactive?at(it):(B=k.parser.defined.includes(Nj(k.sliceSerialize({start:P.end,end:k.now()}))),o.enter("labelEnd"),o.enter("labelMarker"),o.consume(it),o.exit("labelMarker"),o.exit("labelEnd"),J):b(it)}function J(it){return it===40?o.attempt(LFn,nt,B?nt:at)(it):it===91?o.attempt(MFn,nt,B?U:at)(it):B?nt(it):at(it)}function U(it){return o.attempt(DFn,nt,at)(it)}function nt(it){return h(it)}function at(it){return P._balanced=!0,b(it)}}function FFn(o,h,b){return k;function k(at){return o.enter("resource"),o.enter("resourceMarker"),o.consume(at),o.exit("resourceMarker"),O}function O(at){return K2(at)?pX(o,P)(at):P(at)}function P(at){return at===41?nt(at):AOe(o,B,G,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(at)}function B(at){return K2(at)?pX(o,J)(at):nt(at)}function G(at){return b(at)}function J(at){return at===34||at===39||at===40?NOe(o,U,b,"resourceTitle","resourceTitleMarker","resourceTitleString")(at):nt(at)}function U(at){return K2(at)?pX(o,nt)(at):nt(at)}function nt(at){return at===41?(o.enter("resourceMarker"),o.consume(at),o.exit("resourceMarker"),o.exit("resource"),h):b(at)}}function $Fn(o,h,b){const k=this;return O;function O(G){return OOe.call(k,o,P,B,"reference","referenceMarker","referenceString")(G)}function P(G){return k.parser.defined.includes(Nj(k.sliceSerialize(k.events[k.events.length-1][1]).slice(1,-1)))?h(G):b(G)}function B(G){return b(G)}}function HFn(o,h,b){return k;function k(P){return o.enter("reference"),o.enter("referenceMarker"),o.consume(P),o.exit("referenceMarker"),O}function O(P){return P===93?(o.enter("referenceMarker"),o.consume(P),o.exit("referenceMarker"),o.exit("reference"),h):b(P)}}const zFn={name:"labelStartImage",resolveAll:Kjt.resolveAll,tokenize:UFn};function UFn(o,h,b){const k=this;return O;function O(G){return o.enter("labelImage"),o.enter("labelImageMarker"),o.consume(G),o.exit("labelImageMarker"),P}function P(G){return G===91?(o.enter("labelMarker"),o.consume(G),o.exit("labelMarker"),o.exit("labelImage"),B):b(G)}function B(G){return G===94&&"_hiddenFootnoteSupport"in k.parser.constructs?b(G):h(G)}}const GFn={name:"labelStartLink",resolveAll:Kjt.resolveAll,tokenize:qFn};function qFn(o,h,b){const k=this;return O;function O(B){return o.enter("labelLink"),o.enter("labelMarker"),o.consume(B),o.exit("labelMarker"),o.exit("labelLink"),P}function P(B){return B===94&&"_hiddenFootnoteSupport"in k.parser.constructs?b(B):h(B)}}const bRt={name:"lineEnding",tokenize:WFn};function WFn(o,h){return b;function b(k){return o.enter("lineEnding"),o.consume(k),o.exit("lineEnding"),af(o,h,"linePrefix")}}const Pmt={name:"thematicBreak",tokenize:KFn};function KFn(o,h,b){let k=0,O;return P;function P(U){return o.enter("thematicBreak"),B(U)}function B(U){return O=U,G(U)}function G(U){return U===O?(o.enter("thematicBreakSequence"),J(U)):k>=3&&(U===null||Ys(U))?(o.exit("thematicBreak"),h(U)):b(U)}function J(U){return U===O?(o.consume(U),k++,J):(o.exit("thematicBreakSequence"),Fl(U)?af(o,G,"whitespace")(U):G(U))}}const q2={continuation:{tokenize:XFn},exit:ZFn,name:"list",tokenize:JFn},VFn={partial:!0,tokenize:t$n},YFn={partial:!0,tokenize:QFn};function JFn(o,h,b){const k=this,O=k.events[k.events.length-1];let P=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,B=0;return G;function G(st){const tt=k.containerState.type||(st===42||st===43||st===45?"listUnordered":"listOrdered");if(tt==="listUnordered"?!k.containerState.marker||st===k.containerState.marker:OBt(st)){if(k.containerState.type||(k.containerState.type=tt,o.enter(tt,{_container:!0})),tt==="listUnordered")return o.enter("listItemPrefix"),st===42||st===45?o.check(Pmt,b,U)(st):U(st);if(!k.interrupt||st===49)return o.enter("listItemPrefix"),o.enter("listItemValue"),J(st)}return b(st)}function J(st){return OBt(st)&&++B<10?(o.consume(st),J):(!k.interrupt||B<2)&&(k.containerState.marker?st===k.containerState.marker:st===41||st===46)?(o.exit("listItemValue"),U(st)):b(st)}function U(st){return o.enter("listItemMarker"),o.consume(st),o.exit("listItemMarker"),k.containerState.marker=k.containerState.marker||st,o.check(Tbt,k.interrupt?b:nt,o.attempt(VFn,it,at))}function nt(st){return k.containerState.initialBlankLine=!0,P++,it(st)}function at(st){return Fl(st)?(o.enter("listItemPrefixWhitespace"),o.consume(st),o.exit("listItemPrefixWhitespace"),it):b(st)}function it(st){return k.containerState.size=P+k.sliceSerialize(o.exit("listItemPrefix"),!0).length,h(st)}}function XFn(o,h,b){const k=this;return k.containerState._closeFlow=void 0,o.check(Tbt,O,P);function O(G){return k.containerState.furtherBlankLines=k.containerState.furtherBlankLines||k.containerState.initialBlankLine,af(o,h,"listItemIndent",k.containerState.size+1)(G)}function P(G){return k.containerState.furtherBlankLines||!Fl(G)?(k.containerState.furtherBlankLines=void 0,k.containerState.initialBlankLine=void 0,B(G)):(k.containerState.furtherBlankLines=void 0,k.containerState.initialBlankLine=void 0,o.attempt(YFn,h,B)(G))}function B(G){return k.containerState._closeFlow=!0,k.interrupt=void 0,af(o,o.attempt(q2,h,b),"linePrefix",k.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G)}}function QFn(o,h,b){const k=this;return af(o,O,"listItemIndent",k.containerState.size+1);function O(P){const B=k.events[k.events.length-1];return B&&B[1].type==="listItemIndent"&&B[2].sliceSerialize(B[1],!0).length===k.containerState.size?h(P):b(P)}}function ZFn(o){o.exit(this.containerState.type)}function t$n(o,h,b){const k=this;return af(o,O,"listItemPrefixWhitespace",k.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function O(P){const B=k.events[k.events.length-1];return!Fl(P)&&B&&B[1].type==="listItemPrefixWhitespace"?h(P):b(P)}}const YCe={name:"setextUnderline",resolveTo:e$n,tokenize:n$n};function e$n(o,h){let b=o.length,k,O,P;for(;b--;)if(o[b][0]==="enter"){if(o[b][1].type==="content"){k=b;break}o[b][1].type==="paragraph"&&(O=b)}else o[b][1].type==="content"&&o.splice(b,1),!P&&o[b][1].type==="definition"&&(P=b);const B={type:"setextHeading",start:{...o[k][1].start},end:{...o[o.length-1][1].end}};return o[O][1].type="setextHeadingText",P?(o.splice(O,0,["enter",B,h]),o.splice(P+1,0,["exit",o[k][1],h]),o[k][1].end={...o[P][1].end}):o[k][1]=B,o.push(["exit",B,h]),o}function n$n(o,h,b){const k=this;let O;return P;function P(U){let nt=k.events.length,at;for(;nt--;)if(k.events[nt][1].type!=="lineEnding"&&k.events[nt][1].type!=="linePrefix"&&k.events[nt][1].type!=="content"){at=k.events[nt][1].type==="paragraph";break}return!k.parser.lazy[k.now().line]&&(k.interrupt||at)?(o.enter("setextHeadingLine"),O=U,B(U)):b(U)}function B(U){return o.enter("setextHeadingLineSequence"),G(U)}function G(U){return U===O?(o.consume(U),G):(o.exit("setextHeadingLineSequence"),Fl(U)?af(o,J,"lineSuffix")(U):J(U))}function J(U){return U===null||Ys(U)?(o.exit("setextHeadingLine"),h(U)):b(U)}}const r$n={tokenize:i$n};function i$n(o){const h=this,b=o.attempt(Tbt,k,o.attempt(this.parser.constructs.flowInitial,O,af(o,o.attempt(this.parser.constructs.flow,O,o.attempt(uFn,O)),"linePrefix")));return b;function k(P){if(P===null){o.consume(P);return}return o.enter("lineEndingBlank"),o.consume(P),o.exit("lineEndingBlank"),h.currentConstruct=void 0,b}function O(P){if(P===null){o.consume(P);return}return o.enter("lineEnding"),o.consume(P),o.exit("lineEnding"),h.currentConstruct=void 0,b}}const a$n={resolveAll:LOe()},o$n=POe("string"),s$n=POe("text");function POe(o){return{resolveAll:LOe(o==="text"?c$n:void 0),tokenize:h};function h(b){const k=this,O=this.parser.constructs[o],P=b.attempt(O,B,G);return B;function B(nt){return U(nt)?P(nt):G(nt)}function G(nt){if(nt===null){b.consume(nt);return}return b.enter("data"),b.consume(nt),J}function J(nt){return U(nt)?(b.exit("data"),P(nt)):(b.consume(nt),J)}function U(nt){if(nt===null)return!0;const at=O[nt];let it=-1;if(at)for(;++it<at.length;){const st=at[it];if(!st.previous||st.previous.call(k,k.previous))return!0}return!1}}}function LOe(o){return h;function h(b,k){let O=-1,P;for(;++O<=b.length;)P===void 0?b[O]&&b[O][1].type==="data"&&(P=O,O++):(!b[O]||b[O][1].type!=="data")&&(O!==P+2&&(b[P][1].end=b[O-1][1].end,b.splice(P+2,O-P-2),O=P+2),P=void 0);return o?o(b,k):b}}function c$n(o,h){let b=0;for(;++b<=o.length;)if((b===o.length||o[b][1].type==="lineEnding")&&o[b-1][1].type==="data"){const k=o[b-1][1],O=h.sliceStream(k);let P=O.length,B=-1,G=0,J;for(;P--;){const U=O[P];if(typeof U=="string"){for(B=U.length;U.charCodeAt(B-1)===32;)G++,B--;if(B)break;B=-1}else if(U===-2)J=!0,G++;else if(U!==-1){P++;break}}if(h._contentTypeTextTrailing&&b===o.length&&(G=0),G){const U={type:b===o.length||J||G<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:P?B:k.start._bufferIndex+B,_index:k.start._index+P,line:k.end.line,column:k.end.column-G,offset:k.end.offset-G},end:{...k.end}};k.end={...U.start},k.start.offset===k.end.offset?Object.assign(k,U):(o.splice(b,0,["enter",U,h],["exit",U,h]),b+=2)}b++}return o}const u$n={42:q2,43:q2,45:q2,48:q2,49:q2,50:q2,51:q2,52:q2,53:q2,54:q2,55:q2,56:q2,57:q2,62:TOe},l$n={91:pFn},h$n={[-2]:mRt,[-1]:mRt,32:mRt},f$n={35:vFn,42:Pmt,45:[YCe,Pmt],60:EFn,61:YCe,95:Pmt,96:KCe,126:KCe},d$n={38:IOe,92:SOe},p$n={[-5]:bRt,[-4]:bRt,[-3]:bRt,33:zFn,38:IOe,42:NBt,60:[Gjn,NFn],91:GFn,92:[yFn,SOe],93:Kjt,95:NBt,96:rFn},g$n={null:[NBt,a$n]},m$n={null:[42,95]},b$n={null:[]},y$n=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:m$n,contentInitial:l$n,disable:b$n,document:u$n,flow:f$n,flowInitial:h$n,insideSpan:g$n,string:d$n,text:p$n},Symbol.toStringTag,{value:"Module"}));function w$n(o,h,b){let k={_bufferIndex:-1,_index:0,line:b&&b.line||1,column:b&&b.column||1,offset:b&&b.offset||0};const O={},P=[];let B=[],G=[];const J={attempt:Mn(gn),check:Mn(ge),consume:ae,enter:qt,exit:_e,interrupt:Mn(ge,{interrupt:!0})},U={code:null,containerState:{},defineSkip:Et,events:[],now:tt,parser:o,previous:null,sliceSerialize:it,sliceStream:st,write:at};let nt=h.tokenize.call(U,J);return h.resolveAll&&P.push(h),U;function at(bn){return B=y3(B,bn),Lt(),B[B.length-1]!==null?[]:(Wn(h,0),U.events=Wjt(P,U.events,U),U.events)}function it(bn,Vn){return x$n(st(bn),Vn)}function st(bn){return v$n(B,bn)}function tt(){const{_bufferIndex:bn,_index:Vn,line:hi,column:$n,offset:Vt}=k;return{_bufferIndex:bn,_index:Vn,line:hi,column:$n,offset:Vt}}function Et(bn){O[bn.line]=bn.column,ar()}function Lt(){let bn;for(;k._index<B.length;){const Vn=B[k._index];if(typeof Vn=="string")for(bn=k._index,k._bufferIndex<0&&(k._bufferIndex=0);k._index===bn&&k._bufferIndex<Vn.length;)Dt(Vn.charCodeAt(k._bufferIndex));else Dt(Vn)}}function Dt(bn){nt=nt(bn)}function ae(bn){Ys(bn)?(k.line++,k.column=1,k.offset+=bn===-3?2:1,ar()):bn!==-1&&(k.column++,k.offset++),k._bufferIndex<0?k._index++:(k._bufferIndex++,k._bufferIndex===B[k._index].length&&(k._bufferIndex=-1,k._index++)),U.previous=bn}function qt(bn,Vn){const hi=Vn||{};return hi.type=bn,hi.start=tt(),U.events.push(["enter",hi,U]),G.push(hi),hi}function _e(bn){const Vn=G.pop();return Vn.end=tt(),U.events.push(["exit",Vn,U]),Vn}function gn(bn,Vn){Wn(bn,Vn.from)}function ge(bn,Vn){Vn.restore()}function Mn(bn,Vn){return hi;function hi($n,Vt,Ye){let jn,er,rr,Be;return Array.isArray($n)?el($n):"tokenize"in $n?el([$n]):Js($n);function Js(Na){return Bs;function Bs(Du){const lu=Du!==null&&Na[Du],Lo=Du!==null&&Na.null,uc=[...Array.isArray(lu)?lu:lu?[lu]:[],...Array.isArray(Lo)?Lo:Lo?[Lo]:[]];return el(uc)(Du)}}function el(Na){return jn=Na,er=0,Na.length===0?Ye:Je(Na[er])}function Je(Na){return Bs;function Bs(Du){return Be=cr(),rr=Na,Na.partial||(U.currentConstruct=Na),Na.name&&U.parser.constructs.disable.null.includes(Na.name)?_o():Na.tokenize.call(Vn?Object.assign(Object.create(U),Vn):U,J,Xs,_o)(Du)}}function Xs(Na){return bn(rr,Be),Vt}function _o(Na){return Be.restore(),++er<jn.length?Je(jn[er]):Ye}}}function Wn(bn,Vn){bn.resolveAll&&!P.includes(bn)&&P.push(bn),bn.resolve&&g6(U.events,Vn,U.events.length-Vn,bn.resolve(U.events.slice(Vn),U)),bn.resolveTo&&(U.events=bn.resolveTo(U.events,U))}function cr(){const bn=tt(),Vn=U.previous,hi=U.currentConstruct,$n=U.events.length,Vt=Array.from(G);return{from:$n,restore:Ye};function Ye(){k=bn,U.previous=Vn,U.currentConstruct=hi,U.events.length=$n,G=Vt,ar()}}function ar(){k.line in O&&k.column<2&&(k.column=O[k.line],k.offset+=O[k.line]-1)}}function v$n(o,h){const b=h.start._index,k=h.start._bufferIndex,O=h.end._index,P=h.end._bufferIndex;let B;if(b===O)B=[o[b].slice(k,P)];else{if(B=o.slice(b,O),k>-1){const G=B[0];typeof G=="string"?B[0]=G.slice(k):B.shift()}P>0&&B.push(o[O].slice(0,P))}return B}function x$n(o,h){let b=-1;const k=[];let O;for(;++b<o.length;){const P=o[b];let B;if(typeof P=="string")B=P;else switch(P){case-5:{B="\r";break}case-4:{B=`
3220
3220
  `;break}case-3:{B=`\r
3221
- `;break}case-2:{B=h?" ":" ";break}case-1:{if(!h&&O)continue;B=" ";break}default:B=String.fromCharCode(P)}O=P===-2,k.push(B)}return k.join("")}function x$n(o){const k={constructs:Cjn([b$n,...(o||{}).extensions||[]]),content:O(Rjn),defined:[],document:O(jjn),flow:O(n$n),lazy:{},string:O(a$n),text:O(o$n)};return k;function O(P){return B;function B(G){return y$n(k,P,G)}}}function k$n(o){for(;!COe(o););return o}const JCe=/[\0\t\n\r]/g;function _$n(){let o=1,h="",b=!0,k;return O;function O(P,B,G){const J=[];let U,nt,at,it,st;for(P=h+(typeof P=="string"?P.toString():new TextDecoder(B||void 0).decode(P)),at=0,h="",b&&(P.charCodeAt(0)===65279&&at++,b=void 0);at<P.length;){if(JCe.lastIndex=at,U=JCe.exec(P),it=U&&U.index!==void 0?U.index:P.length,st=P.charCodeAt(it),!U){h=P.slice(at);break}if(st===10&&at===it&&k)J.push(-3),k=void 0;else switch(k&&(J.push(-5),k=void 0),at<it&&(J.push(P.slice(at,it)),o+=it-at),st){case 0:{J.push(65533),o++;break}case 9:{for(nt=Math.ceil(o/4)*4,J.push(-2);o++<nt;)J.push(-1);break}case 10:{J.push(-4),o=1;break}default:k=!0,o=1}at=it+1}return G&&(k&&J.push(-5),h&&J.push(h),J.push(null)),J}}const E$n=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function T$n(o){return o.replace(E$n,S$n)}function S$n(o,h,b){if(h)return h;if(b.charCodeAt(0)===35){const O=b.charCodeAt(1),P=O===120||O===88;return EOe(b.slice(P?2:1),P?16:10)}return qjt(b)||o}const MOe={}.hasOwnProperty;function I$n(o,h,b){return typeof h!="string"&&(b=h,h=void 0),C$n(b)(k$n(x$n(b).document().write(_$n()(o,h,!0))))}function C$n(o){const h={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:P(X2),autolinkProtocol:cr,autolinkEmail:cr,atxHeading:P(Lh),blockQuote:P(Lo),characterEscape:cr,characterReference:cr,codeFenced:P(uc),codeFencedFenceInfo:B,codeFencedFenceMeta:B,codeIndented:P(uc,B),codeText:P(hu,B),codeTextData:cr,data:cr,codeFlowValue:cr,definition:P(A1),definitionDestinationString:B,definitionLabelString:B,definitionTitleString:B,emphasis:P(nl),hardBreakEscape:P(Cg),hardBreakTrailing:P(Cg),htmlFlow:P(Ag,B),htmlFlowData:cr,htmlText:P(Ag,B),htmlTextData:cr,image:P(Og),label:B,link:P(X2),listItem:P(md),listItemValue:it,listOrdered:P(H0,at),listUnordered:P(H0),paragraph:P(z0),reference:Je,referenceString:B,resourceDestinationString:B,resourceTitleString:B,setextHeading:P(Lh),strong:P(xw),thematicBreak:P(T3)},exit:{atxHeading:J(),atxHeadingSequence:gn,autolink:J(),autolinkEmail:lu,autolinkProtocol:Du,blockQuote:J(),characterEscapeValue:ar,characterReferenceMarkerHexadecimal:_o,characterReferenceMarkerNumeric:_o,characterReferenceValue:Na,characterReference:Bs,codeFenced:J(Lt),codeFencedFence:Et,codeFencedFenceInfo:st,codeFencedFenceMeta:tt,codeFlowValue:ar,codeIndented:J(Dt),codeText:J(Vt),codeTextData:ar,data:ar,definition:J(),definitionDestinationString:_e,definitionLabelString:ae,definitionTitleString:qt,emphasis:J(),hardBreakEscape:J(Vn),hardBreakTrailing:J(Vn),htmlFlow:J(hi),htmlFlowData:ar,htmlText:J($n),htmlTextData:ar,image:J(jn),label:rr,labelText:er,lineEnding:bn,link:J(Ye),listItem:J(),listOrdered:J(),listUnordered:J(),paragraph:J(),referenceString:Xs,resourceDestinationString:Be,resourceTitleString:Js,resource:el,setextHeading:J(Wn),setextHeadingLineSequence:Mn,setextHeadingText:ge,strong:J(),thematicBreak:J()}};DOe(h,(o||{}).mdastExtensions||[]);const b={};return k;function k(qr){let da={type:"root",children:[]};const Uo={stack:[da],tokenStack:[],config:h,enter:G,exit:U,buffer:B,resume:nt,data:b},lc=[];let _u=-1;for(;++_u<qr.length;)if(qr[_u][1].type==="listOrdered"||qr[_u][1].type==="listUnordered")if(qr[_u][0]==="enter")lc.push(_u);else{const eu=lc.pop();_u=O(qr,eu,_u)}for(_u=-1;++_u<qr.length;){const eu=h[qr[_u][0]];MOe.call(eu,qr[_u][1].type)&&eu[qr[_u][1].type].call(Object.assign({sliceSerialize:qr[_u][2].sliceSerialize},Uo),qr[_u][1])}if(Uo.tokenStack.length>0){const eu=Uo.tokenStack[Uo.tokenStack.length-1];(eu[1]||XCe).call(Uo,void 0,eu[0])}for(da.position={start:z8(qr.length>0?qr[0][1].start:{line:1,column:1,offset:0}),end:z8(qr.length>0?qr[qr.length-2][1].end:{line:1,column:1,offset:0})},_u=-1;++_u<h.transforms.length;)da=h.transforms[_u](da)||da;return da}function O(qr,da,Uo){let lc=da-1,_u=-1,eu=!1,Ng,sp,Y5,Co;for(;++lc<=Uo;){const Bc=qr[lc];switch(Bc[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Bc[0]==="enter"?_u++:_u--,Co=void 0;break}case"lineEndingBlank":{Bc[0]==="enter"&&(Ng&&!Co&&!_u&&!Y5&&(Y5=lc),Co=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Co=void 0}if(!_u&&Bc[0]==="enter"&&Bc[1].type==="listItemPrefix"||_u===-1&&Bc[0]==="exit"&&(Bc[1].type==="listUnordered"||Bc[1].type==="listOrdered")){if(Ng){let Mh=lc;for(sp=void 0;Mh--;){const Qp=qr[Mh];if(Qp[1].type==="lineEnding"||Qp[1].type==="lineEndingBlank"){if(Qp[0]==="exit")continue;sp&&(qr[sp][1].type="lineEndingBlank",eu=!0),Qp[1].type="lineEnding",sp=Mh}else if(!(Qp[1].type==="linePrefix"||Qp[1].type==="blockQuotePrefix"||Qp[1].type==="blockQuotePrefixWhitespace"||Qp[1].type==="blockQuoteMarker"||Qp[1].type==="listItemIndent"))break}Y5&&(!sp||Y5<sp)&&(Ng._spread=!0),Ng.end=Object.assign({},sp?qr[sp][1].start:Bc[1].end),qr.splice(sp||lc,0,["exit",Ng,Bc[2]]),lc++,Uo++}if(Bc[1].type==="listItemPrefix"){const Mh={type:"listItem",_spread:!1,start:Object.assign({},Bc[1].start),end:void 0};Ng=Mh,qr.splice(lc,0,["enter",Mh,Bc[2]]),lc++,Uo++,Y5=void 0,Co=!0}}}return qr[da][1]._spread=eu,Uo}function P(qr,da){return Uo;function Uo(lc){G.call(this,qr(lc),lc),da&&da.call(this,lc)}}function B(){this.stack.push({type:"fragment",children:[]})}function G(qr,da,Uo){this.stack[this.stack.length-1].children.push(qr),this.stack.push(qr),this.tokenStack.push([da,Uo||void 0]),qr.position={start:z8(da.start),end:void 0}}function J(qr){return da;function da(Uo){qr&&qr.call(this,Uo),U.call(this,Uo)}}function U(qr,da){const Uo=this.stack.pop(),lc=this.tokenStack.pop();if(lc)lc[0].type!==qr.type&&(da?da.call(this,qr,lc[0]):(lc[1]||XCe).call(this,qr,lc[0]));else throw new Error("Cannot close `"+qr.type+"` ("+dX({start:qr.start,end:qr.end})+"): it’s not open");Uo.position.end=z8(qr.end)}function nt(){return Sjn(this.stack.pop())}function at(){this.data.expectingFirstListItemValue=!0}function it(qr){if(this.data.expectingFirstListItemValue){const da=this.stack[this.stack.length-2];da.start=Number.parseInt(this.sliceSerialize(qr),10),this.data.expectingFirstListItemValue=void 0}}function st(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.lang=qr}function tt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.meta=qr}function Et(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Lt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function Dt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr.replace(/(\r?\n|\r)$/g,"")}function ae(qr){const da=this.resume(),Uo=this.stack[this.stack.length-1];Uo.label=da,Uo.identifier=Nj(this.sliceSerialize(qr)).toLowerCase()}function qt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.title=qr}function _e(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.url=qr}function gn(qr){const da=this.stack[this.stack.length-1];if(!da.depth){const Uo=this.sliceSerialize(qr).length;da.depth=Uo}}function ge(){this.data.setextHeadingSlurpLineEnding=!0}function Mn(qr){const da=this.stack[this.stack.length-1];da.depth=this.sliceSerialize(qr).codePointAt(0)===61?1:2}function Wn(){this.data.setextHeadingSlurpLineEnding=void 0}function cr(qr){const Uo=this.stack[this.stack.length-1].children;let lc=Uo[Uo.length-1];(!lc||lc.type!=="text")&&(lc=Vd(),lc.position={start:z8(qr.start),end:void 0},Uo.push(lc)),this.stack.push(lc)}function ar(qr){const da=this.stack.pop();da.value+=this.sliceSerialize(qr),da.position.end=z8(qr.end)}function bn(qr){const da=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Uo=da.children[da.children.length-1];Uo.position.end=z8(qr.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&h.canContainEols.includes(da.type)&&(cr.call(this,qr),ar.call(this,qr))}function Vn(){this.data.atHardBreak=!0}function hi(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr}function $n(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr}function Vt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr}function Ye(){const qr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";qr.type+="Reference",qr.referenceType=da,delete qr.url,delete qr.title}else delete qr.identifier,delete qr.label;this.data.referenceType=void 0}function jn(){const qr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";qr.type+="Reference",qr.referenceType=da,delete qr.url,delete qr.title}else delete qr.identifier,delete qr.label;this.data.referenceType=void 0}function er(qr){const da=this.sliceSerialize(qr),Uo=this.stack[this.stack.length-2];Uo.label=T$n(da),Uo.identifier=Nj(da).toLowerCase()}function rr(){const qr=this.stack[this.stack.length-1],da=this.resume(),Uo=this.stack[this.stack.length-1];if(this.data.inReference=!0,Uo.type==="link"){const lc=qr.children;Uo.children=lc}else Uo.alt=da}function Be(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.url=qr}function Js(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.title=qr}function el(){this.data.inReference=void 0}function Je(){this.data.referenceType="collapsed"}function Xs(qr){const da=this.resume(),Uo=this.stack[this.stack.length-1];Uo.label=da,Uo.identifier=Nj(this.sliceSerialize(qr)).toLowerCase(),this.data.referenceType="full"}function _o(qr){this.data.characterReferenceType=qr.type}function Na(qr){const da=this.sliceSerialize(qr),Uo=this.data.characterReferenceType;let lc;Uo?(lc=EOe(da,Uo==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):lc=qjt(da);const _u=this.stack[this.stack.length-1];_u.value+=lc}function Bs(qr){const da=this.stack.pop();da.position.end=z8(qr.end)}function Du(qr){ar.call(this,qr);const da=this.stack[this.stack.length-1];da.url=this.sliceSerialize(qr)}function lu(qr){ar.call(this,qr);const da=this.stack[this.stack.length-1];da.url="mailto:"+this.sliceSerialize(qr)}function Lo(){return{type:"blockquote",children:[]}}function uc(){return{type:"code",lang:null,meta:null,value:""}}function hu(){return{type:"inlineCode",value:""}}function A1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function nl(){return{type:"emphasis",children:[]}}function Lh(){return{type:"heading",depth:0,children:[]}}function Cg(){return{type:"break"}}function Ag(){return{type:"html",value:""}}function Og(){return{type:"image",title:null,url:"",alt:null}}function X2(){return{type:"link",title:null,url:"",children:[]}}function H0(qr){return{type:"list",ordered:qr.type==="listOrdered",start:null,spread:qr._spread,children:[]}}function md(qr){return{type:"listItem",spread:qr._spread,checked:null,children:[]}}function z0(){return{type:"paragraph",children:[]}}function xw(){return{type:"strong",children:[]}}function Vd(){return{type:"text",value:""}}function T3(){return{type:"thematicBreak"}}}function z8(o){return{line:o.line,column:o.column,offset:o.offset}}function DOe(o,h){let b=-1;for(;++b<h.length;){const k=h[b];Array.isArray(k)?DOe(o,k):A$n(o,k)}}function A$n(o,h){let b;for(b in h)if(MOe.call(h,b))switch(b){case"canContainEols":{const k=h[b];k&&o[b].push(...k);break}case"transforms":{const k=h[b];k&&o[b].push(...k);break}case"enter":case"exit":{const k=h[b];k&&Object.assign(o[b],k);break}}}function XCe(o,h){throw o?new Error("Cannot close `"+o.type+"` ("+dX({start:o.start,end:o.end})+"): a different token (`"+h.type+"`, "+dX({start:h.start,end:h.end})+") is open"):new Error("Cannot close document, a token (`"+h.type+"`, "+dX({start:h.start,end:h.end})+") is still open")}function O$n(o){const h=this;h.parser=b;function b(k){return I$n(k,{...h.data("settings"),...o,extensions:h.data("micromarkExtensions")||[],mdastExtensions:h.data("fromMarkdownExtensions")||[]})}}function N$n(o,h){const b={type:"element",tagName:"blockquote",properties:{},children:o.wrap(o.all(h),!0)};return o.patch(h,b),o.applyData(h,b)}function P$n(o,h){const b={type:"element",tagName:"br",properties:{},children:[]};return o.patch(h,b),[o.applyData(h,b),{type:"text",value:`
3222
- `}]}function L$n(o,h){const b=h.value?h.value+`
3223
- `:"",k={};h.lang&&(k.className=["language-"+h.lang]);let O={type:"element",tagName:"code",properties:k,children:[{type:"text",value:b}]};return h.meta&&(O.data={meta:h.meta}),o.patch(h,O),O=o.applyData(h,O),O={type:"element",tagName:"pre",properties:{},children:[O]},o.patch(h,O),O}function M$n(o,h){const b={type:"element",tagName:"del",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function D$n(o,h){const b={type:"element",tagName:"em",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function R$n(o,h){const b=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",k=String(h.identifier).toUpperCase(),O=Jj(k.toLowerCase()),P=o.footnoteOrder.indexOf(k);let B,G=o.footnoteCounts.get(k);G===void 0?(G=0,o.footnoteOrder.push(k),B=o.footnoteOrder.length):B=P+1,G+=1,o.footnoteCounts.set(k,G);const J={type:"element",tagName:"a",properties:{href:"#"+b+"fn-"+O,id:b+"fnref-"+O+(G>1?"-"+G:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(B)}]};o.patch(h,J);const U={type:"element",tagName:"sup",properties:{},children:[J]};return o.patch(h,U),o.applyData(h,U)}function B$n(o,h){const b={type:"element",tagName:"h"+h.depth,properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function j$n(o,h){if(o.options.allowDangerousHtml){const b={type:"raw",value:h.value};return o.patch(h,b),o.applyData(h,b)}}function ROe(o,h){const b=h.referenceType;let k="]";if(b==="collapsed"?k+="[]":b==="full"&&(k+="["+(h.label||h.identifier)+"]"),h.type==="imageReference")return[{type:"text",value:"!["+h.alt+k}];const O=o.all(h),P=O[0];P&&P.type==="text"?P.value="["+P.value:O.unshift({type:"text",value:"["});const B=O[O.length-1];return B&&B.type==="text"?B.value+=k:O.push({type:"text",value:k}),O}function F$n(o,h){const b=String(h.identifier).toUpperCase(),k=o.definitionById.get(b);if(!k)return ROe(o,h);const O={src:Jj(k.url||""),alt:h.alt};k.title!==null&&k.title!==void 0&&(O.title=k.title);const P={type:"element",tagName:"img",properties:O,children:[]};return o.patch(h,P),o.applyData(h,P)}function $$n(o,h){const b={src:Jj(h.url)};h.alt!==null&&h.alt!==void 0&&(b.alt=h.alt),h.title!==null&&h.title!==void 0&&(b.title=h.title);const k={type:"element",tagName:"img",properties:b,children:[]};return o.patch(h,k),o.applyData(h,k)}function H$n(o,h){const b={type:"text",value:h.value.replace(/\r?\n|\r/g," ")};o.patch(h,b);const k={type:"element",tagName:"code",properties:{},children:[b]};return o.patch(h,k),o.applyData(h,k)}function z$n(o,h){const b=String(h.identifier).toUpperCase(),k=o.definitionById.get(b);if(!k)return ROe(o,h);const O={href:Jj(k.url||"")};k.title!==null&&k.title!==void 0&&(O.title=k.title);const P={type:"element",tagName:"a",properties:O,children:o.all(h)};return o.patch(h,P),o.applyData(h,P)}function U$n(o,h){const b={href:Jj(h.url)};h.title!==null&&h.title!==void 0&&(b.title=h.title);const k={type:"element",tagName:"a",properties:b,children:o.all(h)};return o.patch(h,k),o.applyData(h,k)}function G$n(o,h,b){const k=o.all(h),O=b?q$n(b):BOe(h),P={},B=[];if(typeof h.checked=="boolean"){const nt=k[0];let at;nt&&nt.type==="element"&&nt.tagName==="p"?at=nt:(at={type:"element",tagName:"p",properties:{},children:[]},k.unshift(at)),at.children.length>0&&at.children.unshift({type:"text",value:" "}),at.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:h.checked,disabled:!0},children:[]}),P.className=["task-list-item"]}let G=-1;for(;++G<k.length;){const nt=k[G];(O||G!==0||nt.type!=="element"||nt.tagName!=="p")&&B.push({type:"text",value:`
3221
+ `;break}case-2:{B=h?" ":" ";break}case-1:{if(!h&&O)continue;B=" ";break}default:B=String.fromCharCode(P)}O=P===-2,k.push(B)}return k.join("")}function k$n(o){const k={constructs:Ajn([y$n,...(o||{}).extensions||[]]),content:O(Bjn),defined:[],document:O(Fjn),flow:O(r$n),lazy:{},string:O(o$n),text:O(s$n)};return k;function O(P){return B;function B(G){return w$n(k,P,G)}}}function _$n(o){for(;!COe(o););return o}const JCe=/[\0\t\n\r]/g;function E$n(){let o=1,h="",b=!0,k;return O;function O(P,B,G){const J=[];let U,nt,at,it,st;for(P=h+(typeof P=="string"?P.toString():new TextDecoder(B||void 0).decode(P)),at=0,h="",b&&(P.charCodeAt(0)===65279&&at++,b=void 0);at<P.length;){if(JCe.lastIndex=at,U=JCe.exec(P),it=U&&U.index!==void 0?U.index:P.length,st=P.charCodeAt(it),!U){h=P.slice(at);break}if(st===10&&at===it&&k)J.push(-3),k=void 0;else switch(k&&(J.push(-5),k=void 0),at<it&&(J.push(P.slice(at,it)),o+=it-at),st){case 0:{J.push(65533),o++;break}case 9:{for(nt=Math.ceil(o/4)*4,J.push(-2);o++<nt;)J.push(-1);break}case 10:{J.push(-4),o=1;break}default:k=!0,o=1}at=it+1}return G&&(k&&J.push(-5),h&&J.push(h),J.push(null)),J}}const T$n=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function S$n(o){return o.replace(T$n,I$n)}function I$n(o,h,b){if(h)return h;if(b.charCodeAt(0)===35){const O=b.charCodeAt(1),P=O===120||O===88;return EOe(b.slice(P?2:1),P?16:10)}return qjt(b)||o}const MOe={}.hasOwnProperty;function C$n(o,h,b){return typeof h!="string"&&(b=h,h=void 0),A$n(b)(_$n(k$n(b).document().write(E$n()(o,h,!0))))}function A$n(o){const h={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:P(X2),autolinkProtocol:cr,autolinkEmail:cr,atxHeading:P(Lh),blockQuote:P(Lo),characterEscape:cr,characterReference:cr,codeFenced:P(uc),codeFencedFenceInfo:B,codeFencedFenceMeta:B,codeIndented:P(uc,B),codeText:P(hu,B),codeTextData:cr,data:cr,codeFlowValue:cr,definition:P(A1),definitionDestinationString:B,definitionLabelString:B,definitionTitleString:B,emphasis:P(nl),hardBreakEscape:P(Cg),hardBreakTrailing:P(Cg),htmlFlow:P(Ag,B),htmlFlowData:cr,htmlText:P(Ag,B),htmlTextData:cr,image:P(Og),label:B,link:P(X2),listItem:P(md),listItemValue:it,listOrdered:P(H0,at),listUnordered:P(H0),paragraph:P(z0),reference:Je,referenceString:B,resourceDestinationString:B,resourceTitleString:B,setextHeading:P(Lh),strong:P(xw),thematicBreak:P(T3)},exit:{atxHeading:J(),atxHeadingSequence:gn,autolink:J(),autolinkEmail:lu,autolinkProtocol:Du,blockQuote:J(),characterEscapeValue:ar,characterReferenceMarkerHexadecimal:_o,characterReferenceMarkerNumeric:_o,characterReferenceValue:Na,characterReference:Bs,codeFenced:J(Lt),codeFencedFence:Et,codeFencedFenceInfo:st,codeFencedFenceMeta:tt,codeFlowValue:ar,codeIndented:J(Dt),codeText:J(Vt),codeTextData:ar,data:ar,definition:J(),definitionDestinationString:_e,definitionLabelString:ae,definitionTitleString:qt,emphasis:J(),hardBreakEscape:J(Vn),hardBreakTrailing:J(Vn),htmlFlow:J(hi),htmlFlowData:ar,htmlText:J($n),htmlTextData:ar,image:J(jn),label:rr,labelText:er,lineEnding:bn,link:J(Ye),listItem:J(),listOrdered:J(),listUnordered:J(),paragraph:J(),referenceString:Xs,resourceDestinationString:Be,resourceTitleString:Js,resource:el,setextHeading:J(Wn),setextHeadingLineSequence:Mn,setextHeadingText:ge,strong:J(),thematicBreak:J()}};DOe(h,(o||{}).mdastExtensions||[]);const b={};return k;function k(qr){let da={type:"root",children:[]};const Uo={stack:[da],tokenStack:[],config:h,enter:G,exit:U,buffer:B,resume:nt,data:b},lc=[];let _u=-1;for(;++_u<qr.length;)if(qr[_u][1].type==="listOrdered"||qr[_u][1].type==="listUnordered")if(qr[_u][0]==="enter")lc.push(_u);else{const eu=lc.pop();_u=O(qr,eu,_u)}for(_u=-1;++_u<qr.length;){const eu=h[qr[_u][0]];MOe.call(eu,qr[_u][1].type)&&eu[qr[_u][1].type].call(Object.assign({sliceSerialize:qr[_u][2].sliceSerialize},Uo),qr[_u][1])}if(Uo.tokenStack.length>0){const eu=Uo.tokenStack[Uo.tokenStack.length-1];(eu[1]||XCe).call(Uo,void 0,eu[0])}for(da.position={start:z8(qr.length>0?qr[0][1].start:{line:1,column:1,offset:0}),end:z8(qr.length>0?qr[qr.length-2][1].end:{line:1,column:1,offset:0})},_u=-1;++_u<h.transforms.length;)da=h.transforms[_u](da)||da;return da}function O(qr,da,Uo){let lc=da-1,_u=-1,eu=!1,Ng,sp,Y5,Co;for(;++lc<=Uo;){const Bc=qr[lc];switch(Bc[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Bc[0]==="enter"?_u++:_u--,Co=void 0;break}case"lineEndingBlank":{Bc[0]==="enter"&&(Ng&&!Co&&!_u&&!Y5&&(Y5=lc),Co=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Co=void 0}if(!_u&&Bc[0]==="enter"&&Bc[1].type==="listItemPrefix"||_u===-1&&Bc[0]==="exit"&&(Bc[1].type==="listUnordered"||Bc[1].type==="listOrdered")){if(Ng){let Mh=lc;for(sp=void 0;Mh--;){const Qp=qr[Mh];if(Qp[1].type==="lineEnding"||Qp[1].type==="lineEndingBlank"){if(Qp[0]==="exit")continue;sp&&(qr[sp][1].type="lineEndingBlank",eu=!0),Qp[1].type="lineEnding",sp=Mh}else if(!(Qp[1].type==="linePrefix"||Qp[1].type==="blockQuotePrefix"||Qp[1].type==="blockQuotePrefixWhitespace"||Qp[1].type==="blockQuoteMarker"||Qp[1].type==="listItemIndent"))break}Y5&&(!sp||Y5<sp)&&(Ng._spread=!0),Ng.end=Object.assign({},sp?qr[sp][1].start:Bc[1].end),qr.splice(sp||lc,0,["exit",Ng,Bc[2]]),lc++,Uo++}if(Bc[1].type==="listItemPrefix"){const Mh={type:"listItem",_spread:!1,start:Object.assign({},Bc[1].start),end:void 0};Ng=Mh,qr.splice(lc,0,["enter",Mh,Bc[2]]),lc++,Uo++,Y5=void 0,Co=!0}}}return qr[da][1]._spread=eu,Uo}function P(qr,da){return Uo;function Uo(lc){G.call(this,qr(lc),lc),da&&da.call(this,lc)}}function B(){this.stack.push({type:"fragment",children:[]})}function G(qr,da,Uo){this.stack[this.stack.length-1].children.push(qr),this.stack.push(qr),this.tokenStack.push([da,Uo||void 0]),qr.position={start:z8(da.start),end:void 0}}function J(qr){return da;function da(Uo){qr&&qr.call(this,Uo),U.call(this,Uo)}}function U(qr,da){const Uo=this.stack.pop(),lc=this.tokenStack.pop();if(lc)lc[0].type!==qr.type&&(da?da.call(this,qr,lc[0]):(lc[1]||XCe).call(this,qr,lc[0]));else throw new Error("Cannot close `"+qr.type+"` ("+dX({start:qr.start,end:qr.end})+"): it’s not open");Uo.position.end=z8(qr.end)}function nt(){return Ijn(this.stack.pop())}function at(){this.data.expectingFirstListItemValue=!0}function it(qr){if(this.data.expectingFirstListItemValue){const da=this.stack[this.stack.length-2];da.start=Number.parseInt(this.sliceSerialize(qr),10),this.data.expectingFirstListItemValue=void 0}}function st(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.lang=qr}function tt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.meta=qr}function Et(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Lt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function Dt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr.replace(/(\r?\n|\r)$/g,"")}function ae(qr){const da=this.resume(),Uo=this.stack[this.stack.length-1];Uo.label=da,Uo.identifier=Nj(this.sliceSerialize(qr)).toLowerCase()}function qt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.title=qr}function _e(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.url=qr}function gn(qr){const da=this.stack[this.stack.length-1];if(!da.depth){const Uo=this.sliceSerialize(qr).length;da.depth=Uo}}function ge(){this.data.setextHeadingSlurpLineEnding=!0}function Mn(qr){const da=this.stack[this.stack.length-1];da.depth=this.sliceSerialize(qr).codePointAt(0)===61?1:2}function Wn(){this.data.setextHeadingSlurpLineEnding=void 0}function cr(qr){const Uo=this.stack[this.stack.length-1].children;let lc=Uo[Uo.length-1];(!lc||lc.type!=="text")&&(lc=Vd(),lc.position={start:z8(qr.start),end:void 0},Uo.push(lc)),this.stack.push(lc)}function ar(qr){const da=this.stack.pop();da.value+=this.sliceSerialize(qr),da.position.end=z8(qr.end)}function bn(qr){const da=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Uo=da.children[da.children.length-1];Uo.position.end=z8(qr.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&h.canContainEols.includes(da.type)&&(cr.call(this,qr),ar.call(this,qr))}function Vn(){this.data.atHardBreak=!0}function hi(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr}function $n(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr}function Vt(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.value=qr}function Ye(){const qr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";qr.type+="Reference",qr.referenceType=da,delete qr.url,delete qr.title}else delete qr.identifier,delete qr.label;this.data.referenceType=void 0}function jn(){const qr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";qr.type+="Reference",qr.referenceType=da,delete qr.url,delete qr.title}else delete qr.identifier,delete qr.label;this.data.referenceType=void 0}function er(qr){const da=this.sliceSerialize(qr),Uo=this.stack[this.stack.length-2];Uo.label=S$n(da),Uo.identifier=Nj(da).toLowerCase()}function rr(){const qr=this.stack[this.stack.length-1],da=this.resume(),Uo=this.stack[this.stack.length-1];if(this.data.inReference=!0,Uo.type==="link"){const lc=qr.children;Uo.children=lc}else Uo.alt=da}function Be(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.url=qr}function Js(){const qr=this.resume(),da=this.stack[this.stack.length-1];da.title=qr}function el(){this.data.inReference=void 0}function Je(){this.data.referenceType="collapsed"}function Xs(qr){const da=this.resume(),Uo=this.stack[this.stack.length-1];Uo.label=da,Uo.identifier=Nj(this.sliceSerialize(qr)).toLowerCase(),this.data.referenceType="full"}function _o(qr){this.data.characterReferenceType=qr.type}function Na(qr){const da=this.sliceSerialize(qr),Uo=this.data.characterReferenceType;let lc;Uo?(lc=EOe(da,Uo==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):lc=qjt(da);const _u=this.stack[this.stack.length-1];_u.value+=lc}function Bs(qr){const da=this.stack.pop();da.position.end=z8(qr.end)}function Du(qr){ar.call(this,qr);const da=this.stack[this.stack.length-1];da.url=this.sliceSerialize(qr)}function lu(qr){ar.call(this,qr);const da=this.stack[this.stack.length-1];da.url="mailto:"+this.sliceSerialize(qr)}function Lo(){return{type:"blockquote",children:[]}}function uc(){return{type:"code",lang:null,meta:null,value:""}}function hu(){return{type:"inlineCode",value:""}}function A1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function nl(){return{type:"emphasis",children:[]}}function Lh(){return{type:"heading",depth:0,children:[]}}function Cg(){return{type:"break"}}function Ag(){return{type:"html",value:""}}function Og(){return{type:"image",title:null,url:"",alt:null}}function X2(){return{type:"link",title:null,url:"",children:[]}}function H0(qr){return{type:"list",ordered:qr.type==="listOrdered",start:null,spread:qr._spread,children:[]}}function md(qr){return{type:"listItem",spread:qr._spread,checked:null,children:[]}}function z0(){return{type:"paragraph",children:[]}}function xw(){return{type:"strong",children:[]}}function Vd(){return{type:"text",value:""}}function T3(){return{type:"thematicBreak"}}}function z8(o){return{line:o.line,column:o.column,offset:o.offset}}function DOe(o,h){let b=-1;for(;++b<h.length;){const k=h[b];Array.isArray(k)?DOe(o,k):O$n(o,k)}}function O$n(o,h){let b;for(b in h)if(MOe.call(h,b))switch(b){case"canContainEols":{const k=h[b];k&&o[b].push(...k);break}case"transforms":{const k=h[b];k&&o[b].push(...k);break}case"enter":case"exit":{const k=h[b];k&&Object.assign(o[b],k);break}}}function XCe(o,h){throw o?new Error("Cannot close `"+o.type+"` ("+dX({start:o.start,end:o.end})+"): a different token (`"+h.type+"`, "+dX({start:h.start,end:h.end})+") is open"):new Error("Cannot close document, a token (`"+h.type+"`, "+dX({start:h.start,end:h.end})+") is still open")}function N$n(o){const h=this;h.parser=b;function b(k){return C$n(k,{...h.data("settings"),...o,extensions:h.data("micromarkExtensions")||[],mdastExtensions:h.data("fromMarkdownExtensions")||[]})}}function P$n(o,h){const b={type:"element",tagName:"blockquote",properties:{},children:o.wrap(o.all(h),!0)};return o.patch(h,b),o.applyData(h,b)}function L$n(o,h){const b={type:"element",tagName:"br",properties:{},children:[]};return o.patch(h,b),[o.applyData(h,b),{type:"text",value:`
3222
+ `}]}function M$n(o,h){const b=h.value?h.value+`
3223
+ `:"",k={};h.lang&&(k.className=["language-"+h.lang]);let O={type:"element",tagName:"code",properties:k,children:[{type:"text",value:b}]};return h.meta&&(O.data={meta:h.meta}),o.patch(h,O),O=o.applyData(h,O),O={type:"element",tagName:"pre",properties:{},children:[O]},o.patch(h,O),O}function D$n(o,h){const b={type:"element",tagName:"del",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function R$n(o,h){const b={type:"element",tagName:"em",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function B$n(o,h){const b=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",k=String(h.identifier).toUpperCase(),O=Jj(k.toLowerCase()),P=o.footnoteOrder.indexOf(k);let B,G=o.footnoteCounts.get(k);G===void 0?(G=0,o.footnoteOrder.push(k),B=o.footnoteOrder.length):B=P+1,G+=1,o.footnoteCounts.set(k,G);const J={type:"element",tagName:"a",properties:{href:"#"+b+"fn-"+O,id:b+"fnref-"+O+(G>1?"-"+G:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(B)}]};o.patch(h,J);const U={type:"element",tagName:"sup",properties:{},children:[J]};return o.patch(h,U),o.applyData(h,U)}function j$n(o,h){const b={type:"element",tagName:"h"+h.depth,properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function F$n(o,h){if(o.options.allowDangerousHtml){const b={type:"raw",value:h.value};return o.patch(h,b),o.applyData(h,b)}}function ROe(o,h){const b=h.referenceType;let k="]";if(b==="collapsed"?k+="[]":b==="full"&&(k+="["+(h.label||h.identifier)+"]"),h.type==="imageReference")return[{type:"text",value:"!["+h.alt+k}];const O=o.all(h),P=O[0];P&&P.type==="text"?P.value="["+P.value:O.unshift({type:"text",value:"["});const B=O[O.length-1];return B&&B.type==="text"?B.value+=k:O.push({type:"text",value:k}),O}function $$n(o,h){const b=String(h.identifier).toUpperCase(),k=o.definitionById.get(b);if(!k)return ROe(o,h);const O={src:Jj(k.url||""),alt:h.alt};k.title!==null&&k.title!==void 0&&(O.title=k.title);const P={type:"element",tagName:"img",properties:O,children:[]};return o.patch(h,P),o.applyData(h,P)}function H$n(o,h){const b={src:Jj(h.url)};h.alt!==null&&h.alt!==void 0&&(b.alt=h.alt),h.title!==null&&h.title!==void 0&&(b.title=h.title);const k={type:"element",tagName:"img",properties:b,children:[]};return o.patch(h,k),o.applyData(h,k)}function z$n(o,h){const b={type:"text",value:h.value.replace(/\r?\n|\r/g," ")};o.patch(h,b);const k={type:"element",tagName:"code",properties:{},children:[b]};return o.patch(h,k),o.applyData(h,k)}function U$n(o,h){const b=String(h.identifier).toUpperCase(),k=o.definitionById.get(b);if(!k)return ROe(o,h);const O={href:Jj(k.url||"")};k.title!==null&&k.title!==void 0&&(O.title=k.title);const P={type:"element",tagName:"a",properties:O,children:o.all(h)};return o.patch(h,P),o.applyData(h,P)}function G$n(o,h){const b={href:Jj(h.url)};h.title!==null&&h.title!==void 0&&(b.title=h.title);const k={type:"element",tagName:"a",properties:b,children:o.all(h)};return o.patch(h,k),o.applyData(h,k)}function q$n(o,h,b){const k=o.all(h),O=b?W$n(b):BOe(h),P={},B=[];if(typeof h.checked=="boolean"){const nt=k[0];let at;nt&&nt.type==="element"&&nt.tagName==="p"?at=nt:(at={type:"element",tagName:"p",properties:{},children:[]},k.unshift(at)),at.children.length>0&&at.children.unshift({type:"text",value:" "}),at.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:h.checked,disabled:!0},children:[]}),P.className=["task-list-item"]}let G=-1;for(;++G<k.length;){const nt=k[G];(O||G!==0||nt.type!=="element"||nt.tagName!=="p")&&B.push({type:"text",value:`
3224
3224
  `}),nt.type==="element"&&nt.tagName==="p"&&!O?B.push(...nt.children):B.push(nt)}const J=k[k.length-1];J&&(O||J.type!=="element"||J.tagName!=="p")&&B.push({type:"text",value:`
3225
- `});const U={type:"element",tagName:"li",properties:P,children:B};return o.patch(h,U),o.applyData(h,U)}function q$n(o){let h=!1;if(o.type==="list"){h=o.spread||!1;const b=o.children;let k=-1;for(;!h&&++k<b.length;)h=BOe(b[k])}return h}function BOe(o){const h=o.spread;return h??o.children.length>1}function W$n(o,h){const b={},k=o.all(h);let O=-1;for(typeof h.start=="number"&&h.start!==1&&(b.start=h.start);++O<k.length;){const B=k[O];if(B.type==="element"&&B.tagName==="li"&&B.properties&&Array.isArray(B.properties.className)&&B.properties.className.includes("task-list-item")){b.className=["contains-task-list"];break}}const P={type:"element",tagName:h.ordered?"ol":"ul",properties:b,children:o.wrap(k,!0)};return o.patch(h,P),o.applyData(h,P)}function K$n(o,h){const b={type:"element",tagName:"p",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function V$n(o,h){const b={type:"root",children:o.wrap(o.all(h))};return o.patch(h,b),o.applyData(h,b)}function Y$n(o,h){const b={type:"element",tagName:"strong",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function J$n(o,h){const b=o.all(h),k=b.shift(),O=[];if(k){const B={type:"element",tagName:"thead",properties:{},children:o.wrap([k],!0)};o.patch(h.children[0],B),O.push(B)}if(b.length>0){const B={type:"element",tagName:"tbody",properties:{},children:o.wrap(b,!0)},G=b6(h.children[1]),J=Ebt(h.children[h.children.length-1]);G&&J&&(B.position={start:G,end:J}),O.push(B)}const P={type:"element",tagName:"table",properties:{},children:o.wrap(O,!0)};return o.patch(h,P),o.applyData(h,P)}function X$n(o,h,b){const k=b?b.children:void 0,P=(k?k.indexOf(h):1)===0?"th":"td",B=b&&b.type==="table"?b.align:void 0,G=B?B.length:h.children.length;let J=-1;const U=[];for(;++J<G;){const at=h.children[J],it={},st=B?B[J]:void 0;st&&(it.align=st);let tt={type:"element",tagName:P,properties:it,children:[]};at&&(tt.children=o.all(at),o.patch(at,tt),tt=o.applyData(at,tt)),U.push(tt)}const nt={type:"element",tagName:"tr",properties:{},children:o.wrap(U,!0)};return o.patch(h,nt),o.applyData(h,nt)}function Q$n(o,h){const b={type:"element",tagName:"td",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}const QCe=9,ZCe=32;function Z$n(o){const h=String(o),b=/\r?\n|\r/g;let k=b.exec(h),O=0;const P=[];for(;k;)P.push(tAe(h.slice(O,k.index),O>0,!0),k[0]),O=k.index+k[0].length,k=b.exec(h);return P.push(tAe(h.slice(O),O>0,!1)),P.join("")}function tAe(o,h,b){let k=0,O=o.length;if(h){let P=o.codePointAt(k);for(;P===QCe||P===ZCe;)k++,P=o.codePointAt(k)}if(b){let P=o.codePointAt(O-1);for(;P===QCe||P===ZCe;)O--,P=o.codePointAt(O-1)}return O>k?o.slice(k,O):""}function tHn(o,h){const b={type:"text",value:Z$n(String(h.value))};return o.patch(h,b),o.applyData(h,b)}function eHn(o,h){const b={type:"element",tagName:"hr",properties:{},children:[]};return o.patch(h,b),o.applyData(h,b)}const nHn={blockquote:N$n,break:P$n,code:L$n,delete:M$n,emphasis:D$n,footnoteReference:R$n,heading:B$n,html:j$n,imageReference:F$n,image:$$n,inlineCode:H$n,linkReference:z$n,link:U$n,listItem:G$n,list:W$n,paragraph:K$n,root:V$n,strong:Y$n,table:J$n,tableCell:Q$n,tableRow:X$n,text:tHn,thematicBreak:eHn,toml:bmt,yaml:bmt,definition:bmt,footnoteDefinition:bmt};function bmt(){}const jOe=-1,Sbt=0,gX=1,Ymt=2,Vjt=3,Yjt=4,Jjt=5,Xjt=6,FOe=7,$Oe=8,eAe=typeof self=="object"?self:globalThis,rHn=(o,h)=>{const b=(O,P)=>(o.set(P,O),O),k=O=>{if(o.has(O))return o.get(O);const[P,B]=h[O];switch(P){case Sbt:case jOe:return b(B,O);case gX:{const G=b([],O);for(const J of B)G.push(k(J));return G}case Ymt:{const G=b({},O);for(const[J,U]of B)G[k(J)]=k(U);return G}case Vjt:return b(new Date(B),O);case Yjt:{const{source:G,flags:J}=B;return b(new RegExp(G,J),O)}case Jjt:{const G=b(new Map,O);for(const[J,U]of B)G.set(k(J),k(U));return G}case Xjt:{const G=b(new Set,O);for(const J of B)G.add(k(J));return G}case FOe:{const{name:G,message:J}=B;return b(new eAe[G](J),O)}case $Oe:return b(BigInt(B),O);case"BigInt":return b(Object(BigInt(B)),O);case"ArrayBuffer":return b(new Uint8Array(B).buffer,B);case"DataView":{const{buffer:G}=new Uint8Array(B);return b(new DataView(G),B)}}return b(new eAe[P](B),O)};return k},nAe=o=>rHn(new Map,o)(0),wj="",{toString:iHn}={},{keys:aHn}=Object,JJ=o=>{const h=typeof o;if(h!=="object"||!o)return[Sbt,h];const b=iHn.call(o).slice(8,-1);switch(b){case"Array":return[gX,wj];case"Object":return[Ymt,wj];case"Date":return[Vjt,wj];case"RegExp":return[Yjt,wj];case"Map":return[Jjt,wj];case"Set":return[Xjt,wj];case"DataView":return[gX,b]}return b.includes("Array")?[gX,b]:b.includes("Error")?[FOe,b]:[Ymt,b]},ymt=([o,h])=>o===Sbt&&(h==="function"||h==="symbol"),oHn=(o,h,b,k)=>{const O=(B,G)=>{const J=k.push(B)-1;return b.set(G,J),J},P=B=>{if(b.has(B))return b.get(B);let[G,J]=JJ(B);switch(G){case Sbt:{let nt=B;switch(J){case"bigint":G=$Oe,nt=B.toString();break;case"function":case"symbol":if(o)throw new TypeError("unable to serialize "+J);nt=null;break;case"undefined":return O([jOe],B)}return O([G,nt],B)}case gX:{if(J){let it=B;return J==="DataView"?it=new Uint8Array(B.buffer):J==="ArrayBuffer"&&(it=new Uint8Array(B)),O([J,[...it]],B)}const nt=[],at=O([G,nt],B);for(const it of B)nt.push(P(it));return at}case Ymt:{if(J)switch(J){case"BigInt":return O([J,B.toString()],B);case"Boolean":case"Number":case"String":return O([J,B.valueOf()],B)}if(h&&"toJSON"in B)return P(B.toJSON());const nt=[],at=O([G,nt],B);for(const it of aHn(B))(o||!ymt(JJ(B[it])))&&nt.push([P(it),P(B[it])]);return at}case Vjt:return O([G,B.toISOString()],B);case Yjt:{const{source:nt,flags:at}=B;return O([G,{source:nt,flags:at}],B)}case Jjt:{const nt=[],at=O([G,nt],B);for(const[it,st]of B)(o||!(ymt(JJ(it))||ymt(JJ(st))))&&nt.push([P(it),P(st)]);return at}case Xjt:{const nt=[],at=O([G,nt],B);for(const it of B)(o||!ymt(JJ(it)))&&nt.push(P(it));return at}}const{message:U}=B;return O([G,{name:J,message:U}],B)};return P},rAe=(o,{json:h,lossy:b}={})=>{const k=[];return oHn(!(h||b),!!h,new Map,k)(o),k},$j=typeof structuredClone=="function"?(o,h)=>h&&("json"in h||"lossy"in h)?nAe(rAe(o,h)):structuredClone(o):(o,h)=>nAe(rAe(o,h));function sHn(o,h){const b=[{type:"text",value:"↩"}];return h>1&&b.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(h)}]}),b}function cHn(o,h){return"Back to reference "+(o+1)+(h>1?"-"+h:"")}function uHn(o){const h=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",b=o.options.footnoteBackContent||sHn,k=o.options.footnoteBackLabel||cHn,O=o.options.footnoteLabel||"Footnotes",P=o.options.footnoteLabelTagName||"h2",B=o.options.footnoteLabelProperties||{className:["sr-only"]},G=[];let J=-1;for(;++J<o.footnoteOrder.length;){const U=o.footnoteById.get(o.footnoteOrder[J]);if(!U)continue;const nt=o.all(U),at=String(U.identifier).toUpperCase(),it=Jj(at.toLowerCase());let st=0;const tt=[],Et=o.footnoteCounts.get(at);for(;Et!==void 0&&++st<=Et;){tt.length>0&&tt.push({type:"text",value:" "});let ae=typeof b=="string"?b:b(J,st);typeof ae=="string"&&(ae={type:"text",value:ae}),tt.push({type:"element",tagName:"a",properties:{href:"#"+h+"fnref-"+it+(st>1?"-"+st:""),dataFootnoteBackref:"",ariaLabel:typeof k=="string"?k:k(J,st),className:["data-footnote-backref"]},children:Array.isArray(ae)?ae:[ae]})}const Lt=nt[nt.length-1];if(Lt&&Lt.type==="element"&&Lt.tagName==="p"){const ae=Lt.children[Lt.children.length-1];ae&&ae.type==="text"?ae.value+=" ":Lt.children.push({type:"text",value:" "}),Lt.children.push(...tt)}else nt.push(...tt);const Dt={type:"element",tagName:"li",properties:{id:h+"fn-"+it},children:o.wrap(nt,!0)};o.patch(U,Dt),G.push(Dt)}if(G.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:P,properties:{...$j(B),id:"footnote-label"},children:[{type:"text",value:O}]},{type:"text",value:`
3225
+ `});const U={type:"element",tagName:"li",properties:P,children:B};return o.patch(h,U),o.applyData(h,U)}function W$n(o){let h=!1;if(o.type==="list"){h=o.spread||!1;const b=o.children;let k=-1;for(;!h&&++k<b.length;)h=BOe(b[k])}return h}function BOe(o){const h=o.spread;return h??o.children.length>1}function K$n(o,h){const b={},k=o.all(h);let O=-1;for(typeof h.start=="number"&&h.start!==1&&(b.start=h.start);++O<k.length;){const B=k[O];if(B.type==="element"&&B.tagName==="li"&&B.properties&&Array.isArray(B.properties.className)&&B.properties.className.includes("task-list-item")){b.className=["contains-task-list"];break}}const P={type:"element",tagName:h.ordered?"ol":"ul",properties:b,children:o.wrap(k,!0)};return o.patch(h,P),o.applyData(h,P)}function V$n(o,h){const b={type:"element",tagName:"p",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function Y$n(o,h){const b={type:"root",children:o.wrap(o.all(h))};return o.patch(h,b),o.applyData(h,b)}function J$n(o,h){const b={type:"element",tagName:"strong",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}function X$n(o,h){const b=o.all(h),k=b.shift(),O=[];if(k){const B={type:"element",tagName:"thead",properties:{},children:o.wrap([k],!0)};o.patch(h.children[0],B),O.push(B)}if(b.length>0){const B={type:"element",tagName:"tbody",properties:{},children:o.wrap(b,!0)},G=b6(h.children[1]),J=Ebt(h.children[h.children.length-1]);G&&J&&(B.position={start:G,end:J}),O.push(B)}const P={type:"element",tagName:"table",properties:{},children:o.wrap(O,!0)};return o.patch(h,P),o.applyData(h,P)}function Q$n(o,h,b){const k=b?b.children:void 0,P=(k?k.indexOf(h):1)===0?"th":"td",B=b&&b.type==="table"?b.align:void 0,G=B?B.length:h.children.length;let J=-1;const U=[];for(;++J<G;){const at=h.children[J],it={},st=B?B[J]:void 0;st&&(it.align=st);let tt={type:"element",tagName:P,properties:it,children:[]};at&&(tt.children=o.all(at),o.patch(at,tt),tt=o.applyData(at,tt)),U.push(tt)}const nt={type:"element",tagName:"tr",properties:{},children:o.wrap(U,!0)};return o.patch(h,nt),o.applyData(h,nt)}function Z$n(o,h){const b={type:"element",tagName:"td",properties:{},children:o.all(h)};return o.patch(h,b),o.applyData(h,b)}const QCe=9,ZCe=32;function tHn(o){const h=String(o),b=/\r?\n|\r/g;let k=b.exec(h),O=0;const P=[];for(;k;)P.push(tAe(h.slice(O,k.index),O>0,!0),k[0]),O=k.index+k[0].length,k=b.exec(h);return P.push(tAe(h.slice(O),O>0,!1)),P.join("")}function tAe(o,h,b){let k=0,O=o.length;if(h){let P=o.codePointAt(k);for(;P===QCe||P===ZCe;)k++,P=o.codePointAt(k)}if(b){let P=o.codePointAt(O-1);for(;P===QCe||P===ZCe;)O--,P=o.codePointAt(O-1)}return O>k?o.slice(k,O):""}function eHn(o,h){const b={type:"text",value:tHn(String(h.value))};return o.patch(h,b),o.applyData(h,b)}function nHn(o,h){const b={type:"element",tagName:"hr",properties:{},children:[]};return o.patch(h,b),o.applyData(h,b)}const rHn={blockquote:P$n,break:L$n,code:M$n,delete:D$n,emphasis:R$n,footnoteReference:B$n,heading:j$n,html:F$n,imageReference:$$n,image:H$n,inlineCode:z$n,linkReference:U$n,link:G$n,listItem:q$n,list:K$n,paragraph:V$n,root:Y$n,strong:J$n,table:X$n,tableCell:Z$n,tableRow:Q$n,text:eHn,thematicBreak:nHn,toml:bmt,yaml:bmt,definition:bmt,footnoteDefinition:bmt};function bmt(){}const jOe=-1,Sbt=0,gX=1,Ymt=2,Vjt=3,Yjt=4,Jjt=5,Xjt=6,FOe=7,$Oe=8,eAe=typeof self=="object"?self:globalThis,iHn=(o,h)=>{const b=(O,P)=>(o.set(P,O),O),k=O=>{if(o.has(O))return o.get(O);const[P,B]=h[O];switch(P){case Sbt:case jOe:return b(B,O);case gX:{const G=b([],O);for(const J of B)G.push(k(J));return G}case Ymt:{const G=b({},O);for(const[J,U]of B)G[k(J)]=k(U);return G}case Vjt:return b(new Date(B),O);case Yjt:{const{source:G,flags:J}=B;return b(new RegExp(G,J),O)}case Jjt:{const G=b(new Map,O);for(const[J,U]of B)G.set(k(J),k(U));return G}case Xjt:{const G=b(new Set,O);for(const J of B)G.add(k(J));return G}case FOe:{const{name:G,message:J}=B;return b(new eAe[G](J),O)}case $Oe:return b(BigInt(B),O);case"BigInt":return b(Object(BigInt(B)),O);case"ArrayBuffer":return b(new Uint8Array(B).buffer,B);case"DataView":{const{buffer:G}=new Uint8Array(B);return b(new DataView(G),B)}}return b(new eAe[P](B),O)};return k},nAe=o=>iHn(new Map,o)(0),wj="",{toString:aHn}={},{keys:oHn}=Object,JJ=o=>{const h=typeof o;if(h!=="object"||!o)return[Sbt,h];const b=aHn.call(o).slice(8,-1);switch(b){case"Array":return[gX,wj];case"Object":return[Ymt,wj];case"Date":return[Vjt,wj];case"RegExp":return[Yjt,wj];case"Map":return[Jjt,wj];case"Set":return[Xjt,wj];case"DataView":return[gX,b]}return b.includes("Array")?[gX,b]:b.includes("Error")?[FOe,b]:[Ymt,b]},ymt=([o,h])=>o===Sbt&&(h==="function"||h==="symbol"),sHn=(o,h,b,k)=>{const O=(B,G)=>{const J=k.push(B)-1;return b.set(G,J),J},P=B=>{if(b.has(B))return b.get(B);let[G,J]=JJ(B);switch(G){case Sbt:{let nt=B;switch(J){case"bigint":G=$Oe,nt=B.toString();break;case"function":case"symbol":if(o)throw new TypeError("unable to serialize "+J);nt=null;break;case"undefined":return O([jOe],B)}return O([G,nt],B)}case gX:{if(J){let it=B;return J==="DataView"?it=new Uint8Array(B.buffer):J==="ArrayBuffer"&&(it=new Uint8Array(B)),O([J,[...it]],B)}const nt=[],at=O([G,nt],B);for(const it of B)nt.push(P(it));return at}case Ymt:{if(J)switch(J){case"BigInt":return O([J,B.toString()],B);case"Boolean":case"Number":case"String":return O([J,B.valueOf()],B)}if(h&&"toJSON"in B)return P(B.toJSON());const nt=[],at=O([G,nt],B);for(const it of oHn(B))(o||!ymt(JJ(B[it])))&&nt.push([P(it),P(B[it])]);return at}case Vjt:return O([G,B.toISOString()],B);case Yjt:{const{source:nt,flags:at}=B;return O([G,{source:nt,flags:at}],B)}case Jjt:{const nt=[],at=O([G,nt],B);for(const[it,st]of B)(o||!(ymt(JJ(it))||ymt(JJ(st))))&&nt.push([P(it),P(st)]);return at}case Xjt:{const nt=[],at=O([G,nt],B);for(const it of B)(o||!ymt(JJ(it)))&&nt.push(P(it));return at}}const{message:U}=B;return O([G,{name:J,message:U}],B)};return P},rAe=(o,{json:h,lossy:b}={})=>{const k=[];return sHn(!(h||b),!!h,new Map,k)(o),k},$j=typeof structuredClone=="function"?(o,h)=>h&&("json"in h||"lossy"in h)?nAe(rAe(o,h)):structuredClone(o):(o,h)=>nAe(rAe(o,h));function cHn(o,h){const b=[{type:"text",value:"↩"}];return h>1&&b.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(h)}]}),b}function uHn(o,h){return"Back to reference "+(o+1)+(h>1?"-"+h:"")}function lHn(o){const h=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",b=o.options.footnoteBackContent||cHn,k=o.options.footnoteBackLabel||uHn,O=o.options.footnoteLabel||"Footnotes",P=o.options.footnoteLabelTagName||"h2",B=o.options.footnoteLabelProperties||{className:["sr-only"]},G=[];let J=-1;for(;++J<o.footnoteOrder.length;){const U=o.footnoteById.get(o.footnoteOrder[J]);if(!U)continue;const nt=o.all(U),at=String(U.identifier).toUpperCase(),it=Jj(at.toLowerCase());let st=0;const tt=[],Et=o.footnoteCounts.get(at);for(;Et!==void 0&&++st<=Et;){tt.length>0&&tt.push({type:"text",value:" "});let ae=typeof b=="string"?b:b(J,st);typeof ae=="string"&&(ae={type:"text",value:ae}),tt.push({type:"element",tagName:"a",properties:{href:"#"+h+"fnref-"+it+(st>1?"-"+st:""),dataFootnoteBackref:"",ariaLabel:typeof k=="string"?k:k(J,st),className:["data-footnote-backref"]},children:Array.isArray(ae)?ae:[ae]})}const Lt=nt[nt.length-1];if(Lt&&Lt.type==="element"&&Lt.tagName==="p"){const ae=Lt.children[Lt.children.length-1];ae&&ae.type==="text"?ae.value+=" ":Lt.children.push({type:"text",value:" "}),Lt.children.push(...tt)}else nt.push(...tt);const Dt={type:"element",tagName:"li",properties:{id:h+"fn-"+it},children:o.wrap(nt,!0)};o.patch(U,Dt),G.push(Dt)}if(G.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:P,properties:{...$j(B),id:"footnote-label"},children:[{type:"text",value:O}]},{type:"text",value:`
3226
3226
  `},{type:"element",tagName:"ol",properties:{},children:o.wrap(G,!0)},{type:"text",value:`
3227
- `}]}}const HOe=function(o){if(o==null)return dHn;if(typeof o=="function")return Ibt(o);if(typeof o=="object")return Array.isArray(o)?lHn(o):hHn(o);if(typeof o=="string")return fHn(o);throw new Error("Expected function, string, or object as test")};function lHn(o){const h=[];let b=-1;for(;++b<o.length;)h[b]=HOe(o[b]);return Ibt(k);function k(...O){let P=-1;for(;++P<h.length;)if(h[P].apply(this,O))return!0;return!1}}function hHn(o){const h=o;return Ibt(b);function b(k){const O=k;let P;for(P in o)if(O[P]!==h[P])return!1;return!0}}function fHn(o){return Ibt(h);function h(b){return b&&b.type===o}}function Ibt(o){return h;function h(b,k,O){return!!(pHn(b)&&o.call(this,b,typeof k=="number"?k:void 0,O||void 0))}}function dHn(){return!0}function pHn(o){return o!==null&&typeof o=="object"&&"type"in o}const zOe=[],gHn=!0,iAe=!1,mHn="skip";function bHn(o,h,b,k){let O;typeof h=="function"&&typeof b!="function"?(k=b,b=h):O=h;const P=HOe(O),B=k?-1:1;G(o,void 0,[])();function G(J,U,nt){const at=J&&typeof J=="object"?J:{};if(typeof at.type=="string"){const st=typeof at.tagName=="string"?at.tagName:typeof at.name=="string"?at.name:void 0;Object.defineProperty(it,"name",{value:"node ("+(J.type+(st?"<"+st+">":""))+")"})}return it;function it(){let st=zOe,tt,Et,Lt;if((!h||P(J,U,nt[nt.length-1]||void 0))&&(st=yHn(b(J,nt)),st[0]===iAe))return st;if("children"in J&&J.children){const Dt=J;if(Dt.children&&st[0]!==mHn)for(Et=(k?Dt.children.length:-1)+B,Lt=nt.concat(Dt);Et>-1&&Et<Dt.children.length;){const ae=Dt.children[Et];if(tt=G(ae,Et,Lt)(),tt[0]===iAe)return tt;Et=typeof tt[1]=="number"?tt[1]:Et+B}}return st}}}function yHn(o){return Array.isArray(o)?o:typeof o=="number"?[gHn,o]:o==null?zOe:[o]}function Qjt(o,h,b,k){let O,P,B;typeof h=="function"&&typeof b!="function"?(P=void 0,B=h,O=b):(P=h,B=b,O=k),bHn(o,P,G,O);function G(J,U){const nt=U[U.length-1],at=nt?nt.children.indexOf(J):void 0;return B(J,at,nt)}}const PBt={}.hasOwnProperty,wHn={};function vHn(o,h){const b=h||wHn,k=new Map,O=new Map,P=new Map,B={...nHn,...b.handlers},G={all:U,applyData:kHn,definitionById:k,footnoteById:O,footnoteCounts:P,footnoteOrder:[],handlers:B,one:J,options:b,patch:xHn,wrap:EHn};return Qjt(o,function(nt){if(nt.type==="definition"||nt.type==="footnoteDefinition"){const at=nt.type==="definition"?k:O,it=String(nt.identifier).toUpperCase();at.has(it)||at.set(it,nt)}}),G;function J(nt,at){const it=nt.type,st=G.handlers[it];if(PBt.call(G.handlers,it)&&st)return st(G,nt,at);if(G.options.passThrough&&G.options.passThrough.includes(it)){if("children"in nt){const{children:Et,...Lt}=nt,Dt=$j(Lt);return Dt.children=G.all(nt),Dt}return $j(nt)}return(G.options.unknownHandler||_Hn)(G,nt,at)}function U(nt){const at=[];if("children"in nt){const it=nt.children;let st=-1;for(;++st<it.length;){const tt=G.one(it[st],nt);if(tt){if(st&&it[st-1].type==="break"&&(!Array.isArray(tt)&&tt.type==="text"&&(tt.value=aAe(tt.value)),!Array.isArray(tt)&&tt.type==="element")){const Et=tt.children[0];Et&&Et.type==="text"&&(Et.value=aAe(Et.value))}Array.isArray(tt)?at.push(...tt):at.push(tt)}}}return at}}function xHn(o,h){o.position&&(h.position=ijn(o))}function kHn(o,h){let b=h;if(o&&o.data){const k=o.data.hName,O=o.data.hChildren,P=o.data.hProperties;if(typeof k=="string")if(b.type==="element")b.tagName=k;else{const B="children"in b?b.children:[b];b={type:"element",tagName:k,properties:{},children:B}}b.type==="element"&&P&&Object.assign(b.properties,$j(P)),"children"in b&&b.children&&O!==null&&O!==void 0&&(b.children=O)}return b}function _Hn(o,h){const b=h.data||{},k="value"in h&&!(PBt.call(b,"hProperties")||PBt.call(b,"hChildren"))?{type:"text",value:h.value}:{type:"element",tagName:"div",properties:{},children:o.all(h)};return o.patch(h,k),o.applyData(h,k)}function EHn(o,h){const b=[];let k=-1;for(h&&b.push({type:"text",value:`
3227
+ `}]}}const HOe=function(o){if(o==null)return pHn;if(typeof o=="function")return Ibt(o);if(typeof o=="object")return Array.isArray(o)?hHn(o):fHn(o);if(typeof o=="string")return dHn(o);throw new Error("Expected function, string, or object as test")};function hHn(o){const h=[];let b=-1;for(;++b<o.length;)h[b]=HOe(o[b]);return Ibt(k);function k(...O){let P=-1;for(;++P<h.length;)if(h[P].apply(this,O))return!0;return!1}}function fHn(o){const h=o;return Ibt(b);function b(k){const O=k;let P;for(P in o)if(O[P]!==h[P])return!1;return!0}}function dHn(o){return Ibt(h);function h(b){return b&&b.type===o}}function Ibt(o){return h;function h(b,k,O){return!!(gHn(b)&&o.call(this,b,typeof k=="number"?k:void 0,O||void 0))}}function pHn(){return!0}function gHn(o){return o!==null&&typeof o=="object"&&"type"in o}const zOe=[],mHn=!0,iAe=!1,bHn="skip";function yHn(o,h,b,k){let O;typeof h=="function"&&typeof b!="function"?(k=b,b=h):O=h;const P=HOe(O),B=k?-1:1;G(o,void 0,[])();function G(J,U,nt){const at=J&&typeof J=="object"?J:{};if(typeof at.type=="string"){const st=typeof at.tagName=="string"?at.tagName:typeof at.name=="string"?at.name:void 0;Object.defineProperty(it,"name",{value:"node ("+(J.type+(st?"<"+st+">":""))+")"})}return it;function it(){let st=zOe,tt,Et,Lt;if((!h||P(J,U,nt[nt.length-1]||void 0))&&(st=wHn(b(J,nt)),st[0]===iAe))return st;if("children"in J&&J.children){const Dt=J;if(Dt.children&&st[0]!==bHn)for(Et=(k?Dt.children.length:-1)+B,Lt=nt.concat(Dt);Et>-1&&Et<Dt.children.length;){const ae=Dt.children[Et];if(tt=G(ae,Et,Lt)(),tt[0]===iAe)return tt;Et=typeof tt[1]=="number"?tt[1]:Et+B}}return st}}}function wHn(o){return Array.isArray(o)?o:typeof o=="number"?[mHn,o]:o==null?zOe:[o]}function Qjt(o,h,b,k){let O,P,B;typeof h=="function"&&typeof b!="function"?(P=void 0,B=h,O=b):(P=h,B=b,O=k),yHn(o,P,G,O);function G(J,U){const nt=U[U.length-1],at=nt?nt.children.indexOf(J):void 0;return B(J,at,nt)}}const PBt={}.hasOwnProperty,vHn={};function xHn(o,h){const b=h||vHn,k=new Map,O=new Map,P=new Map,B={...rHn,...b.handlers},G={all:U,applyData:_Hn,definitionById:k,footnoteById:O,footnoteCounts:P,footnoteOrder:[],handlers:B,one:J,options:b,patch:kHn,wrap:THn};return Qjt(o,function(nt){if(nt.type==="definition"||nt.type==="footnoteDefinition"){const at=nt.type==="definition"?k:O,it=String(nt.identifier).toUpperCase();at.has(it)||at.set(it,nt)}}),G;function J(nt,at){const it=nt.type,st=G.handlers[it];if(PBt.call(G.handlers,it)&&st)return st(G,nt,at);if(G.options.passThrough&&G.options.passThrough.includes(it)){if("children"in nt){const{children:Et,...Lt}=nt,Dt=$j(Lt);return Dt.children=G.all(nt),Dt}return $j(nt)}return(G.options.unknownHandler||EHn)(G,nt,at)}function U(nt){const at=[];if("children"in nt){const it=nt.children;let st=-1;for(;++st<it.length;){const tt=G.one(it[st],nt);if(tt){if(st&&it[st-1].type==="break"&&(!Array.isArray(tt)&&tt.type==="text"&&(tt.value=aAe(tt.value)),!Array.isArray(tt)&&tt.type==="element")){const Et=tt.children[0];Et&&Et.type==="text"&&(Et.value=aAe(Et.value))}Array.isArray(tt)?at.push(...tt):at.push(tt)}}}return at}}function kHn(o,h){o.position&&(h.position=ajn(o))}function _Hn(o,h){let b=h;if(o&&o.data){const k=o.data.hName,O=o.data.hChildren,P=o.data.hProperties;if(typeof k=="string")if(b.type==="element")b.tagName=k;else{const B="children"in b?b.children:[b];b={type:"element",tagName:k,properties:{},children:B}}b.type==="element"&&P&&Object.assign(b.properties,$j(P)),"children"in b&&b.children&&O!==null&&O!==void 0&&(b.children=O)}return b}function EHn(o,h){const b=h.data||{},k="value"in h&&!(PBt.call(b,"hProperties")||PBt.call(b,"hChildren"))?{type:"text",value:h.value}:{type:"element",tagName:"div",properties:{},children:o.all(h)};return o.patch(h,k),o.applyData(h,k)}function THn(o,h){const b=[];let k=-1;for(h&&b.push({type:"text",value:`
3228
3228
  `});++k<o.length;)k&&b.push({type:"text",value:`
3229
3229
  `}),b.push(o[k]);return h&&o.length>0&&b.push({type:"text",value:`
3230
- `}),b}function aAe(o){let h=0,b=o.charCodeAt(h);for(;b===9||b===32;)h++,b=o.charCodeAt(h);return o.slice(h)}function oAe(o,h){const b=vHn(o,h),k=b.one(o,void 0),O=uHn(b),P=Array.isArray(k)?{type:"root",children:k}:k||{type:"root",children:[]};return O&&P.children.push({type:"text",value:`
3231
- `},O),P}function THn(o,h){return o&&"run"in o?async function(b,k){const O=oAe(b,{file:k,...h});await o.run(O,k)}:function(b,k){return oAe(b,{file:k,...o||h})}}function sAe(o){if(o)throw o}var Lmt=Object.prototype.hasOwnProperty,UOe=Object.prototype.toString,cAe=Object.defineProperty,uAe=Object.getOwnPropertyDescriptor,lAe=function(h){return typeof Array.isArray=="function"?Array.isArray(h):UOe.call(h)==="[object Array]"},hAe=function(h){if(!h||UOe.call(h)!=="[object Object]")return!1;var b=Lmt.call(h,"constructor"),k=h.constructor&&h.constructor.prototype&&Lmt.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!b&&!k)return!1;var O;for(O in h);return typeof O>"u"||Lmt.call(h,O)},fAe=function(h,b){cAe&&b.name==="__proto__"?cAe(h,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):h[b.name]=b.newValue},dAe=function(h,b){if(b==="__proto__")if(Lmt.call(h,b)){if(uAe)return uAe(h,b).value}else return;return h[b]},SHn=function o(){var h,b,k,O,P,B,G=arguments[0],J=1,U=arguments.length,nt=!1;for(typeof G=="boolean"&&(nt=G,G=arguments[1]||{},J=2),(G==null||typeof G!="object"&&typeof G!="function")&&(G={});J<U;++J)if(h=arguments[J],h!=null)for(b in h)k=dAe(G,b),O=dAe(h,b),G!==O&&(nt&&O&&(hAe(O)||(P=lAe(O)))?(P?(P=!1,B=k&&lAe(k)?k:[]):B=k&&hAe(k)?k:{},fAe(G,{name:b,newValue:o(nt,B,O)})):typeof O<"u"&&fAe(G,{name:b,newValue:O}));return G};const yRt=e7e(SHn);function LBt(o){if(typeof o!="object"||o===null)return!1;const h=Object.getPrototypeOf(o);return(h===null||h===Object.prototype||Object.getPrototypeOf(h)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)}function IHn(){const o=[],h={run:b,use:k};return h;function b(...O){let P=-1;const B=O.pop();if(typeof B!="function")throw new TypeError("Expected function as last argument, not "+B);G(null,...O);function G(J,...U){const nt=o[++P];let at=-1;if(J){B(J);return}for(;++at<O.length;)(U[at]===null||U[at]===void 0)&&(U[at]=O[at]);O=U,nt?CHn(nt,G)(...U):B(null,...U)}}function k(O){if(typeof O!="function")throw new TypeError("Expected `middelware` to be a function, not "+O);return o.push(O),h}}function CHn(o,h){let b;return k;function k(...B){const G=o.length>B.length;let J;G&&B.push(O);try{J=o.apply(this,B)}catch(U){const nt=U;if(G&&b)throw nt;return O(nt)}G||(J&&J.then&&typeof J.then=="function"?J.then(P,O):J instanceof Error?O(J):P(J))}function O(B,...G){b||(b=!0,h(B,...G))}function P(B){O(null,B)}}const s6={basename:AHn,dirname:OHn,extname:NHn,join:PHn,sep:"/"};function AHn(o,h){if(h!==void 0&&typeof h!="string")throw new TypeError('"ext" argument must be a string');$X(o);let b=0,k=-1,O=o.length,P;if(h===void 0||h.length===0||h.length>o.length){for(;O--;)if(o.codePointAt(O)===47){if(P){b=O+1;break}}else k<0&&(P=!0,k=O+1);return k<0?"":o.slice(b,k)}if(h===o)return"";let B=-1,G=h.length-1;for(;O--;)if(o.codePointAt(O)===47){if(P){b=O+1;break}}else B<0&&(P=!0,B=O+1),G>-1&&(o.codePointAt(O)===h.codePointAt(G--)?G<0&&(k=O):(G=-1,k=B));return b===k?k=B:k<0&&(k=o.length),o.slice(b,k)}function OHn(o){if($X(o),o.length===0)return".";let h=-1,b=o.length,k;for(;--b;)if(o.codePointAt(b)===47){if(k){h=b;break}}else k||(k=!0);return h<0?o.codePointAt(0)===47?"/":".":h===1&&o.codePointAt(0)===47?"//":o.slice(0,h)}function NHn(o){$X(o);let h=o.length,b=-1,k=0,O=-1,P=0,B;for(;h--;){const G=o.codePointAt(h);if(G===47){if(B){k=h+1;break}continue}b<0&&(B=!0,b=h+1),G===46?O<0?O=h:P!==1&&(P=1):O>-1&&(P=-1)}return O<0||b<0||P===0||P===1&&O===b-1&&O===k+1?"":o.slice(O,b)}function PHn(...o){let h=-1,b;for(;++h<o.length;)$X(o[h]),o[h]&&(b=b===void 0?o[h]:b+"/"+o[h]);return b===void 0?".":LHn(b)}function LHn(o){$X(o);const h=o.codePointAt(0)===47;let b=MHn(o,!h);return b.length===0&&!h&&(b="."),b.length>0&&o.codePointAt(o.length-1)===47&&(b+="/"),h?"/"+b:b}function MHn(o,h){let b="",k=0,O=-1,P=0,B=-1,G,J;for(;++B<=o.length;){if(B<o.length)G=o.codePointAt(B);else{if(G===47)break;G=47}if(G===47){if(!(O===B-1||P===1))if(O!==B-1&&P===2){if(b.length<2||k!==2||b.codePointAt(b.length-1)!==46||b.codePointAt(b.length-2)!==46){if(b.length>2){if(J=b.lastIndexOf("/"),J!==b.length-1){J<0?(b="",k=0):(b=b.slice(0,J),k=b.length-1-b.lastIndexOf("/")),O=B,P=0;continue}}else if(b.length>0){b="",k=0,O=B,P=0;continue}}h&&(b=b.length>0?b+"/..":"..",k=2)}else b.length>0?b+="/"+o.slice(O+1,B):b=o.slice(O+1,B),k=B-O-1;O=B,P=0}else G===46&&P>-1?P++:P=-1}return b}function $X(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}const DHn={cwd:RHn};function RHn(){return"/"}function MBt(o){return!!(o!==null&&typeof o=="object"&&"href"in o&&o.href&&"protocol"in o&&o.protocol&&o.auth===void 0)}function BHn(o){if(typeof o=="string")o=new URL(o);else if(!MBt(o)){const h=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+o+"`");throw h.code="ERR_INVALID_ARG_TYPE",h}if(o.protocol!=="file:"){const h=new TypeError("The URL must be of scheme file");throw h.code="ERR_INVALID_URL_SCHEME",h}return jHn(o)}function jHn(o){if(o.hostname!==""){const k=new TypeError('File URL host must be "localhost" or empty on darwin');throw k.code="ERR_INVALID_FILE_URL_HOST",k}const h=o.pathname;let b=-1;for(;++b<h.length;)if(h.codePointAt(b)===37&&h.codePointAt(b+1)===50){const k=h.codePointAt(b+2);if(k===70||k===102){const O=new TypeError("File URL path must not include encoded / characters");throw O.code="ERR_INVALID_FILE_URL_PATH",O}}return decodeURIComponent(h)}const wRt=["history","path","basename","stem","extname","dirname"];class GOe{constructor(h){let b;h?MBt(h)?b={path:h}:typeof h=="string"||FHn(h)?b={value:h}:b=h:b={},this.cwd="cwd"in b?"":DHn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let k=-1;for(;++k<wRt.length;){const P=wRt[k];P in b&&b[P]!==void 0&&b[P]!==null&&(this[P]=P==="history"?[...b[P]]:b[P])}let O;for(O in b)wRt.includes(O)||(this[O]=b[O])}get basename(){return typeof this.path=="string"?s6.basename(this.path):void 0}set basename(h){xRt(h,"basename"),vRt(h,"basename"),this.path=s6.join(this.dirname||"",h)}get dirname(){return typeof this.path=="string"?s6.dirname(this.path):void 0}set dirname(h){pAe(this.basename,"dirname"),this.path=s6.join(h||"",this.basename)}get extname(){return typeof this.path=="string"?s6.extname(this.path):void 0}set extname(h){if(vRt(h,"extname"),pAe(this.dirname,"extname"),h){if(h.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(h.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=s6.join(this.dirname,this.stem+(h||""))}get path(){return this.history[this.history.length-1]}set path(h){MBt(h)&&(h=BHn(h)),xRt(h,"path"),this.path!==h&&this.history.push(h)}get stem(){return typeof this.path=="string"?s6.basename(this.path,this.extname):void 0}set stem(h){xRt(h,"stem"),vRt(h,"stem"),this.path=s6.join(this.dirname||"",h+(this.extname||""))}fail(h,b,k){const O=this.message(h,b,k);throw O.fatal=!0,O}info(h,b,k){const O=this.message(h,b,k);return O.fatal=void 0,O}message(h,b,k){const O=new wm(h,b,k);return this.path&&(O.name=this.path+":"+O.name,O.file=this.path),O.fatal=!1,this.messages.push(O),O}toString(h){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(h||void 0).decode(this.value)}}function vRt(o,h){if(o&&o.includes(s6.sep))throw new Error("`"+h+"` cannot be a path: did not expect `"+s6.sep+"`")}function xRt(o,h){if(!o)throw new Error("`"+h+"` cannot be empty")}function pAe(o,h){if(!o)throw new Error("Setting `"+h+"` requires `path` to be set too")}function FHn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const $Hn=function(o){const k=this.constructor.prototype,O=k[o],P=function(){return O.apply(P,arguments)};return Object.setPrototypeOf(P,k),P},HHn={}.hasOwnProperty;class Zjt extends $Hn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=IHn()}copy(){const h=new Zjt;let b=-1;for(;++b<this.attachers.length;){const k=this.attachers[b];h.use(...k)}return h.data(yRt(!0,{},this.namespace)),h}data(h,b){return typeof h=="string"?arguments.length===2?(ERt("data",this.frozen),this.namespace[h]=b,this):HHn.call(this.namespace,h)&&this.namespace[h]||void 0:h?(ERt("data",this.frozen),this.namespace=h,this):this.namespace}freeze(){if(this.frozen)return this;const h=this;for(;++this.freezeIndex<this.attachers.length;){const[b,...k]=this.attachers[this.freezeIndex];if(k[0]===!1)continue;k[0]===!0&&(k[0]=void 0);const O=b.call(h,...k);typeof O=="function"&&this.transformers.use(O)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(h){this.freeze();const b=wmt(h),k=this.parser||this.Parser;return kRt("parse",k),k(String(b),b)}process(h,b){const k=this;return this.freeze(),kRt("process",this.parser||this.Parser),_Rt("process",this.compiler||this.Compiler),b?O(void 0,b):new Promise(O);function O(P,B){const G=wmt(h),J=k.parse(G);k.run(J,G,function(nt,at,it){if(nt||!at||!it)return U(nt);const st=at,tt=k.stringify(st,it);GHn(tt)?it.value=tt:it.result=tt,U(nt,it)});function U(nt,at){nt||!at?B(nt):P?P(at):b(void 0,at)}}}processSync(h){let b=!1,k;return this.freeze(),kRt("processSync",this.parser||this.Parser),_Rt("processSync",this.compiler||this.Compiler),this.process(h,O),mAe("processSync","process",b),k;function O(P,B){b=!0,sAe(P),k=B}}run(h,b,k){gAe(h),this.freeze();const O=this.transformers;return!k&&typeof b=="function"&&(k=b,b=void 0),k?P(void 0,k):new Promise(P);function P(B,G){const J=wmt(b);O.run(h,J,U);function U(nt,at,it){const st=at||h;nt?G(nt):B?B(st):k(void 0,st,it)}}}runSync(h,b){let k=!1,O;return this.run(h,b,P),mAe("runSync","run",k),O;function P(B,G){sAe(B),O=G,k=!0}}stringify(h,b){this.freeze();const k=wmt(b),O=this.compiler||this.Compiler;return _Rt("stringify",O),gAe(h),O(h,k)}use(h,...b){const k=this.attachers,O=this.namespace;if(ERt("use",this.frozen),h!=null)if(typeof h=="function")J(h,b);else if(typeof h=="object")Array.isArray(h)?G(h):B(h);else throw new TypeError("Expected usable value, not `"+h+"`");return this;function P(U){if(typeof U=="function")J(U,[]);else if(typeof U=="object")if(Array.isArray(U)){const[nt,...at]=U;J(nt,at)}else B(U);else throw new TypeError("Expected usable value, not `"+U+"`")}function B(U){if(!("plugins"in U)&&!("settings"in U))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");G(U.plugins),U.settings&&(O.settings=yRt(!0,O.settings,U.settings))}function G(U){let nt=-1;if(U!=null)if(Array.isArray(U))for(;++nt<U.length;){const at=U[nt];P(at)}else throw new TypeError("Expected a list of plugins, not `"+U+"`")}function J(U,nt){let at=-1,it=-1;for(;++at<k.length;)if(k[at][0]===U){it=at;break}if(it===-1)k.push([U,...nt]);else if(nt.length>0){let[st,...tt]=nt;const Et=k[it][1];LBt(Et)&&LBt(st)&&(st=yRt(!0,Et,st)),k[it]=[U,st,...tt]}}}}const zHn=new Zjt().freeze();function kRt(o,h){if(typeof h!="function")throw new TypeError("Cannot `"+o+"` without `parser`")}function _Rt(o,h){if(typeof h!="function")throw new TypeError("Cannot `"+o+"` without `compiler`")}function ERt(o,h){if(h)throw new Error("Cannot call `"+o+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gAe(o){if(!LBt(o)||typeof o.type!="string")throw new TypeError("Expected node, got `"+o+"`")}function mAe(o,h,b){if(!b)throw new Error("`"+o+"` finished async. Use `"+h+"` instead")}function wmt(o){return UHn(o)?o:new GOe(o)}function UHn(o){return!!(o&&typeof o=="object"&&"message"in o&&"messages"in o)}function GHn(o){return typeof o=="string"||qHn(o)}function qHn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const WHn="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bAe=[],yAe={allowDangerousHtml:!0},KHn=/^(https?|ircs?|mailto|xmpp)$/i,VHn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function YHn(o){const h=JHn(o),b=XHn(o);return QHn(h.runSync(h.parse(b),b),o)}function JHn(o){const h=o.rehypePlugins||bAe,b=o.remarkPlugins||bAe,k=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...yAe}:yAe;return zHn().use(O$n).use(b).use(THn,k).use(h)}function XHn(o){const h=o.children||"",b=new GOe;return typeof h=="string"&&(b.value=h),b}function QHn(o,h){const b=h.allowedElements,k=h.allowElement,O=h.components,P=h.disallowedElements,B=h.skipHtml,G=h.unwrapDisallowed,J=h.urlTransform||ZHn;for(const nt of VHn)Object.hasOwn(h,nt.from)&&(""+nt.from+(nt.to?"use `"+nt.to+"` instead":"remove it")+WHn+nt.id,void 0);return h.className&&(o={type:"element",tagName:"div",properties:{className:h.className},children:o.type==="root"?o.children:[o]}),Qjt(o,U),ujn(o,{Fragment:pe.Fragment,components:O,ignoreInvalidStyle:!0,jsx:pe.jsx,jsxs:pe.jsxs,passKeys:!0,passNode:!0});function U(nt,at,it){if(nt.type==="raw"&&it&&typeof at=="number")return B?it.children.splice(at,1):it.children[at]={type:"text",value:nt.value},at;if(nt.type==="element"){let st;for(st in gRt)if(Object.hasOwn(gRt,st)&&Object.hasOwn(nt.properties,st)){const tt=nt.properties[st],Et=gRt[st];(Et===null||Et.includes(nt.tagName))&&(nt.properties[st]=J(String(tt||""),st,nt))}}if(nt.type==="element"){let st=b?!b.includes(nt.tagName):P?P.includes(nt.tagName):!1;if(!st&&k&&typeof at=="number"&&(st=!k(nt,at,it)),st&&it&&typeof at=="number")return G&&nt.children?it.children.splice(at,1,...nt.children):it.children.splice(at,1),at}}}function ZHn(o){const h=o.indexOf(":"),b=o.indexOf("?"),k=o.indexOf("#"),O=o.indexOf("/");return h===-1||O!==-1&&h>O||b!==-1&&h>b||k!==-1&&h>k||KHn.test(o.slice(0,h))?o:""}const wAe=/[#.]/g;function tzn(o,h){const b=o||"",k={};let O=0,P,B;for(;O<b.length;){wAe.lastIndex=O;const G=wAe.exec(b),J=b.slice(O,G?G.index:b.length);J&&(P?P==="#"?k.id=J:Array.isArray(k.className)?k.className.push(J):k.className=[J]:B=J,O+=J.length),G&&(P=G[0],O++)}return{type:"element",tagName:B||h||"div",properties:k,children:[]}}function qOe(o,h,b){const k=b?izn(b):void 0;function O(P,B,...G){let J;if(P==null){J={type:"root",children:[]};const U=B;G.unshift(U)}else{J=tzn(P,h);const U=J.tagName.toLowerCase(),nt=k?k.get(U):void 0;if(J.tagName=nt||U,ezn(B))G.unshift(B);else for(const[at,it]of Object.entries(B))nzn(o,J.properties,at,it)}for(const U of G)DBt(J.children,U);return J.type==="element"&&J.tagName==="template"&&(J.content={type:"root",children:J.children},J.children=[]),J}return O}function ezn(o){if(o===null||typeof o!="object"||Array.isArray(o))return!0;if(typeof o.type!="string")return!1;const h=o,b=Object.keys(o);for(const k of b){const O=h[k];if(O&&typeof O=="object"){if(!Array.isArray(O))return!0;const P=O;for(const B of P)if(typeof B!="number"&&typeof B!="string")return!0}}return!!("children"in o&&Array.isArray(o.children))}function nzn(o,h,b,k){const O=kbt(o,b);let P;if(k!=null){if(typeof k=="number"){if(Number.isNaN(k))return;P=k}else typeof k=="boolean"?P=k:typeof k=="string"?O.spaceSeparated?P=PCe(k):O.commaSeparated?P=ICe(k):O.commaOrSpaceSeparated?P=PCe(ICe(k).join(" ")):P=vAe(O,O.property,k):Array.isArray(k)?P=[...k]:P=O.property==="style"?rzn(k):String(k);if(Array.isArray(P)){const B=[];for(const G of P)B.push(vAe(O,O.property,G));P=B}O.property==="className"&&Array.isArray(h.className)&&(P=h.className.concat(P)),h[O.property]=P}}function DBt(o,h){if(h!=null)if(typeof h=="number"||typeof h=="string")o.push({type:"text",value:String(h)});else if(Array.isArray(h))for(const b of h)DBt(o,b);else if(typeof h=="object"&&"type"in h)h.type==="root"?DBt(o,h.children):o.push(h);else throw new Error("Expected node, nodes, or string, got `"+h+"`")}function vAe(o,h,b){if(typeof b=="string"){if(o.number&&b&&!Number.isNaN(Number(b)))return Number(b);if((o.boolean||o.overloadedBoolean)&&(b===""||IX(b)===IX(h)))return!0}return b}function rzn(o){const h=[];for(const[b,k]of Object.entries(o))h.push([b,k].join(": "));return h.join("; ")}function izn(o){const h=new Map;for(const b of o)h.set(b.toLowerCase(),b);return h}const azn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],ozn=qOe(FX,"div"),szn=qOe(nC,"g",azn);function czn(o){const h=String(o),b=[];return{toOffset:O,toPoint:k};function k(P){if(typeof P=="number"&&P>-1&&P<=h.length){let B=0;for(;;){let G=b[B];if(G===void 0){const J=xAe(h,b[B-1]);G=J===-1?h.length+1:J+1,b[B]=G}if(G>P)return{line:B+1,column:P-(B>0?b[B-1]:0)+1,offset:P};B++}}}function O(P){if(P&&typeof P.line=="number"&&typeof P.column=="number"&&!Number.isNaN(P.line)&&!Number.isNaN(P.column)){for(;b.length<P.line;){const G=b[b.length-1],J=xAe(h,G),U=J===-1?h.length+1:J+1;if(G===U)break;b.push(U)}const B=(P.line>1?b[P.line-2]:0)+P.column-1;if(B<b[P.line-1])return B}}}function xAe(o,h){const b=o.indexOf("\r",h),k=o.indexOf(`
3232
- `,h);return k===-1?b:b===-1||b+1===k?k:b<k?b:k}const qN={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},WOe={}.hasOwnProperty,uzn=Object.prototype;function lzn(o,h){const b=h||{};return tFt({file:b.file||void 0,location:!1,schema:b.space==="svg"?nC:FX,verbose:b.verbose||!1},o)}function tFt(o,h){let b;switch(h.nodeName){case"#comment":{const k=h;return b={type:"comment",value:k.data},Mmt(o,k,b),b}case"#document":case"#document-fragment":{const k=h,O="mode"in k?k.mode==="quirks"||k.mode==="limited-quirks":!1;if(b={type:"root",children:KOe(o,h.childNodes),data:{quirksMode:O}},o.file&&o.location){const P=String(o.file),B=czn(P),G=B.toPoint(0),J=B.toPoint(P.length);b.position={start:G,end:J}}return b}case"#documentType":{const k=h;return b={type:"doctype"},Mmt(o,k,b),b}case"#text":{const k=h;return b={type:"text",value:k.value},Mmt(o,k,b),b}default:return b=hzn(o,h),b}}function KOe(o,h){let b=-1;const k=[];for(;++b<h.length;){const O=tFt(o,h[b]);k.push(O)}return k}function hzn(o,h){const b=o.schema;o.schema=h.namespaceURI===qN.svg?nC:FX;let k=-1;const O={};for(;++k<h.attrs.length;){const G=h.attrs[k],J=(G.prefix?G.prefix+":":"")+G.name;WOe.call(uzn,J)||(O[J]=G.value)}const B=(o.schema.space==="svg"?szn:ozn)(h.tagName,O,KOe(o,h.childNodes));if(Mmt(o,h,B),B.tagName==="template"){const G=h,J=G.sourceCodeLocation,U=J&&J.startTag&&Tj(J.startTag),nt=J&&J.endTag&&Tj(J.endTag),at=tFt(o,G.content);U&&nt&&o.file&&(at.position={start:U.end,end:nt.start}),B.content=at}return o.schema=b,B}function Mmt(o,h,b){if("sourceCodeLocation"in h&&h.sourceCodeLocation&&o.file){const k=fzn(o,b,h.sourceCodeLocation);k&&(o.location=!0,b.position=k)}}function fzn(o,h,b){const k=Tj(b);if(h.type==="element"){const O=h.children[h.children.length-1];if(k&&!b.endTag&&O&&O.position&&O.position.end&&(k.end=Object.assign({},O.position.end)),o.verbose){const P={};let B;if(b.attrs)for(B in b.attrs)WOe.call(b.attrs,B)&&(P[kbt(o.schema,B).property]=Tj(b.attrs[B]));b.startTag;const G=Tj(b.startTag),J=b.endTag?Tj(b.endTag):void 0,U={opening:G};J&&(U.closing=J),U.properties=P,h.data={position:U}}}return k}function Tj(o){const h=kAe({line:o.startLine,column:o.startCol,offset:o.startOffset}),b=kAe({line:o.endLine,column:o.endCol,offset:o.endOffset});return h||b?{start:h,end:b}:void 0}function kAe(o){return o.line&&o.column?o:void 0}class HX{constructor(h,b,k){this.property=h,this.normal=b,k&&(this.space=k)}}HX.prototype.property={};HX.prototype.normal={};HX.prototype.space=null;function VOe(o,h){const b={},k={};let O=-1;for(;++O<o.length;)Object.assign(b,o[O].property),Object.assign(k,o[O].normal);return new HX(b,k,h)}function RBt(o){return o.toLowerCase()}class E3{constructor(h,b){this.property=h,this.attribute=b}}E3.prototype.space=null;E3.prototype.boolean=!1;E3.prototype.booleanish=!1;E3.prototype.overloadedBoolean=!1;E3.prototype.number=!1;E3.prototype.commaSeparated=!1;E3.prototype.spaceSeparated=!1;E3.prototype.commaOrSpaceSeparated=!1;E3.prototype.mustUseProperty=!1;E3.prototype.defined=!1;let dzn=0;const Dc=iP(),op=iP(),YOe=iP(),la=iP(),rf=iP(),Pj=iP(),bw=iP();function iP(){return 2**++dzn}const BBt=Object.freeze(Object.defineProperty({__proto__:null,boolean:Dc,booleanish:op,commaOrSpaceSeparated:bw,commaSeparated:Pj,number:la,overloadedBoolean:YOe,spaceSeparated:rf},Symbol.toStringTag,{value:"Module"})),TRt=Object.keys(BBt);class eFt extends E3{constructor(h,b,k,O){let P=-1;if(super(h,b),_Ae(this,"space",O),typeof k=="number")for(;++P<TRt.length;){const B=TRt[P];_Ae(this,TRt[P],(k&BBt[B])===BBt[B])}}}eFt.prototype.defined=!0;function _Ae(o,h,b){b&&(o[h]=b)}const pzn={}.hasOwnProperty;function Xj(o){const h={},b={};let k;for(k in o.properties)if(pzn.call(o.properties,k)){const O=o.properties[k],P=new eFt(k,o.transform(o.attributes||{},k),O,o.space);o.mustUseProperty&&o.mustUseProperty.includes(k)&&(P.mustUseProperty=!0),h[k]=P,b[RBt(k)]=k,b[RBt(P.attribute)]=k}return new HX(h,b,o.space)}const JOe=Xj({space:"xlink",transform(o,h){return"xlink:"+h.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),XOe=Xj({space:"xml",transform(o,h){return"xml:"+h.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function QOe(o,h){return h in o?o[h]:h}function ZOe(o,h){return QOe(o,h.toLowerCase())}const tNe=Xj({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ZOe,properties:{xmlns:null,xmlnsXLink:null}}),eNe=Xj({transform(o,h){return h==="role"?h:"aria-"+h.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:op,ariaAutoComplete:null,ariaBusy:op,ariaChecked:op,ariaColCount:la,ariaColIndex:la,ariaColSpan:la,ariaControls:rf,ariaCurrent:null,ariaDescribedBy:rf,ariaDetails:null,ariaDisabled:op,ariaDropEffect:rf,ariaErrorMessage:null,ariaExpanded:op,ariaFlowTo:rf,ariaGrabbed:op,ariaHasPopup:null,ariaHidden:op,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rf,ariaLevel:la,ariaLive:null,ariaModal:op,ariaMultiLine:op,ariaMultiSelectable:op,ariaOrientation:null,ariaOwns:rf,ariaPlaceholder:null,ariaPosInSet:la,ariaPressed:op,ariaReadOnly:op,ariaRelevant:null,ariaRequired:op,ariaRoleDescription:rf,ariaRowCount:la,ariaRowIndex:la,ariaRowSpan:la,ariaSelected:op,ariaSetSize:la,ariaSort:null,ariaValueMax:la,ariaValueMin:la,ariaValueNow:la,ariaValueText:null,role:null}}),gzn=Xj({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ZOe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pj,acceptCharset:rf,accessKey:rf,action:null,allow:null,allowFullScreen:Dc,allowPaymentRequest:Dc,allowUserMedia:Dc,alt:null,as:null,async:Dc,autoCapitalize:null,autoComplete:rf,autoFocus:Dc,autoPlay:Dc,blocking:rf,capture:null,charSet:null,checked:Dc,cite:null,className:rf,cols:la,colSpan:null,content:null,contentEditable:op,controls:Dc,controlsList:rf,coords:la|Pj,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Dc,defer:Dc,dir:null,dirName:null,disabled:Dc,download:YOe,draggable:op,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Dc,formTarget:null,headers:rf,height:la,hidden:Dc,high:la,href:null,hrefLang:null,htmlFor:rf,httpEquiv:rf,id:null,imageSizes:null,imageSrcSet:null,inert:Dc,inputMode:null,integrity:null,is:null,isMap:Dc,itemId:null,itemProp:rf,itemRef:rf,itemScope:Dc,itemType:rf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Dc,low:la,manifest:null,max:null,maxLength:la,media:null,method:null,min:null,minLength:la,multiple:Dc,muted:Dc,name:null,nonce:null,noModule:Dc,noValidate:Dc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Dc,optimum:la,pattern:null,ping:rf,placeholder:null,playsInline:Dc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Dc,referrerPolicy:null,rel:rf,required:Dc,reversed:Dc,rows:la,rowSpan:la,sandbox:rf,scope:null,scoped:Dc,seamless:Dc,selected:Dc,shadowRootClonable:Dc,shadowRootDelegatesFocus:Dc,shadowRootMode:null,shape:null,size:la,sizes:null,slot:null,span:la,spellCheck:op,src:null,srcDoc:null,srcLang:null,srcSet:null,start:la,step:null,style:null,tabIndex:la,target:null,title:null,translate:null,type:null,typeMustMatch:Dc,useMap:null,value:op,width:la,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rf,axis:null,background:null,bgColor:null,border:la,borderColor:null,bottomMargin:la,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Dc,declare:Dc,event:null,face:null,frame:null,frameBorder:null,hSpace:la,leftMargin:la,link:null,longDesc:null,lowSrc:null,marginHeight:la,marginWidth:la,noResize:Dc,noHref:Dc,noShade:Dc,noWrap:Dc,object:null,profile:null,prompt:null,rev:null,rightMargin:la,rules:null,scheme:null,scrolling:op,standby:null,summary:null,text:null,topMargin:la,valueType:null,version:null,vAlign:null,vLink:null,vSpace:la,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Dc,disableRemotePlayback:Dc,prefix:null,property:null,results:la,security:null,unselectable:null}}),mzn=Xj({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:QOe,properties:{about:bw,accentHeight:la,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:la,amplitude:la,arabicForm:null,ascent:la,attributeName:null,attributeType:null,azimuth:la,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:la,by:null,calcMode:null,capHeight:la,className:rf,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:la,diffuseConstant:la,direction:null,display:null,dur:null,divisor:la,dominantBaseline:null,download:Dc,dx:null,dy:null,edgeMode:null,editable:null,elevation:la,enableBackground:null,end:null,event:null,exponent:la,externalResourcesRequired:null,fill:null,fillOpacity:la,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pj,g2:Pj,glyphName:Pj,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:la,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:la,horizOriginX:la,horizOriginY:la,id:null,ideographic:la,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:la,k:la,k1:la,k2:la,k3:la,k4:la,kernelMatrix:bw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:la,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:la,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:la,overlineThickness:la,paintOrder:null,panose1:null,path:null,pathLength:la,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:la,pointsAtY:la,pointsAtZ:la,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bw,rev:bw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bw,requiredFeatures:bw,requiredFonts:bw,requiredFormats:bw,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:la,specularExponent:la,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:la,strikethroughThickness:la,string:null,stroke:null,strokeDashArray:bw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:la,strokeOpacity:la,strokeWidth:null,style:null,surfaceScale:la,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bw,tabIndex:la,tableValues:null,target:null,targetX:la,targetY:la,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:la,underlineThickness:la,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:la,values:null,vAlphabetic:la,vMathematical:la,vectorEffect:null,vHanging:la,vIdeographic:la,version:null,vertAdvY:la,vertOriginX:la,vertOriginY:la,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:la,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),bzn=/^data[-\w.:]+$/i,EAe=/-[a-z]/g,yzn=/[A-Z]/g;function wzn(o,h){const b=RBt(h);let k=h,O=E3;if(b in o.normal)return o.property[o.normal[b]];if(b.length>4&&b.slice(0,4)==="data"&&bzn.test(h)){if(h.charAt(4)==="-"){const P=h.slice(5).replace(EAe,xzn);k="data"+P.charAt(0).toUpperCase()+P.slice(1)}else{const P=h.slice(4);if(!EAe.test(P)){let B=P.replace(yzn,vzn);B.charAt(0)!=="-"&&(B="-"+B),h="data"+B}}O=eFt}return new O(k,h)}function vzn(o){return"-"+o.toLowerCase()}function xzn(o){return o.charAt(1).toUpperCase()}const kzn=VOe([XOe,JOe,tNe,eNe,gzn],"html"),nNe=VOe([XOe,JOe,tNe,eNe,mzn],"svg"),TAe={}.hasOwnProperty;function nFt(o,h){const b=h||{};function k(O,...P){let B=k.invalid;const G=k.handlers;if(O&&TAe.call(O,o)){const J=String(O[o]);B=TAe.call(G,J)?G[J]:k.unknown}if(B)return B.call(this,O,...P)}return k.handlers=b.handlers||{},k.invalid=b.invalid,k.unknown=b.unknown,k}const _zn={},Ezn={}.hasOwnProperty,rNe=nFt("type",{handlers:{root:Szn,element:Nzn,text:Azn,comment:Ozn,doctype:Czn}});function Tzn(o,h){const k=(h||_zn).space;return rNe(o,k==="svg"?nNe:kzn)}function Szn(o,h){const b={nodeName:"#document",mode:(o.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return b.childNodes=rFt(o.children,b,h),Qj(o,b),b}function Izn(o,h){const b={nodeName:"#document-fragment",childNodes:[]};return b.childNodes=rFt(o.children,b,h),Qj(o,b),b}function Czn(o){const h={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Qj(o,h),h}function Azn(o){const h={nodeName:"#text",value:o.value,parentNode:null};return Qj(o,h),h}function Ozn(o){const h={nodeName:"#comment",data:o.value,parentNode:null};return Qj(o,h),h}function Nzn(o,h){const b=h;let k=b;o.type==="element"&&o.tagName.toLowerCase()==="svg"&&b.space==="html"&&(k=nNe);const O=[];let P;if(o.properties){for(P in o.properties)if(P!=="children"&&Ezn.call(o.properties,P)){const J=Pzn(k,P,o.properties[P]);J&&O.push(J)}}const B=k.space,G={nodeName:o.tagName,tagName:o.tagName,attrs:O,namespaceURI:qN[B],childNodes:[],parentNode:null};return G.childNodes=rFt(o.children,G,k),Qj(o,G),o.tagName==="template"&&o.content&&(G.content=Izn(o.content,k)),G}function Pzn(o,h,b){const k=wzn(o,h);if(b===!1||b===null||b===void 0||typeof b=="number"&&Number.isNaN(b)||!b&&k.boolean)return;Array.isArray(b)&&(b=k.commaSeparated?jjt(b):$jt(b));const O={name:k.attribute,value:b===!0?"":String(b)};if(k.space&&k.space!=="html"&&k.space!=="svg"){const P=O.name.indexOf(":");P<0?O.prefix="":(O.name=O.name.slice(P+1),O.prefix=k.attribute.slice(0,P)),O.namespace=qN[k.space]}return O}function rFt(o,h,b){let k=-1;const O=[];if(o)for(;++k<o.length;){const P=rNe(o[k],b);P.parentNode=h,O.push(P)}return O}function Qj(o,h){const b=o.position;b&&b.start&&b.end&&(b.start.offset,b.end.offset,h.sourceCodeLocation={startLine:b.start.line,startCol:b.start.column,startOffset:b.start.offset,endLine:b.end.line,endCol:b.end.column,endOffset:b.end.offset})}const iNe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Lzn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Wf="�";var xe;(function(o){o[o.EOF=-1]="EOF",o[o.NULL=0]="NULL",o[o.TABULATION=9]="TABULATION",o[o.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",o[o.LINE_FEED=10]="LINE_FEED",o[o.FORM_FEED=12]="FORM_FEED",o[o.SPACE=32]="SPACE",o[o.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",o[o.QUOTATION_MARK=34]="QUOTATION_MARK",o[o.AMPERSAND=38]="AMPERSAND",o[o.APOSTROPHE=39]="APOSTROPHE",o[o.HYPHEN_MINUS=45]="HYPHEN_MINUS",o[o.SOLIDUS=47]="SOLIDUS",o[o.DIGIT_0=48]="DIGIT_0",o[o.DIGIT_9=57]="DIGIT_9",o[o.SEMICOLON=59]="SEMICOLON",o[o.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",o[o.EQUALS_SIGN=61]="EQUALS_SIGN",o[o.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",o[o.QUESTION_MARK=63]="QUESTION_MARK",o[o.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",o[o.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",o[o.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",o[o.GRAVE_ACCENT=96]="GRAVE_ACCENT",o[o.LATIN_SMALL_A=97]="LATIN_SMALL_A",o[o.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(xe||(xe={}));const U2={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function aNe(o){return o>=55296&&o<=57343}function Mzn(o){return o>=56320&&o<=57343}function Dzn(o,h){return(o-55296)*1024+9216+h}function oNe(o){return o!==32&&o!==10&&o!==13&&o!==9&&o!==12&&o>=1&&o<=31||o>=127&&o<=159}function sNe(o){return o>=64976&&o<=65007||Lzn.has(o)}var Fr;(function(o){o.controlCharacterInInputStream="control-character-in-input-stream",o.noncharacterInInputStream="noncharacter-in-input-stream",o.surrogateInInputStream="surrogate-in-input-stream",o.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",o.endTagWithAttributes="end-tag-with-attributes",o.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",o.unexpectedSolidusInTag="unexpected-solidus-in-tag",o.unexpectedNullCharacter="unexpected-null-character",o.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",o.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",o.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",o.missingEndTagName="missing-end-tag-name",o.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",o.unknownNamedCharacterReference="unknown-named-character-reference",o.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",o.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",o.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",o.eofBeforeTagName="eof-before-tag-name",o.eofInTag="eof-in-tag",o.missingAttributeValue="missing-attribute-value",o.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",o.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",o.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",o.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",o.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",o.missingDoctypePublicIdentifier="missing-doctype-public-identifier",o.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",o.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",o.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",o.cdataInHtmlContent="cdata-in-html-content",o.incorrectlyOpenedComment="incorrectly-opened-comment",o.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",o.eofInDoctype="eof-in-doctype",o.nestedComment="nested-comment",o.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",o.eofInComment="eof-in-comment",o.incorrectlyClosedComment="incorrectly-closed-comment",o.eofInCdata="eof-in-cdata",o.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",o.nullCharacterReference="null-character-reference",o.surrogateCharacterReference="surrogate-character-reference",o.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",o.controlCharacterReference="control-character-reference",o.noncharacterCharacterReference="noncharacter-character-reference",o.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",o.missingDoctypeName="missing-doctype-name",o.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",o.duplicateAttribute="duplicate-attribute",o.nonConformingDoctype="non-conforming-doctype",o.missingDoctype="missing-doctype",o.misplacedDoctype="misplaced-doctype",o.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",o.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",o.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",o.openElementsLeftAfterEof="open-elements-left-after-eof",o.abandonedHeadElementChild="abandoned-head-element-child",o.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",o.nestedNoscriptInHead="nested-noscript-in-head",o.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Fr||(Fr={}));const Rzn=65536;class Bzn{constructor(h){this.handler=h,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Rzn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(h,b){const{line:k,col:O,offset:P}=this,B=O+b,G=P+b;return{code:h,startLine:k,endLine:k,startCol:B,endCol:B,startOffset:G,endOffset:G}}_err(h){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(h,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(h){if(this.pos!==this.html.length-1){const b=this.html.charCodeAt(this.pos+1);if(Mzn(b))return this.pos++,this._addGap(),Dzn(h,b)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,xe.EOF;return this._err(Fr.surrogateInInputStream),h}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(h,b){this.html.length>0?this.html+=h:this.html=h,this.endOfChunkHit=!1,this.lastChunkWritten=b}insertHtmlAtCurrentPos(h){this.html=this.html.substring(0,this.pos+1)+h+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(h,b){if(this.pos+h.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(b)return this.html.startsWith(h,this.pos);for(let k=0;k<h.length;k++)if((this.html.charCodeAt(this.pos+k)|32)!==h.charCodeAt(k))return!1;return!0}peek(h){const b=this.pos+h;if(b>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;const k=this.html.charCodeAt(b);return k===xe.CARRIAGE_RETURN?xe.LINE_FEED:k}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;let h=this.html.charCodeAt(this.pos);return h===xe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,xe.LINE_FEED):h===xe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,aNe(h)&&(h=this._processSurrogate(h)),this.handler.onParseError===null||h>31&&h<127||h===xe.LINE_FEED||h===xe.CARRIAGE_RETURN||h>159&&h<64976||this._checkForProblematicCharacters(h),h)}_checkForProblematicCharacters(h){oNe(h)?this._err(Fr.controlCharacterInInputStream):sNe(h)&&this._err(Fr.noncharacterInInputStream)}retreat(h){for(this.pos-=h;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var vu;(function(o){o[o.CHARACTER=0]="CHARACTER",o[o.NULL_CHARACTER=1]="NULL_CHARACTER",o[o.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",o[o.START_TAG=3]="START_TAG",o[o.END_TAG=4]="END_TAG",o[o.COMMENT=5]="COMMENT",o[o.DOCTYPE=6]="DOCTYPE",o[o.EOF=7]="EOF",o[o.HIBERNATION=8]="HIBERNATION"})(vu||(vu={}));function cNe(o,h){for(let b=o.attrs.length-1;b>=0;b--)if(o.attrs[b].name===h)return o.attrs[b].value;return null}const uNe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(o=>o.charCodeAt(0))),jzn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(o=>o.charCodeAt(0)));var SRt;const Fzn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),$zn=(SRt=String.fromCodePoint)!==null&&SRt!==void 0?SRt:function(o){let h="";return o>65535&&(o-=65536,h+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),h+=String.fromCharCode(o),h};function Hzn(o){var h;return o>=55296&&o<=57343||o>1114111?65533:(h=Fzn.get(o))!==null&&h!==void 0?h:o}var F0;(function(o){o[o.NUM=35]="NUM",o[o.SEMI=59]="SEMI",o[o.EQUALS=61]="EQUALS",o[o.ZERO=48]="ZERO",o[o.NINE=57]="NINE",o[o.LOWER_A=97]="LOWER_A",o[o.LOWER_F=102]="LOWER_F",o[o.LOWER_X=120]="LOWER_X",o[o.LOWER_Z=122]="LOWER_Z",o[o.UPPER_A=65]="UPPER_A",o[o.UPPER_F=70]="UPPER_F",o[o.UPPER_Z=90]="UPPER_Z"})(F0||(F0={}));const zzn=32;var q8;(function(o){o[o.VALUE_LENGTH=49152]="VALUE_LENGTH",o[o.BRANCH_LENGTH=16256]="BRANCH_LENGTH",o[o.JUMP_TABLE=127]="JUMP_TABLE"})(q8||(q8={}));function jBt(o){return o>=F0.ZERO&&o<=F0.NINE}function Uzn(o){return o>=F0.UPPER_A&&o<=F0.UPPER_F||o>=F0.LOWER_A&&o<=F0.LOWER_F}function Gzn(o){return o>=F0.UPPER_A&&o<=F0.UPPER_Z||o>=F0.LOWER_A&&o<=F0.LOWER_Z||jBt(o)}function qzn(o){return o===F0.EQUALS||Gzn(o)}var R0;(function(o){o[o.EntityStart=0]="EntityStart",o[o.NumericStart=1]="NumericStart",o[o.NumericDecimal=2]="NumericDecimal",o[o.NumericHex=3]="NumericHex",o[o.NamedEntity=4]="NamedEntity"})(R0||(R0={}));var tT;(function(o){o[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute"})(tT||(tT={}));class lNe{constructor(h,b,k){this.decodeTree=h,this.emitCodePoint=b,this.errors=k,this.state=R0.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=tT.Strict}startEntity(h){this.decodeMode=h,this.state=R0.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(h,b){switch(this.state){case R0.EntityStart:return h.charCodeAt(b)===F0.NUM?(this.state=R0.NumericStart,this.consumed+=1,this.stateNumericStart(h,b+1)):(this.state=R0.NamedEntity,this.stateNamedEntity(h,b));case R0.NumericStart:return this.stateNumericStart(h,b);case R0.NumericDecimal:return this.stateNumericDecimal(h,b);case R0.NumericHex:return this.stateNumericHex(h,b);case R0.NamedEntity:return this.stateNamedEntity(h,b)}}stateNumericStart(h,b){return b>=h.length?-1:(h.charCodeAt(b)|zzn)===F0.LOWER_X?(this.state=R0.NumericHex,this.consumed+=1,this.stateNumericHex(h,b+1)):(this.state=R0.NumericDecimal,this.stateNumericDecimal(h,b))}addToNumericResult(h,b,k,O){if(b!==k){const P=k-b;this.result=this.result*Math.pow(O,P)+parseInt(h.substr(b,P),O),this.consumed+=P}}stateNumericHex(h,b){const k=b;for(;b<h.length;){const O=h.charCodeAt(b);if(jBt(O)||Uzn(O))b+=1;else return this.addToNumericResult(h,k,b,16),this.emitNumericEntity(O,3)}return this.addToNumericResult(h,k,b,16),-1}stateNumericDecimal(h,b){const k=b;for(;b<h.length;){const O=h.charCodeAt(b);if(jBt(O))b+=1;else return this.addToNumericResult(h,k,b,10),this.emitNumericEntity(O,2)}return this.addToNumericResult(h,k,b,10),-1}emitNumericEntity(h,b){var k;if(this.consumed<=b)return(k=this.errors)===null||k===void 0||k.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(h===F0.SEMI)this.consumed+=1;else if(this.decodeMode===tT.Strict)return 0;return this.emitCodePoint(Hzn(this.result),this.consumed),this.errors&&(h!==F0.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(h,b){const{decodeTree:k}=this;let O=k[this.treeIndex],P=(O&q8.VALUE_LENGTH)>>14;for(;b<h.length;b++,this.excess++){const B=h.charCodeAt(b);if(this.treeIndex=Wzn(k,O,this.treeIndex+Math.max(1,P),B),this.treeIndex<0)return this.result===0||this.decodeMode===tT.Attribute&&(P===0||qzn(B))?0:this.emitNotTerminatedNamedEntity();if(O=k[this.treeIndex],P=(O&q8.VALUE_LENGTH)>>14,P!==0){if(B===F0.SEMI)return this.emitNamedEntityData(this.treeIndex,P,this.consumed+this.excess);this.decodeMode!==tT.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var h;const{result:b,decodeTree:k}=this,O=(k[b]&q8.VALUE_LENGTH)>>14;return this.emitNamedEntityData(b,O,this.consumed),(h=this.errors)===null||h===void 0||h.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(h,b,k){const{decodeTree:O}=this;return this.emitCodePoint(b===1?O[h]&~q8.VALUE_LENGTH:O[h+1],k),b===3&&this.emitCodePoint(O[h+2],k),k}end(){var h;switch(this.state){case R0.NamedEntity:return this.result!==0&&(this.decodeMode!==tT.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case R0.NumericDecimal:return this.emitNumericEntity(0,2);case R0.NumericHex:return this.emitNumericEntity(0,3);case R0.NumericStart:return(h=this.errors)===null||h===void 0||h.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case R0.EntityStart:return 0}}}function hNe(o){let h="";const b=new lNe(o,k=>h+=$zn(k));return function(O,P){let B=0,G=0;for(;(G=O.indexOf("&",G))>=0;){h+=O.slice(B,G),b.startEntity(P);const U=b.write(O,G+1);if(U<0){B=G+b.end();break}B=G+U,G=U===0?B+1:B}const J=h+O.slice(B);return h="",J}}function Wzn(o,h,b,k){const O=(h&q8.BRANCH_LENGTH)>>7,P=h&q8.JUMP_TABLE;if(O===0)return P!==0&&k===P?b:-1;if(P){const J=k-P;return J<0||J>=O?-1:o[b+J]-1}let B=b,G=B+O-1;for(;B<=G;){const J=B+G>>>1,U=o[J];if(U<k)B=J+1;else if(U>k)G=J-1;else return o[J+O]}return-1}hNe(uNe);hNe(jzn);var Bi;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.MATHML="http://www.w3.org/1998/Math/MathML",o.SVG="http://www.w3.org/2000/svg",o.XLINK="http://www.w3.org/1999/xlink",o.XML="http://www.w3.org/XML/1998/namespace",o.XMLNS="http://www.w3.org/2000/xmlns/"})(Bi||(Bi={}));var WN;(function(o){o.TYPE="type",o.ACTION="action",o.ENCODING="encoding",o.PROMPT="prompt",o.NAME="name",o.COLOR="color",o.FACE="face",o.SIZE="size"})(WN||(WN={}));var w3;(function(o){o.NO_QUIRKS="no-quirks",o.QUIRKS="quirks",o.LIMITED_QUIRKS="limited-quirks"})(w3||(w3={}));var ur;(function(o){o.A="a",o.ADDRESS="address",o.ANNOTATION_XML="annotation-xml",o.APPLET="applet",o.AREA="area",o.ARTICLE="article",o.ASIDE="aside",o.B="b",o.BASE="base",o.BASEFONT="basefont",o.BGSOUND="bgsound",o.BIG="big",o.BLOCKQUOTE="blockquote",o.BODY="body",o.BR="br",o.BUTTON="button",o.CAPTION="caption",o.CENTER="center",o.CODE="code",o.COL="col",o.COLGROUP="colgroup",o.DD="dd",o.DESC="desc",o.DETAILS="details",o.DIALOG="dialog",o.DIR="dir",o.DIV="div",o.DL="dl",o.DT="dt",o.EM="em",o.EMBED="embed",o.FIELDSET="fieldset",o.FIGCAPTION="figcaption",o.FIGURE="figure",o.FONT="font",o.FOOTER="footer",o.FOREIGN_OBJECT="foreignObject",o.FORM="form",o.FRAME="frame",o.FRAMESET="frameset",o.H1="h1",o.H2="h2",o.H3="h3",o.H4="h4",o.H5="h5",o.H6="h6",o.HEAD="head",o.HEADER="header",o.HGROUP="hgroup",o.HR="hr",o.HTML="html",o.I="i",o.IMG="img",o.IMAGE="image",o.INPUT="input",o.IFRAME="iframe",o.KEYGEN="keygen",o.LABEL="label",o.LI="li",o.LINK="link",o.LISTING="listing",o.MAIN="main",o.MALIGNMARK="malignmark",o.MARQUEE="marquee",o.MATH="math",o.MENU="menu",o.META="meta",o.MGLYPH="mglyph",o.MI="mi",o.MO="mo",o.MN="mn",o.MS="ms",o.MTEXT="mtext",o.NAV="nav",o.NOBR="nobr",o.NOFRAMES="noframes",o.NOEMBED="noembed",o.NOSCRIPT="noscript",o.OBJECT="object",o.OL="ol",o.OPTGROUP="optgroup",o.OPTION="option",o.P="p",o.PARAM="param",o.PLAINTEXT="plaintext",o.PRE="pre",o.RB="rb",o.RP="rp",o.RT="rt",o.RTC="rtc",o.RUBY="ruby",o.S="s",o.SCRIPT="script",o.SEARCH="search",o.SECTION="section",o.SELECT="select",o.SOURCE="source",o.SMALL="small",o.SPAN="span",o.STRIKE="strike",o.STRONG="strong",o.STYLE="style",o.SUB="sub",o.SUMMARY="summary",o.SUP="sup",o.TABLE="table",o.TBODY="tbody",o.TEMPLATE="template",o.TEXTAREA="textarea",o.TFOOT="tfoot",o.TD="td",o.TH="th",o.THEAD="thead",o.TITLE="title",o.TR="tr",o.TRACK="track",o.TT="tt",o.U="u",o.UL="ul",o.SVG="svg",o.VAR="var",o.WBR="wbr",o.XMP="xmp"})(ur||(ur={}));var dt;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.A=1]="A",o[o.ADDRESS=2]="ADDRESS",o[o.ANNOTATION_XML=3]="ANNOTATION_XML",o[o.APPLET=4]="APPLET",o[o.AREA=5]="AREA",o[o.ARTICLE=6]="ARTICLE",o[o.ASIDE=7]="ASIDE",o[o.B=8]="B",o[o.BASE=9]="BASE",o[o.BASEFONT=10]="BASEFONT",o[o.BGSOUND=11]="BGSOUND",o[o.BIG=12]="BIG",o[o.BLOCKQUOTE=13]="BLOCKQUOTE",o[o.BODY=14]="BODY",o[o.BR=15]="BR",o[o.BUTTON=16]="BUTTON",o[o.CAPTION=17]="CAPTION",o[o.CENTER=18]="CENTER",o[o.CODE=19]="CODE",o[o.COL=20]="COL",o[o.COLGROUP=21]="COLGROUP",o[o.DD=22]="DD",o[o.DESC=23]="DESC",o[o.DETAILS=24]="DETAILS",o[o.DIALOG=25]="DIALOG",o[o.DIR=26]="DIR",o[o.DIV=27]="DIV",o[o.DL=28]="DL",o[o.DT=29]="DT",o[o.EM=30]="EM",o[o.EMBED=31]="EMBED",o[o.FIELDSET=32]="FIELDSET",o[o.FIGCAPTION=33]="FIGCAPTION",o[o.FIGURE=34]="FIGURE",o[o.FONT=35]="FONT",o[o.FOOTER=36]="FOOTER",o[o.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",o[o.FORM=38]="FORM",o[o.FRAME=39]="FRAME",o[o.FRAMESET=40]="FRAMESET",o[o.H1=41]="H1",o[o.H2=42]="H2",o[o.H3=43]="H3",o[o.H4=44]="H4",o[o.H5=45]="H5",o[o.H6=46]="H6",o[o.HEAD=47]="HEAD",o[o.HEADER=48]="HEADER",o[o.HGROUP=49]="HGROUP",o[o.HR=50]="HR",o[o.HTML=51]="HTML",o[o.I=52]="I",o[o.IMG=53]="IMG",o[o.IMAGE=54]="IMAGE",o[o.INPUT=55]="INPUT",o[o.IFRAME=56]="IFRAME",o[o.KEYGEN=57]="KEYGEN",o[o.LABEL=58]="LABEL",o[o.LI=59]="LI",o[o.LINK=60]="LINK",o[o.LISTING=61]="LISTING",o[o.MAIN=62]="MAIN",o[o.MALIGNMARK=63]="MALIGNMARK",o[o.MARQUEE=64]="MARQUEE",o[o.MATH=65]="MATH",o[o.MENU=66]="MENU",o[o.META=67]="META",o[o.MGLYPH=68]="MGLYPH",o[o.MI=69]="MI",o[o.MO=70]="MO",o[o.MN=71]="MN",o[o.MS=72]="MS",o[o.MTEXT=73]="MTEXT",o[o.NAV=74]="NAV",o[o.NOBR=75]="NOBR",o[o.NOFRAMES=76]="NOFRAMES",o[o.NOEMBED=77]="NOEMBED",o[o.NOSCRIPT=78]="NOSCRIPT",o[o.OBJECT=79]="OBJECT",o[o.OL=80]="OL",o[o.OPTGROUP=81]="OPTGROUP",o[o.OPTION=82]="OPTION",o[o.P=83]="P",o[o.PARAM=84]="PARAM",o[o.PLAINTEXT=85]="PLAINTEXT",o[o.PRE=86]="PRE",o[o.RB=87]="RB",o[o.RP=88]="RP",o[o.RT=89]="RT",o[o.RTC=90]="RTC",o[o.RUBY=91]="RUBY",o[o.S=92]="S",o[o.SCRIPT=93]="SCRIPT",o[o.SEARCH=94]="SEARCH",o[o.SECTION=95]="SECTION",o[o.SELECT=96]="SELECT",o[o.SOURCE=97]="SOURCE",o[o.SMALL=98]="SMALL",o[o.SPAN=99]="SPAN",o[o.STRIKE=100]="STRIKE",o[o.STRONG=101]="STRONG",o[o.STYLE=102]="STYLE",o[o.SUB=103]="SUB",o[o.SUMMARY=104]="SUMMARY",o[o.SUP=105]="SUP",o[o.TABLE=106]="TABLE",o[o.TBODY=107]="TBODY",o[o.TEMPLATE=108]="TEMPLATE",o[o.TEXTAREA=109]="TEXTAREA",o[o.TFOOT=110]="TFOOT",o[o.TD=111]="TD",o[o.TH=112]="TH",o[o.THEAD=113]="THEAD",o[o.TITLE=114]="TITLE",o[o.TR=115]="TR",o[o.TRACK=116]="TRACK",o[o.TT=117]="TT",o[o.U=118]="U",o[o.UL=119]="UL",o[o.SVG=120]="SVG",o[o.VAR=121]="VAR",o[o.WBR=122]="WBR",o[o.XMP=123]="XMP"})(dt||(dt={}));const Kzn=new Map([[ur.A,dt.A],[ur.ADDRESS,dt.ADDRESS],[ur.ANNOTATION_XML,dt.ANNOTATION_XML],[ur.APPLET,dt.APPLET],[ur.AREA,dt.AREA],[ur.ARTICLE,dt.ARTICLE],[ur.ASIDE,dt.ASIDE],[ur.B,dt.B],[ur.BASE,dt.BASE],[ur.BASEFONT,dt.BASEFONT],[ur.BGSOUND,dt.BGSOUND],[ur.BIG,dt.BIG],[ur.BLOCKQUOTE,dt.BLOCKQUOTE],[ur.BODY,dt.BODY],[ur.BR,dt.BR],[ur.BUTTON,dt.BUTTON],[ur.CAPTION,dt.CAPTION],[ur.CENTER,dt.CENTER],[ur.CODE,dt.CODE],[ur.COL,dt.COL],[ur.COLGROUP,dt.COLGROUP],[ur.DD,dt.DD],[ur.DESC,dt.DESC],[ur.DETAILS,dt.DETAILS],[ur.DIALOG,dt.DIALOG],[ur.DIR,dt.DIR],[ur.DIV,dt.DIV],[ur.DL,dt.DL],[ur.DT,dt.DT],[ur.EM,dt.EM],[ur.EMBED,dt.EMBED],[ur.FIELDSET,dt.FIELDSET],[ur.FIGCAPTION,dt.FIGCAPTION],[ur.FIGURE,dt.FIGURE],[ur.FONT,dt.FONT],[ur.FOOTER,dt.FOOTER],[ur.FOREIGN_OBJECT,dt.FOREIGN_OBJECT],[ur.FORM,dt.FORM],[ur.FRAME,dt.FRAME],[ur.FRAMESET,dt.FRAMESET],[ur.H1,dt.H1],[ur.H2,dt.H2],[ur.H3,dt.H3],[ur.H4,dt.H4],[ur.H5,dt.H5],[ur.H6,dt.H6],[ur.HEAD,dt.HEAD],[ur.HEADER,dt.HEADER],[ur.HGROUP,dt.HGROUP],[ur.HR,dt.HR],[ur.HTML,dt.HTML],[ur.I,dt.I],[ur.IMG,dt.IMG],[ur.IMAGE,dt.IMAGE],[ur.INPUT,dt.INPUT],[ur.IFRAME,dt.IFRAME],[ur.KEYGEN,dt.KEYGEN],[ur.LABEL,dt.LABEL],[ur.LI,dt.LI],[ur.LINK,dt.LINK],[ur.LISTING,dt.LISTING],[ur.MAIN,dt.MAIN],[ur.MALIGNMARK,dt.MALIGNMARK],[ur.MARQUEE,dt.MARQUEE],[ur.MATH,dt.MATH],[ur.MENU,dt.MENU],[ur.META,dt.META],[ur.MGLYPH,dt.MGLYPH],[ur.MI,dt.MI],[ur.MO,dt.MO],[ur.MN,dt.MN],[ur.MS,dt.MS],[ur.MTEXT,dt.MTEXT],[ur.NAV,dt.NAV],[ur.NOBR,dt.NOBR],[ur.NOFRAMES,dt.NOFRAMES],[ur.NOEMBED,dt.NOEMBED],[ur.NOSCRIPT,dt.NOSCRIPT],[ur.OBJECT,dt.OBJECT],[ur.OL,dt.OL],[ur.OPTGROUP,dt.OPTGROUP],[ur.OPTION,dt.OPTION],[ur.P,dt.P],[ur.PARAM,dt.PARAM],[ur.PLAINTEXT,dt.PLAINTEXT],[ur.PRE,dt.PRE],[ur.RB,dt.RB],[ur.RP,dt.RP],[ur.RT,dt.RT],[ur.RTC,dt.RTC],[ur.RUBY,dt.RUBY],[ur.S,dt.S],[ur.SCRIPT,dt.SCRIPT],[ur.SEARCH,dt.SEARCH],[ur.SECTION,dt.SECTION],[ur.SELECT,dt.SELECT],[ur.SOURCE,dt.SOURCE],[ur.SMALL,dt.SMALL],[ur.SPAN,dt.SPAN],[ur.STRIKE,dt.STRIKE],[ur.STRONG,dt.STRONG],[ur.STYLE,dt.STYLE],[ur.SUB,dt.SUB],[ur.SUMMARY,dt.SUMMARY],[ur.SUP,dt.SUP],[ur.TABLE,dt.TABLE],[ur.TBODY,dt.TBODY],[ur.TEMPLATE,dt.TEMPLATE],[ur.TEXTAREA,dt.TEXTAREA],[ur.TFOOT,dt.TFOOT],[ur.TD,dt.TD],[ur.TH,dt.TH],[ur.THEAD,dt.THEAD],[ur.TITLE,dt.TITLE],[ur.TR,dt.TR],[ur.TRACK,dt.TRACK],[ur.TT,dt.TT],[ur.U,dt.U],[ur.UL,dt.UL],[ur.SVG,dt.SVG],[ur.VAR,dt.VAR],[ur.WBR,dt.WBR],[ur.XMP,dt.XMP]]);function Zj(o){var h;return(h=Kzn.get(o))!==null&&h!==void 0?h:dt.UNKNOWN}const Xi=dt,Vzn={[Bi.HTML]:new Set([Xi.ADDRESS,Xi.APPLET,Xi.AREA,Xi.ARTICLE,Xi.ASIDE,Xi.BASE,Xi.BASEFONT,Xi.BGSOUND,Xi.BLOCKQUOTE,Xi.BODY,Xi.BR,Xi.BUTTON,Xi.CAPTION,Xi.CENTER,Xi.COL,Xi.COLGROUP,Xi.DD,Xi.DETAILS,Xi.DIR,Xi.DIV,Xi.DL,Xi.DT,Xi.EMBED,Xi.FIELDSET,Xi.FIGCAPTION,Xi.FIGURE,Xi.FOOTER,Xi.FORM,Xi.FRAME,Xi.FRAMESET,Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6,Xi.HEAD,Xi.HEADER,Xi.HGROUP,Xi.HR,Xi.HTML,Xi.IFRAME,Xi.IMG,Xi.INPUT,Xi.LI,Xi.LINK,Xi.LISTING,Xi.MAIN,Xi.MARQUEE,Xi.MENU,Xi.META,Xi.NAV,Xi.NOEMBED,Xi.NOFRAMES,Xi.NOSCRIPT,Xi.OBJECT,Xi.OL,Xi.P,Xi.PARAM,Xi.PLAINTEXT,Xi.PRE,Xi.SCRIPT,Xi.SECTION,Xi.SELECT,Xi.SOURCE,Xi.STYLE,Xi.SUMMARY,Xi.TABLE,Xi.TBODY,Xi.TD,Xi.TEMPLATE,Xi.TEXTAREA,Xi.TFOOT,Xi.TH,Xi.THEAD,Xi.TITLE,Xi.TR,Xi.TRACK,Xi.UL,Xi.WBR,Xi.XMP]),[Bi.MATHML]:new Set([Xi.MI,Xi.MO,Xi.MN,Xi.MS,Xi.MTEXT,Xi.ANNOTATION_XML]),[Bi.SVG]:new Set([Xi.TITLE,Xi.FOREIGN_OBJECT,Xi.DESC]),[Bi.XLINK]:new Set,[Bi.XML]:new Set,[Bi.XMLNS]:new Set},FBt=new Set([Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6]);ur.STYLE,ur.SCRIPT,ur.XMP,ur.IFRAME,ur.NOEMBED,ur.NOFRAMES,ur.PLAINTEXT;var He;(function(o){o[o.DATA=0]="DATA",o[o.RCDATA=1]="RCDATA",o[o.RAWTEXT=2]="RAWTEXT",o[o.SCRIPT_DATA=3]="SCRIPT_DATA",o[o.PLAINTEXT=4]="PLAINTEXT",o[o.TAG_OPEN=5]="TAG_OPEN",o[o.END_TAG_OPEN=6]="END_TAG_OPEN",o[o.TAG_NAME=7]="TAG_NAME",o[o.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",o[o.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",o[o.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",o[o.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",o[o.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",o[o.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",o[o.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",o[o.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",o[o.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",o[o.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",o[o.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",o[o.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",o[o.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",o[o.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",o[o.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",o[o.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",o[o.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",o[o.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",o[o.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",o[o.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",o[o.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",o[o.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",o[o.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",o[o.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",o[o.BOGUS_COMMENT=40]="BOGUS_COMMENT",o[o.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",o[o.COMMENT_START=42]="COMMENT_START",o[o.COMMENT_START_DASH=43]="COMMENT_START_DASH",o[o.COMMENT=44]="COMMENT",o[o.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",o[o.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",o[o.COMMENT_END_DASH=49]="COMMENT_END_DASH",o[o.COMMENT_END=50]="COMMENT_END",o[o.COMMENT_END_BANG=51]="COMMENT_END_BANG",o[o.DOCTYPE=52]="DOCTYPE",o[o.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",o[o.DOCTYPE_NAME=54]="DOCTYPE_NAME",o[o.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",o[o.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",o[o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",o[o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",o[o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",o[o.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",o[o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",o[o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",o[o.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",o[o.CDATA_SECTION=68]="CDATA_SECTION",o[o.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",o[o.CDATA_SECTION_END=70]="CDATA_SECTION_END",o[o.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",o[o.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(He||(He={}));const C1={DATA:He.DATA,RCDATA:He.RCDATA,RAWTEXT:He.RAWTEXT,SCRIPT_DATA:He.SCRIPT_DATA,PLAINTEXT:He.PLAINTEXT,CDATA_SECTION:He.CDATA_SECTION};function Yzn(o){return o>=xe.DIGIT_0&&o<=xe.DIGIT_9}function sX(o){return o>=xe.LATIN_CAPITAL_A&&o<=xe.LATIN_CAPITAL_Z}function Jzn(o){return o>=xe.LATIN_SMALL_A&&o<=xe.LATIN_SMALL_Z}function U8(o){return Jzn(o)||sX(o)}function SAe(o){return U8(o)||Yzn(o)}function vmt(o){return o+32}function fNe(o){return o===xe.SPACE||o===xe.LINE_FEED||o===xe.TABULATION||o===xe.FORM_FEED}function IAe(o){return fNe(o)||o===xe.SOLIDUS||o===xe.GREATER_THAN_SIGN}function Xzn(o){return o===xe.NULL?Fr.nullCharacterReference:o>1114111?Fr.characterReferenceOutsideUnicodeRange:aNe(o)?Fr.surrogateCharacterReference:sNe(o)?Fr.noncharacterCharacterReference:oNe(o)||o===xe.CARRIAGE_RETURN?Fr.controlCharacterReference:null}class Qzn{constructor(h,b){this.options=h,this.handler=b,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=He.DATA,this.returnState=He.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Bzn(b),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new lNe(uNe,(k,O)=>{this.preprocessor.pos=this.entityStartPos+O-1,this._flushCodePointConsumedAsCharacterReference(k)},b.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Fr.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:k=>{this._err(Fr.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+k)},validateNumericCharacterReference:k=>{const O=Xzn(k);O&&this._err(O,1)}}:void 0)}_err(h,b=0){var k,O;(O=(k=this.handler).onParseError)===null||O===void 0||O.call(k,this.preprocessor.getError(h,b))}getCurrentLocation(h){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-h,startOffset:this.preprocessor.offset-h,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const h=this._consume();this._ensureHibernation()||this._callState(h)}this.inLoop=!1}}pause(){this.paused=!0}resume(h){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||h==null||h())}write(h,b,k){this.active=!0,this.preprocessor.write(h,b),this._runParsingLoop(),this.paused||k==null||k()}insertHtmlAtCurrentPos(h){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(h),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(h){this.consumedAfterSnapshot+=h;for(let b=0;b<h;b++)this.preprocessor.advance()}_consumeSequenceIfMatch(h,b){return this.preprocessor.startsWith(h,b)?(this._advanceBy(h.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:vu.START_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:vu.END_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(h){this.currentToken={type:vu.COMMENT,data:"",location:this.getCurrentLocation(h)}}_createDoctypeToken(h){this.currentToken={type:vu.DOCTYPE,name:h,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(h,b){this.currentCharacterToken={type:h,chars:b,location:this.currentLocation}}_createAttr(h){this.currentAttr={name:h,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var h,b;const k=this.currentToken;if(cNe(k,this.currentAttr.name)===null){if(k.attrs.push(this.currentAttr),k.location&&this.currentLocation){const O=(h=(b=k.location).attrs)!==null&&h!==void 0?h:b.attrs=Object.create(null);O[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Fr.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(h){this._emitCurrentCharacterToken(h.location),this.currentToken=null,h.location&&(h.location.endLine=this.preprocessor.line,h.location.endCol=this.preprocessor.col+1,h.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const h=this.currentToken;this.prepareToken(h),h.tagID=Zj(h.tagName),h.type===vu.START_TAG?(this.lastStartTagName=h.tagName,this.handler.onStartTag(h)):(h.attrs.length>0&&this._err(Fr.endTagWithAttributes),h.selfClosing&&this._err(Fr.endTagWithTrailingSolidus),this.handler.onEndTag(h)),this.preprocessor.dropParsedChunk()}emitCurrentComment(h){this.prepareToken(h),this.handler.onComment(h),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(h){this.prepareToken(h),this.handler.onDoctype(h),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(h){if(this.currentCharacterToken){switch(h&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=h.startLine,this.currentCharacterToken.location.endCol=h.startCol,this.currentCharacterToken.location.endOffset=h.startOffset),this.currentCharacterToken.type){case vu.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case vu.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case vu.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const h=this.getCurrentLocation(0);h&&(h.endLine=h.startLine,h.endCol=h.startCol,h.endOffset=h.startOffset),this._emitCurrentCharacterToken(h),this.handler.onEof({type:vu.EOF,location:h}),this.active=!1}_appendCharToCurrentCharacterToken(h,b){if(this.currentCharacterToken)if(this.currentCharacterToken.type===h){this.currentCharacterToken.chars+=b;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(h,b)}_emitCodePoint(h){const b=fNe(h)?vu.WHITESPACE_CHARACTER:h===xe.NULL?vu.NULL_CHARACTER:vu.CHARACTER;this._appendCharToCurrentCharacterToken(b,String.fromCodePoint(h))}_emitChars(h){this._appendCharToCurrentCharacterToken(vu.CHARACTER,h)}_startCharacterReference(){this.returnState=this.state,this.state=He.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?tT.Attribute:tT.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===He.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===He.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===He.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(h){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(h):this._emitCodePoint(h)}_callState(h){switch(this.state){case He.DATA:{this._stateData(h);break}case He.RCDATA:{this._stateRcdata(h);break}case He.RAWTEXT:{this._stateRawtext(h);break}case He.SCRIPT_DATA:{this._stateScriptData(h);break}case He.PLAINTEXT:{this._statePlaintext(h);break}case He.TAG_OPEN:{this._stateTagOpen(h);break}case He.END_TAG_OPEN:{this._stateEndTagOpen(h);break}case He.TAG_NAME:{this._stateTagName(h);break}case He.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(h);break}case He.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(h);break}case He.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(h);break}case He.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(h);break}case He.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(h);break}case He.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(h);break}case He.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(h);break}case He.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(h);break}case He.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(h);break}case He.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(h);break}case He.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(h);break}case He.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(h);break}case He.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(h);break}case He.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(h);break}case He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(h);break}case He.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(h);break}case He.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(h);break}case He.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(h);break}case He.ATTRIBUTE_NAME:{this._stateAttributeName(h);break}case He.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(h);break}case He.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(h);break}case He.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(h);break}case He.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(h);break}case He.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(h);break}case He.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(h);break}case He.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(h);break}case He.BOGUS_COMMENT:{this._stateBogusComment(h);break}case He.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(h);break}case He.COMMENT_START:{this._stateCommentStart(h);break}case He.COMMENT_START_DASH:{this._stateCommentStartDash(h);break}case He.COMMENT:{this._stateComment(h);break}case He.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(h);break}case He.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(h);break}case He.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(h);break}case He.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(h);break}case He.COMMENT_END_DASH:{this._stateCommentEndDash(h);break}case He.COMMENT_END:{this._stateCommentEnd(h);break}case He.COMMENT_END_BANG:{this._stateCommentEndBang(h);break}case He.DOCTYPE:{this._stateDoctype(h);break}case He.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(h);break}case He.DOCTYPE_NAME:{this._stateDoctypeName(h);break}case He.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(h);break}case He.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(h);break}case He.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(h);break}case He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(h);break}case He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(h);break}case He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(h);break}case He.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(h);break}case He.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(h);break}case He.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(h);break}case He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(h);break}case He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(h);break}case He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(h);break}case He.BOGUS_DOCTYPE:{this._stateBogusDoctype(h);break}case He.CDATA_SECTION:{this._stateCdataSection(h);break}case He.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(h);break}case He.CDATA_SECTION_END:{this._stateCdataSectionEnd(h);break}case He.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case He.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(h);break}default:throw new Error("Unknown state")}}_stateData(h){switch(h){case xe.LESS_THAN_SIGN:{this.state=He.TAG_OPEN;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitCodePoint(h);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateRcdata(h){switch(h){case xe.AMPERSAND:{this._startCharacterReference();break}case xe.LESS_THAN_SIGN:{this.state=He.RCDATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateRawtext(h){switch(h){case xe.LESS_THAN_SIGN:{this.state=He.RAWTEXT_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateScriptData(h){switch(h){case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_statePlaintext(h){switch(h){case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateTagOpen(h){if(U8(h))this._createStartTagToken(),this.state=He.TAG_NAME,this._stateTagName(h);else switch(h){case xe.EXCLAMATION_MARK:{this.state=He.MARKUP_DECLARATION_OPEN;break}case xe.SOLIDUS:{this.state=He.END_TAG_OPEN;break}case xe.QUESTION_MARK:{this._err(Fr.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=He.BOGUS_COMMENT,this._stateBogusComment(h);break}case xe.EOF:{this._err(Fr.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Fr.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=He.DATA,this._stateData(h)}}_stateEndTagOpen(h){if(U8(h))this._createEndTagToken(),this.state=He.TAG_NAME,this._stateTagName(h);else switch(h){case xe.GREATER_THAN_SIGN:{this._err(Fr.missingEndTagName),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Fr.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=He.BOGUS_COMMENT,this._stateBogusComment(h)}}_stateTagName(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_ATTRIBUTE_NAME;break}case xe.SOLIDUS:{this.state=He.SELF_CLOSING_START_TAG;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentTagToken();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.tagName+=Wf;break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:b.tagName+=String.fromCodePoint(sX(h)?vmt(h):h)}}_stateRcdataLessThanSign(h){h===xe.SOLIDUS?this.state=He.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=He.RCDATA,this._stateRcdata(h))}_stateRcdataEndTagOpen(h){U8(h)?(this.state=He.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(h)):(this._emitChars("</"),this.state=He.RCDATA,this._stateRcdata(h))}handleSpecialEndTag(h){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const b=this.currentToken;switch(b.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=He.BEFORE_ATTRIBUTE_NAME,!1;case xe.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=He.SELF_CLOSING_START_TAG,!1;case xe.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=He.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.RCDATA,this._stateRcdata(h))}_stateRawtextLessThanSign(h){h===xe.SOLIDUS?this.state=He.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=He.RAWTEXT,this._stateRawtext(h))}_stateRawtextEndTagOpen(h){U8(h)?(this.state=He.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(h)):(this._emitChars("</"),this.state=He.RAWTEXT,this._stateRawtext(h))}_stateRawtextEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.RAWTEXT,this._stateRawtext(h))}_stateScriptDataLessThanSign(h){switch(h){case xe.SOLIDUS:{this.state=He.SCRIPT_DATA_END_TAG_OPEN;break}case xe.EXCLAMATION_MARK:{this.state=He.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=He.SCRIPT_DATA,this._stateScriptData(h)}}_stateScriptDataEndTagOpen(h){U8(h)?(this.state=He.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(h)):(this._emitChars("</"),this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEscapeStart(h){h===xe.HYPHEN_MINUS?(this.state=He.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEscapeStartDash(h){h===xe.HYPHEN_MINUS?(this.state=He.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEscaped(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateScriptDataEscapedDash(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataEscapedDashDash(h){switch(h){case xe.HYPHEN_MINUS:{this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case xe.GREATER_THAN_SIGN:{this.state=He.SCRIPT_DATA,this._emitChars(">");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataEscapedLessThanSign(h){h===xe.SOLIDUS?this.state=He.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:U8(h)?(this._emitChars("<"),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(h)):(this._emitChars("<"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataEscapedEndTagOpen(h){U8(h)?(this.state=He.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(h)):(this._emitChars("</"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataEscapedEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataDoubleEscapeStart(h){if(this.preprocessor.startsWith(U2.SCRIPT,!1)&&IAe(this.preprocessor.peek(U2.SCRIPT.length))){this._emitCodePoint(h);for(let b=0;b<U2.SCRIPT.length;b++)this._emitCodePoint(this._consume());this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataDoubleEscaped(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateScriptDataDoubleEscapedDash(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataDoubleEscapedDashDash(h){switch(h){case xe.HYPHEN_MINUS:{this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case xe.GREATER_THAN_SIGN:{this.state=He.SCRIPT_DATA,this._emitChars(">");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataDoubleEscapedLessThanSign(h){h===xe.SOLIDUS?(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(h))}_stateScriptDataDoubleEscapeEnd(h){if(this.preprocessor.startsWith(U2.SCRIPT,!1)&&IAe(this.preprocessor.peek(U2.SCRIPT.length))){this._emitCodePoint(h);for(let b=0;b<U2.SCRIPT.length;b++)this._emitCodePoint(this._consume());this.state=He.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(h))}_stateBeforeAttributeName(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.SOLIDUS:case xe.GREATER_THAN_SIGN:case xe.EOF:{this.state=He.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(h);break}case xe.EQUALS_SIGN:{this._err(Fr.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=He.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=He.ATTRIBUTE_NAME,this._stateAttributeName(h)}}_stateAttributeName(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:case xe.SOLIDUS:case xe.GREATER_THAN_SIGN:case xe.EOF:{this._leaveAttrName(),this.state=He.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(h);break}case xe.EQUALS_SIGN:{this._leaveAttrName(),this.state=He.BEFORE_ATTRIBUTE_VALUE;break}case xe.QUOTATION_MARK:case xe.APOSTROPHE:case xe.LESS_THAN_SIGN:{this._err(Fr.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(h);break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.name+=Wf;break}default:this.currentAttr.name+=String.fromCodePoint(sX(h)?vmt(h):h)}}_stateAfterAttributeName(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.SOLIDUS:{this.state=He.SELF_CLOSING_START_TAG;break}case xe.EQUALS_SIGN:{this.state=He.BEFORE_ATTRIBUTE_VALUE;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentTagToken();break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=He.ATTRIBUTE_NAME,this._stateAttributeName(h)}}_stateBeforeAttributeValue(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.QUOTATION_MARK:{this.state=He.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this.state=He.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingAttributeValue),this.state=He.DATA,this.emitCurrentTagToken();break}default:this.state=He.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(h)}}_stateAttributeValueDoubleQuoted(h){switch(h){case xe.QUOTATION_MARK:{this.state=He.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.value+=Wf;break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(h)}}_stateAttributeValueSingleQuoted(h){switch(h){case xe.APOSTROPHE:{this.state=He.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.value+=Wf;break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(h)}}_stateAttributeValueUnquoted(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this._leaveAttrValue(),this.state=He.BEFORE_ATTRIBUTE_NAME;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=He.DATA,this.emitCurrentTagToken();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.value+=Wf;break}case xe.QUOTATION_MARK:case xe.APOSTROPHE:case xe.LESS_THAN_SIGN:case xe.EQUALS_SIGN:case xe.GRAVE_ACCENT:{this._err(Fr.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(h);break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(h)}}_stateAfterAttributeValueQuoted(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this._leaveAttrValue(),this.state=He.BEFORE_ATTRIBUTE_NAME;break}case xe.SOLIDUS:{this._leaveAttrValue(),this.state=He.SELF_CLOSING_START_TAG;break}case xe.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=He.DATA,this.emitCurrentTagToken();break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this._err(Fr.missingWhitespaceBetweenAttributes),this.state=He.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(h)}}_stateSelfClosingStartTag(h){switch(h){case xe.GREATER_THAN_SIGN:{const b=this.currentToken;b.selfClosing=!0,this.state=He.DATA,this.emitCurrentTagToken();break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this._err(Fr.unexpectedSolidusInTag),this.state=He.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(h)}}_stateBogusComment(h){const b=this.currentToken;switch(h){case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EOF:{this.emitCurrentComment(b),this._emitEOFToken();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.data+=Wf;break}default:b.data+=String.fromCodePoint(h)}}_stateMarkupDeclarationOpen(h){this._consumeSequenceIfMatch(U2.DASH_DASH,!0)?(this._createCommentToken(U2.DASH_DASH.length+1),this.state=He.COMMENT_START):this._consumeSequenceIfMatch(U2.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(U2.DOCTYPE.length+1),this.state=He.DOCTYPE):this._consumeSequenceIfMatch(U2.CDATA_START,!0)?this.inForeignNode?this.state=He.CDATA_SECTION:(this._err(Fr.cdataInHtmlContent),this._createCommentToken(U2.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=He.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Fr.incorrectlyOpenedComment),this._createCommentToken(2),this.state=He.BOGUS_COMMENT,this._stateBogusComment(h))}_stateCommentStart(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_START_DASH;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptClosingOfEmptyComment),this.state=He.DATA;const b=this.currentToken;this.emitCurrentComment(b);break}default:this.state=He.COMMENT,this._stateComment(h)}}_stateCommentStartDash(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_END;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptClosingOfEmptyComment),this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="-",this.state=He.COMMENT,this._stateComment(h)}}_stateComment(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_END_DASH;break}case xe.LESS_THAN_SIGN:{b.data+="<",this.state=He.COMMENT_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.data+=Wf;break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+=String.fromCodePoint(h)}}_stateCommentLessThanSign(h){const b=this.currentToken;switch(h){case xe.EXCLAMATION_MARK:{b.data+="!",this.state=He.COMMENT_LESS_THAN_SIGN_BANG;break}case xe.LESS_THAN_SIGN:{b.data+="<";break}default:this.state=He.COMMENT,this._stateComment(h)}}_stateCommentLessThanSignBang(h){h===xe.HYPHEN_MINUS?this.state=He.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=He.COMMENT,this._stateComment(h))}_stateCommentLessThanSignBangDash(h){h===xe.HYPHEN_MINUS?this.state=He.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=He.COMMENT_END_DASH,this._stateCommentEndDash(h))}_stateCommentLessThanSignBangDashDash(h){h!==xe.GREATER_THAN_SIGN&&h!==xe.EOF&&this._err(Fr.nestedComment),this.state=He.COMMENT_END,this._stateCommentEnd(h)}_stateCommentEndDash(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_END;break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="-",this.state=He.COMMENT,this._stateComment(h)}}_stateCommentEnd(h){const b=this.currentToken;switch(h){case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EXCLAMATION_MARK:{this.state=He.COMMENT_END_BANG;break}case xe.HYPHEN_MINUS:{b.data+="-";break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="--",this.state=He.COMMENT,this._stateComment(h)}}_stateCommentEndBang(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{b.data+="--!",this.state=He.COMMENT_END_DASH;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.incorrectlyClosedComment),this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="--!",this.state=He.COMMENT,this._stateComment(h)}}_stateDoctype(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_NAME;break}case xe.GREATER_THAN_SIGN:{this.state=He.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(h);break}case xe.EOF:{this._err(Fr.eofInDoctype),this._createDoctypeToken(null);const b=this.currentToken;b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingWhitespaceBeforeDoctypeName),this.state=He.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(h)}}_stateBeforeDoctypeName(h){if(sX(h))this._createDoctypeToken(String.fromCharCode(vmt(h))),this.state=He.DOCTYPE_NAME;else switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._createDoctypeToken(Wf),this.state=He.DOCTYPE_NAME;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypeName),this._createDoctypeToken(null);const b=this.currentToken;b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),this._createDoctypeToken(null);const b=this.currentToken;b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(h)),this.state=He.DOCTYPE_NAME}}_stateDoctypeName(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.AFTER_DOCTYPE_NAME;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.name+=Wf;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.name+=String.fromCodePoint(sX(h)?vmt(h):h)}}_stateAfterDoctypeName(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(U2.PUBLIC,!1)?this.state=He.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(U2.SYSTEM,!1)?this.state=He.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Fr.invalidCharacterSequenceAfterDoctypeName),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h))}}_stateAfterDoctypePublicKeyword(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case xe.QUOTATION_MARK:{this._err(Fr.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this._err(Fr.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBeforeDoctypePublicIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.QUOTATION_MARK:{b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateDoctypePublicIdentifierDoubleQuoted(h){const b=this.currentToken;switch(h){case xe.QUOTATION_MARK:{this.state=He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.publicId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.publicId+=String.fromCodePoint(h)}}_stateDoctypePublicIdentifierSingleQuoted(h){const b=this.currentToken;switch(h){case xe.APOSTROPHE:{this.state=He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.publicId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.publicId+=String.fromCodePoint(h)}}_stateAfterDoctypePublicIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.QUOTATION_MARK:{this._err(Fr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this._err(Fr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBetweenDoctypePublicAndSystemIdentifiers(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.GREATER_THAN_SIGN:{this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.QUOTATION_MARK:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateAfterDoctypeSystemKeyword(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case xe.QUOTATION_MARK:{this._err(Fr.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this._err(Fr.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBeforeDoctypeSystemIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.QUOTATION_MARK:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateDoctypeSystemIdentifierDoubleQuoted(h){const b=this.currentToken;switch(h){case xe.QUOTATION_MARK:{this.state=He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.systemId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.systemId+=String.fromCodePoint(h)}}_stateDoctypeSystemIdentifierSingleQuoted(h){const b=this.currentToken;switch(h){case xe.APOSTROPHE:{this.state=He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.systemId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.systemId+=String.fromCodePoint(h)}}_stateAfterDoctypeSystemIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.GREATER_THAN_SIGN:{this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBogusDoctype(h){const b=this.currentToken;switch(h){case xe.GREATER_THAN_SIGN:{this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter);break}case xe.EOF:{this.emitCurrentDoctype(b),this._emitEOFToken();break}}}_stateCdataSection(h){switch(h){case xe.RIGHT_SQUARE_BRACKET:{this.state=He.CDATA_SECTION_BRACKET;break}case xe.EOF:{this._err(Fr.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateCdataSectionBracket(h){h===xe.RIGHT_SQUARE_BRACKET?this.state=He.CDATA_SECTION_END:(this._emitChars("]"),this.state=He.CDATA_SECTION,this._stateCdataSection(h))}_stateCdataSectionEnd(h){switch(h){case xe.GREATER_THAN_SIGN:{this.state=He.DATA;break}case xe.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=He.CDATA_SECTION,this._stateCdataSection(h)}}_stateCharacterReference(){let h=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(h<0)if(this.preprocessor.lastChunkWritten)h=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}h===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(xe.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&SAe(this.preprocessor.peek(1))?He.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(h){SAe(h)?this._flushCodePointConsumedAsCharacterReference(h):(h===xe.SEMICOLON&&this._err(Fr.unknownNamedCharacterReference),this.state=this.returnState,this._callState(h))}}const dNe=new Set([dt.DD,dt.DT,dt.LI,dt.OPTGROUP,dt.OPTION,dt.P,dt.RB,dt.RP,dt.RT,dt.RTC]),CAe=new Set([...dNe,dt.CAPTION,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]),Jmt=new Set([dt.APPLET,dt.CAPTION,dt.HTML,dt.MARQUEE,dt.OBJECT,dt.TABLE,dt.TD,dt.TEMPLATE,dt.TH]),Zzn=new Set([...Jmt,dt.OL,dt.UL]),tUn=new Set([...Jmt,dt.BUTTON]),AAe=new Set([dt.ANNOTATION_XML,dt.MI,dt.MN,dt.MO,dt.MS,dt.MTEXT]),OAe=new Set([dt.DESC,dt.FOREIGN_OBJECT,dt.TITLE]),eUn=new Set([dt.TR,dt.TEMPLATE,dt.HTML]),nUn=new Set([dt.TBODY,dt.TFOOT,dt.THEAD,dt.TEMPLATE,dt.HTML]),rUn=new Set([dt.TABLE,dt.TEMPLATE,dt.HTML]),iUn=new Set([dt.TD,dt.TH]);class aUn{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(h,b,k){this.treeAdapter=b,this.handler=k,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=dt.UNKNOWN,this.current=h}_indexOf(h){return this.items.lastIndexOf(h,this.stackTop)}_isInTemplate(){return this.currentTagId===dt.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Bi.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(h,b){this.stackTop++,this.items[this.stackTop]=h,this.current=h,this.tagIDs[this.stackTop]=b,this.currentTagId=b,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(h,b,!0)}pop(){const h=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(h,!0)}replace(h,b){const k=this._indexOf(h);this.items[k]=b,k===this.stackTop&&(this.current=b)}insertAfter(h,b,k){const O=this._indexOf(h)+1;this.items.splice(O,0,b),this.tagIDs.splice(O,0,k),this.stackTop++,O===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,O===this.stackTop)}popUntilTagNamePopped(h){let b=this.stackTop+1;do b=this.tagIDs.lastIndexOf(h,b-1);while(b>0&&this.treeAdapter.getNamespaceURI(this.items[b])!==Bi.HTML);this.shortenToLength(b<0?0:b)}shortenToLength(h){for(;this.stackTop>=h;){const b=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(b,this.stackTop<h)}}popUntilElementPopped(h){const b=this._indexOf(h);this.shortenToLength(b<0?0:b)}popUntilPopped(h,b){const k=this._indexOfTagNames(h,b);this.shortenToLength(k<0?0:k)}popUntilNumberedHeaderPopped(){this.popUntilPopped(FBt,Bi.HTML)}popUntilTableCellPopped(){this.popUntilPopped(iUn,Bi.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(h,b){for(let k=this.stackTop;k>=0;k--)if(h.has(this.tagIDs[k])&&this.treeAdapter.getNamespaceURI(this.items[k])===b)return k;return-1}clearBackTo(h,b){const k=this._indexOfTagNames(h,b);this.shortenToLength(k+1)}clearBackToTableContext(){this.clearBackTo(rUn,Bi.HTML)}clearBackToTableBodyContext(){this.clearBackTo(nUn,Bi.HTML)}clearBackToTableRowContext(){this.clearBackTo(eUn,Bi.HTML)}remove(h){const b=this._indexOf(h);b>=0&&(b===this.stackTop?this.pop():(this.items.splice(b,1),this.tagIDs.splice(b,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(h,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===dt.BODY?this.items[1]:null}contains(h){return this._indexOf(h)>-1}getCommonAncestor(h){const b=this._indexOf(h)-1;return b>=0?this.items[b]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===dt.HTML}hasInDynamicScope(h,b){for(let k=this.stackTop;k>=0;k--){const O=this.tagIDs[k];switch(this.treeAdapter.getNamespaceURI(this.items[k])){case Bi.HTML:{if(O===h)return!0;if(b.has(O))return!1;break}case Bi.SVG:{if(OAe.has(O))return!1;break}case Bi.MATHML:{if(AAe.has(O))return!1;break}}}return!0}hasInScope(h){return this.hasInDynamicScope(h,Jmt)}hasInListItemScope(h){return this.hasInDynamicScope(h,Zzn)}hasInButtonScope(h){return this.hasInDynamicScope(h,tUn)}hasNumberedHeaderInScope(){for(let h=this.stackTop;h>=0;h--){const b=this.tagIDs[h];switch(this.treeAdapter.getNamespaceURI(this.items[h])){case Bi.HTML:{if(FBt.has(b))return!0;if(Jmt.has(b))return!1;break}case Bi.SVG:{if(OAe.has(b))return!1;break}case Bi.MATHML:{if(AAe.has(b))return!1;break}}}return!0}hasInTableScope(h){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===Bi.HTML)switch(this.tagIDs[b]){case h:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let h=this.stackTop;h>=0;h--)if(this.treeAdapter.getNamespaceURI(this.items[h])===Bi.HTML)switch(this.tagIDs[h]){case dt.TBODY:case dt.THEAD:case dt.TFOOT:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasInSelectScope(h){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===Bi.HTML)switch(this.tagIDs[b]){case h:return!0;case dt.OPTION:case dt.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;dNe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;CAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(h){for(;this.currentTagId!==h&&CAe.has(this.currentTagId);)this.pop()}}const IRt=3;var l6;(function(o){o[o.Marker=0]="Marker",o[o.Element=1]="Element"})(l6||(l6={}));const NAe={type:l6.Marker};class oUn{constructor(h){this.treeAdapter=h,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(h,b){const k=[],O=b.length,P=this.treeAdapter.getTagName(h),B=this.treeAdapter.getNamespaceURI(h);for(let G=0;G<this.entries.length;G++){const J=this.entries[G];if(J.type===l6.Marker)break;const{element:U}=J;if(this.treeAdapter.getTagName(U)===P&&this.treeAdapter.getNamespaceURI(U)===B){const nt=this.treeAdapter.getAttrList(U);nt.length===O&&k.push({idx:G,attrs:nt})}}return k}_ensureNoahArkCondition(h){if(this.entries.length<IRt)return;const b=this.treeAdapter.getAttrList(h),k=this._getNoahArkConditionCandidates(h,b);if(k.length<IRt)return;const O=new Map(b.map(B=>[B.name,B.value]));let P=0;for(let B=0;B<k.length;B++){const G=k[B];G.attrs.every(J=>O.get(J.name)===J.value)&&(P+=1,P>=IRt&&this.entries.splice(G.idx,1))}}insertMarker(){this.entries.unshift(NAe)}pushElement(h,b){this._ensureNoahArkCondition(h),this.entries.unshift({type:l6.Element,element:h,token:b})}insertElementAfterBookmark(h,b){const k=this.entries.indexOf(this.bookmark);this.entries.splice(k,0,{type:l6.Element,element:h,token:b})}removeEntry(h){const b=this.entries.indexOf(h);b>=0&&this.entries.splice(b,1)}clearToLastMarker(){const h=this.entries.indexOf(NAe);h>=0?this.entries.splice(0,h+1):this.entries.length=0}getElementEntryInScopeWithTagName(h){const b=this.entries.find(k=>k.type===l6.Marker||this.treeAdapter.getTagName(k.element)===h);return b&&b.type===l6.Element?b:null}getElementEntry(h){return this.entries.find(b=>b.type===l6.Element&&b.element===h)}}const G8={createDocument(){return{nodeName:"#document",mode:w3.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(o,h,b){return{nodeName:o,tagName:o,attrs:b,namespaceURI:h,childNodes:[],parentNode:null}},createCommentNode(o){return{nodeName:"#comment",data:o,parentNode:null}},createTextNode(o){return{nodeName:"#text",value:o,parentNode:null}},appendChild(o,h){o.childNodes.push(h),h.parentNode=o},insertBefore(o,h,b){const k=o.childNodes.indexOf(b);o.childNodes.splice(k,0,h),h.parentNode=o},setTemplateContent(o,h){o.content=h},getTemplateContent(o){return o.content},setDocumentType(o,h,b,k){const O=o.childNodes.find(P=>P.nodeName==="#documentType");if(O)O.name=h,O.publicId=b,O.systemId=k;else{const P={nodeName:"#documentType",name:h,publicId:b,systemId:k,parentNode:null};G8.appendChild(o,P)}},setDocumentMode(o,h){o.mode=h},getDocumentMode(o){return o.mode},detachNode(o){if(o.parentNode){const h=o.parentNode.childNodes.indexOf(o);o.parentNode.childNodes.splice(h,1),o.parentNode=null}},insertText(o,h){if(o.childNodes.length>0){const b=o.childNodes[o.childNodes.length-1];if(G8.isTextNode(b)){b.value+=h;return}}G8.appendChild(o,G8.createTextNode(h))},insertTextBefore(o,h,b){const k=o.childNodes[o.childNodes.indexOf(b)-1];k&&G8.isTextNode(k)?k.value+=h:G8.insertBefore(o,G8.createTextNode(h),b)},adoptAttributes(o,h){const b=new Set(o.attrs.map(k=>k.name));for(let k=0;k<h.length;k++)b.has(h[k].name)||o.attrs.push(h[k])},getFirstChild(o){return o.childNodes[0]},getChildNodes(o){return o.childNodes},getParentNode(o){return o.parentNode},getAttrList(o){return o.attrs},getTagName(o){return o.tagName},getNamespaceURI(o){return o.namespaceURI},getTextNodeContent(o){return o.value},getCommentNodeContent(o){return o.data},getDocumentTypeNodeName(o){return o.name},getDocumentTypeNodePublicId(o){return o.publicId},getDocumentTypeNodeSystemId(o){return o.systemId},isTextNode(o){return o.nodeName==="#text"},isCommentNode(o){return o.nodeName==="#comment"},isDocumentTypeNode(o){return o.nodeName==="#documentType"},isElementNode(o){return Object.prototype.hasOwnProperty.call(o,"tagName")},setNodeSourceCodeLocation(o,h){o.sourceCodeLocation=h},getNodeSourceCodeLocation(o){return o.sourceCodeLocation},updateNodeSourceCodeLocation(o,h){o.sourceCodeLocation={...o.sourceCodeLocation,...h}}},pNe="html",sUn="about:legacy-compat",cUn="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",gNe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],uUn=[...gNe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],lUn=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),mNe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],hUn=[...mNe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function PAe(o,h){return h.some(b=>o.startsWith(b))}function fUn(o){return o.name===pNe&&o.publicId===null&&(o.systemId===null||o.systemId===sUn)}function dUn(o){if(o.name!==pNe)return w3.QUIRKS;const{systemId:h}=o;if(h&&h.toLowerCase()===cUn)return w3.QUIRKS;let{publicId:b}=o;if(b!==null){if(b=b.toLowerCase(),lUn.has(b))return w3.QUIRKS;let k=h===null?uUn:gNe;if(PAe(b,k))return w3.QUIRKS;if(k=h===null?mNe:hUn,PAe(b,k))return w3.LIMITED_QUIRKS}return w3.NO_QUIRKS}const LAe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},pUn="definitionurl",gUn="definitionURL",mUn=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(o=>[o.toLowerCase(),o])),bUn=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Bi.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Bi.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Bi.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Bi.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Bi.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Bi.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Bi.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Bi.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Bi.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Bi.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Bi.XMLNS}]]),yUn=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(o=>[o.toLowerCase(),o])),wUn=new Set([dt.B,dt.BIG,dt.BLOCKQUOTE,dt.BODY,dt.BR,dt.CENTER,dt.CODE,dt.DD,dt.DIV,dt.DL,dt.DT,dt.EM,dt.EMBED,dt.H1,dt.H2,dt.H3,dt.H4,dt.H5,dt.H6,dt.HEAD,dt.HR,dt.I,dt.IMG,dt.LI,dt.LISTING,dt.MENU,dt.META,dt.NOBR,dt.OL,dt.P,dt.PRE,dt.RUBY,dt.S,dt.SMALL,dt.SPAN,dt.STRONG,dt.STRIKE,dt.SUB,dt.SUP,dt.TABLE,dt.TT,dt.U,dt.UL,dt.VAR]);function vUn(o){const h=o.tagID;return h===dt.FONT&&o.attrs.some(({name:k})=>k===WN.COLOR||k===WN.SIZE||k===WN.FACE)||wUn.has(h)}function bNe(o){for(let h=0;h<o.attrs.length;h++)if(o.attrs[h].name===pUn){o.attrs[h].name=gUn;break}}function yNe(o){for(let h=0;h<o.attrs.length;h++){const b=mUn.get(o.attrs[h].name);b!=null&&(o.attrs[h].name=b)}}function iFt(o){for(let h=0;h<o.attrs.length;h++){const b=bUn.get(o.attrs[h].name);b&&(o.attrs[h].prefix=b.prefix,o.attrs[h].name=b.name,o.attrs[h].namespace=b.namespace)}}function xUn(o){const h=yUn.get(o.tagName);h!=null&&(o.tagName=h,o.tagID=Zj(o.tagName))}function kUn(o,h){return h===Bi.MATHML&&(o===dt.MI||o===dt.MO||o===dt.MN||o===dt.MS||o===dt.MTEXT)}function _Un(o,h,b){if(h===Bi.MATHML&&o===dt.ANNOTATION_XML){for(let k=0;k<b.length;k++)if(b[k].name===WN.ENCODING){const O=b[k].value.toLowerCase();return O===LAe.TEXT_HTML||O===LAe.APPLICATION_XML}}return h===Bi.SVG&&(o===dt.FOREIGN_OBJECT||o===dt.DESC||o===dt.TITLE)}function EUn(o,h,b,k){return(!k||k===Bi.HTML)&&_Un(o,h,b)||(!k||k===Bi.MATHML)&&kUn(o,h)}const TUn="hidden",SUn=8,IUn=3;var Ze;(function(o){o[o.INITIAL=0]="INITIAL",o[o.BEFORE_HTML=1]="BEFORE_HTML",o[o.BEFORE_HEAD=2]="BEFORE_HEAD",o[o.IN_HEAD=3]="IN_HEAD",o[o.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",o[o.AFTER_HEAD=5]="AFTER_HEAD",o[o.IN_BODY=6]="IN_BODY",o[o.TEXT=7]="TEXT",o[o.IN_TABLE=8]="IN_TABLE",o[o.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",o[o.IN_CAPTION=10]="IN_CAPTION",o[o.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",o[o.IN_TABLE_BODY=12]="IN_TABLE_BODY",o[o.IN_ROW=13]="IN_ROW",o[o.IN_CELL=14]="IN_CELL",o[o.IN_SELECT=15]="IN_SELECT",o[o.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",o[o.IN_TEMPLATE=17]="IN_TEMPLATE",o[o.AFTER_BODY=18]="AFTER_BODY",o[o.IN_FRAMESET=19]="IN_FRAMESET",o[o.AFTER_FRAMESET=20]="AFTER_FRAMESET",o[o.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",o[o.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Ze||(Ze={}));const CUn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},wNe=new Set([dt.TABLE,dt.TBODY,dt.TFOOT,dt.THEAD,dt.TR]),MAe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:G8,onParseError:null};class DAe{constructor(h,b,k=null,O=null){this.fragmentContext=k,this.scriptHandler=O,this.currentToken=null,this.stopped=!1,this.insertionMode=Ze.INITIAL,this.originalInsertionMode=Ze.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...MAe,...h},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=b??this.treeAdapter.createDocument(),this.tokenizer=new Qzn(this.options,this),this.activeFormattingElements=new oUn(this.treeAdapter),this.fragmentContextID=k?Zj(this.treeAdapter.getTagName(k)):dt.UNKNOWN,this._setContextModes(k??this.document,this.fragmentContextID),this.openElements=new aUn(this.document,this.treeAdapter,this)}static parse(h,b){const k=new this(b);return k.tokenizer.write(h,!0),k.document}static getFragmentParser(h,b){const k={...MAe,...b};h??(h=k.treeAdapter.createElement(ur.TEMPLATE,Bi.HTML,[]));const O=k.treeAdapter.createElement("documentmock",Bi.HTML,[]),P=new this(k,O,h);return P.fragmentContextID===dt.TEMPLATE&&P.tmplInsertionModeStack.unshift(Ze.IN_TEMPLATE),P._initTokenizerForFragmentParsing(),P._insertFakeRootElement(),P._resetInsertionMode(),P._findFormInFragmentContext(),P}getFragment(){const h=this.treeAdapter.getFirstChild(this.document),b=this.treeAdapter.createDocumentFragment();return this._adoptNodes(h,b),b}_err(h,b,k){var O;if(!this.onParseError)return;const P=(O=h.location)!==null&&O!==void 0?O:CUn,B={code:b,startLine:P.startLine,startCol:P.startCol,startOffset:P.startOffset,endLine:k?P.startLine:P.endLine,endCol:k?P.startCol:P.endCol,endOffset:k?P.startOffset:P.endOffset};this.onParseError(B)}onItemPush(h,b,k){var O,P;(P=(O=this.treeAdapter).onItemPush)===null||P===void 0||P.call(O,h),k&&this.openElements.stackTop>0&&this._setContextModes(h,b)}onItemPop(h,b){var k,O;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(h,this.currentToken),(O=(k=this.treeAdapter).onItemPop)===null||O===void 0||O.call(k,h,this.openElements.current),b){let P,B;this.openElements.stackTop===0&&this.fragmentContext?(P=this.fragmentContext,B=this.fragmentContextID):{current:P,currentTagId:B}=this.openElements,this._setContextModes(P,B)}}_setContextModes(h,b){const k=h===this.document||this.treeAdapter.getNamespaceURI(h)===Bi.HTML;this.currentNotInHTML=!k,this.tokenizer.inForeignNode=!k&&!this._isIntegrationPoint(b,h)}_switchToTextParsing(h,b){this._insertElement(h,Bi.HTML),this.tokenizer.state=b,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ze.TEXT}switchToPlaintextParsing(){this.insertionMode=Ze.TEXT,this.originalInsertionMode=Ze.IN_BODY,this.tokenizer.state=C1.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let h=this.fragmentContext;for(;h;){if(this.treeAdapter.getTagName(h)===ur.FORM){this.formElement=h;break}h=this.treeAdapter.getParentNode(h)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Bi.HTML))switch(this.fragmentContextID){case dt.TITLE:case dt.TEXTAREA:{this.tokenizer.state=C1.RCDATA;break}case dt.STYLE:case dt.XMP:case dt.IFRAME:case dt.NOEMBED:case dt.NOFRAMES:case dt.NOSCRIPT:{this.tokenizer.state=C1.RAWTEXT;break}case dt.SCRIPT:{this.tokenizer.state=C1.SCRIPT_DATA;break}case dt.PLAINTEXT:{this.tokenizer.state=C1.PLAINTEXT;break}}}_setDocumentType(h){const b=h.name||"",k=h.publicId||"",O=h.systemId||"";if(this.treeAdapter.setDocumentType(this.document,b,k,O),h.location){const B=this.treeAdapter.getChildNodes(this.document).find(G=>this.treeAdapter.isDocumentTypeNode(G));B&&this.treeAdapter.setNodeSourceCodeLocation(B,h.location)}}_attachElementToTree(h,b){if(this.options.sourceCodeLocationInfo){const k=b&&{...b,startTag:b};this.treeAdapter.setNodeSourceCodeLocation(h,k)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(h);else{const k=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(k,h)}}_appendElement(h,b){const k=this.treeAdapter.createElement(h.tagName,b,h.attrs);this._attachElementToTree(k,h.location)}_insertElement(h,b){const k=this.treeAdapter.createElement(h.tagName,b,h.attrs);this._attachElementToTree(k,h.location),this.openElements.push(k,h.tagID)}_insertFakeElement(h,b){const k=this.treeAdapter.createElement(h,Bi.HTML,[]);this._attachElementToTree(k,null),this.openElements.push(k,b)}_insertTemplate(h){const b=this.treeAdapter.createElement(h.tagName,Bi.HTML,h.attrs),k=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(b,k),this._attachElementToTree(b,h.location),this.openElements.push(b,h.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(k,null)}_insertFakeRootElement(){const h=this.treeAdapter.createElement(ur.HTML,Bi.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(h,null),this.treeAdapter.appendChild(this.openElements.current,h),this.openElements.push(h,dt.HTML)}_appendCommentNode(h,b){const k=this.treeAdapter.createCommentNode(h.data);this.treeAdapter.appendChild(b,k),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(k,h.location)}_insertCharacters(h){let b,k;if(this._shouldFosterParentOnInsertion()?({parent:b,beforeElement:k}=this._findFosterParentingLocation(),k?this.treeAdapter.insertTextBefore(b,h.chars,k):this.treeAdapter.insertText(b,h.chars)):(b=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(b,h.chars)),!h.location)return;const O=this.treeAdapter.getChildNodes(b),P=k?O.lastIndexOf(k):O.length,B=O[P-1];if(this.treeAdapter.getNodeSourceCodeLocation(B)){const{endLine:J,endCol:U,endOffset:nt}=h.location;this.treeAdapter.updateNodeSourceCodeLocation(B,{endLine:J,endCol:U,endOffset:nt})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(B,h.location)}_adoptNodes(h,b){for(let k=this.treeAdapter.getFirstChild(h);k;k=this.treeAdapter.getFirstChild(h))this.treeAdapter.detachNode(k),this.treeAdapter.appendChild(b,k)}_setEndLocation(h,b){if(this.treeAdapter.getNodeSourceCodeLocation(h)&&b.location){const k=b.location,O=this.treeAdapter.getTagName(h),P=b.type===vu.END_TAG&&O===b.tagName?{endTag:{...k},endLine:k.endLine,endCol:k.endCol,endOffset:k.endOffset}:{endLine:k.startLine,endCol:k.startCol,endOffset:k.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(h,P)}}shouldProcessStartTagTokenInForeignContent(h){if(!this.currentNotInHTML)return!1;let b,k;return this.openElements.stackTop===0&&this.fragmentContext?(b=this.fragmentContext,k=this.fragmentContextID):{current:b,currentTagId:k}=this.openElements,h.tagID===dt.SVG&&this.treeAdapter.getTagName(b)===ur.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(b)===Bi.MATHML?!1:this.tokenizer.inForeignNode||(h.tagID===dt.MGLYPH||h.tagID===dt.MALIGNMARK)&&!this._isIntegrationPoint(k,b,Bi.HTML)}_processToken(h){switch(h.type){case vu.CHARACTER:{this.onCharacter(h);break}case vu.NULL_CHARACTER:{this.onNullCharacter(h);break}case vu.COMMENT:{this.onComment(h);break}case vu.DOCTYPE:{this.onDoctype(h);break}case vu.START_TAG:{this._processStartTag(h);break}case vu.END_TAG:{this.onEndTag(h);break}case vu.EOF:{this.onEof(h);break}case vu.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(h);break}}}_isIntegrationPoint(h,b,k){const O=this.treeAdapter.getNamespaceURI(b),P=this.treeAdapter.getAttrList(b);return EUn(h,O,P,k)}_reconstructActiveFormattingElements(){const h=this.activeFormattingElements.entries.length;if(h){const b=this.activeFormattingElements.entries.findIndex(O=>O.type===l6.Marker||this.openElements.contains(O.element)),k=b<0?h-1:b-1;for(let O=k;O>=0;O--){const P=this.activeFormattingElements.entries[O];this._insertElement(P.token,this.treeAdapter.getNamespaceURI(P.element)),P.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ze.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(dt.P),this.openElements.popUntilTagNamePopped(dt.P)}_resetInsertionMode(){for(let h=this.openElements.stackTop;h>=0;h--)switch(h===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[h]){case dt.TR:{this.insertionMode=Ze.IN_ROW;return}case dt.TBODY:case dt.THEAD:case dt.TFOOT:{this.insertionMode=Ze.IN_TABLE_BODY;return}case dt.CAPTION:{this.insertionMode=Ze.IN_CAPTION;return}case dt.COLGROUP:{this.insertionMode=Ze.IN_COLUMN_GROUP;return}case dt.TABLE:{this.insertionMode=Ze.IN_TABLE;return}case dt.BODY:{this.insertionMode=Ze.IN_BODY;return}case dt.FRAMESET:{this.insertionMode=Ze.IN_FRAMESET;return}case dt.SELECT:{this._resetInsertionModeForSelect(h);return}case dt.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case dt.HTML:{this.insertionMode=this.headElement?Ze.AFTER_HEAD:Ze.BEFORE_HEAD;return}case dt.TD:case dt.TH:{if(h>0){this.insertionMode=Ze.IN_CELL;return}break}case dt.HEAD:{if(h>0){this.insertionMode=Ze.IN_HEAD;return}break}}this.insertionMode=Ze.IN_BODY}_resetInsertionModeForSelect(h){if(h>0)for(let b=h-1;b>0;b--){const k=this.openElements.tagIDs[b];if(k===dt.TEMPLATE)break;if(k===dt.TABLE){this.insertionMode=Ze.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ze.IN_SELECT}_isElementCausesFosterParenting(h){return wNe.has(h)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let h=this.openElements.stackTop;h>=0;h--){const b=this.openElements.items[h];switch(this.openElements.tagIDs[h]){case dt.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(b)===Bi.HTML)return{parent:this.treeAdapter.getTemplateContent(b),beforeElement:null};break}case dt.TABLE:{const k=this.treeAdapter.getParentNode(b);return k?{parent:k,beforeElement:b}:{parent:this.openElements.items[h-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(h){const b=this._findFosterParentingLocation();b.beforeElement?this.treeAdapter.insertBefore(b.parent,h,b.beforeElement):this.treeAdapter.appendChild(b.parent,h)}_isSpecialElement(h,b){const k=this.treeAdapter.getNamespaceURI(h);return Vzn[k].has(b)}onCharacter(h){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){iqn(this,h);return}switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{mX(this,h);break}case Ze.BEFORE_HEAD:{bX(this,h);break}case Ze.IN_HEAD:{yX(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{wX(this,h);break}case Ze.AFTER_HEAD:{vX(this,h);break}case Ze.IN_BODY:case Ze.IN_CAPTION:case Ze.IN_CELL:case Ze.IN_TEMPLATE:{xNe(this,h);break}case Ze.TEXT:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:{this._insertCharacters(h);break}case Ze.IN_TABLE:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:{CRt(this,h);break}case Ze.IN_TABLE_TEXT:{INe(this,h);break}case Ze.IN_COLUMN_GROUP:{Xmt(this,h);break}case Ze.AFTER_BODY:{Qmt(this,h);break}case Ze.AFTER_AFTER_BODY:{Dmt(this,h);break}}}onNullCharacter(h){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){rqn(this,h);return}switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{mX(this,h);break}case Ze.BEFORE_HEAD:{bX(this,h);break}case Ze.IN_HEAD:{yX(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{wX(this,h);break}case Ze.AFTER_HEAD:{vX(this,h);break}case Ze.TEXT:{this._insertCharacters(h);break}case Ze.IN_TABLE:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:{CRt(this,h);break}case Ze.IN_COLUMN_GROUP:{Xmt(this,h);break}case Ze.AFTER_BODY:{Qmt(this,h);break}case Ze.AFTER_AFTER_BODY:{Dmt(this,h);break}}}onComment(h){if(this.skipNextNewLine=!1,this.currentNotInHTML){$Bt(this,h);return}switch(this.insertionMode){case Ze.INITIAL:case Ze.BEFORE_HTML:case Ze.BEFORE_HEAD:case Ze.IN_HEAD:case Ze.IN_HEAD_NO_SCRIPT:case Ze.AFTER_HEAD:case Ze.IN_BODY:case Ze.IN_TABLE:case Ze.IN_CAPTION:case Ze.IN_COLUMN_GROUP:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:case Ze.IN_CELL:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:case Ze.IN_TEMPLATE:case Ze.IN_FRAMESET:case Ze.AFTER_FRAMESET:{$Bt(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.AFTER_BODY:{DUn(this,h);break}case Ze.AFTER_AFTER_BODY:case Ze.AFTER_AFTER_FRAMESET:{RUn(this,h);break}}}onDoctype(h){switch(this.skipNextNewLine=!1,this.insertionMode){case Ze.INITIAL:{BUn(this,h);break}case Ze.BEFORE_HEAD:case Ze.IN_HEAD:case Ze.IN_HEAD_NO_SCRIPT:case Ze.AFTER_HEAD:{this._err(h,Fr.misplacedDoctype);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}}}onStartTag(h){this.skipNextNewLine=!1,this.currentToken=h,this._processStartTag(h),h.selfClosing&&!h.ackSelfClosing&&this._err(h,Fr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(h){this.shouldProcessStartTagTokenInForeignContent(h)?aqn(this,h):this._startTagOutsideForeignContent(h)}_startTagOutsideForeignContent(h){switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{jUn(this,h);break}case Ze.BEFORE_HEAD:{$Un(this,h);break}case Ze.IN_HEAD:{V5(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{UUn(this,h);break}case Ze.AFTER_HEAD:{qUn(this,h);break}case Ze.IN_BODY:{vm(this,h);break}case Ze.IN_TABLE:{Hj(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.IN_CAPTION:{HGn(this,h);break}case Ze.IN_COLUMN_GROUP:{sFt(this,h);break}case Ze.IN_TABLE_BODY:{Obt(this,h);break}case Ze.IN_ROW:{Nbt(this,h);break}case Ze.IN_CELL:{GGn(this,h);break}case Ze.IN_SELECT:{ONe(this,h);break}case Ze.IN_SELECT_IN_TABLE:{WGn(this,h);break}case Ze.IN_TEMPLATE:{VGn(this,h);break}case Ze.AFTER_BODY:{JGn(this,h);break}case Ze.IN_FRAMESET:{XGn(this,h);break}case Ze.AFTER_FRAMESET:{ZGn(this,h);break}case Ze.AFTER_AFTER_BODY:{eqn(this,h);break}case Ze.AFTER_AFTER_FRAMESET:{nqn(this,h);break}}}onEndTag(h){this.skipNextNewLine=!1,this.currentToken=h,this.currentNotInHTML?oqn(this,h):this._endTagOutsideForeignContent(h)}_endTagOutsideForeignContent(h){switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{FUn(this,h);break}case Ze.BEFORE_HEAD:{HUn(this,h);break}case Ze.IN_HEAD:{zUn(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{GUn(this,h);break}case Ze.AFTER_HEAD:{WUn(this,h);break}case Ze.IN_BODY:{Abt(this,h);break}case Ze.TEXT:{NGn(this,h);break}case Ze.IN_TABLE:{AX(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.IN_CAPTION:{zGn(this,h);break}case Ze.IN_COLUMN_GROUP:{UGn(this,h);break}case Ze.IN_TABLE_BODY:{HBt(this,h);break}case Ze.IN_ROW:{ANe(this,h);break}case Ze.IN_CELL:{qGn(this,h);break}case Ze.IN_SELECT:{NNe(this,h);break}case Ze.IN_SELECT_IN_TABLE:{KGn(this,h);break}case Ze.IN_TEMPLATE:{YGn(this,h);break}case Ze.AFTER_BODY:{LNe(this,h);break}case Ze.IN_FRAMESET:{QGn(this,h);break}case Ze.AFTER_FRAMESET:{tqn(this,h);break}case Ze.AFTER_AFTER_BODY:{Dmt(this,h);break}}}onEof(h){switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{mX(this,h);break}case Ze.BEFORE_HEAD:{bX(this,h);break}case Ze.IN_HEAD:{yX(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{wX(this,h);break}case Ze.AFTER_HEAD:{vX(this,h);break}case Ze.IN_BODY:case Ze.IN_TABLE:case Ze.IN_CAPTION:case Ze.IN_COLUMN_GROUP:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:case Ze.IN_CELL:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:{TNe(this,h);break}case Ze.TEXT:{PGn(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.IN_TEMPLATE:{PNe(this,h);break}case Ze.AFTER_BODY:case Ze.IN_FRAMESET:case Ze.AFTER_FRAMESET:case Ze.AFTER_AFTER_BODY:case Ze.AFTER_AFTER_FRAMESET:{oFt(this,h);break}}}onWhitespaceCharacter(h){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,h.chars.charCodeAt(0)===xe.LINE_FEED)){if(h.chars.length===1)return;h.chars=h.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(h);return}switch(this.insertionMode){case Ze.IN_HEAD:case Ze.IN_HEAD_NO_SCRIPT:case Ze.AFTER_HEAD:case Ze.TEXT:case Ze.IN_COLUMN_GROUP:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:case Ze.IN_FRAMESET:case Ze.AFTER_FRAMESET:{this._insertCharacters(h);break}case Ze.IN_BODY:case Ze.IN_CAPTION:case Ze.IN_CELL:case Ze.IN_TEMPLATE:case Ze.AFTER_BODY:case Ze.AFTER_AFTER_BODY:case Ze.AFTER_AFTER_FRAMESET:{vNe(this,h);break}case Ze.IN_TABLE:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:{CRt(this,h);break}case Ze.IN_TABLE_TEXT:{SNe(this,h);break}}}}function AUn(o,h){let b=o.activeFormattingElements.getElementEntryInScopeWithTagName(h.tagName);return b?o.openElements.contains(b.element)?o.openElements.hasInScope(h.tagID)||(b=null):(o.activeFormattingElements.removeEntry(b),b=null):ENe(o,h),b}function OUn(o,h){let b=null,k=o.openElements.stackTop;for(;k>=0;k--){const O=o.openElements.items[k];if(O===h.element)break;o._isSpecialElement(O,o.openElements.tagIDs[k])&&(b=O)}return b||(o.openElements.shortenToLength(k<0?0:k),o.activeFormattingElements.removeEntry(h)),b}function NUn(o,h,b){let k=h,O=o.openElements.getCommonAncestor(h);for(let P=0,B=O;B!==b;P++,B=O){O=o.openElements.getCommonAncestor(B);const G=o.activeFormattingElements.getElementEntry(B),J=G&&P>=IUn;!G||J?(J&&o.activeFormattingElements.removeEntry(G),o.openElements.remove(B)):(B=PUn(o,G),k===h&&(o.activeFormattingElements.bookmark=G),o.treeAdapter.detachNode(k),o.treeAdapter.appendChild(B,k),k=B)}return k}function PUn(o,h){const b=o.treeAdapter.getNamespaceURI(h.element),k=o.treeAdapter.createElement(h.token.tagName,b,h.token.attrs);return o.openElements.replace(h.element,k),h.element=k,k}function LUn(o,h,b){const k=o.treeAdapter.getTagName(h),O=Zj(k);if(o._isElementCausesFosterParenting(O))o._fosterParentElement(b);else{const P=o.treeAdapter.getNamespaceURI(h);O===dt.TEMPLATE&&P===Bi.HTML&&(h=o.treeAdapter.getTemplateContent(h)),o.treeAdapter.appendChild(h,b)}}function MUn(o,h,b){const k=o.treeAdapter.getNamespaceURI(b.element),{token:O}=b,P=o.treeAdapter.createElement(O.tagName,k,O.attrs);o._adoptNodes(h,P),o.treeAdapter.appendChild(h,P),o.activeFormattingElements.insertElementAfterBookmark(P,O),o.activeFormattingElements.removeEntry(b),o.openElements.remove(b.element),o.openElements.insertAfter(h,P,O.tagID)}function aFt(o,h){for(let b=0;b<SUn;b++){const k=AUn(o,h);if(!k)break;const O=OUn(o,k);if(!O)break;o.activeFormattingElements.bookmark=k;const P=NUn(o,O,k.element),B=o.openElements.getCommonAncestor(k.element);o.treeAdapter.detachNode(P),B&&LUn(o,B,P),MUn(o,O,k)}}function $Bt(o,h){o._appendCommentNode(h,o.openElements.currentTmplContentOrNode)}function DUn(o,h){o._appendCommentNode(h,o.openElements.items[0])}function RUn(o,h){o._appendCommentNode(h,o.document)}function oFt(o,h){if(o.stopped=!0,h.location){const b=o.fragmentContext?0:2;for(let k=o.openElements.stackTop;k>=b;k--)o._setEndLocation(o.openElements.items[k],h);if(!o.fragmentContext&&o.openElements.stackTop>=0){const k=o.openElements.items[0],O=o.treeAdapter.getNodeSourceCodeLocation(k);if(O&&!O.endTag&&(o._setEndLocation(k,h),o.openElements.stackTop>=1)){const P=o.openElements.items[1],B=o.treeAdapter.getNodeSourceCodeLocation(P);B&&!B.endTag&&o._setEndLocation(P,h)}}}}function BUn(o,h){o._setDocumentType(h);const b=h.forceQuirks?w3.QUIRKS:dUn(h);fUn(h)||o._err(h,Fr.nonConformingDoctype),o.treeAdapter.setDocumentMode(o.document,b),o.insertionMode=Ze.BEFORE_HTML}function XJ(o,h){o._err(h,Fr.missingDoctype,!0),o.treeAdapter.setDocumentMode(o.document,w3.QUIRKS),o.insertionMode=Ze.BEFORE_HTML,o._processToken(h)}function jUn(o,h){h.tagID===dt.HTML?(o._insertElement(h,Bi.HTML),o.insertionMode=Ze.BEFORE_HEAD):mX(o,h)}function FUn(o,h){const b=h.tagID;(b===dt.HTML||b===dt.HEAD||b===dt.BODY||b===dt.BR)&&mX(o,h)}function mX(o,h){o._insertFakeRootElement(),o.insertionMode=Ze.BEFORE_HEAD,o._processToken(h)}function $Un(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.HEAD:{o._insertElement(h,Bi.HTML),o.headElement=o.openElements.current,o.insertionMode=Ze.IN_HEAD;break}default:bX(o,h)}}function HUn(o,h){const b=h.tagID;b===dt.HEAD||b===dt.BODY||b===dt.HTML||b===dt.BR?bX(o,h):o._err(h,Fr.endTagWithoutMatchingOpenElement)}function bX(o,h){o._insertFakeElement(ur.HEAD,dt.HEAD),o.headElement=o.openElements.current,o.insertionMode=Ze.IN_HEAD,o._processToken(h)}function V5(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:{o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.TITLE:{o._switchToTextParsing(h,C1.RCDATA);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?o._switchToTextParsing(h,C1.RAWTEXT):(o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_HEAD_NO_SCRIPT);break}case dt.NOFRAMES:case dt.STYLE:{o._switchToTextParsing(h,C1.RAWTEXT);break}case dt.SCRIPT:{o._switchToTextParsing(h,C1.SCRIPT_DATA);break}case dt.TEMPLATE:{o._insertTemplate(h),o.activeFormattingElements.insertMarker(),o.framesetOk=!1,o.insertionMode=Ze.IN_TEMPLATE,o.tmplInsertionModeStack.unshift(Ze.IN_TEMPLATE);break}case dt.HEAD:{o._err(h,Fr.misplacedStartTagForHeadElement);break}default:yX(o,h)}}function zUn(o,h){switch(h.tagID){case dt.HEAD:{o.openElements.pop(),o.insertionMode=Ze.AFTER_HEAD;break}case dt.BODY:case dt.BR:case dt.HTML:{yX(o,h);break}case dt.TEMPLATE:{aP(o,h);break}default:o._err(h,Fr.endTagWithoutMatchingOpenElement)}}function aP(o,h){o.openElements.tmplCount>0?(o.openElements.generateImpliedEndTagsThoroughly(),o.openElements.currentTagId!==dt.TEMPLATE&&o._err(h,Fr.closingOfElementWithOpenChildElements),o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode()):o._err(h,Fr.endTagWithoutMatchingOpenElement)}function yX(o,h){o.openElements.pop(),o.insertionMode=Ze.AFTER_HEAD,o._processToken(h)}function UUn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.BASEFONT:case dt.BGSOUND:case dt.HEAD:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.STYLE:{V5(o,h);break}case dt.NOSCRIPT:{o._err(h,Fr.nestedNoscriptInHead);break}default:wX(o,h)}}function GUn(o,h){switch(h.tagID){case dt.NOSCRIPT:{o.openElements.pop(),o.insertionMode=Ze.IN_HEAD;break}case dt.BR:{wX(o,h);break}default:o._err(h,Fr.endTagWithoutMatchingOpenElement)}}function wX(o,h){const b=h.type===vu.EOF?Fr.openElementsLeftAfterEof:Fr.disallowedContentInNoscriptInHead;o._err(h,b),o.openElements.pop(),o.insertionMode=Ze.IN_HEAD,o._processToken(h)}function qUn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.BODY:{o._insertElement(h,Bi.HTML),o.framesetOk=!1,o.insertionMode=Ze.IN_BODY;break}case dt.FRAMESET:{o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_FRAMESET;break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{o._err(h,Fr.abandonedHeadElementChild),o.openElements.push(o.headElement,dt.HEAD),V5(o,h),o.openElements.remove(o.headElement);break}case dt.HEAD:{o._err(h,Fr.misplacedStartTagForHeadElement);break}default:vX(o,h)}}function WUn(o,h){switch(h.tagID){case dt.BODY:case dt.HTML:case dt.BR:{vX(o,h);break}case dt.TEMPLATE:{aP(o,h);break}default:o._err(h,Fr.endTagWithoutMatchingOpenElement)}}function vX(o,h){o._insertFakeElement(ur.BODY,dt.BODY),o.insertionMode=Ze.IN_BODY,Cbt(o,h)}function Cbt(o,h){switch(h.type){case vu.CHARACTER:{xNe(o,h);break}case vu.WHITESPACE_CHARACTER:{vNe(o,h);break}case vu.COMMENT:{$Bt(o,h);break}case vu.START_TAG:{vm(o,h);break}case vu.END_TAG:{Abt(o,h);break}case vu.EOF:{TNe(o,h);break}}}function vNe(o,h){o._reconstructActiveFormattingElements(),o._insertCharacters(h)}function xNe(o,h){o._reconstructActiveFormattingElements(),o._insertCharacters(h),o.framesetOk=!1}function KUn(o,h){o.openElements.tmplCount===0&&o.treeAdapter.adoptAttributes(o.openElements.items[0],h.attrs)}function VUn(o,h){const b=o.openElements.tryPeekProperlyNestedBodyElement();b&&o.openElements.tmplCount===0&&(o.framesetOk=!1,o.treeAdapter.adoptAttributes(b,h.attrs))}function YUn(o,h){const b=o.openElements.tryPeekProperlyNestedBodyElement();o.framesetOk&&b&&(o.treeAdapter.detachNode(b),o.openElements.popAllUpToHtmlElement(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_FRAMESET)}function JUn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML)}function XUn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),FBt.has(o.openElements.currentTagId)&&o.openElements.pop(),o._insertElement(h,Bi.HTML)}function QUn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),o.skipNextNewLine=!0,o.framesetOk=!1}function ZUn(o,h){const b=o.openElements.tmplCount>0;(!o.formElement||b)&&(o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),b||(o.formElement=o.openElements.current))}function tGn(o,h){o.framesetOk=!1;const b=h.tagID;for(let k=o.openElements.stackTop;k>=0;k--){const O=o.openElements.tagIDs[k];if(b===dt.LI&&O===dt.LI||(b===dt.DD||b===dt.DT)&&(O===dt.DD||O===dt.DT)){o.openElements.generateImpliedEndTagsWithExclusion(O),o.openElements.popUntilTagNamePopped(O);break}if(O!==dt.ADDRESS&&O!==dt.DIV&&O!==dt.P&&o._isSpecialElement(o.openElements.items[k],O))break}o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML)}function eGn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),o.tokenizer.state=C1.PLAINTEXT}function nGn(o,h){o.openElements.hasInScope(dt.BUTTON)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.BUTTON)),o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.framesetOk=!1}function rGn(o,h){const b=o.activeFormattingElements.getElementEntryInScopeWithTagName(ur.A);b&&(aFt(o,h),o.openElements.remove(b.element),o.activeFormattingElements.removeEntry(b)),o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,h)}function iGn(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,h)}function aGn(o,h){o._reconstructActiveFormattingElements(),o.openElements.hasInScope(dt.NOBR)&&(aFt(o,h),o._reconstructActiveFormattingElements()),o._insertElement(h,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,h)}function oGn(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.activeFormattingElements.insertMarker(),o.framesetOk=!1}function sGn(o,h){o.treeAdapter.getDocumentMode(o.document)!==w3.QUIRKS&&o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),o.framesetOk=!1,o.insertionMode=Ze.IN_TABLE}function kNe(o,h){o._reconstructActiveFormattingElements(),o._appendElement(h,Bi.HTML),o.framesetOk=!1,h.ackSelfClosing=!0}function _Ne(o){const h=cNe(o,WN.TYPE);return h!=null&&h.toLowerCase()===TUn}function cGn(o,h){o._reconstructActiveFormattingElements(),o._appendElement(h,Bi.HTML),_Ne(h)||(o.framesetOk=!1),h.ackSelfClosing=!0}function uGn(o,h){o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0}function lGn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._appendElement(h,Bi.HTML),o.framesetOk=!1,h.ackSelfClosing=!0}function hGn(o,h){h.tagName=ur.IMG,h.tagID=dt.IMG,kNe(o,h)}function fGn(o,h){o._insertElement(h,Bi.HTML),o.skipNextNewLine=!0,o.tokenizer.state=C1.RCDATA,o.originalInsertionMode=o.insertionMode,o.framesetOk=!1,o.insertionMode=Ze.TEXT}function dGn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._reconstructActiveFormattingElements(),o.framesetOk=!1,o._switchToTextParsing(h,C1.RAWTEXT)}function pGn(o,h){o.framesetOk=!1,o._switchToTextParsing(h,C1.RAWTEXT)}function RAe(o,h){o._switchToTextParsing(h,C1.RAWTEXT)}function gGn(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.framesetOk=!1,o.insertionMode=o.insertionMode===Ze.IN_TABLE||o.insertionMode===Ze.IN_CAPTION||o.insertionMode===Ze.IN_TABLE_BODY||o.insertionMode===Ze.IN_ROW||o.insertionMode===Ze.IN_CELL?Ze.IN_SELECT_IN_TABLE:Ze.IN_SELECT}function mGn(o,h){o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML)}function bGn(o,h){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTags(),o._insertElement(h,Bi.HTML)}function yGn(o,h){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTagsWithExclusion(dt.RTC),o._insertElement(h,Bi.HTML)}function wGn(o,h){o._reconstructActiveFormattingElements(),bNe(h),iFt(h),h.selfClosing?o._appendElement(h,Bi.MATHML):o._insertElement(h,Bi.MATHML),h.ackSelfClosing=!0}function vGn(o,h){o._reconstructActiveFormattingElements(),yNe(h),iFt(h),h.selfClosing?o._appendElement(h,Bi.SVG):o._insertElement(h,Bi.SVG),h.ackSelfClosing=!0}function BAe(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML)}function vm(o,h){switch(h.tagID){case dt.I:case dt.S:case dt.B:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{iGn(o,h);break}case dt.A:{rGn(o,h);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{XUn(o,h);break}case dt.P:case dt.DL:case dt.OL:case dt.UL:case dt.DIV:case dt.DIR:case dt.NAV:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.DETAILS:case dt.ADDRESS:case dt.ARTICLE:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{JUn(o,h);break}case dt.LI:case dt.DD:case dt.DT:{tGn(o,h);break}case dt.BR:case dt.IMG:case dt.WBR:case dt.AREA:case dt.EMBED:case dt.KEYGEN:{kNe(o,h);break}case dt.HR:{lGn(o,h);break}case dt.RB:case dt.RTC:{bGn(o,h);break}case dt.RT:case dt.RP:{yGn(o,h);break}case dt.PRE:case dt.LISTING:{QUn(o,h);break}case dt.XMP:{dGn(o,h);break}case dt.SVG:{vGn(o,h);break}case dt.HTML:{KUn(o,h);break}case dt.BASE:case dt.LINK:case dt.META:case dt.STYLE:case dt.TITLE:case dt.SCRIPT:case dt.BGSOUND:case dt.BASEFONT:case dt.TEMPLATE:{V5(o,h);break}case dt.BODY:{VUn(o,h);break}case dt.FORM:{ZUn(o,h);break}case dt.NOBR:{aGn(o,h);break}case dt.MATH:{wGn(o,h);break}case dt.TABLE:{sGn(o,h);break}case dt.INPUT:{cGn(o,h);break}case dt.PARAM:case dt.TRACK:case dt.SOURCE:{uGn(o,h);break}case dt.IMAGE:{hGn(o,h);break}case dt.BUTTON:{nGn(o,h);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{oGn(o,h);break}case dt.IFRAME:{pGn(o,h);break}case dt.SELECT:{gGn(o,h);break}case dt.OPTION:case dt.OPTGROUP:{mGn(o,h);break}case dt.NOEMBED:case dt.NOFRAMES:{RAe(o,h);break}case dt.FRAMESET:{YUn(o,h);break}case dt.TEXTAREA:{fGn(o,h);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?RAe(o,h):BAe(o,h);break}case dt.PLAINTEXT:{eGn(o,h);break}case dt.COL:case dt.TH:case dt.TD:case dt.TR:case dt.HEAD:case dt.FRAME:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.CAPTION:case dt.COLGROUP:break;default:BAe(o,h)}}function xGn(o,h){if(o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Ze.AFTER_BODY,o.options.sourceCodeLocationInfo)){const b=o.openElements.tryPeekProperlyNestedBodyElement();b&&o._setEndLocation(b,h)}}function kGn(o,h){o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Ze.AFTER_BODY,LNe(o,h))}function _Gn(o,h){const b=h.tagID;o.openElements.hasInScope(b)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(b))}function EGn(o){const h=o.openElements.tmplCount>0,{formElement:b}=o;h||(o.formElement=null),(b||h)&&o.openElements.hasInScope(dt.FORM)&&(o.openElements.generateImpliedEndTags(),h?o.openElements.popUntilTagNamePopped(dt.FORM):b&&o.openElements.remove(b))}function TGn(o){o.openElements.hasInButtonScope(dt.P)||o._insertFakeElement(ur.P,dt.P),o._closePElement()}function SGn(o){o.openElements.hasInListItemScope(dt.LI)&&(o.openElements.generateImpliedEndTagsWithExclusion(dt.LI),o.openElements.popUntilTagNamePopped(dt.LI))}function IGn(o,h){const b=h.tagID;o.openElements.hasInScope(b)&&(o.openElements.generateImpliedEndTagsWithExclusion(b),o.openElements.popUntilTagNamePopped(b))}function CGn(o){o.openElements.hasNumberedHeaderInScope()&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilNumberedHeaderPopped())}function AGn(o,h){const b=h.tagID;o.openElements.hasInScope(b)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(b),o.activeFormattingElements.clearToLastMarker())}function OGn(o){o._reconstructActiveFormattingElements(),o._insertFakeElement(ur.BR,dt.BR),o.openElements.pop(),o.framesetOk=!1}function ENe(o,h){const b=h.tagName,k=h.tagID;for(let O=o.openElements.stackTop;O>0;O--){const P=o.openElements.items[O],B=o.openElements.tagIDs[O];if(k===B&&(k!==dt.UNKNOWN||o.treeAdapter.getTagName(P)===b)){o.openElements.generateImpliedEndTagsWithExclusion(k),o.openElements.stackTop>=O&&o.openElements.shortenToLength(O);break}if(o._isSpecialElement(P,B))break}}function Abt(o,h){switch(h.tagID){case dt.A:case dt.B:case dt.I:case dt.S:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.NOBR:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{aFt(o,h);break}case dt.P:{TGn(o);break}case dt.DL:case dt.UL:case dt.OL:case dt.DIR:case dt.DIV:case dt.NAV:case dt.PRE:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.BUTTON:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.ADDRESS:case dt.ARTICLE:case dt.DETAILS:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.LISTING:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{_Gn(o,h);break}case dt.LI:{SGn(o);break}case dt.DD:case dt.DT:{IGn(o,h);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{CGn(o);break}case dt.BR:{OGn(o);break}case dt.BODY:{xGn(o,h);break}case dt.HTML:{kGn(o,h);break}case dt.FORM:{EGn(o);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{AGn(o,h);break}case dt.TEMPLATE:{aP(o,h);break}default:ENe(o,h)}}function TNe(o,h){o.tmplInsertionModeStack.length>0?PNe(o,h):oFt(o,h)}function NGn(o,h){var b;h.tagID===dt.SCRIPT&&((b=o.scriptHandler)===null||b===void 0||b.call(o,o.openElements.current)),o.openElements.pop(),o.insertionMode=o.originalInsertionMode}function PGn(o,h){o._err(h,Fr.eofInElementThatCanContainOnlyText),o.openElements.pop(),o.insertionMode=o.originalInsertionMode,o.onEof(h)}function CRt(o,h){if(wNe.has(o.openElements.currentTagId))switch(o.pendingCharacterTokens.length=0,o.hasNonWhitespacePendingCharacterToken=!1,o.originalInsertionMode=o.insertionMode,o.insertionMode=Ze.IN_TABLE_TEXT,h.type){case vu.CHARACTER:{INe(o,h);break}case vu.WHITESPACE_CHARACTER:{SNe(o,h);break}}else zX(o,h)}function LGn(o,h){o.openElements.clearBackToTableContext(),o.activeFormattingElements.insertMarker(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_CAPTION}function MGn(o,h){o.openElements.clearBackToTableContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_COLUMN_GROUP}function DGn(o,h){o.openElements.clearBackToTableContext(),o._insertFakeElement(ur.COLGROUP,dt.COLGROUP),o.insertionMode=Ze.IN_COLUMN_GROUP,sFt(o,h)}function RGn(o,h){o.openElements.clearBackToTableContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_TABLE_BODY}function BGn(o,h){o.openElements.clearBackToTableContext(),o._insertFakeElement(ur.TBODY,dt.TBODY),o.insertionMode=Ze.IN_TABLE_BODY,Obt(o,h)}function jGn(o,h){o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode(),o._processStartTag(h))}function FGn(o,h){_Ne(h)?o._appendElement(h,Bi.HTML):zX(o,h),h.ackSelfClosing=!0}function $Gn(o,h){!o.formElement&&o.openElements.tmplCount===0&&(o._insertElement(h,Bi.HTML),o.formElement=o.openElements.current,o.openElements.pop())}function Hj(o,h){switch(h.tagID){case dt.TD:case dt.TH:case dt.TR:{BGn(o,h);break}case dt.STYLE:case dt.SCRIPT:case dt.TEMPLATE:{V5(o,h);break}case dt.COL:{DGn(o,h);break}case dt.FORM:{$Gn(o,h);break}case dt.TABLE:{jGn(o,h);break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{RGn(o,h);break}case dt.INPUT:{FGn(o,h);break}case dt.CAPTION:{LGn(o,h);break}case dt.COLGROUP:{MGn(o,h);break}default:zX(o,h)}}function AX(o,h){switch(h.tagID){case dt.TABLE:{o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode());break}case dt.TEMPLATE:{aP(o,h);break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:zX(o,h)}}function zX(o,h){const b=o.fosterParentingEnabled;o.fosterParentingEnabled=!0,Cbt(o,h),o.fosterParentingEnabled=b}function SNe(o,h){o.pendingCharacterTokens.push(h)}function INe(o,h){o.pendingCharacterTokens.push(h),o.hasNonWhitespacePendingCharacterToken=!0}function QJ(o,h){let b=0;if(o.hasNonWhitespacePendingCharacterToken)for(;b<o.pendingCharacterTokens.length;b++)zX(o,o.pendingCharacterTokens[b]);else for(;b<o.pendingCharacterTokens.length;b++)o._insertCharacters(o.pendingCharacterTokens[b]);o.insertionMode=o.originalInsertionMode,o._processToken(h)}const CNe=new Set([dt.CAPTION,dt.COL,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]);function HGn(o,h){const b=h.tagID;CNe.has(b)?o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Ze.IN_TABLE,Hj(o,h)):vm(o,h)}function zGn(o,h){const b=h.tagID;switch(b){case dt.CAPTION:case dt.TABLE:{o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Ze.IN_TABLE,b===dt.TABLE&&AX(o,h));break}case dt.BODY:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:Abt(o,h)}}function sFt(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.COL:{o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.TEMPLATE:{V5(o,h);break}default:Xmt(o,h)}}function UGn(o,h){switch(h.tagID){case dt.COLGROUP:{o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Ze.IN_TABLE);break}case dt.TEMPLATE:{aP(o,h);break}case dt.COL:break;default:Xmt(o,h)}}function Xmt(o,h){o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Ze.IN_TABLE,o._processToken(h))}function Obt(o,h){switch(h.tagID){case dt.TR:{o.openElements.clearBackToTableBodyContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_ROW;break}case dt.TH:case dt.TD:{o.openElements.clearBackToTableBodyContext(),o._insertFakeElement(ur.TR,dt.TR),o.insertionMode=Ze.IN_ROW,Nbt(o,h);break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE,Hj(o,h));break}default:Hj(o,h)}}function HBt(o,h){const b=h.tagID;switch(h.tagID){case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasInTableScope(b)&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE);break}case dt.TABLE:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE,AX(o,h));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:case dt.TR:break;default:AX(o,h)}}function Nbt(o,h){switch(h.tagID){case dt.TH:case dt.TD:{o.openElements.clearBackToTableRowContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_CELL,o.activeFormattingElements.insertMarker();break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY,Obt(o,h));break}default:Hj(o,h)}}function ANe(o,h){switch(h.tagID){case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY);break}case dt.TABLE:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY,HBt(o,h));break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{(o.openElements.hasInTableScope(h.tagID)||o.openElements.hasInTableScope(dt.TR))&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY,HBt(o,h));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:break;default:AX(o,h)}}function GGn(o,h){const b=h.tagID;CNe.has(b)?(o.openElements.hasInTableScope(dt.TD)||o.openElements.hasInTableScope(dt.TH))&&(o._closeTableCell(),Nbt(o,h)):vm(o,h)}function qGn(o,h){const b=h.tagID;switch(b){case dt.TD:case dt.TH:{o.openElements.hasInTableScope(b)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(b),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Ze.IN_ROW);break}case dt.TABLE:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(b)&&(o._closeTableCell(),ANe(o,h));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:break;default:Abt(o,h)}}function ONe(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._insertElement(h,Bi.HTML);break}case dt.OPTGROUP:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._insertElement(h,Bi.HTML);break}case dt.HR:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.INPUT:case dt.KEYGEN:case dt.TEXTAREA:case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),h.tagID!==dt.SELECT&&o._processStartTag(h));break}case dt.SCRIPT:case dt.TEMPLATE:{V5(o,h);break}}}function NNe(o,h){switch(h.tagID){case dt.OPTGROUP:{o.openElements.stackTop>0&&o.openElements.currentTagId===dt.OPTION&&o.openElements.tagIDs[o.openElements.stackTop-1]===dt.OPTGROUP&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop();break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop();break}case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode());break}case dt.TEMPLATE:{aP(o,h);break}}}function WGn(o,h){const b=h.tagID;b===dt.CAPTION||b===dt.TABLE||b===dt.TBODY||b===dt.TFOOT||b===dt.THEAD||b===dt.TR||b===dt.TD||b===dt.TH?(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o._processStartTag(h)):ONe(o,h)}function KGn(o,h){const b=h.tagID;b===dt.CAPTION||b===dt.TABLE||b===dt.TBODY||b===dt.TFOOT||b===dt.THEAD||b===dt.TR||b===dt.TD||b===dt.TH?o.openElements.hasInTableScope(b)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o.onEndTag(h)):NNe(o,h)}function VGn(o,h){switch(h.tagID){case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{V5(o,h);break}case dt.CAPTION:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.tmplInsertionModeStack[0]=Ze.IN_TABLE,o.insertionMode=Ze.IN_TABLE,Hj(o,h);break}case dt.COL:{o.tmplInsertionModeStack[0]=Ze.IN_COLUMN_GROUP,o.insertionMode=Ze.IN_COLUMN_GROUP,sFt(o,h);break}case dt.TR:{o.tmplInsertionModeStack[0]=Ze.IN_TABLE_BODY,o.insertionMode=Ze.IN_TABLE_BODY,Obt(o,h);break}case dt.TD:case dt.TH:{o.tmplInsertionModeStack[0]=Ze.IN_ROW,o.insertionMode=Ze.IN_ROW,Nbt(o,h);break}default:o.tmplInsertionModeStack[0]=Ze.IN_BODY,o.insertionMode=Ze.IN_BODY,vm(o,h)}}function YGn(o,h){h.tagID===dt.TEMPLATE&&aP(o,h)}function PNe(o,h){o.openElements.tmplCount>0?(o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode(),o.onEof(h)):oFt(o,h)}function JGn(o,h){h.tagID===dt.HTML?vm(o,h):Qmt(o,h)}function LNe(o,h){var b;if(h.tagID===dt.HTML){if(o.fragmentContext||(o.insertionMode=Ze.AFTER_AFTER_BODY),o.options.sourceCodeLocationInfo&&o.openElements.tagIDs[0]===dt.HTML){o._setEndLocation(o.openElements.items[0],h);const k=o.openElements.items[1];k&&!(!((b=o.treeAdapter.getNodeSourceCodeLocation(k))===null||b===void 0)&&b.endTag)&&o._setEndLocation(k,h)}}else Qmt(o,h)}function Qmt(o,h){o.insertionMode=Ze.IN_BODY,Cbt(o,h)}function XGn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.FRAMESET:{o._insertElement(h,Bi.HTML);break}case dt.FRAME:{o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.NOFRAMES:{V5(o,h);break}}}function QGn(o,h){h.tagID===dt.FRAMESET&&!o.openElements.isRootHtmlElementCurrent()&&(o.openElements.pop(),!o.fragmentContext&&o.openElements.currentTagId!==dt.FRAMESET&&(o.insertionMode=Ze.AFTER_FRAMESET))}function ZGn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.NOFRAMES:{V5(o,h);break}}}function tqn(o,h){h.tagID===dt.HTML&&(o.insertionMode=Ze.AFTER_AFTER_FRAMESET)}function eqn(o,h){h.tagID===dt.HTML?vm(o,h):Dmt(o,h)}function Dmt(o,h){o.insertionMode=Ze.IN_BODY,Cbt(o,h)}function nqn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.NOFRAMES:{V5(o,h);break}}}function rqn(o,h){h.chars=Wf,o._insertCharacters(h)}function iqn(o,h){o._insertCharacters(h),o.framesetOk=!1}function MNe(o){for(;o.treeAdapter.getNamespaceURI(o.openElements.current)!==Bi.HTML&&!o._isIntegrationPoint(o.openElements.currentTagId,o.openElements.current);)o.openElements.pop()}function aqn(o,h){if(vUn(h))MNe(o),o._startTagOutsideForeignContent(h);else{const b=o._getAdjustedCurrentElement(),k=o.treeAdapter.getNamespaceURI(b);k===Bi.MATHML?bNe(h):k===Bi.SVG&&(xUn(h),yNe(h)),iFt(h),h.selfClosing?o._appendElement(h,k):o._insertElement(h,k),h.ackSelfClosing=!0}}function oqn(o,h){if(h.tagID===dt.P||h.tagID===dt.BR){MNe(o),o._endTagOutsideForeignContent(h);return}for(let b=o.openElements.stackTop;b>0;b--){const k=o.openElements.items[b];if(o.treeAdapter.getNamespaceURI(k)===Bi.HTML){o._endTagOutsideForeignContent(h);break}const O=o.treeAdapter.getTagName(k);if(O.toLowerCase()===h.tagName){h.tagName=O,o.openElements.shortenToLength(b);break}}}ur.AREA,ur.BASE,ur.BASEFONT,ur.BGSOUND,ur.BR,ur.COL,ur.EMBED,ur.FRAME,ur.HR,ur.IMG,ur.INPUT,ur.KEYGEN,ur.LINK,ur.META,ur.PARAM,ur.SOURCE,ur.TRACK,ur.WBR;const sqn=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,cqn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),jAe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function DNe(o,h){const b=yqn(o),k=nFt("type",{handlers:{root:uqn,element:lqn,text:hqn,comment:BNe,doctype:fqn,raw:pqn},unknown:gqn}),O={parser:b?new DAe(jAe):DAe.getFragmentParser(void 0,jAe),handle(G){k(G,O)},stitches:!1,options:h||{}};k(o,O),tF(O,b6());const P=b?O.parser.document:O.parser.getFragment(),B=lzn(P,{file:O.options.file});return O.stitches&&Qjt(B,"comment",function(G,J,U){const nt=G;if(nt.value.stitch&&U&&J!==void 0){const at=U.children;return at[J]=nt.value.stitch,J}}),B.type==="root"&&B.children.length===1&&B.children[0].type===o.type?B.children[0]:B}function RNe(o,h){let b=-1;if(o)for(;++b<o.length;)h.handle(o[b])}function uqn(o,h){RNe(o.children,h)}function lqn(o,h){mqn(o,h),RNe(o.children,h),bqn(o,h)}function hqn(o,h){h.parser.tokenizer.state>4&&(h.parser.tokenizer.state=0);const b={type:vu.CHARACTER,chars:o.value,location:UX(o)};tF(h,b6(o)),h.parser.currentToken=b,h.parser._processToken(h.parser.currentToken)}function fqn(o,h){const b={type:vu.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:UX(o)};tF(h,b6(o)),h.parser.currentToken=b,h.parser._processToken(h.parser.currentToken)}function dqn(o,h){h.stitches=!0;const b=wqn(o);if("children"in o&&"children"in b){const k=DNe({type:"root",children:o.children},h.options);b.children=k.children}BNe({type:"comment",value:{stitch:b}},h)}function BNe(o,h){const b=o.value,k={type:vu.COMMENT,data:b,location:UX(o)};tF(h,b6(o)),h.parser.currentToken=k,h.parser._processToken(h.parser.currentToken)}function pqn(o,h){if(h.parser.tokenizer.preprocessor.html="",h.parser.tokenizer.preprocessor.pos=-1,h.parser.tokenizer.preprocessor.lastGapPos=-2,h.parser.tokenizer.preprocessor.gapStack=[],h.parser.tokenizer.preprocessor.skipNextNewLine=!1,h.parser.tokenizer.preprocessor.lastChunkWritten=!1,h.parser.tokenizer.preprocessor.endOfChunkHit=!1,h.parser.tokenizer.preprocessor.isEol=!1,jNe(h,b6(o)),h.parser.tokenizer.write(h.options.tagfilter?o.value.replace(sqn,"&lt;$1$2"):o.value,!1),h.parser.tokenizer._runParsingLoop(),h.parser.tokenizer.state===72||h.parser.tokenizer.state===78){h.parser.tokenizer.preprocessor.lastChunkWritten=!0;const b=h.parser.tokenizer._consume();h.parser.tokenizer._callState(b)}}function gqn(o,h){const b=o;if(h.options.passThrough&&h.options.passThrough.includes(b.type))dqn(b,h);else{let k="";throw cqn.has(b.type)&&(k=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+b.type+"` node"+k)}}function tF(o,h){jNe(o,h);const b=o.parser.tokenizer.currentCharacterToken;b&&b.location&&(b.location.endLine=o.parser.tokenizer.preprocessor.line,b.location.endCol=o.parser.tokenizer.preprocessor.col+1,b.location.endOffset=o.parser.tokenizer.preprocessor.offset+1,o.parser.currentToken=b,o.parser._processToken(o.parser.currentToken)),o.parser.tokenizer.paused=!1,o.parser.tokenizer.inLoop=!1,o.parser.tokenizer.active=!1,o.parser.tokenizer.returnState=C1.DATA,o.parser.tokenizer.charRefCode=-1,o.parser.tokenizer.consumedAfterSnapshot=-1,o.parser.tokenizer.currentLocation=null,o.parser.tokenizer.currentCharacterToken=null,o.parser.tokenizer.currentToken=null,o.parser.tokenizer.currentAttr={name:"",value:""}}function jNe(o,h){if(h&&h.offset!==void 0){const b={startLine:h.line,startCol:h.column,startOffset:h.offset,endLine:-1,endCol:-1,endOffset:-1};o.parser.tokenizer.preprocessor.lineStartPos=-h.column+1,o.parser.tokenizer.preprocessor.droppedBufferSize=h.offset,o.parser.tokenizer.preprocessor.line=h.line,o.parser.tokenizer.currentLocation=b}}function mqn(o,h){const b=o.tagName.toLowerCase();if(h.parser.tokenizer.state===C1.PLAINTEXT)return;tF(h,b6(o));const k=h.parser.openElements.current;let O="namespaceURI"in k?k.namespaceURI:qN.html;O===qN.html&&b==="svg"&&(O=qN.svg);const P=Tzn({...o,children:[]},{space:O===qN.svg?"svg":"html"}),B={type:vu.START_TAG,tagName:b,tagID:Zj(b),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in P?P.attrs:[],location:UX(o)};h.parser.currentToken=B,h.parser._processToken(h.parser.currentToken),h.parser.tokenizer.lastStartTagName=b}function bqn(o,h){const b=o.tagName.toLowerCase();if(!h.parser.tokenizer.inForeignNode&&iNe.includes(b)||h.parser.tokenizer.state===C1.PLAINTEXT)return;tF(h,Ebt(o));const k={type:vu.END_TAG,tagName:b,tagID:Zj(b),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:UX(o)};h.parser.currentToken=k,h.parser._processToken(h.parser.currentToken),b===h.parser.tokenizer.lastStartTagName&&(h.parser.tokenizer.state===C1.RCDATA||h.parser.tokenizer.state===C1.RAWTEXT||h.parser.tokenizer.state===C1.SCRIPT_DATA)&&(h.parser.tokenizer.state=C1.DATA)}function yqn(o){const h=o.type==="root"?o.children[0]:o;return!!(h&&(h.type==="doctype"||h.type==="element"&&h.tagName.toLowerCase()==="html"))}function UX(o){const h=b6(o)||{line:void 0,column:void 0,offset:void 0},b=Ebt(o)||{line:void 0,column:void 0,offset:void 0};return{startLine:h.line,startCol:h.column,startOffset:h.offset,endLine:b.line,endCol:b.column,endOffset:b.offset}}function wqn(o){return"children"in o?$j({...o,children:[]}):$j(o)}function vqn(o){return function(h,b){return DNe(h,{...o,file:b})}}const xqn=/["&'<>`]/g,kqn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_qn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Eqn=/[|\\{}()[\]^$+*?.]/g,FAe=new WeakMap;function Tqn(o,h){if(o=o.replace(h.subset?Sqn(h.subset):xqn,k),h.subset||h.escapeOnly)return o;return o.replace(kqn,b).replace(_qn,k);function b(O,P,B){return h.format((O.charCodeAt(0)-55296)*1024+O.charCodeAt(1)-56320+65536,B.charCodeAt(P+2),h)}function k(O,P,B){return h.format(O.charCodeAt(0),B.charCodeAt(P+1),h)}}function Sqn(o){let h=FAe.get(o);return h||(h=Iqn(o),FAe.set(o,h)),h}function Iqn(o){const h=[];let b=-1;for(;++b<o.length;)h.push(o[b].replace(Eqn,"\\$&"));return new RegExp("(?:"+h.join("|")+")","g")}const Cqn=/[\dA-Fa-f]/;function Aqn(o,h,b){const k="&#x"+o.toString(16).toUpperCase();return b&&h&&!Cqn.test(String.fromCharCode(h))?k:k+";"}const Oqn=/\d/;function Nqn(o,h,b){const k="&#"+String(o);return b&&h&&!Oqn.test(String.fromCharCode(h))?k:k+";"}const Pqn=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],ARt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Lqn=["cent","copy","divide","gt","lt","not","para","times"],FNe={}.hasOwnProperty,zBt={};let xmt;for(xmt in ARt)FNe.call(ARt,xmt)&&(zBt[ARt[xmt]]=xmt);const Mqn=/[^\dA-Za-z]/;function Dqn(o,h,b,k){const O=String.fromCharCode(o);if(FNe.call(zBt,O)){const P=zBt[O],B="&"+P;return b&&Pqn.includes(P)&&!Lqn.includes(P)&&(!k||h&&h!==61&&Mqn.test(String.fromCharCode(h)))?B:B+";"}return""}function Rqn(o,h,b){let k=Aqn(o,h,b.omitOptionalSemicolons),O;if((b.useNamedReferences||b.useShortestReferences)&&(O=Dqn(o,h,b.omitOptionalSemicolons,b.attribute)),(b.useShortestReferences||!O)&&b.useShortestReferences){const P=Nqn(o,h,b.omitOptionalSemicolons);P.length<k.length&&(k=P)}return O&&(!b.useShortestReferences||O.length<k.length)?O:k}function Lj(o,h){return Tqn(o,Object.assign({format:Rqn},h))}const Bqn=/^>|^->|<!--|-->|--!>|<!-$/g,jqn=[">"],Fqn=["<",">"];function $qn(o,h,b,k){return k.settings.bogusComments?"<?"+Lj(o.value,Object.assign({},k.settings.characterReferences,{subset:jqn}))+">":"<!--"+o.value.replace(Bqn,O)+"-->";function O(P){return Lj(P,Object.assign({},k.settings.characterReferences,{subset:Fqn}))}}function Hqn(o,h,b,k){return"<!"+(k.settings.upperDoctype?"DOCTYPE":"doctype")+(k.settings.tightDoctype?"":" ")+"html>"}function $Ae(o,h){const b=String(o);if(typeof h!="string")throw new TypeError("Expected character");let k=0,O=b.indexOf(h);for(;O!==-1;)k++,O=b.indexOf(h,O+h.length);return k}const Xp=HNe(1),$Ne=HNe(-1),zqn=[];function HNe(o){return h;function h(b,k,O){const P=b?b.children:zqn;let B=(k||0)+o,G=P[B];if(!O)for(;G&&xbt(G);)B+=o,G=P[B];return G}}const Uqn={}.hasOwnProperty;function zNe(o){return h;function h(b,k,O){return Uqn.call(o,b.tagName)&&o[b.tagName](b,k,O)}}const cFt=zNe({body:qqn,caption:ORt,colgroup:ORt,dd:Yqn,dt:Vqn,head:ORt,html:Gqn,li:Kqn,optgroup:Jqn,option:Xqn,p:Wqn,rp:HAe,rt:HAe,tbody:Zqn,td:zAe,tfoot:tWn,th:zAe,thead:Qqn,tr:eWn});function ORt(o,h,b){const k=Xp(b,h,!0);return!k||k.type!=="comment"&&!(k.type==="text"&&xbt(k.value.charAt(0)))}function Gqn(o,h,b){const k=Xp(b,h);return!k||k.type!=="comment"}function qqn(o,h,b){const k=Xp(b,h);return!k||k.type!=="comment"}function Wqn(o,h,b){const k=Xp(b,h);return k?k.type==="element"&&(k.tagName==="address"||k.tagName==="article"||k.tagName==="aside"||k.tagName==="blockquote"||k.tagName==="details"||k.tagName==="div"||k.tagName==="dl"||k.tagName==="fieldset"||k.tagName==="figcaption"||k.tagName==="figure"||k.tagName==="footer"||k.tagName==="form"||k.tagName==="h1"||k.tagName==="h2"||k.tagName==="h3"||k.tagName==="h4"||k.tagName==="h5"||k.tagName==="h6"||k.tagName==="header"||k.tagName==="hgroup"||k.tagName==="hr"||k.tagName==="main"||k.tagName==="menu"||k.tagName==="nav"||k.tagName==="ol"||k.tagName==="p"||k.tagName==="pre"||k.tagName==="section"||k.tagName==="table"||k.tagName==="ul"):!b||!(b.type==="element"&&(b.tagName==="a"||b.tagName==="audio"||b.tagName==="del"||b.tagName==="ins"||b.tagName==="map"||b.tagName==="noscript"||b.tagName==="video"))}function Kqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&k.tagName==="li"}function Vqn(o,h,b){const k=Xp(b,h);return!!(k&&k.type==="element"&&(k.tagName==="dt"||k.tagName==="dd"))}function Yqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="dt"||k.tagName==="dd")}function HAe(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="rp"||k.tagName==="rt")}function Jqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&k.tagName==="optgroup"}function Xqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="option"||k.tagName==="optgroup")}function Qqn(o,h,b){const k=Xp(b,h);return!!(k&&k.type==="element"&&(k.tagName==="tbody"||k.tagName==="tfoot"))}function Zqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="tbody"||k.tagName==="tfoot")}function tWn(o,h,b){return!Xp(b,h)}function eWn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&k.tagName==="tr"}function zAe(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="td"||k.tagName==="th")}const nWn=zNe({body:aWn,colgroup:oWn,head:iWn,html:rWn,tbody:sWn});function rWn(o){const h=Xp(o,-1);return!h||h.type!=="comment"}function iWn(o){const h=new Set;for(const k of o.children)if(k.type==="element"&&(k.tagName==="base"||k.tagName==="title")){if(h.has(k.tagName))return!1;h.add(k.tagName)}const b=o.children[0];return!b||b.type==="element"}function aWn(o){const h=Xp(o,-1,!0);return!h||h.type!=="comment"&&!(h.type==="text"&&xbt(h.value.charAt(0)))&&!(h.type==="element"&&(h.tagName==="meta"||h.tagName==="link"||h.tagName==="script"||h.tagName==="style"||h.tagName==="template"))}function oWn(o,h,b){const k=$Ne(b,h),O=Xp(o,-1,!0);return b&&k&&k.type==="element"&&k.tagName==="colgroup"&&cFt(k,b.children.indexOf(k),b)?!1:!!(O&&O.type==="element"&&O.tagName==="col")}function sWn(o,h,b){const k=$Ne(b,h),O=Xp(o,-1);return b&&k&&k.type==="element"&&(k.tagName==="thead"||k.tagName==="tbody")&&cFt(k,b.children.indexOf(k),b)?!1:!!(O&&O.type==="element"&&O.tagName==="tr")}const kmt={name:[[`
3230
+ `}),b}function aAe(o){let h=0,b=o.charCodeAt(h);for(;b===9||b===32;)h++,b=o.charCodeAt(h);return o.slice(h)}function oAe(o,h){const b=xHn(o,h),k=b.one(o,void 0),O=lHn(b),P=Array.isArray(k)?{type:"root",children:k}:k||{type:"root",children:[]};return O&&P.children.push({type:"text",value:`
3231
+ `},O),P}function SHn(o,h){return o&&"run"in o?async function(b,k){const O=oAe(b,{file:k,...h});await o.run(O,k)}:function(b,k){return oAe(b,{file:k,...o||h})}}function sAe(o){if(o)throw o}var Lmt=Object.prototype.hasOwnProperty,UOe=Object.prototype.toString,cAe=Object.defineProperty,uAe=Object.getOwnPropertyDescriptor,lAe=function(h){return typeof Array.isArray=="function"?Array.isArray(h):UOe.call(h)==="[object Array]"},hAe=function(h){if(!h||UOe.call(h)!=="[object Object]")return!1;var b=Lmt.call(h,"constructor"),k=h.constructor&&h.constructor.prototype&&Lmt.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!b&&!k)return!1;var O;for(O in h);return typeof O>"u"||Lmt.call(h,O)},fAe=function(h,b){cAe&&b.name==="__proto__"?cAe(h,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):h[b.name]=b.newValue},dAe=function(h,b){if(b==="__proto__")if(Lmt.call(h,b)){if(uAe)return uAe(h,b).value}else return;return h[b]},IHn=function o(){var h,b,k,O,P,B,G=arguments[0],J=1,U=arguments.length,nt=!1;for(typeof G=="boolean"&&(nt=G,G=arguments[1]||{},J=2),(G==null||typeof G!="object"&&typeof G!="function")&&(G={});J<U;++J)if(h=arguments[J],h!=null)for(b in h)k=dAe(G,b),O=dAe(h,b),G!==O&&(nt&&O&&(hAe(O)||(P=lAe(O)))?(P?(P=!1,B=k&&lAe(k)?k:[]):B=k&&hAe(k)?k:{},fAe(G,{name:b,newValue:o(nt,B,O)})):typeof O<"u"&&fAe(G,{name:b,newValue:O}));return G};const yRt=e7e(IHn);function LBt(o){if(typeof o!="object"||o===null)return!1;const h=Object.getPrototypeOf(o);return(h===null||h===Object.prototype||Object.getPrototypeOf(h)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)}function CHn(){const o=[],h={run:b,use:k};return h;function b(...O){let P=-1;const B=O.pop();if(typeof B!="function")throw new TypeError("Expected function as last argument, not "+B);G(null,...O);function G(J,...U){const nt=o[++P];let at=-1;if(J){B(J);return}for(;++at<O.length;)(U[at]===null||U[at]===void 0)&&(U[at]=O[at]);O=U,nt?AHn(nt,G)(...U):B(null,...U)}}function k(O){if(typeof O!="function")throw new TypeError("Expected `middelware` to be a function, not "+O);return o.push(O),h}}function AHn(o,h){let b;return k;function k(...B){const G=o.length>B.length;let J;G&&B.push(O);try{J=o.apply(this,B)}catch(U){const nt=U;if(G&&b)throw nt;return O(nt)}G||(J&&J.then&&typeof J.then=="function"?J.then(P,O):J instanceof Error?O(J):P(J))}function O(B,...G){b||(b=!0,h(B,...G))}function P(B){O(null,B)}}const s6={basename:OHn,dirname:NHn,extname:PHn,join:LHn,sep:"/"};function OHn(o,h){if(h!==void 0&&typeof h!="string")throw new TypeError('"ext" argument must be a string');$X(o);let b=0,k=-1,O=o.length,P;if(h===void 0||h.length===0||h.length>o.length){for(;O--;)if(o.codePointAt(O)===47){if(P){b=O+1;break}}else k<0&&(P=!0,k=O+1);return k<0?"":o.slice(b,k)}if(h===o)return"";let B=-1,G=h.length-1;for(;O--;)if(o.codePointAt(O)===47){if(P){b=O+1;break}}else B<0&&(P=!0,B=O+1),G>-1&&(o.codePointAt(O)===h.codePointAt(G--)?G<0&&(k=O):(G=-1,k=B));return b===k?k=B:k<0&&(k=o.length),o.slice(b,k)}function NHn(o){if($X(o),o.length===0)return".";let h=-1,b=o.length,k;for(;--b;)if(o.codePointAt(b)===47){if(k){h=b;break}}else k||(k=!0);return h<0?o.codePointAt(0)===47?"/":".":h===1&&o.codePointAt(0)===47?"//":o.slice(0,h)}function PHn(o){$X(o);let h=o.length,b=-1,k=0,O=-1,P=0,B;for(;h--;){const G=o.codePointAt(h);if(G===47){if(B){k=h+1;break}continue}b<0&&(B=!0,b=h+1),G===46?O<0?O=h:P!==1&&(P=1):O>-1&&(P=-1)}return O<0||b<0||P===0||P===1&&O===b-1&&O===k+1?"":o.slice(O,b)}function LHn(...o){let h=-1,b;for(;++h<o.length;)$X(o[h]),o[h]&&(b=b===void 0?o[h]:b+"/"+o[h]);return b===void 0?".":MHn(b)}function MHn(o){$X(o);const h=o.codePointAt(0)===47;let b=DHn(o,!h);return b.length===0&&!h&&(b="."),b.length>0&&o.codePointAt(o.length-1)===47&&(b+="/"),h?"/"+b:b}function DHn(o,h){let b="",k=0,O=-1,P=0,B=-1,G,J;for(;++B<=o.length;){if(B<o.length)G=o.codePointAt(B);else{if(G===47)break;G=47}if(G===47){if(!(O===B-1||P===1))if(O!==B-1&&P===2){if(b.length<2||k!==2||b.codePointAt(b.length-1)!==46||b.codePointAt(b.length-2)!==46){if(b.length>2){if(J=b.lastIndexOf("/"),J!==b.length-1){J<0?(b="",k=0):(b=b.slice(0,J),k=b.length-1-b.lastIndexOf("/")),O=B,P=0;continue}}else if(b.length>0){b="",k=0,O=B,P=0;continue}}h&&(b=b.length>0?b+"/..":"..",k=2)}else b.length>0?b+="/"+o.slice(O+1,B):b=o.slice(O+1,B),k=B-O-1;O=B,P=0}else G===46&&P>-1?P++:P=-1}return b}function $X(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}const RHn={cwd:BHn};function BHn(){return"/"}function MBt(o){return!!(o!==null&&typeof o=="object"&&"href"in o&&o.href&&"protocol"in o&&o.protocol&&o.auth===void 0)}function jHn(o){if(typeof o=="string")o=new URL(o);else if(!MBt(o)){const h=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+o+"`");throw h.code="ERR_INVALID_ARG_TYPE",h}if(o.protocol!=="file:"){const h=new TypeError("The URL must be of scheme file");throw h.code="ERR_INVALID_URL_SCHEME",h}return FHn(o)}function FHn(o){if(o.hostname!==""){const k=new TypeError('File URL host must be "localhost" or empty on darwin');throw k.code="ERR_INVALID_FILE_URL_HOST",k}const h=o.pathname;let b=-1;for(;++b<h.length;)if(h.codePointAt(b)===37&&h.codePointAt(b+1)===50){const k=h.codePointAt(b+2);if(k===70||k===102){const O=new TypeError("File URL path must not include encoded / characters");throw O.code="ERR_INVALID_FILE_URL_PATH",O}}return decodeURIComponent(h)}const wRt=["history","path","basename","stem","extname","dirname"];class GOe{constructor(h){let b;h?MBt(h)?b={path:h}:typeof h=="string"||$Hn(h)?b={value:h}:b=h:b={},this.cwd="cwd"in b?"":RHn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let k=-1;for(;++k<wRt.length;){const P=wRt[k];P in b&&b[P]!==void 0&&b[P]!==null&&(this[P]=P==="history"?[...b[P]]:b[P])}let O;for(O in b)wRt.includes(O)||(this[O]=b[O])}get basename(){return typeof this.path=="string"?s6.basename(this.path):void 0}set basename(h){xRt(h,"basename"),vRt(h,"basename"),this.path=s6.join(this.dirname||"",h)}get dirname(){return typeof this.path=="string"?s6.dirname(this.path):void 0}set dirname(h){pAe(this.basename,"dirname"),this.path=s6.join(h||"",this.basename)}get extname(){return typeof this.path=="string"?s6.extname(this.path):void 0}set extname(h){if(vRt(h,"extname"),pAe(this.dirname,"extname"),h){if(h.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(h.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=s6.join(this.dirname,this.stem+(h||""))}get path(){return this.history[this.history.length-1]}set path(h){MBt(h)&&(h=jHn(h)),xRt(h,"path"),this.path!==h&&this.history.push(h)}get stem(){return typeof this.path=="string"?s6.basename(this.path,this.extname):void 0}set stem(h){xRt(h,"stem"),vRt(h,"stem"),this.path=s6.join(this.dirname||"",h+(this.extname||""))}fail(h,b,k){const O=this.message(h,b,k);throw O.fatal=!0,O}info(h,b,k){const O=this.message(h,b,k);return O.fatal=void 0,O}message(h,b,k){const O=new wm(h,b,k);return this.path&&(O.name=this.path+":"+O.name,O.file=this.path),O.fatal=!1,this.messages.push(O),O}toString(h){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(h||void 0).decode(this.value)}}function vRt(o,h){if(o&&o.includes(s6.sep))throw new Error("`"+h+"` cannot be a path: did not expect `"+s6.sep+"`")}function xRt(o,h){if(!o)throw new Error("`"+h+"` cannot be empty")}function pAe(o,h){if(!o)throw new Error("Setting `"+h+"` requires `path` to be set too")}function $Hn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const HHn=function(o){const k=this.constructor.prototype,O=k[o],P=function(){return O.apply(P,arguments)};return Object.setPrototypeOf(P,k),P},zHn={}.hasOwnProperty;class Zjt extends HHn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=CHn()}copy(){const h=new Zjt;let b=-1;for(;++b<this.attachers.length;){const k=this.attachers[b];h.use(...k)}return h.data(yRt(!0,{},this.namespace)),h}data(h,b){return typeof h=="string"?arguments.length===2?(ERt("data",this.frozen),this.namespace[h]=b,this):zHn.call(this.namespace,h)&&this.namespace[h]||void 0:h?(ERt("data",this.frozen),this.namespace=h,this):this.namespace}freeze(){if(this.frozen)return this;const h=this;for(;++this.freezeIndex<this.attachers.length;){const[b,...k]=this.attachers[this.freezeIndex];if(k[0]===!1)continue;k[0]===!0&&(k[0]=void 0);const O=b.call(h,...k);typeof O=="function"&&this.transformers.use(O)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(h){this.freeze();const b=wmt(h),k=this.parser||this.Parser;return kRt("parse",k),k(String(b),b)}process(h,b){const k=this;return this.freeze(),kRt("process",this.parser||this.Parser),_Rt("process",this.compiler||this.Compiler),b?O(void 0,b):new Promise(O);function O(P,B){const G=wmt(h),J=k.parse(G);k.run(J,G,function(nt,at,it){if(nt||!at||!it)return U(nt);const st=at,tt=k.stringify(st,it);qHn(tt)?it.value=tt:it.result=tt,U(nt,it)});function U(nt,at){nt||!at?B(nt):P?P(at):b(void 0,at)}}}processSync(h){let b=!1,k;return this.freeze(),kRt("processSync",this.parser||this.Parser),_Rt("processSync",this.compiler||this.Compiler),this.process(h,O),mAe("processSync","process",b),k;function O(P,B){b=!0,sAe(P),k=B}}run(h,b,k){gAe(h),this.freeze();const O=this.transformers;return!k&&typeof b=="function"&&(k=b,b=void 0),k?P(void 0,k):new Promise(P);function P(B,G){const J=wmt(b);O.run(h,J,U);function U(nt,at,it){const st=at||h;nt?G(nt):B?B(st):k(void 0,st,it)}}}runSync(h,b){let k=!1,O;return this.run(h,b,P),mAe("runSync","run",k),O;function P(B,G){sAe(B),O=G,k=!0}}stringify(h,b){this.freeze();const k=wmt(b),O=this.compiler||this.Compiler;return _Rt("stringify",O),gAe(h),O(h,k)}use(h,...b){const k=this.attachers,O=this.namespace;if(ERt("use",this.frozen),h!=null)if(typeof h=="function")J(h,b);else if(typeof h=="object")Array.isArray(h)?G(h):B(h);else throw new TypeError("Expected usable value, not `"+h+"`");return this;function P(U){if(typeof U=="function")J(U,[]);else if(typeof U=="object")if(Array.isArray(U)){const[nt,...at]=U;J(nt,at)}else B(U);else throw new TypeError("Expected usable value, not `"+U+"`")}function B(U){if(!("plugins"in U)&&!("settings"in U))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");G(U.plugins),U.settings&&(O.settings=yRt(!0,O.settings,U.settings))}function G(U){let nt=-1;if(U!=null)if(Array.isArray(U))for(;++nt<U.length;){const at=U[nt];P(at)}else throw new TypeError("Expected a list of plugins, not `"+U+"`")}function J(U,nt){let at=-1,it=-1;for(;++at<k.length;)if(k[at][0]===U){it=at;break}if(it===-1)k.push([U,...nt]);else if(nt.length>0){let[st,...tt]=nt;const Et=k[it][1];LBt(Et)&&LBt(st)&&(st=yRt(!0,Et,st)),k[it]=[U,st,...tt]}}}}const UHn=new Zjt().freeze();function kRt(o,h){if(typeof h!="function")throw new TypeError("Cannot `"+o+"` without `parser`")}function _Rt(o,h){if(typeof h!="function")throw new TypeError("Cannot `"+o+"` without `compiler`")}function ERt(o,h){if(h)throw new Error("Cannot call `"+o+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gAe(o){if(!LBt(o)||typeof o.type!="string")throw new TypeError("Expected node, got `"+o+"`")}function mAe(o,h,b){if(!b)throw new Error("`"+o+"` finished async. Use `"+h+"` instead")}function wmt(o){return GHn(o)?o:new GOe(o)}function GHn(o){return!!(o&&typeof o=="object"&&"message"in o&&"messages"in o)}function qHn(o){return typeof o=="string"||WHn(o)}function WHn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const KHn="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bAe=[],yAe={allowDangerousHtml:!0},VHn=/^(https?|ircs?|mailto|xmpp)$/i,YHn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function JHn(o){const h=XHn(o),b=QHn(o);return ZHn(h.runSync(h.parse(b),b),o)}function XHn(o){const h=o.rehypePlugins||bAe,b=o.remarkPlugins||bAe,k=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...yAe}:yAe;return UHn().use(N$n).use(b).use(SHn,k).use(h)}function QHn(o){const h=o.children||"",b=new GOe;return typeof h=="string"&&(b.value=h),b}function ZHn(o,h){const b=h.allowedElements,k=h.allowElement,O=h.components,P=h.disallowedElements,B=h.skipHtml,G=h.unwrapDisallowed,J=h.urlTransform||tzn;for(const nt of YHn)Object.hasOwn(h,nt.from)&&(""+nt.from+(nt.to?"use `"+nt.to+"` instead":"remove it")+KHn+nt.id,void 0);return h.className&&(o={type:"element",tagName:"div",properties:{className:h.className},children:o.type==="root"?o.children:[o]}),Qjt(o,U),ljn(o,{Fragment:pe.Fragment,components:O,ignoreInvalidStyle:!0,jsx:pe.jsx,jsxs:pe.jsxs,passKeys:!0,passNode:!0});function U(nt,at,it){if(nt.type==="raw"&&it&&typeof at=="number")return B?it.children.splice(at,1):it.children[at]={type:"text",value:nt.value},at;if(nt.type==="element"){let st;for(st in gRt)if(Object.hasOwn(gRt,st)&&Object.hasOwn(nt.properties,st)){const tt=nt.properties[st],Et=gRt[st];(Et===null||Et.includes(nt.tagName))&&(nt.properties[st]=J(String(tt||""),st,nt))}}if(nt.type==="element"){let st=b?!b.includes(nt.tagName):P?P.includes(nt.tagName):!1;if(!st&&k&&typeof at=="number"&&(st=!k(nt,at,it)),st&&it&&typeof at=="number")return G&&nt.children?it.children.splice(at,1,...nt.children):it.children.splice(at,1),at}}}function tzn(o){const h=o.indexOf(":"),b=o.indexOf("?"),k=o.indexOf("#"),O=o.indexOf("/");return h===-1||O!==-1&&h>O||b!==-1&&h>b||k!==-1&&h>k||VHn.test(o.slice(0,h))?o:""}const wAe=/[#.]/g;function ezn(o,h){const b=o||"",k={};let O=0,P,B;for(;O<b.length;){wAe.lastIndex=O;const G=wAe.exec(b),J=b.slice(O,G?G.index:b.length);J&&(P?P==="#"?k.id=J:Array.isArray(k.className)?k.className.push(J):k.className=[J]:B=J,O+=J.length),G&&(P=G[0],O++)}return{type:"element",tagName:B||h||"div",properties:k,children:[]}}function qOe(o,h,b){const k=b?azn(b):void 0;function O(P,B,...G){let J;if(P==null){J={type:"root",children:[]};const U=B;G.unshift(U)}else{J=ezn(P,h);const U=J.tagName.toLowerCase(),nt=k?k.get(U):void 0;if(J.tagName=nt||U,nzn(B))G.unshift(B);else for(const[at,it]of Object.entries(B))rzn(o,J.properties,at,it)}for(const U of G)DBt(J.children,U);return J.type==="element"&&J.tagName==="template"&&(J.content={type:"root",children:J.children},J.children=[]),J}return O}function nzn(o){if(o===null||typeof o!="object"||Array.isArray(o))return!0;if(typeof o.type!="string")return!1;const h=o,b=Object.keys(o);for(const k of b){const O=h[k];if(O&&typeof O=="object"){if(!Array.isArray(O))return!0;const P=O;for(const B of P)if(typeof B!="number"&&typeof B!="string")return!0}}return!!("children"in o&&Array.isArray(o.children))}function rzn(o,h,b,k){const O=kbt(o,b);let P;if(k!=null){if(typeof k=="number"){if(Number.isNaN(k))return;P=k}else typeof k=="boolean"?P=k:typeof k=="string"?O.spaceSeparated?P=PCe(k):O.commaSeparated?P=ICe(k):O.commaOrSpaceSeparated?P=PCe(ICe(k).join(" ")):P=vAe(O,O.property,k):Array.isArray(k)?P=[...k]:P=O.property==="style"?izn(k):String(k);if(Array.isArray(P)){const B=[];for(const G of P)B.push(vAe(O,O.property,G));P=B}O.property==="className"&&Array.isArray(h.className)&&(P=h.className.concat(P)),h[O.property]=P}}function DBt(o,h){if(h!=null)if(typeof h=="number"||typeof h=="string")o.push({type:"text",value:String(h)});else if(Array.isArray(h))for(const b of h)DBt(o,b);else if(typeof h=="object"&&"type"in h)h.type==="root"?DBt(o,h.children):o.push(h);else throw new Error("Expected node, nodes, or string, got `"+h+"`")}function vAe(o,h,b){if(typeof b=="string"){if(o.number&&b&&!Number.isNaN(Number(b)))return Number(b);if((o.boolean||o.overloadedBoolean)&&(b===""||IX(b)===IX(h)))return!0}return b}function izn(o){const h=[];for(const[b,k]of Object.entries(o))h.push([b,k].join(": "));return h.join("; ")}function azn(o){const h=new Map;for(const b of o)h.set(b.toLowerCase(),b);return h}const ozn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],szn=qOe(FX,"div"),czn=qOe(nC,"g",ozn);function uzn(o){const h=String(o),b=[];return{toOffset:O,toPoint:k};function k(P){if(typeof P=="number"&&P>-1&&P<=h.length){let B=0;for(;;){let G=b[B];if(G===void 0){const J=xAe(h,b[B-1]);G=J===-1?h.length+1:J+1,b[B]=G}if(G>P)return{line:B+1,column:P-(B>0?b[B-1]:0)+1,offset:P};B++}}}function O(P){if(P&&typeof P.line=="number"&&typeof P.column=="number"&&!Number.isNaN(P.line)&&!Number.isNaN(P.column)){for(;b.length<P.line;){const G=b[b.length-1],J=xAe(h,G),U=J===-1?h.length+1:J+1;if(G===U)break;b.push(U)}const B=(P.line>1?b[P.line-2]:0)+P.column-1;if(B<b[P.line-1])return B}}}function xAe(o,h){const b=o.indexOf("\r",h),k=o.indexOf(`
3232
+ `,h);return k===-1?b:b===-1||b+1===k?k:b<k?b:k}const qN={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},WOe={}.hasOwnProperty,lzn=Object.prototype;function hzn(o,h){const b=h||{};return tFt({file:b.file||void 0,location:!1,schema:b.space==="svg"?nC:FX,verbose:b.verbose||!1},o)}function tFt(o,h){let b;switch(h.nodeName){case"#comment":{const k=h;return b={type:"comment",value:k.data},Mmt(o,k,b),b}case"#document":case"#document-fragment":{const k=h,O="mode"in k?k.mode==="quirks"||k.mode==="limited-quirks":!1;if(b={type:"root",children:KOe(o,h.childNodes),data:{quirksMode:O}},o.file&&o.location){const P=String(o.file),B=uzn(P),G=B.toPoint(0),J=B.toPoint(P.length);b.position={start:G,end:J}}return b}case"#documentType":{const k=h;return b={type:"doctype"},Mmt(o,k,b),b}case"#text":{const k=h;return b={type:"text",value:k.value},Mmt(o,k,b),b}default:return b=fzn(o,h),b}}function KOe(o,h){let b=-1;const k=[];for(;++b<h.length;){const O=tFt(o,h[b]);k.push(O)}return k}function fzn(o,h){const b=o.schema;o.schema=h.namespaceURI===qN.svg?nC:FX;let k=-1;const O={};for(;++k<h.attrs.length;){const G=h.attrs[k],J=(G.prefix?G.prefix+":":"")+G.name;WOe.call(lzn,J)||(O[J]=G.value)}const B=(o.schema.space==="svg"?czn:szn)(h.tagName,O,KOe(o,h.childNodes));if(Mmt(o,h,B),B.tagName==="template"){const G=h,J=G.sourceCodeLocation,U=J&&J.startTag&&Tj(J.startTag),nt=J&&J.endTag&&Tj(J.endTag),at=tFt(o,G.content);U&&nt&&o.file&&(at.position={start:U.end,end:nt.start}),B.content=at}return o.schema=b,B}function Mmt(o,h,b){if("sourceCodeLocation"in h&&h.sourceCodeLocation&&o.file){const k=dzn(o,b,h.sourceCodeLocation);k&&(o.location=!0,b.position=k)}}function dzn(o,h,b){const k=Tj(b);if(h.type==="element"){const O=h.children[h.children.length-1];if(k&&!b.endTag&&O&&O.position&&O.position.end&&(k.end=Object.assign({},O.position.end)),o.verbose){const P={};let B;if(b.attrs)for(B in b.attrs)WOe.call(b.attrs,B)&&(P[kbt(o.schema,B).property]=Tj(b.attrs[B]));b.startTag;const G=Tj(b.startTag),J=b.endTag?Tj(b.endTag):void 0,U={opening:G};J&&(U.closing=J),U.properties=P,h.data={position:U}}}return k}function Tj(o){const h=kAe({line:o.startLine,column:o.startCol,offset:o.startOffset}),b=kAe({line:o.endLine,column:o.endCol,offset:o.endOffset});return h||b?{start:h,end:b}:void 0}function kAe(o){return o.line&&o.column?o:void 0}class HX{constructor(h,b,k){this.property=h,this.normal=b,k&&(this.space=k)}}HX.prototype.property={};HX.prototype.normal={};HX.prototype.space=null;function VOe(o,h){const b={},k={};let O=-1;for(;++O<o.length;)Object.assign(b,o[O].property),Object.assign(k,o[O].normal);return new HX(b,k,h)}function RBt(o){return o.toLowerCase()}class E3{constructor(h,b){this.property=h,this.attribute=b}}E3.prototype.space=null;E3.prototype.boolean=!1;E3.prototype.booleanish=!1;E3.prototype.overloadedBoolean=!1;E3.prototype.number=!1;E3.prototype.commaSeparated=!1;E3.prototype.spaceSeparated=!1;E3.prototype.commaOrSpaceSeparated=!1;E3.prototype.mustUseProperty=!1;E3.prototype.defined=!1;let pzn=0;const Dc=iP(),op=iP(),YOe=iP(),la=iP(),rf=iP(),Pj=iP(),bw=iP();function iP(){return 2**++pzn}const BBt=Object.freeze(Object.defineProperty({__proto__:null,boolean:Dc,booleanish:op,commaOrSpaceSeparated:bw,commaSeparated:Pj,number:la,overloadedBoolean:YOe,spaceSeparated:rf},Symbol.toStringTag,{value:"Module"})),TRt=Object.keys(BBt);class eFt extends E3{constructor(h,b,k,O){let P=-1;if(super(h,b),_Ae(this,"space",O),typeof k=="number")for(;++P<TRt.length;){const B=TRt[P];_Ae(this,TRt[P],(k&BBt[B])===BBt[B])}}}eFt.prototype.defined=!0;function _Ae(o,h,b){b&&(o[h]=b)}const gzn={}.hasOwnProperty;function Xj(o){const h={},b={};let k;for(k in o.properties)if(gzn.call(o.properties,k)){const O=o.properties[k],P=new eFt(k,o.transform(o.attributes||{},k),O,o.space);o.mustUseProperty&&o.mustUseProperty.includes(k)&&(P.mustUseProperty=!0),h[k]=P,b[RBt(k)]=k,b[RBt(P.attribute)]=k}return new HX(h,b,o.space)}const JOe=Xj({space:"xlink",transform(o,h){return"xlink:"+h.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),XOe=Xj({space:"xml",transform(o,h){return"xml:"+h.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function QOe(o,h){return h in o?o[h]:h}function ZOe(o,h){return QOe(o,h.toLowerCase())}const tNe=Xj({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ZOe,properties:{xmlns:null,xmlnsXLink:null}}),eNe=Xj({transform(o,h){return h==="role"?h:"aria-"+h.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:op,ariaAutoComplete:null,ariaBusy:op,ariaChecked:op,ariaColCount:la,ariaColIndex:la,ariaColSpan:la,ariaControls:rf,ariaCurrent:null,ariaDescribedBy:rf,ariaDetails:null,ariaDisabled:op,ariaDropEffect:rf,ariaErrorMessage:null,ariaExpanded:op,ariaFlowTo:rf,ariaGrabbed:op,ariaHasPopup:null,ariaHidden:op,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rf,ariaLevel:la,ariaLive:null,ariaModal:op,ariaMultiLine:op,ariaMultiSelectable:op,ariaOrientation:null,ariaOwns:rf,ariaPlaceholder:null,ariaPosInSet:la,ariaPressed:op,ariaReadOnly:op,ariaRelevant:null,ariaRequired:op,ariaRoleDescription:rf,ariaRowCount:la,ariaRowIndex:la,ariaRowSpan:la,ariaSelected:op,ariaSetSize:la,ariaSort:null,ariaValueMax:la,ariaValueMin:la,ariaValueNow:la,ariaValueText:null,role:null}}),mzn=Xj({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ZOe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pj,acceptCharset:rf,accessKey:rf,action:null,allow:null,allowFullScreen:Dc,allowPaymentRequest:Dc,allowUserMedia:Dc,alt:null,as:null,async:Dc,autoCapitalize:null,autoComplete:rf,autoFocus:Dc,autoPlay:Dc,blocking:rf,capture:null,charSet:null,checked:Dc,cite:null,className:rf,cols:la,colSpan:null,content:null,contentEditable:op,controls:Dc,controlsList:rf,coords:la|Pj,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Dc,defer:Dc,dir:null,dirName:null,disabled:Dc,download:YOe,draggable:op,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Dc,formTarget:null,headers:rf,height:la,hidden:Dc,high:la,href:null,hrefLang:null,htmlFor:rf,httpEquiv:rf,id:null,imageSizes:null,imageSrcSet:null,inert:Dc,inputMode:null,integrity:null,is:null,isMap:Dc,itemId:null,itemProp:rf,itemRef:rf,itemScope:Dc,itemType:rf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Dc,low:la,manifest:null,max:null,maxLength:la,media:null,method:null,min:null,minLength:la,multiple:Dc,muted:Dc,name:null,nonce:null,noModule:Dc,noValidate:Dc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Dc,optimum:la,pattern:null,ping:rf,placeholder:null,playsInline:Dc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Dc,referrerPolicy:null,rel:rf,required:Dc,reversed:Dc,rows:la,rowSpan:la,sandbox:rf,scope:null,scoped:Dc,seamless:Dc,selected:Dc,shadowRootClonable:Dc,shadowRootDelegatesFocus:Dc,shadowRootMode:null,shape:null,size:la,sizes:null,slot:null,span:la,spellCheck:op,src:null,srcDoc:null,srcLang:null,srcSet:null,start:la,step:null,style:null,tabIndex:la,target:null,title:null,translate:null,type:null,typeMustMatch:Dc,useMap:null,value:op,width:la,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rf,axis:null,background:null,bgColor:null,border:la,borderColor:null,bottomMargin:la,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Dc,declare:Dc,event:null,face:null,frame:null,frameBorder:null,hSpace:la,leftMargin:la,link:null,longDesc:null,lowSrc:null,marginHeight:la,marginWidth:la,noResize:Dc,noHref:Dc,noShade:Dc,noWrap:Dc,object:null,profile:null,prompt:null,rev:null,rightMargin:la,rules:null,scheme:null,scrolling:op,standby:null,summary:null,text:null,topMargin:la,valueType:null,version:null,vAlign:null,vLink:null,vSpace:la,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Dc,disableRemotePlayback:Dc,prefix:null,property:null,results:la,security:null,unselectable:null}}),bzn=Xj({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:QOe,properties:{about:bw,accentHeight:la,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:la,amplitude:la,arabicForm:null,ascent:la,attributeName:null,attributeType:null,azimuth:la,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:la,by:null,calcMode:null,capHeight:la,className:rf,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:la,diffuseConstant:la,direction:null,display:null,dur:null,divisor:la,dominantBaseline:null,download:Dc,dx:null,dy:null,edgeMode:null,editable:null,elevation:la,enableBackground:null,end:null,event:null,exponent:la,externalResourcesRequired:null,fill:null,fillOpacity:la,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pj,g2:Pj,glyphName:Pj,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:la,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:la,horizOriginX:la,horizOriginY:la,id:null,ideographic:la,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:la,k:la,k1:la,k2:la,k3:la,k4:la,kernelMatrix:bw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:la,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:la,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:la,overlineThickness:la,paintOrder:null,panose1:null,path:null,pathLength:la,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:la,pointsAtY:la,pointsAtZ:la,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bw,rev:bw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bw,requiredFeatures:bw,requiredFonts:bw,requiredFormats:bw,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:la,specularExponent:la,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:la,strikethroughThickness:la,string:null,stroke:null,strokeDashArray:bw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:la,strokeOpacity:la,strokeWidth:null,style:null,surfaceScale:la,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bw,tabIndex:la,tableValues:null,target:null,targetX:la,targetY:la,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:la,underlineThickness:la,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:la,values:null,vAlphabetic:la,vMathematical:la,vectorEffect:null,vHanging:la,vIdeographic:la,version:null,vertAdvY:la,vertOriginX:la,vertOriginY:la,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:la,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),yzn=/^data[-\w.:]+$/i,EAe=/-[a-z]/g,wzn=/[A-Z]/g;function vzn(o,h){const b=RBt(h);let k=h,O=E3;if(b in o.normal)return o.property[o.normal[b]];if(b.length>4&&b.slice(0,4)==="data"&&yzn.test(h)){if(h.charAt(4)==="-"){const P=h.slice(5).replace(EAe,kzn);k="data"+P.charAt(0).toUpperCase()+P.slice(1)}else{const P=h.slice(4);if(!EAe.test(P)){let B=P.replace(wzn,xzn);B.charAt(0)!=="-"&&(B="-"+B),h="data"+B}}O=eFt}return new O(k,h)}function xzn(o){return"-"+o.toLowerCase()}function kzn(o){return o.charAt(1).toUpperCase()}const _zn=VOe([XOe,JOe,tNe,eNe,mzn],"html"),nNe=VOe([XOe,JOe,tNe,eNe,bzn],"svg"),TAe={}.hasOwnProperty;function nFt(o,h){const b=h||{};function k(O,...P){let B=k.invalid;const G=k.handlers;if(O&&TAe.call(O,o)){const J=String(O[o]);B=TAe.call(G,J)?G[J]:k.unknown}if(B)return B.call(this,O,...P)}return k.handlers=b.handlers||{},k.invalid=b.invalid,k.unknown=b.unknown,k}const Ezn={},Tzn={}.hasOwnProperty,rNe=nFt("type",{handlers:{root:Izn,element:Pzn,text:Ozn,comment:Nzn,doctype:Azn}});function Szn(o,h){const k=(h||Ezn).space;return rNe(o,k==="svg"?nNe:_zn)}function Izn(o,h){const b={nodeName:"#document",mode:(o.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return b.childNodes=rFt(o.children,b,h),Qj(o,b),b}function Czn(o,h){const b={nodeName:"#document-fragment",childNodes:[]};return b.childNodes=rFt(o.children,b,h),Qj(o,b),b}function Azn(o){const h={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Qj(o,h),h}function Ozn(o){const h={nodeName:"#text",value:o.value,parentNode:null};return Qj(o,h),h}function Nzn(o){const h={nodeName:"#comment",data:o.value,parentNode:null};return Qj(o,h),h}function Pzn(o,h){const b=h;let k=b;o.type==="element"&&o.tagName.toLowerCase()==="svg"&&b.space==="html"&&(k=nNe);const O=[];let P;if(o.properties){for(P in o.properties)if(P!=="children"&&Tzn.call(o.properties,P)){const J=Lzn(k,P,o.properties[P]);J&&O.push(J)}}const B=k.space,G={nodeName:o.tagName,tagName:o.tagName,attrs:O,namespaceURI:qN[B],childNodes:[],parentNode:null};return G.childNodes=rFt(o.children,G,k),Qj(o,G),o.tagName==="template"&&o.content&&(G.content=Czn(o.content,k)),G}function Lzn(o,h,b){const k=vzn(o,h);if(b===!1||b===null||b===void 0||typeof b=="number"&&Number.isNaN(b)||!b&&k.boolean)return;Array.isArray(b)&&(b=k.commaSeparated?jjt(b):$jt(b));const O={name:k.attribute,value:b===!0?"":String(b)};if(k.space&&k.space!=="html"&&k.space!=="svg"){const P=O.name.indexOf(":");P<0?O.prefix="":(O.name=O.name.slice(P+1),O.prefix=k.attribute.slice(0,P)),O.namespace=qN[k.space]}return O}function rFt(o,h,b){let k=-1;const O=[];if(o)for(;++k<o.length;){const P=rNe(o[k],b);P.parentNode=h,O.push(P)}return O}function Qj(o,h){const b=o.position;b&&b.start&&b.end&&(b.start.offset,b.end.offset,h.sourceCodeLocation={startLine:b.start.line,startCol:b.start.column,startOffset:b.start.offset,endLine:b.end.line,endCol:b.end.column,endOffset:b.end.offset})}const iNe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Mzn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Wf="�";var xe;(function(o){o[o.EOF=-1]="EOF",o[o.NULL=0]="NULL",o[o.TABULATION=9]="TABULATION",o[o.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",o[o.LINE_FEED=10]="LINE_FEED",o[o.FORM_FEED=12]="FORM_FEED",o[o.SPACE=32]="SPACE",o[o.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",o[o.QUOTATION_MARK=34]="QUOTATION_MARK",o[o.AMPERSAND=38]="AMPERSAND",o[o.APOSTROPHE=39]="APOSTROPHE",o[o.HYPHEN_MINUS=45]="HYPHEN_MINUS",o[o.SOLIDUS=47]="SOLIDUS",o[o.DIGIT_0=48]="DIGIT_0",o[o.DIGIT_9=57]="DIGIT_9",o[o.SEMICOLON=59]="SEMICOLON",o[o.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",o[o.EQUALS_SIGN=61]="EQUALS_SIGN",o[o.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",o[o.QUESTION_MARK=63]="QUESTION_MARK",o[o.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",o[o.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",o[o.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",o[o.GRAVE_ACCENT=96]="GRAVE_ACCENT",o[o.LATIN_SMALL_A=97]="LATIN_SMALL_A",o[o.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(xe||(xe={}));const U2={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function aNe(o){return o>=55296&&o<=57343}function Dzn(o){return o>=56320&&o<=57343}function Rzn(o,h){return(o-55296)*1024+9216+h}function oNe(o){return o!==32&&o!==10&&o!==13&&o!==9&&o!==12&&o>=1&&o<=31||o>=127&&o<=159}function sNe(o){return o>=64976&&o<=65007||Mzn.has(o)}var Fr;(function(o){o.controlCharacterInInputStream="control-character-in-input-stream",o.noncharacterInInputStream="noncharacter-in-input-stream",o.surrogateInInputStream="surrogate-in-input-stream",o.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",o.endTagWithAttributes="end-tag-with-attributes",o.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",o.unexpectedSolidusInTag="unexpected-solidus-in-tag",o.unexpectedNullCharacter="unexpected-null-character",o.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",o.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",o.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",o.missingEndTagName="missing-end-tag-name",o.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",o.unknownNamedCharacterReference="unknown-named-character-reference",o.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",o.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",o.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",o.eofBeforeTagName="eof-before-tag-name",o.eofInTag="eof-in-tag",o.missingAttributeValue="missing-attribute-value",o.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",o.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",o.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",o.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",o.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",o.missingDoctypePublicIdentifier="missing-doctype-public-identifier",o.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",o.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",o.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",o.cdataInHtmlContent="cdata-in-html-content",o.incorrectlyOpenedComment="incorrectly-opened-comment",o.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",o.eofInDoctype="eof-in-doctype",o.nestedComment="nested-comment",o.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",o.eofInComment="eof-in-comment",o.incorrectlyClosedComment="incorrectly-closed-comment",o.eofInCdata="eof-in-cdata",o.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",o.nullCharacterReference="null-character-reference",o.surrogateCharacterReference="surrogate-character-reference",o.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",o.controlCharacterReference="control-character-reference",o.noncharacterCharacterReference="noncharacter-character-reference",o.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",o.missingDoctypeName="missing-doctype-name",o.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",o.duplicateAttribute="duplicate-attribute",o.nonConformingDoctype="non-conforming-doctype",o.missingDoctype="missing-doctype",o.misplacedDoctype="misplaced-doctype",o.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",o.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",o.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",o.openElementsLeftAfterEof="open-elements-left-after-eof",o.abandonedHeadElementChild="abandoned-head-element-child",o.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",o.nestedNoscriptInHead="nested-noscript-in-head",o.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Fr||(Fr={}));const Bzn=65536;class jzn{constructor(h){this.handler=h,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Bzn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(h,b){const{line:k,col:O,offset:P}=this,B=O+b,G=P+b;return{code:h,startLine:k,endLine:k,startCol:B,endCol:B,startOffset:G,endOffset:G}}_err(h){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(h,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(h){if(this.pos!==this.html.length-1){const b=this.html.charCodeAt(this.pos+1);if(Dzn(b))return this.pos++,this._addGap(),Rzn(h,b)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,xe.EOF;return this._err(Fr.surrogateInInputStream),h}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(h,b){this.html.length>0?this.html+=h:this.html=h,this.endOfChunkHit=!1,this.lastChunkWritten=b}insertHtmlAtCurrentPos(h){this.html=this.html.substring(0,this.pos+1)+h+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(h,b){if(this.pos+h.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(b)return this.html.startsWith(h,this.pos);for(let k=0;k<h.length;k++)if((this.html.charCodeAt(this.pos+k)|32)!==h.charCodeAt(k))return!1;return!0}peek(h){const b=this.pos+h;if(b>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;const k=this.html.charCodeAt(b);return k===xe.CARRIAGE_RETURN?xe.LINE_FEED:k}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;let h=this.html.charCodeAt(this.pos);return h===xe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,xe.LINE_FEED):h===xe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,aNe(h)&&(h=this._processSurrogate(h)),this.handler.onParseError===null||h>31&&h<127||h===xe.LINE_FEED||h===xe.CARRIAGE_RETURN||h>159&&h<64976||this._checkForProblematicCharacters(h),h)}_checkForProblematicCharacters(h){oNe(h)?this._err(Fr.controlCharacterInInputStream):sNe(h)&&this._err(Fr.noncharacterInInputStream)}retreat(h){for(this.pos-=h;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var vu;(function(o){o[o.CHARACTER=0]="CHARACTER",o[o.NULL_CHARACTER=1]="NULL_CHARACTER",o[o.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",o[o.START_TAG=3]="START_TAG",o[o.END_TAG=4]="END_TAG",o[o.COMMENT=5]="COMMENT",o[o.DOCTYPE=6]="DOCTYPE",o[o.EOF=7]="EOF",o[o.HIBERNATION=8]="HIBERNATION"})(vu||(vu={}));function cNe(o,h){for(let b=o.attrs.length-1;b>=0;b--)if(o.attrs[b].name===h)return o.attrs[b].value;return null}const uNe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(o=>o.charCodeAt(0))),Fzn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(o=>o.charCodeAt(0)));var SRt;const $zn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Hzn=(SRt=String.fromCodePoint)!==null&&SRt!==void 0?SRt:function(o){let h="";return o>65535&&(o-=65536,h+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),h+=String.fromCharCode(o),h};function zzn(o){var h;return o>=55296&&o<=57343||o>1114111?65533:(h=$zn.get(o))!==null&&h!==void 0?h:o}var F0;(function(o){o[o.NUM=35]="NUM",o[o.SEMI=59]="SEMI",o[o.EQUALS=61]="EQUALS",o[o.ZERO=48]="ZERO",o[o.NINE=57]="NINE",o[o.LOWER_A=97]="LOWER_A",o[o.LOWER_F=102]="LOWER_F",o[o.LOWER_X=120]="LOWER_X",o[o.LOWER_Z=122]="LOWER_Z",o[o.UPPER_A=65]="UPPER_A",o[o.UPPER_F=70]="UPPER_F",o[o.UPPER_Z=90]="UPPER_Z"})(F0||(F0={}));const Uzn=32;var q8;(function(o){o[o.VALUE_LENGTH=49152]="VALUE_LENGTH",o[o.BRANCH_LENGTH=16256]="BRANCH_LENGTH",o[o.JUMP_TABLE=127]="JUMP_TABLE"})(q8||(q8={}));function jBt(o){return o>=F0.ZERO&&o<=F0.NINE}function Gzn(o){return o>=F0.UPPER_A&&o<=F0.UPPER_F||o>=F0.LOWER_A&&o<=F0.LOWER_F}function qzn(o){return o>=F0.UPPER_A&&o<=F0.UPPER_Z||o>=F0.LOWER_A&&o<=F0.LOWER_Z||jBt(o)}function Wzn(o){return o===F0.EQUALS||qzn(o)}var R0;(function(o){o[o.EntityStart=0]="EntityStart",o[o.NumericStart=1]="NumericStart",o[o.NumericDecimal=2]="NumericDecimal",o[o.NumericHex=3]="NumericHex",o[o.NamedEntity=4]="NamedEntity"})(R0||(R0={}));var tT;(function(o){o[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute"})(tT||(tT={}));class lNe{constructor(h,b,k){this.decodeTree=h,this.emitCodePoint=b,this.errors=k,this.state=R0.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=tT.Strict}startEntity(h){this.decodeMode=h,this.state=R0.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(h,b){switch(this.state){case R0.EntityStart:return h.charCodeAt(b)===F0.NUM?(this.state=R0.NumericStart,this.consumed+=1,this.stateNumericStart(h,b+1)):(this.state=R0.NamedEntity,this.stateNamedEntity(h,b));case R0.NumericStart:return this.stateNumericStart(h,b);case R0.NumericDecimal:return this.stateNumericDecimal(h,b);case R0.NumericHex:return this.stateNumericHex(h,b);case R0.NamedEntity:return this.stateNamedEntity(h,b)}}stateNumericStart(h,b){return b>=h.length?-1:(h.charCodeAt(b)|Uzn)===F0.LOWER_X?(this.state=R0.NumericHex,this.consumed+=1,this.stateNumericHex(h,b+1)):(this.state=R0.NumericDecimal,this.stateNumericDecimal(h,b))}addToNumericResult(h,b,k,O){if(b!==k){const P=k-b;this.result=this.result*Math.pow(O,P)+parseInt(h.substr(b,P),O),this.consumed+=P}}stateNumericHex(h,b){const k=b;for(;b<h.length;){const O=h.charCodeAt(b);if(jBt(O)||Gzn(O))b+=1;else return this.addToNumericResult(h,k,b,16),this.emitNumericEntity(O,3)}return this.addToNumericResult(h,k,b,16),-1}stateNumericDecimal(h,b){const k=b;for(;b<h.length;){const O=h.charCodeAt(b);if(jBt(O))b+=1;else return this.addToNumericResult(h,k,b,10),this.emitNumericEntity(O,2)}return this.addToNumericResult(h,k,b,10),-1}emitNumericEntity(h,b){var k;if(this.consumed<=b)return(k=this.errors)===null||k===void 0||k.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(h===F0.SEMI)this.consumed+=1;else if(this.decodeMode===tT.Strict)return 0;return this.emitCodePoint(zzn(this.result),this.consumed),this.errors&&(h!==F0.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(h,b){const{decodeTree:k}=this;let O=k[this.treeIndex],P=(O&q8.VALUE_LENGTH)>>14;for(;b<h.length;b++,this.excess++){const B=h.charCodeAt(b);if(this.treeIndex=Kzn(k,O,this.treeIndex+Math.max(1,P),B),this.treeIndex<0)return this.result===0||this.decodeMode===tT.Attribute&&(P===0||Wzn(B))?0:this.emitNotTerminatedNamedEntity();if(O=k[this.treeIndex],P=(O&q8.VALUE_LENGTH)>>14,P!==0){if(B===F0.SEMI)return this.emitNamedEntityData(this.treeIndex,P,this.consumed+this.excess);this.decodeMode!==tT.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var h;const{result:b,decodeTree:k}=this,O=(k[b]&q8.VALUE_LENGTH)>>14;return this.emitNamedEntityData(b,O,this.consumed),(h=this.errors)===null||h===void 0||h.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(h,b,k){const{decodeTree:O}=this;return this.emitCodePoint(b===1?O[h]&~q8.VALUE_LENGTH:O[h+1],k),b===3&&this.emitCodePoint(O[h+2],k),k}end(){var h;switch(this.state){case R0.NamedEntity:return this.result!==0&&(this.decodeMode!==tT.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case R0.NumericDecimal:return this.emitNumericEntity(0,2);case R0.NumericHex:return this.emitNumericEntity(0,3);case R0.NumericStart:return(h=this.errors)===null||h===void 0||h.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case R0.EntityStart:return 0}}}function hNe(o){let h="";const b=new lNe(o,k=>h+=Hzn(k));return function(O,P){let B=0,G=0;for(;(G=O.indexOf("&",G))>=0;){h+=O.slice(B,G),b.startEntity(P);const U=b.write(O,G+1);if(U<0){B=G+b.end();break}B=G+U,G=U===0?B+1:B}const J=h+O.slice(B);return h="",J}}function Kzn(o,h,b,k){const O=(h&q8.BRANCH_LENGTH)>>7,P=h&q8.JUMP_TABLE;if(O===0)return P!==0&&k===P?b:-1;if(P){const J=k-P;return J<0||J>=O?-1:o[b+J]-1}let B=b,G=B+O-1;for(;B<=G;){const J=B+G>>>1,U=o[J];if(U<k)B=J+1;else if(U>k)G=J-1;else return o[J+O]}return-1}hNe(uNe);hNe(Fzn);var Bi;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.MATHML="http://www.w3.org/1998/Math/MathML",o.SVG="http://www.w3.org/2000/svg",o.XLINK="http://www.w3.org/1999/xlink",o.XML="http://www.w3.org/XML/1998/namespace",o.XMLNS="http://www.w3.org/2000/xmlns/"})(Bi||(Bi={}));var WN;(function(o){o.TYPE="type",o.ACTION="action",o.ENCODING="encoding",o.PROMPT="prompt",o.NAME="name",o.COLOR="color",o.FACE="face",o.SIZE="size"})(WN||(WN={}));var w3;(function(o){o.NO_QUIRKS="no-quirks",o.QUIRKS="quirks",o.LIMITED_QUIRKS="limited-quirks"})(w3||(w3={}));var ur;(function(o){o.A="a",o.ADDRESS="address",o.ANNOTATION_XML="annotation-xml",o.APPLET="applet",o.AREA="area",o.ARTICLE="article",o.ASIDE="aside",o.B="b",o.BASE="base",o.BASEFONT="basefont",o.BGSOUND="bgsound",o.BIG="big",o.BLOCKQUOTE="blockquote",o.BODY="body",o.BR="br",o.BUTTON="button",o.CAPTION="caption",o.CENTER="center",o.CODE="code",o.COL="col",o.COLGROUP="colgroup",o.DD="dd",o.DESC="desc",o.DETAILS="details",o.DIALOG="dialog",o.DIR="dir",o.DIV="div",o.DL="dl",o.DT="dt",o.EM="em",o.EMBED="embed",o.FIELDSET="fieldset",o.FIGCAPTION="figcaption",o.FIGURE="figure",o.FONT="font",o.FOOTER="footer",o.FOREIGN_OBJECT="foreignObject",o.FORM="form",o.FRAME="frame",o.FRAMESET="frameset",o.H1="h1",o.H2="h2",o.H3="h3",o.H4="h4",o.H5="h5",o.H6="h6",o.HEAD="head",o.HEADER="header",o.HGROUP="hgroup",o.HR="hr",o.HTML="html",o.I="i",o.IMG="img",o.IMAGE="image",o.INPUT="input",o.IFRAME="iframe",o.KEYGEN="keygen",o.LABEL="label",o.LI="li",o.LINK="link",o.LISTING="listing",o.MAIN="main",o.MALIGNMARK="malignmark",o.MARQUEE="marquee",o.MATH="math",o.MENU="menu",o.META="meta",o.MGLYPH="mglyph",o.MI="mi",o.MO="mo",o.MN="mn",o.MS="ms",o.MTEXT="mtext",o.NAV="nav",o.NOBR="nobr",o.NOFRAMES="noframes",o.NOEMBED="noembed",o.NOSCRIPT="noscript",o.OBJECT="object",o.OL="ol",o.OPTGROUP="optgroup",o.OPTION="option",o.P="p",o.PARAM="param",o.PLAINTEXT="plaintext",o.PRE="pre",o.RB="rb",o.RP="rp",o.RT="rt",o.RTC="rtc",o.RUBY="ruby",o.S="s",o.SCRIPT="script",o.SEARCH="search",o.SECTION="section",o.SELECT="select",o.SOURCE="source",o.SMALL="small",o.SPAN="span",o.STRIKE="strike",o.STRONG="strong",o.STYLE="style",o.SUB="sub",o.SUMMARY="summary",o.SUP="sup",o.TABLE="table",o.TBODY="tbody",o.TEMPLATE="template",o.TEXTAREA="textarea",o.TFOOT="tfoot",o.TD="td",o.TH="th",o.THEAD="thead",o.TITLE="title",o.TR="tr",o.TRACK="track",o.TT="tt",o.U="u",o.UL="ul",o.SVG="svg",o.VAR="var",o.WBR="wbr",o.XMP="xmp"})(ur||(ur={}));var dt;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.A=1]="A",o[o.ADDRESS=2]="ADDRESS",o[o.ANNOTATION_XML=3]="ANNOTATION_XML",o[o.APPLET=4]="APPLET",o[o.AREA=5]="AREA",o[o.ARTICLE=6]="ARTICLE",o[o.ASIDE=7]="ASIDE",o[o.B=8]="B",o[o.BASE=9]="BASE",o[o.BASEFONT=10]="BASEFONT",o[o.BGSOUND=11]="BGSOUND",o[o.BIG=12]="BIG",o[o.BLOCKQUOTE=13]="BLOCKQUOTE",o[o.BODY=14]="BODY",o[o.BR=15]="BR",o[o.BUTTON=16]="BUTTON",o[o.CAPTION=17]="CAPTION",o[o.CENTER=18]="CENTER",o[o.CODE=19]="CODE",o[o.COL=20]="COL",o[o.COLGROUP=21]="COLGROUP",o[o.DD=22]="DD",o[o.DESC=23]="DESC",o[o.DETAILS=24]="DETAILS",o[o.DIALOG=25]="DIALOG",o[o.DIR=26]="DIR",o[o.DIV=27]="DIV",o[o.DL=28]="DL",o[o.DT=29]="DT",o[o.EM=30]="EM",o[o.EMBED=31]="EMBED",o[o.FIELDSET=32]="FIELDSET",o[o.FIGCAPTION=33]="FIGCAPTION",o[o.FIGURE=34]="FIGURE",o[o.FONT=35]="FONT",o[o.FOOTER=36]="FOOTER",o[o.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",o[o.FORM=38]="FORM",o[o.FRAME=39]="FRAME",o[o.FRAMESET=40]="FRAMESET",o[o.H1=41]="H1",o[o.H2=42]="H2",o[o.H3=43]="H3",o[o.H4=44]="H4",o[o.H5=45]="H5",o[o.H6=46]="H6",o[o.HEAD=47]="HEAD",o[o.HEADER=48]="HEADER",o[o.HGROUP=49]="HGROUP",o[o.HR=50]="HR",o[o.HTML=51]="HTML",o[o.I=52]="I",o[o.IMG=53]="IMG",o[o.IMAGE=54]="IMAGE",o[o.INPUT=55]="INPUT",o[o.IFRAME=56]="IFRAME",o[o.KEYGEN=57]="KEYGEN",o[o.LABEL=58]="LABEL",o[o.LI=59]="LI",o[o.LINK=60]="LINK",o[o.LISTING=61]="LISTING",o[o.MAIN=62]="MAIN",o[o.MALIGNMARK=63]="MALIGNMARK",o[o.MARQUEE=64]="MARQUEE",o[o.MATH=65]="MATH",o[o.MENU=66]="MENU",o[o.META=67]="META",o[o.MGLYPH=68]="MGLYPH",o[o.MI=69]="MI",o[o.MO=70]="MO",o[o.MN=71]="MN",o[o.MS=72]="MS",o[o.MTEXT=73]="MTEXT",o[o.NAV=74]="NAV",o[o.NOBR=75]="NOBR",o[o.NOFRAMES=76]="NOFRAMES",o[o.NOEMBED=77]="NOEMBED",o[o.NOSCRIPT=78]="NOSCRIPT",o[o.OBJECT=79]="OBJECT",o[o.OL=80]="OL",o[o.OPTGROUP=81]="OPTGROUP",o[o.OPTION=82]="OPTION",o[o.P=83]="P",o[o.PARAM=84]="PARAM",o[o.PLAINTEXT=85]="PLAINTEXT",o[o.PRE=86]="PRE",o[o.RB=87]="RB",o[o.RP=88]="RP",o[o.RT=89]="RT",o[o.RTC=90]="RTC",o[o.RUBY=91]="RUBY",o[o.S=92]="S",o[o.SCRIPT=93]="SCRIPT",o[o.SEARCH=94]="SEARCH",o[o.SECTION=95]="SECTION",o[o.SELECT=96]="SELECT",o[o.SOURCE=97]="SOURCE",o[o.SMALL=98]="SMALL",o[o.SPAN=99]="SPAN",o[o.STRIKE=100]="STRIKE",o[o.STRONG=101]="STRONG",o[o.STYLE=102]="STYLE",o[o.SUB=103]="SUB",o[o.SUMMARY=104]="SUMMARY",o[o.SUP=105]="SUP",o[o.TABLE=106]="TABLE",o[o.TBODY=107]="TBODY",o[o.TEMPLATE=108]="TEMPLATE",o[o.TEXTAREA=109]="TEXTAREA",o[o.TFOOT=110]="TFOOT",o[o.TD=111]="TD",o[o.TH=112]="TH",o[o.THEAD=113]="THEAD",o[o.TITLE=114]="TITLE",o[o.TR=115]="TR",o[o.TRACK=116]="TRACK",o[o.TT=117]="TT",o[o.U=118]="U",o[o.UL=119]="UL",o[o.SVG=120]="SVG",o[o.VAR=121]="VAR",o[o.WBR=122]="WBR",o[o.XMP=123]="XMP"})(dt||(dt={}));const Vzn=new Map([[ur.A,dt.A],[ur.ADDRESS,dt.ADDRESS],[ur.ANNOTATION_XML,dt.ANNOTATION_XML],[ur.APPLET,dt.APPLET],[ur.AREA,dt.AREA],[ur.ARTICLE,dt.ARTICLE],[ur.ASIDE,dt.ASIDE],[ur.B,dt.B],[ur.BASE,dt.BASE],[ur.BASEFONT,dt.BASEFONT],[ur.BGSOUND,dt.BGSOUND],[ur.BIG,dt.BIG],[ur.BLOCKQUOTE,dt.BLOCKQUOTE],[ur.BODY,dt.BODY],[ur.BR,dt.BR],[ur.BUTTON,dt.BUTTON],[ur.CAPTION,dt.CAPTION],[ur.CENTER,dt.CENTER],[ur.CODE,dt.CODE],[ur.COL,dt.COL],[ur.COLGROUP,dt.COLGROUP],[ur.DD,dt.DD],[ur.DESC,dt.DESC],[ur.DETAILS,dt.DETAILS],[ur.DIALOG,dt.DIALOG],[ur.DIR,dt.DIR],[ur.DIV,dt.DIV],[ur.DL,dt.DL],[ur.DT,dt.DT],[ur.EM,dt.EM],[ur.EMBED,dt.EMBED],[ur.FIELDSET,dt.FIELDSET],[ur.FIGCAPTION,dt.FIGCAPTION],[ur.FIGURE,dt.FIGURE],[ur.FONT,dt.FONT],[ur.FOOTER,dt.FOOTER],[ur.FOREIGN_OBJECT,dt.FOREIGN_OBJECT],[ur.FORM,dt.FORM],[ur.FRAME,dt.FRAME],[ur.FRAMESET,dt.FRAMESET],[ur.H1,dt.H1],[ur.H2,dt.H2],[ur.H3,dt.H3],[ur.H4,dt.H4],[ur.H5,dt.H5],[ur.H6,dt.H6],[ur.HEAD,dt.HEAD],[ur.HEADER,dt.HEADER],[ur.HGROUP,dt.HGROUP],[ur.HR,dt.HR],[ur.HTML,dt.HTML],[ur.I,dt.I],[ur.IMG,dt.IMG],[ur.IMAGE,dt.IMAGE],[ur.INPUT,dt.INPUT],[ur.IFRAME,dt.IFRAME],[ur.KEYGEN,dt.KEYGEN],[ur.LABEL,dt.LABEL],[ur.LI,dt.LI],[ur.LINK,dt.LINK],[ur.LISTING,dt.LISTING],[ur.MAIN,dt.MAIN],[ur.MALIGNMARK,dt.MALIGNMARK],[ur.MARQUEE,dt.MARQUEE],[ur.MATH,dt.MATH],[ur.MENU,dt.MENU],[ur.META,dt.META],[ur.MGLYPH,dt.MGLYPH],[ur.MI,dt.MI],[ur.MO,dt.MO],[ur.MN,dt.MN],[ur.MS,dt.MS],[ur.MTEXT,dt.MTEXT],[ur.NAV,dt.NAV],[ur.NOBR,dt.NOBR],[ur.NOFRAMES,dt.NOFRAMES],[ur.NOEMBED,dt.NOEMBED],[ur.NOSCRIPT,dt.NOSCRIPT],[ur.OBJECT,dt.OBJECT],[ur.OL,dt.OL],[ur.OPTGROUP,dt.OPTGROUP],[ur.OPTION,dt.OPTION],[ur.P,dt.P],[ur.PARAM,dt.PARAM],[ur.PLAINTEXT,dt.PLAINTEXT],[ur.PRE,dt.PRE],[ur.RB,dt.RB],[ur.RP,dt.RP],[ur.RT,dt.RT],[ur.RTC,dt.RTC],[ur.RUBY,dt.RUBY],[ur.S,dt.S],[ur.SCRIPT,dt.SCRIPT],[ur.SEARCH,dt.SEARCH],[ur.SECTION,dt.SECTION],[ur.SELECT,dt.SELECT],[ur.SOURCE,dt.SOURCE],[ur.SMALL,dt.SMALL],[ur.SPAN,dt.SPAN],[ur.STRIKE,dt.STRIKE],[ur.STRONG,dt.STRONG],[ur.STYLE,dt.STYLE],[ur.SUB,dt.SUB],[ur.SUMMARY,dt.SUMMARY],[ur.SUP,dt.SUP],[ur.TABLE,dt.TABLE],[ur.TBODY,dt.TBODY],[ur.TEMPLATE,dt.TEMPLATE],[ur.TEXTAREA,dt.TEXTAREA],[ur.TFOOT,dt.TFOOT],[ur.TD,dt.TD],[ur.TH,dt.TH],[ur.THEAD,dt.THEAD],[ur.TITLE,dt.TITLE],[ur.TR,dt.TR],[ur.TRACK,dt.TRACK],[ur.TT,dt.TT],[ur.U,dt.U],[ur.UL,dt.UL],[ur.SVG,dt.SVG],[ur.VAR,dt.VAR],[ur.WBR,dt.WBR],[ur.XMP,dt.XMP]]);function Zj(o){var h;return(h=Vzn.get(o))!==null&&h!==void 0?h:dt.UNKNOWN}const Xi=dt,Yzn={[Bi.HTML]:new Set([Xi.ADDRESS,Xi.APPLET,Xi.AREA,Xi.ARTICLE,Xi.ASIDE,Xi.BASE,Xi.BASEFONT,Xi.BGSOUND,Xi.BLOCKQUOTE,Xi.BODY,Xi.BR,Xi.BUTTON,Xi.CAPTION,Xi.CENTER,Xi.COL,Xi.COLGROUP,Xi.DD,Xi.DETAILS,Xi.DIR,Xi.DIV,Xi.DL,Xi.DT,Xi.EMBED,Xi.FIELDSET,Xi.FIGCAPTION,Xi.FIGURE,Xi.FOOTER,Xi.FORM,Xi.FRAME,Xi.FRAMESET,Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6,Xi.HEAD,Xi.HEADER,Xi.HGROUP,Xi.HR,Xi.HTML,Xi.IFRAME,Xi.IMG,Xi.INPUT,Xi.LI,Xi.LINK,Xi.LISTING,Xi.MAIN,Xi.MARQUEE,Xi.MENU,Xi.META,Xi.NAV,Xi.NOEMBED,Xi.NOFRAMES,Xi.NOSCRIPT,Xi.OBJECT,Xi.OL,Xi.P,Xi.PARAM,Xi.PLAINTEXT,Xi.PRE,Xi.SCRIPT,Xi.SECTION,Xi.SELECT,Xi.SOURCE,Xi.STYLE,Xi.SUMMARY,Xi.TABLE,Xi.TBODY,Xi.TD,Xi.TEMPLATE,Xi.TEXTAREA,Xi.TFOOT,Xi.TH,Xi.THEAD,Xi.TITLE,Xi.TR,Xi.TRACK,Xi.UL,Xi.WBR,Xi.XMP]),[Bi.MATHML]:new Set([Xi.MI,Xi.MO,Xi.MN,Xi.MS,Xi.MTEXT,Xi.ANNOTATION_XML]),[Bi.SVG]:new Set([Xi.TITLE,Xi.FOREIGN_OBJECT,Xi.DESC]),[Bi.XLINK]:new Set,[Bi.XML]:new Set,[Bi.XMLNS]:new Set},FBt=new Set([Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6]);ur.STYLE,ur.SCRIPT,ur.XMP,ur.IFRAME,ur.NOEMBED,ur.NOFRAMES,ur.PLAINTEXT;var He;(function(o){o[o.DATA=0]="DATA",o[o.RCDATA=1]="RCDATA",o[o.RAWTEXT=2]="RAWTEXT",o[o.SCRIPT_DATA=3]="SCRIPT_DATA",o[o.PLAINTEXT=4]="PLAINTEXT",o[o.TAG_OPEN=5]="TAG_OPEN",o[o.END_TAG_OPEN=6]="END_TAG_OPEN",o[o.TAG_NAME=7]="TAG_NAME",o[o.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",o[o.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",o[o.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",o[o.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",o[o.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",o[o.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",o[o.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",o[o.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",o[o.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",o[o.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",o[o.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",o[o.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",o[o.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",o[o.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",o[o.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",o[o.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",o[o.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",o[o.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",o[o.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",o[o.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",o[o.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",o[o.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",o[o.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",o[o.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",o[o.BOGUS_COMMENT=40]="BOGUS_COMMENT",o[o.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",o[o.COMMENT_START=42]="COMMENT_START",o[o.COMMENT_START_DASH=43]="COMMENT_START_DASH",o[o.COMMENT=44]="COMMENT",o[o.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",o[o.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",o[o.COMMENT_END_DASH=49]="COMMENT_END_DASH",o[o.COMMENT_END=50]="COMMENT_END",o[o.COMMENT_END_BANG=51]="COMMENT_END_BANG",o[o.DOCTYPE=52]="DOCTYPE",o[o.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",o[o.DOCTYPE_NAME=54]="DOCTYPE_NAME",o[o.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",o[o.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",o[o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",o[o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",o[o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",o[o.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",o[o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",o[o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",o[o.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",o[o.CDATA_SECTION=68]="CDATA_SECTION",o[o.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",o[o.CDATA_SECTION_END=70]="CDATA_SECTION_END",o[o.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",o[o.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(He||(He={}));const C1={DATA:He.DATA,RCDATA:He.RCDATA,RAWTEXT:He.RAWTEXT,SCRIPT_DATA:He.SCRIPT_DATA,PLAINTEXT:He.PLAINTEXT,CDATA_SECTION:He.CDATA_SECTION};function Jzn(o){return o>=xe.DIGIT_0&&o<=xe.DIGIT_9}function sX(o){return o>=xe.LATIN_CAPITAL_A&&o<=xe.LATIN_CAPITAL_Z}function Xzn(o){return o>=xe.LATIN_SMALL_A&&o<=xe.LATIN_SMALL_Z}function U8(o){return Xzn(o)||sX(o)}function SAe(o){return U8(o)||Jzn(o)}function vmt(o){return o+32}function fNe(o){return o===xe.SPACE||o===xe.LINE_FEED||o===xe.TABULATION||o===xe.FORM_FEED}function IAe(o){return fNe(o)||o===xe.SOLIDUS||o===xe.GREATER_THAN_SIGN}function Qzn(o){return o===xe.NULL?Fr.nullCharacterReference:o>1114111?Fr.characterReferenceOutsideUnicodeRange:aNe(o)?Fr.surrogateCharacterReference:sNe(o)?Fr.noncharacterCharacterReference:oNe(o)||o===xe.CARRIAGE_RETURN?Fr.controlCharacterReference:null}class Zzn{constructor(h,b){this.options=h,this.handler=b,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=He.DATA,this.returnState=He.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new jzn(b),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new lNe(uNe,(k,O)=>{this.preprocessor.pos=this.entityStartPos+O-1,this._flushCodePointConsumedAsCharacterReference(k)},b.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Fr.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:k=>{this._err(Fr.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+k)},validateNumericCharacterReference:k=>{const O=Qzn(k);O&&this._err(O,1)}}:void 0)}_err(h,b=0){var k,O;(O=(k=this.handler).onParseError)===null||O===void 0||O.call(k,this.preprocessor.getError(h,b))}getCurrentLocation(h){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-h,startOffset:this.preprocessor.offset-h,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const h=this._consume();this._ensureHibernation()||this._callState(h)}this.inLoop=!1}}pause(){this.paused=!0}resume(h){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||h==null||h())}write(h,b,k){this.active=!0,this.preprocessor.write(h,b),this._runParsingLoop(),this.paused||k==null||k()}insertHtmlAtCurrentPos(h){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(h),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(h){this.consumedAfterSnapshot+=h;for(let b=0;b<h;b++)this.preprocessor.advance()}_consumeSequenceIfMatch(h,b){return this.preprocessor.startsWith(h,b)?(this._advanceBy(h.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:vu.START_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:vu.END_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(h){this.currentToken={type:vu.COMMENT,data:"",location:this.getCurrentLocation(h)}}_createDoctypeToken(h){this.currentToken={type:vu.DOCTYPE,name:h,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(h,b){this.currentCharacterToken={type:h,chars:b,location:this.currentLocation}}_createAttr(h){this.currentAttr={name:h,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var h,b;const k=this.currentToken;if(cNe(k,this.currentAttr.name)===null){if(k.attrs.push(this.currentAttr),k.location&&this.currentLocation){const O=(h=(b=k.location).attrs)!==null&&h!==void 0?h:b.attrs=Object.create(null);O[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Fr.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(h){this._emitCurrentCharacterToken(h.location),this.currentToken=null,h.location&&(h.location.endLine=this.preprocessor.line,h.location.endCol=this.preprocessor.col+1,h.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const h=this.currentToken;this.prepareToken(h),h.tagID=Zj(h.tagName),h.type===vu.START_TAG?(this.lastStartTagName=h.tagName,this.handler.onStartTag(h)):(h.attrs.length>0&&this._err(Fr.endTagWithAttributes),h.selfClosing&&this._err(Fr.endTagWithTrailingSolidus),this.handler.onEndTag(h)),this.preprocessor.dropParsedChunk()}emitCurrentComment(h){this.prepareToken(h),this.handler.onComment(h),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(h){this.prepareToken(h),this.handler.onDoctype(h),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(h){if(this.currentCharacterToken){switch(h&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=h.startLine,this.currentCharacterToken.location.endCol=h.startCol,this.currentCharacterToken.location.endOffset=h.startOffset),this.currentCharacterToken.type){case vu.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case vu.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case vu.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const h=this.getCurrentLocation(0);h&&(h.endLine=h.startLine,h.endCol=h.startCol,h.endOffset=h.startOffset),this._emitCurrentCharacterToken(h),this.handler.onEof({type:vu.EOF,location:h}),this.active=!1}_appendCharToCurrentCharacterToken(h,b){if(this.currentCharacterToken)if(this.currentCharacterToken.type===h){this.currentCharacterToken.chars+=b;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(h,b)}_emitCodePoint(h){const b=fNe(h)?vu.WHITESPACE_CHARACTER:h===xe.NULL?vu.NULL_CHARACTER:vu.CHARACTER;this._appendCharToCurrentCharacterToken(b,String.fromCodePoint(h))}_emitChars(h){this._appendCharToCurrentCharacterToken(vu.CHARACTER,h)}_startCharacterReference(){this.returnState=this.state,this.state=He.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?tT.Attribute:tT.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===He.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===He.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===He.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(h){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(h):this._emitCodePoint(h)}_callState(h){switch(this.state){case He.DATA:{this._stateData(h);break}case He.RCDATA:{this._stateRcdata(h);break}case He.RAWTEXT:{this._stateRawtext(h);break}case He.SCRIPT_DATA:{this._stateScriptData(h);break}case He.PLAINTEXT:{this._statePlaintext(h);break}case He.TAG_OPEN:{this._stateTagOpen(h);break}case He.END_TAG_OPEN:{this._stateEndTagOpen(h);break}case He.TAG_NAME:{this._stateTagName(h);break}case He.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(h);break}case He.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(h);break}case He.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(h);break}case He.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(h);break}case He.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(h);break}case He.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(h);break}case He.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(h);break}case He.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(h);break}case He.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(h);break}case He.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(h);break}case He.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(h);break}case He.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(h);break}case He.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(h);break}case He.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(h);break}case He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(h);break}case He.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(h);break}case He.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(h);break}case He.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(h);break}case He.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(h);break}case He.ATTRIBUTE_NAME:{this._stateAttributeName(h);break}case He.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(h);break}case He.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(h);break}case He.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(h);break}case He.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(h);break}case He.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(h);break}case He.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(h);break}case He.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(h);break}case He.BOGUS_COMMENT:{this._stateBogusComment(h);break}case He.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(h);break}case He.COMMENT_START:{this._stateCommentStart(h);break}case He.COMMENT_START_DASH:{this._stateCommentStartDash(h);break}case He.COMMENT:{this._stateComment(h);break}case He.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(h);break}case He.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(h);break}case He.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(h);break}case He.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(h);break}case He.COMMENT_END_DASH:{this._stateCommentEndDash(h);break}case He.COMMENT_END:{this._stateCommentEnd(h);break}case He.COMMENT_END_BANG:{this._stateCommentEndBang(h);break}case He.DOCTYPE:{this._stateDoctype(h);break}case He.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(h);break}case He.DOCTYPE_NAME:{this._stateDoctypeName(h);break}case He.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(h);break}case He.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(h);break}case He.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(h);break}case He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(h);break}case He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(h);break}case He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(h);break}case He.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(h);break}case He.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(h);break}case He.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(h);break}case He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(h);break}case He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(h);break}case He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(h);break}case He.BOGUS_DOCTYPE:{this._stateBogusDoctype(h);break}case He.CDATA_SECTION:{this._stateCdataSection(h);break}case He.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(h);break}case He.CDATA_SECTION_END:{this._stateCdataSectionEnd(h);break}case He.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case He.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(h);break}default:throw new Error("Unknown state")}}_stateData(h){switch(h){case xe.LESS_THAN_SIGN:{this.state=He.TAG_OPEN;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitCodePoint(h);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateRcdata(h){switch(h){case xe.AMPERSAND:{this._startCharacterReference();break}case xe.LESS_THAN_SIGN:{this.state=He.RCDATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateRawtext(h){switch(h){case xe.LESS_THAN_SIGN:{this.state=He.RAWTEXT_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateScriptData(h){switch(h){case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_statePlaintext(h){switch(h){case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateTagOpen(h){if(U8(h))this._createStartTagToken(),this.state=He.TAG_NAME,this._stateTagName(h);else switch(h){case xe.EXCLAMATION_MARK:{this.state=He.MARKUP_DECLARATION_OPEN;break}case xe.SOLIDUS:{this.state=He.END_TAG_OPEN;break}case xe.QUESTION_MARK:{this._err(Fr.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=He.BOGUS_COMMENT,this._stateBogusComment(h);break}case xe.EOF:{this._err(Fr.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Fr.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=He.DATA,this._stateData(h)}}_stateEndTagOpen(h){if(U8(h))this._createEndTagToken(),this.state=He.TAG_NAME,this._stateTagName(h);else switch(h){case xe.GREATER_THAN_SIGN:{this._err(Fr.missingEndTagName),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Fr.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=He.BOGUS_COMMENT,this._stateBogusComment(h)}}_stateTagName(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_ATTRIBUTE_NAME;break}case xe.SOLIDUS:{this.state=He.SELF_CLOSING_START_TAG;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentTagToken();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.tagName+=Wf;break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:b.tagName+=String.fromCodePoint(sX(h)?vmt(h):h)}}_stateRcdataLessThanSign(h){h===xe.SOLIDUS?this.state=He.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=He.RCDATA,this._stateRcdata(h))}_stateRcdataEndTagOpen(h){U8(h)?(this.state=He.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(h)):(this._emitChars("</"),this.state=He.RCDATA,this._stateRcdata(h))}handleSpecialEndTag(h){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const b=this.currentToken;switch(b.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=He.BEFORE_ATTRIBUTE_NAME,!1;case xe.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=He.SELF_CLOSING_START_TAG,!1;case xe.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=He.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.RCDATA,this._stateRcdata(h))}_stateRawtextLessThanSign(h){h===xe.SOLIDUS?this.state=He.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=He.RAWTEXT,this._stateRawtext(h))}_stateRawtextEndTagOpen(h){U8(h)?(this.state=He.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(h)):(this._emitChars("</"),this.state=He.RAWTEXT,this._stateRawtext(h))}_stateRawtextEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.RAWTEXT,this._stateRawtext(h))}_stateScriptDataLessThanSign(h){switch(h){case xe.SOLIDUS:{this.state=He.SCRIPT_DATA_END_TAG_OPEN;break}case xe.EXCLAMATION_MARK:{this.state=He.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=He.SCRIPT_DATA,this._stateScriptData(h)}}_stateScriptDataEndTagOpen(h){U8(h)?(this.state=He.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(h)):(this._emitChars("</"),this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEscapeStart(h){h===xe.HYPHEN_MINUS?(this.state=He.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEscapeStartDash(h){h===xe.HYPHEN_MINUS?(this.state=He.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=He.SCRIPT_DATA,this._stateScriptData(h))}_stateScriptDataEscaped(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateScriptDataEscapedDash(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataEscapedDashDash(h){switch(h){case xe.HYPHEN_MINUS:{this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case xe.GREATER_THAN_SIGN:{this.state=He.SCRIPT_DATA,this._emitChars(">");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataEscapedLessThanSign(h){h===xe.SOLIDUS?this.state=He.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:U8(h)?(this._emitChars("<"),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(h)):(this._emitChars("<"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataEscapedEndTagOpen(h){U8(h)?(this.state=He.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(h)):(this._emitChars("</"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataEscapedEndTagName(h){this.handleSpecialEndTag(h)&&(this._emitChars("</"),this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataDoubleEscapeStart(h){if(this.preprocessor.startsWith(U2.SCRIPT,!1)&&IAe(this.preprocessor.peek(U2.SCRIPT.length))){this._emitCodePoint(h);for(let b=0;b<U2.SCRIPT.length;b++)this._emitCodePoint(this._consume());this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=He.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(h))}_stateScriptDataDoubleEscaped(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateScriptDataDoubleEscapedDash(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataDoubleEscapedDashDash(h){switch(h){case xe.HYPHEN_MINUS:{this._emitChars("-");break}case xe.LESS_THAN_SIGN:{this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case xe.GREATER_THAN_SIGN:{this.state=He.SCRIPT_DATA,this._emitChars(">");break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Wf);break}case xe.EOF:{this._err(Fr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(h)}}_stateScriptDataDoubleEscapedLessThanSign(h){h===xe.SOLIDUS?(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(h))}_stateScriptDataDoubleEscapeEnd(h){if(this.preprocessor.startsWith(U2.SCRIPT,!1)&&IAe(this.preprocessor.peek(U2.SCRIPT.length))){this._emitCodePoint(h);for(let b=0;b<U2.SCRIPT.length;b++)this._emitCodePoint(this._consume());this.state=He.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=He.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(h))}_stateBeforeAttributeName(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.SOLIDUS:case xe.GREATER_THAN_SIGN:case xe.EOF:{this.state=He.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(h);break}case xe.EQUALS_SIGN:{this._err(Fr.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=He.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=He.ATTRIBUTE_NAME,this._stateAttributeName(h)}}_stateAttributeName(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:case xe.SOLIDUS:case xe.GREATER_THAN_SIGN:case xe.EOF:{this._leaveAttrName(),this.state=He.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(h);break}case xe.EQUALS_SIGN:{this._leaveAttrName(),this.state=He.BEFORE_ATTRIBUTE_VALUE;break}case xe.QUOTATION_MARK:case xe.APOSTROPHE:case xe.LESS_THAN_SIGN:{this._err(Fr.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(h);break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.name+=Wf;break}default:this.currentAttr.name+=String.fromCodePoint(sX(h)?vmt(h):h)}}_stateAfterAttributeName(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.SOLIDUS:{this.state=He.SELF_CLOSING_START_TAG;break}case xe.EQUALS_SIGN:{this.state=He.BEFORE_ATTRIBUTE_VALUE;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentTagToken();break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=He.ATTRIBUTE_NAME,this._stateAttributeName(h)}}_stateBeforeAttributeValue(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.QUOTATION_MARK:{this.state=He.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this.state=He.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingAttributeValue),this.state=He.DATA,this.emitCurrentTagToken();break}default:this.state=He.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(h)}}_stateAttributeValueDoubleQuoted(h){switch(h){case xe.QUOTATION_MARK:{this.state=He.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.value+=Wf;break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(h)}}_stateAttributeValueSingleQuoted(h){switch(h){case xe.APOSTROPHE:{this.state=He.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.value+=Wf;break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(h)}}_stateAttributeValueUnquoted(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this._leaveAttrValue(),this.state=He.BEFORE_ATTRIBUTE_NAME;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=He.DATA,this.emitCurrentTagToken();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this.currentAttr.value+=Wf;break}case xe.QUOTATION_MARK:case xe.APOSTROPHE:case xe.LESS_THAN_SIGN:case xe.EQUALS_SIGN:case xe.GRAVE_ACCENT:{this._err(Fr.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(h);break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(h)}}_stateAfterAttributeValueQuoted(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this._leaveAttrValue(),this.state=He.BEFORE_ATTRIBUTE_NAME;break}case xe.SOLIDUS:{this._leaveAttrValue(),this.state=He.SELF_CLOSING_START_TAG;break}case xe.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=He.DATA,this.emitCurrentTagToken();break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this._err(Fr.missingWhitespaceBetweenAttributes),this.state=He.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(h)}}_stateSelfClosingStartTag(h){switch(h){case xe.GREATER_THAN_SIGN:{const b=this.currentToken;b.selfClosing=!0,this.state=He.DATA,this.emitCurrentTagToken();break}case xe.EOF:{this._err(Fr.eofInTag),this._emitEOFToken();break}default:this._err(Fr.unexpectedSolidusInTag),this.state=He.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(h)}}_stateBogusComment(h){const b=this.currentToken;switch(h){case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EOF:{this.emitCurrentComment(b),this._emitEOFToken();break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.data+=Wf;break}default:b.data+=String.fromCodePoint(h)}}_stateMarkupDeclarationOpen(h){this._consumeSequenceIfMatch(U2.DASH_DASH,!0)?(this._createCommentToken(U2.DASH_DASH.length+1),this.state=He.COMMENT_START):this._consumeSequenceIfMatch(U2.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(U2.DOCTYPE.length+1),this.state=He.DOCTYPE):this._consumeSequenceIfMatch(U2.CDATA_START,!0)?this.inForeignNode?this.state=He.CDATA_SECTION:(this._err(Fr.cdataInHtmlContent),this._createCommentToken(U2.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=He.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Fr.incorrectlyOpenedComment),this._createCommentToken(2),this.state=He.BOGUS_COMMENT,this._stateBogusComment(h))}_stateCommentStart(h){switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_START_DASH;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptClosingOfEmptyComment),this.state=He.DATA;const b=this.currentToken;this.emitCurrentComment(b);break}default:this.state=He.COMMENT,this._stateComment(h)}}_stateCommentStartDash(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_END;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptClosingOfEmptyComment),this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="-",this.state=He.COMMENT,this._stateComment(h)}}_stateComment(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_END_DASH;break}case xe.LESS_THAN_SIGN:{b.data+="<",this.state=He.COMMENT_LESS_THAN_SIGN;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.data+=Wf;break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+=String.fromCodePoint(h)}}_stateCommentLessThanSign(h){const b=this.currentToken;switch(h){case xe.EXCLAMATION_MARK:{b.data+="!",this.state=He.COMMENT_LESS_THAN_SIGN_BANG;break}case xe.LESS_THAN_SIGN:{b.data+="<";break}default:this.state=He.COMMENT,this._stateComment(h)}}_stateCommentLessThanSignBang(h){h===xe.HYPHEN_MINUS?this.state=He.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=He.COMMENT,this._stateComment(h))}_stateCommentLessThanSignBangDash(h){h===xe.HYPHEN_MINUS?this.state=He.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=He.COMMENT_END_DASH,this._stateCommentEndDash(h))}_stateCommentLessThanSignBangDashDash(h){h!==xe.GREATER_THAN_SIGN&&h!==xe.EOF&&this._err(Fr.nestedComment),this.state=He.COMMENT_END,this._stateCommentEnd(h)}_stateCommentEndDash(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{this.state=He.COMMENT_END;break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="-",this.state=He.COMMENT,this._stateComment(h)}}_stateCommentEnd(h){const b=this.currentToken;switch(h){case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EXCLAMATION_MARK:{this.state=He.COMMENT_END_BANG;break}case xe.HYPHEN_MINUS:{b.data+="-";break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="--",this.state=He.COMMENT,this._stateComment(h)}}_stateCommentEndBang(h){const b=this.currentToken;switch(h){case xe.HYPHEN_MINUS:{b.data+="--!",this.state=He.COMMENT_END_DASH;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.incorrectlyClosedComment),this.state=He.DATA,this.emitCurrentComment(b);break}case xe.EOF:{this._err(Fr.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break}default:b.data+="--!",this.state=He.COMMENT,this._stateComment(h)}}_stateDoctype(h){switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_NAME;break}case xe.GREATER_THAN_SIGN:{this.state=He.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(h);break}case xe.EOF:{this._err(Fr.eofInDoctype),this._createDoctypeToken(null);const b=this.currentToken;b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingWhitespaceBeforeDoctypeName),this.state=He.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(h)}}_stateBeforeDoctypeName(h){if(sX(h))this._createDoctypeToken(String.fromCharCode(vmt(h))),this.state=He.DOCTYPE_NAME;else switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.NULL:{this._err(Fr.unexpectedNullCharacter),this._createDoctypeToken(Wf),this.state=He.DOCTYPE_NAME;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypeName),this._createDoctypeToken(null);const b=this.currentToken;b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),this._createDoctypeToken(null);const b=this.currentToken;b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(h)),this.state=He.DOCTYPE_NAME}}_stateDoctypeName(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.AFTER_DOCTYPE_NAME;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.name+=Wf;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.name+=String.fromCodePoint(sX(h)?vmt(h):h)}}_stateAfterDoctypeName(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(U2.PUBLIC,!1)?this.state=He.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(U2.SYSTEM,!1)?this.state=He.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Fr.invalidCharacterSequenceAfterDoctypeName),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h))}}_stateAfterDoctypePublicKeyword(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case xe.QUOTATION_MARK:{this._err(Fr.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this._err(Fr.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBeforeDoctypePublicIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.QUOTATION_MARK:{b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{b.publicId="",this.state=He.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateDoctypePublicIdentifierDoubleQuoted(h){const b=this.currentToken;switch(h){case xe.QUOTATION_MARK:{this.state=He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.publicId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.publicId+=String.fromCodePoint(h)}}_stateDoctypePublicIdentifierSingleQuoted(h){const b=this.currentToken;switch(h){case xe.APOSTROPHE:{this.state=He.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.publicId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.publicId+=String.fromCodePoint(h)}}_stateAfterDoctypePublicIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case xe.GREATER_THAN_SIGN:{this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.QUOTATION_MARK:{this._err(Fr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this._err(Fr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBetweenDoctypePublicAndSystemIdentifiers(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.GREATER_THAN_SIGN:{this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.QUOTATION_MARK:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateAfterDoctypeSystemKeyword(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:{this.state=He.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case xe.QUOTATION_MARK:{this._err(Fr.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{this._err(Fr.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBeforeDoctypeSystemIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.QUOTATION_MARK:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case xe.APOSTROPHE:{b.systemId="",this.state=He.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.DATA,this.emitCurrentDoctype(b);break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateDoctypeSystemIdentifierDoubleQuoted(h){const b=this.currentToken;switch(h){case xe.QUOTATION_MARK:{this.state=He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.systemId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.systemId+=String.fromCodePoint(h)}}_stateDoctypeSystemIdentifierSingleQuoted(h){const b=this.currentToken;switch(h){case xe.APOSTROPHE:{this.state=He.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter),b.systemId+=Wf;break}case xe.GREATER_THAN_SIGN:{this._err(Fr.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:b.systemId+=String.fromCodePoint(h)}}_stateAfterDoctypeSystemIdentifier(h){const b=this.currentToken;switch(h){case xe.SPACE:case xe.LINE_FEED:case xe.TABULATION:case xe.FORM_FEED:break;case xe.GREATER_THAN_SIGN:{this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.EOF:{this._err(Fr.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break}default:this._err(Fr.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=He.BOGUS_DOCTYPE,this._stateBogusDoctype(h)}}_stateBogusDoctype(h){const b=this.currentToken;switch(h){case xe.GREATER_THAN_SIGN:{this.emitCurrentDoctype(b),this.state=He.DATA;break}case xe.NULL:{this._err(Fr.unexpectedNullCharacter);break}case xe.EOF:{this.emitCurrentDoctype(b),this._emitEOFToken();break}}}_stateCdataSection(h){switch(h){case xe.RIGHT_SQUARE_BRACKET:{this.state=He.CDATA_SECTION_BRACKET;break}case xe.EOF:{this._err(Fr.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(h)}}_stateCdataSectionBracket(h){h===xe.RIGHT_SQUARE_BRACKET?this.state=He.CDATA_SECTION_END:(this._emitChars("]"),this.state=He.CDATA_SECTION,this._stateCdataSection(h))}_stateCdataSectionEnd(h){switch(h){case xe.GREATER_THAN_SIGN:{this.state=He.DATA;break}case xe.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=He.CDATA_SECTION,this._stateCdataSection(h)}}_stateCharacterReference(){let h=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(h<0)if(this.preprocessor.lastChunkWritten)h=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}h===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(xe.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&SAe(this.preprocessor.peek(1))?He.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(h){SAe(h)?this._flushCodePointConsumedAsCharacterReference(h):(h===xe.SEMICOLON&&this._err(Fr.unknownNamedCharacterReference),this.state=this.returnState,this._callState(h))}}const dNe=new Set([dt.DD,dt.DT,dt.LI,dt.OPTGROUP,dt.OPTION,dt.P,dt.RB,dt.RP,dt.RT,dt.RTC]),CAe=new Set([...dNe,dt.CAPTION,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]),Jmt=new Set([dt.APPLET,dt.CAPTION,dt.HTML,dt.MARQUEE,dt.OBJECT,dt.TABLE,dt.TD,dt.TEMPLATE,dt.TH]),tUn=new Set([...Jmt,dt.OL,dt.UL]),eUn=new Set([...Jmt,dt.BUTTON]),AAe=new Set([dt.ANNOTATION_XML,dt.MI,dt.MN,dt.MO,dt.MS,dt.MTEXT]),OAe=new Set([dt.DESC,dt.FOREIGN_OBJECT,dt.TITLE]),nUn=new Set([dt.TR,dt.TEMPLATE,dt.HTML]),rUn=new Set([dt.TBODY,dt.TFOOT,dt.THEAD,dt.TEMPLATE,dt.HTML]),iUn=new Set([dt.TABLE,dt.TEMPLATE,dt.HTML]),aUn=new Set([dt.TD,dt.TH]);class oUn{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(h,b,k){this.treeAdapter=b,this.handler=k,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=dt.UNKNOWN,this.current=h}_indexOf(h){return this.items.lastIndexOf(h,this.stackTop)}_isInTemplate(){return this.currentTagId===dt.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Bi.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(h,b){this.stackTop++,this.items[this.stackTop]=h,this.current=h,this.tagIDs[this.stackTop]=b,this.currentTagId=b,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(h,b,!0)}pop(){const h=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(h,!0)}replace(h,b){const k=this._indexOf(h);this.items[k]=b,k===this.stackTop&&(this.current=b)}insertAfter(h,b,k){const O=this._indexOf(h)+1;this.items.splice(O,0,b),this.tagIDs.splice(O,0,k),this.stackTop++,O===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,O===this.stackTop)}popUntilTagNamePopped(h){let b=this.stackTop+1;do b=this.tagIDs.lastIndexOf(h,b-1);while(b>0&&this.treeAdapter.getNamespaceURI(this.items[b])!==Bi.HTML);this.shortenToLength(b<0?0:b)}shortenToLength(h){for(;this.stackTop>=h;){const b=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(b,this.stackTop<h)}}popUntilElementPopped(h){const b=this._indexOf(h);this.shortenToLength(b<0?0:b)}popUntilPopped(h,b){const k=this._indexOfTagNames(h,b);this.shortenToLength(k<0?0:k)}popUntilNumberedHeaderPopped(){this.popUntilPopped(FBt,Bi.HTML)}popUntilTableCellPopped(){this.popUntilPopped(aUn,Bi.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(h,b){for(let k=this.stackTop;k>=0;k--)if(h.has(this.tagIDs[k])&&this.treeAdapter.getNamespaceURI(this.items[k])===b)return k;return-1}clearBackTo(h,b){const k=this._indexOfTagNames(h,b);this.shortenToLength(k+1)}clearBackToTableContext(){this.clearBackTo(iUn,Bi.HTML)}clearBackToTableBodyContext(){this.clearBackTo(rUn,Bi.HTML)}clearBackToTableRowContext(){this.clearBackTo(nUn,Bi.HTML)}remove(h){const b=this._indexOf(h);b>=0&&(b===this.stackTop?this.pop():(this.items.splice(b,1),this.tagIDs.splice(b,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(h,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===dt.BODY?this.items[1]:null}contains(h){return this._indexOf(h)>-1}getCommonAncestor(h){const b=this._indexOf(h)-1;return b>=0?this.items[b]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===dt.HTML}hasInDynamicScope(h,b){for(let k=this.stackTop;k>=0;k--){const O=this.tagIDs[k];switch(this.treeAdapter.getNamespaceURI(this.items[k])){case Bi.HTML:{if(O===h)return!0;if(b.has(O))return!1;break}case Bi.SVG:{if(OAe.has(O))return!1;break}case Bi.MATHML:{if(AAe.has(O))return!1;break}}}return!0}hasInScope(h){return this.hasInDynamicScope(h,Jmt)}hasInListItemScope(h){return this.hasInDynamicScope(h,tUn)}hasInButtonScope(h){return this.hasInDynamicScope(h,eUn)}hasNumberedHeaderInScope(){for(let h=this.stackTop;h>=0;h--){const b=this.tagIDs[h];switch(this.treeAdapter.getNamespaceURI(this.items[h])){case Bi.HTML:{if(FBt.has(b))return!0;if(Jmt.has(b))return!1;break}case Bi.SVG:{if(OAe.has(b))return!1;break}case Bi.MATHML:{if(AAe.has(b))return!1;break}}}return!0}hasInTableScope(h){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===Bi.HTML)switch(this.tagIDs[b]){case h:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let h=this.stackTop;h>=0;h--)if(this.treeAdapter.getNamespaceURI(this.items[h])===Bi.HTML)switch(this.tagIDs[h]){case dt.TBODY:case dt.THEAD:case dt.TFOOT:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasInSelectScope(h){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===Bi.HTML)switch(this.tagIDs[b]){case h:return!0;case dt.OPTION:case dt.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;dNe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;CAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(h){for(;this.currentTagId!==h&&CAe.has(this.currentTagId);)this.pop()}}const IRt=3;var l6;(function(o){o[o.Marker=0]="Marker",o[o.Element=1]="Element"})(l6||(l6={}));const NAe={type:l6.Marker};class sUn{constructor(h){this.treeAdapter=h,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(h,b){const k=[],O=b.length,P=this.treeAdapter.getTagName(h),B=this.treeAdapter.getNamespaceURI(h);for(let G=0;G<this.entries.length;G++){const J=this.entries[G];if(J.type===l6.Marker)break;const{element:U}=J;if(this.treeAdapter.getTagName(U)===P&&this.treeAdapter.getNamespaceURI(U)===B){const nt=this.treeAdapter.getAttrList(U);nt.length===O&&k.push({idx:G,attrs:nt})}}return k}_ensureNoahArkCondition(h){if(this.entries.length<IRt)return;const b=this.treeAdapter.getAttrList(h),k=this._getNoahArkConditionCandidates(h,b);if(k.length<IRt)return;const O=new Map(b.map(B=>[B.name,B.value]));let P=0;for(let B=0;B<k.length;B++){const G=k[B];G.attrs.every(J=>O.get(J.name)===J.value)&&(P+=1,P>=IRt&&this.entries.splice(G.idx,1))}}insertMarker(){this.entries.unshift(NAe)}pushElement(h,b){this._ensureNoahArkCondition(h),this.entries.unshift({type:l6.Element,element:h,token:b})}insertElementAfterBookmark(h,b){const k=this.entries.indexOf(this.bookmark);this.entries.splice(k,0,{type:l6.Element,element:h,token:b})}removeEntry(h){const b=this.entries.indexOf(h);b>=0&&this.entries.splice(b,1)}clearToLastMarker(){const h=this.entries.indexOf(NAe);h>=0?this.entries.splice(0,h+1):this.entries.length=0}getElementEntryInScopeWithTagName(h){const b=this.entries.find(k=>k.type===l6.Marker||this.treeAdapter.getTagName(k.element)===h);return b&&b.type===l6.Element?b:null}getElementEntry(h){return this.entries.find(b=>b.type===l6.Element&&b.element===h)}}const G8={createDocument(){return{nodeName:"#document",mode:w3.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(o,h,b){return{nodeName:o,tagName:o,attrs:b,namespaceURI:h,childNodes:[],parentNode:null}},createCommentNode(o){return{nodeName:"#comment",data:o,parentNode:null}},createTextNode(o){return{nodeName:"#text",value:o,parentNode:null}},appendChild(o,h){o.childNodes.push(h),h.parentNode=o},insertBefore(o,h,b){const k=o.childNodes.indexOf(b);o.childNodes.splice(k,0,h),h.parentNode=o},setTemplateContent(o,h){o.content=h},getTemplateContent(o){return o.content},setDocumentType(o,h,b,k){const O=o.childNodes.find(P=>P.nodeName==="#documentType");if(O)O.name=h,O.publicId=b,O.systemId=k;else{const P={nodeName:"#documentType",name:h,publicId:b,systemId:k,parentNode:null};G8.appendChild(o,P)}},setDocumentMode(o,h){o.mode=h},getDocumentMode(o){return o.mode},detachNode(o){if(o.parentNode){const h=o.parentNode.childNodes.indexOf(o);o.parentNode.childNodes.splice(h,1),o.parentNode=null}},insertText(o,h){if(o.childNodes.length>0){const b=o.childNodes[o.childNodes.length-1];if(G8.isTextNode(b)){b.value+=h;return}}G8.appendChild(o,G8.createTextNode(h))},insertTextBefore(o,h,b){const k=o.childNodes[o.childNodes.indexOf(b)-1];k&&G8.isTextNode(k)?k.value+=h:G8.insertBefore(o,G8.createTextNode(h),b)},adoptAttributes(o,h){const b=new Set(o.attrs.map(k=>k.name));for(let k=0;k<h.length;k++)b.has(h[k].name)||o.attrs.push(h[k])},getFirstChild(o){return o.childNodes[0]},getChildNodes(o){return o.childNodes},getParentNode(o){return o.parentNode},getAttrList(o){return o.attrs},getTagName(o){return o.tagName},getNamespaceURI(o){return o.namespaceURI},getTextNodeContent(o){return o.value},getCommentNodeContent(o){return o.data},getDocumentTypeNodeName(o){return o.name},getDocumentTypeNodePublicId(o){return o.publicId},getDocumentTypeNodeSystemId(o){return o.systemId},isTextNode(o){return o.nodeName==="#text"},isCommentNode(o){return o.nodeName==="#comment"},isDocumentTypeNode(o){return o.nodeName==="#documentType"},isElementNode(o){return Object.prototype.hasOwnProperty.call(o,"tagName")},setNodeSourceCodeLocation(o,h){o.sourceCodeLocation=h},getNodeSourceCodeLocation(o){return o.sourceCodeLocation},updateNodeSourceCodeLocation(o,h){o.sourceCodeLocation={...o.sourceCodeLocation,...h}}},pNe="html",cUn="about:legacy-compat",uUn="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",gNe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],lUn=[...gNe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],hUn=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),mNe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],fUn=[...mNe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function PAe(o,h){return h.some(b=>o.startsWith(b))}function dUn(o){return o.name===pNe&&o.publicId===null&&(o.systemId===null||o.systemId===cUn)}function pUn(o){if(o.name!==pNe)return w3.QUIRKS;const{systemId:h}=o;if(h&&h.toLowerCase()===uUn)return w3.QUIRKS;let{publicId:b}=o;if(b!==null){if(b=b.toLowerCase(),hUn.has(b))return w3.QUIRKS;let k=h===null?lUn:gNe;if(PAe(b,k))return w3.QUIRKS;if(k=h===null?mNe:fUn,PAe(b,k))return w3.LIMITED_QUIRKS}return w3.NO_QUIRKS}const LAe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},gUn="definitionurl",mUn="definitionURL",bUn=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(o=>[o.toLowerCase(),o])),yUn=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Bi.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Bi.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Bi.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Bi.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Bi.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Bi.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Bi.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Bi.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Bi.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Bi.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Bi.XMLNS}]]),wUn=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(o=>[o.toLowerCase(),o])),vUn=new Set([dt.B,dt.BIG,dt.BLOCKQUOTE,dt.BODY,dt.BR,dt.CENTER,dt.CODE,dt.DD,dt.DIV,dt.DL,dt.DT,dt.EM,dt.EMBED,dt.H1,dt.H2,dt.H3,dt.H4,dt.H5,dt.H6,dt.HEAD,dt.HR,dt.I,dt.IMG,dt.LI,dt.LISTING,dt.MENU,dt.META,dt.NOBR,dt.OL,dt.P,dt.PRE,dt.RUBY,dt.S,dt.SMALL,dt.SPAN,dt.STRONG,dt.STRIKE,dt.SUB,dt.SUP,dt.TABLE,dt.TT,dt.U,dt.UL,dt.VAR]);function xUn(o){const h=o.tagID;return h===dt.FONT&&o.attrs.some(({name:k})=>k===WN.COLOR||k===WN.SIZE||k===WN.FACE)||vUn.has(h)}function bNe(o){for(let h=0;h<o.attrs.length;h++)if(o.attrs[h].name===gUn){o.attrs[h].name=mUn;break}}function yNe(o){for(let h=0;h<o.attrs.length;h++){const b=bUn.get(o.attrs[h].name);b!=null&&(o.attrs[h].name=b)}}function iFt(o){for(let h=0;h<o.attrs.length;h++){const b=yUn.get(o.attrs[h].name);b&&(o.attrs[h].prefix=b.prefix,o.attrs[h].name=b.name,o.attrs[h].namespace=b.namespace)}}function kUn(o){const h=wUn.get(o.tagName);h!=null&&(o.tagName=h,o.tagID=Zj(o.tagName))}function _Un(o,h){return h===Bi.MATHML&&(o===dt.MI||o===dt.MO||o===dt.MN||o===dt.MS||o===dt.MTEXT)}function EUn(o,h,b){if(h===Bi.MATHML&&o===dt.ANNOTATION_XML){for(let k=0;k<b.length;k++)if(b[k].name===WN.ENCODING){const O=b[k].value.toLowerCase();return O===LAe.TEXT_HTML||O===LAe.APPLICATION_XML}}return h===Bi.SVG&&(o===dt.FOREIGN_OBJECT||o===dt.DESC||o===dt.TITLE)}function TUn(o,h,b,k){return(!k||k===Bi.HTML)&&EUn(o,h,b)||(!k||k===Bi.MATHML)&&_Un(o,h)}const SUn="hidden",IUn=8,CUn=3;var Ze;(function(o){o[o.INITIAL=0]="INITIAL",o[o.BEFORE_HTML=1]="BEFORE_HTML",o[o.BEFORE_HEAD=2]="BEFORE_HEAD",o[o.IN_HEAD=3]="IN_HEAD",o[o.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",o[o.AFTER_HEAD=5]="AFTER_HEAD",o[o.IN_BODY=6]="IN_BODY",o[o.TEXT=7]="TEXT",o[o.IN_TABLE=8]="IN_TABLE",o[o.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",o[o.IN_CAPTION=10]="IN_CAPTION",o[o.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",o[o.IN_TABLE_BODY=12]="IN_TABLE_BODY",o[o.IN_ROW=13]="IN_ROW",o[o.IN_CELL=14]="IN_CELL",o[o.IN_SELECT=15]="IN_SELECT",o[o.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",o[o.IN_TEMPLATE=17]="IN_TEMPLATE",o[o.AFTER_BODY=18]="AFTER_BODY",o[o.IN_FRAMESET=19]="IN_FRAMESET",o[o.AFTER_FRAMESET=20]="AFTER_FRAMESET",o[o.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",o[o.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Ze||(Ze={}));const AUn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},wNe=new Set([dt.TABLE,dt.TBODY,dt.TFOOT,dt.THEAD,dt.TR]),MAe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:G8,onParseError:null};class DAe{constructor(h,b,k=null,O=null){this.fragmentContext=k,this.scriptHandler=O,this.currentToken=null,this.stopped=!1,this.insertionMode=Ze.INITIAL,this.originalInsertionMode=Ze.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...MAe,...h},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=b??this.treeAdapter.createDocument(),this.tokenizer=new Zzn(this.options,this),this.activeFormattingElements=new sUn(this.treeAdapter),this.fragmentContextID=k?Zj(this.treeAdapter.getTagName(k)):dt.UNKNOWN,this._setContextModes(k??this.document,this.fragmentContextID),this.openElements=new oUn(this.document,this.treeAdapter,this)}static parse(h,b){const k=new this(b);return k.tokenizer.write(h,!0),k.document}static getFragmentParser(h,b){const k={...MAe,...b};h??(h=k.treeAdapter.createElement(ur.TEMPLATE,Bi.HTML,[]));const O=k.treeAdapter.createElement("documentmock",Bi.HTML,[]),P=new this(k,O,h);return P.fragmentContextID===dt.TEMPLATE&&P.tmplInsertionModeStack.unshift(Ze.IN_TEMPLATE),P._initTokenizerForFragmentParsing(),P._insertFakeRootElement(),P._resetInsertionMode(),P._findFormInFragmentContext(),P}getFragment(){const h=this.treeAdapter.getFirstChild(this.document),b=this.treeAdapter.createDocumentFragment();return this._adoptNodes(h,b),b}_err(h,b,k){var O;if(!this.onParseError)return;const P=(O=h.location)!==null&&O!==void 0?O:AUn,B={code:b,startLine:P.startLine,startCol:P.startCol,startOffset:P.startOffset,endLine:k?P.startLine:P.endLine,endCol:k?P.startCol:P.endCol,endOffset:k?P.startOffset:P.endOffset};this.onParseError(B)}onItemPush(h,b,k){var O,P;(P=(O=this.treeAdapter).onItemPush)===null||P===void 0||P.call(O,h),k&&this.openElements.stackTop>0&&this._setContextModes(h,b)}onItemPop(h,b){var k,O;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(h,this.currentToken),(O=(k=this.treeAdapter).onItemPop)===null||O===void 0||O.call(k,h,this.openElements.current),b){let P,B;this.openElements.stackTop===0&&this.fragmentContext?(P=this.fragmentContext,B=this.fragmentContextID):{current:P,currentTagId:B}=this.openElements,this._setContextModes(P,B)}}_setContextModes(h,b){const k=h===this.document||this.treeAdapter.getNamespaceURI(h)===Bi.HTML;this.currentNotInHTML=!k,this.tokenizer.inForeignNode=!k&&!this._isIntegrationPoint(b,h)}_switchToTextParsing(h,b){this._insertElement(h,Bi.HTML),this.tokenizer.state=b,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ze.TEXT}switchToPlaintextParsing(){this.insertionMode=Ze.TEXT,this.originalInsertionMode=Ze.IN_BODY,this.tokenizer.state=C1.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let h=this.fragmentContext;for(;h;){if(this.treeAdapter.getTagName(h)===ur.FORM){this.formElement=h;break}h=this.treeAdapter.getParentNode(h)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Bi.HTML))switch(this.fragmentContextID){case dt.TITLE:case dt.TEXTAREA:{this.tokenizer.state=C1.RCDATA;break}case dt.STYLE:case dt.XMP:case dt.IFRAME:case dt.NOEMBED:case dt.NOFRAMES:case dt.NOSCRIPT:{this.tokenizer.state=C1.RAWTEXT;break}case dt.SCRIPT:{this.tokenizer.state=C1.SCRIPT_DATA;break}case dt.PLAINTEXT:{this.tokenizer.state=C1.PLAINTEXT;break}}}_setDocumentType(h){const b=h.name||"",k=h.publicId||"",O=h.systemId||"";if(this.treeAdapter.setDocumentType(this.document,b,k,O),h.location){const B=this.treeAdapter.getChildNodes(this.document).find(G=>this.treeAdapter.isDocumentTypeNode(G));B&&this.treeAdapter.setNodeSourceCodeLocation(B,h.location)}}_attachElementToTree(h,b){if(this.options.sourceCodeLocationInfo){const k=b&&{...b,startTag:b};this.treeAdapter.setNodeSourceCodeLocation(h,k)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(h);else{const k=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(k,h)}}_appendElement(h,b){const k=this.treeAdapter.createElement(h.tagName,b,h.attrs);this._attachElementToTree(k,h.location)}_insertElement(h,b){const k=this.treeAdapter.createElement(h.tagName,b,h.attrs);this._attachElementToTree(k,h.location),this.openElements.push(k,h.tagID)}_insertFakeElement(h,b){const k=this.treeAdapter.createElement(h,Bi.HTML,[]);this._attachElementToTree(k,null),this.openElements.push(k,b)}_insertTemplate(h){const b=this.treeAdapter.createElement(h.tagName,Bi.HTML,h.attrs),k=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(b,k),this._attachElementToTree(b,h.location),this.openElements.push(b,h.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(k,null)}_insertFakeRootElement(){const h=this.treeAdapter.createElement(ur.HTML,Bi.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(h,null),this.treeAdapter.appendChild(this.openElements.current,h),this.openElements.push(h,dt.HTML)}_appendCommentNode(h,b){const k=this.treeAdapter.createCommentNode(h.data);this.treeAdapter.appendChild(b,k),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(k,h.location)}_insertCharacters(h){let b,k;if(this._shouldFosterParentOnInsertion()?({parent:b,beforeElement:k}=this._findFosterParentingLocation(),k?this.treeAdapter.insertTextBefore(b,h.chars,k):this.treeAdapter.insertText(b,h.chars)):(b=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(b,h.chars)),!h.location)return;const O=this.treeAdapter.getChildNodes(b),P=k?O.lastIndexOf(k):O.length,B=O[P-1];if(this.treeAdapter.getNodeSourceCodeLocation(B)){const{endLine:J,endCol:U,endOffset:nt}=h.location;this.treeAdapter.updateNodeSourceCodeLocation(B,{endLine:J,endCol:U,endOffset:nt})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(B,h.location)}_adoptNodes(h,b){for(let k=this.treeAdapter.getFirstChild(h);k;k=this.treeAdapter.getFirstChild(h))this.treeAdapter.detachNode(k),this.treeAdapter.appendChild(b,k)}_setEndLocation(h,b){if(this.treeAdapter.getNodeSourceCodeLocation(h)&&b.location){const k=b.location,O=this.treeAdapter.getTagName(h),P=b.type===vu.END_TAG&&O===b.tagName?{endTag:{...k},endLine:k.endLine,endCol:k.endCol,endOffset:k.endOffset}:{endLine:k.startLine,endCol:k.startCol,endOffset:k.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(h,P)}}shouldProcessStartTagTokenInForeignContent(h){if(!this.currentNotInHTML)return!1;let b,k;return this.openElements.stackTop===0&&this.fragmentContext?(b=this.fragmentContext,k=this.fragmentContextID):{current:b,currentTagId:k}=this.openElements,h.tagID===dt.SVG&&this.treeAdapter.getTagName(b)===ur.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(b)===Bi.MATHML?!1:this.tokenizer.inForeignNode||(h.tagID===dt.MGLYPH||h.tagID===dt.MALIGNMARK)&&!this._isIntegrationPoint(k,b,Bi.HTML)}_processToken(h){switch(h.type){case vu.CHARACTER:{this.onCharacter(h);break}case vu.NULL_CHARACTER:{this.onNullCharacter(h);break}case vu.COMMENT:{this.onComment(h);break}case vu.DOCTYPE:{this.onDoctype(h);break}case vu.START_TAG:{this._processStartTag(h);break}case vu.END_TAG:{this.onEndTag(h);break}case vu.EOF:{this.onEof(h);break}case vu.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(h);break}}}_isIntegrationPoint(h,b,k){const O=this.treeAdapter.getNamespaceURI(b),P=this.treeAdapter.getAttrList(b);return TUn(h,O,P,k)}_reconstructActiveFormattingElements(){const h=this.activeFormattingElements.entries.length;if(h){const b=this.activeFormattingElements.entries.findIndex(O=>O.type===l6.Marker||this.openElements.contains(O.element)),k=b<0?h-1:b-1;for(let O=k;O>=0;O--){const P=this.activeFormattingElements.entries[O];this._insertElement(P.token,this.treeAdapter.getNamespaceURI(P.element)),P.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ze.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(dt.P),this.openElements.popUntilTagNamePopped(dt.P)}_resetInsertionMode(){for(let h=this.openElements.stackTop;h>=0;h--)switch(h===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[h]){case dt.TR:{this.insertionMode=Ze.IN_ROW;return}case dt.TBODY:case dt.THEAD:case dt.TFOOT:{this.insertionMode=Ze.IN_TABLE_BODY;return}case dt.CAPTION:{this.insertionMode=Ze.IN_CAPTION;return}case dt.COLGROUP:{this.insertionMode=Ze.IN_COLUMN_GROUP;return}case dt.TABLE:{this.insertionMode=Ze.IN_TABLE;return}case dt.BODY:{this.insertionMode=Ze.IN_BODY;return}case dt.FRAMESET:{this.insertionMode=Ze.IN_FRAMESET;return}case dt.SELECT:{this._resetInsertionModeForSelect(h);return}case dt.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case dt.HTML:{this.insertionMode=this.headElement?Ze.AFTER_HEAD:Ze.BEFORE_HEAD;return}case dt.TD:case dt.TH:{if(h>0){this.insertionMode=Ze.IN_CELL;return}break}case dt.HEAD:{if(h>0){this.insertionMode=Ze.IN_HEAD;return}break}}this.insertionMode=Ze.IN_BODY}_resetInsertionModeForSelect(h){if(h>0)for(let b=h-1;b>0;b--){const k=this.openElements.tagIDs[b];if(k===dt.TEMPLATE)break;if(k===dt.TABLE){this.insertionMode=Ze.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ze.IN_SELECT}_isElementCausesFosterParenting(h){return wNe.has(h)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let h=this.openElements.stackTop;h>=0;h--){const b=this.openElements.items[h];switch(this.openElements.tagIDs[h]){case dt.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(b)===Bi.HTML)return{parent:this.treeAdapter.getTemplateContent(b),beforeElement:null};break}case dt.TABLE:{const k=this.treeAdapter.getParentNode(b);return k?{parent:k,beforeElement:b}:{parent:this.openElements.items[h-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(h){const b=this._findFosterParentingLocation();b.beforeElement?this.treeAdapter.insertBefore(b.parent,h,b.beforeElement):this.treeAdapter.appendChild(b.parent,h)}_isSpecialElement(h,b){const k=this.treeAdapter.getNamespaceURI(h);return Yzn[k].has(b)}onCharacter(h){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){aqn(this,h);return}switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{mX(this,h);break}case Ze.BEFORE_HEAD:{bX(this,h);break}case Ze.IN_HEAD:{yX(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{wX(this,h);break}case Ze.AFTER_HEAD:{vX(this,h);break}case Ze.IN_BODY:case Ze.IN_CAPTION:case Ze.IN_CELL:case Ze.IN_TEMPLATE:{xNe(this,h);break}case Ze.TEXT:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:{this._insertCharacters(h);break}case Ze.IN_TABLE:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:{CRt(this,h);break}case Ze.IN_TABLE_TEXT:{INe(this,h);break}case Ze.IN_COLUMN_GROUP:{Xmt(this,h);break}case Ze.AFTER_BODY:{Qmt(this,h);break}case Ze.AFTER_AFTER_BODY:{Dmt(this,h);break}}}onNullCharacter(h){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){iqn(this,h);return}switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{mX(this,h);break}case Ze.BEFORE_HEAD:{bX(this,h);break}case Ze.IN_HEAD:{yX(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{wX(this,h);break}case Ze.AFTER_HEAD:{vX(this,h);break}case Ze.TEXT:{this._insertCharacters(h);break}case Ze.IN_TABLE:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:{CRt(this,h);break}case Ze.IN_COLUMN_GROUP:{Xmt(this,h);break}case Ze.AFTER_BODY:{Qmt(this,h);break}case Ze.AFTER_AFTER_BODY:{Dmt(this,h);break}}}onComment(h){if(this.skipNextNewLine=!1,this.currentNotInHTML){$Bt(this,h);return}switch(this.insertionMode){case Ze.INITIAL:case Ze.BEFORE_HTML:case Ze.BEFORE_HEAD:case Ze.IN_HEAD:case Ze.IN_HEAD_NO_SCRIPT:case Ze.AFTER_HEAD:case Ze.IN_BODY:case Ze.IN_TABLE:case Ze.IN_CAPTION:case Ze.IN_COLUMN_GROUP:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:case Ze.IN_CELL:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:case Ze.IN_TEMPLATE:case Ze.IN_FRAMESET:case Ze.AFTER_FRAMESET:{$Bt(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.AFTER_BODY:{RUn(this,h);break}case Ze.AFTER_AFTER_BODY:case Ze.AFTER_AFTER_FRAMESET:{BUn(this,h);break}}}onDoctype(h){switch(this.skipNextNewLine=!1,this.insertionMode){case Ze.INITIAL:{jUn(this,h);break}case Ze.BEFORE_HEAD:case Ze.IN_HEAD:case Ze.IN_HEAD_NO_SCRIPT:case Ze.AFTER_HEAD:{this._err(h,Fr.misplacedDoctype);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}}}onStartTag(h){this.skipNextNewLine=!1,this.currentToken=h,this._processStartTag(h),h.selfClosing&&!h.ackSelfClosing&&this._err(h,Fr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(h){this.shouldProcessStartTagTokenInForeignContent(h)?oqn(this,h):this._startTagOutsideForeignContent(h)}_startTagOutsideForeignContent(h){switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{FUn(this,h);break}case Ze.BEFORE_HEAD:{HUn(this,h);break}case Ze.IN_HEAD:{V5(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{GUn(this,h);break}case Ze.AFTER_HEAD:{WUn(this,h);break}case Ze.IN_BODY:{vm(this,h);break}case Ze.IN_TABLE:{Hj(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.IN_CAPTION:{zGn(this,h);break}case Ze.IN_COLUMN_GROUP:{sFt(this,h);break}case Ze.IN_TABLE_BODY:{Obt(this,h);break}case Ze.IN_ROW:{Nbt(this,h);break}case Ze.IN_CELL:{qGn(this,h);break}case Ze.IN_SELECT:{ONe(this,h);break}case Ze.IN_SELECT_IN_TABLE:{KGn(this,h);break}case Ze.IN_TEMPLATE:{YGn(this,h);break}case Ze.AFTER_BODY:{XGn(this,h);break}case Ze.IN_FRAMESET:{QGn(this,h);break}case Ze.AFTER_FRAMESET:{tqn(this,h);break}case Ze.AFTER_AFTER_BODY:{nqn(this,h);break}case Ze.AFTER_AFTER_FRAMESET:{rqn(this,h);break}}}onEndTag(h){this.skipNextNewLine=!1,this.currentToken=h,this.currentNotInHTML?sqn(this,h):this._endTagOutsideForeignContent(h)}_endTagOutsideForeignContent(h){switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{$Un(this,h);break}case Ze.BEFORE_HEAD:{zUn(this,h);break}case Ze.IN_HEAD:{UUn(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{qUn(this,h);break}case Ze.AFTER_HEAD:{KUn(this,h);break}case Ze.IN_BODY:{Abt(this,h);break}case Ze.TEXT:{PGn(this,h);break}case Ze.IN_TABLE:{AX(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.IN_CAPTION:{UGn(this,h);break}case Ze.IN_COLUMN_GROUP:{GGn(this,h);break}case Ze.IN_TABLE_BODY:{HBt(this,h);break}case Ze.IN_ROW:{ANe(this,h);break}case Ze.IN_CELL:{WGn(this,h);break}case Ze.IN_SELECT:{NNe(this,h);break}case Ze.IN_SELECT_IN_TABLE:{VGn(this,h);break}case Ze.IN_TEMPLATE:{JGn(this,h);break}case Ze.AFTER_BODY:{LNe(this,h);break}case Ze.IN_FRAMESET:{ZGn(this,h);break}case Ze.AFTER_FRAMESET:{eqn(this,h);break}case Ze.AFTER_AFTER_BODY:{Dmt(this,h);break}}}onEof(h){switch(this.insertionMode){case Ze.INITIAL:{XJ(this,h);break}case Ze.BEFORE_HTML:{mX(this,h);break}case Ze.BEFORE_HEAD:{bX(this,h);break}case Ze.IN_HEAD:{yX(this,h);break}case Ze.IN_HEAD_NO_SCRIPT:{wX(this,h);break}case Ze.AFTER_HEAD:{vX(this,h);break}case Ze.IN_BODY:case Ze.IN_TABLE:case Ze.IN_CAPTION:case Ze.IN_COLUMN_GROUP:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:case Ze.IN_CELL:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:{TNe(this,h);break}case Ze.TEXT:{LGn(this,h);break}case Ze.IN_TABLE_TEXT:{QJ(this,h);break}case Ze.IN_TEMPLATE:{PNe(this,h);break}case Ze.AFTER_BODY:case Ze.IN_FRAMESET:case Ze.AFTER_FRAMESET:case Ze.AFTER_AFTER_BODY:case Ze.AFTER_AFTER_FRAMESET:{oFt(this,h);break}}}onWhitespaceCharacter(h){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,h.chars.charCodeAt(0)===xe.LINE_FEED)){if(h.chars.length===1)return;h.chars=h.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(h);return}switch(this.insertionMode){case Ze.IN_HEAD:case Ze.IN_HEAD_NO_SCRIPT:case Ze.AFTER_HEAD:case Ze.TEXT:case Ze.IN_COLUMN_GROUP:case Ze.IN_SELECT:case Ze.IN_SELECT_IN_TABLE:case Ze.IN_FRAMESET:case Ze.AFTER_FRAMESET:{this._insertCharacters(h);break}case Ze.IN_BODY:case Ze.IN_CAPTION:case Ze.IN_CELL:case Ze.IN_TEMPLATE:case Ze.AFTER_BODY:case Ze.AFTER_AFTER_BODY:case Ze.AFTER_AFTER_FRAMESET:{vNe(this,h);break}case Ze.IN_TABLE:case Ze.IN_TABLE_BODY:case Ze.IN_ROW:{CRt(this,h);break}case Ze.IN_TABLE_TEXT:{SNe(this,h);break}}}}function OUn(o,h){let b=o.activeFormattingElements.getElementEntryInScopeWithTagName(h.tagName);return b?o.openElements.contains(b.element)?o.openElements.hasInScope(h.tagID)||(b=null):(o.activeFormattingElements.removeEntry(b),b=null):ENe(o,h),b}function NUn(o,h){let b=null,k=o.openElements.stackTop;for(;k>=0;k--){const O=o.openElements.items[k];if(O===h.element)break;o._isSpecialElement(O,o.openElements.tagIDs[k])&&(b=O)}return b||(o.openElements.shortenToLength(k<0?0:k),o.activeFormattingElements.removeEntry(h)),b}function PUn(o,h,b){let k=h,O=o.openElements.getCommonAncestor(h);for(let P=0,B=O;B!==b;P++,B=O){O=o.openElements.getCommonAncestor(B);const G=o.activeFormattingElements.getElementEntry(B),J=G&&P>=CUn;!G||J?(J&&o.activeFormattingElements.removeEntry(G),o.openElements.remove(B)):(B=LUn(o,G),k===h&&(o.activeFormattingElements.bookmark=G),o.treeAdapter.detachNode(k),o.treeAdapter.appendChild(B,k),k=B)}return k}function LUn(o,h){const b=o.treeAdapter.getNamespaceURI(h.element),k=o.treeAdapter.createElement(h.token.tagName,b,h.token.attrs);return o.openElements.replace(h.element,k),h.element=k,k}function MUn(o,h,b){const k=o.treeAdapter.getTagName(h),O=Zj(k);if(o._isElementCausesFosterParenting(O))o._fosterParentElement(b);else{const P=o.treeAdapter.getNamespaceURI(h);O===dt.TEMPLATE&&P===Bi.HTML&&(h=o.treeAdapter.getTemplateContent(h)),o.treeAdapter.appendChild(h,b)}}function DUn(o,h,b){const k=o.treeAdapter.getNamespaceURI(b.element),{token:O}=b,P=o.treeAdapter.createElement(O.tagName,k,O.attrs);o._adoptNodes(h,P),o.treeAdapter.appendChild(h,P),o.activeFormattingElements.insertElementAfterBookmark(P,O),o.activeFormattingElements.removeEntry(b),o.openElements.remove(b.element),o.openElements.insertAfter(h,P,O.tagID)}function aFt(o,h){for(let b=0;b<IUn;b++){const k=OUn(o,h);if(!k)break;const O=NUn(o,k);if(!O)break;o.activeFormattingElements.bookmark=k;const P=PUn(o,O,k.element),B=o.openElements.getCommonAncestor(k.element);o.treeAdapter.detachNode(P),B&&MUn(o,B,P),DUn(o,O,k)}}function $Bt(o,h){o._appendCommentNode(h,o.openElements.currentTmplContentOrNode)}function RUn(o,h){o._appendCommentNode(h,o.openElements.items[0])}function BUn(o,h){o._appendCommentNode(h,o.document)}function oFt(o,h){if(o.stopped=!0,h.location){const b=o.fragmentContext?0:2;for(let k=o.openElements.stackTop;k>=b;k--)o._setEndLocation(o.openElements.items[k],h);if(!o.fragmentContext&&o.openElements.stackTop>=0){const k=o.openElements.items[0],O=o.treeAdapter.getNodeSourceCodeLocation(k);if(O&&!O.endTag&&(o._setEndLocation(k,h),o.openElements.stackTop>=1)){const P=o.openElements.items[1],B=o.treeAdapter.getNodeSourceCodeLocation(P);B&&!B.endTag&&o._setEndLocation(P,h)}}}}function jUn(o,h){o._setDocumentType(h);const b=h.forceQuirks?w3.QUIRKS:pUn(h);dUn(h)||o._err(h,Fr.nonConformingDoctype),o.treeAdapter.setDocumentMode(o.document,b),o.insertionMode=Ze.BEFORE_HTML}function XJ(o,h){o._err(h,Fr.missingDoctype,!0),o.treeAdapter.setDocumentMode(o.document,w3.QUIRKS),o.insertionMode=Ze.BEFORE_HTML,o._processToken(h)}function FUn(o,h){h.tagID===dt.HTML?(o._insertElement(h,Bi.HTML),o.insertionMode=Ze.BEFORE_HEAD):mX(o,h)}function $Un(o,h){const b=h.tagID;(b===dt.HTML||b===dt.HEAD||b===dt.BODY||b===dt.BR)&&mX(o,h)}function mX(o,h){o._insertFakeRootElement(),o.insertionMode=Ze.BEFORE_HEAD,o._processToken(h)}function HUn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.HEAD:{o._insertElement(h,Bi.HTML),o.headElement=o.openElements.current,o.insertionMode=Ze.IN_HEAD;break}default:bX(o,h)}}function zUn(o,h){const b=h.tagID;b===dt.HEAD||b===dt.BODY||b===dt.HTML||b===dt.BR?bX(o,h):o._err(h,Fr.endTagWithoutMatchingOpenElement)}function bX(o,h){o._insertFakeElement(ur.HEAD,dt.HEAD),o.headElement=o.openElements.current,o.insertionMode=Ze.IN_HEAD,o._processToken(h)}function V5(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:{o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.TITLE:{o._switchToTextParsing(h,C1.RCDATA);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?o._switchToTextParsing(h,C1.RAWTEXT):(o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_HEAD_NO_SCRIPT);break}case dt.NOFRAMES:case dt.STYLE:{o._switchToTextParsing(h,C1.RAWTEXT);break}case dt.SCRIPT:{o._switchToTextParsing(h,C1.SCRIPT_DATA);break}case dt.TEMPLATE:{o._insertTemplate(h),o.activeFormattingElements.insertMarker(),o.framesetOk=!1,o.insertionMode=Ze.IN_TEMPLATE,o.tmplInsertionModeStack.unshift(Ze.IN_TEMPLATE);break}case dt.HEAD:{o._err(h,Fr.misplacedStartTagForHeadElement);break}default:yX(o,h)}}function UUn(o,h){switch(h.tagID){case dt.HEAD:{o.openElements.pop(),o.insertionMode=Ze.AFTER_HEAD;break}case dt.BODY:case dt.BR:case dt.HTML:{yX(o,h);break}case dt.TEMPLATE:{aP(o,h);break}default:o._err(h,Fr.endTagWithoutMatchingOpenElement)}}function aP(o,h){o.openElements.tmplCount>0?(o.openElements.generateImpliedEndTagsThoroughly(),o.openElements.currentTagId!==dt.TEMPLATE&&o._err(h,Fr.closingOfElementWithOpenChildElements),o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode()):o._err(h,Fr.endTagWithoutMatchingOpenElement)}function yX(o,h){o.openElements.pop(),o.insertionMode=Ze.AFTER_HEAD,o._processToken(h)}function GUn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.BASEFONT:case dt.BGSOUND:case dt.HEAD:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.STYLE:{V5(o,h);break}case dt.NOSCRIPT:{o._err(h,Fr.nestedNoscriptInHead);break}default:wX(o,h)}}function qUn(o,h){switch(h.tagID){case dt.NOSCRIPT:{o.openElements.pop(),o.insertionMode=Ze.IN_HEAD;break}case dt.BR:{wX(o,h);break}default:o._err(h,Fr.endTagWithoutMatchingOpenElement)}}function wX(o,h){const b=h.type===vu.EOF?Fr.openElementsLeftAfterEof:Fr.disallowedContentInNoscriptInHead;o._err(h,b),o.openElements.pop(),o.insertionMode=Ze.IN_HEAD,o._processToken(h)}function WUn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.BODY:{o._insertElement(h,Bi.HTML),o.framesetOk=!1,o.insertionMode=Ze.IN_BODY;break}case dt.FRAMESET:{o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_FRAMESET;break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{o._err(h,Fr.abandonedHeadElementChild),o.openElements.push(o.headElement,dt.HEAD),V5(o,h),o.openElements.remove(o.headElement);break}case dt.HEAD:{o._err(h,Fr.misplacedStartTagForHeadElement);break}default:vX(o,h)}}function KUn(o,h){switch(h.tagID){case dt.BODY:case dt.HTML:case dt.BR:{vX(o,h);break}case dt.TEMPLATE:{aP(o,h);break}default:o._err(h,Fr.endTagWithoutMatchingOpenElement)}}function vX(o,h){o._insertFakeElement(ur.BODY,dt.BODY),o.insertionMode=Ze.IN_BODY,Cbt(o,h)}function Cbt(o,h){switch(h.type){case vu.CHARACTER:{xNe(o,h);break}case vu.WHITESPACE_CHARACTER:{vNe(o,h);break}case vu.COMMENT:{$Bt(o,h);break}case vu.START_TAG:{vm(o,h);break}case vu.END_TAG:{Abt(o,h);break}case vu.EOF:{TNe(o,h);break}}}function vNe(o,h){o._reconstructActiveFormattingElements(),o._insertCharacters(h)}function xNe(o,h){o._reconstructActiveFormattingElements(),o._insertCharacters(h),o.framesetOk=!1}function VUn(o,h){o.openElements.tmplCount===0&&o.treeAdapter.adoptAttributes(o.openElements.items[0],h.attrs)}function YUn(o,h){const b=o.openElements.tryPeekProperlyNestedBodyElement();b&&o.openElements.tmplCount===0&&(o.framesetOk=!1,o.treeAdapter.adoptAttributes(b,h.attrs))}function JUn(o,h){const b=o.openElements.tryPeekProperlyNestedBodyElement();o.framesetOk&&b&&(o.treeAdapter.detachNode(b),o.openElements.popAllUpToHtmlElement(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_FRAMESET)}function XUn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML)}function QUn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),FBt.has(o.openElements.currentTagId)&&o.openElements.pop(),o._insertElement(h,Bi.HTML)}function ZUn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),o.skipNextNewLine=!0,o.framesetOk=!1}function tGn(o,h){const b=o.openElements.tmplCount>0;(!o.formElement||b)&&(o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),b||(o.formElement=o.openElements.current))}function eGn(o,h){o.framesetOk=!1;const b=h.tagID;for(let k=o.openElements.stackTop;k>=0;k--){const O=o.openElements.tagIDs[k];if(b===dt.LI&&O===dt.LI||(b===dt.DD||b===dt.DT)&&(O===dt.DD||O===dt.DT)){o.openElements.generateImpliedEndTagsWithExclusion(O),o.openElements.popUntilTagNamePopped(O);break}if(O!==dt.ADDRESS&&O!==dt.DIV&&O!==dt.P&&o._isSpecialElement(o.openElements.items[k],O))break}o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML)}function nGn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),o.tokenizer.state=C1.PLAINTEXT}function rGn(o,h){o.openElements.hasInScope(dt.BUTTON)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.BUTTON)),o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.framesetOk=!1}function iGn(o,h){const b=o.activeFormattingElements.getElementEntryInScopeWithTagName(ur.A);b&&(aFt(o,h),o.openElements.remove(b.element),o.activeFormattingElements.removeEntry(b)),o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,h)}function aGn(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,h)}function oGn(o,h){o._reconstructActiveFormattingElements(),o.openElements.hasInScope(dt.NOBR)&&(aFt(o,h),o._reconstructActiveFormattingElements()),o._insertElement(h,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,h)}function sGn(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.activeFormattingElements.insertMarker(),o.framesetOk=!1}function cGn(o,h){o.treeAdapter.getDocumentMode(o.document)!==w3.QUIRKS&&o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(h,Bi.HTML),o.framesetOk=!1,o.insertionMode=Ze.IN_TABLE}function kNe(o,h){o._reconstructActiveFormattingElements(),o._appendElement(h,Bi.HTML),o.framesetOk=!1,h.ackSelfClosing=!0}function _Ne(o){const h=cNe(o,WN.TYPE);return h!=null&&h.toLowerCase()===SUn}function uGn(o,h){o._reconstructActiveFormattingElements(),o._appendElement(h,Bi.HTML),_Ne(h)||(o.framesetOk=!1),h.ackSelfClosing=!0}function lGn(o,h){o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0}function hGn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._appendElement(h,Bi.HTML),o.framesetOk=!1,h.ackSelfClosing=!0}function fGn(o,h){h.tagName=ur.IMG,h.tagID=dt.IMG,kNe(o,h)}function dGn(o,h){o._insertElement(h,Bi.HTML),o.skipNextNewLine=!0,o.tokenizer.state=C1.RCDATA,o.originalInsertionMode=o.insertionMode,o.framesetOk=!1,o.insertionMode=Ze.TEXT}function pGn(o,h){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._reconstructActiveFormattingElements(),o.framesetOk=!1,o._switchToTextParsing(h,C1.RAWTEXT)}function gGn(o,h){o.framesetOk=!1,o._switchToTextParsing(h,C1.RAWTEXT)}function RAe(o,h){o._switchToTextParsing(h,C1.RAWTEXT)}function mGn(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML),o.framesetOk=!1,o.insertionMode=o.insertionMode===Ze.IN_TABLE||o.insertionMode===Ze.IN_CAPTION||o.insertionMode===Ze.IN_TABLE_BODY||o.insertionMode===Ze.IN_ROW||o.insertionMode===Ze.IN_CELL?Ze.IN_SELECT_IN_TABLE:Ze.IN_SELECT}function bGn(o,h){o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML)}function yGn(o,h){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTags(),o._insertElement(h,Bi.HTML)}function wGn(o,h){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTagsWithExclusion(dt.RTC),o._insertElement(h,Bi.HTML)}function vGn(o,h){o._reconstructActiveFormattingElements(),bNe(h),iFt(h),h.selfClosing?o._appendElement(h,Bi.MATHML):o._insertElement(h,Bi.MATHML),h.ackSelfClosing=!0}function xGn(o,h){o._reconstructActiveFormattingElements(),yNe(h),iFt(h),h.selfClosing?o._appendElement(h,Bi.SVG):o._insertElement(h,Bi.SVG),h.ackSelfClosing=!0}function BAe(o,h){o._reconstructActiveFormattingElements(),o._insertElement(h,Bi.HTML)}function vm(o,h){switch(h.tagID){case dt.I:case dt.S:case dt.B:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{aGn(o,h);break}case dt.A:{iGn(o,h);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{QUn(o,h);break}case dt.P:case dt.DL:case dt.OL:case dt.UL:case dt.DIV:case dt.DIR:case dt.NAV:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.DETAILS:case dt.ADDRESS:case dt.ARTICLE:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{XUn(o,h);break}case dt.LI:case dt.DD:case dt.DT:{eGn(o,h);break}case dt.BR:case dt.IMG:case dt.WBR:case dt.AREA:case dt.EMBED:case dt.KEYGEN:{kNe(o,h);break}case dt.HR:{hGn(o,h);break}case dt.RB:case dt.RTC:{yGn(o,h);break}case dt.RT:case dt.RP:{wGn(o,h);break}case dt.PRE:case dt.LISTING:{ZUn(o,h);break}case dt.XMP:{pGn(o,h);break}case dt.SVG:{xGn(o,h);break}case dt.HTML:{VUn(o,h);break}case dt.BASE:case dt.LINK:case dt.META:case dt.STYLE:case dt.TITLE:case dt.SCRIPT:case dt.BGSOUND:case dt.BASEFONT:case dt.TEMPLATE:{V5(o,h);break}case dt.BODY:{YUn(o,h);break}case dt.FORM:{tGn(o,h);break}case dt.NOBR:{oGn(o,h);break}case dt.MATH:{vGn(o,h);break}case dt.TABLE:{cGn(o,h);break}case dt.INPUT:{uGn(o,h);break}case dt.PARAM:case dt.TRACK:case dt.SOURCE:{lGn(o,h);break}case dt.IMAGE:{fGn(o,h);break}case dt.BUTTON:{rGn(o,h);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{sGn(o,h);break}case dt.IFRAME:{gGn(o,h);break}case dt.SELECT:{mGn(o,h);break}case dt.OPTION:case dt.OPTGROUP:{bGn(o,h);break}case dt.NOEMBED:case dt.NOFRAMES:{RAe(o,h);break}case dt.FRAMESET:{JUn(o,h);break}case dt.TEXTAREA:{dGn(o,h);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?RAe(o,h):BAe(o,h);break}case dt.PLAINTEXT:{nGn(o,h);break}case dt.COL:case dt.TH:case dt.TD:case dt.TR:case dt.HEAD:case dt.FRAME:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.CAPTION:case dt.COLGROUP:break;default:BAe(o,h)}}function kGn(o,h){if(o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Ze.AFTER_BODY,o.options.sourceCodeLocationInfo)){const b=o.openElements.tryPeekProperlyNestedBodyElement();b&&o._setEndLocation(b,h)}}function _Gn(o,h){o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Ze.AFTER_BODY,LNe(o,h))}function EGn(o,h){const b=h.tagID;o.openElements.hasInScope(b)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(b))}function TGn(o){const h=o.openElements.tmplCount>0,{formElement:b}=o;h||(o.formElement=null),(b||h)&&o.openElements.hasInScope(dt.FORM)&&(o.openElements.generateImpliedEndTags(),h?o.openElements.popUntilTagNamePopped(dt.FORM):b&&o.openElements.remove(b))}function SGn(o){o.openElements.hasInButtonScope(dt.P)||o._insertFakeElement(ur.P,dt.P),o._closePElement()}function IGn(o){o.openElements.hasInListItemScope(dt.LI)&&(o.openElements.generateImpliedEndTagsWithExclusion(dt.LI),o.openElements.popUntilTagNamePopped(dt.LI))}function CGn(o,h){const b=h.tagID;o.openElements.hasInScope(b)&&(o.openElements.generateImpliedEndTagsWithExclusion(b),o.openElements.popUntilTagNamePopped(b))}function AGn(o){o.openElements.hasNumberedHeaderInScope()&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilNumberedHeaderPopped())}function OGn(o,h){const b=h.tagID;o.openElements.hasInScope(b)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(b),o.activeFormattingElements.clearToLastMarker())}function NGn(o){o._reconstructActiveFormattingElements(),o._insertFakeElement(ur.BR,dt.BR),o.openElements.pop(),o.framesetOk=!1}function ENe(o,h){const b=h.tagName,k=h.tagID;for(let O=o.openElements.stackTop;O>0;O--){const P=o.openElements.items[O],B=o.openElements.tagIDs[O];if(k===B&&(k!==dt.UNKNOWN||o.treeAdapter.getTagName(P)===b)){o.openElements.generateImpliedEndTagsWithExclusion(k),o.openElements.stackTop>=O&&o.openElements.shortenToLength(O);break}if(o._isSpecialElement(P,B))break}}function Abt(o,h){switch(h.tagID){case dt.A:case dt.B:case dt.I:case dt.S:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.NOBR:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{aFt(o,h);break}case dt.P:{SGn(o);break}case dt.DL:case dt.UL:case dt.OL:case dt.DIR:case dt.DIV:case dt.NAV:case dt.PRE:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.BUTTON:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.ADDRESS:case dt.ARTICLE:case dt.DETAILS:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.LISTING:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{EGn(o,h);break}case dt.LI:{IGn(o);break}case dt.DD:case dt.DT:{CGn(o,h);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{AGn(o);break}case dt.BR:{NGn(o);break}case dt.BODY:{kGn(o,h);break}case dt.HTML:{_Gn(o,h);break}case dt.FORM:{TGn(o);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{OGn(o,h);break}case dt.TEMPLATE:{aP(o,h);break}default:ENe(o,h)}}function TNe(o,h){o.tmplInsertionModeStack.length>0?PNe(o,h):oFt(o,h)}function PGn(o,h){var b;h.tagID===dt.SCRIPT&&((b=o.scriptHandler)===null||b===void 0||b.call(o,o.openElements.current)),o.openElements.pop(),o.insertionMode=o.originalInsertionMode}function LGn(o,h){o._err(h,Fr.eofInElementThatCanContainOnlyText),o.openElements.pop(),o.insertionMode=o.originalInsertionMode,o.onEof(h)}function CRt(o,h){if(wNe.has(o.openElements.currentTagId))switch(o.pendingCharacterTokens.length=0,o.hasNonWhitespacePendingCharacterToken=!1,o.originalInsertionMode=o.insertionMode,o.insertionMode=Ze.IN_TABLE_TEXT,h.type){case vu.CHARACTER:{INe(o,h);break}case vu.WHITESPACE_CHARACTER:{SNe(o,h);break}}else zX(o,h)}function MGn(o,h){o.openElements.clearBackToTableContext(),o.activeFormattingElements.insertMarker(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_CAPTION}function DGn(o,h){o.openElements.clearBackToTableContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_COLUMN_GROUP}function RGn(o,h){o.openElements.clearBackToTableContext(),o._insertFakeElement(ur.COLGROUP,dt.COLGROUP),o.insertionMode=Ze.IN_COLUMN_GROUP,sFt(o,h)}function BGn(o,h){o.openElements.clearBackToTableContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_TABLE_BODY}function jGn(o,h){o.openElements.clearBackToTableContext(),o._insertFakeElement(ur.TBODY,dt.TBODY),o.insertionMode=Ze.IN_TABLE_BODY,Obt(o,h)}function FGn(o,h){o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode(),o._processStartTag(h))}function $Gn(o,h){_Ne(h)?o._appendElement(h,Bi.HTML):zX(o,h),h.ackSelfClosing=!0}function HGn(o,h){!o.formElement&&o.openElements.tmplCount===0&&(o._insertElement(h,Bi.HTML),o.formElement=o.openElements.current,o.openElements.pop())}function Hj(o,h){switch(h.tagID){case dt.TD:case dt.TH:case dt.TR:{jGn(o,h);break}case dt.STYLE:case dt.SCRIPT:case dt.TEMPLATE:{V5(o,h);break}case dt.COL:{RGn(o,h);break}case dt.FORM:{HGn(o,h);break}case dt.TABLE:{FGn(o,h);break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{BGn(o,h);break}case dt.INPUT:{$Gn(o,h);break}case dt.CAPTION:{MGn(o,h);break}case dt.COLGROUP:{DGn(o,h);break}default:zX(o,h)}}function AX(o,h){switch(h.tagID){case dt.TABLE:{o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode());break}case dt.TEMPLATE:{aP(o,h);break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:zX(o,h)}}function zX(o,h){const b=o.fosterParentingEnabled;o.fosterParentingEnabled=!0,Cbt(o,h),o.fosterParentingEnabled=b}function SNe(o,h){o.pendingCharacterTokens.push(h)}function INe(o,h){o.pendingCharacterTokens.push(h),o.hasNonWhitespacePendingCharacterToken=!0}function QJ(o,h){let b=0;if(o.hasNonWhitespacePendingCharacterToken)for(;b<o.pendingCharacterTokens.length;b++)zX(o,o.pendingCharacterTokens[b]);else for(;b<o.pendingCharacterTokens.length;b++)o._insertCharacters(o.pendingCharacterTokens[b]);o.insertionMode=o.originalInsertionMode,o._processToken(h)}const CNe=new Set([dt.CAPTION,dt.COL,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]);function zGn(o,h){const b=h.tagID;CNe.has(b)?o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Ze.IN_TABLE,Hj(o,h)):vm(o,h)}function UGn(o,h){const b=h.tagID;switch(b){case dt.CAPTION:case dt.TABLE:{o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Ze.IN_TABLE,b===dt.TABLE&&AX(o,h));break}case dt.BODY:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:Abt(o,h)}}function sFt(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.COL:{o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.TEMPLATE:{V5(o,h);break}default:Xmt(o,h)}}function GGn(o,h){switch(h.tagID){case dt.COLGROUP:{o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Ze.IN_TABLE);break}case dt.TEMPLATE:{aP(o,h);break}case dt.COL:break;default:Xmt(o,h)}}function Xmt(o,h){o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Ze.IN_TABLE,o._processToken(h))}function Obt(o,h){switch(h.tagID){case dt.TR:{o.openElements.clearBackToTableBodyContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_ROW;break}case dt.TH:case dt.TD:{o.openElements.clearBackToTableBodyContext(),o._insertFakeElement(ur.TR,dt.TR),o.insertionMode=Ze.IN_ROW,Nbt(o,h);break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE,Hj(o,h));break}default:Hj(o,h)}}function HBt(o,h){const b=h.tagID;switch(h.tagID){case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasInTableScope(b)&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE);break}case dt.TABLE:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE,AX(o,h));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:case dt.TR:break;default:AX(o,h)}}function Nbt(o,h){switch(h.tagID){case dt.TH:case dt.TD:{o.openElements.clearBackToTableRowContext(),o._insertElement(h,Bi.HTML),o.insertionMode=Ze.IN_CELL,o.activeFormattingElements.insertMarker();break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY,Obt(o,h));break}default:Hj(o,h)}}function ANe(o,h){switch(h.tagID){case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY);break}case dt.TABLE:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY,HBt(o,h));break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{(o.openElements.hasInTableScope(h.tagID)||o.openElements.hasInTableScope(dt.TR))&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Ze.IN_TABLE_BODY,HBt(o,h));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:break;default:AX(o,h)}}function qGn(o,h){const b=h.tagID;CNe.has(b)?(o.openElements.hasInTableScope(dt.TD)||o.openElements.hasInTableScope(dt.TH))&&(o._closeTableCell(),Nbt(o,h)):vm(o,h)}function WGn(o,h){const b=h.tagID;switch(b){case dt.TD:case dt.TH:{o.openElements.hasInTableScope(b)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(b),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Ze.IN_ROW);break}case dt.TABLE:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(b)&&(o._closeTableCell(),ANe(o,h));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:break;default:Abt(o,h)}}function ONe(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._insertElement(h,Bi.HTML);break}case dt.OPTGROUP:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._insertElement(h,Bi.HTML);break}case dt.HR:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.INPUT:case dt.KEYGEN:case dt.TEXTAREA:case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),h.tagID!==dt.SELECT&&o._processStartTag(h));break}case dt.SCRIPT:case dt.TEMPLATE:{V5(o,h);break}}}function NNe(o,h){switch(h.tagID){case dt.OPTGROUP:{o.openElements.stackTop>0&&o.openElements.currentTagId===dt.OPTION&&o.openElements.tagIDs[o.openElements.stackTop-1]===dt.OPTGROUP&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop();break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop();break}case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode());break}case dt.TEMPLATE:{aP(o,h);break}}}function KGn(o,h){const b=h.tagID;b===dt.CAPTION||b===dt.TABLE||b===dt.TBODY||b===dt.TFOOT||b===dt.THEAD||b===dt.TR||b===dt.TD||b===dt.TH?(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o._processStartTag(h)):ONe(o,h)}function VGn(o,h){const b=h.tagID;b===dt.CAPTION||b===dt.TABLE||b===dt.TBODY||b===dt.TFOOT||b===dt.THEAD||b===dt.TR||b===dt.TD||b===dt.TH?o.openElements.hasInTableScope(b)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o.onEndTag(h)):NNe(o,h)}function YGn(o,h){switch(h.tagID){case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{V5(o,h);break}case dt.CAPTION:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.tmplInsertionModeStack[0]=Ze.IN_TABLE,o.insertionMode=Ze.IN_TABLE,Hj(o,h);break}case dt.COL:{o.tmplInsertionModeStack[0]=Ze.IN_COLUMN_GROUP,o.insertionMode=Ze.IN_COLUMN_GROUP,sFt(o,h);break}case dt.TR:{o.tmplInsertionModeStack[0]=Ze.IN_TABLE_BODY,o.insertionMode=Ze.IN_TABLE_BODY,Obt(o,h);break}case dt.TD:case dt.TH:{o.tmplInsertionModeStack[0]=Ze.IN_ROW,o.insertionMode=Ze.IN_ROW,Nbt(o,h);break}default:o.tmplInsertionModeStack[0]=Ze.IN_BODY,o.insertionMode=Ze.IN_BODY,vm(o,h)}}function JGn(o,h){h.tagID===dt.TEMPLATE&&aP(o,h)}function PNe(o,h){o.openElements.tmplCount>0?(o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode(),o.onEof(h)):oFt(o,h)}function XGn(o,h){h.tagID===dt.HTML?vm(o,h):Qmt(o,h)}function LNe(o,h){var b;if(h.tagID===dt.HTML){if(o.fragmentContext||(o.insertionMode=Ze.AFTER_AFTER_BODY),o.options.sourceCodeLocationInfo&&o.openElements.tagIDs[0]===dt.HTML){o._setEndLocation(o.openElements.items[0],h);const k=o.openElements.items[1];k&&!(!((b=o.treeAdapter.getNodeSourceCodeLocation(k))===null||b===void 0)&&b.endTag)&&o._setEndLocation(k,h)}}else Qmt(o,h)}function Qmt(o,h){o.insertionMode=Ze.IN_BODY,Cbt(o,h)}function QGn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.FRAMESET:{o._insertElement(h,Bi.HTML);break}case dt.FRAME:{o._appendElement(h,Bi.HTML),h.ackSelfClosing=!0;break}case dt.NOFRAMES:{V5(o,h);break}}}function ZGn(o,h){h.tagID===dt.FRAMESET&&!o.openElements.isRootHtmlElementCurrent()&&(o.openElements.pop(),!o.fragmentContext&&o.openElements.currentTagId!==dt.FRAMESET&&(o.insertionMode=Ze.AFTER_FRAMESET))}function tqn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.NOFRAMES:{V5(o,h);break}}}function eqn(o,h){h.tagID===dt.HTML&&(o.insertionMode=Ze.AFTER_AFTER_FRAMESET)}function nqn(o,h){h.tagID===dt.HTML?vm(o,h):Dmt(o,h)}function Dmt(o,h){o.insertionMode=Ze.IN_BODY,Cbt(o,h)}function rqn(o,h){switch(h.tagID){case dt.HTML:{vm(o,h);break}case dt.NOFRAMES:{V5(o,h);break}}}function iqn(o,h){h.chars=Wf,o._insertCharacters(h)}function aqn(o,h){o._insertCharacters(h),o.framesetOk=!1}function MNe(o){for(;o.treeAdapter.getNamespaceURI(o.openElements.current)!==Bi.HTML&&!o._isIntegrationPoint(o.openElements.currentTagId,o.openElements.current);)o.openElements.pop()}function oqn(o,h){if(xUn(h))MNe(o),o._startTagOutsideForeignContent(h);else{const b=o._getAdjustedCurrentElement(),k=o.treeAdapter.getNamespaceURI(b);k===Bi.MATHML?bNe(h):k===Bi.SVG&&(kUn(h),yNe(h)),iFt(h),h.selfClosing?o._appendElement(h,k):o._insertElement(h,k),h.ackSelfClosing=!0}}function sqn(o,h){if(h.tagID===dt.P||h.tagID===dt.BR){MNe(o),o._endTagOutsideForeignContent(h);return}for(let b=o.openElements.stackTop;b>0;b--){const k=o.openElements.items[b];if(o.treeAdapter.getNamespaceURI(k)===Bi.HTML){o._endTagOutsideForeignContent(h);break}const O=o.treeAdapter.getTagName(k);if(O.toLowerCase()===h.tagName){h.tagName=O,o.openElements.shortenToLength(b);break}}}ur.AREA,ur.BASE,ur.BASEFONT,ur.BGSOUND,ur.BR,ur.COL,ur.EMBED,ur.FRAME,ur.HR,ur.IMG,ur.INPUT,ur.KEYGEN,ur.LINK,ur.META,ur.PARAM,ur.SOURCE,ur.TRACK,ur.WBR;const cqn=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,uqn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),jAe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function DNe(o,h){const b=wqn(o),k=nFt("type",{handlers:{root:lqn,element:hqn,text:fqn,comment:BNe,doctype:dqn,raw:gqn},unknown:mqn}),O={parser:b?new DAe(jAe):DAe.getFragmentParser(void 0,jAe),handle(G){k(G,O)},stitches:!1,options:h||{}};k(o,O),tF(O,b6());const P=b?O.parser.document:O.parser.getFragment(),B=hzn(P,{file:O.options.file});return O.stitches&&Qjt(B,"comment",function(G,J,U){const nt=G;if(nt.value.stitch&&U&&J!==void 0){const at=U.children;return at[J]=nt.value.stitch,J}}),B.type==="root"&&B.children.length===1&&B.children[0].type===o.type?B.children[0]:B}function RNe(o,h){let b=-1;if(o)for(;++b<o.length;)h.handle(o[b])}function lqn(o,h){RNe(o.children,h)}function hqn(o,h){bqn(o,h),RNe(o.children,h),yqn(o,h)}function fqn(o,h){h.parser.tokenizer.state>4&&(h.parser.tokenizer.state=0);const b={type:vu.CHARACTER,chars:o.value,location:UX(o)};tF(h,b6(o)),h.parser.currentToken=b,h.parser._processToken(h.parser.currentToken)}function dqn(o,h){const b={type:vu.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:UX(o)};tF(h,b6(o)),h.parser.currentToken=b,h.parser._processToken(h.parser.currentToken)}function pqn(o,h){h.stitches=!0;const b=vqn(o);if("children"in o&&"children"in b){const k=DNe({type:"root",children:o.children},h.options);b.children=k.children}BNe({type:"comment",value:{stitch:b}},h)}function BNe(o,h){const b=o.value,k={type:vu.COMMENT,data:b,location:UX(o)};tF(h,b6(o)),h.parser.currentToken=k,h.parser._processToken(h.parser.currentToken)}function gqn(o,h){if(h.parser.tokenizer.preprocessor.html="",h.parser.tokenizer.preprocessor.pos=-1,h.parser.tokenizer.preprocessor.lastGapPos=-2,h.parser.tokenizer.preprocessor.gapStack=[],h.parser.tokenizer.preprocessor.skipNextNewLine=!1,h.parser.tokenizer.preprocessor.lastChunkWritten=!1,h.parser.tokenizer.preprocessor.endOfChunkHit=!1,h.parser.tokenizer.preprocessor.isEol=!1,jNe(h,b6(o)),h.parser.tokenizer.write(h.options.tagfilter?o.value.replace(cqn,"&lt;$1$2"):o.value,!1),h.parser.tokenizer._runParsingLoop(),h.parser.tokenizer.state===72||h.parser.tokenizer.state===78){h.parser.tokenizer.preprocessor.lastChunkWritten=!0;const b=h.parser.tokenizer._consume();h.parser.tokenizer._callState(b)}}function mqn(o,h){const b=o;if(h.options.passThrough&&h.options.passThrough.includes(b.type))pqn(b,h);else{let k="";throw uqn.has(b.type)&&(k=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+b.type+"` node"+k)}}function tF(o,h){jNe(o,h);const b=o.parser.tokenizer.currentCharacterToken;b&&b.location&&(b.location.endLine=o.parser.tokenizer.preprocessor.line,b.location.endCol=o.parser.tokenizer.preprocessor.col+1,b.location.endOffset=o.parser.tokenizer.preprocessor.offset+1,o.parser.currentToken=b,o.parser._processToken(o.parser.currentToken)),o.parser.tokenizer.paused=!1,o.parser.tokenizer.inLoop=!1,o.parser.tokenizer.active=!1,o.parser.tokenizer.returnState=C1.DATA,o.parser.tokenizer.charRefCode=-1,o.parser.tokenizer.consumedAfterSnapshot=-1,o.parser.tokenizer.currentLocation=null,o.parser.tokenizer.currentCharacterToken=null,o.parser.tokenizer.currentToken=null,o.parser.tokenizer.currentAttr={name:"",value:""}}function jNe(o,h){if(h&&h.offset!==void 0){const b={startLine:h.line,startCol:h.column,startOffset:h.offset,endLine:-1,endCol:-1,endOffset:-1};o.parser.tokenizer.preprocessor.lineStartPos=-h.column+1,o.parser.tokenizer.preprocessor.droppedBufferSize=h.offset,o.parser.tokenizer.preprocessor.line=h.line,o.parser.tokenizer.currentLocation=b}}function bqn(o,h){const b=o.tagName.toLowerCase();if(h.parser.tokenizer.state===C1.PLAINTEXT)return;tF(h,b6(o));const k=h.parser.openElements.current;let O="namespaceURI"in k?k.namespaceURI:qN.html;O===qN.html&&b==="svg"&&(O=qN.svg);const P=Szn({...o,children:[]},{space:O===qN.svg?"svg":"html"}),B={type:vu.START_TAG,tagName:b,tagID:Zj(b),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in P?P.attrs:[],location:UX(o)};h.parser.currentToken=B,h.parser._processToken(h.parser.currentToken),h.parser.tokenizer.lastStartTagName=b}function yqn(o,h){const b=o.tagName.toLowerCase();if(!h.parser.tokenizer.inForeignNode&&iNe.includes(b)||h.parser.tokenizer.state===C1.PLAINTEXT)return;tF(h,Ebt(o));const k={type:vu.END_TAG,tagName:b,tagID:Zj(b),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:UX(o)};h.parser.currentToken=k,h.parser._processToken(h.parser.currentToken),b===h.parser.tokenizer.lastStartTagName&&(h.parser.tokenizer.state===C1.RCDATA||h.parser.tokenizer.state===C1.RAWTEXT||h.parser.tokenizer.state===C1.SCRIPT_DATA)&&(h.parser.tokenizer.state=C1.DATA)}function wqn(o){const h=o.type==="root"?o.children[0]:o;return!!(h&&(h.type==="doctype"||h.type==="element"&&h.tagName.toLowerCase()==="html"))}function UX(o){const h=b6(o)||{line:void 0,column:void 0,offset:void 0},b=Ebt(o)||{line:void 0,column:void 0,offset:void 0};return{startLine:h.line,startCol:h.column,startOffset:h.offset,endLine:b.line,endCol:b.column,endOffset:b.offset}}function vqn(o){return"children"in o?$j({...o,children:[]}):$j(o)}function xqn(o){return function(h,b){return DNe(h,{...o,file:b})}}const kqn=/["&'<>`]/g,_qn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Eqn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Tqn=/[|\\{}()[\]^$+*?.]/g,FAe=new WeakMap;function Sqn(o,h){if(o=o.replace(h.subset?Iqn(h.subset):kqn,k),h.subset||h.escapeOnly)return o;return o.replace(_qn,b).replace(Eqn,k);function b(O,P,B){return h.format((O.charCodeAt(0)-55296)*1024+O.charCodeAt(1)-56320+65536,B.charCodeAt(P+2),h)}function k(O,P,B){return h.format(O.charCodeAt(0),B.charCodeAt(P+1),h)}}function Iqn(o){let h=FAe.get(o);return h||(h=Cqn(o),FAe.set(o,h)),h}function Cqn(o){const h=[];let b=-1;for(;++b<o.length;)h.push(o[b].replace(Tqn,"\\$&"));return new RegExp("(?:"+h.join("|")+")","g")}const Aqn=/[\dA-Fa-f]/;function Oqn(o,h,b){const k="&#x"+o.toString(16).toUpperCase();return b&&h&&!Aqn.test(String.fromCharCode(h))?k:k+";"}const Nqn=/\d/;function Pqn(o,h,b){const k="&#"+String(o);return b&&h&&!Nqn.test(String.fromCharCode(h))?k:k+";"}const Lqn=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],ARt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Mqn=["cent","copy","divide","gt","lt","not","para","times"],FNe={}.hasOwnProperty,zBt={};let xmt;for(xmt in ARt)FNe.call(ARt,xmt)&&(zBt[ARt[xmt]]=xmt);const Dqn=/[^\dA-Za-z]/;function Rqn(o,h,b,k){const O=String.fromCharCode(o);if(FNe.call(zBt,O)){const P=zBt[O],B="&"+P;return b&&Lqn.includes(P)&&!Mqn.includes(P)&&(!k||h&&h!==61&&Dqn.test(String.fromCharCode(h)))?B:B+";"}return""}function Bqn(o,h,b){let k=Oqn(o,h,b.omitOptionalSemicolons),O;if((b.useNamedReferences||b.useShortestReferences)&&(O=Rqn(o,h,b.omitOptionalSemicolons,b.attribute)),(b.useShortestReferences||!O)&&b.useShortestReferences){const P=Pqn(o,h,b.omitOptionalSemicolons);P.length<k.length&&(k=P)}return O&&(!b.useShortestReferences||O.length<k.length)?O:k}function Lj(o,h){return Sqn(o,Object.assign({format:Bqn},h))}const jqn=/^>|^->|<!--|-->|--!>|<!-$/g,Fqn=[">"],$qn=["<",">"];function Hqn(o,h,b,k){return k.settings.bogusComments?"<?"+Lj(o.value,Object.assign({},k.settings.characterReferences,{subset:Fqn}))+">":"<!--"+o.value.replace(jqn,O)+"-->";function O(P){return Lj(P,Object.assign({},k.settings.characterReferences,{subset:$qn}))}}function zqn(o,h,b,k){return"<!"+(k.settings.upperDoctype?"DOCTYPE":"doctype")+(k.settings.tightDoctype?"":" ")+"html>"}function $Ae(o,h){const b=String(o);if(typeof h!="string")throw new TypeError("Expected character");let k=0,O=b.indexOf(h);for(;O!==-1;)k++,O=b.indexOf(h,O+h.length);return k}const Xp=HNe(1),$Ne=HNe(-1),Uqn=[];function HNe(o){return h;function h(b,k,O){const P=b?b.children:Uqn;let B=(k||0)+o,G=P[B];if(!O)for(;G&&xbt(G);)B+=o,G=P[B];return G}}const Gqn={}.hasOwnProperty;function zNe(o){return h;function h(b,k,O){return Gqn.call(o,b.tagName)&&o[b.tagName](b,k,O)}}const cFt=zNe({body:Wqn,caption:ORt,colgroup:ORt,dd:Jqn,dt:Yqn,head:ORt,html:qqn,li:Vqn,optgroup:Xqn,option:Qqn,p:Kqn,rp:HAe,rt:HAe,tbody:tWn,td:zAe,tfoot:eWn,th:zAe,thead:Zqn,tr:nWn});function ORt(o,h,b){const k=Xp(b,h,!0);return!k||k.type!=="comment"&&!(k.type==="text"&&xbt(k.value.charAt(0)))}function qqn(o,h,b){const k=Xp(b,h);return!k||k.type!=="comment"}function Wqn(o,h,b){const k=Xp(b,h);return!k||k.type!=="comment"}function Kqn(o,h,b){const k=Xp(b,h);return k?k.type==="element"&&(k.tagName==="address"||k.tagName==="article"||k.tagName==="aside"||k.tagName==="blockquote"||k.tagName==="details"||k.tagName==="div"||k.tagName==="dl"||k.tagName==="fieldset"||k.tagName==="figcaption"||k.tagName==="figure"||k.tagName==="footer"||k.tagName==="form"||k.tagName==="h1"||k.tagName==="h2"||k.tagName==="h3"||k.tagName==="h4"||k.tagName==="h5"||k.tagName==="h6"||k.tagName==="header"||k.tagName==="hgroup"||k.tagName==="hr"||k.tagName==="main"||k.tagName==="menu"||k.tagName==="nav"||k.tagName==="ol"||k.tagName==="p"||k.tagName==="pre"||k.tagName==="section"||k.tagName==="table"||k.tagName==="ul"):!b||!(b.type==="element"&&(b.tagName==="a"||b.tagName==="audio"||b.tagName==="del"||b.tagName==="ins"||b.tagName==="map"||b.tagName==="noscript"||b.tagName==="video"))}function Vqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&k.tagName==="li"}function Yqn(o,h,b){const k=Xp(b,h);return!!(k&&k.type==="element"&&(k.tagName==="dt"||k.tagName==="dd"))}function Jqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="dt"||k.tagName==="dd")}function HAe(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="rp"||k.tagName==="rt")}function Xqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&k.tagName==="optgroup"}function Qqn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="option"||k.tagName==="optgroup")}function Zqn(o,h,b){const k=Xp(b,h);return!!(k&&k.type==="element"&&(k.tagName==="tbody"||k.tagName==="tfoot"))}function tWn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="tbody"||k.tagName==="tfoot")}function eWn(o,h,b){return!Xp(b,h)}function nWn(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&k.tagName==="tr"}function zAe(o,h,b){const k=Xp(b,h);return!k||k.type==="element"&&(k.tagName==="td"||k.tagName==="th")}const rWn=zNe({body:oWn,colgroup:sWn,head:aWn,html:iWn,tbody:cWn});function iWn(o){const h=Xp(o,-1);return!h||h.type!=="comment"}function aWn(o){const h=new Set;for(const k of o.children)if(k.type==="element"&&(k.tagName==="base"||k.tagName==="title")){if(h.has(k.tagName))return!1;h.add(k.tagName)}const b=o.children[0];return!b||b.type==="element"}function oWn(o){const h=Xp(o,-1,!0);return!h||h.type!=="comment"&&!(h.type==="text"&&xbt(h.value.charAt(0)))&&!(h.type==="element"&&(h.tagName==="meta"||h.tagName==="link"||h.tagName==="script"||h.tagName==="style"||h.tagName==="template"))}function sWn(o,h,b){const k=$Ne(b,h),O=Xp(o,-1,!0);return b&&k&&k.type==="element"&&k.tagName==="colgroup"&&cFt(k,b.children.indexOf(k),b)?!1:!!(O&&O.type==="element"&&O.tagName==="col")}function cWn(o,h,b){const k=$Ne(b,h),O=Xp(o,-1);return b&&k&&k.type==="element"&&(k.tagName==="thead"||k.tagName==="tbody")&&cFt(k,b.children.indexOf(k),b)?!1:!!(O&&O.type==="element"&&O.tagName==="tr")}const kmt={name:[[`
3233
3233
  \f\r &/=>`.split(""),`
3234
3234
  \f\r "&'/=>\``.split("")],[`\0
3235
3235
  \f\r "&'/<=>`.split(""),`\0
@@ -3237,7 +3237,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
3237
3237
  \f\r &>`.split(""),`\0
3238
3238
  \f\r "&'<=>\``.split("")],[`\0
3239
3239
  \f\r "&'<=>\``.split(""),`\0
3240
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function cWn(o,h,b,k){const O=k.schema,P=O.space==="svg"?!1:k.settings.omitOptionalTags;let B=O.space==="svg"?k.settings.closeEmptyElements:k.settings.voids.includes(o.tagName.toLowerCase());const G=[];let J;O.space==="html"&&o.tagName==="svg"&&(k.schema=nC);const U=uWn(k,o.properties),nt=k.all(O.space==="html"&&o.tagName==="template"?o.content:o);return k.schema=O,nt&&(B=!1),(U||!P||!nWn(o,h,b))&&(G.push("<",o.tagName,U?" "+U:""),B&&(O.space==="svg"||k.settings.closeSelfClosing)&&(J=U.charAt(U.length-1),(!k.settings.tightSelfClosing||J==="/"||J&&J!=='"'&&J!=="'")&&G.push(" "),G.push("/")),G.push(">")),G.push(nt),!B&&(!P||!cFt(o,h,b))&&G.push("</"+o.tagName+">"),G.join("")}function uWn(o,h){const b=[];let k=-1,O;if(h){for(O in h)if(h[O]!==null&&h[O]!==void 0){const P=lWn(o,O,h[O]);P&&b.push(P)}}for(;++k<b.length;){const P=o.settings.tightAttributes?b[k].charAt(b[k].length-1):void 0;k!==b.length-1&&P!=='"'&&P!=="'"&&(b[k]+=" ")}return b.join("")}function lWn(o,h,b){const k=kbt(o.schema,h),O=o.settings.allowParseErrors&&o.schema.space==="html"?0:1,P=o.settings.allowDangerousCharacters?0:1;let B=o.quote,G;if(k.overloadedBoolean&&(b===k.attribute||b==="")?b=!0:(k.boolean||k.overloadedBoolean)&&(typeof b!="string"||b===k.attribute||b==="")&&(b=!!b),b==null||b===!1||typeof b=="number"&&Number.isNaN(b))return"";const J=Lj(k.attribute,Object.assign({},o.settings.characterReferences,{subset:kmt.name[O][P]}));return b===!0||(b=Array.isArray(b)?(k.commaSeparated?jjt:$jt)(b,{padLeft:!o.settings.tightCommaSeparatedLists}):String(b),o.settings.collapseEmptyAttributes&&!b)?J:(o.settings.preferUnquoted&&(G=Lj(b,Object.assign({},o.settings.characterReferences,{attribute:!0,subset:kmt.unquoted[O][P]}))),G!==b&&(o.settings.quoteSmart&&$Ae(b,B)>$Ae(b,o.alternative)&&(B=o.alternative),G=B+Lj(b,Object.assign({},o.settings.characterReferences,{subset:(B==="'"?kmt.single:kmt.double)[O][P],attribute:!0}))+B),J+(G&&"="+G))}const hWn=["<","&"];function UNe(o,h,b,k){return b&&b.type==="element"&&(b.tagName==="script"||b.tagName==="style")?o.value:Lj(o.value,Object.assign({},k.settings.characterReferences,{subset:hWn}))}function fWn(o,h,b,k){return k.settings.allowDangerousHtml?o.value:UNe(o,h,b,k)}function dWn(o,h,b,k){return k.all(o)}const pWn=nFt("type",{invalid:gWn,unknown:mWn,handlers:{comment:$qn,doctype:Hqn,element:cWn,raw:fWn,root:dWn,text:UNe}});function gWn(o){throw new Error("Expected node, not `"+o+"`")}function mWn(o){const h=o;throw new Error("Cannot compile unknown node `"+h.type+"`")}const bWn={},yWn={},wWn=[];function vWn(o,h){const b=h||bWn,k=b.quote||'"',O=k==='"'?"'":'"';if(k!=='"'&&k!=="'")throw new Error("Invalid quote `"+k+"`, expected `'` or `\"`");return{one:xWn,all:kWn,settings:{omitOptionalTags:b.omitOptionalTags||!1,allowParseErrors:b.allowParseErrors||!1,allowDangerousCharacters:b.allowDangerousCharacters||!1,quoteSmart:b.quoteSmart||!1,preferUnquoted:b.preferUnquoted||!1,tightAttributes:b.tightAttributes||!1,upperDoctype:b.upperDoctype||!1,tightDoctype:b.tightDoctype||!1,bogusComments:b.bogusComments||!1,tightCommaSeparatedLists:b.tightCommaSeparatedLists||!1,tightSelfClosing:b.tightSelfClosing||!1,collapseEmptyAttributes:b.collapseEmptyAttributes||!1,allowDangerousHtml:b.allowDangerousHtml||!1,voids:b.voids||iNe,characterReferences:b.characterReferences||yWn,closeSelfClosing:b.closeSelfClosing||!1,closeEmptyElements:b.closeEmptyElements||!1},schema:b.space==="svg"?nC:FX,quote:k,alternative:O}.one(Array.isArray(o)?{type:"root",children:o}:o,void 0,void 0)}function xWn(o,h,b){return pWn(o,h,b,this)}function kWn(o){const h=[],b=o&&o.children||wWn;let k=-1;for(;++k<b.length;)h[k]=this.one(b[k],k,o);return h.join("")}function _Wn(o){const h=this,b={...h.data("settings"),...o};h.compiler=k;function k(O){return vWn(O,b)}}var GNe={};const qNe=function(o){if(o==null)return IWn;if(typeof o=="string")return SWn(o);if(typeof o=="object")return Array.isArray(o)?EWn(o):TWn(o);if(typeof o=="function")return Pbt(o);throw new Error("Expected function, string, or object as test")};function EWn(o){const h=[];let b=-1;for(;++b<o.length;)h[b]=qNe(o[b]);return Pbt(k);function k(...O){let P=-1;for(;++P<h.length;)if(h[P].call(this,...O))return!0;return!1}}function TWn(o){return Pbt(h);function h(b){let k;for(k in o)if(b[k]!==o[k])return!1;return!0}}function SWn(o){return Pbt(h);function h(b){return b&&b.type===o}}function Pbt(o){return h;function h(b,...k){return!!(b&&typeof b=="object"&&"type"in b&&o.call(this,b,...k))}}function IWn(){return!0}const WNe=!0,UBt=!1,KNe="skip",CWn=function(o,h,b,k){typeof h=="function"&&typeof b!="function"&&(k=b,b=h,h=null);const O=qNe(h),P=k?-1:1;B(o,void 0,[])();function B(G,J,U){const nt=G&&typeof G=="object"?G:{};if(typeof nt.type=="string"){const it=typeof nt.tagName=="string"?nt.tagName:typeof nt.name=="string"?nt.name:void 0;Object.defineProperty(at,"name",{value:"node ("+(G.type+(it?"<"+it+">":""))+")"})}return at;function at(){let it=[],st,tt,Et;if((!h||O(G,J,U[U.length-1]||null))&&(it=AWn(b(G,U)),it[0]===UBt))return it;if(G.children&&it[0]!==KNe)for(tt=(k?G.children.length:-1)+P,Et=U.concat(G);tt>-1&&tt<G.children.length;){if(st=B(G.children[tt],tt,Et)(),st[0]===UBt)return st;tt=typeof st[1]=="number"?st[1]:tt+P}return it}}};function AWn(o){return Array.isArray(o)?o:typeof o=="number"?[WNe,o]:[o]}const OWn=function(o,h,b,k){typeof h=="function"&&typeof b!="function"&&(k=b,b=h,h=null),CWn(o,h,O,k);function O(P,B){const G=B[B.length-1];return b(P,G?G.children.indexOf(P):null,G)}},NWn=Object.freeze(Object.defineProperty({__proto__:null,CONTINUE:WNe,EXIT:UBt,SKIP:KNe,visit:OWn},Symbol.toStringTag,{value:"Module"})),PWn=F7n(NWn);var Zmt={exports:{}};Zmt.exports;(function(o,h){(function(b,k){o.exports=k()})(ww,function(){function b(i){for(var u=[],g=1;g<arguments.length;g++)u[g-1]=arguments[g];var w=Array.from(typeof i=="string"?[i]:i);w[w.length-1]=w[w.length-1].replace(/\r?\n([\t ]*)$/,"");var _=w.reduce(function(C,N){var F=N.match(/\n([\t ]+|(?!\s).)/g);return F?C.concat(F.map(function(q){var W,Z;return(Z=(W=q.match(/[\t ]/g))===null||W===void 0?void 0:W.length)!==null&&Z!==void 0?Z:0})):C},[]);if(_.length){var E=new RegExp(`
3240
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function uWn(o,h,b,k){const O=k.schema,P=O.space==="svg"?!1:k.settings.omitOptionalTags;let B=O.space==="svg"?k.settings.closeEmptyElements:k.settings.voids.includes(o.tagName.toLowerCase());const G=[];let J;O.space==="html"&&o.tagName==="svg"&&(k.schema=nC);const U=lWn(k,o.properties),nt=k.all(O.space==="html"&&o.tagName==="template"?o.content:o);return k.schema=O,nt&&(B=!1),(U||!P||!rWn(o,h,b))&&(G.push("<",o.tagName,U?" "+U:""),B&&(O.space==="svg"||k.settings.closeSelfClosing)&&(J=U.charAt(U.length-1),(!k.settings.tightSelfClosing||J==="/"||J&&J!=='"'&&J!=="'")&&G.push(" "),G.push("/")),G.push(">")),G.push(nt),!B&&(!P||!cFt(o,h,b))&&G.push("</"+o.tagName+">"),G.join("")}function lWn(o,h){const b=[];let k=-1,O;if(h){for(O in h)if(h[O]!==null&&h[O]!==void 0){const P=hWn(o,O,h[O]);P&&b.push(P)}}for(;++k<b.length;){const P=o.settings.tightAttributes?b[k].charAt(b[k].length-1):void 0;k!==b.length-1&&P!=='"'&&P!=="'"&&(b[k]+=" ")}return b.join("")}function hWn(o,h,b){const k=kbt(o.schema,h),O=o.settings.allowParseErrors&&o.schema.space==="html"?0:1,P=o.settings.allowDangerousCharacters?0:1;let B=o.quote,G;if(k.overloadedBoolean&&(b===k.attribute||b==="")?b=!0:(k.boolean||k.overloadedBoolean)&&(typeof b!="string"||b===k.attribute||b==="")&&(b=!!b),b==null||b===!1||typeof b=="number"&&Number.isNaN(b))return"";const J=Lj(k.attribute,Object.assign({},o.settings.characterReferences,{subset:kmt.name[O][P]}));return b===!0||(b=Array.isArray(b)?(k.commaSeparated?jjt:$jt)(b,{padLeft:!o.settings.tightCommaSeparatedLists}):String(b),o.settings.collapseEmptyAttributes&&!b)?J:(o.settings.preferUnquoted&&(G=Lj(b,Object.assign({},o.settings.characterReferences,{attribute:!0,subset:kmt.unquoted[O][P]}))),G!==b&&(o.settings.quoteSmart&&$Ae(b,B)>$Ae(b,o.alternative)&&(B=o.alternative),G=B+Lj(b,Object.assign({},o.settings.characterReferences,{subset:(B==="'"?kmt.single:kmt.double)[O][P],attribute:!0}))+B),J+(G&&"="+G))}const fWn=["<","&"];function UNe(o,h,b,k){return b&&b.type==="element"&&(b.tagName==="script"||b.tagName==="style")?o.value:Lj(o.value,Object.assign({},k.settings.characterReferences,{subset:fWn}))}function dWn(o,h,b,k){return k.settings.allowDangerousHtml?o.value:UNe(o,h,b,k)}function pWn(o,h,b,k){return k.all(o)}const gWn=nFt("type",{invalid:mWn,unknown:bWn,handlers:{comment:Hqn,doctype:zqn,element:uWn,raw:dWn,root:pWn,text:UNe}});function mWn(o){throw new Error("Expected node, not `"+o+"`")}function bWn(o){const h=o;throw new Error("Cannot compile unknown node `"+h.type+"`")}const yWn={},wWn={},vWn=[];function xWn(o,h){const b=h||yWn,k=b.quote||'"',O=k==='"'?"'":'"';if(k!=='"'&&k!=="'")throw new Error("Invalid quote `"+k+"`, expected `'` or `\"`");return{one:kWn,all:_Wn,settings:{omitOptionalTags:b.omitOptionalTags||!1,allowParseErrors:b.allowParseErrors||!1,allowDangerousCharacters:b.allowDangerousCharacters||!1,quoteSmart:b.quoteSmart||!1,preferUnquoted:b.preferUnquoted||!1,tightAttributes:b.tightAttributes||!1,upperDoctype:b.upperDoctype||!1,tightDoctype:b.tightDoctype||!1,bogusComments:b.bogusComments||!1,tightCommaSeparatedLists:b.tightCommaSeparatedLists||!1,tightSelfClosing:b.tightSelfClosing||!1,collapseEmptyAttributes:b.collapseEmptyAttributes||!1,allowDangerousHtml:b.allowDangerousHtml||!1,voids:b.voids||iNe,characterReferences:b.characterReferences||wWn,closeSelfClosing:b.closeSelfClosing||!1,closeEmptyElements:b.closeEmptyElements||!1},schema:b.space==="svg"?nC:FX,quote:k,alternative:O}.one(Array.isArray(o)?{type:"root",children:o}:o,void 0,void 0)}function kWn(o,h,b){return gWn(o,h,b,this)}function _Wn(o){const h=[],b=o&&o.children||vWn;let k=-1;for(;++k<b.length;)h[k]=this.one(b[k],k,o);return h.join("")}function EWn(o){const h=this,b={...h.data("settings"),...o};h.compiler=k;function k(O){return xWn(O,b)}}var GNe={};const qNe=function(o){if(o==null)return CWn;if(typeof o=="string")return IWn(o);if(typeof o=="object")return Array.isArray(o)?TWn(o):SWn(o);if(typeof o=="function")return Pbt(o);throw new Error("Expected function, string, or object as test")};function TWn(o){const h=[];let b=-1;for(;++b<o.length;)h[b]=qNe(o[b]);return Pbt(k);function k(...O){let P=-1;for(;++P<h.length;)if(h[P].call(this,...O))return!0;return!1}}function SWn(o){return Pbt(h);function h(b){let k;for(k in o)if(b[k]!==o[k])return!1;return!0}}function IWn(o){return Pbt(h);function h(b){return b&&b.type===o}}function Pbt(o){return h;function h(b,...k){return!!(b&&typeof b=="object"&&"type"in b&&o.call(this,b,...k))}}function CWn(){return!0}const WNe=!0,UBt=!1,KNe="skip",AWn=function(o,h,b,k){typeof h=="function"&&typeof b!="function"&&(k=b,b=h,h=null);const O=qNe(h),P=k?-1:1;B(o,void 0,[])();function B(G,J,U){const nt=G&&typeof G=="object"?G:{};if(typeof nt.type=="string"){const it=typeof nt.tagName=="string"?nt.tagName:typeof nt.name=="string"?nt.name:void 0;Object.defineProperty(at,"name",{value:"node ("+(G.type+(it?"<"+it+">":""))+")"})}return at;function at(){let it=[],st,tt,Et;if((!h||O(G,J,U[U.length-1]||null))&&(it=OWn(b(G,U)),it[0]===UBt))return it;if(G.children&&it[0]!==KNe)for(tt=(k?G.children.length:-1)+P,Et=U.concat(G);tt>-1&&tt<G.children.length;){if(st=B(G.children[tt],tt,Et)(),st[0]===UBt)return st;tt=typeof st[1]=="number"?st[1]:tt+P}return it}}};function OWn(o){return Array.isArray(o)?o:typeof o=="number"?[WNe,o]:[o]}const NWn=function(o,h,b,k){typeof h=="function"&&typeof b!="function"&&(k=b,b=h,h=null),AWn(o,h,O,k);function O(P,B){const G=B[B.length-1];return b(P,G?G.children.indexOf(P):null,G)}},PWn=Object.freeze(Object.defineProperty({__proto__:null,CONTINUE:WNe,EXIT:UBt,SKIP:KNe,visit:NWn},Symbol.toStringTag,{value:"Module"})),LWn=F7n(PWn);var Zmt={exports:{}};Zmt.exports;(function(o,h){(function(b,k){o.exports=k()})(ww,function(){function b(i){for(var u=[],g=1;g<arguments.length;g++)u[g-1]=arguments[g];var w=Array.from(typeof i=="string"?[i]:i);w[w.length-1]=w[w.length-1].replace(/\r?\n([\t ]*)$/,"");var _=w.reduce(function(C,N){var F=N.match(/\n([\t ]+|(?!\s).)/g);return F?C.concat(F.map(function(q){var W,Z;return(Z=(W=q.match(/[\t ]/g))===null||W===void 0?void 0:W.length)!==null&&Z!==void 0?Z:0})):C},[]);if(_.length){var E=new RegExp(`
3241
3241
  [ ]{`+Math.min.apply(Math,_)+"}","g");w=w.map(function(C){return C.replace(E,`
3242
3242
  `)})}w[0]=w[0].replace(/^\r?\n/,"");var v=w[0];return u.forEach(function(C,N){var F=v.match(/(?:^|\n)( *)$/),q=F?F[1]:"",W=C;typeof C=="string"&&C.includes(`
3243
3243
  `)&&(W=String(C).split(`
@@ -4815,6 +4815,6 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
4815
4815
  .edge {
4816
4816
  fill: none;
4817
4817
  }
4818
- `}},Symbol.toStringTag,{value:"Module"}));return Aw})})(Zmt,Zmt.exports);var LWn=Zmt.exports,MWn=ww&&ww.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(GNe,"__esModule",{value:!0});var DWn=PWn,UAe=MWn(LWn),RWn=function(h){var b=h===void 0?{}:h,k=b.theme,O=k===void 0?"default":k;return function(P){var B=[];if((0,DWn.visit)(P,{type:"code",lang:"mermaid"},function(J,U,nt){B.push([J.value,U,nt])}),!B.length)return P;var G=B.map(function(J){var U=J[0],nt="mermaid"+Math.random().toString(36).slice(2);UAe.default.initialize({theme:O});var at=document.createElement("div");return at.innerHTML='<pre><code class="hljs language-mermaid">'.concat(UAe.default.render(nt,U),"</code></pre>"),at.innerHTML});B.forEach(function(J,U){var nt=J[1],at=J[2],it=G[U];at.children.splice(nt,1,{type:"html",value:it})})}},BWn=GNe.default=RWn;function X8(o){return pe.jsx(YHn,{remarkPlugins:[BWn],rehypePlugins:[vqn,_Wn],components:{img:({...h})=>pe.jsx("img",{...h,style:{display:"block",maxWidth:"100%",height:"auto"}})},children:o.children})}function jWn({execute:o}){return pe.jsxs(UN.Fragment,{children:[pe.jsxs(v3,{variant:"h5",children:[" ",FWn(o)," "]}),pe.jsx("hr",{}),pe.jsx(v3,{variant:"h6",children:" Description "}),pe.jsx(X8,{children:o.operation.function.description}),pe.jsx("br",{}),pe.jsx(v3,{variant:"h6",children:" Arguments "}),pe.jsx(X8,{children:["```json",JSON.stringify(o.arguments,null,2),"```"].join(`
4818
+ `}},Symbol.toStringTag,{value:"Module"}));return Aw})})(Zmt,Zmt.exports);var MWn=Zmt.exports,DWn=ww&&ww.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(GNe,"__esModule",{value:!0});var RWn=LWn,UAe=DWn(MWn),BWn=function(h){var b=h===void 0?{}:h,k=b.theme,O=k===void 0?"default":k;return function(P){var B=[];if((0,RWn.visit)(P,{type:"code",lang:"mermaid"},function(J,U,nt){B.push([J.value,U,nt])}),!B.length)return P;var G=B.map(function(J){var U=J[0],nt="mermaid"+Math.random().toString(36).slice(2);UAe.default.initialize({theme:O});var at=document.createElement("div");return at.innerHTML='<pre><code class="hljs language-mermaid">'.concat(UAe.default.render(nt,U),"</code></pre>"),at.innerHTML});B.forEach(function(J,U){var nt=J[1],at=J[2],it=G[U];at.children.splice(nt,1,{type:"html",value:it})})}},jWn=GNe.default=BWn;function X8(o){return pe.jsx(JHn,{remarkPlugins:[jWn],rehypePlugins:[xqn,EWn],components:{img:({...h})=>pe.jsx("img",{...h,style:{display:"block",maxWidth:"100%",height:"auto"}})},children:o.children})}function FWn({execute:o}){return pe.jsxs(UN.Fragment,{children:[pe.jsxs(v3,{variant:"h5",children:[" ",$Wn(o)," "]}),pe.jsx("hr",{}),pe.jsx(v3,{variant:"h6",children:" Description "}),pe.jsx(X8,{children:o.operation.function.description}),pe.jsx("br",{}),pe.jsx(v3,{variant:"h6",children:" Arguments "}),pe.jsx(X8,{children:["```json",JSON.stringify(o.arguments,null,2),"```"].join(`
4819
4819
  `)}),pe.jsx("br",{}),pe.jsx(v3,{variant:"h6",children:" Return Value "}),pe.jsx(X8,{children:["```json",JSON.stringify(o.value,null,2),"```"].join(`
4820
- `)})]})}function FWn(o){return o.operation.protocol==="http"?`${o.operation.function.method.toUpperCase()} ${o.operation.function.path}`:o.operation.function.name}function $Wn({history:o}){const[h,b]=fn.useState(!1);return pe.jsxs(JBt,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(_X,{children:[pe.jsx(KBt,{label:"Function Describer",variant:"outlined",color:"secondary"}),pe.jsx(X8,{children:o.text})]}),pe.jsx(h7e,{style:{textAlign:"right"},children:pe.jsx(Bmt,{startIcon:pe.jsx(uOe,{style:{transform:`rotate(${h?180:0}deg)`}}),onClick:()=>b(!h),children:h?"Hide Function Calls":"Show Function Calls"})}),pe.jsx(kX,{in:h,timeout:"auto",unmountOnExit:!0,children:pe.jsx(_X,{children:o.executes.map(k=>pe.jsx(jWn,{execute:k}))})})]})}const HWn=K5(pe.jsx("path",{d:"M4 7h16v2H4zm0 6h16v-2H4zm0 4h7v-2H4zm0 4h7v-2H4zm11.41-2.83L14 16.75l-1.41 1.41L15.41 21 20 16.42 18.58 15zM4 3v2h16V3z"}),"Grading");function zWn({selection:o}){const[h,b]=fn.useState(!1);return pe.jsxs(JBt,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(_X,{children:[pe.jsx(KBt,{icon:pe.jsx(HWn,{}),label:"Function Selector",variant:"outlined",color:"warning"}),pe.jsx("br",{}),pe.jsx("br",{}),"Operation:",o.operation.protocol==="http"?pe.jsxs("ul",{children:[pe.jsx("li",{children:o.operation.function.method.toUpperCase()}),pe.jsx("li",{children:o.operation.function.path})]}):pe.jsx("ul",{children:pe.jsx("li",{children:o.operation.function.name})}),pe.jsx(X8,{children:o.reason})]}),pe.jsx(h7e,{style:{textAlign:"right"},children:pe.jsx(Bmt,{onClick:()=>b(!h),children:h?"Hide Function Description":"Show Function Description"})}),pe.jsx(kX,{in:h,timeout:"auto",unmountOnExit:!0,children:pe.jsx(_X,{children:pe.jsx(X8,{children:o.operation.function.description})})})]})}const UWn=K5(pe.jsx("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face"),GWn=K5(pe.jsx("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13"}),"SmartToy");function qWn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:o.role==="user"?"flex-end":"flex-start"},children:pe.jsx(JBt,{elevation:3,style:{marginTop:15,marginBottom:15,marginLeft:o.role==="user"?"15%":void 0,marginRight:o.role==="assistant"?"15%":void 0,textAlign:o.role==="user"?"right":"left",backgroundColor:o.role==="user"?"lightyellow":void 0},children:pe.jsxs(_X,{children:[pe.jsx(KBt,{icon:o.role==="user"?pe.jsx(UWn,{}):pe.jsx(GWn,{}),label:o.role==="user"?"User":"Assistant",variant:"outlined",color:o.role==="user"?"primary":"success"}),pe.jsx(X8,{children:o.text})]})})})}function WWn({prompt:o}){return o.type==="text"?pe.jsx(qWn,{prompt:o}):o.type==="select"?o.selections.map(h=>pe.jsx(zWn,{selection:h})):o.type==="describe"?pe.jsx($Wn,{history:o}):null}function KWn(o){return pe.jsxs(UN.Fragment,{children:[pe.jsx(v3,{variant:"h5",children:" Function Stack "}),pe.jsx("hr",{}),o.selections.map(h=>pe.jsxs(d9n,{children:[pe.jsx(_9n,{expandIcon:pe.jsx(uOe,{}),children:pe.jsx(v3,{component:"h6",children:h.operation.protocol==="http"?`${h.operation.function.method.toUpperCase()} ${h.operation.function.path}`:h.operation.function.name})}),pe.jsxs(b9n,{children:[pe.jsx("hr",{}),h.reason,pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(X8,{children:h.operation.function.description})]})]}))]})}function VWn(o){const h=YWn(o.usage);return pe.jsxs(UN.Fragment,{children:[pe.jsx(v3,{variant:"h5",children:" Token Usage "}),pe.jsx("hr",{}),pe.jsxs(RPn,{children:[pe.jsx(JPn,{children:pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Type"}),pe.jsx(b3,{children:"Token Usage"}),pe.jsx(b3,{children:"Price"})]})}),pe.jsxs(HPn,{children:[pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Total"}),pe.jsx(b3,{children:o.usage.aggregate.total.toLocaleString()}),pe.jsxs(b3,{children:["$",h.total.toLocaleString()]})]}),pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Input"}),pe.jsx(b3,{children:o.usage.aggregate.input.total.toLocaleString()}),pe.jsxs(b3,{children:["$",h.prompt.toLocaleString()]})]}),pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Output"}),pe.jsx(b3,{children:o.usage.aggregate.output.total.toLocaleString()}),pe.jsxs(b3,{children:["$",h.completion.toLocaleString()]})]})]})]})]})}function YWn(o){const h=(o.aggregate.input.total-o.aggregate.input.cached)*25e-7+o.aggregate.input.cached*125e-8,b=o.aggregate.output.total*(10/1e6);return{total:h+b,prompt:h,completion:b}}function JWn(o){var h,b;return pe.jsxs("div",{style:{padding:25},children:[o.error!==null?pe.jsxs(pe.Fragment,{children:[pe.jsx(v3,{variant:"h5",color:"error",children:"OpenAI Error"}),pe.jsx("hr",{}),o.error.message,pe.jsx("br",{}),pe.jsx("br",{}),"Your OpenAI API key may not valid.",pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx("br",{})]}):null,pe.jsx(v3,{variant:"h5",children:"Agent Information"}),pe.jsx("hr",{}),pe.jsxs("ul",{children:[pe.jsxs("li",{children:["Model:"," ",o.vendor.model]}),pe.jsxs("li",{children:["Locale:"," ",((h=o.config)==null?void 0:h.locale)??navigator.language]}),pe.jsxs("li",{children:["Timezone:"," ",((b=o.config)==null?void 0:b.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(VWn,{usage:o.usage}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(KWn,{selections:o.selections})]})}const GAe=450;function XWn({agent:o,title:h}){const b=fn.useRef(null),k=fn.useRef(null),O=fn.useRef(null),P=fn.useRef(null),B=fn.useRef(null),[G,J]=fn.useState(null),[U,nt]=fn.useState(""),[at,it]=fn.useState(o.getHistories().slice()),[st,tt]=fn.useState(JSON.parse(JSON.stringify(o.getTokenUsage()))),[Et,Lt]=fn.useState(122),[Dt,ae]=fn.useState(!0),[qt,_e]=fn.useState([]),[gn,ge]=fn.useState(!1),Mn=async rr=>{await rr.join(),at.push(rr.toHistory()),it(at)},Wn=async rr=>{await rr.join(),at.push(rr.toHistory()),it(at)},cr=rr=>{at.push(rr.toHistory()),it(at),qt.push(rr.selection),_e(qt)},ar=rr=>{console.error(rr)};fn.useEffect(()=>(B.current!==null&&B.current.select(),o.on("text",Mn),o.on("describe",Wn),o.on("select",cr),o.on("validate",ar),tt(o.getTokenUsage()),()=>{o.off("text",Mn),o.off("describe",Wn),o.off("select",cr),o.off("validate",ar)}),[]);const bn=()=>{setTimeout(()=>{if(b.current===null||k.current===null||O.current===null)return;const rr=b.current.clientHeight+O.current.clientHeight;rr!==Et&&Lt(rr)})},Vn=async()=>{nt(""),ae(!1),bn();try{await o.conversate(U)}catch(Be){Be instanceof Error?(alert(Be.message),J(Be)):J(new Error("Unknown error"));return}at.splice(0,at.length),at.push(...o.getHistories()),it(at),tt(o.getTokenUsage()),ae(!0);const rr=o.getHistories().filter(Be=>Be.type==="select").map(Be=>Be.selections).flat();for(const Be of o.getHistories().filter(Js=>Js.type==="cancel").map(Js=>Js.selections).flat()){const Js=rr.findIndex(el=>el.operation.protocol===Be.operation.protocol&&el.operation.controller.name===Be.operation.controller.name&&el.operation.function.name===Be.operation.function.name);Js!==-1&&rr.splice(Js,1)}_e(rr)},hi=async rr=>{rr.key==="Enter"&&rr.shiftKey===!1&&(Dt===!1?rr.preventDefault():await Vn())},$n=async()=>{if(P.current===null)return;const rr=await yBn(P.current,{}),Be=document.createElement("a");Be.download="nestia-chat-screenshot.png",Be.href=rr,Be.click(),Be.remove()},Vt=tP(),Ye=ONn(Vt.breakpoints.down("lg")),jn=()=>pe.jsx("div",{style:{overflowY:"auto",height:"100%",width:Ye?"100%":`calc(100% - ${GAe}px)`,margin:0,backgroundColor:"lightblue"},children:pe.jsx(k8e,{style:{paddingBottom:50,width:"100%",minHeight:"100%",backgroundColor:"lightblue",margin:0},ref:P,children:at.map(rr=>pe.jsx(WWn,{prompt:rr})).filter(rr=>rr!==null)})}),er=()=>pe.jsx("div",{style:{width:Ye?void 0:GAe,height:"100%",overflowY:"auto",backgroundColor:"#eeeeee"},children:pe.jsx(k8e,{maxWidth:!1,onClick:Ye?()=>ge(!1):void 0,children:pe.jsx(JWn,{vendor:o.getVendor(),config:o.getConfig(),usage:st,selections:qt,error:G})})});return pe.jsxs("div",{style:{width:"100%",height:"100%"},children:[pe.jsx(g8e,{ref:b,position:"relative",component:"div",children:pe.jsxs($8e,{children:[pe.jsx(v3,{variant:"h6",component:"div",sx:{flexGrow:1},children:h??"Agentica Chatbot"}),Ye?pe.jsxs(pe.Fragment,{children:[pe.jsx(d8e,{onClick:()=>void $n().catch(()=>{}),children:pe.jsx(wCe,{})}),pe.jsx(d8e,{onClick:()=>ge(!0),children:pe.jsx(ERn,{})})]}):pe.jsx(Bmt,{color:"inherit",startIcon:pe.jsx(wCe,{}),onClick:()=>void $n().catch(()=>{}),children:"Screenshot Capture"})]})}),pe.jsx("div",{ref:k,style:{width:"100%",height:`calc(100% - ${Et}px)`,display:"flex",flexDirection:"row"},children:Ye?pe.jsxs(pe.Fragment,{children:[jn(),pe.jsx(iNn,{anchor:"right",open:gn,onClose:()=>ge(!1),children:er()})]}):pe.jsxs(pe.Fragment,{children:[jn(),er()]})}),pe.jsx(g8e,{ref:O,position:"static",component:"div",color:"inherit",children:pe.jsxs($8e,{children:[pe.jsx(ibt,{inputRef:B,fullWidth:!0,placeholder:"Conversate with AI Chatbot",value:U,multiline:!0,onKeyUp:rr=>void hi(rr).catch(()=>{}),onChange:rr=>{nt(rr.target.value),bn()}}),pe.jsx(Bmt,{variant:"contained",style:{marginLeft:10},startIcon:pe.jsx(TRn,{}),disabled:!Dt,onClick:()=>void Vn().catch(()=>{}),children:"Send"})]})})]})}function hKn(o){return pe.jsx(XWn,{...o})}function qAe(o){const[h,b]=fn.useState(o.config.apiKey),[k,O]=fn.useState(o.config.baseURL===void 0&&(o.config.vendorModel==="gpt-4o"||o.config.vendorModel==="gpt-4o-mini")?o.config.vendorModel:"manual"),[P,B]=fn.useState(o.config.vendorModel),[G,J]=fn.useState(o.config.schemaModel),[U,nt]=fn.useState(o.config.baseURL),at=()=>({schemaModel:G,vendorModel:P,apiKey:h,baseURL:U}),it=Dt=>{const ae=at();ae.apiKey=Dt,b(Dt),o.onChange(ae)},st=(Dt,ae)=>{const qt=at();O(ae),ae==="gpt-4o"||ae==="gpt-4o-mini"?(qt.vendorModel=ae,qt.baseURL=void 0,qt.schemaModel="chatgpt",nt(void 0),B(ae),J("chatgpt")):(qt.baseURL="https://openrouter.ai/api/v1",nt("https://openrouter.ai/api/v1")),o.onChange(qt)},tt=Dt=>{const ae=at();ae.baseURL=Dt,nt(Dt),o.onChange(ae)},Et=Dt=>{const ae=at();ae.vendorModel=Dt,B(Dt),o.onChange(ae)},Lt=Dt=>{const ae=at();ae.schemaModel=Dt,J(Dt),o.onChange(ae)};return pe.jsxs(pe.Fragment,{children:[pe.jsx(tRt,{onChange:Dt=>it(Dt.target.value),defaultValue:h,label:"OpenAI API Key",variant:"outlined",placeholder:"Your OpenAI API Key",error:h.length===0}),pe.jsx("br",{}),pe.jsxs(M8e,{defaultValue:k,onChange:st,style:{paddingLeft:15},children:[pe.jsx(JE,{control:pe.jsx(XE,{}),label:"GPT-4o Mini",value:"gpt-4o-mini"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"GPT-4o",value:"gpt-4o"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Manual Configuration",value:"manual"})]}),k==="manual"?pe.jsxs(pe.Fragment,{children:[pe.jsx("br",{}),pe.jsx(tRt,{fullWidth:!0,label:"Base URL",defaultValue:U,onChange:Dt=>tt(Dt.target.value)}),pe.jsx("br",{}),pe.jsx(tRt,{fullWidth:!0,label:"Vendor Model",defaultValue:P,onChange:Dt=>Et(Dt.target.value)}),pe.jsx("br",{}),pe.jsxs(M8e,{title:"Schema Model",defaultValue:G,onChange:(Dt,ae)=>Lt(ae),style:{paddingLeft:15},children:[pe.jsx(JE,{control:pe.jsx(XE,{}),label:"OpenAI ChatGPT",value:"chatgpt"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Anthropic Claude",value:"claude"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Google Gemini",value:"gemini"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Meta Llama",value:"llama"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"OpenAPI v3.0",value:"3.0"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"OpenAPI v3.1",value:"3.1"})]}),pe.jsx("br",{})]}):null,pe.jsx("br",{})]})}(o=>{function h(){return{schemaModel:"chatgpt",vendorModel:"gpt-4o-mini",apiKey:"",baseURL:void 0}}o.defaultConfig=h})(qAe||(qAe={}));export{$7e as A,Bmt as B,S1 as C,hNn as F,JRt as G,uBt as H,d8e as I,DLn as L,qRt as O,NX as P,HRt as S,tRt as T,qAe as V,nP as _,ONn as a,CNn as b,ku as c,hKn as d,MLn as e,ILn as f,r7e as g,YRt as h,ym as i,I1 as j,Br as k,FRt as l,$Rt as m,tP as u,ejt as v};
4820
+ `)})]})}function $Wn(o){return o.operation.protocol==="http"?`${o.operation.function.method.toUpperCase()} ${o.operation.function.path}`:o.operation.function.name}function HWn({history:o}){const[h,b]=fn.useState(!1);return pe.jsxs(JBt,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(_X,{children:[pe.jsx(KBt,{label:"Function Describer",variant:"outlined",color:"secondary"}),pe.jsx(X8,{children:o.text})]}),pe.jsx(h7e,{style:{textAlign:"right"},children:pe.jsx(Bmt,{startIcon:pe.jsx(uOe,{style:{transform:`rotate(${h?180:0}deg)`}}),onClick:()=>b(!h),children:h?"Hide Function Calls":"Show Function Calls"})}),pe.jsx(kX,{in:h,timeout:"auto",unmountOnExit:!0,children:pe.jsx(_X,{children:o.executes.map(k=>pe.jsx(FWn,{execute:k}))})})]})}const zWn=K5(pe.jsx("path",{d:"M4 7h16v2H4zm0 6h16v-2H4zm0 4h7v-2H4zm0 4h7v-2H4zm11.41-2.83L14 16.75l-1.41 1.41L15.41 21 20 16.42 18.58 15zM4 3v2h16V3z"}),"Grading");function UWn({selection:o}){const[h,b]=fn.useState(!1);return pe.jsxs(JBt,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(_X,{children:[pe.jsx(KBt,{icon:pe.jsx(zWn,{}),label:"Function Selector",variant:"outlined",color:"warning"}),pe.jsx("br",{}),pe.jsx("br",{}),"Operation:",o.operation.protocol==="http"?pe.jsxs("ul",{children:[pe.jsx("li",{children:o.operation.function.method.toUpperCase()}),pe.jsx("li",{children:o.operation.function.path})]}):pe.jsx("ul",{children:pe.jsx("li",{children:o.operation.function.name})}),pe.jsx(X8,{children:o.reason})]}),pe.jsx(h7e,{style:{textAlign:"right"},children:pe.jsx(Bmt,{onClick:()=>b(!h),children:h?"Hide Function Description":"Show Function Description"})}),pe.jsx(kX,{in:h,timeout:"auto",unmountOnExit:!0,children:pe.jsx(_X,{children:pe.jsx(X8,{children:o.operation.function.description})})})]})}const GWn=K5(pe.jsx("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face"),qWn=K5(pe.jsx("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13"}),"SmartToy");function WWn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:o.role==="user"?"flex-end":"flex-start"},children:pe.jsx(JBt,{elevation:3,style:{marginTop:15,marginBottom:15,marginLeft:o.role==="user"?"15%":void 0,marginRight:o.role==="assistant"?"15%":void 0,textAlign:o.role==="user"?"right":"left",backgroundColor:o.role==="user"?"lightyellow":void 0},children:pe.jsxs(_X,{children:[pe.jsx(KBt,{icon:o.role==="user"?pe.jsx(GWn,{}):pe.jsx(qWn,{}),label:o.role==="user"?"User":"Assistant",variant:"outlined",color:o.role==="user"?"primary":"success"}),pe.jsx(X8,{children:o.text})]})})})}function KWn({prompt:o}){return o.type==="text"?pe.jsx(WWn,{prompt:o}):o.type==="select"?o.selections.map(h=>pe.jsx(UWn,{selection:h})):o.type==="describe"?pe.jsx(HWn,{history:o}):null}function VWn(o){return pe.jsxs(UN.Fragment,{children:[pe.jsx(v3,{variant:"h5",children:" Function Stack "}),pe.jsx("hr",{}),o.selections.map(h=>pe.jsxs(d9n,{children:[pe.jsx(_9n,{expandIcon:pe.jsx(uOe,{}),children:pe.jsx(v3,{component:"h6",children:h.operation.protocol==="http"?`${h.operation.function.method.toUpperCase()} ${h.operation.function.path}`:h.operation.function.name})}),pe.jsxs(b9n,{children:[pe.jsx("hr",{}),h.reason,pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(X8,{children:h.operation.function.description})]})]}))]})}function YWn(o){const h=JWn(o.usage);return pe.jsxs(UN.Fragment,{children:[pe.jsx(v3,{variant:"h5",children:" Token Usage "}),pe.jsx("hr",{}),pe.jsxs(RPn,{children:[pe.jsx(JPn,{children:pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Type"}),pe.jsx(b3,{children:"Token Usage"}),pe.jsx(b3,{children:"Price"})]})}),pe.jsxs(HPn,{children:[pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Total"}),pe.jsx(b3,{children:o.usage.aggregate.total.toLocaleString()}),pe.jsxs(b3,{children:["$",h.total.toLocaleString()]})]}),pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Input"}),pe.jsx(b3,{children:o.usage.aggregate.input.total.toLocaleString()}),pe.jsxs(b3,{children:["$",h.prompt.toLocaleString()]})]}),pe.jsxs(omt,{children:[pe.jsx(b3,{children:"Output"}),pe.jsx(b3,{children:o.usage.aggregate.output.total.toLocaleString()}),pe.jsxs(b3,{children:["$",h.completion.toLocaleString()]})]})]})]})]})}function JWn(o){const h=(o.aggregate.input.total-o.aggregate.input.cached)*25e-7+o.aggregate.input.cached*125e-8,b=o.aggregate.output.total*(10/1e6);return{total:h+b,prompt:h,completion:b}}function XWn(o){var h,b;return pe.jsxs("div",{style:{padding:25},children:[o.error!==null?pe.jsxs(pe.Fragment,{children:[pe.jsx(v3,{variant:"h5",color:"error",children:"OpenAI Error"}),pe.jsx("hr",{}),o.error.message,pe.jsx("br",{}),pe.jsx("br",{}),"Your OpenAI API key may not valid.",pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx("br",{})]}):null,pe.jsx(v3,{variant:"h5",children:"Agent Information"}),pe.jsx("hr",{}),pe.jsxs("ul",{children:[pe.jsxs("li",{children:["Model:"," ",o.vendor.model]}),pe.jsxs("li",{children:["Locale:"," ",((h=o.config)==null?void 0:h.locale)??navigator.language]}),pe.jsxs("li",{children:["Timezone:"," ",((b=o.config)==null?void 0:b.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(YWn,{usage:o.usage}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(VWn,{selections:o.selections})]})}const GAe=450;function QWn({agent:o,title:h}){const b=fn.useRef(null),k=fn.useRef(null),O=fn.useRef(null),P=fn.useRef(null),B=fn.useRef(null),[G,J]=fn.useState(null),[U,nt]=fn.useState(""),[at,it]=fn.useState(o.getHistories().slice()),[st,tt]=fn.useState(JSON.parse(JSON.stringify(o.getTokenUsage()))),[Et,Lt]=fn.useState(122),[Dt,ae]=fn.useState(!0),[qt,_e]=fn.useState([]),[gn,ge]=fn.useState(!1),Mn=async rr=>{await rr.join(),at.push(rr.toHistory()),it(at)},Wn=async rr=>{await rr.join(),at.push(rr.toHistory()),it(at)},cr=rr=>{at.push(rr.toHistory()),it(at),qt.push(rr.selection),_e(qt)},ar=rr=>{console.error(rr)};fn.useEffect(()=>(B.current!==null&&B.current.select(),o.on("text",Mn),o.on("describe",Wn),o.on("select",cr),o.on("validate",ar),tt(o.getTokenUsage()),()=>{o.off("text",Mn),o.off("describe",Wn),o.off("select",cr),o.off("validate",ar)}),[]);const bn=()=>{setTimeout(()=>{if(b.current===null||k.current===null||O.current===null)return;const rr=b.current.clientHeight+O.current.clientHeight;rr!==Et&&Lt(rr)})},Vn=async()=>{nt(""),ae(!1),bn();try{await o.conversate(U)}catch(Be){Be instanceof Error?(alert(Be.message),J(Be)):J(new Error("Unknown error"));return}at.splice(0,at.length),at.push(...o.getHistories()),it(at),tt(o.getTokenUsage()),ae(!0);const rr=o.getHistories().filter(Be=>Be.type==="select").map(Be=>Be.selections).flat();for(const Be of o.getHistories().filter(Js=>Js.type==="cancel").map(Js=>Js.selections).flat()){const Js=rr.findIndex(el=>el.operation.protocol===Be.operation.protocol&&el.operation.controller.name===Be.operation.controller.name&&el.operation.function.name===Be.operation.function.name);Js!==-1&&rr.splice(Js,1)}_e(rr)},hi=async rr=>{rr.key==="Enter"&&rr.shiftKey===!1&&(Dt===!1?rr.preventDefault():await Vn())},$n=async()=>{if(P.current===null)return;const rr=await wBn(P.current,{}),Be=document.createElement("a");Be.download="nestia-chat-screenshot.png",Be.href=rr,Be.click(),Be.remove()},Vt=tP(),Ye=ONn(Vt.breakpoints.down("lg")),jn=()=>pe.jsx("div",{style:{overflowY:"auto",height:"100%",width:Ye?"100%":`calc(100% - ${GAe}px)`,margin:0,backgroundColor:"lightblue"},children:pe.jsx(k8e,{style:{paddingBottom:50,width:"100%",minHeight:"100%",backgroundColor:"lightblue",margin:0},ref:P,children:at.map(rr=>pe.jsx(KWn,{prompt:rr})).filter(rr=>rr!==null)})}),er=()=>pe.jsx("div",{style:{width:Ye?void 0:GAe,height:"100%",overflowY:"auto",backgroundColor:"#eeeeee"},children:pe.jsx(k8e,{maxWidth:!1,onClick:Ye?()=>ge(!1):void 0,children:pe.jsx(XWn,{vendor:o.getVendor(),config:o.getConfig(),usage:st,selections:qt,error:G})})});return pe.jsxs("div",{style:{width:"100%",height:"100%"},children:[pe.jsx(g8e,{ref:b,position:"relative",component:"div",children:pe.jsxs($8e,{children:[pe.jsx(v3,{variant:"h6",component:"div",sx:{flexGrow:1},children:h??"Agentica Chatbot"}),Ye?pe.jsxs(pe.Fragment,{children:[pe.jsx(d8e,{onClick:()=>void $n().catch(()=>{}),children:pe.jsx(wCe,{})}),pe.jsx(d8e,{onClick:()=>ge(!0),children:pe.jsx(TRn,{})})]}):pe.jsx(Bmt,{color:"inherit",startIcon:pe.jsx(wCe,{}),onClick:()=>void $n().catch(()=>{}),children:"Screenshot Capture"})]})}),pe.jsx("div",{ref:k,style:{width:"100%",height:`calc(100% - ${Et}px)`,display:"flex",flexDirection:"row"},children:Ye?pe.jsxs(pe.Fragment,{children:[jn(),pe.jsx(iNn,{anchor:"right",open:gn,onClose:()=>ge(!1),children:er()})]}):pe.jsxs(pe.Fragment,{children:[jn(),er()]})}),pe.jsx(g8e,{ref:O,position:"static",component:"div",color:"inherit",children:pe.jsxs($8e,{children:[pe.jsx(ibt,{inputRef:B,fullWidth:!0,placeholder:"Conversate with AI Chatbot",value:U,multiline:!0,onKeyUp:rr=>void hi(rr).catch(()=>{}),onChange:rr=>{nt(rr.target.value),bn()}}),pe.jsx(Bmt,{variant:"contained",style:{marginLeft:10},startIcon:pe.jsx(SRn,{}),disabled:!Dt,onClick:()=>void Vn().catch(()=>{}),children:"Send"})]})})]})}function fKn(o){return pe.jsx(QWn,{...o})}function qAe(o){const[h,b]=fn.useState(o.config.apiKey),[k,O]=fn.useState(o.config.baseURL===void 0&&(o.config.vendorModel==="gpt-4o"||o.config.vendorModel==="gpt-4o-mini")?o.config.vendorModel:"manual"),[P,B]=fn.useState(o.config.vendorModel),[G,J]=fn.useState(o.config.schemaModel),[U,nt]=fn.useState(o.config.baseURL),at=()=>({schemaModel:G,vendorModel:P,apiKey:h,baseURL:U}),it=Dt=>{const ae=at();ae.apiKey=Dt,b(Dt),o.onChange(ae)},st=(Dt,ae)=>{const qt=at();O(ae),ae==="gpt-4o"||ae==="gpt-4o-mini"?(qt.vendorModel=ae,qt.baseURL=void 0,qt.schemaModel="chatgpt",nt(void 0),B(ae),J("chatgpt")):(qt.baseURL="https://openrouter.ai/api/v1",nt("https://openrouter.ai/api/v1")),o.onChange(qt)},tt=Dt=>{const ae=at();ae.baseURL=Dt,nt(Dt),o.onChange(ae)},Et=Dt=>{const ae=at();ae.vendorModel=Dt,B(Dt),o.onChange(ae)},Lt=Dt=>{const ae=at();ae.schemaModel=Dt,J(Dt),o.onChange(ae)};return pe.jsxs(pe.Fragment,{children:[pe.jsx(tRt,{onChange:Dt=>it(Dt.target.value),defaultValue:h,label:"OpenAI API Key",variant:"outlined",placeholder:"Your OpenAI API Key",error:h.length===0}),pe.jsx("br",{}),pe.jsxs(M8e,{defaultValue:k,onChange:st,style:{paddingLeft:15},children:[pe.jsx(JE,{control:pe.jsx(XE,{}),label:"GPT-4o Mini",value:"gpt-4o-mini"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"GPT-4o",value:"gpt-4o"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Manual Configuration",value:"manual"})]}),k==="manual"?pe.jsxs(pe.Fragment,{children:[pe.jsx("br",{}),pe.jsx(tRt,{fullWidth:!0,label:"Base URL",defaultValue:U,onChange:Dt=>tt(Dt.target.value)}),pe.jsx("br",{}),pe.jsx(tRt,{fullWidth:!0,label:"Vendor Model",defaultValue:P,onChange:Dt=>Et(Dt.target.value)}),pe.jsx("br",{}),pe.jsxs(M8e,{title:"Schema Model",defaultValue:G,onChange:(Dt,ae)=>Lt(ae),style:{paddingLeft:15},children:[pe.jsx(JE,{control:pe.jsx(XE,{}),label:"OpenAI ChatGPT",value:"chatgpt"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Anthropic Claude",value:"claude"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Google Gemini",value:"gemini"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"Meta Llama",value:"llama"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"OpenAPI v3.0",value:"3.0"}),pe.jsx(JE,{control:pe.jsx(XE,{}),label:"OpenAPI v3.1",value:"3.1"})]}),pe.jsx("br",{})]}):null,pe.jsx("br",{})]})}(o=>{function h(){return{schemaModel:"chatgpt",vendorModel:"gpt-4o-mini",apiKey:"",baseURL:void 0}}o.defaultConfig=h})(qAe||(qAe={}));export{$7e as A,Bmt as B,S1 as C,hNn as F,JRt as G,uBt as H,d8e as I,DLn as L,qRt as O,NX as P,HRt as S,tRt as T,qAe as V,nP as _,ONn as a,CNn as b,ku as c,fKn as d,MLn as e,ILn as f,r7e as g,YRt as h,ym as i,I1 as j,Br as k,FRt as l,$Rt as m,tP as u,ejt as v};