import{s as oe,p as W}from"./vendor-c-99-Gw4UEZta.js";import{o as g}from"./vendor-d-100-DUwYIYiB.js";import{s as T,h as D,f as U,a as Me,n as K,P as X,T as x,b as A,g as ae}from"./vendor-p-112-kISQk9cd.js";import{b as ie,c as ze,p as J}from"./vendor-s-115-HsCUIFCF.js";import{n as G}from"./vendor-e-101-D7dDjsNb.js";import{a as se,l as De}from"./vendor-v-118-B42bNtZ1.js";import{p as y,v as Re,a as ue}from"./vendor-u-117-DC4Cwaa0.js";import{A as Y}from"./vendor-misc-bJru-SXh.js";import{w as b}from"./vendor-w-119-DEalYQv-.js";import{z as ce}from"./vendor-z-122-C2o2j-tx.js";const Ie=/[ \t\n\f\r]/g;function je(n){return typeof n=="object"?n.type==="text"?Z(n.value):!1:Z(n)}function Z(n){return n.replace(Ie,"")===""}const B={}.hasOwnProperty,Fe=new Map,Ue=/[A-Z]/g,Be=new Set(["table","tbody","thead","tfoot","tr"]),He=new Set(["td","th"]),pe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function il(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const l=e.filePath||void 0;let t;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");t=Je(l,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");t=Xe(l,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:t,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?T:D,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},o=fe(r,n,void 0);return o&&typeof o!="string"?o:r.create(n,r.Fragment,{children:o||void 0},void 0)}function fe(n,e,l){if(e.type==="element")return $e(n,e,l);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Ve(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return qe(n,e,l);if(e.type==="mdxjsEsm")return _e(n,e);if(e.type==="root")return We(n,e,l);if(e.type==="text")return Ke(n,e)}function $e(n,e,l){const t=n.schema;let r=t;e.tagName.toLowerCase()==="svg"&&t.space==="html"&&(r=T,n.schema=r),n.ancestors.push(e);const o=me(n,e.tagName,!1),i=Ge(n,e);let s=$(n,e);return Be.has(e.tagName)&&(s=s.filter(function(u){return typeof u=="string"?!je(u):!0})),de(n,i,o,e),H(i,s),n.ancestors.pop(),n.schema=t,n.create(e,o,i,l)}function Ve(n,e){if(e.data&&e.data.estree&&n.evaluater){const t=e.data.estree.body[0];return g(t.type==="ExpressionStatement"),n.evaluater.evaluateExpression(t.expression)}N(n,e.position)}function _e(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);N(n,e.position)}function qe(n,e,l){const t=n.schema;let r=t;e.name==="svg"&&t.space==="html"&&(r=T,n.schema=r),n.ancestors.push(e);const o=e.name===null?n.Fragment:me(n,e.name,!0),i=Ye(n,e),s=$(n,e);return de(n,i,o,e),H(i,s),n.ancestors.pop(),n.schema=t,n.create(e,o,i,l)}function We(n,e,l){const t={};return H(t,$(n,e)),n.create(e,n.Fragment,t,l)}function Ke(n,e){return e.value}function de(n,e,l,t){typeof l!="string"&&l!==n.Fragment&&n.passNode&&(e.node=t)}function H(n,e){if(e.length>0){const l=e.length>1?e:e[0];l&&(n.children=l)}}function Xe(n,e,l){return t;function t(r,o,i,s){const f=Array.isArray(i.children)?l:e;return s?f(o,i,s):f(o,i)}}function Je(n,e){return l;function l(t,r,o,i){const s=Array.isArray(o.children),u=y(t);return e(r,o,i,s,{columnNumber:u?u.column-1:void 0,fileName:n,lineNumber:u?u.line:void 0},void 0)}}function Ge(n,e){const l={};let t,r;for(r in e.properties)if(r!=="children"&&B.call(e.properties,r)){const o=Ze(n,r,e.properties[r]);if(o){const[i,s]=o;n.tableCellAlignToStyle&&i==="align"&&typeof s=="string"&&He.has(e.tagName)?t=s:l[i]=s}}if(t){const o=l.style||(l.style={});o[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=t}return l}function Ye(n,e){const l={};for(const t of e.attributes)if(t.type==="mdxJsxExpressionAttribute")if(t.data&&t.data.estree&&n.evaluater){const o=t.data.estree.body[0];g(o.type==="ExpressionStatement");const i=o.expression;g(i.type==="ObjectExpression");const s=i.properties[0];g(s.type==="SpreadElement"),Object.assign(l,n.evaluater.evaluateExpression(s.argument))}else N(n,e.position);else{const r=t.name;let o;if(t.value&&typeof t.value=="object")if(t.value.data&&t.value.data.estree&&n.evaluater){const s=t.value.data.estree.body[0];g(s.type==="ExpressionStatement"),o=n.evaluater.evaluateExpression(s.expression)}else N(n,e.position);else o=t.value===null?!0:t.value;l[r]=o}return l}function $(n,e){const l=[];let t=-1;const r=n.passKeys?new Map:Fe;for(;++t4&&l.slice(0,4)==="data"&&bn.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(te,wn);t="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!te.test(o)){let i=o.replace(vn,Sn);i.charAt(0)!=="-"&&(i="-"+i),e="data"+i}}r=_}return new r(t,e)}function Sn(n){return"-"+n.toLowerCase()}function wn(n){return n.charAt(1).toUpperCase()}const Tn=ke([ve,be,we,Te,kn],"html"),Pe=ke([ve,be,we,Te,xn],"svg"),Pn={},Ln={}.hasOwnProperty,Le=ce("type",{handlers:{root:Nn,element:Dn,text:Mn,comment:zn,doctype:On}});function En(n,e){const t=(e||Pn).space;return Le(n,t==="svg"?Pe:Tn)}function Nn(n,e){const l={nodeName:"#document",mode:(n.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return l.childNodes=q(n.children,l,e),L(n,l),l}function An(n,e){const l={nodeName:"#document-fragment",childNodes:[]};return l.childNodes=q(n.children,l,e),L(n,l),l}function On(n){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return L(n,e),e}function Mn(n){const e={nodeName:"#text",value:n.value,parentNode:null};return L(n,e),e}function zn(n){const e={nodeName:"#comment",data:n.value,parentNode:null};return L(n,e),e}function Dn(n,e){const l=e;let t=l;n.type==="element"&&n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(t=Pe);const r=[];let o;if(n.properties){for(o in n.properties)if(o!=="children"&&Ln.call(n.properties,o)){const u=Rn(t,o,n.properties[o]);u&&r.push(u)}}const i=t.space,s={nodeName:n.tagName,tagName:n.tagName,attrs:r,namespaceURI:b[i],childNodes:[],parentNode:null};return s.childNodes=q(n.children,s,t),L(n,s),n.tagName==="template"&&n.content&&(s.content=An(n.content,t)),s}function Rn(n,e,l){const t=Cn(n,e);if(l===!1||l===null||l===void 0||typeof l=="number"&&Number.isNaN(l)||!l&&t.boolean)return;Array.isArray(l)&&(l=t.commaSeparated?oe(l):ie(l));const r={name:t.attribute,value:l===!0?"":String(l)};if(t.space&&t.space!=="html"&&t.space!=="svg"){const o=r.name.indexOf(":");o<0?r.prefix="":(r.name=r.name.slice(o+1),r.prefix=t.attribute.slice(0,o)),r.namespace=b[t.space]}return r}function q(n,e,l){let t=-1;const r=[];if(n)for(;++t])/gi,Fn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),re={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Un(n,e){const l=Jn(n),t=ce("type",{handlers:{root:Bn,element:Hn,text:$n,comment:Ne,doctype:Vn,raw:qn},unknown:Wn}),r={parser:l?new X(re):X.getFragmentParser(void 0,re),handle(s){t(s,r)},stitches:!1,options:e||{}};t(n,r),E(r,y());const o=l?r.parser.document:r.parser.getFragment(),i=dn(o,{file:r.options.file});return r.stitches&&Re(i,"comment",function(s,u,f){const k=s;if(k.value.stitch&&f&&u!==void 0){const C=f.children;return C[u]=k.value.stitch,u}}),i.type==="root"&&i.children.length===1&&i.children[0].type===n.type?i.children[0]:i}function Ee(n,e){let l=-1;if(n)for(;++l4&&(e.parser.tokenizer.state=0);const l={type:A.CHARACTER,chars:n.value,location:M(n)};E(e,y(n)),e.parser.currentToken=l,e.parser._processToken(e.parser.currentToken)}function Vn(n,e){const l={type:A.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:M(n)};E(e,y(n)),e.parser.currentToken=l,e.parser._processToken(e.parser.currentToken)}function _n(n,e){e.stitches=!0;const l=Gn(n);if("children"in n&&"children"in l){const t=Un({type:"root",children:n.children},e.options);l.children=t.children}Ne({type:"comment",value:{stitch:l}},e)}function Ne(n,e){const l=n.value,t={type:A.COMMENT,data:l,location:M(n)};E(e,y(n)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function qn(n,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,Ae(e,y(n)),e.parser.tokenizer.write(e.options.tagfilter?n.value.replace(jn,"<$1$2"):n.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const l=e.parser.tokenizer._consume();e.parser.tokenizer._callState(l)}}function Wn(n,e){const l=n;if(e.options.passThrough&&e.options.passThrough.includes(l.type))_n(l,e);else{let t="";throw Fn.has(l.type)&&(t=". 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 `"+l.type+"` node"+t)}}function E(n,e){Ae(n,e);const l=n.parser.tokenizer.currentCharacterToken;l&&l.location&&(l.location.endLine=n.parser.tokenizer.preprocessor.line,l.location.endCol=n.parser.tokenizer.preprocessor.col+1,l.location.endOffset=n.parser.tokenizer.preprocessor.offset+1,n.parser.currentToken=l,n.parser._processToken(n.parser.currentToken)),n.parser.tokenizer.paused=!1,n.parser.tokenizer.inLoop=!1,n.parser.tokenizer.active=!1,n.parser.tokenizer.returnState=x.DATA,n.parser.tokenizer.charRefCode=-1,n.parser.tokenizer.consumedAfterSnapshot=-1,n.parser.tokenizer.currentLocation=null,n.parser.tokenizer.currentCharacterToken=null,n.parser.tokenizer.currentToken=null,n.parser.tokenizer.currentAttr={name:"",value:""}}function Ae(n,e){if(e&&e.offset!==void 0){const l={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};n.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,n.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,n.parser.tokenizer.preprocessor.line=e.line,n.parser.tokenizer.currentLocation=l}}function Kn(n,e){const l=n.tagName.toLowerCase();if(e.parser.tokenizer.state===x.PLAINTEXT)return;E(e,y(n));const t=e.parser.openElements.current;let r="namespaceURI"in t?t.namespaceURI:b.html;r===b.html&&l==="svg"&&(r=b.svg);const o=En({...n,children:[]},{space:r===b.svg?"svg":"html"}),i={type:A.START_TAG,tagName:l,tagID:ae(l),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:M(n)};e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=l}function Xn(n,e){const l=n.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&In.includes(l)||e.parser.tokenizer.state===x.PLAINTEXT)return;E(e,ue(n));const t={type:A.END_TAG,tagName:l,tagID:ae(l),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:M(n)};e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken),l===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===x.RCDATA||e.parser.tokenizer.state===x.RAWTEXT||e.parser.tokenizer.state===x.SCRIPT_DATA)&&(e.parser.tokenizer.state=x.DATA)}function Jn(n){const e=n.type==="root"?n.children[0]:n;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function M(n){const e=y(n)||{line:void 0,column:void 0,offset:void 0},l=ue(n)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:l.line,endCol:l.column,endOffset:l.offset}}function Gn(n){return"children"in n?Y({...n,children:[]}):Y(n)}export{Un as r,il as t,sl as u};