diff --git a/asset-manifest.json b/asset-manifest.json index 5ac284a..6bd9f82 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,25 +1,25 @@ { "files": { "main.css": "/static/css/main.020a7543.css", - "main.js": "/static/js/main.2b55a1ec.js", - "refractor-prismjs-vendor.0abbb2f3.js": "/static/js/refractor-prismjs-vendor.0abbb2f3.9bfa0335.js", + "main.js": "/static/js/main.1b8b16a1.js", + "refractor-prismjs-vendor.0abbb2f3.js": "/static/js/refractor-prismjs-vendor.0abbb2f3.38012b06.js", "react-vendor.js": "/static/js/react-vendor.b3fdfee2.js", "refractor-prismjs-vendor.3665b250.js": "/static/js/refractor-prismjs-vendor.3665b250.9abd5b17.js", - "refractor-prismjs-vendor.a81a7d65.js": "/static/js/refractor-prismjs-vendor.a81a7d65.609697fc.js", + "refractor-prismjs-vendor.a81a7d65.js": "/static/js/refractor-prismjs-vendor.a81a7d65.75681052.js", "index.html": "/index.html", "main.020a7543.css.map": "/static/css/main.020a7543.css.map", - "main.2b55a1ec.js.map": "/static/js/main.2b55a1ec.js.map", - "refractor-prismjs-vendor.0abbb2f3.9bfa0335.js.map": "/static/js/refractor-prismjs-vendor.0abbb2f3.9bfa0335.js.map", + "main.1b8b16a1.js.map": "/static/js/main.1b8b16a1.js.map", + "refractor-prismjs-vendor.0abbb2f3.38012b06.js.map": "/static/js/refractor-prismjs-vendor.0abbb2f3.38012b06.js.map", "react-vendor.b3fdfee2.js.map": "/static/js/react-vendor.b3fdfee2.js.map", "refractor-prismjs-vendor.3665b250.9abd5b17.js.map": "/static/js/refractor-prismjs-vendor.3665b250.9abd5b17.js.map", - "refractor-prismjs-vendor.a81a7d65.609697fc.js.map": "/static/js/refractor-prismjs-vendor.a81a7d65.609697fc.js.map" + "refractor-prismjs-vendor.a81a7d65.75681052.js.map": "/static/js/refractor-prismjs-vendor.a81a7d65.75681052.js.map" }, "entrypoints": [ "static/js/refractor-prismjs-vendor.3665b250.9abd5b17.js", - "static/js/refractor-prismjs-vendor.a81a7d65.609697fc.js", - "static/js/refractor-prismjs-vendor.0abbb2f3.9bfa0335.js", + "static/js/refractor-prismjs-vendor.a81a7d65.75681052.js", + "static/js/refractor-prismjs-vendor.0abbb2f3.38012b06.js", "static/js/react-vendor.b3fdfee2.js", "static/css/main.020a7543.css", - "static/js/main.2b55a1ec.js" + "static/js/main.1b8b16a1.js" ] } \ No newline at end of file diff --git a/coverage/coverage-summary.json b/coverage/coverage-summary.json index 11d5cbb..37fca5b 100644 --- a/coverage/coverage-summary.json +++ b/coverage/coverage-summary.json @@ -1,5 +1,7 @@ -{"total": {"lines":{"total":28,"covered":28,"skipped":0,"pct":100},"statements":{"total":30,"covered":30,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"branches":{"total":35,"covered":34,"skipped":0,"pct":97.14},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}} +{"total": {"lines":{"total":59,"covered":59,"skipped":0,"pct":100},"statements":{"total":62,"covered":62,"skipped":0,"pct":100},"functions":{"total":13,"covered":12,"skipped":0,"pct":92.3},"branches":{"total":45,"covered":43,"skipped":0,"pct":95.55},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}} ,"/home/runner/work/react-only-when/react-only-when/core/src/If.tsx": {"lines":{"total":2,"covered":2,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":2,"covered":2,"skipped":0,"pct":100},"branches":{"total":4,"covered":4,"skipped":0,"pct":100}} +,"/home/runner/work/react-only-when/react-only-when/core/src/case.tsx": {"lines":{"total":16,"covered":16,"skipped":0,"pct":100},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":18,"covered":18,"skipped":0,"pct":100},"branches":{"total":4,"covered":4,"skipped":0,"pct":100}} ,"/home/runner/work/react-only-when/react-only-when/core/src/index.tsx": {"lines":{"total":12,"covered":12,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":12,"covered":12,"skipped":0,"pct":100},"branches":{"total":18,"covered":17,"skipped":0,"pct":94.44}} -,"/home/runner/work/react-only-when/react-only-when/core/src/switch.tsx": {"lines":{"total":14,"covered":14,"skipped":0,"pct":100},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":16,"covered":16,"skipped":0,"pct":100},"branches":{"total":13,"covered":13,"skipped":0,"pct":100}} +,"/home/runner/work/react-only-when/react-only-when/core/src/switch.store.tsx": {"lines":{"total":12,"covered":12,"skipped":0,"pct":100},"functions":{"total":5,"covered":4,"skipped":0,"pct":80},"statements":{"total":12,"covered":12,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}} +,"/home/runner/work/react-only-when/react-only-when/core/src/switch.tsx": {"lines":{"total":17,"covered":17,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":18,"covered":18,"skipped":0,"pct":100},"branches":{"total":17,"covered":16,"skipped":0,"pct":94.11}} } diff --git a/coverage/lcov-report/If.tsx.html b/coverage/lcov-report/If.tsx.html index 78bf433..4ca9495 100644 --- a/coverage/lcov-report/If.tsx.html +++ b/coverage/lcov-report/If.tsx.html @@ -100,7 +100,7 @@

All files If.tsx

+ + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index a98c935..c0677a3 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -25,28 +25,28 @@

All files

100% Statements - 30/30 + 62/62
- 97.14% + 95.55% Branches - 34/35 + 43/45
- 100% + 92.3% Functions - 6/6 + 12/13
100% Lines - 28/28 + 59/59
@@ -93,6 +93,21 @@

All files

2/2 + + case.tsx + +
+ + 100% + 18/18 + 100% + 4/4 + 100% + 4/4 + 100% + 16/16 + + index.tsx @@ -109,18 +124,33 @@

All files

- switch.tsx + switch.store.tsx
100% - 16/16 + 12/12 100% - 13/13 + 2/2 + 80% + 4/5 100% - 4/4 + 12/12 + + + + switch.tsx + +
+ + 100% + 18/18 + 94.11% + 16/17 + 100% + 2/2 100% - 14/14 + 17/17 @@ -131,7 +161,7 @@

All files

+ + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/switch.tsx.html b/coverage/lcov-report/switch.tsx.html index e670828..089caa0 100644 --- a/coverage/lcov-report/switch.tsx.html +++ b/coverage/lcov-report/switch.tsx.html @@ -25,28 +25,28 @@

All files switch.tsx

100% Statements - 16/16 + 18/18
- 100% + 94.11% Branches - 13/13 + 16/17
100% Functions - 4/4 + 2/2
100% Lines - 14/14 + 17/17
@@ -89,58 +89,91 @@

All files switch.tsx

24 25 26 -27  +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38  +  +  +      1x -5x -5x -5x -9x -4x -4x -4x -2x +13x +13x +13x +13x +12x +22x +22x +22x   -5x -4x     -5x +13x +              -2x -2x - 
import { ReactElement, Children } from 'react';
-import { FC, PropsWithChildren } from 'react';
+1x
+13x
+ 
+13x
+5x
+3x
+3x
+ 
+ 
+13x
+ 
+ 
import { type FC, type PropsWithChildren } from 'react';
+import { DispatchSwitch, Context, useSwitch, useSwitchStore } from './switch.store';
+import { Case, Default } from './case';
+ 
+export * from './case';
  
 export const Switch: FC<PropsWithChildren<{}>> = ({ children }) => {
-  let matchChild: ReactElement | null = null;
-  let defaultCase: ReactElement | null = null;
-  Children.forEach(Children.toArray(children) as ReactElement<PropsWithChildren<CaseProps>>[], (child) => {
-    if (!matchChild && child.type === Case) {
-      const { condition } = child.props;
-      const conditionIsTrue = Boolean(condition);
-      if (conditionIsTrue) {
-        matchChild = child;
+  const [state, dispatch] = useSwitch();
+  const filteredChildren = [];
+  const childs = Array.isArray(children) ? children : children ? [children] : null;
+  if (childs) {
+    for (let i = 0; i < childs.length; i++) {
+      const child = childs[i];
+      Eif (child && (child.type === Case || child.type === Default)) {
+        filteredChildren.push(child);
       }
-    } else if (!defaultCase && child.type === Default) {
-      defaultCase = child;
     }
-  });
-  return matchChild ?? defaultCase ?? null;
+  }
+  return (
+    <Context.Provider value={state}>
+      <DispatchSwitch.Provider value={dispatch}>{childs}</DispatchSwitch.Provider>
+      <Render />
+    </Context.Provider>
+  );
 };
  
-export interface CaseProps {
-  readonly condition?: boolean;
-}
- 
-export const Case: FC<PropsWithChildren<CaseProps>> = ({ children }) => children;
-export const Default: FC<PropsWithChildren> = ({ children }) => children;
+const Render = () => {
+  const state = useSwitchStore();
+  let activeKey;
+  for (var key in state.active) {
+    if (state.active[key] === true) {
+      activeKey = key;
+      break;
+    }
+  }
+  return state[activeKey ?? 'default'] ?? null;
+};
  
@@ -148,7 +181,7 @@

All files switch.tsx

\ No newline at end of file +React App - A declarative component for conditional rendering.
\ No newline at end of file diff --git a/static/js/main.1b8b16a1.js b/static/js/main.1b8b16a1.js new file mode 100644 index 0000000..5a839aa --- /dev/null +++ b/static/js/main.1b8b16a1.js @@ -0,0 +1,3 @@ +/*! For license information please see main.1b8b16a1.js.LICENSE.txt */ +!function(){var e={363:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=363,e.exports=t},6282:function(e,t,r){"use strict";var n={};r.r(n),r.d(n,{attentionMarkers:function(){return vs},contentInitial:function(){return ps},disable:function(){return bs},document:function(){return us},flow:function(){return gs},flowInitial:function(){return fs},insideSpan:function(){return ys},string:function(){return hs},text:function(){return ms}});var a=r(6378);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(a[r]=e[r]);return a}function o(e,t){return t||(t=e.slice(0)),e.raw=t,e}var d=r(3528);r(9446);var c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0?k(U,--M):0,F--,10===B&&(F=1,N--),B}function K(){return B=M2||X(B)>3?"":" "}function ee(e,t){for(;--t&&K()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return Y(e,V()+(t<6&&32==z()&&32==K()))}function te(e){for(;K();)switch(B){case e:return M;case 34:case 39:34!==e&&39!==e&&te(B);break;case 40:41===e&&te(e);break;case 92:K()}return M}function re(e,t){for(;K()&&e+B!==57&&(e+B!==84||47!==z()););return"/*"+Y(t,M-1)+"*"+T(47===e?e:K())}function ne(e){for(;!X(z());)K();return Y(e,M)}function ae(e,t){for(var r="",n=0;n6)switch(k(e,t+1)){case 109:if(45!==k(e,t+4))break;case 102:return A(e,/(.+:)(.+)-([^]+)/,"$1"+h+"$2-$3$1"+g+(108==k(e,t+3)?"$3":"$2-$3"))+e;case 115:return~C(e,"stretch")?ie(A(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return A(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,r,n,a,s,i,o){return f+r+":"+n+o+(a?f+r+"-span:"+(s?i:+i-+n)+o:"")+e}));case 4949:if(121===k(e,t+6))return A(e,":",":"+h)+e;break;case 6444:switch(k(e,45===k(e,14)?18:11)){case 120:return A(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+h+(45===k(e,14)?"inline-":"")+"box$3$1"+h+"$2$3$1"+f+"$2box$3")+e;case 100:return A(e,":",":"+f)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return A(e,"scroll-","scroll-snap-")+e}return e}function oe(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case v:return void(e.return=ie(e.value,e.length,r));case x:return ae([G(e,{value:A(e.value,"@","@"+h)})],n);case y:if(e.length)return function(e,t){return e.map(t).join("")}(r=e.props,(function(t){switch(S(t,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":W(G(e,{props:[A(t,/:(read-\w+)/,":"+g+"$1")]})),W(G(e,{props:[t]})),w(e,{props:O(r,n)});break;case"::placeholder":W(G(e,{props:[A(t,/:(plac\w+)/,":"+h+"input-$1")]})),W(G(e,{props:[A(t,/:(plac\w+)/,":"+g+"$1")]})),W(G(e,{props:[A(t,/:(plac\w+)/,f+"input-$1")]})),W(G(e,{props:[t]})),w(e,{props:O(r,n)})}return""}))}}function de(e){return $(ce("",null,null,null,[""],e=J(e),0,[0],e))}function ce(e,t,r,n,a,s,i,o,d){for(var c=0,l=0,u=i,p=0,f=0,g=0,h=1,m=1,y=1,v=0,b="",x=a,R=s,E=n,w=b;m;)switch(g=v,v=K()){case 40:if(108!=g&&58==k(w,u-1)){-1!=C(w+=A(Q(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:w+=Q(v);break;case 9:case 10:case 13:case 32:w+=Z(g);break;case 92:w+=ee(V()-1,7);continue;case 47:switch(z()){case 42:case 47:D(ue(re(K(),V()),t,r,d),d);break;default:w+="/"}break;case 123*h:o[c++]=P(w)*y;case 125*h:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+l:-1==y&&(w=A(w,/\f/g,"")),f>0&&P(w)-u&&D(f>32?pe(w+";",n,r,u-1,d):pe(A(w," ","")+";",n,r,u-2,d),d);break;case 59:w+=";";default:if(D(E=le(w,t,r,c,l,a,o,b,x=[],R=[],u,s),s),123===v)if(0===l)ce(w,t,E,E,x,s,u,o,R);else switch(99===p&&110===k(w,3)?100:p){case 100:case 108:case 109:case 115:ce(e,E,E,n&&D(le(e,E,E,0,0,a,o,b,a,x=[],u,R),R),a,R,u,o,n?x:R);break;default:ce(w,E,E,E,[""],R,0,o,R)}}c=l=f=0,h=y=1,b=w="",u=i;break;case 58:u=1+P(w),f=g;default:if(h<1)if(123==v)--h;else if(125==v&&0==h++&&125==q())continue;switch(w+=T(v),v*h){case 38:y=l>0?1:(w+="\f",-1);break;case 44:o[c++]=(P(w)-1)*y,y=1;break;case 64:45===z()&&(w+=Q(K())),p=z(),l=u=P(b=w+=ne(V())),v++;break;case 45:45===g&&2==P(w)&&(h=0)}}return s}function le(e,t,r,n,a,s,i,o,d,c,l,u){for(var p=a-1,f=0===a?s:[""],g=I(f),h=0,m=0,v=0;h0?f[b]+" "+x:A(x,/&\f/g,f[b])))&&(d[v++]=R);return H(e,t,r,0===a?y:o,d,c,l,u)}function ue(e,t,r,n){return H(e,t,r,m,T(B),_(e,2,-2),0,n)}function pe(e,t,r,n,a){return H(e,t,r,v,_(e,0,n),_(e,n+1,-1),n,a)}var fe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ge=r(3617),he="undefined"!=typeof ge&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_ATTR||{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_ATTR)||"data-styled",me="undefined"!=typeof window&&"HTMLElement"in window,ye=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof ge&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY?"false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof ge&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&("false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY)),ve=(new Set,Object.freeze([])),be=Object.freeze({});function xe(e,t,r){return void 0===r&&(r=be),e.theme!==r.theme&&e.theme||t||r.theme}var Re=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Ee=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Te=/(^-|-$)/g;function we(e){return e.replace(Ee,"-").replace(Te,"")}var je=/(a)(d)/gi,Se=function(e){return String.fromCharCode(e+(e>25?39:97))};function Ae(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Se(t%52)+r;return(Se(t%52)+r).replace(je,"$1-$2")}var Ce,ke=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},_e=function(e){return ke(5381,e)};function Pe(e){return Ae(_e(e)>>>0)}function Ie(e){return"string"==typeof e&&!0}var De="function"==typeof Symbol&&Symbol.for,Oe=De?Symbol.for("react.memo"):60115,Ne=De?Symbol.for("react.forward_ref"):60112,Fe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Le={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Me={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Be=((Ce={})[Ne]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ce[Oe]=Me,Ce);function Ue(e){return("type"in(t=e)&&t.type.$$typeof)===Oe?Me:"$$typeof"in e?Be[e.$$typeof]:Fe;var t}var He=Object.defineProperty,Ge=Object.getOwnPropertyNames,We=Object.getOwnPropertySymbols,qe=Object.getOwnPropertyDescriptor,Ke=Object.getPrototypeOf,ze=Object.prototype;function Ve(e,t,r){if("string"!=typeof t){if(ze){var n=Ke(t);n&&n!==ze&&Ve(e,n,r)}var a=Ge(t);We&&(a=a.concat(We(t)));for(var s=Ue(e),i=Ue(t),o=0;o0?" Args: ".concat(t.join(", ")):""))}var rt=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,a=n;e>=a;)if((a<<=1)<0)throw tt(16,"".concat(e));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var s=n;s=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),a=n+r,s=n;s=0){var r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(d+="".concat(e,","))})),n+="".concat(i).concat(o,'{content:"').concat(d,'"}').concat("/*!sc*/\n")},s=0;s0?".".concat(t):e},l=d.slice();l.push((function(e){e.type===y&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(xt,r).replace(n,c))})),i.prefix&&l.push(oe),l.push(se);var u=function(e,a,s,o){void 0===a&&(a=""),void 0===s&&(s=""),void 0===o&&(o="&"),t=o,r=a,n=new RegExp("\\".concat(r,"\\b"),"g");var d=e.replace(Rt,""),c=de(s||a?"".concat(s," ").concat(a," { ").concat(d," }"):d);i.namespace&&(c=Et(c,i.namespace));var u,p=[];return ae(c,function(e){var t=I(e);return function(r,n,a,s){for(var i="",o=0;o="A"&&e<="Z"};function It(e){for(var t="",r=0;r>>0);if(!t.hasNameForId(this.componentId,s)){var i=r(a,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}n=Je(n,s),this.staticRulesId=s}else{for(var o=ke(this.baseHash,r.hash),d="",c=0;c>>0);t.hasNameForId(this.componentId,p)||t.insertRules(this.componentId,p,r(d,".".concat(p),void 0,this.componentId)),n=Je(n,p)}}return n},e}(),Bt=d.createContext(void 0);Bt.Consumer;var Ut={};new Set;function Ht(e,t,r){var n=Xe(e),a=e,s=!Ie(e),i=t.attrs,o=void 0===i?ve:i,l=t.componentId,u=void 0===l?function(e,t){var r="string"!=typeof e?"sc":we(e);Ut[r]=(Ut[r]||0)+1;var n="".concat(r,"-").concat(Pe("6.0.8"+r+Ut[r]));return t?"".concat(t,"-").concat(n):n}(t.displayName,t.parentComponentId):l,p=t.displayName,f=(void 0===p&&function(e){Ie(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(we(t.displayName),"-").concat(t.componentId):t.componentId||u),g=n&&a.attrs?a.attrs.concat(o).filter(Boolean):o,h=t.shouldForwardProp;if(n&&a.shouldForwardProp){var m=a.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;h=function(e,t){return m(e,t)&&y(e,t)}}else h=m}var v=new Mt(r,f,n?a.componentStyle:void 0);var b=d.forwardRef((function(e,t){return function(e,t,r){var n=e.attrs,a=e.componentStyle,s=e.defaultProps,i=e.foldedComponentIds,o=e.styledComponentId,l=e.target,u=d.useContext(Bt),p=Ct(),f=e.shouldForwardProp||p.shouldForwardProp,g=function(e,t,r){for(var n,a=c(c({},t),{className:void 0,theme:r}),s=0;s2&&bt.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)}}();(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),r=pt(),n=$e([r&&'nonce="'.concat(r,'"'),"".concat(he,'="true"'),"".concat("data-styled-version",'="').concat("6.0.8",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw tt(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw tt(2);var r=((t={})[he]="",t["data-styled-version"]="6.0.8",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),n=pt();return n&&(r.nonce=n),[d.createElement("style",c({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new bt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw tt(2);return d.createElement(kt,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw tt(3)}})(),"__sc-".concat(he,"__");var Yt=r(649),Xt=r(2951),Jt=r(1976),$t=r(7591),Qt=r(9616),Zt=r(7597),er=r(6983);var tr=r(8119);function rr(e,t,r){return rr=(0,tr.Z)()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&(0,er.Z)(a,r.prototype),a},rr.apply(null,arguments)}function nr(e){var t="function"===typeof Map?new Map:void 0;return nr=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return rr(e,arguments,(0,Zt.Z)(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,er.Z)(n,e)},nr(e)}var ar=document.createElement("template");ar.innerHTML='\n\n\n';var sr=function(e){(0,$t.Z)(r,e);var t=(0,Qt.Z)(r);function r(){var e;return(0,Xt.Z)(this,r),(e=t.call(this)).right="0",e.shadow=e.attachShadow({mode:"open"}),e.shadow.appendChild(e.ownerDocument.importNode(ar.content,!0)),e.update(),e}return(0,Jt.Z)(r,[{key:"setAttr",value:function(e,t){var r=this.shadow.querySelector("svg");/(href)/.test(e.toLocaleLowerCase())?r.lastElementChild.setAttribute("xlink:href",t):/(color|fill)/.test(e.toLocaleLowerCase())?r.firstElementChild.style[e]=t:/(z-index|position|top|left|right|bottom|transform)/.test(e.toLocaleLowerCase())?r.style[e]=t:r.setAttribute(e,t)}},{key:"update",value:function(){var e=this;[].concat((0,Yt.Z)(this.getAttributeNames()),["right"]).forEach((function(t){var r=e.getAttribute(t)||e[t]||"";e.setAttr(t,r)}))}},{key:"attributeChangedCallback",value:function(e,t,r){t!==r&&this.setAttr(e,r)}}],[{key:"observedAttributes",get:function(){return["style","z-index","target","height","width","href","color","fill","position","top","left","right","bottom","transform"]}}]),r}(nr(HTMLElement));customElements.define("github-corners",sr);var ir=r(9584),or=["size","fixed","bottom","zIndex","className","style","bgColor","color","position"];function dr(e){var t=e.size,r=void 0===t?80:t,n=e.fixed,a=void 0!==n&&n,o=e.bottom,d=e.zIndex,c=e.style,l=e.bgColor,u=void 0===l?"#151513":l,p=e.color,f=void 0===p?"#fff":p,g=e.position,h=void 0===g?"right":g,m=i(e,or),y="left"===h?{left:0,right:"initial",transform:"scale(-1, 1)"}:{right:0,left:"initial",transform:"scale(1, 1)"};return o?(y.bottom=0,y.top="initial",y.transform="left"===h?"scale(-1, -1)":"scale(1, -1)"):(y.bottom="initial",y.top=0),(0,ir.jsx)("github-corners",s({target:"__blank",width:r,height:r,href:e.href,position:a?"fixed":"absolute","z-index":d,style:c,fill:u,color:f},y,m))}function cr(e){if(Array.isArray(e))return e}var lr=r(4013);function ur(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pr(e,t){return cr(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,s,i,o=[],d=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;d=!1}else for(;!(d=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);d=!0);}catch(e){c=!0,a=e}finally{try{if(!d&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return o}}(e,t)||(0,lr.Z)(e,t)||ur()}var fr=["className","prefixCls","element","top","size","strokeWidth","smooth","hideProgress","children"],gr={position:"sticky",bottom:15,right:15,visibility:"visible",opacity:0,transition:"visibility 0.3s linear 0s, opacity 0.3s linear 0s",cursor:"pointer",userSelect:"none"},hr={display:"block",transform:"rotate(-90deg)"},mr={transition:"stroke-dashoffset 0.3s linear 0s"},yr={position:"absolute",top:0,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12},vr=document.documentElement;function br(e){void 0===e&&(e={});var t=e,r=t.className,n=t.prefixCls,a=void 0===n?"w-back-to-up":n,o=t.element,c=void 0===o?vr:o,l=t.top,u=void 0===l?120:l,p=t.size,f=void 0===p?35:p,g=t.strokeWidth,h=void 0===g?3:g,m=t.smooth,y=void 0===m||m,v=t.hideProgress,b=void 0!==v&&v,x=t.children,R=i(e,fr),E=(0,d.useRef)(null),T=[r,a].filter(Boolean).join(" "),w=Object.assign({},gr,{position:c===vr?"fixed":"sticky"},R.style,{width:f,height:f,opacity:0===u?1:0}),j=(0,d.useMemo)((function(){return f/2}),[f]),S=(0,d.useMemo)((function(){return f/2-h/2}),[f,h]),A=(0,d.useMemo)((function(){return Math.PI*S*2}),[S]),C=pr((0,d.useState)(A||0),2),k=C[0],_=C[1],P=function(e){var t=c||vr,r=t.clientHeight,n=t.scrollHeight,a=t.scrollTop;_(A-A*(a/(n-r))||0),E.current&&u>0&&(E.current.style.opacity=a>u?"1":"0")};(0,d.useEffect)((function(){var e=c===vr?document:c;return e&&e.addEventListener("scroll",P,{passive:!0}),function(){e&&e.removeEventListener("scroll",P)}}),[c]);return(0,ir.jsxs)("div",s({className:T,ref:E},R,{onClick:function(e){c.scrollTo({top:0,behavior:y?"smooth":"auto"})},style:w,children:[!b&&(0,ir.jsxs)("svg",{viewBox:"0 0 "+f+" "+f,width:f,height:f,focusable:"false",style:hr,children:[(0,ir.jsx)("circle",{fill:"rgb(0 0 0 / 75%)",stroke:"rgb(200 200 200 / 85%)",strokeWidth:h,r:S,cx:j,cy:j}),(0,ir.jsx)("circle",{fill:"none",stroke:"rgb(0 0 0 / 50%)",strokeWidth:h,r:S,cx:j,cy:j,strokeDasharray:A,strokeDashoffset:k||0,style:mr})]}),x&&(0,ir.jsx)("div",{style:yr,children:x})]}))}var xr={corners:{fixed:!0,target:"__blank",zIndex:10},darkMode:{permanent:!0,dark:"Dark",light:"Light"},example:null},Rr=[],Er=function(e){xr=s({},xr,{corners:s({},xr.corners,e)}),Ar()},Tr=function(e){xr=s({},xr,{darkMode:s({},xr.darkMode,e)}),console.log("globalStore:",xr),Ar()},wr=function(e){xr=s({},xr,{example:e}),Ar()};function jr(){return xr}function Sr(e){return Rr=[].concat((0,Yt.Z)(Rr),[e]),function(){Rr=Rr.filter((function(t){return t!==e}))}}function Ar(){var e,t=function(e,t){var r="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=(0,lr.Z)(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,i=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){o=!0,s=e},f:function(){try{i||null==r.return||r.return()}finally{if(o)throw s}}}}(Rr);try{for(t.s();!(e=t.n()).done;){(0,e.value)()}}catch(r){t.e(r)}finally{t.f()}}var Cr={},kr=(0,d.createContext)({}),_r=function(e,t){return s({},e,t)},Pr=function(e){var t=e.children,r=e.value,n=pr((0,d.useReducer)(_r,s({},Cr,r)),2),a=n[0],i=n[1];return(0,ir.jsx)(kr.Provider,{value:s({},a,{dispatch:i}),children:t})},Ir=["tagName","className","children"],Dr=d.forwardRef((function(e,t){var r=e.tagName,n=void 0===r?"div":r,a=e.className,o=e.children,c=i(e,Ir),l=[Kr+"-code",a].filter(Boolean).join(" ").trim();if((0,d.useContext)(kr).collapse)return null;var u=e.href&&"string"===typeof n?"a":n,p=s({},c,{className:l,ref:t});return d.createElement(u,p,o)}));Dr.displayName="uiw.CodeLayoutCode";var Or=["className","children"],Nr=d.forwardRef((function(e,t){var r=e.className,n=e.children,a=i(e,Or),o=[Kr+"-preview",r].filter(Boolean).join(" ").trim();return(0,ir.jsx)("div",s({},a,{className:o,ref:t,children:n}))}));Nr.displayName="uiw.Preview";var Fr=r(7298),Lr=r.n(Fr),Mr=function(e){return(0,ir.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:(0,ir.jsx)("path",{d:"M8.64 5.23a1 1 0 0 0-1.41.13l-5 6a1 1 0 0 0 0 1.27l4.83 6a1 1 0 0 0 .78.37 1 1 0 0 0 .78-1.63L4.29 12l4.48-5.36a1 1 0 0 0-.13-1.41zm13.14 6.14-4.78-6a1 1 0 0 0-1.41-.15 1 1 0 0 0-.15 1.41L19.71 12l-4.48 5.37a1 1 0 0 0 .13 1.41A1 1 0 0 0 16 19a1 1 0 0 0 .77-.36l5-6a1 1 0 0 0 .01-1.27z","data-name":"code"})})},Br=function(e){return(0,ir.jsxs)("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[(0,ir.jsx)("path",{d:"M18 21h-6a3 3 0 0 1-3-3v-6a3 3 0 0 1 3-3h6a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3zm-6-10a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1z"}),(0,ir.jsx)("path",{d:"M9.73 15H5.67A2.68 2.68 0 0 1 3 12.33V5.67A2.68 2.68 0 0 1 5.67 3h6.66A2.68 2.68 0 0 1 15 5.67V9.4h-2V5.67a.67.67 0 0 0-.67-.67H5.67a.67.67 0 0 0-.67.67v6.66a.67.67 0 0 0 .67.67h4.06z"})]})},Ur=function(e){return(0,ir.jsxs)("svg",{viewBox:"0 0 24 24",fill:"green",children:[(0,ir.jsx)("path",{d:"M9.71 11.29a1 1 0 0 0-1.42 1.42l3 3A1 1 0 0 0 12 16a1 1 0 0 0 .72-.34l7-8a1 1 0 0 0-1.5-1.32L12 13.54z"}),(0,ir.jsx)("path",{d:"M21 11a1 1 0 0 0-1 1 8 8 0 0 1-8 8A8 8 0 0 1 6.33 6.36 7.93 7.93 0 0 1 12 4a8.79 8.79 0 0 1 1.9.22 1 1 0 1 0 .47-1.94A10.54 10.54 0 0 0 12 2a10 10 0 0 0-7 17.09A9.93 9.93 0 0 0 12 22a10 10 0 0 0 10-10 1 1 0 0 0-1-1z"})]})},Hr=function(e){var t=pr((0,d.useState)(!1),2),r=t[0],n=t[1];return(0,ir.jsx)("button",{onClick:function(){n(!0),Lr()(e.text||"",(function(){var e=setTimeout((function(){n(!1),clearTimeout(e)}),2e3)}))},children:r?(0,ir.jsx)(Ur,{}):(0,ir.jsx)(Br,{})})},Gr=["className","children","extra","text","copied","collapse","visibleButton","visible"],Wr=d.forwardRef((function(e,t){var r=e.className,n=e.children,a=e.extra,o=e.text,c=void 0===o?"":o,l=e.copied,u=void 0===l||l,p=e.collapse,f=void 0===p||p,g=e.visibleButton,h=void 0===g||g,m=e.visible,y=void 0===m||m,v=i(e,Gr),b=(0,d.useContext)(kr),x=[Kr+"-toolbar",r].filter(Boolean).join(" ").trim();if((0,d.useEffect)((function(){return b.dispatch({collapse:f})}),[f]),!y)return null;return(0,ir.jsxs)("div",s({className:x},v,{ref:t,children:[(0,ir.jsx)("div",{className:Kr+"-title",children:n}),(0,ir.jsxs)("div",{className:Kr+"-extra",children:[a,u&&(0,ir.jsx)(Hr,{text:c}),h&&(0,ir.jsx)("button",{onClick:function(){return b.dispatch({collapse:!b.collapse})},children:(0,ir.jsx)(Mr,{})})]})]}))}));Wr.displayName="uiw.Toolbar";var qr=["children","prefixCls","className","bordered","disableCheckered"],Kr="w-rcpl",zr=d.forwardRef((function(e,t){var r=e.children,n=e.prefixCls,a=void 0===n?Kr:n,o=e.className,c=e.bordered,l=void 0===c||c,u=e.disableCheckered,p=i(e,qr),f=[a,o,l?"w-bordered":null,u?"w-disable-checkered":null].filter(Boolean).join(" ").trim();return(0,ir.jsx)("div",s({ref:t},p,{className:f,children:d.Children.map(r,(function(e,t){return d.isValidElement(e)?d.cloneElement(e,s({},e.props,{key:t})):e}))}))})),Vr=d.forwardRef((function(e,t){return(0,ir.jsx)(Pr,{value:{collapse:!1},children:(0,ir.jsx)(zr,s({},e,{ref:t}))})}));Vr.Preview=Nr,Vr.Toolbar=Wr,Vr.Code=Dr;var Yr=Vr,Xr=(r(8970),r(8784),r(2258),r(1e3),function(e){for(var t,r=/([^?=&]+)=([^&]*)/g,n={};t=r.exec(e);)n[t[1]]=t[2];return n}),Jr=function(e){void 0===e&&(e="");var t=pr(/mdx:(.[\w|:]+)/i.exec(e)||[],1)[0];return(void 0===t?"":t).replace(/^mdx:preview:?/,"")},$r=function(e){return void 0===e&&(e=""),e&&e.includes("mdx:preview")};var Qr=r(5217);function Zr(e,t,r){return(t=(0,Qr.Z)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function en(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tn(e){for(var t=1;te.length){for(;s--;)if(47===e.charCodeAt(s)){if(r){n=s+1;break}}else a<0&&(r=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";var i=-1,o=t.length-1;for(;s--;)if(47===e.charCodeAt(s)){if(r){n=s+1;break}}else i<0&&(r=!0,i=s+1),o>-1&&(e.charCodeAt(s)===t.charCodeAt(o--)?o<0&&(a=s):(o=-1,a=i));n===a?a=i:a<0&&(a=e.length);return e.slice(n,a)},dirname:function(e){if(ln(e),0===e.length)return".";var t,r=-1,n=e.length;for(;--n;)if(47===e.charCodeAt(n)){if(t){r=n;break}}else t||(t=!0);return r<0?47===e.charCodeAt(0)?"/":".":1===r&&47===e.charCodeAt(0)?"//":e.slice(0,r)},extname:function(e){ln(e);var t,r=e.length,n=-1,a=0,s=-1,i=0;for(;r--;){var o=e.charCodeAt(r);if(47!==o)n<0&&(t=!0,n=r+1),46===o?s<0?s=r:1!==i&&(i=1):s>-1&&(i=-1);else if(t){a=r+1;break}}if(s<0||n<0||0===i||1===i&&s===n-1&&s===a+1)return"";return e.slice(s,n)},join:function(){for(var e,t=-1,r=arguments.length,n=new Array(r),a=0;a2){if((n=a.lastIndexOf("/"))!==a.length-1){n<0?(a="",s=0):s=(a=a.slice(0,n)).length-1-a.lastIndexOf("/"),i=d,o=0;continue}}else if(a.length>0){a="",s=0,i=d,o=0;continue}t&&(a=a.length>0?a+"/..":"..",s=2)}else a.length>0?a+="/"+e.slice(i+1,d):a=e.slice(i+1,d),s=d-i-1;i=d,o=0}else 46===r&&o>-1?o++:o=-1}return a}(e,!t);0!==r.length||t||(r=".");r.length>0&&47===e.charCodeAt(e.length-1)&&(r+="/");return t?"/"+r:r}(e)},sep:"/"};function ln(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var un={cwd:function(){return"/"}};function pn(e){return null!==e&&"object"===typeof e&&e.href&&e.origin}function fn(e){if("string"===typeof e)e=new URL(e);else if(!pn(e)){var t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){var r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return function(e){if(""!==e.hostname){var t=new TypeError('File URL host must be "localhost" or empty on darwin');throw t.code="ERR_INVALID_FILE_URL_HOST",t}var r=e.pathname,n=-1;for(;++n1?d-1:0),l=1;la.length;c&&a.push(s);try{d=e.apply(this,a)}catch(n){if(c&&r)throw n;return s(n)}c||(d instanceof Promise?d.then(i,s):d instanceof Error?s(d):i(d))}function s(e){if(!r){r=!0;for(var n=arguments.length,a=new Array(n>1?n-1:0),s=1;s1?r-1:0),o=1;os?0:s+t:t>s?s:t,r=r>0?r:0,n.length<1e4)(a=Array.from(n)).unshift(t,r),e.splice.apply(e,(0,Yt.Z)(a));else for(r&&e.splice(t,r);i0?(Ln(e,e.length,0,t),e):t}var Bn={}.hasOwnProperty;function Un(e){for(var t={},r=-1;++rn))return;for(var c,l,u=a.events.length,p=u;p--;)if("exit"===a.events[p][0]&&"chunkFlow"===a.events[p][1].type){if(c){l=a.events[p][1].end;break}c=!0}for(y(i),d=u;dt;){var n=s[r];a.containerState=n[1],n[0].exit.call(a,e)}s.length=t}function v(){t.write([null]),r=void 0,t=void 0,a.containerState._closeFlow=void 0}}},sa={tokenize:function(e,t,r){return ra(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};var ia={tokenize:function(e,t,r){return function(t){return Qn(t)?ra(e,n,"linePrefix")(t):n(t)};function n(e){return null===e||Jn(e)?t(e):r(e)}},partial:!0};function oa(e){for(var t,r,n,a,s,i,o,d={},c=-1;++c=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}},partial:!0};var ua={tokenize:function(e){var t=this,r=e.attempt(ia,(function(n){if(null===n)return void e.consume(n);return e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}),e.attempt(this.parser.constructs.flowInitial,n,ra(e,e.attempt(this.parser.constructs.flow,n,e.attempt(ca,n)),"linePrefix")));return r;function n(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,r;e.consume(n)}}};var pa={resolveAll:ma()},fa=ha("string"),ga=ha("text");function ha(e){return{tokenize:function(t){var r=this,n=this.parser.constructs[e],a=t.attempt(n,s,i);return s;function s(e){return d(e)?a(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),o;t.consume(e)}function o(e){return d(e)?(t.exit("data"),a(e)):(t.consume(e),o)}function d(e){if(null===e)return!0;var t=n[e],a=-1;if(t)for(;++a-1){var o=r[0];"string"===typeof o?r[0]=o.slice(a):r.shift()}i>0&&r.push(e[s].slice(0,i))}return r}(i,e)}function p(){var e=n;return{line:e.line,column:e.column,offset:e.offset,_index:e._index,_bufferIndex:e._bufferIndex}}function f(){for(var e;n._index=3&&(null===s||Jn(s))?(e.exit("thematicBreak"),t(s)):r(s)}function i(t){return t===n?(e.consume(t),a++,i):(e.exit("thematicBreakSequence"),Qn(t)?ra(e,s,"whitespace")(t):s(t))}}};var Ra={name:"list",tokenize:function(e,t,r){var n=this,a=n.events[n.events.length-1],s=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,i=0;return function(t){var a=n.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!n.containerState.marker||t===n.containerState.marker:Vn(t)){if(n.containerState.type||(n.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(xa,r,d)(t):d(t);if(!n.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(t)}return r(t)};function o(t){return Vn(t)&&++i<10?(e.consume(t),o):(!n.interrupt||i<2)&&(n.containerState.marker?t===n.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),d(t)):r(t)}function d(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||t,e.check(ia,n.interrupt?r:c,e.attempt(Ea,u,l))}function c(e){return n.containerState.initialBlankLine=!0,s++,u(e)}function l(t){return Qn(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):r(t)}function u(r){return n.containerState.size=s+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(r)}},continuation:{tokenize:function(e,t,r){var n=this;return n.containerState._closeFlow=void 0,e.check(ia,a,s);function a(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ra(e,t,"listItemIndent",n.containerState.size+1)(r)}function s(r){return n.containerState.furtherBlankLines||!Qn(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(Ta,t,i)(r))}function i(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ra(e,e.attempt(Ra,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)}},Ea={tokenize:function(e,t,r){var n=this;return ra(e,(function(e){var a=n.events[n.events.length-1];return!Qn(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):r(e)}),"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},Ta={tokenize:function(e,t,r){var n=this;return ra(e,(function(e){var a=n.events[n.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(e):r(e)}),"listItemIndent",n.containerState.size+1)},partial:!0};var wa={name:"blockQuote",tokenize:function(e,t,r){var n=this;return function(t){if(62===t){var s=n.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return r(t)};function a(r){return Qn(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(r))}},continuation:{tokenize:function(e,t,r){var n=this;return function(t){if(Qn(t))return ra(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return a(t)};function a(n){return e.attempt(wa,t,r)(n)}}},exit:function(e){e.exit("blockQuote")}};function ja(e,t,r,n,a,s,i,o,d){var c=d||Number.POSITIVE_INFINITY,l=0;return function(t){if(60===t)return e.enter(n),e.enter(a),e.enter(s),e.consume(t),e.exit(s),u;if(null===t||32===t||41===t||zn(t))return r(t);return e.enter(n),e.enter(i),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(t)};function u(r){return 62===r?(e.enter(s),e.consume(r),e.exit(s),e.exit(a),e.exit(n),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(r))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),u(t)):null===t||60===t||Jn(t)?r(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function g(a){return l||null!==a&&41!==a&&!$n(a)?l999||null===u||91===u||93===u&&!i||94===u&&!d&&"_hiddenFootnoteSupport"in o.parser.constructs?r(u):93===u?(e.exit(s),e.enter(a),e.consume(u),e.exit(a),e.exit(n),t):Jn(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),l(u))}function l(t){return null===t||91===t||93===t||Jn(t)||d++>999?(e.exit("chunkString"),c(t)):(e.consume(t),i||(i=!Qn(t)),92===t?u:l)}function u(t){return 91===t||92===t||93===t?(e.consume(t),d++,l):l(t)}}function Aa(e,t,r,n,a,s){var i;return function(t){if(34===t||39===t||40===t)return e.enter(n),e.enter(a),e.consume(t),e.exit(a),i=40===t?41:t,o;return r(t)};function o(r){return r===i?(e.enter(a),e.consume(r),e.exit(a),e.exit(n),t):(e.enter(s),d(r))}function d(t){return t===i?(e.exit(s),o(i)):null===t?r(t):Jn(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ra(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===i||null===t||Jn(t)?(e.exit("chunkString"),d(t)):(e.consume(t),92===t?l:c)}function l(t){return t===i||92===t?(e.consume(t),c):c(t)}}function Ca(e,t){var r;return function n(a){if(Jn(a))return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n;if(Qn(a))return ra(e,n,r?"linePrefix":"lineSuffix")(a);return t(a)}}function ka(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var _a={name:"definition",tokenize:function(e,t,r){var n,a=this;return function(t){return e.enter("definition"),function(t){return Sa.call(a,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function s(t){return n=ka(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):r(t)}function i(t){return $n(t)?Ca(e,o)(t):o(t)}function o(t){return ja(e,d,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function d(t){return e.attempt(Pa,c,c)(t)}function c(t){return Qn(t)?ra(e,l,"whitespace")(t):l(t)}function l(s){return null===s||Jn(s)?(e.exit("definition"),a.parser.defined.push(n),t(s)):r(s)}}},Pa={tokenize:function(e,t,r){return function(t){return $n(t)?Ca(e,n)(t):r(t)};function n(t){return Aa(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return Qn(t)?ra(e,s,"whitespace")(t):s(t)}function s(e){return null===e||Jn(e)?t(e):r(e)}},partial:!0};var Ia={name:"codeIndented",tokenize:function(e,t,r){var n=this;return function(t){return e.enter("codeIndented"),ra(e,a,"linePrefix",5)(t)};function a(e){var t=n.events[n.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?s(e):r(e)}function s(t){return null===t?o(t):Jn(t)?e.attempt(Da,s,o)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||Jn(t)?(e.exit("codeFlowValue"),s(t)):(e.consume(t),i)}function o(r){return e.exit("codeIndented"),t(r)}}},Da={tokenize:function(e,t,r){var n=this;return a;function a(t){return n.parser.lazy[n.now().line]?r(t):Jn(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):ra(e,s,"linePrefix",5)(t)}function s(e){var s=n.events[n.events.length-1];return s&&"linePrefix"===s[1].type&&s[2].sliceSerialize(s[1],!0).length>=4?t(e):Jn(e)?a(e):r(e)}},partial:!0};var Oa={name:"headingAtx",tokenize:function(e,t,r){var n=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),a(t)}(t)};function a(t){return 35===t&&n++<6?(e.consume(t),a):null===t||$n(t)?(e.exit("atxHeadingSequence"),s(t)):r(t)}function s(r){return 35===r?(e.enter("atxHeadingSequence"),i(r)):null===r||Jn(r)?(e.exit("atxHeading"),t(r)):Qn(r)?ra(e,s,"whitespace")(r):(e.enter("atxHeadingText"),o(r))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),s(t))}function o(t){return null===t||35===t||$n(t)?(e.exit("atxHeadingText"),s(t)):(e.consume(t),o)}},resolve:function(e,t){var r,n,a=e.length-2,s=3;"whitespace"===e[s][1].type&&(s+=2);a-2>s&&"whitespace"===e[a][1].type&&(a-=2);"atxHeadingSequence"===e[a][1].type&&(s===a-1||a-4>s&&"whitespace"===e[a-2][1].type)&&(a-=s+1===a?2:4);a>s&&Ln(e,s,a-s+1,[["enter",r={type:"atxHeadingText",start:e[s][1].start,end:e[a][1].end},t],["enter",n={type:"chunkText",start:e[s][1].start,end:e[a][1].end,contentType:"text"},t],["exit",n,t],["exit",r,t]]);return e}};var Na={name:"setextUnderline",tokenize:function(e,t,r){var n,a=this;return function(t){var i,o=a.events.length;for(;o--;)if("lineEnding"!==a.events[o][1].type&&"linePrefix"!==a.events[o][1].type&&"content"!==a.events[o][1].type){i="paragraph"===a.events[o][1].type;break}if(!a.parser.lazy[a.now().line]&&(a.interrupt||i))return e.enter("setextHeadingLine"),n=t,function(t){return e.enter("setextHeadingLineSequence"),s(t)}(t);return r(t)};function s(t){return t===n?(e.consume(t),s):(e.exit("setextHeadingLineSequence"),Qn(t)?ra(e,i,"lineSuffix")(t):i(t))}function i(n){return null===n||Jn(n)?(e.exit("setextHeadingLine"),t(n)):r(n)}},resolveTo:function(e,t){var r,n,a,s=e.length;for(;s--;)if("enter"===e[s][0]){if("content"===e[s][1].type){r=s;break}"paragraph"===e[s][1].type&&(n=s)}else"content"===e[s][1].type&&e.splice(s,1),a||"definition"!==e[s][1].type||(a=s);var i={type:"setextHeading",start:Object.assign({},e[n][1].start),end:Object.assign({},e[e.length-1][1].end)};e[n][1].type="setextHeadingText",a?(e.splice(n,0,["enter",i,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=i;return e.push(["exit",i,t]),e}};var Fa=["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"],La=["pre","script","style","textarea"],Ma={name:"htmlFlow",tokenize:function(e,t,r){var n,a,s,i,o,d=this;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(i){return 33===i?(e.consume(i),l):47===i?(e.consume(i),a=!0,f):63===i?(e.consume(i),n=3,d.interrupt?t:O):Wn(i)?(e.consume(i),s=String.fromCharCode(i),g):r(i)}function l(a){return 45===a?(e.consume(a),n=2,u):91===a?(e.consume(a),n=5,i=0,p):Wn(a)?(e.consume(a),n=4,d.interrupt?t:O):r(a)}function u(n){return 45===n?(e.consume(n),d.interrupt?t:O):r(n)}function p(n){var a="CDATA[";return n===a.charCodeAt(i++)?(e.consume(n),6===i?d.interrupt?t:S:p):r(n)}function f(t){return Wn(t)?(e.consume(t),s=String.fromCharCode(t),g):r(t)}function g(i){if(null===i||47===i||62===i||$n(i)){var o=47===i,c=s.toLowerCase();return o||a||!La.includes(c)?Fa.includes(s.toLowerCase())?(n=6,o?(e.consume(i),h):d.interrupt?t(i):S(i)):(n=7,d.interrupt&&!d.parser.lazy[d.now().line]?r(i):a?m(i):y(i)):(n=1,d.interrupt?t(i):S(i))}return 45===i||qn(i)?(e.consume(i),s+=String.fromCharCode(i),g):r(i)}function h(n){return 62===n?(e.consume(n),d.interrupt?t:S):r(n)}function m(t){return Qn(t)?(e.consume(t),m):w(t)}function y(t){return 47===t?(e.consume(t),w):58===t||95===t||Wn(t)?(e.consume(t),v):Qn(t)?(e.consume(t),y):w(t)}function v(t){return 45===t||46===t||58===t||95===t||qn(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),x):Qn(t)?(e.consume(t),b):y(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),o=t,R):Qn(t)?(e.consume(t),x):E(t)}function R(t){return t===o?(e.consume(t),o=null,T):null===t||Jn(t)?r(t):(e.consume(t),R)}function E(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||$n(t)?b(t):(e.consume(t),E)}function T(e){return 47===e||62===e||Qn(e)?y(e):r(e)}function w(t){return 62===t?(e.consume(t),j):r(t)}function j(t){return null===t||Jn(t)?S(t):Qn(t)?(e.consume(t),j):r(t)}function S(t){return 45===t&&2===n?(e.consume(t),_):60===t&&1===n?(e.consume(t),P):62===t&&4===n?(e.consume(t),N):63===t&&3===n?(e.consume(t),O):93===t&&5===n?(e.consume(t),D):!Jn(t)||6!==n&&7!==n?null===t||Jn(t)?(e.exit("htmlFlowData"),A(t)):(e.consume(t),S):(e.exit("htmlFlowData"),e.check(Ba,F,A)(t))}function A(t){return e.check(Ua,C,F)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),k}function k(t){return null===t||Jn(t)?A(t):(e.enter("htmlFlowData"),S(t))}function _(t){return 45===t?(e.consume(t),O):S(t)}function P(t){return 47===t?(e.consume(t),s="",I):S(t)}function I(t){if(62===t){var r=s.toLowerCase();return La.includes(r)?(e.consume(t),N):S(t)}return Wn(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),I):S(t)}function D(t){return 93===t?(e.consume(t),O):S(t)}function O(t){return 62===t?(e.consume(t),N):45===t&&2===n?(e.consume(t),O):S(t)}function N(t){return null===t||Jn(t)?(e.exit("htmlFlowData"),F(t)):(e.consume(t),N)}function F(r){return e.exit("htmlFlow"),t(r)}},resolveTo:function(e){var t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},Ba={tokenize:function(e,t,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(ia,t,r)}},partial:!0},Ua={tokenize:function(e,t,r){var n=this;return function(t){if(Jn(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a;return r(t)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}},partial:!0};var Ha={tokenize:function(e,t,r){var n=this;return function(t){if(null===t)return r(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}},partial:!0},Ga={name:"codeFenced",tokenize:function(e,t,r){var n,a=this,s={tokenize:function(e,t,r){var s=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d}function d(t){return e.enter("codeFencedFence"),Qn(t)?ra(e,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===n?(e.enter("codeFencedFenceSequence"),l(t)):r(t)}function l(t){return t===n?(s++,e.consume(t),l):s>=o?(e.exit("codeFencedFenceSequence"),Qn(t)?ra(e,u,"whitespace")(t):u(t)):r(t)}function u(n){return null===n||Jn(n)?(e.exit("codeFencedFence"),t(n)):r(n)}},partial:!0},i=0,o=0;return function(t){return function(t){var r=a.events[a.events.length-1];return i=r&&"linePrefix"===r[1].type?r[2].sliceSerialize(r[1],!0).length:0,n=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(t)}(t)};function d(t){return t===n?(o++,e.consume(t),d):o<3?r(t):(e.exit("codeFencedFenceSequence"),Qn(t)?ra(e,c,"whitespace")(t):c(t))}function c(r){return null===r||Jn(r)?(e.exit("codeFencedFence"),a.interrupt?t(r):e.check(Ha,f,v)(r)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),l(r))}function l(t){return null===t||Jn(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):Qn(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ra(e,u,"whitespace")(t)):96===t&&t===n?r(t):(e.consume(t),l)}function u(t){return null===t||Jn(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||Jn(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===n?r(t):(e.consume(t),p)}function f(t){return e.attempt(s,v,g)(t)}function g(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&Qn(t)?ra(e,m,"linePrefix",i+1)(t):m(t)}function m(t){return null===t||Jn(t)?e.check(Ha,f,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||Jn(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),y)}function v(r){return e.exit("codeFenced"),t(r)}},concrete:!0};var Wa=r(6166),qa={name:"characterReference",tokenize:function(e,t,r){var n,a,s=this,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),n=31,a=qn,c(t))}function d(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,a=Yn,c):(e.enter("characterReferenceValue"),n=7,a=Vn,c(t))}function c(o){if(59===o&&i){var d=e.exit("characterReferenceValue");return a!==qn||(0,Wa.T)(s.sliceSerialize(d))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):r(o)}return a(o)&&i++1&&e[l][1].end.offset-e[l][1].start.offset>1?2:1;var u=Object.assign({},e[r][1].end),p=Object.assign({},e[l][1].start);es(u,-o),es(p,o),s={type:o>1?"strongSequence":"emphasisSequence",start:u,end:Object.assign({},e[r][1].end)},i={type:o>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[l][1].start),end:p},a={type:o>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[l][1].start)},n={type:o>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},i.end)},e[r][1].end=Object.assign({},s.start),e[l][1].start=Object.assign({},i.end),d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Mn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Mn(d,[["enter",n,t],["enter",s,t],["exit",s,t],["enter",a,t]]),d=Mn(d,va(t.parser.constructs.insideSpan.null,e.slice(r+1,l),t)),d=Mn(d,[["exit",a,t],["enter",i,t],["exit",i,t],["exit",n,t]]),e[l][1].end.offset-e[l][1].start.offset?(c=2,d=Mn(d,[["enter",e[l][1],t],["exit",e[l][1],t]])):c=0,Ln(e,r-1,l-r+3,d),l=r+d.length-c-2;break}l=-1;for(;++l13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||65535===(65535&r)||65534===(65535&r)||r>1114111?"\ufffd":String.fromCharCode(r)}var Es=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ts(e){return e.replace(Es,ws)}function ws(e,t,r){if(t)return t;if(35===r.charCodeAt(0)){var n=r.charCodeAt(1),a=120===n||88===n;return Rs(r.slice(a?2:1),a?16:10)}return(0,Wa.T)(r)||e}var js={}.hasOwnProperty,Ss=function(e,t,r){return"string"!==typeof t&&(r=t,t=void 0),function(e){var t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(re),autolinkProtocol:A,autolinkEmail:A,atxHeading:o(Q),blockQuote:o(V),characterEscape:A,characterReference:A,codeFenced:o(Y),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:o(Y,d),codeText:o(X,d),codeTextData:A,data:A,codeFlowValue:A,definition:o(J),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:o($),hardBreakEscape:o(Z),hardBreakTrailing:o(Z),htmlFlow:o(ee,d),htmlFlowData:A,htmlText:o(ee,d),htmlTextData:A,image:o(te),label:d,link:o(re),listItem:o(ae),listItemValue:g,listOrdered:o(ne,f),listUnordered:o(ne),paragraph:o(se),reference:H,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:o(Q),strong:o(ie),thematicBreak:o(de)},exit:{atxHeading:l(),atxHeadingSequence:T,autolink:l(),autolinkEmail:z,autolinkProtocol:K,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:q,codeFenced:l(v),codeFencedFence:y,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:C,codeIndented:l(b),codeText:l(D),codeTextData:C,data:C,definition:l(),definitionDestinationString:E,definitionLabelString:x,definitionTitleString:R,emphasis:l(),hardBreakEscape:l(_),hardBreakTrailing:l(_),htmlFlow:l(P),htmlFlowData:C,htmlText:l(I),htmlTextData:C,image:l(N),label:L,labelText:F,lineEnding:k,link:l(O),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:G,resourceDestinationString:M,resourceTitleString:B,resource:U,setextHeading:l(S),setextHeadingLineSequence:j,setextHeadingText:w,strong:l(),thematicBreak:l()}};Cs(t,(e||{}).mdastExtensions||[]);var r={};return n;function n(e){for(var r={type:"root",children:[]},n={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:d,resume:p,setData:s,getData:i},o=[],l=-1;++l0){var g=n.tokenStack[n.tokenStack.length-1];(g[1]||_s).call(n,void 0,g[0])}for(r.position={start:As(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:As(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},l=-1;++l55295&&s<57344){var o=e.charCodeAt(r+1);s<56320&&o>56319&&o<57344?(i=String.fromCharCode(s,o),a=1):i="\ufffd"}else i=String.fromCharCode(s);i&&(t.push(e.slice(n,r),encodeURIComponent(i)),n=r+a+1,i=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}var Ds=function(e){if(void 0===e||null===e)return Fs;if("string"===typeof e)return function(e){return Ns(t);function t(t){return t&&t.type===e}}(e);if("object"===typeof e)return Array.isArray(e)?Os(e):function(e){return Ns(t);function t(t){var r;for(r in e)if(t[r]!==e[r])return!1;return!0}}(e);if("function"===typeof e)return Ns(e);throw new Error("Expected function, string, or object as test")};function Os(e){for(var t=[],r=-1;++r1?r-1:0),a=1;a":"")+")"})}return u;function u(){var c,l,u,p=[];if((!t||a(i,o,d[d.length-1]||null))&&(p=function(e){if(Array.isArray(e))return e;if("number"===typeof e)return[true,e];return[e]}(r(i,d)),p[0]===Ls))return p;if(i.children&&p[0]!==Ms)for(l=(n?i.children.length:-1)+s,u=d.concat(i);l>-1&&l-1?r.offset:null}}}var qs={}.hasOwnProperty;function Ks(e){return String(e||"").toUpperCase()}function zs(e,t){var r,n=String(t.identifier).toUpperCase(),a=Is(n.toLowerCase()),s=e.footnoteOrder.indexOf(n);-1===s?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,r=e.footnoteOrder.length):(e.footnoteCounts[n]++,r=s+1);var i=e.footnoteCounts[n],o={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+a,id:e.clobberPrefix+"fnref-"+a+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,o);var d={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,d),e.applyData(t,d)}function Vs(e,t){var r=t.referenceType,n="]";if("collapsed"===r?n+="[]":"full"===r&&(n+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return{type:"text",value:"!["+t.alt+n};var a=e.all(t),s=a[0];s&&"text"===s.type?s.value="["+s.value:a.unshift({type:"text",value:"["});var i=a[a.length-1];return i&&"text"===i.type?i.value+=n:a.push({type:"text",value:n}),a}function Ys(e){var t=e.spread;return void 0===t||null===t?e.children.length>1:t}var Xs=9,Js=32;function $s(e){for(var t=String(e),r=/\r?\n|\r/g,n=r.exec(t),a=0,s=[];n;)s.push(Qs(t.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return s.push(Qs(t.slice(a),a>0,!1)),s.join("")}function Qs(e,t,r){var n=0,a=e.length;if(t)for(var s=e.codePointAt(n);s===Xs||s===Js;)n++,s=e.codePointAt(n);if(r)for(var i=e.codePointAt(a-1);i===Xs||i===Js;)a--,i=e.codePointAt(a-1);return a>n?e.slice(n,a):""}var Zs={blockquote:function(e,t){var r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)},break:function(e,t){var r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:"\n"}]},code:function(e,t){var r=t.value?t.value+"\n":"",n=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,a={};n&&(a.className=["language-"+n]);var s={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s={type:"element",tagName:"pre",properties:{},children:[s=e.applyData(t,s)]},e.patch(t,s),s},delete:function(e,t){var r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},emphasis:function(e,t){var r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},footnoteReference:zs,footnote:function(e,t){for(var r=e.footnoteById,n=1;n in r;)n++;var a=String(n);return r[a]={type:"footnoteDefinition",identifier:a,children:[{type:"paragraph",children:t.children}],position:t.position},zs(e,{type:"footnoteReference",identifier:a,position:t.position})},heading:function(e,t){var r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},html:function(e,t){if(e.dangerous){var r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}return null},imageReference:function(e,t){var r=e.definition(t.identifier);if(!r)return Vs(e,t);var n={src:Is(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(n.title=r.title);var a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){var r={src:Is(t.url)};null!==t.alt&&void 0!==t.alt&&(r.alt=t.alt),null!==t.title&&void 0!==t.title&&(r.title=t.title);var n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)},inlineCode:function(e,t){var r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);var n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)},linkReference:function(e,t){var r=e.definition(t.identifier);if(!r)return Vs(e,t);var n={href:Is(r.url||"")};null!==r.title&&void 0!==r.title&&(n.title=r.title);var a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){var r={href:Is(t.url)};null!==t.title&&void 0!==t.title&&(r.title=t.title);var n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},listItem:function(e,t,r){var n=e.all(t),a=r?function(e){var t=!1;if("list"===e.type){t=e.spread||!1;for(var r=e.children,n=-1;!t&&++n0&&o.children.unshift({type:"text",value:" "}),o.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}for(var c=-1;++c0){var i={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=Hs(t.children[1]),d=Gs(t.children[t.children.length-1]);o.line&&d.line&&(i.position={start:o,end:d}),a.push(i)}var c={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,c),e.applyData(t,c)},tableCell:function(e,t){var r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},tableRow:function(e,t,r){for(var n=r?r.children:void 0,a=0===(n?n.indexOf(t):1)?"th":"td",s=r&&"table"===r.type?r.align:void 0,i=s?s.length:t.children.length,o=-1,d=[];++o0&&r.push({type:"text",value:"\n"}),r}function di(e,t){var r=ri(e,t),n=r.one(e,null),a=function(e){for(var t=[],r=-1;++r1?"-"+o:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"\u21a9"}]};o>1&&c.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(o)}]}),d.length>0&&d.push({type:"text",value:" "}),d.push(c)}var l=a[a.length-1];if(l&&"element"===l.type&&"p"===l.tagName){var u,p=l.children[l.children.length-1];p&&"text"===p.type?p.value+=" ":l.children.push({type:"text",value:" "}),(u=l.children).push.apply(u,d)}else a.push.apply(a,d);var f={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+i},children:e.wrap(a,!0)};e.patch(n,f),t.push(f)}}if(0!==t.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:tn(tn({},JSON.parse(JSON.stringify(e.footnoteLabelProperties))),{},{id:"footnote-label"}),children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:"\n"}]}}(r);return a&&n.children.push({type:"text",value:"\n"},a),Array.isArray(n)?{type:"root",children:n}:n}var ci=function(e,t){return e&&"run"in e?function(e,t){return function(r,n,a){e.run(di(r,t),n,(function(e){a(e)}))}}(e,t):function(e){return function(t){return di(t,e)}}(e||t)};var li=r(726),ui=r(2092);function pi(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return function(t){Us(t,"element",(function(t,r,n){var a,s=n;if(e.allowedElements?a=!e.allowedElements.includes(t.tagName):e.disallowedElements&&(a=e.disallowedElements.includes(t.tagName)),!a&&e.allowElement&&"number"===typeof r&&(a=!e.allowElement(t,r,s)),a&&"number"===typeof r){var i;if(e.unwrapDisallowed&&t.children)(i=s.children).splice.apply(i,[r,1].concat((0,Yt.Z)(t.children)));else s.children.splice(r,1);return r}}))}}var fi=r(8325);function gi(e){var t=e&&"object"===typeof e&&"text"===e.type?e.value||"":e;return"string"===typeof t&&""===t.replace(/[ \t\n\f\r]/g,"")}var hi=r(1003),mi={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"},yi=r(6370),vi=r(8522),bi=r(9290),xi=["http","https","mailto","tel"];function Ri(e){var t=(e||"").trim(),r=t.charAt(0);if("#"===r||"/"===r)return t;var n=t.indexOf(":");if(-1===n)return t;for(var a=-1;++aa||-1!==(a=t.indexOf("#"))&&n>a?t:"javascript:void(0)"}var Ei={}.hasOwnProperty,Ti=new Set(["table","thead","tbody","tfoot","tr"]);function wi(e,t){for(var r,n=[],a=-1;++a0?d.createElement(h,l,p):d.createElement(h,l)}function Si(e,t){for(var r=-1,n=0;++r for more info)")),delete _i[t]}var n=jn().use(Ps).use(e.remarkPlugins||[]).use(ci,tn(tn({},e.remarkRehypeOptions),{},{allowDangerousHtml:!0})).use(e.rehypePlugins||[]).use(pi,e),a=new hn;"string"===typeof e.children?a.value=e.children:void 0!==e.children&&null!==e.children&&console.warn("[react-markdown] Warning: please pass a string as `children` (not: `".concat(e.children,"`)"));var s=n.runSync(n.parse(a),a);if("root"!==s.type)throw new TypeError("Expected a `root` node");var i=d.createElement(d.Fragment,{},wi({options:e,schema:ui.dy,listDepth:0},s));return e.className&&(i=d.createElement("div",{className:e.className},i)),i}Pi.propTypes={children:li.string,className:li.string,allowElement:li.func,allowedElements:li.arrayOf(li.string),disallowedElements:li.arrayOf(li.string),unwrapDisallowed:li.bool,remarkPlugins:li.arrayOf(li.oneOfType([li.object,li.func,li.arrayOf(li.oneOfType([li.bool,li.string,li.object,li.func,li.arrayOf(li.any)]))])),rehypePlugins:li.arrayOf(li.oneOfType([li.object,li.func,li.arrayOf(li.oneOfType([li.bool,li.string,li.object,li.func,li.arrayOf(li.any)]))])),sourcePos:li.bool,rawSourcePos:li.bool,skipHtml:li.bool,includeElementIndex:li.bool,transformLinkUri:li.oneOfType([li.func,li.bool]),linkTarget:li.oneOfType([li.func,li.string]),transformImageUri:li.func,components:li.object};for(var Ii={tokenize:function(e,t,r){var n=0;return function t(s){if((87===s||119===s)&&n<3)return n++,e.consume(s),t;if(46===s&&3===n)return e.consume(s),a;return r(s)};function a(e){return null===e?r(e):t(e)}},partial:!0},Di={tokenize:function(e,t,r){var n,a,s;return i;function i(t){return 46===t||95===t?e.check(Ni,d,o)(t):null===t||$n(t)||ea(t)||45!==t&&Zn(t)?d(t):(s=!0,e.consume(t),i)}function o(t){return 95===t?n=!0:(a=n,n=void 0),e.consume(t),i}function d(e){return a||n||!s?r(e):t(e)}},partial:!0},Oi={tokenize:function(e,t){var r=0,n=0;return a;function a(i){return 40===i?(r++,e.consume(i),a):41===i&&n0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}Ui[43]=Bi,Ui[45]=Bi,Ui[46]=Bi,Ui[95]=Bi,Ui[72]=[Bi,Mi],Ui[104]=[Bi,Mi],Ui[87]=[Bi,Li],Ui[119]=[Bi,Li];var Yi={tokenize:function(e,t,r){var n=this;return ra(e,(function(e){var a=n.events[n.events.length-1];return a&&"gfmFootnoteDefinitionIndent"===a[1].type&&4===a[2].sliceSerialize(a[1],!0).length?t(e):r(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function Xi(){var e;return{document:Zr({},91,{tokenize:Zi,continuation:{tokenize:eo},exit:to}),text:(e={},Zr(e,91,{tokenize:Qi}),Zr(e,93,{add:"after",tokenize:Ji,resolveTo:$i}),e)}}function Ji(e,t,r){for(var n,a=this,s=a.events.length,i=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);s--;){var o=a.events[s][1];if("labelImage"===o.type){n=o;break}if("gfmFootnoteCall"===o.type||"labelLink"===o.type||"label"===o.type||"image"===o.type||"link"===o.type)break}return function(s){if(!n||!n._balanced)return r(s);var o=ka(a.sliceSerialize({start:n.end,end:a.now()}));if(94!==o.codePointAt(0)||!i.includes(o.slice(1)))return r(s);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s)}}function $i(e,t){for(var r=e.length;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";var n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;var s={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[r+1],e[r+2],["enter",n,t],e[r+3],e[r+4],["enter",a,t],["exit",a,t],["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice.apply(e,[r,e.length-r+1].concat(o)),e}function Qi(e,t,r){var n,a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),i=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?r(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(o){if(i>999||93===o&&!n||null===o||91===o||$n(o))return r(o);if(93===o){e.exit("chunkString");var l=e.exit("gfmFootnoteCallString");return s.includes(ka(a.sliceSerialize(l)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(o)}return $n(o)||(n=!0),i++,e.consume(o),92===o?c:d}function c(t){return 91===t||92===t||93===t?(e.consume(t),i++,d):d(t)}}function Zi(e,t,r){var n,a,s=this,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),d};function d(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):r(t)}function c(t){if(o>999||93===t&&!a||null===t||91===t||$n(t))return r(t);if(93===t){e.exit("chunkString");var i=e.exit("gfmFootnoteDefinitionLabelString");return n=ka(s.sliceSerialize(i)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return $n(t)||(a=!0),o++,e.consume(t),92===t?l:c}function l(t){return 91===t||92===t||93===t?(e.consume(t),o++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(n)||i.push(n),ra(e,p,"gfmFootnoteDefinitionWhitespace")):r(t)}function p(e){return t(e)}}function eo(e,t,r){return e.check(ia,t,e.attempt(Yi,t,r))}function to(e){e.exit("gfmFootnoteDefinition")}function ro(e){var t=(e||{}).singleTilde,r={tokenize:function(e,r,n){var a=this.previous,s=this.events,i=0;return function(t){if(126===a&&"characterEscape"!==s[s.length-1][1].type)return n(t);return e.enter("strikethroughSequenceTemporary"),o(t)};function o(s){var d=Qa(a);if(126===s)return i>1?n(s):(e.consume(s),i++,o);if(i<2&&!t)return n(s);var c=e.exit("strikethroughSequenceTemporary"),l=Qa(s);return c._open=!l||2===l&&Boolean(d),c._close=!d||2===d&&Boolean(l),r(s)}},resolveAll:function(e,t){var r=-1;for(;++r0;)t-=1,r.push(e.slice(this.map[t][0]+this.map[t][1])),r.push(this.map[t][2]),e.length=this.map[t][0];r.push((0,Yt.Z)(e)),e.length=0;for(var n=r.pop();n;)e.push.apply(e,(0,Yt.Z)(n)),n=r.pop();this.map.length=0}}}]),e}();function ao(e,t){for(var r=!1,n=[];t-1;){var n=a.events[t][1].type;if("lineEnding"!==n&&"linePrefix"!==n)break;t--}var s=t>-1?a.events[t][1].type:null,i="tableHead"===s||"tableRow"===s?x:o;if(i===x&&a.parser.lazy[a.now().line])return r(e);return i(e)};function o(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return d(e);return n=!0,i+=1,d(e)}(t)}function d(t){return null===t?r(t):Jn(t)?i>1?(i=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):r(t):Qn(t)?ra(e,d,"whitespace")(t):(i+=1,n&&(n=!1,s+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),n=!0,d):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||$n(t)?(e.exit("data"),d(t)):(e.consume(t),92===t?l:c)}function l(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(t):(e.enter("tableDelimiterRow"),n=!1,Qn(t)?ra(e,p,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?g(t):124===t?(n=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):b(t)}function f(t){return Qn(t)?ra(e,g,"whitespace")(t):g(t)}function g(t){return 58===t?(i+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(i+=1,h(t)):null===t||Jn(t)?v(t):b(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),m(t)):b(t)}function m(t){return 45===t?(e.consume(t),m):58===t?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return Qn(t)?ra(e,v,"whitespace")(t):v(t)}function v(r){return 124===r?p(r):(null===r||Jn(r))&&n&&s===i?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(r)):b(r)}function b(e){return r(e)}function x(t){return e.enter("tableRow"),R(t)}function R(r){return 124===r?(e.enter("tableCellDivider"),e.consume(r),e.exit("tableCellDivider"),R):null===r||Jn(r)?(e.exit("tableRow"),t(r)):Qn(r)?ra(e,R,"whitespace")(r):(e.enter("data"),E(r))}function E(t){return null===t||124===t||$n(t)?(e.exit("data"),R(t)):(e.consume(t),92===t?T:E)}function T(t){return 92===t||124===t?(e.consume(t),E):E(t)}},resolveAll:function(e,t){var r,n,a,s=-1,i=!0,o=0,d=[0,0,0,0],c=[0,0,0,0],l=!1,u=0,p=new no;for(;++sr[2]+1){var f=r[2]+1,g=r[3]-r[2]-1;e.add(f,g,[])}}e.add(r[3]+1,0,[["exit",l,t]])}return void 0!==a&&(s.end=Object.assign({},co(t.events,a)),e.add(a,0,[["exit",s,t]]),s=void 0),s}function oo(e,t,r,n,a){var s=[],i=co(t.events,r);a&&(a.end=Object.assign({},i),s.push(["exit",a,t])),n.end=Object.assign({},i),s.push(["exit",n,t]),e.add(r+1,0,s)}function co(e,t){var r=e[t],n="enter"===r[0]?"start":"end";return r[1][n]}var lo={tokenize:function(e,t,r){var n=this;return function(t){if(null!==n.previous||!n._gfmTasklistFirstContentOfListItem)return r(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),a};function a(t){return $n(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),s):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),s):r(t)}function s(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):r(t)}function i(n){return Jn(n)?t(n):Qn(n)?e.check({tokenize:po},t,r)(n):r(n)}}},uo={text:Zr({},91,lo)};function po(e,t,r){return ra(e,(function(e){return null===e?r(e):t(e)}),"whitespace")}function fo(e,t){var r=String(e);if("string"!==typeof t)throw new TypeError("Expected character");for(var n=0,a=r.indexOf(t);-1!==a;)n++,a=r.indexOf(t,a+t.length);return n}var go={}.hasOwnProperty,ho=function(e,t,r,n){var a,s;"string"===typeof t||t instanceof RegExp?(s=[[t,r]],a=n):(s=t,a=r),a||(a={});for(var i=Ds(a.ignore||[]),o=function(e){var t=[];if("object"!==typeof e)throw new TypeError("Expected array or object as schema");if(Array.isArray(e))for(var r=-1;++r0?{type:"text",value:g}:void 0),!1!==g){var h;if(s!==p&&l.push({type:"text",value:e.value.slice(s,p)}),Array.isArray(g))(h=l).push.apply(h,(0,Yt.Z)(g));else g&&l.push(g);s=p+u[0].length,c=!0}if(!n.global)break;u=n.exec(e.value)}if(c){var m;s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);var r=t[0],n=r.indexOf(")"),a=fo(e,"("),s=fo(e,")");for(;-1!==n&&a>s;)e+=r.slice(0,n+1),n=(r=r.slice(n+1)).indexOf(")"),s++;return[e,r]}(r+n);if(!i[0])return!1;var o={type:"link",title:null,url:s+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[o,{type:"text",value:i[1]}]:o}function wo(e,t,r,n){return!(!jo(n,!0)||/[-\d_]$/.test(r))&&{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function jo(e,t){var r=e.input.charCodeAt(e.index-1);return(0===e.index||ea(r)||Zn(r))&&(!t||47!==r)}function So(e){return e.label||!e.identifier?e.label||"":Ts(e.identifier)}function Ao(e,t,r,n){for(var a=n.join.length;a--;){var s=n.join[a](e,t,r,n);if(!0===s||1===s)break;if("number"===typeof s)return"\n".repeat(1+s);if(!1===s)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}var Co=/\r?\n|\r/g;function ko(e){if(!e._compiled){var t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function _o(e,t){return Po(e,t.inConstruct,!0)&&!Po(e,t.notInConstruct,!1)}function Po(e,t,r){if("string"===typeof t&&(t=[t]),!t||0===t.length)return r;for(var n=-1;++n=h||(m+10?" ":"")),a.shift(4),s+=a.move(function(e,t){for(var r,n=[],a=0,s=0;r=Co.exec(e);)i(e.slice(a,r.index)),n.push(r[0]),a=r.index+r[0].length,s++;return i(e.slice(a)),n.join("");function i(e){n.push(t(e,s,!e))}}(function(e,t,r){var n=t.indexStack,a=e.children||[],s=t.createTracker(r),i=[],o=-1;for(n.push(-1);++o0&&("\r"===o||"\n"===o)&&"html"===c.type&&(s[s.length-1]=s[s.length-1].replace(/(\r?\n|\r)$/," "),o=" ",(d=t.createTracker(r)).move(s.join(""))),s.push(d.move(t.handle(c,e,t,tn(tn({},d.current()),{},{before:o,after:l})))),o=s[s.length-1].slice(-1)}return n.pop(),s.join("")}qo.peek=function(){return"["};Jo.peek=function(){return"~"};var Yo={canContainEols:["delete"],enter:{strikethrough:function(e){this.enter({type:"delete",children:[]},e)}},exit:{strikethrough:function(e){this.exit(e)}}},Xo={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"]}],handlers:{delete:Jo}};function Jo(e,t,r,n){var a=No(n),s=r.enter("strikethrough"),i=a.move("~~");return i+=Vo(e,r,tn(tn({},a.current()),{},{before:i,after:"~"})),i+=a.move("~~"),s(),i}function $o(e,t,r){for(var n=e.value||"",a="`",s=-1;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++s1&&void 0!==arguments[1]?arguments[1]:{},r=(t.align||[]).concat(),n=t.stringLength||Zo,a=[],s=[],i=[],o=[],d=0,c=-1;++cd&&(d=e[c].length);++po[p])&&(o[p]=g)}l.push(f)}s[c]=l,i[c]=u}var h=-1;if("object"===typeof r&&"length"in r)for(;++ho[h]&&(o[h]=E),v[h]=E),y[h]=T}s.splice(1,0,y),i.splice(1,0,v),c=-1;for(var w=[];++c-1?t.start:1)+(!1===r.options.incrementListMarker?0:t.children.indexOf(e))+s);var i=s.length+1;("tab"===a||"mixed"===a&&(t&&"list"===t.type&&t.spread||e.spread))&&(i=4*Math.ceil(i/4));var o=r.createTracker(n);o.move(s+" ".repeat(i-s.length)),o.shift(i);var d=r.enter("listItem"),c=r.indentLines(r.containerFlow(e,o.current()),(function(e,t,r){if(t)return(r?"":" ".repeat(i))+e;return(r?s:s+" ".repeat(i-s.length))+e}));return d(),c}var od={exit:{taskListCheckValueChecked:cd,taskListCheckValueUnchecked:cd,paragraph:function(e){var t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"===typeof t.checked){var r=this.stack[this.stack.length-1],n=r.children[0];if(n&&"text"===n.type){for(var a,s=t.children,i=-1;++i0&&void 0!==arguments[0]?arguments[0]:{},t=this.data();function r(e,r){(t[e]?t[e]:t[e]=[]).push(r)}r("micromarkExtensions",function(e){return Un([Hi,Xi(),ro(e),so,uo])}(e)),r("fromMarkdownExtensions",[xo,{enter:{gfmFootnoteDefinition:Fo,gfmFootnoteDefinitionLabelString:Lo,gfmFootnoteCall:Uo,gfmFootnoteCallString:Ho},exit:{gfmFootnoteDefinition:Bo,gfmFootnoteDefinitionLabelString:Mo,gfmFootnoteCall:Wo,gfmFootnoteCallString:Go}},Yo,td,od]),r("toMarkdownExtensions",function(e){return{extensions:[Ro,{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Ko,footnoteReference:qo}},Xo,sd(e),dd]}}(e))}var ud=r(1775),pd=(0,r(1865).v)(ui.YP,"g",["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"]),fd=r(8372);var gd={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/"},hd={}.hasOwnProperty,md=Object.prototype;function yd(e,t){var r;switch(t.nodeName){case"#comment":return bd(e,t,r={type:"comment",value:t.data}),r;case"#document":case"#document-fragment":var n=t,a="mode"in n&&("quirks"===n.mode||"limited-quirks"===n.mode);if(r={type:"root",children:vd(e,t.childNodes),data:{quirksMode:a}},e.file&&e.location){var s=String(e.file),i=function(e){for(var t=String(e),r=[],n=/\r?\n|\r/g;n.test(t);)r.push(n.lastIndex);return r.push(t.length+1),{toPoint:function(e){var t=-1;if("number"===typeof e&&e>-1&&ee)return{line:t+1,column:e-(t>0?r[t-1]:0)+1,offset:e};return{line:void 0,column:void 0,offset:void 0}},toOffset:function(e){var t=e&&e.line,n=e&&e.column;if("number"===typeof t&&"number"===typeof n&&!Number.isNaN(t)&&!Number.isNaN(n)&&t-1 in r){var a=(r[t-2]||0)+n-1||0;if(a>-1&&a1?o-1:0),c=1;c0&&void 0!==arguments[0]?arguments[0]:{};return function(t,r){return Id(t,r,e)}}var Md=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,Bd=Object.hasOwnProperty;var Ud={}.hasOwnProperty;function Hd(e,t){var r="string"===typeof t&&function(e){return Boolean(e&&"object"===typeof e&&"type"in e)}(e)&&"element"===e.type&&e.properties&&Ud.call(e.properties,t)&&e.properties[t];return null!==r&&void 0!==r&&!1!==r}function Gd(e){var t=e&&"element"===e.type&&e.tagName.toLowerCase()||"",r=2===t.length&&104===t.charCodeAt(0)?t.charCodeAt(1):0;return r>48&&r<55?r-48:null}function Wd(e){return"children"in e?Kd(e):"value"in e?e.value:""}function qd(e){return"text"===e.type?e.value:"children"in e?Kd(e):""}function Kd(e){for(var t=-1,r=[];++t0&&void 0!==arguments[0]?arguments[0]:{}).prefix||"";return function(t){zd.reset(),Us(t,"element",(function(t){Gd(t)&&t.properties&&!Hd(t,"id")&&(t.properties.id=e+zd.slug(Wd(t)))}))}}var Yd=function(e){if(void 0===e||null===e)return $d;if("string"===typeof e)return function(e){return t;function t(t){return $d(t)&&t.tagName===e}}(e);if("object"===typeof e)return Xd(e);if("function"===typeof e)return Jd(e);throw new Error("Expected function, string, or array as test")};function Xd(e){for(var t=[],r=-1;++r1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},r=t.properties,n=t.behaviour||t.behavior||"prepend",a=t.content||Qd,s=t.group,i=Yd(t.test);return"wrap"===n?e=function(e){return e.children=[c(e,En(!0,{},r),e.children)],[Ms]}:"before"===n||"after"===n?e=function(e,t,i){var l;if("number"!==typeof t||!i)return;var u=c(e,En(!0,{},r),o(a,e)),p="before"===n?[u,e]:[e,u];if(s){var f=d(s,e);f&&!Array.isArray(f)&&"element"===f.type&&(f.children=p,p=[f])}return(l=i.children).splice.apply(l,[t,1].concat((0,Yt.Z)(p))),[Ms,t+p.length]}:(r||(r={ariaHidden:"true",tabIndex:-1}),e=function(e){return e.children["prepend"===n?"unshift":"push"](c(e,En(!0,{},r),o(a,e))),[Ms]}),function(t){Us(t,"element",(function(t,r,n){if(Gd(t)&&Hd(t,"id")&&i(t,r,n))return e(t,r,n)}))};function o(e,t){var r=d(e,t);return Array.isArray(r)?r:[r]}function d(e,t){return"function"===typeof e?e(t):En(!0,Array.isArray(e)?[]:{},e)}function c(e,t,r){return{type:"element",tagName:"a",properties:Object.assign({},t,{href:"#"+(e.properties||{}).id}),children:r}}}var ec=function e(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>1?arguments[1]:void 0;a/,"$2")||""))return;if(n){if(e(t,a,"pre",n))return;return i.value=(i.value||"").replace(/^(\n|\s)+/,""),i}return i.value=(i.value||"").replace(/^(\n|\s)+/,""),i}}},tc=function(e){var t=e.value,r=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((function(e,t){return e[t.slice(0,t.indexOf("="))]=t.slice(t.indexOf("=")+1),e}),{})}((void 0===t?"":t).replace(/^/,"$1").replace(/^rehype:/,""));return Object.keys(r).forEach((function(e){"true"===r[e]&&(r[e]=!0),"false"===r[e]&&(r[e]=!1),"string"!==typeof r[e]||/^0/.test(r[e])||isNaN(+r[e])||(r[e]=+r[e])})),r},rc=function(e,t,r){return"string"===r?tn(tn({},e),{},{"data-config":JSON.stringify(tn(tn({},t),{},{rehyp:!0}))}):"attr"===r?tn(tn({},e),t):tn(tn({},e),{},{"data-config":tn(tn({},t),{},{rehyp:!0})})},nc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.properties,r=void 0===t?"data":t,n=e.codeBlockParames,a=void 0===n||n;return function(e){Us(e,"element",(function(e,t,n){if(a&&"pre"===e.tagName&&e&&Array.isArray(e.children)&&n&&Array.isArray(n.children)&&n.children.length>1){var s=e.children[0];if(s&&"code"===s.tagName&&"number"===typeof t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;t>-1;){if(!e[--t])return;if(e[t]&&e[t].value&&""!==e[t].value.replace(/(\n|\s)/g,"")||"text"!==e[t].type){if(!/^rehype:/.test(e[t].value)||"comment"!==e[t].type)return;return e[t]}}}(n.children,t);if(i){var o=tc(i);Object.keys(o).length>0&&(e.properties=tn(tn({},e.properties),{"data-type":"rehyp"}),s.properties=rc(s.properties,o,r))}}}if(/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(e.tagName)&&n&&Array.isArray(n.children)&&"number"===typeof t){var d=ec(n.children,t,"",a);if(d){var c=tc(d);Object.keys(c).length>0&&(e.properties=rc(e.properties,c,r))}}}))}},ac=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.openDelimiter,r=void 0===t?"rehype:ignore:start":t,n=e.closeDelimiter,a=void 0===n?"rehype:ignore:end":n;return function(e){Us(e,(function(e,t,n){if("element"===e.type||"root"===e.type){var s=!1;e.children=e.children.filter((function(e){if("raw"===e.type||"comment"===e.type){var t=(e.value||"").trim();if((t=t.replace(/^/,"$1"))===r)return s=!0,!1;if(t===a)return s=!1,!1}return!s}))}}))}},sc={}.hasOwnProperty,ic=r(7392),oc=r(9686),dc=r(9541);function cc(){cc=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,n,a){var s=new RegExp(e,n);return t.set(s,a||t.get(e)),lc(s,r.prototype)}function n(e,r){var n=t.get(r);return Object.keys(n).reduce((function(t,r){var a=n[r];if("number"==typeof a)t[r]=e[a];else{for(var s=0;void 0===e[a[s]]&&s+1]+)>/g,(function(e,t){var r=s[t];return"$"+(Array.isArray(r)?r.join("$"):r)})))}if("function"==typeof a){var i=this;return e[Symbol.replace].call(this,r,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(n(e,i)),a.apply(this,e)}))}return e[Symbol.replace].call(this,r,a)},cc.apply(this,arguments)}function lc(e,t){return lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lc(e,t)}function uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var fc=function(e){return function(t){return void 0===t&&(t={}),function(e,t){if(t&&!e.registered(t))throw new Error('The default language "'+t+'" is not registered with refractor.')}(e,t.defaultLanguage),function(e){Us(e,"element",r)};function r(r,n,a){var s,i;if(a&&"pre"===a.tagName&&"code"===r.tagName){var o=(null==r||null==(s=r.data)?void 0:s.meta)||(null==r||null==(i=r.properties)?void 0:i.metastring)||"";r.properties.className?"boolean"==typeof r.properties.className?r.properties.className=[]:Array.isArray(r.properties.className)||(r.properties.className=[r.properties.className]):r.properties.className=[];var d,c,l=function(e){for(var t,r=pc(e.properties.className);!(t=r()).done;){var n=t.value;if("language-"===n.slice(0,9))return n.slice(9).toLowerCase()}return null}(r);if(!l&&t.defaultLanguage&&r.properties.className.push("language-"+(l=t.defaultLanguage)),r.properties.className.push("code-highlight"),l)try{var u,p;p=null!=(u=l)&&u.includes("diff-")?l.split("-")[1]:l,d=e.highlight(Wd(r),p),a.properties.className=(a.properties.className||[]).concat("language-"+p)}catch(x){if(!t.ignoreMissing||!/Unknown language/.test(x.message))throw x;d=r}else d=r;d.children=(c=1,function e(t){return t.reduce((function(t,r){if("text"===r.type){var n=r.value,a=(n.match(/\n/g)||"").length;if(0===a)r.position={start:{line:c,column:1},end:{line:c,column:1}},t.push(r);else for(var s,i=n.split("\n"),o=pc(i.entries());!(s=o()).done;){var d=s.value,l=d[0],u=d[1];t.push({type:"text",value:l===i.length-1?u:u+"\n",position:{start:{line:c+l,column:1},end:{line:c+l,column:1}}})}return c+=a,t}if(Object.prototype.hasOwnProperty.call(r,"children")){var p=c;return r.children=e(r.children),t.push(r),r.position={start:{line:p,column:1},end:{line:c,column:1}},t}return t.push(r),t}),[])})(d.children),d.position=d.children.length>0?{start:{line:d.children[0].position.start.line,column:0},end:{line:d.children[d.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var f,g=function(e){var t=/{([\d,-]+)}/,r=e.split(",").map((function(e){return e.trim()})).join();if(t.test(r)){var n=t.exec(r)[1],a=ic(n);return function(e){return a.includes(e+1)}}return function(){return!1}}(o),h=function(e){var t=cc(/showLineNumbers=(\d+)/i,{lines:1});if(t.test(e)){var r=t.exec(e);return Number(r.groups.lines)}return 1}(o),m=function(e){for(var t=new Array(e),r=0;r0&&0===i.length)return null}var c,l={};for(c in t)sc.call(t,c)&&(l[c]="children"===c?i:t[c]);return l}(e)}(d,(function(e){return e.position.start.line<=a+1&&e.position.end.line>=a+1}));s.children=i.children,!o.toLowerCase().includes("showLineNumbers".toLowerCase())&&!t.showLineNumbers||y.some((function(e){return o.toLowerCase().includes(e)}))||(s.properties.line=[(a+h).toString()],s.properties.className.push("line-number")),g(a)&&s.properties.className.push("highlight-line"),("diff"===l||null!=(e=l)&&e.includes("diff-"))&&"-"===Wd(s).substring(0,1)?s.properties.className.push("deleted"):("diff"===l||null!=(r=l)&&r.includes("diff-"))&&"+"===Wd(s).substring(0,1)&&s.properties.className.push("inserted")},b=pc(m.entries());!(f=b()).done;)v();m.length>0&&""===Wd(m[m.length-1]).trim()&&m.pop(),r.children=m}}}},gc=(fc(oc.$),fc(dc.$)),hc="\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc",mc="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff",yc=new RegExp("^[^"+mc+"]*["+hc+"]"),vc=new RegExp("^[^"+hc+"]*["+mc+"]");function bc(e){var t=function(e){var t=String(e||"");return yc.test(t)?"rtl":vc.test(t)?"ltr":"neutral"}(e);return"neutral"===t?void 0:t}function xc(e){var t="element"===e.type&&e.properties&&"string"===typeof e.properties.dir?e.properties.dir.toLowerCase():void 0;return"auto"===t||"ltr"===t||"rtl"===t?t:void 0}var Rc=Td("operator",{unknown:function(e){throw new Error("Unknown operator `"+e.operator+"`")},invalid:function(e,t,r){return Hd(t,r.property)},handlers:{"=":function(e,t,r){return Boolean(Hd(t,r.property)&&t.properties&&Ec(t.properties[r.property],r)===e.value)},"~=":function(e,t,r){var n=t.properties&&t.properties[r.property];return!r.commaSeparated&&n&&"object"===typeof n&&e.value&&n.includes(e.value)||Hd(t,r.property)&&Ec(n,r)===e.value},"|=":function(e,t,r){var n=Ec(t.properties&&t.properties[r.property],r);return Boolean(Hd(t,r.property)&&e.value&&(n===e.value||n.slice(0,e.value.length)===e.value&&"-"===n.charAt(e.value.length)))},"^=":function(e,t,r){return Boolean(Hd(t,r.property)&&t.properties&&e.value&&Ec(t.properties[r.property],r).slice(0,e.value.length)===e.value)},"$=":function(e,t,r){return Boolean(Hd(t,r.property)&&t.properties&&e.value&&Ec(t.properties[r.property],r).slice(-e.value.length)===e.value)},"*=":function(e,t,r){return Boolean(Hd(t,r.property)&&t.properties&&e.value&&Ec(t.properties[r.property],r).includes(e.value))}}});function Ec(e,t){return"boolean"===typeof e?t.attribute:Array.isArray(e)?(t.commaSeparated?vi.P:yi.P)(e):String(e)}function Tc(e,t){return function(r,n){for(var a=jc(r,"tag"),s=jc(null===n||void 0===n?"*":n,"range"),i=[],o=-1;++o=r};var n=Math.abs(t),a=(r%n+n)%n;return t>1?function(e){return e>=r&&e%n===a}:function(e){return e<=r&&e%n===a}}(function(e){if("even"===(e=e.trim().toLowerCase()))return[2,0];if("odd"===e)return[2,1];var t=0,r=0,n=s(),a=i();if(t=Ac&&e.charCodeAt(t)<=Cc;)n=10*n+(e.charCodeAt(t)-Ac),t++;return t===r?null:n}function o(){for(;t0},lang:function(e,t,r,n,a){return""!==a.language&&void 0!==a.language&&wc(a.language,(0,vi.Q)(e.value)).length>0},"last-child":function(e,t,r,n,a){return Bc(a,e),Boolean(a.elementCount&&a.elementIndex===a.elementCount-1)},"last-of-type":function(e,t,r,n,a){return Bc(a,e),"number"===typeof a.typeIndex&&"number"===typeof a.typeCount&&a.typeIndex===a.typeCount-1},matches:Nc,not:function(e,t,r,n,a){return!Nc(e,t,r,n,a)},"nth-child":function(e,t,r,n,a){var s=Uc(e);return Bc(a,e),"number"===typeof a.elementIndex&&s(a.elementIndex)},"nth-last-child":function(e,t,r,n,a){var s=Uc(e);return Bc(a,e),Boolean("number"===typeof a.elementCount&&"number"===typeof a.elementIndex&&s(a.elementCount-a.elementIndex-1))},"nth-of-type":function(e,t,r,n,a){var s=Uc(e);return Bc(a,e),"number"===typeof a.typeIndex&&s(a.typeIndex)},"nth-last-of-type":function(e,t,r,n,a){var s=Uc(e);return Bc(a,e),"number"===typeof a.typeCount&&"number"===typeof a.typeIndex&&s(a.typeCount-1-a.typeIndex)},"only-child":function(e,t,r,n,a){return Bc(a,e),1===a.elementCount},"only-of-type":function(e,t,r,n,a){return Bc(a,e),1===a.typeCount},optional:function(e,t){return!Lc(e,t)},"read-only":function(e,t,r,n,a){return!Fc(e,t,r,n,a)},"read-write":Fc,required:Lc,root:function(e,t,r,n,a){return Boolean((!n||"root"===n.type)&&a.schema&&("html"===a.schema.space||"svg"===a.schema.space)&&("html"===t.tagName||"svg"===t.tagName))},scope:function(e,t,r,n,a){return a.scopeElements.includes(t)}}});function Dc(e,t,r,n,a){for(var s=e.pseudos,i=-1;++i"===d.nestingOperator?"directChild":"descendant",c)}else e.found=!0,e.results.includes(r)||e.results.push(r)}null===o.rule.nestingOperator?Vc(s,"descendant",o):"~"===o.rule.nestingOperator&&Vc(s,"generalSibling",o)}return s}(e,zc(t,e.rootQuery.selectors),r,n,a)),!("children"in r)||e.shallow||e.one&&e.found||function(e,t,r){var n,a=zc(t.descendant,t.directChild),s=-1,i={count:0,types:new Map},o={count:0,types:new Map};for(;++s0&&t.length>0?[].concat((0,Yt.Z)(e),(0,Yt.Z)(t)):e&&e.length>0?e:t&&t.length>0?t:Gc}function Vc(e,t,r){var n=e[t];n?n.push(r):e[t]=[r]}function Yc(e,t){if("element"===t.type){var r=t.tagName.toUpperCase(),n=(e.types.get(r)||0)+1;e.count++,e.types.set(r,n)}}var Xc=new(r(6428).N);function Jc(e){if("string"!==typeof e)throw new TypeError("Expected `string` as selector, not `"+e+"`");return Xc.parse(e)}function $c(e,t,r){return{rootQuery:Wc(Jc(e)),results:[],scopeElements:t?"root"===t.type?t.children:[t]:[],one:!1,shallow:!1,found:!1,schema:"svg"===r?ui.YP:ui.dy,language:void 0,direction:"ltr",editableOrEditingHost:!1,typeIndex:void 0,elementIndex:void 0,typeCount:void 0,elementCount:void 0}}Xc.registerAttrEqualityMods("~","|","^","$","*"),Xc.registerSelectorPseudos("any","matches","not","has"),Xc.registerNestingOperators(">","+","~");var Qc=function e(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){"text"===r.type?t+=r.value:"element"===r.type&&r.children&&Array.isArray(r.children)&&(t+=e(r.children))})),t},Zc=function(e){var t=e||{},r=t.selector,n=t.rewrite;return function(e){if(n&&"function"===typeof n)if(r&&"string"===typeof r){var t=function(e,t,r){var n=$c(e,t,r);return qc(n,t||void 0),n.results}(r,e);t&&t.length>0&&Us(e,t,(function(e,t,r){n(e,t,r)}))}else Us(e,(function(e,t,r){n(e,t,r)}))}},el={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]};function tl(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?tl(t.parentElement):null}function rl(e){var t=function(e){var t=tl(e.target);t&&(t.classList.add("active"),Lr()(t.dataset.code,(function(){setTimeout((function(){t.classList.remove("active")}),2e3)})))};(0,d.useEffect)((function(){var r,n;return null==(r=e.current)||r.removeEventListener("click",t,!1),null==(n=e.current)||n.addEventListener("click",t,!1),function(){var r;null==(r=e.current)||r.removeEventListener("click",t,!1)}}),[e])}var nl,al,sl,il=function(e){return void 0===e&&(e={}),function(e){Us(e,(function(e){"element"===e.type&&"code"===e.tagName&&e.data&&e.data.meta&&(e.properties=s({},e.properties,{"data-meta":String(e.data.meta)}))}))}},ol=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement"],dl=d.forwardRef((function(e,t){var r=e.prefixCls,n=void 0===r?"wmde-markdown wmde-markdown-color":r,a=e.className,o=e.source,c=e.style,l=e.disableCopy,u=void 0!==l&&l,p=e.skipHtml,f=void 0===p||p,g=e.onScroll,h=e.onMouseOver,m=e.pluginsFilter,y=e.rehypeRewrite,v=e.wrapperElement,b=void 0===v?{}:v,x=e.warpperElement,R=void 0===x?{}:x,E=i(e,ol),T=d.useRef(null);(0,d.useImperativeHandle)(t,(function(){return s({},e,{mdp:T})}),[T,e]);var w=(n||"")+" "+(a||"");rl(T);var j=[il,[gc,{ignoreMissing:!0}],Vd,Zd,ac,[Zc,{rewrite:function(e,t,r){if("element"===e.type&&r&&"root"===r.type&&/h(1|2|3|4|5|6)/.test(e.tagName)){var n=e.children&&e.children[0];n&&n.properties&&"true"===n.properties.ariaHidden&&(n.properties=s({class:"anchor"},n.properties),n.children=[el])}if("element"===e.type&&"pre"===e.tagName&&!u){var a=Qc(e.children);e.children.push((void 0===(i=a)&&(i=""),{type:"element",tagName:"div",properties:{class:"copied","data-code":i},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}))}var i;y&&y(e,t,r)}}],[nc,{properties:"attr"}]].concat((0,Yt.Z)(E.rehypePlugins||[])),S={allowElement:function(e,t,r){return E.allowElement?E.allowElement(e,t,r):/^[A-Za-z0-9]+$/.test(e.tagName)}};f&&j.push(Ld);var A=[].concat((0,Yt.Z)(E.remarkPlugins||[]),[ld]),C=s({},R,b);return(0,ir.jsx)("div",s({ref:T,onScroll:g,onMouseOver:h},C,{className:w,style:c,children:(0,ir.jsx)(Pi,s({},S,E,{skipHtml:f,rehypePlugins:m?m("rehype",j):j,remarkPlugins:m?m("remark",A):A,children:o||""}))}))})),cl=["inline","node","components","data"],ll=["data-meta","data-md"],ul=["source","components","data","rehypeRewrite"],pl=Yr.Preview,fl=Yr.Code,gl=Yr.Toolbar,hl=Vt(dl)(nl||(nl=o(["\n margin: 0 auto;\n box-shadow:\n rgb(8 15 41 / 8%) 0.5rem 0.5rem 2rem 0px,\n rgb(8 15 41 / 8%) 0px 0px 1px 0px;\n border: 1px solid var(--color-border-default, #30363d);\n text-align: left;\n max-width: 56rem;\n overflow: auto;\n padding: 2rem;\n border-radius: 0.55rem;\n"]))),ml=function(e){var t,r=e.inline,n=e.node,a=e.components,o=e.data,d=i(e,cl),c=d,l=c["data-md"],u=i(c,ll);if(r||!$r(l))return(0,ir.jsx)("code",s({},d));var p=null==(t=n.position)?void 0:t.start.line,f=Jr(l)||String(p),g=a[""+f];if(f&&"function"===typeof g){var h=o[f].value||"",m=Xr(l),y=m.title,v=m.boreder,b=void 0===v?1:v,x=m.checkered,R=void 0===x?1:x,E=m.code,T=void 0===E?1:E,w=m.toolbar,j=void 0===w?1:w;return(0,ir.jsxs)(Yr,{bordered:!!Number(b),disableCheckered:!Number(R),style:{marginBottom:16},children:[(0,ir.jsx)(pl,{children:(0,ir.jsx)(g,{})}),!!Number(j)&&(0,ir.jsx)(gl,{text:h,visibleButton:!!Number(T),children:y||"Code Example"}),!!Number(T)&&(0,ir.jsx)(fl,{tagName:"pre",style:{marginBottom:0},children:(0,ir.jsx)("code",s({},u))})]})}return(0,ir.jsx)("code",s({},u))};function yl(e){var t=e.components,r=e.data,n=e.rehypeRewrite,a=i(e,ul);return(0,ir.jsx)(hl,s({disableCopy:!0,rehypePlugins:[ac].concat((0,Yt.Z)(a.rehypePlugins||[]))},a,{rehypeRewrite:function(e,t,r){var a;if("element"===e.type&&"pre"===e.tagName&&null!=(a=e.children[0].data)&&a.meta){var s,i=null==(s=e.children[0].data)?void 0:s.meta;$r(i)&&(e.tagName="div",e.properties||(e.properties={}),e.properties["data-md"]=i,e.properties["data-meta"]="preview")}n&&n(e,t,r)},source:r.source,components:s({},t,{div:function(e){return(0,ir.jsx)(ml,s({},e,{components:r.components,data:r.data}))}})}))}var vl,bl,xl,Rl,El,Tl=function(e){for(var t=[],r=1;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=6&&r<18},"Primary school"),t.default.createElement(n.Case,{condition:r>=18&&r<60},"Went to college"),t.default.createElement(n.Default,null,"you graduated")))}}(),130:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t=function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!==typeof t)return{default:t};var n=a(r);if(n&&n.has(t))return n.get(t);var s={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var d=i?Object.getOwnPropertyDescriptor(t,o):null;d&&(d.get||d.set)?Object.defineProperty(s,o,d):s[o]=t[o]}s.default=t,n&&n.set(t,s);return s}(r(3528)),n=r(4393);function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,s,i,o=[],d=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;d=!1}else for(;!(d=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);d=!0);}catch(e){c=!0,a=e}finally{try{if(!d&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=6&&r<18},"Primary school"),t.default.createElement(n.Case,{as:"div",condition:r>=18&&r<60},"Went to college"),t.default.createElement(n.Default,{as:"p"},"you graduated")))}}()},data:{79:{name:79,meta:{background:"#fff",codePen:"true"},code:'"use strict";\n\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nvar _react = _interopRequireWildcard(require("react"));\nvar _reactOnlyWhen = _interopRequireDefault(require("@uiw/react-only-when"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nreturn function App() {\n var _useState = (0, _react.useState)(true),\n _useState2 = _slicedToArray(_useState, 2),\n show = _useState2[0],\n setShow = _useState2[1];\n return /*#__PURE__*/_react["default"].createElement("div", {\n className: "app"\n }, /*#__PURE__*/_react["default"].createElement("button", {\n onClick: function onClick() {\n return setShow(!show);\n }\n }, "Toggle"), /*#__PURE__*/_react["default"].createElement(_reactOnlyWhen["default"], {\n when: show\n }, /*#__PURE__*/_react["default"].createElement("h1", null, "Here I Am")));\n};',language:"jsx",value:"import React, { useState } from 'react';\nimport Only from '@uiw/react-only-when';\n\nexport default function App() {\n const [show, setShow] = useState(true)\n return (\n
\n \n \n

Here I Am

\n
\n
\n )\n}"},108:{name:108,meta:{background:"#fff",codePen:"true"},code:'"use strict";\n\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nvar _react = _interopRequireWildcard(require("react"));\nvar _switch = require("@uiw/react-only-when/switch");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nreturn function App() {\n var _useState = (0, _react.useState)(19),\n _useState2 = _slicedToArray(_useState, 2),\n age = _useState2[0],\n setAge = _useState2[1];\n return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("input", {\n type: "range",\n onChange: function onChange(evn) {\n return setAge(Number(evn.target.value));\n }\n }), " ", age, /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_switch.Switch, null, /*#__PURE__*/_react["default"].createElement(_switch.Case, {\n condition: age < 6\n }, "Preschool"), /*#__PURE__*/_react["default"].createElement(_switch.Case, {\n condition: age >= 6 && age < 18\n }, "Primary school"), /*#__PURE__*/_react["default"].createElement(_switch.Case, {\n condition: age >= 18 && age < 60\n }, "Went to college"), /*#__PURE__*/_react["default"].createElement(_switch.Default, null, "you graduated")));\n};',language:"jsx",value:"import React, { useState, Fragment } from 'react';\nimport { Switch, Case, Default } from '@uiw/react-only-when/switch'\n\nexport default function App() {\n const [age, setAge] = useState(19)\n return (\n \n setAge(Number(evn.target.value))} /> {age}
\n \n Preschool\n = 6 && age < 18}>Primary school\n = 18 && age < 60}>Went to college\n you graduated\n \n
\n );\n}"},130:{name:130,meta:{background:"#fff",codePen:"true"},code:'"use strict";\n\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nvar _react = _interopRequireWildcard(require("react"));\nvar _switch = require("@uiw/react-only-when/switch");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nreturn function App() {\n var _useState = (0, _react.useState)(19),\n _useState2 = _slicedToArray(_useState, 2),\n age = _useState2[0],\n setAge = _useState2[1];\n return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("input", {\n type: "range",\n onChange: function onChange(evn) {\n return setAge(Number(evn.target.value));\n }\n }), " ", age, /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_switch.Switch, null, /*#__PURE__*/_react["default"].createElement(_switch.Case, {\n as: "span",\n condition: age < 6\n }, "Preschool"), /*#__PURE__*/_react["default"].createElement(_switch.Case, {\n as: "em",\n condition: age >= 6 && age < 18\n }, "Primary school"), /*#__PURE__*/_react["default"].createElement(_switch.Case, {\n as: "div",\n condition: age >= 18 && age < 60\n }, "Went to college"), /*#__PURE__*/_react["default"].createElement(_switch.Default, {\n as: "p"\n }, "you graduated")));\n};',language:"jsx",value:'import React, { useState, Fragment } from \'react\';\nimport { Switch, Case, Default } from \'@uiw/react-only-when/switch\'\n\nexport default function App() {\n const [age, setAge] = useState(19)\n return (\n \n setAge(Number(evn.target.value))} /> {age}\n
\n \n Preschool\n = 6 && age < 18}>Primary school\n = 18 && age < 60}>Went to college\n you graduated\n \n
\n );\n}'}},source:"react-only-when\n===\n\n[![Build & Deploy](https://github.com/uiwjs/react-only-when/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-only-when/actions/workflows/ci.yml)\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@uiw/react-only-when)](https://www.npmjs.com/package/@uiw/react-only-when)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-only-when.svg)](https://www.npmjs.com/package/@uiw/react-only-when)\n[![Coverage Status](https://uiwjs.github.io/react-only-when/badges.svg)](https://uiwjs.github.io/react-only-when/coverage/lcov-report/)\n\nA declarative component for conditional rendering. Copy [`react-only-when`](https://github.com/sag1v/react-only-when), let it support TypeScript.\n\n## Quick Start\n\n```bash\n$ npm install --save @uiw/react-only-when\n```\n\n## Usage\n\n```jsx\nimport Only from '@uiw/react-only-when'\n \n\n

Here I Am

\n
\n```\n\n```jsx\nimport { If } from '@uiw/react-only-when/if'\n\n\n

{props.error}

\n
\n```\n\n```jsx\nimport { Switch, Case, Default } from '@uiw/react-only-when/switch'\n\n\n preschool\n = 6}>primary school\n you graduated\n\n```\n\n## \\\n\nReact component that renders the children if the `condition` prop is `true`.\n\n```jsx\nimport { If } from '@uiw/react-only-when';\n// Or\nimport { If } from '@uiw/react-only-when/if'\n\n
\n (\n

{props.error}

\n )}\n />\n \n

{props.error}

\n
\n
\n```\n\nOr you could just use plain JavaScript:\n\n```jsx\n
\n {props.error && (\n

{props.error}

\n )}\n
\n```\n\nOnly Example\n\n```jsx mdx:preview&background=#fff&codePen=true\nimport React, { useState } from 'react';\nimport Only from '@uiw/react-only-when';\n\nexport default function App() {\n const [show, setShow] = useState(true)\n return (\n
\n \n \n

Here I Am

\n
\n
\n )\n}\n```\n\n## \\\n\n```jsx\nimport { Switch, Case, Default } from '@uiw/react-only-when/switch'\n\n\n preschool\n = 6}>primary school\n you graduated\n\n```\n\n```jsx mdx:preview&background=#fff&codePen=true\nimport React, { useState, Fragment } from 'react';\nimport { Switch, Case, Default } from '@uiw/react-only-when/switch'\n\nexport default function App() {\n const [age, setAge] = useState(19)\n return (\n \n setAge(Number(evn.target.value))} /> {age}
\n \n Preschool\n = 6 && age < 18}>Primary school\n = 18 && age < 60}>Went to college\n you graduated\n \n
\n );\n}\n```\n\nDefaults to specifying a wrapped HTML Element.\n\n```jsx mdx:preview&background=#fff&codePen=true\nimport React, { useState, Fragment } from 'react';\nimport { Switch, Case, Default } from '@uiw/react-only-when/switch'\n\nexport default function App() {\n const [age, setAge] = useState(19)\n return (\n \n setAge(Number(evn.target.value))} /> {age}\n
\n \n Preschool\n = 6 && age < 18}>Primary school\n = 18 && age < 60}>Went to college\n you graduated\n \n
\n );\n}\n```\n\n## `` props\n\n| prop name | type | default | isRequired | description |\n| ----- | ----- | ----- | ----- | ----- |\n| children | react element | `null` | `true` | A single child element |\n| when | bool | `false` | `true` | When true, children will rendered as is |\n| hiddenMode | string | `null` | `false` | Determines how children should be hidden |\n| className | string | `w-hidden` | `false` | This is working in combination with `hiddenMode={\"css\"}` |\n\n**`hiddenMode` enum**\n\n| hiddenMode | description |\n| ----- | ----- |\n| `null` | Will not render the child |\n| `display` | Will render the child with `display:none` |\n| `visibility` | Will render the child with `visibility:hidden` |\n| `css` | Will render the child with a CSS class (you can pass it a custom `className` prop) |\n\n## `` Props\n\n```tsx\nimport { ReactElement } from 'react';\nimport { FC, PropsWithChildren } from 'react';\nexport interface IfProps {\n readonly condition?: boolean;\n readonly render?: () => ReactElement;\n}\nexport declare const If: FC>;\n```\n\n## `` `` `` Props\n\n```tsx\nimport { FC, PropsWithChildren } from 'react';\nexport declare const Switch: FC>;\nexport interface CaseProps {\n readonly condition?: boolean;\n}\nexport declare const Case: FC>;\nexport declare const Default: FC;\n```\n\n## Development\n\nRuns the project in development mode. \n\n```bash\n# Step 1, run first, listen to the component compile and output the .js file\n# listen for compilation output type .d.ts file\nnpm run watch\n# Step 2, development mode, listen to compile preview website instance\nnpm run start\n```\n\n**production**\n\nBuilds the app for production to the build folder.\n\n```bash\nnpm run build\n```\n\nThe build is minified and the filenames include the hashes.\nYour app is ready to be deployed!\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\n \n\n\nMade with [contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n\n## License\n\nMIT \xa9 [`sag1v`](https://github.com/sag1v) & [`uiwjs`](https://github.com/uiwjs)",headings:[]},Fl=JSON.parse('{"i8":"1.2.0","WL":"A declarative component for conditional rendering."}'),Ll=function(e){return e.condition?e.render?e.render():e.children:null},Ml=["style"];function Bl(e){var t=e.children,r=e.when,n=e.hiddenMode,a=void 0===n?"null":n,o=e.className,c=void 0===o?"w-hidden":o,l=d.Children.only(t),u=l.props,p=u.style,f=s({},i(u,Ml)),g=a&&"null"!==a;g&&("css"===a?f.className=((f.className||"")+" "+(c||"")).trim():f.style=s({},p,"display"===a&&{display:"none"},"visibility"===a&&{visibility:"hidden"}));var h=d.cloneElement(l,f);return r?l:(0,ir.jsx)(Ll,{condition:g,children:h})}function Ul(e){var t=e.hiddenMode,r=e.value,n=e.onChange;return(0,ir.jsxs)("label",{children:[(0,ir.jsx)("input",{type:"radio",value:t,name:"hiddenMode",checked:t===r,onChange:n})," ",r]})}var Hl=function(){var e=pr((0,d.useState)(!0),2),t=e[0],r=e[1],n=pr((0,d.useState)("null"),2),a=n[0],s=n[1];return(0,ir.jsxs)("div",{style:{padding:10,backgroundColor:"rgb(0 0 0 / 17%)",minWidth:360,borderRadius:5},children:[(0,ir.jsxs)("label",{children:[(0,ir.jsx)("input",{type:"checkbox",checked:t,onChange:function(e){return r(e.target.checked)}})," when=","".concat(t)]}),(0,ir.jsxs)("div",{children:[(0,ir.jsx)(Ul,{hiddenMode:a,value:"null",onChange:function(){return s("null")}}),(0,ir.jsx)(Ul,{hiddenMode:a,value:"display",onChange:function(){return s("display")}}),(0,ir.jsx)(Ul,{hiddenMode:a,value:"visibility",onChange:function(){return s("visibility")}}),(0,ir.jsx)(Ul,{hiddenMode:a,value:"css",onChange:function(){return s("css")}})]}),(0,ir.jsx)(Bl,{when:t,hiddenMode:a,className:"css"===a?"w-only-hidden":"",children:(0,ir.jsx)("h1",{children:"Here I Am"})})]})},Gl=Ol.Github,Wl=Ol.Example,ql=document.getElementById("root");(0,a.s)(ql).render((0,ir.jsxs)(Ol,{source:Nl.source,components:Nl.components,data:Nl.data,title:"react-only-when",description:Fl.WL,version:"v".concat(Fl.i8),children:[(0,ir.jsx)(Gl,{href:"https://github.com/uiwjs/react-only-when"}),(0,ir.jsx)(Wl,{children:(0,ir.jsx)(Hl,{})})]}))},8451:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.If=void 0;t.If=function(e){return e.condition?e.render?e.render():e.children:null}},1344:function(e,t,r){"use strict";var n=r(3203).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Default=t.Case=void 0;var a=n(r(3231)),s=n(r(624)),i=n(r(966)),o=r(3528),d=r(2454),c=r(9584),l=["children","condition","as"],u=["children","as"];t.Case=function(e){var t,r=(0,o.useId)(),n=(0,d.useSwitchDispatch)(),u=e.children,p=e.condition,f=e.as,g=(0,i.default)(e,l),h=f,m=h?(0,c.jsx)(h,(0,s.default)((0,s.default)({},g),{},{children:u})):u,y=(t={},(0,a.default)(t,r,m),(0,a.default)(t,"active",(0,a.default)({},r,!!p)),t);return(0,o.useEffect)((function(){return n(y)}),[y]),null};t.Default=function(e){var t=(0,d.useSwitchDispatch)(),r=e.children,n=e.as,a=(0,i.default)(e,u),l=n,p=l?(0,c.jsx)(l,(0,s.default)((0,s.default)({},a),{},{children:r})):r;return(0,o.useEffect)((function(){return t({default:p})}),[e]),null}},6473:function(e,t,r){"use strict";var n=r(3203).default;Object.defineProperty(t,"__esModule",{value:!0});var a={};t.default=function(e){var t=e.children,r=e.when,n=e.hiddenMode,a=void 0===n?"null":n,u=e.className,p=void 0===u?"w-hidden":u,f=o.default.Children.only(t),g=f.props,h=g.style,m=(0,i.default)(g,l),y=(0,s.default)({},m),v=a&&"null"!==a;v&&("css"===a?y.className="".concat(y.className||""," ").concat(p||"").trim():y.style=(0,s.default)((0,s.default)((0,s.default)({},h),"display"===a&&{display:"none"}),"visibility"===a&&{visibility:"hidden"}));var b=o.default.cloneElement(f,y),x=(0,c.jsx)(d.If,{condition:v,children:b});return r?f:x};var s=n(r(624)),i=n(r(966)),o=n(r(3528)),d=r(8451);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(a,e)||e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}));var c=r(9584),l=["style"]},4393:function(e,t,r){"use strict";var n=r(3203).default;Object.defineProperty(t,"__esModule",{value:!0});var a={Switch:!0};t.Switch=void 0;var s=n(r(131)),i=r(2454),o=r(1344);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(a,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var d=r(9584);t.Switch=function(e){var t=e.children,r=(0,i.useSwitch)(),n=(0,s.default)(r,2),a=n[0],l=n[1],u=[],p=Array.isArray(t)?t:t?[t]:null;if(p)for(var f=0;f0&&document.getSelection().getRangeAt(0);r.select();var a=!1;try{a=!!document.execCommand("copy")}catch(s){a=!1}document.body.removeChild(r),n&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n)),t&&t(a)}}return e}()},9446:function(e,t,r){var n=r(8983).default,a=r(2081).default,s=r(7266).default,i=r(8724).default,o=r(670).default,d=r(9952).default,c=r(3231).default,l=document,u="_dark_mode_theme_",p="permanent",f="colorschemechange",g="light",h="dark",m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get:function(){var e=this.getAttribute(t);return null===e?"":e},set:function(e){this.setAttribute(t,e)}})},y=function(e){"use strict";i(r,e);var t=o(r);function r(){var e;return n(this,r),e=t.call(this),c(s(e),"LOCAL_NANE",u),e.t(),e}return a(r,[{key:"connectedCallback",value:function(){var e=this;m(this,"mode"),m(this,h),m(this,g),function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get:function(){return this.hasAttribute(t)},set:function(e){e?this.setAttribute(t,""):this.removeAttribute(t)}})}(this,p);var t=localStorage.getItem(u);t&&[g,h].includes(t)&&(this.mode=t,this.permanent=!0),this.permanent&&!t&&localStorage.setItem(u,this.mode);var r=[g,h].includes(t);this.permanent&&t?this.o():(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(this.mode=h,this.o()),window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(this.mode=g,this.o())),this.permanent||r||(window.matchMedia("(prefers-color-scheme: light)").onchange=function(t){e.mode=t.matches?g:h,e.o()},window.matchMedia("(prefers-color-scheme: dark)").onchange=function(t){e.mode=t.matches?h:g,e.o()}),new MutationObserver((function(t,n){e.mode=l.documentElement.dataset.colorMode,e.permanent&&r&&(localStorage.setItem(u,e.mode),e.i("permanentcolorscheme",{permanent:e.permanent})),e.h(),e.i(f,{colorScheme:e.mode})})).observe(l.documentElement,{attributes:!0}),this.i(f,{colorScheme:this.mode}),this.h()}},{key:"attributeChangedCallback",value:function(e,t,r){if("mode"===e&&t!==r&&[g,h].includes(r)){var n=localStorage.getItem(u);this.mode===n?(this.mode=r,this.h(),this.o()):this.mode&&this.mode!==n&&(this.h(),this.o())}else e!==g&&e!==h||t===r||this.h();"permanent"===e&&"boolean"===typeof this.permanent&&(this.permanent?localStorage.setItem(u,this.mode):localStorage.removeItem(u))}},{key:"o",value:function(){l.documentElement.setAttribute("data-color-mode",this.mode)}},{key:"h",value:function(){this.icon.textContent=this.mode===g?"\ud83c\udf12":"\ud83c\udf1e",this.text.textContent=this.mode===g?this.getAttribute(h):this.getAttribute(g),!this.text.textContent&&this.text.parentElement&&this.text&&this.text.parentElement.removeChild(this.text)}},{key:"t",value:function(){var e=this,t=this.attachShadow({mode:"open"});this.label=l.createElement("span"),this.label.setAttribute("class","wrapper"),this.label.onclick=function(){e.mode=e.mode===g?h:g,e.permanent&&localStorage.setItem(u,e.mode),e.o(),e.h()},t.appendChild(this.label),this.icon=l.createElement("span"),this.label.appendChild(this.icon),this.text=l.createElement("span"),this.label.appendChild(this.text);var r="_dark_mode_style_";if(!l.getElementById(r)){var n=l.createElement("style");n.id=r,n.textContent="\n[data-color-mode*='dark'], [data-color-mode*='dark'] body {\n color-scheme: dark;\n --color-theme-bg: #0d1117;\n --color-theme-text: #c9d1d9;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}\n\n[data-color-mode*='light'], [data-color-mode*='light'] body {\n color-scheme: light;\n --color-theme-bg: #fff;\n --color-theme-text: #24292f;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}",l.head.appendChild(n)}var a=l.createElement("style");a.textContent="\n .wrapper { cursor: pointer; user-select: none; position: relative; }\n .wrapper > span + span { margin-left: .4rem; }\n ",t.appendChild(a)}},{key:"i",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}}],[{key:"observedAttributes",get:function(){return["mode",g,h,p]}}]),r}(d(HTMLElement));customElements.define("dark-mode",y)},2258:function(e,t){"use strict";function r(e,t){return(Array.isArray(t)?t:[t]).some((function(t){return"string"===typeof t&&(t=new RegExp(t)),t.test(e||"")}))}},1e3:function(e,t){"use strict"},7520:function(e){e.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},6428:function(e,t,r){"use strict";var n=r(716),a=r(4664),s=function(){function e(){this.pseudos={},this.attrEqualityMods={},this.ruleNestingOperators={},this.substitutesEnabled=!1}return e.prototype.registerSelectorPseudos=function(){for(var e=[],t=0;t=o)throw Error("Expected symbol but end of file reached.");if(d=e.charAt(t),n.identSpecialChars[d])r+=d;else{if(n.isHex(d)){var a=d;for(t++,d=e.charAt(t);n.isHex(d);)a+=d,t++,d=e.charAt(t);" "===d&&(t++,d=e.charAt(t)),r+=String.fromCharCode(parseInt(a,16));continue}r+=d}}t++,d=e.charAt(t)}return r}function u(){d=e.charAt(t);for(var r=!1;" "===d||"\t"===d||"\n"===d||"\r"===d||"\f"===d;)r=!0,t++,d=e.charAt(t);return r}function p(){var r=f();if(!r)return null;var n=r;for(d=e.charAt(t);","===d;){if(t++,u(),"selectors"!==n.type&&(n={type:"selectors",selectors:[r]}),!(r=f()))throw Error('Rule expected after ",".');n.selectors.push(r)}return n}function f(){u();var r={type:"ruleSet"},n=g();if(!n)return null;for(var a=r;n&&(n.type="rule",a.rule=n,a=n,u(),d=e.charAt(t),!(t>=o||","===d||")"===d));)if(s[d]){var i=d;if(t++,u(),!(n=g()))throw Error('Rule expected after "'+i+'".');n.nestingOperator=i}else(n=g())&&(n.nestingOperator=null);return r}function g(){for(var s=null;t=o)throw Error('Expected "=" but end of file reached.');if("="!==d)throw Error('Expected "=" but "'+d+'" found.');f.operator=g+"=",t++,u();var h="";if(f.valueType="string",'"'===d)h=c('"',n.doubleQuotesEscapeChars);else if("'"===d)h=c("'",n.singleQuoteEscapeChars);else if(i&&"$"===d)t++,h=l(),f.valueType="substitute";else{for(;t=o)throw Error('Expected "]" but end of file reached.');if("]"!==d)throw Error('Expected "]" but "'+d+'" found.');t++,f.value=h}((s=s||{}).attrs=s.attrs||[]).push(f)}else{if(":"!==d)break;t++;var m=l(),y={name:m};if("("===d){t++;var v="";if(u(),"selector"===r[m])y.valueType="selector",v=p();else{if(y.valueType=r[m]||"string",'"'===d)v=c('"',n.doubleQuotesEscapeChars);else if("'"===d)v=c("'",n.singleQuoteEscapeChars);else if(i&&"$"===d)t++,v=l(),y.valueType="substitute";else{for(;t=o)throw Error('Expected ")" but end of file reached.');if(")"!==d)throw Error('Expected ")" but "'+d+'" found.');t++,y.value=v}((s=s||{}).pseudos=s.pseudos||[]).push(y)}return s}return function(){var r=p();if(t="a"&&e<="z"||e>="A"&&e<="Z"||"-"===e||"_"===e},t.isIdent=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"-"===e||"_"===e},t.isHex=function(e){return e>="a"&&e<="f"||e>="A"&&e<="F"||e>="0"&&e<="9"},t.escapeIdentifier=function(e){for(var r=e.length,n="",a=0;a="A"&&s<="Z"||s>="a"&&s<="z"||0!==a&&s>="0"&&s<="9")n+=s;else{var i=s.charCodeAt(0);if(55296===(63488&i)){var o=e.charCodeAt(a++);if(55296!==(64512&i)||56320!==(64512&o))throw Error("UCS-2(decode): illegal sequence");i=((1023&i)<<10)+(1023&o)+65536}n+="\\"+i.toString(16)+" "}a++}return n},t.escapeStr=function(e){for(var r,n=e.length,a="",s=0;s":!0,"?":!0,"@":!0,"[":!0,"\\":!0,"]":!0,"^":!0,"`":!0,"{":!0,"|":!0,"}":!0,"~":!0},t.strReplacementsRev={"\n":"\\n","\r":"\\r","\t":"\\t","\f":"\\f","\v":"\\v"},t.singleQuoteEscapeChars={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\","'":"'"},t.doubleQuotesEscapeChars={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\",'"':'"'}},2032:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"===typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},i=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,a=t.call(e,"constructor"),s=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!s)return!1;for(n in e);return"undefined"===typeof n||t.call(e,n)},o=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;if(a)return a(e,r).value}return e[r]};e.exports=function e(){var t,r,n,a,c,l,u=arguments[0],p=1,f=arguments.length,g=!1;for("boolean"===typeof u&&(g=u,u=arguments[1]||{},p=2),(null==u||"object"!==typeof u&&"function"!==typeof u)&&(u={});p-1)return n.QUIRKS;var l=null===t?i:s;if(u(r,l))return n.QUIRKS;if(u(r,l=null===t?d:c))return n.LIMITED_QUIRKS}return n.NO_QUIRKS},t.serializeContent=function(e,t,r){var n="!DOCTYPE ";return e&&(n+=e),t?n+=" PUBLIC "+l(t):r&&(n+=" SYSTEM"),null!==r&&(n+=" "+l(r)),n}},5693:function(e){"use strict";e.exports={controlCharacterInInputStream:"control-character-in-input-stream",noncharacterInInputStream:"noncharacter-in-input-stream",surrogateInInputStream:"surrogate-in-input-stream",nonVoidHtmlElementStartTagWithTrailingSolidus:"non-void-html-element-start-tag-with-trailing-solidus",endTagWithAttributes:"end-tag-with-attributes",endTagWithTrailingSolidus:"end-tag-with-trailing-solidus",unexpectedSolidusInTag:"unexpected-solidus-in-tag",unexpectedNullCharacter:"unexpected-null-character",unexpectedQuestionMarkInsteadOfTagName:"unexpected-question-mark-instead-of-tag-name",invalidFirstCharacterOfTagName:"invalid-first-character-of-tag-name",unexpectedEqualsSignBeforeAttributeName:"unexpected-equals-sign-before-attribute-name",missingEndTagName:"missing-end-tag-name",unexpectedCharacterInAttributeName:"unexpected-character-in-attribute-name",unknownNamedCharacterReference:"unknown-named-character-reference",missingSemicolonAfterCharacterReference:"missing-semicolon-after-character-reference",unexpectedCharacterAfterDoctypeSystemIdentifier:"unexpected-character-after-doctype-system-identifier",unexpectedCharacterInUnquotedAttributeValue:"unexpected-character-in-unquoted-attribute-value",eofBeforeTagName:"eof-before-tag-name",eofInTag:"eof-in-tag",missingAttributeValue:"missing-attribute-value",missingWhitespaceBetweenAttributes:"missing-whitespace-between-attributes",missingWhitespaceAfterDoctypePublicKeyword:"missing-whitespace-after-doctype-public-keyword",missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:"missing-whitespace-between-doctype-public-and-system-identifiers",missingWhitespaceAfterDoctypeSystemKeyword:"missing-whitespace-after-doctype-system-keyword",missingQuoteBeforeDoctypePublicIdentifier:"missing-quote-before-doctype-public-identifier",missingQuoteBeforeDoctypeSystemIdentifier:"missing-quote-before-doctype-system-identifier",missingDoctypePublicIdentifier:"missing-doctype-public-identifier",missingDoctypeSystemIdentifier:"missing-doctype-system-identifier",abruptDoctypePublicIdentifier:"abrupt-doctype-public-identifier",abruptDoctypeSystemIdentifier:"abrupt-doctype-system-identifier",cdataInHtmlContent:"cdata-in-html-content",incorrectlyOpenedComment:"incorrectly-opened-comment",eofInScriptHtmlCommentLikeText:"eof-in-script-html-comment-like-text",eofInDoctype:"eof-in-doctype",nestedComment:"nested-comment",abruptClosingOfEmptyComment:"abrupt-closing-of-empty-comment",eofInComment:"eof-in-comment",incorrectlyClosedComment:"incorrectly-closed-comment",eofInCdata:"eof-in-cdata",absenceOfDigitsInNumericCharacterReference:"absence-of-digits-in-numeric-character-reference",nullCharacterReference:"null-character-reference",surrogateCharacterReference:"surrogate-character-reference",characterReferenceOutsideUnicodeRange:"character-reference-outside-unicode-range",controlCharacterReference:"control-character-reference",noncharacterCharacterReference:"noncharacter-character-reference",missingWhitespaceBeforeDoctypeName:"missing-whitespace-before-doctype-name",missingDoctypeName:"missing-doctype-name",invalidCharacterSequenceAfterDoctypeName:"invalid-character-sequence-after-doctype-name",duplicateAttribute:"duplicate-attribute",nonConformingDoctype:"non-conforming-doctype",missingDoctype:"missing-doctype",misplacedDoctype:"misplaced-doctype",endTagWithoutMatchingOpenElement:"end-tag-without-matching-open-element",closingOfElementWithOpenChildElements:"closing-of-element-with-open-child-elements",disallowedContentInNoscriptInHead:"disallowed-content-in-noscript-in-head",openElementsLeftAfterEof:"open-elements-left-after-eof",abandonedHeadElementChild:"abandoned-head-element-child",misplacedStartTagForHeadElement:"misplaced-start-tag-for-head-element",nestedNoscriptInHead:"nested-noscript-in-head",eofInElementThatCanContainOnlyText:"eof-in-element-that-can-contain-only-text"}},9205:function(e,t,r){"use strict";var n,a=r(3231).default,s=r(951),i=r(3352),o=i.TAG_NAMES,d=i.NAMESPACES,c=i.ATTRS,l="text/html",u="application/xhtml+xml",p={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},f={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:d.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:d.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:d.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:d.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:d.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:d.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:d.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:d.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:d.XML},"xml:space":{prefix:"xml",name:"space",namespace:d.XML},xmlns:{prefix:"",name:"xmlns",namespace:d.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:d.XMLNS}},g=t.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},h=(a(n={},o.B,!0),a(n,o.BIG,!0),a(n,o.BLOCKQUOTE,!0),a(n,o.BODY,!0),a(n,o.BR,!0),a(n,o.CENTER,!0),a(n,o.CODE,!0),a(n,o.DD,!0),a(n,o.DIV,!0),a(n,o.DL,!0),a(n,o.DT,!0),a(n,o.EM,!0),a(n,o.EMBED,!0),a(n,o.H1,!0),a(n,o.H2,!0),a(n,o.H3,!0),a(n,o.H4,!0),a(n,o.H5,!0),a(n,o.H6,!0),a(n,o.HEAD,!0),a(n,o.HR,!0),a(n,o.I,!0),a(n,o.IMG,!0),a(n,o.LI,!0),a(n,o.LISTING,!0),a(n,o.MENU,!0),a(n,o.META,!0),a(n,o.NOBR,!0),a(n,o.OL,!0),a(n,o.P,!0),a(n,o.PRE,!0),a(n,o.RUBY,!0),a(n,o.S,!0),a(n,o.SMALL,!0),a(n,o.SPAN,!0),a(n,o.STRONG,!0),a(n,o.STRIKE,!0),a(n,o.SUB,!0),a(n,o.SUP,!0),a(n,o.TABLE,!0),a(n,o.TT,!0),a(n,o.U,!0),a(n,o.UL,!0),a(n,o.VAR,!0),n);t.causesExit=function(e){var t=e.tagName;return!!(t===o.FONT&&(null!==s.getTokenAttr(e,c.COLOR)||null!==s.getTokenAttr(e,c.SIZE)||null!==s.getTokenAttr(e,c.FACE)))||h[t]},t.adjustTokenMathMLAttrs=function(e){for(var t=0;t=55296&&e<=57343},t.isSurrogatePair=function(e){return e>=56320&&e<=57343},t.getSurrogatePairCodePoint=function(e,t){return 1024*(e-55296)+9216+t},t.isControlCodePoint=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},t.isUndefinedCodePoint=function(e){return e>=64976&&e<=65007||r.indexOf(e)>-1}},1251:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(8724).default,i=r(670).default,o=function(e){s(r,e);var t=i(r);function r(e,a){var s;return n(this,r),(s=t.call(this,e)).posTracker=null,s.onParseError=a.onParseError,s}return a(r,[{key:"_setErrorLocation",value:function(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset}},{key:"_reportError",value:function(e){var t={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(t),this.onParseError(t)}},{key:"_getOverriddenMethods",value:function(e){return{_err:function(t){e._reportError(t)}}}}]),r}(r(1384));e.exports=o},1474:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(8724).default,i=r(670).default,o=r(1251),d=r(7188),c=r(7978),l=r(1384),u=function(e){s(r,e);var t=i(r);function r(e,a){var s;return n(this,r),(s=t.call(this,e,a)).opts=a,s.ctLoc=null,s.locBeforeToken=!1,s}return a(r,[{key:"_setErrorLocation",value:function(e){this.ctLoc&&(e.startLine=this.ctLoc.startLine,e.startCol=this.ctLoc.startCol,e.startOffset=this.ctLoc.startOffset,e.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,e.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,e.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset)}},{key:"_getOverriddenMethods",value:function(e,t){return{_bootstrap:function(r,n){t._bootstrap.call(this,r,n),l.install(this.tokenizer,d,e.opts),l.install(this.tokenizer,c)},_processInputToken:function(r){e.ctLoc=r.location,t._processInputToken.call(this,r)},_err:function(t,r){e.locBeforeToken=r&&r.beforeToken,e._reportError(t)}}}}]),r}(o);e.exports=u},8578:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(1121).default,i=r(4910).default,o=r(8724).default,d=r(670).default,c=r(1251),l=r(9571),u=r(1384),p=function(e){o(r,e);var t=d(r);function r(e,a){var s;return n(this,r),(s=t.call(this,e,a)).posTracker=u.install(e,l),s.lastErrOffset=-1,s}return a(r,[{key:"_reportError",value:function(e){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,s(i(r.prototype),"_reportError",this).call(this,e))}}]),r}(c);e.exports=p},7188:function(e,t,r){"use strict";var n=r(2081).default,a=r(8983).default,s=r(8724).default,i=r(670).default,o=r(1251),d=r(8578),c=r(1384),l=function(e){s(r,e);var t=i(r);function r(e,n){var s;a(this,r),s=t.call(this,e,n);var i=c.install(e.preprocessor,d,n);return s.posTracker=i.posTracker,s}return n(r)}(o);e.exports=l},2633:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(8724).default,i=r(670).default,o=function(e){s(r,e);var t=i(r);function r(e,a){var s;return n(this,r),(s=t.call(this,e)).onItemPop=a.onItemPop,s}return a(r,[{key:"_getOverriddenMethods",value:function(e,t){return{pop:function(){e.onItemPop(this.current),t.pop.call(this)},popAllUpToHtmlElement:function(){for(var r=this.stackTop;r>0;r--)e.onItemPop(this.items[r]);t.popAllUpToHtmlElement.call(this)},remove:function(r){e.onItemPop(this.current),t.remove.call(this,r)}}}}]),r}(r(1384));e.exports=o},2965:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(8724).default,i=r(670).default,o=r(1384),d=r(951),c=r(7978),l=r(2633),u=r(3352).TAG_NAMES,p=function(e){s(r,e);var t=i(r);function r(e){var a;return n(this,r),(a=t.call(this,e)).parser=e,a.treeAdapter=a.parser.treeAdapter,a.posTracker=null,a.lastStartTagToken=null,a.lastFosterParentingLocation=null,a.currentToken=null,a}return a(r,[{key:"_setStartLocation",value:function(e){var t=null;this.lastStartTagToken&&((t=Object.assign({},this.lastStartTagToken.location)).startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(e,t)}},{key:"_setEndLocation",value:function(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){var r=t.location,n=this.treeAdapter.getTagName(e),a={};t.type===d.END_TAG_TOKEN&&n===t.tagName?(a.endTag=Object.assign({},r),a.endLine=r.endLine,a.endCol=r.endCol,a.endOffset=r.endOffset):(a.endLine=r.startLine,a.endCol=r.startCol,a.endOffset=r.startOffset),this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}},{key:"_getOverriddenMethods",value:function(e,t){return{_bootstrap:function(r,n){t._bootstrap.call(this,r,n),e.lastStartTagToken=null,e.lastFosterParentingLocation=null,e.currentToken=null;var a=o.install(this.tokenizer,c);e.posTracker=a.posTracker,o.install(this.openElements,l,{onItemPop:function(t){e._setEndLocation(t,e.currentToken)}})},_runParsingLoop:function(r){t._runParsingLoop.call(this,r);for(var n=this.openElements.stackTop;n>=0;n--)e._setEndLocation(this.openElements.items[n],e.currentToken)},_processTokenInForeignContent:function(r){e.currentToken=r,t._processTokenInForeignContent.call(this,r)},_processToken:function(r){if(e.currentToken=r,t._processToken.call(this,r),r.type===d.END_TAG_TOKEN&&(r.tagName===u.HTML||r.tagName===u.BODY&&this.openElements.hasInScope(u.BODY)))for(var n=this.openElements.stackTop;n>=0;n--){var a=this.openElements.items[n];if(this.treeAdapter.getTagName(a)===r.tagName){e._setEndLocation(a,r);break}}},_setDocumentType:function(e){t._setDocumentType.call(this,e);for(var r=this.treeAdapter.getChildNodes(this.document),n=r.length,a=0;a=3)for(var n=this.treeAdapter.getAttrList(t).length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t),i=this.length-1;i>=0;i--){var o=this.entries[i];if(o.type===e.MARKER_ENTRY)break;var d=o.element,c=this.treeAdapter.getAttrList(d);this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===s&&c.length===n&&r.push({idx:i,attrs:c})}return r.length<3?[]:r}},{key:"_ensureNoahArkCondition",value:function(e){var t=this._getNoahArkConditionCandidates(e),r=t.length;if(r){for(var n=this.treeAdapter.getAttrList(e),a=n.length,s=Object.create(null),i=0;i=2;u--)this.entries.splice(t[u].idx,1),this.length--}}},{key:"insertMarker",value:function(){this.entries.push({type:e.MARKER_ENTRY}),this.length++}},{key:"pushElement",value:function(t,r){this._ensureNoahArkCondition(t),this.entries.push({type:e.ELEMENT_ENTRY,element:t,token:r}),this.length++}},{key:"insertElementAfterBookmark",value:function(t,r){for(var n=this.length-1;n>=0&&this.entries[n]!==this.bookmark;n--);this.entries.splice(n+1,0,{type:e.ELEMENT_ENTRY,element:t,token:r}),this.length++}},{key:"removeEntry",value:function(e){for(var t=this.length-1;t>=0;t--)if(this.entries[t]===e){this.entries.splice(t,1),this.length--;break}}},{key:"clearToLastMarker",value:function(){for(;this.length;){var t=this.entries.pop();if(this.length--,t.type===e.MARKER_ENTRY)break}}},{key:"getElementEntryInScopeWithTagName",value:function(t){for(var r=this.length-1;r>=0;r--){var n=this.entries[r];if(n.type===e.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(n.element)===t)return n}return null}},{key:"getElementEntry",value:function(t){for(var r=this.length-1;r>=0;r--){var n=this.entries[r];if(n.type===e.ELEMENT_ENTRY&&n.element===t)return n}return null}}]),e}();s.MARKER_ENTRY="MARKER_ENTRY",s.ELEMENT_ENTRY="ELEMENT_ENTRY",e.exports=s},1775:function(e,t,r){"use strict";var n,a,s,i,o,d,c,l,u,p,f,g,h,m,y,v,b,x,R,E,T,w,j,S,A,C,k=r(8983).default,_=r(2081).default,P=r(3231).default,I=r(951),D=r(6750),O=r(7294),N=r(2965),F=r(1474),L=r(1384),M=r(55),B=r(5204),U=r(962),H=r(9205),G=r(5693),W=r(3535),q=r(3352),K=q.TAG_NAMES,z=q.NAMESPACES,V=q.ATTRS,Y={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:M},X="hidden",J=8,$=3,Q="INITIAL_MODE",Z="BEFORE_HTML_MODE",ee="BEFORE_HEAD_MODE",te="IN_HEAD_MODE",re="IN_HEAD_NO_SCRIPT_MODE",ne="AFTER_HEAD_MODE",ae="IN_BODY_MODE",se="TEXT_MODE",ie="IN_TABLE_MODE",oe="IN_TABLE_TEXT_MODE",de="IN_CAPTION_MODE",ce="IN_COLUMN_GROUP_MODE",le="IN_TABLE_BODY_MODE",ue="IN_ROW_MODE",pe="IN_CELL_MODE",fe="IN_SELECT_MODE",ge="IN_SELECT_IN_TABLE_MODE",he="IN_TEMPLATE_MODE",me="AFTER_BODY_MODE",ye="IN_FRAMESET_MODE",ve="AFTER_FRAMESET_MODE",be="AFTER_AFTER_BODY_MODE",xe="AFTER_AFTER_FRAMESET_MODE",Re=(P(n={},K.TR,ue),P(n,K.TBODY,le),P(n,K.THEAD,le),P(n,K.TFOOT,le),P(n,K.CAPTION,de),P(n,K.COLGROUP,ce),P(n,K.TABLE,ie),P(n,K.BODY,ae),P(n,K.FRAMESET,ye),n),Ee=(P(a={},K.CAPTION,ie),P(a,K.COLGROUP,ie),P(a,K.TBODY,ie),P(a,K.TFOOT,ie),P(a,K.THEAD,ie),P(a,K.COL,ce),P(a,K.TR,le),P(a,K.TD,ue),P(a,K.TH,ue),a),Te=(P(C={},Q,(P(s={},I.CHARACTER_TOKEN,Me),P(s,I.NULL_CHARACTER_TOKEN,Me),P(s,I.WHITESPACE_CHARACTER_TOKEN,Ie),P(s,I.COMMENT_TOKEN,Oe),P(s,I.DOCTYPE_TOKEN,(function(e,t){e._setDocumentType(t);var r=t.forceQuirks?q.DOCUMENT_MODE.QUIRKS:U.getDocumentMode(t);U.isConforming(t)||e._err(G.nonConformingDoctype);e.treeAdapter.setDocumentMode(e.document,r),e.insertionMode=Z})),P(s,I.START_TAG_TOKEN,Me),P(s,I.END_TAG_TOKEN,Me),P(s,I.EOF_TOKEN,Me),s)),P(C,Z,(P(i={},I.CHARACTER_TOKEN,Be),P(i,I.NULL_CHARACTER_TOKEN,Be),P(i,I.WHITESPACE_CHARACTER_TOKEN,Ie),P(i,I.COMMENT_TOKEN,Oe),P(i,I.DOCTYPE_TOKEN,Ie),P(i,I.START_TAG_TOKEN,(function(e,t){t.tagName===K.HTML?(e._insertElement(t,z.HTML),e.insertionMode=ee):Be(e,t)})),P(i,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r!==K.HTML&&r!==K.HEAD&&r!==K.BODY&&r!==K.BR||Be(e,t)})),P(i,I.EOF_TOKEN,Be),i)),P(C,ee,(P(o={},I.CHARACTER_TOKEN,Ue),P(o,I.NULL_CHARACTER_TOKEN,Ue),P(o,I.WHITESPACE_CHARACTER_TOKEN,Ie),P(o,I.COMMENT_TOKEN,Oe),P(o,I.DOCTYPE_TOKEN,De),P(o,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HTML?at(e,t):r===K.HEAD?(e._insertElement(t,z.HTML),e.headElement=e.openElements.current,e.insertionMode=te):Ue(e,t)})),P(o,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HEAD||r===K.BODY||r===K.HTML||r===K.BR?Ue(e,t):e._err(G.endTagWithoutMatchingOpenElement)})),P(o,I.EOF_TOKEN,Ue),o)),P(C,te,(P(d={},I.CHARACTER_TOKEN,We),P(d,I.NULL_CHARACTER_TOKEN,We),P(d,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(d,I.COMMENT_TOKEN,Oe),P(d,I.DOCTYPE_TOKEN,De),P(d,I.START_TAG_TOKEN,He),P(d,I.END_TAG_TOKEN,Ge),P(d,I.EOF_TOKEN,We),d)),P(C,re,(P(c={},I.CHARACTER_TOKEN,qe),P(c,I.NULL_CHARACTER_TOKEN,qe),P(c,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(c,I.COMMENT_TOKEN,Oe),P(c,I.DOCTYPE_TOKEN,De),P(c,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HTML?at(e,t):r===K.BASEFONT||r===K.BGSOUND||r===K.HEAD||r===K.LINK||r===K.META||r===K.NOFRAMES||r===K.STYLE?He(e,t):r===K.NOSCRIPT?e._err(G.nestedNoscriptInHead):qe(e,t)})),P(c,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.NOSCRIPT?(e.openElements.pop(),e.insertionMode=te):r===K.BR?qe(e,t):e._err(G.endTagWithoutMatchingOpenElement)})),P(c,I.EOF_TOKEN,qe),c)),P(C,ne,(P(l={},I.CHARACTER_TOKEN,Ke),P(l,I.NULL_CHARACTER_TOKEN,Ke),P(l,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(l,I.COMMENT_TOKEN,Oe),P(l,I.DOCTYPE_TOKEN,De),P(l,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HTML?at(e,t):r===K.BODY?(e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=ae):r===K.FRAMESET?(e._insertElement(t,z.HTML),e.insertionMode=ye):r===K.BASE||r===K.BASEFONT||r===K.BGSOUND||r===K.LINK||r===K.META||r===K.NOFRAMES||r===K.SCRIPT||r===K.STYLE||r===K.TEMPLATE||r===K.TITLE?(e._err(G.abandonedHeadElementChild),e.openElements.push(e.headElement),He(e,t),e.openElements.remove(e.headElement)):r===K.HEAD?e._err(G.misplacedStartTagForHeadElement):Ke(e,t)})),P(l,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.BODY||r===K.HTML||r===K.BR?Ke(e,t):r===K.TEMPLATE?Ge(e,t):e._err(G.endTagWithoutMatchingOpenElement)})),P(l,I.EOF_TOKEN,Ke),l)),P(C,ae,(P(u={},I.CHARACTER_TOKEN,Ve),P(u,I.NULL_CHARACTER_TOKEN,Ie),P(u,I.WHITESPACE_CHARACTER_TOKEN,ze),P(u,I.COMMENT_TOKEN,Oe),P(u,I.DOCTYPE_TOKEN,Ie),P(u,I.START_TAG_TOKEN,at),P(u,I.END_TAG_TOKEN,dt),P(u,I.EOF_TOKEN,ct),u)),P(C,se,(P(p={},I.CHARACTER_TOKEN,Fe),P(p,I.NULL_CHARACTER_TOKEN,Fe),P(p,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(p,I.COMMENT_TOKEN,Ie),P(p,I.DOCTYPE_TOKEN,Ie),P(p,I.START_TAG_TOKEN,Ie),P(p,I.END_TAG_TOKEN,(function(e,t){t.tagName===K.SCRIPT&&(e.pendingScript=e.openElements.current);e.openElements.pop(),e.insertionMode=e.originalInsertionMode})),P(p,I.EOF_TOKEN,(function(e,t){e._err(G.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e._processToken(t)})),p)),P(C,ie,(P(f={},I.CHARACTER_TOKEN,lt),P(f,I.NULL_CHARACTER_TOKEN,lt),P(f,I.WHITESPACE_CHARACTER_TOKEN,lt),P(f,I.COMMENT_TOKEN,Oe),P(f,I.DOCTYPE_TOKEN,Ie),P(f,I.START_TAG_TOKEN,ut),P(f,I.END_TAG_TOKEN,pt),P(f,I.EOF_TOKEN,ct),f)),P(C,oe,(P(g={},I.CHARACTER_TOKEN,(function(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0})),P(g,I.NULL_CHARACTER_TOKEN,Ie),P(g,I.WHITESPACE_CHARACTER_TOKEN,(function(e,t){e.pendingCharacterTokens.push(t)})),P(g,I.COMMENT_TOKEN,gt),P(g,I.DOCTYPE_TOKEN,gt),P(g,I.START_TAG_TOKEN,gt),P(g,I.END_TAG_TOKEN,gt),P(g,I.EOF_TOKEN,gt),g)),P(C,de,(P(h={},I.CHARACTER_TOKEN,Ve),P(h,I.NULL_CHARACTER_TOKEN,Ie),P(h,I.WHITESPACE_CHARACTER_TOKEN,ze),P(h,I.COMMENT_TOKEN,Oe),P(h,I.DOCTYPE_TOKEN,Ie),P(h,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.CAPTION||r===K.COL||r===K.COLGROUP||r===K.TBODY||r===K.TD||r===K.TFOOT||r===K.TH||r===K.THEAD||r===K.TR?e.openElements.hasInTableScope(K.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ie,e._processToken(t)):at(e,t)})),P(h,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.CAPTION||r===K.TABLE?e.openElements.hasInTableScope(K.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ie,r===K.TABLE&&e._processToken(t)):r!==K.BODY&&r!==K.COL&&r!==K.COLGROUP&&r!==K.HTML&&r!==K.TBODY&&r!==K.TD&&r!==K.TFOOT&&r!==K.TH&&r!==K.THEAD&&r!==K.TR&&dt(e,t)})),P(h,I.EOF_TOKEN,ct),h)),P(C,ce,(P(m={},I.CHARACTER_TOKEN,ht),P(m,I.NULL_CHARACTER_TOKEN,ht),P(m,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(m,I.COMMENT_TOKEN,Oe),P(m,I.DOCTYPE_TOKEN,Ie),P(m,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HTML?at(e,t):r===K.COL?(e._appendElement(t,z.HTML),t.ackSelfClosing=!0):r===K.TEMPLATE?He(e,t):ht(e,t)})),P(m,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.COLGROUP?e.openElements.currentTagName===K.COLGROUP&&(e.openElements.pop(),e.insertionMode=ie):r===K.TEMPLATE?Ge(e,t):r!==K.COL&&ht(e,t)})),P(m,I.EOF_TOKEN,ct),m)),P(C,le,(P(y={},I.CHARACTER_TOKEN,lt),P(y,I.NULL_CHARACTER_TOKEN,lt),P(y,I.WHITESPACE_CHARACTER_TOKEN,lt),P(y,I.COMMENT_TOKEN,Oe),P(y,I.DOCTYPE_TOKEN,Ie),P(y,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.TR?(e.openElements.clearBackToTableBodyContext(),e._insertElement(t,z.HTML),e.insertionMode=ue):r===K.TH||r===K.TD?(e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(K.TR),e.insertionMode=ue,e._processToken(t)):r===K.CAPTION||r===K.COL||r===K.COLGROUP||r===K.TBODY||r===K.TFOOT||r===K.THEAD?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ie,e._processToken(t)):ut(e,t)})),P(y,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.TBODY||r===K.TFOOT||r===K.THEAD?e.openElements.hasInTableScope(r)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ie):r===K.TABLE?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ie,e._processToken(t)):(r!==K.BODY&&r!==K.CAPTION&&r!==K.COL&&r!==K.COLGROUP||r!==K.HTML&&r!==K.TD&&r!==K.TH&&r!==K.TR)&&pt(e,t)})),P(y,I.EOF_TOKEN,ct),y)),P(C,ue,(P(v={},I.CHARACTER_TOKEN,lt),P(v,I.NULL_CHARACTER_TOKEN,lt),P(v,I.WHITESPACE_CHARACTER_TOKEN,lt),P(v,I.COMMENT_TOKEN,Oe),P(v,I.DOCTYPE_TOKEN,Ie),P(v,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.TH||r===K.TD?(e.openElements.clearBackToTableRowContext(),e._insertElement(t,z.HTML),e.insertionMode=pe,e.activeFormattingElements.insertMarker()):r===K.CAPTION||r===K.COL||r===K.COLGROUP||r===K.TBODY||r===K.TFOOT||r===K.THEAD||r===K.TR?e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=le,e._processToken(t)):ut(e,t)})),P(v,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.TR?e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=le):r===K.TABLE?e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=le,e._processToken(t)):r===K.TBODY||r===K.TFOOT||r===K.THEAD?(e.openElements.hasInTableScope(r)||e.openElements.hasInTableScope(K.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=le,e._processToken(t)):(r!==K.BODY&&r!==K.CAPTION&&r!==K.COL&&r!==K.COLGROUP||r!==K.HTML&&r!==K.TD&&r!==K.TH)&&pt(e,t)})),P(v,I.EOF_TOKEN,ct),v)),P(C,pe,(P(b={},I.CHARACTER_TOKEN,Ve),P(b,I.NULL_CHARACTER_TOKEN,Ie),P(b,I.WHITESPACE_CHARACTER_TOKEN,ze),P(b,I.COMMENT_TOKEN,Oe),P(b,I.DOCTYPE_TOKEN,Ie),P(b,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.CAPTION||r===K.COL||r===K.COLGROUP||r===K.TBODY||r===K.TD||r===K.TFOOT||r===K.TH||r===K.THEAD||r===K.TR?(e.openElements.hasInTableScope(K.TD)||e.openElements.hasInTableScope(K.TH))&&(e._closeTableCell(),e._processToken(t)):at(e,t)})),P(b,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.TD||r===K.TH?e.openElements.hasInTableScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ue):r===K.TABLE||r===K.TBODY||r===K.TFOOT||r===K.THEAD||r===K.TR?e.openElements.hasInTableScope(r)&&(e._closeTableCell(),e._processToken(t)):r!==K.BODY&&r!==K.CAPTION&&r!==K.COL&&r!==K.COLGROUP&&r!==K.HTML&&dt(e,t)})),P(b,I.EOF_TOKEN,ct),b)),P(C,fe,(P(x={},I.CHARACTER_TOKEN,Fe),P(x,I.NULL_CHARACTER_TOKEN,Ie),P(x,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(x,I.COMMENT_TOKEN,Oe),P(x,I.DOCTYPE_TOKEN,Ie),P(x,I.START_TAG_TOKEN,mt),P(x,I.END_TAG_TOKEN,yt),P(x,I.EOF_TOKEN,ct),x)),P(C,ge,(P(R={},I.CHARACTER_TOKEN,Fe),P(R,I.NULL_CHARACTER_TOKEN,Ie),P(R,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(R,I.COMMENT_TOKEN,Oe),P(R,I.DOCTYPE_TOKEN,Ie),P(R,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.CAPTION||r===K.TABLE||r===K.TBODY||r===K.TFOOT||r===K.THEAD||r===K.TR||r===K.TD||r===K.TH?(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),e._processToken(t)):mt(e,t)})),P(R,I.END_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.CAPTION||r===K.TABLE||r===K.TBODY||r===K.TFOOT||r===K.THEAD||r===K.TR||r===K.TD||r===K.TH?e.openElements.hasInTableScope(r)&&(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),e._processToken(t)):yt(e,t)})),P(R,I.EOF_TOKEN,ct),R)),P(C,he,(P(E={},I.CHARACTER_TOKEN,Ve),P(E,I.NULL_CHARACTER_TOKEN,Ie),P(E,I.WHITESPACE_CHARACTER_TOKEN,ze),P(E,I.COMMENT_TOKEN,Oe),P(E,I.DOCTYPE_TOKEN,Ie),P(E,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;if(r===K.BASE||r===K.BASEFONT||r===K.BGSOUND||r===K.LINK||r===K.META||r===K.NOFRAMES||r===K.SCRIPT||r===K.STYLE||r===K.TEMPLATE||r===K.TITLE)He(e,t);else{var n=Ee[r]||ae;e._popTmplInsertionMode(),e._pushTmplInsertionMode(n),e.insertionMode=n,e._processToken(t)}})),P(E,I.END_TAG_TOKEN,(function(e,t){t.tagName===K.TEMPLATE&&Ge(e,t)})),P(E,I.EOF_TOKEN,vt),E)),P(C,me,(P(T={},I.CHARACTER_TOKEN,bt),P(T,I.NULL_CHARACTER_TOKEN,bt),P(T,I.WHITESPACE_CHARACTER_TOKEN,ze),P(T,I.COMMENT_TOKEN,(function(e,t){e._appendCommentNode(t,e.openElements.items[0])})),P(T,I.DOCTYPE_TOKEN,Ie),P(T,I.START_TAG_TOKEN,(function(e,t){t.tagName===K.HTML?at(e,t):bt(e,t)})),P(T,I.END_TAG_TOKEN,(function(e,t){t.tagName===K.HTML?e.fragmentContext||(e.insertionMode=be):bt(e,t)})),P(T,I.EOF_TOKEN,Le),T)),P(C,ye,(P(w={},I.CHARACTER_TOKEN,Ie),P(w,I.NULL_CHARACTER_TOKEN,Ie),P(w,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(w,I.COMMENT_TOKEN,Oe),P(w,I.DOCTYPE_TOKEN,Ie),P(w,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HTML?at(e,t):r===K.FRAMESET?e._insertElement(t,z.HTML):r===K.FRAME?(e._appendElement(t,z.HTML),t.ackSelfClosing=!0):r===K.NOFRAMES&&He(e,t)})),P(w,I.END_TAG_TOKEN,(function(e,t){t.tagName!==K.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagName===K.FRAMESET||(e.insertionMode=ve))})),P(w,I.EOF_TOKEN,Le),w)),P(C,ve,(P(j={},I.CHARACTER_TOKEN,Ie),P(j,I.NULL_CHARACTER_TOKEN,Ie),P(j,I.WHITESPACE_CHARACTER_TOKEN,Fe),P(j,I.COMMENT_TOKEN,Oe),P(j,I.DOCTYPE_TOKEN,Ie),P(j,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HTML?at(e,t):r===K.NOFRAMES&&He(e,t)})),P(j,I.END_TAG_TOKEN,(function(e,t){t.tagName===K.HTML&&(e.insertionMode=xe)})),P(j,I.EOF_TOKEN,Le),j)),P(C,be,(P(S={},I.CHARACTER_TOKEN,xt),P(S,I.NULL_CHARACTER_TOKEN,xt),P(S,I.WHITESPACE_CHARACTER_TOKEN,ze),P(S,I.COMMENT_TOKEN,Ne),P(S,I.DOCTYPE_TOKEN,Ie),P(S,I.START_TAG_TOKEN,(function(e,t){t.tagName===K.HTML?at(e,t):xt(e,t)})),P(S,I.END_TAG_TOKEN,xt),P(S,I.EOF_TOKEN,Le),S)),P(C,xe,(P(A={},I.CHARACTER_TOKEN,Ie),P(A,I.NULL_CHARACTER_TOKEN,Ie),P(A,I.WHITESPACE_CHARACTER_TOKEN,ze),P(A,I.COMMENT_TOKEN,Ne),P(A,I.DOCTYPE_TOKEN,Ie),P(A,I.START_TAG_TOKEN,(function(e,t){var r=t.tagName;r===K.HTML?at(e,t):r===K.NOFRAMES&&He(e,t)})),P(A,I.END_TAG_TOKEN,Ie),P(A,I.EOF_TOKEN,Le),A)),C),we=function(){function e(t){k(this,e),this.options=B(Y,t),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&&L.install(this,N),this.options.onParseError&&L.install(this,F,{onParseError:this.options.onParseError})}return _(e,[{key:"parse",value:function(e){var t=this.treeAdapter.createDocument();return this._bootstrap(t,null),this.tokenizer.write(e,!0),this._runParsingLoop(null),t}},{key:"parseFragment",value:function(e,t){t||(t=this.treeAdapter.createElement(K.TEMPLATE,z.HTML,[]));var r=this.treeAdapter.createElement("documentmock",z.HTML,[]);this._bootstrap(r,t),this.treeAdapter.getTagName(t)===K.TEMPLATE&&this._pushTmplInsertionMode(he),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(e,!0),this._runParsingLoop(null);var n=this.treeAdapter.getFirstChild(r),a=this.treeAdapter.createDocumentFragment();return this._adoptNodes(n,a),a}},{key:"_bootstrap",value:function(e,t){this.tokenizer=new I(this.options),this.stopped=!1,this.insertionMode=Q,this.originalInsertionMode="",this.document=e,this.fragmentContext=t,this.headElement=null,this.formElement=null,this.openElements=new D(this.document,this.treeAdapter),this.activeFormattingElements=new O(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1}},{key:"_err",value:function(){}},{key:"_runParsingLoop",value:function(e){for(;!this.stopped;){this._setupTokenizerCDATAMode();var t=this.tokenizer.getNextToken();if(t.type===I.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.type===I.WHITESPACE_CHARACTER_TOKEN&&"\n"===t.chars[0])){if(1===t.chars.length)continue;t.chars=t.chars.substr(1)}if(this._processInputToken(t),e&&this.pendingScript)break}}},{key:"runParsingLoopForCurrentChunk",value:function(e,t){if(this._runParsingLoop(t),t&&this.pendingScript){var r=this.pendingScript;return this.pendingScript=null,void t(r)}e&&e()}},{key:"_setupTokenizerCDATAMode",value:function(){var e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==z.HTML&&!this._isIntegrationPoint(e)}},{key:"_switchToTextParsing",value:function(e,t){this._insertElement(e,z.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=se}},{key:"switchToPlaintextParsing",value:function(){this.insertionMode=se,this.originalInsertionMode=ae,this.tokenizer.state=I.MODE.PLAINTEXT}},{key:"_getAdjustedCurrentElement",value:function(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}},{key:"_findFormInFragmentContext",value:function(){var e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===K.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}while(e)}},{key:"_initTokenizerForFragmentParsing",value:function(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===z.HTML){var e=this.treeAdapter.getTagName(this.fragmentContext);e===K.TITLE||e===K.TEXTAREA?this.tokenizer.state=I.MODE.RCDATA:e===K.STYLE||e===K.XMP||e===K.IFRAME||e===K.NOEMBED||e===K.NOFRAMES||e===K.NOSCRIPT?this.tokenizer.state=I.MODE.RAWTEXT:e===K.SCRIPT?this.tokenizer.state=I.MODE.SCRIPT_DATA:e===K.PLAINTEXT&&(this.tokenizer.state=I.MODE.PLAINTEXT)}}},{key:"_setDocumentType",value:function(e){var t=e.name||"",r=e.publicId||"",n=e.systemId||"";this.treeAdapter.setDocumentType(this.document,t,r,n)}},{key:"_attachElementToTree",value:function(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{var t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(t,e)}}},{key:"_appendElement",value:function(e,t){var r=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(r)}},{key:"_insertElement",value:function(e,t){var r=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(r),this.openElements.push(r)}},{key:"_insertFakeElement",value:function(e){var t=this.treeAdapter.createElement(e,z.HTML,[]);this._attachElementToTree(t),this.openElements.push(t)}},{key:"_insertTemplate",value:function(e){var t=this.treeAdapter.createElement(e.tagName,z.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,r),this._attachElementToTree(t),this.openElements.push(t)}},{key:"_insertFakeRootElement",value:function(){var e=this.treeAdapter.createElement(K.HTML,z.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e)}},{key:"_appendCommentNode",value:function(e,t){var r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,r)}},{key:"_insertCharacters",value:function(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else{var t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(t,e.chars)}}},{key:"_adoptNodes",value:function(e,t){for(var r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(t,r)}},{key:"_shouldProcessTokenInForeignContent",value:function(e){var t=this._getAdjustedCurrentElement();if(!t||t===this.document)return!1;var r=this.treeAdapter.getNamespaceURI(t);if(r===z.HTML)return!1;if(this.treeAdapter.getTagName(t)===K.ANNOTATION_XML&&r===z.MATHML&&e.type===I.START_TAG_TOKEN&&e.tagName===K.SVG)return!1;var n=e.type===I.CHARACTER_TOKEN||e.type===I.NULL_CHARACTER_TOKEN||e.type===I.WHITESPACE_CHARACTER_TOKEN;return(!(e.type===I.START_TAG_TOKEN&&e.tagName!==K.MGLYPH&&e.tagName!==K.MALIGNMARK)&&!n||!this._isIntegrationPoint(t,z.MATHML))&&((e.type!==I.START_TAG_TOKEN&&!n||!this._isIntegrationPoint(t,z.HTML))&&e.type!==I.EOF_TOKEN)}},{key:"_processToken",value:function(e){Te[this.insertionMode][e.type](this,e)}},{key:"_processTokenInBodyMode",value:function(e){Te[ae][e.type](this,e)}},{key:"_processTokenInForeignContent",value:function(e){e.type===I.CHARACTER_TOKEN?function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e):e.type===I.NULL_CHARACTER_TOKEN?function(e,t){t.chars=W.REPLACEMENT_CHARACTER,e._insertCharacters(t)}(this,e):e.type===I.WHITESPACE_CHARACTER_TOKEN?Fe(this,e):e.type===I.COMMENT_TOKEN?Oe(this,e):e.type===I.START_TAG_TOKEN?function(e,t){if(H.causesExit(t)&&!e.fragmentContext){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==z.HTML&&!e._isIntegrationPoint(e.openElements.current);)e.openElements.pop();e._processToken(t)}else{var r=e._getAdjustedCurrentElement(),n=e.treeAdapter.getNamespaceURI(r);n===z.MATHML?H.adjustTokenMathMLAttrs(t):n===z.SVG&&(H.adjustTokenSVGTagName(t),H.adjustTokenSVGAttrs(t)),H.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,n):e._insertElement(t,n),t.ackSelfClosing=!0}}(this,e):e.type===I.END_TAG_TOKEN&&function(e,t){for(var r=e.openElements.stackTop;r>0;r--){var n=e.openElements.items[r];if(e.treeAdapter.getNamespaceURI(n)===z.HTML){e._processToken(t);break}if(e.treeAdapter.getTagName(n).toLowerCase()===t.tagName){e.openElements.popUntilElementPopped(n);break}}}(this,e)}},{key:"_processInputToken",value:function(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===I.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err(G.nonVoidHtmlElementStartTagWithTrailingSolidus)}},{key:"_isIntegrationPoint",value:function(e,t){var r=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e),a=this.treeAdapter.getAttrList(e);return H.isIntegrationPoint(r,n,a,t)}},{key:"_reconstructActiveFormattingElements",value:function(){var e=this.activeFormattingElements.length;if(e){var t=e,r=null;do{if(t--,(r=this.activeFormattingElements.entries[t]).type===O.MARKER_ENTRY||this.openElements.contains(r.element)){t++;break}}while(t>0);for(var n=t;n=0;e--){var r=this.openElements.items[e];0===e&&(t=!0,this.fragmentContext&&(r=this.fragmentContext));var n=this.treeAdapter.getTagName(r),a=Re[n];if(a){this.insertionMode=a;break}if(!(t||n!==K.TD&&n!==K.TH)){this.insertionMode=pe;break}if(!t&&n===K.HEAD){this.insertionMode=te;break}if(n===K.SELECT){this._resetInsertionModeForSelect(e);break}if(n===K.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}if(n===K.HTML){this.insertionMode=this.headElement?ne:ee;break}if(t){this.insertionMode=ae;break}}}},{key:"_resetInsertionModeForSelect",value:function(e){if(e>0)for(var t=e-1;t>0;t--){var r=this.openElements.items[t],n=this.treeAdapter.getTagName(r);if(n===K.TEMPLATE)break;if(n===K.TABLE)return void(this.insertionMode=ge)}this.insertionMode=fe}},{key:"_pushTmplInsertionMode",value:function(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e}},{key:"_popTmplInsertionMode",value:function(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]}},{key:"_isElementCausesFosterParenting",value:function(e){var t=this.treeAdapter.getTagName(e);return t===K.TABLE||t===K.TBODY||t===K.TFOOT||t===K.THEAD||t===K.TR}},{key:"_shouldFosterParentOnInsertion",value:function(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}},{key:"_findFosterParentingLocation",value:function(){for(var e={parent:null,beforeElement:null},t=this.openElements.stackTop;t>=0;t--){var r=this.openElements.items[t],n=this.treeAdapter.getTagName(r),a=this.treeAdapter.getNamespaceURI(r);if(n===K.TEMPLATE&&a===z.HTML){e.parent=this.treeAdapter.getTemplateContent(r);break}if(n===K.TABLE){e.parent=this.treeAdapter.getParentNode(r),e.parent?e.beforeElement=r:e.parent=this.openElements.items[t-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}},{key:"_fosterParentElement",value:function(e){var t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}},{key:"_fosterParentText",value:function(e){var t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertTextBefore(t.parent,e,t.beforeElement):this.treeAdapter.insertText(t.parent,e)}},{key:"_isSpecialElement",value:function(e){var t=this.treeAdapter.getTagName(e),r=this.treeAdapter.getNamespaceURI(e);return q.SPECIAL_ELEMENTS[r][t]}}]),e}();function je(e,t){var r=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return r?e.openElements.contains(r.element)?e.openElements.hasInScope(t.tagName)||(r=null):(e.activeFormattingElements.removeEntry(r),r=null):ot(e,t),r}function Se(e,t){for(var r=null,n=e.openElements.stackTop;n>=0;n--){var a=e.openElements.items[n];if(a===t.element)break;e._isSpecialElement(a)&&(r=a)}return r||(e.openElements.popUntilElementPopped(t.element),e.activeFormattingElements.removeEntry(t)),r}function Ae(e,t,r){for(var n=t,a=e.openElements.getCommonAncestor(t),s=0,i=a;i!==r;s++,i=a){a=e.openElements.getCommonAncestor(i);var o=e.activeFormattingElements.getElementEntry(i),d=o&&s>=$;!o||d?(d&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(i)):(i=Ce(e,o),n===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(n),e.treeAdapter.appendChild(i,n),n=i)}return n}function Ce(e,t){var r=e.treeAdapter.getNamespaceURI(t.element),n=e.treeAdapter.createElement(t.token.tagName,r,t.token.attrs);return e.openElements.replace(t.element,n),t.element=n,n}function ke(e,t,r){if(e._isElementCausesFosterParenting(t))e._fosterParentElement(r);else{var n=e.treeAdapter.getTagName(t),a=e.treeAdapter.getNamespaceURI(t);n===K.TEMPLATE&&a===z.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,r)}}function _e(e,t,r){var n=e.treeAdapter.getNamespaceURI(r.element),a=r.token,s=e.treeAdapter.createElement(a.tagName,n,a.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r.token),e.activeFormattingElements.removeEntry(r),e.openElements.remove(r.element),e.openElements.insertAfter(t,s)}function Pe(e,t){for(var r,n=0;n0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagName!==K.TEMPLATE&&e._err(G.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(K.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode()):e._err(G.endTagWithoutMatchingOpenElement)}function We(e,t){e.openElements.pop(),e.insertionMode=ne,e._processToken(t)}function qe(e,t){var r=t.type===I.EOF_TOKEN?G.openElementsLeftAfterEof:G.disallowedContentInNoscriptInHead;e._err(r),e.openElements.pop(),e.insertionMode=te,e._processToken(t)}function Ke(e,t){e._insertFakeElement(K.BODY),e.insertionMode=ae,e._processToken(t)}function ze(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Ve(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Ye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,z.HTML)}function Xe(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Je(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $e(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Qe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ze(e,t){e._appendElement(t,z.HTML),t.ackSelfClosing=!0}function et(e,t){e._switchToTextParsing(t,I.MODE.RAWTEXT)}function tt(e,t){e.openElements.currentTagName===K.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function rt(e,t){e.openElements.hasInScope(K.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,z.HTML)}function nt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function at(e,t){var r=t.tagName;switch(r.length){case 1:r===K.I||r===K.S||r===K.B||r===K.U?Je(e,t):r===K.P?Ye(e,t):r===K.A?function(e,t){var r=e.activeFormattingElements.getElementEntryInScopeWithTagName(K.A);r&&(Pe(e,t),e.openElements.remove(r.element),e.activeFormattingElements.removeEntry(r)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t):nt(e,t);break;case 2:r===K.DL||r===K.OL||r===K.UL?Ye(e,t):r===K.H1||r===K.H2||r===K.H3||r===K.H4||r===K.H5||r===K.H6?function(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement();var r=e.openElements.currentTagName;r!==K.H1&&r!==K.H2&&r!==K.H3&&r!==K.H4&&r!==K.H5&&r!==K.H6||e.openElements.pop(),e._insertElement(t,z.HTML)}(e,t):r===K.LI||r===K.DD||r===K.DT?function(e,t){e.framesetOk=!1;for(var r=t.tagName,n=e.openElements.stackTop;n>=0;n--){var a=e.openElements.items[n],s=e.treeAdapter.getTagName(a),i=null;if(r===K.LI&&s===K.LI?i=K.LI:r!==K.DD&&r!==K.DT||s!==K.DD&&s!==K.DT||(i=s),i){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(s!==K.ADDRESS&&s!==K.DIV&&s!==K.P&&e._isSpecialElement(a))break}e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,z.HTML)}(e,t):r===K.EM||r===K.TT?Je(e,t):r===K.BR?Qe(e,t):r===K.HR?function(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t):r===K.RB?rt(e,t):r===K.RT||r===K.RP?function(e,t){e.openElements.hasInScope(K.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(K.RTC),e._insertElement(t,z.HTML)}(e,t):r!==K.TH&&r!==K.TD&&r!==K.TR&&nt(e,t);break;case 3:r===K.DIV||r===K.DIR||r===K.NAV?Ye(e,t):r===K.PRE?Xe(e,t):r===K.BIG?Je(e,t):r===K.IMG||r===K.WBR?Qe(e,t):r===K.XMP?function(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,I.MODE.RAWTEXT)}(e,t):r===K.SVG?function(e,t){e._reconstructActiveFormattingElements(),H.adjustTokenSVGAttrs(t),H.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,z.SVG):e._insertElement(t,z.SVG),t.ackSelfClosing=!0}(e,t):r===K.RTC?rt(e,t):r!==K.COL&&nt(e,t);break;case 4:r===K.HTML?function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t):r===K.BASE||r===K.LINK||r===K.META?He(e,t):r===K.BODY?function(e,t){var r=e.openElements.tryPeekProperlyNestedBodyElement();r&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(r,t.attrs))}(e,t):r===K.MAIN||r===K.MENU?Ye(e,t):r===K.FORM?function(e,t){var r=e.openElements.tmplCount>0;e.formElement&&!r||(e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,z.HTML),r||(e.formElement=e.openElements.current))}(e,t):r===K.CODE||r===K.FONT?Je(e,t):r===K.NOBR?function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(K.NOBR)&&(Pe(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t):r===K.AREA?Qe(e,t):r===K.MATH?function(e,t){e._reconstructActiveFormattingElements(),H.adjustTokenMathMLAttrs(t),H.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,z.MATHML):e._insertElement(t,z.MATHML),t.ackSelfClosing=!0}(e,t):r===K.MENU?function(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,z.HTML)}(e,t):r!==K.HEAD&&nt(e,t);break;case 5:r===K.STYLE||r===K.TITLE?He(e,t):r===K.ASIDE?Ye(e,t):r===K.SMALL?Je(e,t):r===K.TABLE?function(e,t){e.treeAdapter.getDocumentMode(e.document)!==q.DOCUMENT_MODE.QUIRKS&&e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=ie}(e,t):r===K.EMBED?Qe(e,t):r===K.INPUT?function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML);var r=I.getTokenAttr(t,V.TYPE);r&&r.toLowerCase()===X||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t):r===K.PARAM||r===K.TRACK?Ze(e,t):r===K.IMAGE?function(e,t){t.tagName=K.IMG,Qe(e,t)}(e,t):r!==K.FRAME&&r!==K.TBODY&&r!==K.TFOOT&&r!==K.THEAD&&nt(e,t);break;case 6:r===K.SCRIPT?He(e,t):r===K.CENTER||r===K.FIGURE||r===K.FOOTER||r===K.HEADER||r===K.HGROUP||r===K.DIALOG?Ye(e,t):r===K.BUTTON?function(e,t){e.openElements.hasInScope(K.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1}(e,t):r===K.STRIKE||r===K.STRONG?Je(e,t):r===K.APPLET||r===K.OBJECT?$e(e,t):r===K.KEYGEN?Qe(e,t):r===K.SOURCE?Ze(e,t):r===K.IFRAME?function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,I.MODE.RAWTEXT)}(e,t):r===K.SELECT?function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode===ie||e.insertionMode===de||e.insertionMode===le||e.insertionMode===ue||e.insertionMode===pe?e.insertionMode=ge:e.insertionMode=fe}(e,t):r===K.OPTION?tt(e,t):nt(e,t);break;case 7:r===K.BGSOUND?He(e,t):r===K.DETAILS||r===K.ADDRESS||r===K.ARTICLE||r===K.SECTION||r===K.SUMMARY?Ye(e,t):r===K.LISTING?Xe(e,t):r===K.MARQUEE?$e(e,t):r===K.NOEMBED?et(e,t):r!==K.CAPTION&&nt(e,t);break;case 8:r===K.BASEFONT?He(e,t):r===K.FRAMESET?function(e,t){var r=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&r&&(e.treeAdapter.detachNode(r),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,z.HTML),e.insertionMode=ye)}(e,t):r===K.FIELDSET?Ye(e,t):r===K.TEXTAREA?function(e,t){e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.tokenizer.state=I.MODE.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=se}(e,t):r===K.TEMPLATE?He(e,t):r===K.NOSCRIPT?e.options.scriptingEnabled?et(e,t):nt(e,t):r===K.OPTGROUP?tt(e,t):r!==K.COLGROUP&&nt(e,t);break;case 9:r===K.PLAINTEXT?function(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.tokenizer.state=I.MODE.PLAINTEXT}(e,t):nt(e,t);break;case 10:r===K.BLOCKQUOTE||r===K.FIGCAPTION?Ye(e,t):nt(e,t);break;default:nt(e,t)}}function st(e,t){var r=t.tagName;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r))}function it(e,t){var r=t.tagName;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(r),e.activeFormattingElements.clearToLastMarker())}function ot(e,t){for(var r=t.tagName,n=e.openElements.stackTop;n>0;n--){var a=e.openElements.items[n];if(e.treeAdapter.getTagName(a)===r){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilElementPopped(a);break}if(e._isSpecialElement(a))break}}function dt(e,t){var r=t.tagName;switch(r.length){case 1:r===K.A||r===K.B||r===K.I||r===K.S||r===K.U?Pe(e,t):r===K.P?function(e){e.openElements.hasInButtonScope(K.P)||e._insertFakeElement(K.P),e._closePElement()}(e):ot(e,t);break;case 2:r===K.DL||r===K.UL||r===K.OL?st(e,t):r===K.LI?function(e){e.openElements.hasInListItemScope(K.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(K.LI),e.openElements.popUntilTagNamePopped(K.LI))}(e):r===K.DD||r===K.DT?function(e,t){var r=t.tagName;e.openElements.hasInScope(r)&&(e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r))}(e,t):r===K.H1||r===K.H2||r===K.H3||r===K.H4||r===K.H5||r===K.H6?function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e):r===K.BR?function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(K.BR),e.openElements.pop(),e.framesetOk=!1}(e):r===K.EM||r===K.TT?Pe(e,t):ot(e,t);break;case 3:r===K.BIG?Pe(e,t):r===K.DIR||r===K.DIV||r===K.NAV||r===K.PRE?st(e,t):ot(e,t);break;case 4:r===K.BODY?function(e){e.openElements.hasInScope(K.BODY)&&(e.insertionMode=me)}(e):r===K.HTML?function(e,t){e.openElements.hasInScope(K.BODY)&&(e.insertionMode=me,e._processToken(t))}(e,t):r===K.FORM?function(e){var t=e.openElements.tmplCount>0,r=e.formElement;t||(e.formElement=null),(r||t)&&e.openElements.hasInScope(K.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(K.FORM):e.openElements.remove(r))}(e):r===K.CODE||r===K.FONT||r===K.NOBR?Pe(e,t):r===K.MAIN||r===K.MENU?st(e,t):ot(e,t);break;case 5:r===K.ASIDE?st(e,t):r===K.SMALL?Pe(e,t):ot(e,t);break;case 6:r===K.CENTER||r===K.FIGURE||r===K.FOOTER||r===K.HEADER||r===K.HGROUP||r===K.DIALOG?st(e,t):r===K.APPLET||r===K.OBJECT?it(e,t):r===K.STRIKE||r===K.STRONG?Pe(e,t):ot(e,t);break;case 7:r===K.ADDRESS||r===K.ARTICLE||r===K.DETAILS||r===K.SECTION||r===K.SUMMARY||r===K.LISTING?st(e,t):r===K.MARQUEE?it(e,t):ot(e,t);break;case 8:r===K.FIELDSET?st(e,t):r===K.TEMPLATE?Ge(e,t):ot(e,t);break;case 10:r===K.BLOCKQUOTE||r===K.FIGCAPTION?st(e,t):ot(e,t);break;default:ot(e,t)}}function ct(e,t){e.tmplInsertionModeStackTop>-1?vt(e,t):e.stopped=!0}function lt(e,t){var r=e.openElements.currentTagName;r===K.TABLE||r===K.TBODY||r===K.TFOOT||r===K.THEAD||r===K.TR?(e.pendingCharacterTokens=[],e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=oe,e._processToken(t)):ft(e,t)}function ut(e,t){var r=t.tagName;switch(r.length){case 2:r===K.TD||r===K.TH||r===K.TR?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.TBODY),e.insertionMode=le,e._processToken(t)}(e,t):ft(e,t);break;case 3:r===K.COL?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.COLGROUP),e.insertionMode=ce,e._processToken(t)}(e,t):ft(e,t);break;case 4:r===K.FORM?function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,z.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t):ft(e,t);break;case 5:r===K.TABLE?function(e,t){e.openElements.hasInTableScope(K.TABLE)&&(e.openElements.popUntilTagNamePopped(K.TABLE),e._resetInsertionMode(),e._processToken(t))}(e,t):r===K.STYLE?He(e,t):r===K.TBODY||r===K.TFOOT||r===K.THEAD?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=le}(e,t):r===K.INPUT?function(e,t){var r=I.getTokenAttr(t,V.TYPE);r&&r.toLowerCase()===X?e._appendElement(t,z.HTML):ft(e,t),t.ackSelfClosing=!0}(e,t):ft(e,t);break;case 6:r===K.SCRIPT?He(e,t):ft(e,t);break;case 7:r===K.CAPTION?function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,z.HTML),e.insertionMode=de}(e,t):ft(e,t);break;case 8:r===K.COLGROUP?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=ce}(e,t):r===K.TEMPLATE?He(e,t):ft(e,t);break;default:ft(e,t)}}function pt(e,t){var r=t.tagName;r===K.TABLE?e.openElements.hasInTableScope(K.TABLE)&&(e.openElements.popUntilTagNamePopped(K.TABLE),e._resetInsertionMode()):r===K.TEMPLATE?Ge(e,t):r!==K.BODY&&r!==K.CAPTION&&r!==K.COL&&r!==K.COLGROUP&&r!==K.HTML&&r!==K.TBODY&&r!==K.TD&&r!==K.TFOOT&&r!==K.TH&&r!==K.THEAD&&r!==K.TR&&ft(e,t)}function ft(e,t){var r=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,e._processTokenInBodyMode(t),e.fosterParentingEnabled=r}function gt(e,t){var r=0;if(e.hasNonWhitespacePendingCharacterToken)for(;r0?(e.openElements.popUntilTagNamePopped(K.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode(),e._processToken(t)):e.stopped=!0}function bt(e,t){e.insertionMode=ae,e._processToken(t)}function xt(e,t){e.insertionMode=ae,e._processToken(t)}e.exports=we},6750:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(3352),i=s.TAG_NAMES,o=s.NAMESPACES;function d(e){switch(e.length){case 1:return e===i.P;case 2:return e===i.RB||e===i.RP||e===i.RT||e===i.DD||e===i.DT||e===i.LI;case 3:return e===i.RTC;case 6:return e===i.OPTION;case 8:return e===i.OPTGROUP}return!1}function c(e){switch(e.length){case 1:return e===i.P;case 2:return e===i.RB||e===i.RP||e===i.RT||e===i.DD||e===i.DT||e===i.LI||e===i.TD||e===i.TH||e===i.TR;case 3:return e===i.RTC;case 5:return e===i.TBODY||e===i.TFOOT||e===i.THEAD;case 6:return e===i.OPTION;case 7:return e===i.CAPTION;case 8:return e===i.OPTGROUP||e===i.COLGROUP}return!1}function l(e,t){switch(e.length){case 2:if(e===i.TD||e===i.TH)return t===o.HTML;if(e===i.MI||e===i.MO||e===i.MN||e===i.MS)return t===o.MATHML;break;case 4:if(e===i.HTML)return t===o.HTML;if(e===i.DESC)return t===o.SVG;break;case 5:if(e===i.TABLE)return t===o.HTML;if(e===i.MTEXT)return t===o.MATHML;if(e===i.TITLE)return t===o.SVG;break;case 6:return(e===i.APPLET||e===i.OBJECT)&&t===o.HTML;case 7:return(e===i.CAPTION||e===i.MARQUEE)&&t===o.HTML;case 8:return e===i.TEMPLATE&&t===o.HTML;case 13:return e===i.FOREIGN_OBJECT&&t===o.SVG;case 14:return e===i.ANNOTATION_XML&&t===o.MATHML}return!1}var u=function(){function e(t,r){n(this,e),this.stackTop=-1,this.items=[],this.current=t,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=r}return a(e,[{key:"_indexOf",value:function(e){for(var t=-1,r=this.stackTop;r>=0;r--)if(this.items[r]===e){t=r;break}return t}},{key:"_isInTemplate",value:function(){return this.currentTagName===i.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===o.HTML}},{key:"_updateCurrentElement",value:function(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null}},{key:"push",value:function(e){this.items[++this.stackTop]=e,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++}},{key:"pop",value:function(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement()}},{key:"replace",value:function(e,t){var r=this._indexOf(e);this.items[r]=t,r===this.stackTop&&this._updateCurrentElement()}},{key:"insertAfter",value:function(e,t){var r=this._indexOf(e)+1;this.items.splice(r,0,t),r===++this.stackTop&&this._updateCurrentElement()}},{key:"popUntilTagNamePopped",value:function(e){for(;this.stackTop>-1;){var t=this.currentTagName,r=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),t===e&&r===o.HTML)break}}},{key:"popUntilElementPopped",value:function(e){for(;this.stackTop>-1;){var t=this.current;if(this.pop(),t===e)break}}},{key:"popUntilNumberedHeaderPopped",value:function(){for(;this.stackTop>-1;){var e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===i.H1||e===i.H2||e===i.H3||e===i.H4||e===i.H5||e===i.H6&&t===o.HTML)break}}},{key:"popUntilTableCellPopped",value:function(){for(;this.stackTop>-1;){var e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===i.TD||e===i.TH&&t===o.HTML)break}}},{key:"popAllUpToHtmlElement",value:function(){this.stackTop=0,this._updateCurrentElement()}},{key:"clearBackToTableContext",value:function(){for(;this.currentTagName!==i.TABLE&&this.currentTagName!==i.TEMPLATE&&this.currentTagName!==i.HTML||this.treeAdapter.getNamespaceURI(this.current)!==o.HTML;)this.pop()}},{key:"clearBackToTableBodyContext",value:function(){for(;this.currentTagName!==i.TBODY&&this.currentTagName!==i.TFOOT&&this.currentTagName!==i.THEAD&&this.currentTagName!==i.TEMPLATE&&this.currentTagName!==i.HTML||this.treeAdapter.getNamespaceURI(this.current)!==o.HTML;)this.pop()}},{key:"clearBackToTableRowContext",value:function(){for(;this.currentTagName!==i.TR&&this.currentTagName!==i.TEMPLATE&&this.currentTagName!==i.HTML||this.treeAdapter.getNamespaceURI(this.current)!==o.HTML;)this.pop()}},{key:"remove",value:function(e){for(var t=this.stackTop;t>=0;t--)if(this.items[t]===e){this.items.splice(t,1),this.stackTop--,this._updateCurrentElement();break}}},{key:"tryPeekProperlyNestedBodyElement",value:function(){var e=this.items[1];return e&&this.treeAdapter.getTagName(e)===i.BODY?e:null}},{key:"contains",value:function(e){return this._indexOf(e)>-1}},{key:"getCommonAncestor",value:function(e){var t=this._indexOf(e);return--t>=0?this.items[t]:null}},{key:"isRootHtmlElementCurrent",value:function(){return 0===this.stackTop&&this.currentTagName===i.HTML}},{key:"hasInScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var r=this.treeAdapter.getTagName(this.items[t]),n=this.treeAdapter.getNamespaceURI(this.items[t]);if(r===e&&n===o.HTML)return!0;if(l(r,n))return!1}return!0}},{key:"hasNumberedHeaderInScope",value:function(){for(var e=this.stackTop;e>=0;e--){var t=this.treeAdapter.getTagName(this.items[e]),r=this.treeAdapter.getNamespaceURI(this.items[e]);if((t===i.H1||t===i.H2||t===i.H3||t===i.H4||t===i.H5||t===i.H6)&&r===o.HTML)return!0;if(l(t,r))return!1}return!0}},{key:"hasInListItemScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var r=this.treeAdapter.getTagName(this.items[t]),n=this.treeAdapter.getNamespaceURI(this.items[t]);if(r===e&&n===o.HTML)return!0;if((r===i.UL||r===i.OL)&&n===o.HTML||l(r,n))return!1}return!0}},{key:"hasInButtonScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var r=this.treeAdapter.getTagName(this.items[t]),n=this.treeAdapter.getNamespaceURI(this.items[t]);if(r===e&&n===o.HTML)return!0;if(r===i.BUTTON&&n===o.HTML||l(r,n))return!1}return!0}},{key:"hasInTableScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var r=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===o.HTML){if(r===e)return!0;if(r===i.TABLE||r===i.TEMPLATE||r===i.HTML)return!1}}return!0}},{key:"hasTableBodyContextInTableScope",value:function(){for(var e=this.stackTop;e>=0;e--){var t=this.treeAdapter.getTagName(this.items[e]);if(this.treeAdapter.getNamespaceURI(this.items[e])===o.HTML){if(t===i.TBODY||t===i.THEAD||t===i.TFOOT)return!0;if(t===i.TABLE||t===i.HTML)return!1}}return!0}},{key:"hasInSelectScope",value:function(e){for(var t=this.stackTop;t>=0;t--){var r=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===o.HTML){if(r===e)return!0;if(r!==i.OPTION&&r!==i.OPTGROUP)return!1}}return!0}},{key:"generateImpliedEndTags",value:function(){for(;d(this.currentTagName);)this.pop()}},{key:"generateImpliedEndTagsThoroughly",value:function(){for(;c(this.currentTagName);)this.pop()}},{key:"generateImpliedEndTagsWithExclusion",value:function(e){for(;d(this.currentTagName)&&this.currentTagName!==e;)this.pop()}}]),e}();e.exports=u},951:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(6506),i=r(3535),o=r(8588),d=r(5693),c=i.CODE_POINTS,l=i.CODE_POINT_SEQUENCES,u={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},p="DATA_STATE",f="RCDATA_STATE",g="RAWTEXT_STATE",h="SCRIPT_DATA_STATE",m="PLAINTEXT_STATE",y="TAG_OPEN_STATE",v="END_TAG_OPEN_STATE",b="TAG_NAME_STATE",x="RCDATA_LESS_THAN_SIGN_STATE",R="RCDATA_END_TAG_OPEN_STATE",E="RCDATA_END_TAG_NAME_STATE",T="RAWTEXT_LESS_THAN_SIGN_STATE",w="RAWTEXT_END_TAG_OPEN_STATE",j="RAWTEXT_END_TAG_NAME_STATE",S="SCRIPT_DATA_LESS_THAN_SIGN_STATE",A="SCRIPT_DATA_END_TAG_OPEN_STATE",C="SCRIPT_DATA_END_TAG_NAME_STATE",k="SCRIPT_DATA_ESCAPE_START_STATE",_="SCRIPT_DATA_ESCAPE_START_DASH_STATE",P="SCRIPT_DATA_ESCAPED_STATE",I="SCRIPT_DATA_ESCAPED_DASH_STATE",D="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",O="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",N="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",F="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",L="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",M="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",B="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",U="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",H="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",G="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",W="BEFORE_ATTRIBUTE_NAME_STATE",q="ATTRIBUTE_NAME_STATE",K="AFTER_ATTRIBUTE_NAME_STATE",z="BEFORE_ATTRIBUTE_VALUE_STATE",V="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",Y="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",X="ATTRIBUTE_VALUE_UNQUOTED_STATE",J="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",$="SELF_CLOSING_START_TAG_STATE",Q="BOGUS_COMMENT_STATE",Z="MARKUP_DECLARATION_OPEN_STATE",ee="COMMENT_START_STATE",te="COMMENT_START_DASH_STATE",re="COMMENT_STATE",ne="COMMENT_LESS_THAN_SIGN_STATE",ae="COMMENT_LESS_THAN_SIGN_BANG_STATE",se="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",ie="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",oe="COMMENT_END_DASH_STATE",de="COMMENT_END_STATE",ce="COMMENT_END_BANG_STATE",le="DOCTYPE_STATE",ue="BEFORE_DOCTYPE_NAME_STATE",pe="DOCTYPE_NAME_STATE",fe="AFTER_DOCTYPE_NAME_STATE",ge="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",he="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",me="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",ye="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",ve="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",be="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",xe="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",Re="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",Ee="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",Te="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",we="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",je="BOGUS_DOCTYPE_STATE",Se="CDATA_SECTION_STATE",Ae="CDATA_SECTION_BRACKET_STATE",Ce="CDATA_SECTION_END_STATE",ke="CHARACTER_REFERENCE_STATE",_e="NAMED_CHARACTER_REFERENCE_STATE",Pe="AMBIGUOS_AMPERSAND_STATE",Ie="NUMERIC_CHARACTER_REFERENCE_STATE",De="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",Oe="DECIMAL_CHARACTER_REFERENCE_START_STATE",Ne="HEXADEMICAL_CHARACTER_REFERENCE_STATE",Fe="DECIMAL_CHARACTER_REFERENCE_STATE",Le="NUMERIC_CHARACTER_REFERENCE_END_STATE";function Me(e){return e===c.SPACE||e===c.LINE_FEED||e===c.TABULATION||e===c.FORM_FEED}function Be(e){return e>=c.DIGIT_0&&e<=c.DIGIT_9}function Ue(e){return e>=c.LATIN_CAPITAL_A&&e<=c.LATIN_CAPITAL_Z}function He(e){return e>=c.LATIN_SMALL_A&&e<=c.LATIN_SMALL_Z}function Ge(e){return He(e)||Ue(e)}function We(e){return Ge(e)||Be(e)}function qe(e){return e>=c.LATIN_CAPITAL_A&&e<=c.LATIN_CAPITAL_F}function Ke(e){return e>=c.LATIN_SMALL_A&&e<=c.LATIN_SMALL_F}function ze(e){return e+32}function Ve(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function Ye(e){return String.fromCharCode(ze(e))}function Xe(e,t){for(var r=o[++e],n=++e,a=n+r-1;n<=a;){var s=n+a>>>1,i=o[s];if(it))return o[s+r];a=s-1}}return-1}var Je=function(){function e(){n(this,e),this.preprocessor=new s,this.tokenQueue=[],this.allowCDATA=!1,this.state=p,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}return a(e,[{key:"_err",value:function(){}},{key:"_errOnNextCodePoint",value:function(e){this._consume(),this._err(e),this._unconsume()}},{key:"getNextToken",value:function(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;var e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}},{key:"write",value:function(e,t){this.active=!0,this.preprocessor.write(e,t)}},{key:"insertHtmlAtCurrentPos",value:function(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}},{key:"_ensureHibernation",value:function(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:e.HIBERNATION_TOKEN}),!0}return!1}},{key:"_consume",value:function(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}},{key:"_unconsume",value:function(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}},{key:"_reconsumeInState",value:function(e){this.state=e,this._unconsume()}},{key:"_consumeSequenceIfMatch",value:function(e,t,r){for(var n=0,a=!0,s=e.length,i=0,o=t,d=void 0;i0&&(o=this._consume(),n++),o===c.EOF){a=!1;break}if(o!==(d=e[i])&&(r||o!==ze(d))){a=!1;break}}if(!a)for(;n--;)this._unconsume();return a}},{key:"_isTempBufferEqualToScriptString",value:function(){if(this.tempBuff.length!==l.SCRIPT_STRING.length)return!1;for(var e=0;e0&&this._err(d.endTagWithAttributes),t.selfClosing&&this._err(d.endTagWithTrailingSolidus)),this.tokenQueue.push(t)}},{key:"_emitCurrentCharacterToken",value:function(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}},{key:"_emitEOFToken",value:function(){this._createEOFToken(),this._emitCurrentToken()}},{key:"_appendCharToCurrentCharacterToken",value:function(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t)}},{key:"_emitCodePoint",value:function(t){var r=e.CHARACTER_TOKEN;Me(t)?r=e.WHITESPACE_CHARACTER_TOKEN:t===c.NULL&&(r=e.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(r,Ve(t))}},{key:"_emitSeveralCodePoints",value:function(e){for(var t=0;t-1;){var a=o[n],s=a<7;s&&1&a&&(t=2&a?[o[++n],o[++n]]:[o[++n]],r=0);var i=this._consume();if(this.tempBuff.push(i),r++,i===c.EOF)break;n=s?4&a?Xe(n,i):-1:i===a?++n:-1}for(;r--;)this.tempBuff.pop(),this._unconsume();return t}},{key:"_isCharacterReferenceInAttribute",value:function(){return this.returnState===V||this.returnState===Y||this.returnState===X}},{key:"_isCharacterReferenceAttributeQuirk",value:function(e){if(!e&&this._isCharacterReferenceInAttribute()){var t=this._consume();return this._unconsume(),t===c.EQUALS_SIGN||We(t)}return!1}},{key:"_flushCodePointsConsumedAsCharacterReference",value:function(){if(this._isCharacterReferenceInAttribute())for(var e=0;e")):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.state=P,this._emitChars(i.REPLACEMENT_CHARACTER)):e===c.EOF?(this._err(d.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=P,this._emitCodePoint(e))}},{key:O,value:function(e){e===c.SOLIDUS?(this.tempBuff=[],this.state=N):Ge(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(L)):(this._emitChars("<"),this._reconsumeInState(P))}},{key:N,value:function(e){Ge(e)?(this._createEndTagToken(),this._reconsumeInState(F)):(this._emitChars("")):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.state=M,this._emitChars(i.REPLACEMENT_CHARACTER)):e===c.EOF?(this._err(d.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=M,this._emitCodePoint(e))}},{key:H,value:function(e){e===c.SOLIDUS?(this.tempBuff=[],this.state=G,this._emitChars("/")):this._reconsumeInState(M)}},{key:G,value:function(e){Me(e)||e===c.SOLIDUS||e===c.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?P:M,this._emitCodePoint(e)):Ue(e)?(this.tempBuff.push(ze(e)),this._emitCodePoint(e)):He(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(M)}},{key:W,value:function(e){Me(e)||(e===c.SOLIDUS||e===c.GREATER_THAN_SIGN||e===c.EOF?this._reconsumeInState(K):e===c.EQUALS_SIGN?(this._err(d.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=q):(this._createAttr(""),this._reconsumeInState(q)))}},{key:q,value:function(e){Me(e)||e===c.SOLIDUS||e===c.GREATER_THAN_SIGN||e===c.EOF?(this._leaveAttrName(K),this._unconsume()):e===c.EQUALS_SIGN?this._leaveAttrName(z):Ue(e)?this.currentAttr.name+=Ye(e):e===c.QUOTATION_MARK||e===c.APOSTROPHE||e===c.LESS_THAN_SIGN?(this._err(d.unexpectedCharacterInAttributeName),this.currentAttr.name+=Ve(e)):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentAttr.name+=i.REPLACEMENT_CHARACTER):this.currentAttr.name+=Ve(e)}},{key:K,value:function(e){Me(e)||(e===c.SOLIDUS?this.state=$:e===c.EQUALS_SIGN?this.state=z:e===c.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(q)))}},{key:z,value:function(e){Me(e)||(e===c.QUOTATION_MARK?this.state=V:e===c.APOSTROPHE?this.state=Y:e===c.GREATER_THAN_SIGN?(this._err(d.missingAttributeValue),this.state=p,this._emitCurrentToken()):this._reconsumeInState(X))}},{key:V,value:function(e){e===c.QUOTATION_MARK?this.state=J:e===c.AMPERSAND?(this.returnState=V,this.state=ke):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===c.EOF?(this._err(d.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Ve(e)}},{key:Y,value:function(e){e===c.APOSTROPHE?this.state=J:e===c.AMPERSAND?(this.returnState=Y,this.state=ke):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===c.EOF?(this._err(d.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Ve(e)}},{key:X,value:function(e){Me(e)?this._leaveAttrValue(W):e===c.AMPERSAND?(this.returnState=X,this.state=ke):e===c.GREATER_THAN_SIGN?(this._leaveAttrValue(p),this._emitCurrentToken()):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===c.QUOTATION_MARK||e===c.APOSTROPHE||e===c.LESS_THAN_SIGN||e===c.EQUALS_SIGN||e===c.GRAVE_ACCENT?(this._err(d.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=Ve(e)):e===c.EOF?(this._err(d.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Ve(e)}},{key:J,value:function(e){Me(e)?this._leaveAttrValue(W):e===c.SOLIDUS?this._leaveAttrValue($):e===c.GREATER_THAN_SIGN?(this._leaveAttrValue(p),this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInTag),this._emitEOFToken()):(this._err(d.missingWhitespaceBetweenAttributes),this._reconsumeInState(W))}},{key:$,value:function(e){e===c.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInTag),this._emitEOFToken()):(this._err(d.unexpectedSolidusInTag),this._reconsumeInState(W))}},{key:Q,value:function(e){e===c.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===c.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):this.currentToken.data+=Ve(e)}},{key:Z,value:function(e){this._consumeSequenceIfMatch(l.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state=ee):this._consumeSequenceIfMatch(l.DOCTYPE_STRING,e,!1)?this.state=le:this._consumeSequenceIfMatch(l.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state=Se:(this._err(d.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=Q):this._ensureHibernation()||(this._err(d.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState(Q))}},{key:ee,value:function(e){e===c.HYPHEN_MINUS?this.state=te:e===c.GREATER_THAN_SIGN?(this._err(d.abruptClosingOfEmptyComment),this.state=p,this._emitCurrentToken()):this._reconsumeInState(re)}},{key:te,value:function(e){e===c.HYPHEN_MINUS?this.state=de:e===c.GREATER_THAN_SIGN?(this._err(d.abruptClosingOfEmptyComment),this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(re))}},{key:re,value:function(e){e===c.HYPHEN_MINUS?this.state=oe:e===c.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=ne):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):e===c.EOF?(this._err(d.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=Ve(e)}},{key:ne,value:function(e){e===c.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=ae):e===c.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(re)}},{key:ae,value:function(e){e===c.HYPHEN_MINUS?this.state=se:this._reconsumeInState(re)}},{key:se,value:function(e){e===c.HYPHEN_MINUS?this.state=ie:this._reconsumeInState(oe)}},{key:ie,value:function(e){e!==c.GREATER_THAN_SIGN&&e!==c.EOF&&this._err(d.nestedComment),this._reconsumeInState(de)}},{key:oe,value:function(e){e===c.HYPHEN_MINUS?this.state=de:e===c.EOF?(this._err(d.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(re))}},{key:de,value:function(e){e===c.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===c.EXCLAMATION_MARK?this.state=ce:e===c.HYPHEN_MINUS?this.currentToken.data+="-":e===c.EOF?(this._err(d.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(re))}},{key:ce,value:function(e){e===c.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=oe):e===c.GREATER_THAN_SIGN?(this._err(d.incorrectlyClosedComment),this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(re))}},{key:le,value:function(e){Me(e)?this.state=ue:e===c.GREATER_THAN_SIGN?this._reconsumeInState(ue):e===c.EOF?(this._err(d.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.missingWhitespaceBeforeDoctypeName),this._reconsumeInState(ue))}},{key:ue,value:function(e){Me(e)||(Ue(e)?(this._createDoctypeToken(Ye(e)),this.state=pe):e===c.NULL?(this._err(d.unexpectedNullCharacter),this._createDoctypeToken(i.REPLACEMENT_CHARACTER),this.state=pe):e===c.GREATER_THAN_SIGN?(this._err(d.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===c.EOF?(this._err(d.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(Ve(e)),this.state=pe))}},{key:pe,value:function(e){Me(e)?this.state=fe:e===c.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):Ue(e)?this.currentToken.name+=Ye(e):e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentToken.name+=i.REPLACEMENT_CHARACTER):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=Ve(e)}},{key:fe,value:function(e){Me(e)||(e===c.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(l.PUBLIC_STRING,e,!1)?this.state=ge:this._consumeSequenceIfMatch(l.SYSTEM_STRING,e,!1)?this.state=xe:this._ensureHibernation()||(this._err(d.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState(je)))}},{key:ge,value:function(e){Me(e)?this.state=he:e===c.QUOTATION_MARK?(this._err(d.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=me):e===c.APOSTROPHE?(this._err(d.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=ye):e===c.GREATER_THAN_SIGN?(this._err(d.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(je))}},{key:he,value:function(e){Me(e)||(e===c.QUOTATION_MARK?(this.currentToken.publicId="",this.state=me):e===c.APOSTROPHE?(this.currentToken.publicId="",this.state=ye):e===c.GREATER_THAN_SIGN?(this._err(d.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(je)))}},{key:me,value:function(e){e===c.QUOTATION_MARK?this.state=ve:e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===c.GREATER_THAN_SIGN?(this._err(d.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=Ve(e)}},{key:ye,value:function(e){e===c.APOSTROPHE?this.state=ve:e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===c.GREATER_THAN_SIGN?(this._err(d.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=Ve(e)}},{key:ve,value:function(e){Me(e)?this.state=be:e===c.GREATER_THAN_SIGN?(this.state=p,this._emitCurrentToken()):e===c.QUOTATION_MARK?(this._err(d.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=Ee):e===c.APOSTROPHE?(this._err(d.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=Te):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(je))}},{key:be,value:function(e){Me(e)||(e===c.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=p):e===c.QUOTATION_MARK?(this.currentToken.systemId="",this.state=Ee):e===c.APOSTROPHE?(this.currentToken.systemId="",this.state=Te):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(je)))}},{key:xe,value:function(e){Me(e)?this.state=Re:e===c.QUOTATION_MARK?(this._err(d.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=Ee):e===c.APOSTROPHE?(this._err(d.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=Te):e===c.GREATER_THAN_SIGN?(this._err(d.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(je))}},{key:Re,value:function(e){Me(e)||(e===c.QUOTATION_MARK?(this.currentToken.systemId="",this.state=Ee):e===c.APOSTROPHE?(this.currentToken.systemId="",this.state=Te):e===c.GREATER_THAN_SIGN?(this._err(d.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=p,this._emitCurrentToken()):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(je)))}},{key:Ee,value:function(e){e===c.QUOTATION_MARK?this.state=we:e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===c.GREATER_THAN_SIGN?(this._err(d.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=Ve(e)}},{key:Te,value:function(e){e===c.APOSTROPHE?this.state=we:e===c.NULL?(this._err(d.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===c.GREATER_THAN_SIGN?(this._err(d.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=p):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=Ve(e)}},{key:we,value:function(e){Me(e)||(e===c.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=p):e===c.EOF?(this._err(d.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(d.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState(je)))}},{key:je,value:function(e){e===c.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=p):e===c.NULL?this._err(d.unexpectedNullCharacter):e===c.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}},{key:Se,value:function(e){e===c.RIGHT_SQUARE_BRACKET?this.state=Ae:e===c.EOF?(this._err(d.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}},{key:Ae,value:function(e){e===c.RIGHT_SQUARE_BRACKET?this.state=Ce:(this._emitChars("]"),this._reconsumeInState(Se))}},{key:Ce,value:function(e){e===c.GREATER_THAN_SIGN?this.state=p:e===c.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(Se))}},{key:ke,value:function(e){this.tempBuff=[c.AMPERSAND],e===c.NUMBER_SIGN?(this.tempBuff.push(e),this.state=Ie):We(e)?this._reconsumeInState(_e):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}},{key:_e,value:function(e){var t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[c.AMPERSAND];else if(t){var r=this.tempBuff[this.tempBuff.length-1]===c.SEMICOLON;this._isCharacterReferenceAttributeQuirk(r)||(r||this._errOnNextCodePoint(d.missingSemicolonAfterCharacterReference),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state=Pe}},{key:Pe,value:function(e){We(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=Ve(e):this._emitCodePoint(e):(e===c.SEMICOLON&&this._err(d.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}},{key:Ie,value:function(e){this.charRefCode=0,e===c.LATIN_SMALL_X||e===c.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state=De):this._reconsumeInState(Oe)}},{key:De,value:function(e){!function(e){return Be(e)||qe(e)||Ke(e)}(e)?(this._err(d.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState(Ne)}},{key:Oe,value:function(e){Be(e)?this._reconsumeInState(Fe):(this._err(d.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}},{key:Ne,value:function(e){qe(e)?this.charRefCode=16*this.charRefCode+e-55:Ke(e)?this.charRefCode=16*this.charRefCode+e-87:Be(e)?this.charRefCode=16*this.charRefCode+e-48:e===c.SEMICOLON?this.state=Le:(this._err(d.missingSemicolonAfterCharacterReference),this._reconsumeInState(Le))}},{key:Fe,value:function(e){Be(e)?this.charRefCode=10*this.charRefCode+e-48:e===c.SEMICOLON?this.state=Le:(this._err(d.missingSemicolonAfterCharacterReference),this._reconsumeInState(Le))}},{key:Le,value:function(){if(this.charRefCode===c.NULL)this._err(d.nullCharacterReference),this.charRefCode=c.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(d.characterReferenceOutsideUnicodeRange),this.charRefCode=c.REPLACEMENT_CHARACTER;else if(i.isSurrogate(this.charRefCode))this._err(d.surrogateCharacterReference),this.charRefCode=c.REPLACEMENT_CHARACTER;else if(i.isUndefinedCodePoint(this.charRefCode))this._err(d.noncharacterCharacterReference);else if(i.isControlCodePoint(this.charRefCode)||this.charRefCode===c.CARRIAGE_RETURN){this._err(d.controlCharacterReference);var e=u[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}]),e}();Je.CHARACTER_TOKEN="CHARACTER_TOKEN",Je.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",Je.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",Je.START_TAG_TOKEN="START_TAG_TOKEN",Je.END_TAG_TOKEN="END_TAG_TOKEN",Je.COMMENT_TOKEN="COMMENT_TOKEN",Je.DOCTYPE_TOKEN="DOCTYPE_TOKEN",Je.EOF_TOKEN="EOF_TOKEN",Je.HIBERNATION_TOKEN="HIBERNATION_TOKEN",Je.MODE={DATA:p,RCDATA:f,RAWTEXT:g,SCRIPT_DATA:h,PLAINTEXT:m},Je.getTokenAttr=function(e,t){for(var r=e.attrs.length-1;r>=0;r--)if(e.attrs[r].name===t)return e.attrs[r].value;return null},e.exports=Je},8588:function(e){"use strict";e.exports=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204])},6506:function(e,t,r){"use strict";var n=r(8983).default,a=r(2081).default,s=r(3535),i=r(5693),o=s.CODE_POINTS,d=function(){function e(){n(this,e),this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536}return a(e,[{key:"_err",value:function(){}},{key:"_addGap",value:function(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}},{key:"_processSurrogate",value:function(e){if(this.pos!==this.lastCharPos){var t=this.html.charCodeAt(this.pos+1);if(s.isSurrogatePair(t))return this.pos++,this._addGap(),s.getSurrogatePairCodePoint(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,o.EOF;return this._err(i.surrogateInInputStream),e}},{key:"dropParsedChunk",value:function(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[])}},{key:"write",value:function(e,t){this.html?this.html+=e:this.html=e,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=t}},{key:"insertHtmlAtCurrentPos",value:function(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1}},{key:"advance",value:function(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,o.EOF;var e=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&e===o.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):e===o.CARRIAGE_RETURN?(this.skipNextNewLine=!0,o.LINE_FEED):(this.skipNextNewLine=!1,s.isSurrogate(e)&&(e=this._processSurrogate(e)),e>31&&e<127||e===o.LINE_FEED||e===o.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}},{key:"_checkForProblematicCharacters",value:function(e){s.isControlCodePoint(e)?this._err(i.controlCharacterInInputStream):s.isUndefinedCodePoint(e)&&this._err(i.noncharacterInInputStream)}},{key:"retreat",value:function(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--}}]),e}();e.exports=d},55:function(e,t,r){"use strict";var n=r(3352).DOCUMENT_MODE;t.createDocument=function(){return{nodeName:"#document",mode:n.NO_QUIRKS,childNodes:[]}},t.createDocumentFragment=function(){return{nodeName:"#document-fragment",childNodes:[]}},t.createElement=function(e,t,r){return{nodeName:e,tagName:e,attrs:r,namespaceURI:t,childNodes:[],parentNode:null}},t.createCommentNode=function(e){return{nodeName:"#comment",data:e,parentNode:null}};var a=function(e){return{nodeName:"#text",value:e,parentNode:null}},s=t.appendChild=function(e,t){e.childNodes.push(t),t.parentNode=e},i=t.insertBefore=function(e,t,r){var n=e.childNodes.indexOf(r);e.childNodes.splice(n,0,t),t.parentNode=e};t.setTemplateContent=function(e,t){e.content=t},t.getTemplateContent=function(e){return e.content},t.setDocumentType=function(e,t,r,n){for(var a=null,i=0;i1)for(var r=1;rs&&(s=a):a=1,r=n+1,n=e.indexOf(t,r);return s}},2422:function(e,t,r){e.exports=r(3482)},5403:function(e){e.exports=function e(t,r){var n,a=-1;if(r.extensions)for(;++a"+(r?"":" ")+e}},3016:function(e,t,r){e.exports=function(e,t,r,a){var s=-1;for(;++s"})+">"):(c=r.enter("destinationRaw"),l+=s(r,e.url,{before:" ",after:" "}));c(),e.title&&(c=r.enter("title"+o),l+=" "+i+s(r,e.title,{before:i,after:i})+i,c());return d(),l};var n=r(3582),a=r(1056),s=r(1933)},6504:function(e,t,r){e.exports=s,s.peek=function(e,t,r){return r.options.emphasis||"*"};var n=r(3601),a=r(2393);function s(e,t,r){var s=n(r),i=r.enter("emphasis"),o=a(e,r,{before:s,after:s});return i(),s+o+s}},7818:function(e,t,r){e.exports=function(e,t,r){var i,o,d,c,l=Math.max(Math.min(6,e.depth||1),1);if(a(e,r))return i=r.enter("headingSetext"),o=r.enter("phrasing"),d=s(e,r,{before:"\n",after:"\n"}),o(),i(),d+"\n"+n(1===l?"=":"-",d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf("\n"))+1));c=n("#",l),i=r.enter("headingAtx"),o=r.enter("phrasing"),d=(d=s(e,r,{before:"# ",after:"\n"}))?c+" "+d:c,r.options.closeAtx&&(d+=" "+c);return o(),i(),d};var n=r(7807),a=r(6576),s=r(2393)},8370:function(e){function t(e){return e.value||""}e.exports=t,t.peek=function(){return"<"}},2719:function(e,t,r){e.exports=s,s.peek=function(){return"!"};var n=r(3582),a=r(1933);function s(e,t,r){var s,i,o=e.referenceType,d=r.enter("imageReference"),c=r.enter("label"),l=a(r,e.alt,{before:"[",after:"]"}),u="!["+l+"]";return c(),i=r.stack,r.stack=[],c=r.enter("reference"),s=a(r,n(e),{before:"[",after:"]"}),c(),r.stack=i,d(),"full"!==o&&l&&l===s?"shortcut"!==o&&(u+="[]"):u+="["+s+"]",u}},9130:function(e,t,r){e.exports=s,s.peek=function(){return"!"};var n=r(1056),a=r(1933);function s(e,t,r){var s=n(r),i='"'===s?"Quote":"Apostrophe",o=r.enter("image"),d=r.enter("label"),c="!["+a(r,e.alt,{before:"[",after:"]"})+"](";return d(),!e.url&&e.title||/[ \t\r\n]/.test(e.url)?(d=r.enter("destinationLiteral"),c+="<"+a(r,e.url,{before:"<",after:">"})+">"):(d=r.enter("destinationRaw"),c+=a(r,e.url,{before:"(",after:e.title?" ":")"})),d(),e.title&&(d=r.enter("title"+i),c+=" "+s+a(r,e.title,{before:s,after:s})+s,d()),c+=")",o(),c}},9223:function(e,t,r){t.blockquote=r(828),t.break=r(3016),t.code=r(1990),t.definition=r(7722),t.emphasis=r(6504),t.hardBreak=r(3016),t.heading=r(7818),t.html=r(8370),t.image=r(9130),t.imageReference=r(2719),t.inlineCode=r(4138),t.link=r(8468),t.linkReference=r(5794),t.list=r(4694),t.listItem=r(2574),t.paragraph=r(6869),t.root=r(1495),t.strong=r(3152),t.text=r(857),t.thematicBreak=r(890)},4138:function(e,t,r){e.exports=a,a.peek=function(){return"`"};var n=r(6758);function a(e,t,r){for(var a,s,i,o,d=e.value||"",c="`",l=-1;new RegExp("(^|[^`])"+c+"([^`]|$)").test(d);)c+="`";for(/[^ \r\n]/.test(d)&&(/[ \r\n`]/.test(d.charAt(0))||/[ \r\n`]/.test(d.charAt(d.length-1)))&&(d=" "+d+" ");++l"})+">",o(),r.stack=l,c):(o=r.enter("link"),d=r.enter("label"),c="["+s(e,r,{before:"[",after:"]"})+"](",d(),!e.url&&e.title||/[ \t\r\n]/.test(e.url)?(d=r.enter("destinationLiteral"),c+="<"+i(r,e.url,{before:"<",after:">"})+">"):(d=r.enter("destinationRaw"),c+=i(r,e.url,{before:"(",after:e.title?" ":")"})),d(),e.title&&(d=r.enter("title"+p),c+=" "+u+i(r,e.title,{before:u,after:u})+u,d()),c+=")",o(),c)}},2574:function(e,t,r){e.exports=function(e,t,r){var d,c,l,u=a(r),p=s(r);t&&t.ordered&&(u=(t.start>-1?t.start:1)+(!1===r.options.incrementListMarker?0:t.children.indexOf(e))+".");d=u.length+1,("tab"===p||"mixed"===p&&(t&&t.spread||e.spread))&&(d=4*Math.ceil(d/4));return l=r.enter("listItem"),c=o(i(e,r),(function(e,t,r){if(t)return(r?"":n(" ",d))+e;return(r?u:u+n(" ",d-u.length))+e})),l(),c};var n=r(7807),a=r(1596),s=r(6753),i=r(1177),o=r(5453)},4694:function(e,t,r){e.exports=function(e,t,r){var a=r.enter("list"),s=n(e,r);return a(),s};var n=r(1177)},6869:function(e,t,r){e.exports=function(e,t,r){var a=r.enter("paragraph"),s=r.enter("phrasing"),i=n(e,r,{before:"\n",after:"\n"});return s(),a(),i};var n=r(2393)},1495:function(e,t,r){e.exports=function(e,t,r){return n(e,r)};var n=r(1177)},3152:function(e,t,r){e.exports=s,s.peek=function(e,t,r){return r.options.strong||"*"};var n=r(2286),a=r(2393);function s(e,t,r){var s=n(r),i=r.enter("strong"),o=a(e,r,{before:s,after:s});return i(),s+s+o+s+s}},857:function(e,t,r){e.exports=function(e,t,r,a){return n(r,e.value,a)};var n=r(1933)},890:function(e,t,r){e.exports=function(e,t,r){var i=n(s(r)+(r.options.ruleSpaces?" ":""),a(r));return r.options.ruleSpaces?i.slice(0,-1):i};var n=r(7807),a=r(1787),s=r(8237)},3482:function(e,t,r){e.exports=function(e,t){var r,u=t||{},p={enter:function(e){return p.stack.push(e),t;function t(){p.stack.pop()}},stack:[],unsafe:[],join:[],handlers:{},options:{}};a(p,{unsafe:o,join:i,handlers:s}),a(p,u),p.options.tightDefinitions&&(p.join=[l].concat(p.join));p.handle=n("type",{invalid:d,unknown:c,handlers:p.handlers}),(r=p.handle(e,null,p,{before:"\n",after:"\n"}))&&10!==r.charCodeAt(r.length-1)&&13!==r.charCodeAt(r.length-1)&&(r+="\n");return r};var n=r(8622),a=r(5403),s=r(9223),i=r(3724),o=r(2738);function d(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function c(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function l(e,t){if("definition"===e.type&&e.type===t.type)return 0}},3724:function(e,t,r){e.exports=[function(e,t,r,s){if("list"===t.type&&t.type===e.type&&Boolean(e.ordered)===Boolean(t.ordered)||"code"===t.type&&n(t,s)&&("list"===e.type||e.type===t.type&&n(e,s)))return!1;if("boolean"===typeof r.spread){if("paragraph"===e.type&&(e.type===t.type||"definition"===t.type||"heading"===t.type&&a(t,s)))return;return r.spread?1:0}}];var n=r(368),a=r(6576)},2738:function(e){e.exports=[{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing"},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing"},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*"},{character:"*",inConstruct:"phrasing"},{atBreak:!0,character:"+"},{atBreak:!0,character:"-"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing"},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:["phrasing","label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{before:"[^A-Za-z]",character:"_",inConstruct:"phrasing"},{character:"_",after:"[^A-Za-z]",inConstruct:"phrasing"},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent","phrasing"]},{atBreak:!0,character:"~"}]},3582:function(e,t,r){e.exports=function(e){if(e.label||!e.identifier)return e.label||"";return e.identifier.replace(a,"$1").replace(s,i)};var n=r(4755),a=/\\([!-/:-@[-`{-~])/g,s=/&(#(\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function i(e,t){return n(t)||e}},1596:function(e){e.exports=function(e){var t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}},3601:function(e){e.exports=function(e){var t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}},6553:function(e){e.exports=function(e){var t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}},6753:function(e){e.exports=function(e){var t=e.options.listItemIndent||"tab";if(1===t||"1"===t)return"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}},1056:function(e){e.exports=function(e){var t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}},1787:function(e){e.exports=function(e){var t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}},8237:function(e){e.exports=function(e){var t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}},2286:function(e){e.exports=function(e){var t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}},1177:function(e,t,r){e.exports=function(e,t){var r,a=e.children||[],s=[],i=-1;for(;++i0&&("\r"===c||"\n"===c)&&"html"===s.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),c=" "),o.push(t.handle(s,e,t,{before:c,after:n})),c=o[o.length-1].slice(-1);return o.join("")}},368:function(e){e.exports=function(e,t){return!t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value)}},6576:function(e,t,r){e.exports=function(e,t){return t.options.setext&&(!e.depth||e.depth<3)&&n(e)};var n=r(7554)},6943:function(e,t,r){e.exports=function(e,t){var r=n(e);return!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url)};var n=r(7554)},5453:function(e){e.exports=function(e,r){var n,a=[],s=0,i=0;for(;n=t.exec(e);)o(e.slice(s,n.index)),a.push(n[0]),s=n.index+n[0].length,i++;return o(e.slice(s)),a.join("");function o(e){a.push(r(e,i,!e))}};var t=/\r?\n|\r/g},6758:function(e){e.exports=function(e){var t,r;e._compiled||(t=e.before?"(?:"+e.before+")":"",r=e.after?"(?:"+e.after+")":"",e.atBreak&&(t="[\\r\\n][\\t ]*"+t),e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(r||""),"g"));return e._compiled}},397:function(e){function t(e,t,r){var n;if(!t)return r;for("string"===typeof t&&(t=[t]),n=-1;++n=g||c+1-1&&(L.call(this,e),M.call(this,e))}function U(){g("atHardBreak",!0)}function H(){var e=this.resume();this.stack[this.stack.length-1].value=e}function G(){var e=this.resume();this.stack[this.stack.length-1].value=e}function W(){var e=this.resume();this.stack[this.stack.length-1].value=e}function q(){var e=this.stack[this.stack.length-1];h("inReference")?(e.type+="Reference",e.referenceType=h("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),g("referenceType")}function K(){var e=this.stack[this.stack.length-1];h("inReference")?(e.type+="Reference",e.referenceType=h("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),g("referenceType")}function z(e){this.stack[this.stack.length-2].identifier=i(this.sliceSerialize(e)).toLowerCase()}function V(){var e=this.stack[this.stack.length-1],t=this.resume();this.stack[this.stack.length-1].label=t,g("inReference",!0),"link"===this.stack[this.stack.length-1].type?this.stack[this.stack.length-1].children=e.children:this.stack[this.stack.length-1].alt=t}function Y(){var e=this.resume();this.stack[this.stack.length-1].url=e}function X(){var e=this.resume();this.stack[this.stack.length-1].title=e}function J(){g("inReference")}function $(){g("referenceType","collapsed")}function Q(e){var t=this.resume();this.stack[this.stack.length-1].label=t,this.stack[this.stack.length-1].identifier=i(this.sliceSerialize(e)).toLowerCase(),g("referenceType","full")}function Z(e){g("characterReferenceType",e.type)}function ee(e){var t,r,n=this.sliceSerialize(e),a=h("characterReferenceType");a?(t=o(n,"characterReferenceMarkerNumeric"===a?10:16),g("characterReferenceType")):t=u(n),(r=this.stack.pop()).value+=t,r.position.end=m(e.end)}function te(e){M.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function re(e){M.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function ne(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function oe(){return{type:"emphasis",children:[]}}function de(){return{type:"heading",depth:void 0,children:[]}}function ce(){return{type:"break"}}function le(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function pe(){return{type:"link",title:null,url:"",children:[]}}function fe(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function ge(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function he(){return{type:"paragraph",children:[]}}function me(){return{type:"strong",children:[]}}function ye(){return{type:"text",value:""}}function ve(){return{type:"thematicBreak"}}}(r)(l(d(r).document().write(c()(e,t,!0))))};var n=r(3728),a=r(8548),s=r(138),i=r(7166),o=r(7090),d=r(3245),c=r(5094),l=r(5965),u=r(3003),p=r(2631);function f(e,t){var r,n;for(r in t)n=s.call(e,r)?e[r]:e[r]={},"canContainEols"===r||"transforms"===r?e[r]=[].concat(n,t[r]):Object.assign(n,t[r])}},5415:function(e,t,r){"use strict";e.exports=r(4374)},3728:function(e){"use strict";function t(e){return e&&(e.value||e.alt||e.title||"children"in e&&r(e.children)||"length"in e&&r(e))||""}function r(e){for(var r=[],n=-1;++nt;)i.containerState=c[s][1],c[s][0].exit.call(i,e);c.length=t}},o={tokenize:function(e,t,r){return a(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}},d={tokenize:function(e,t,r){return a(e,e.lazy(this.parser.constructs.flow,t,r),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}};t.tokenize=i},5785:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1499),a=r(915),s=r(2853),i=function(e){var t=this,r=e.attempt(s,(function(n){if(null===n)return void e.consume(n);return e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}),e.attempt(this.parser.constructs.flowInitial,i,a(e,e.attempt(this.parser.constructs.flow,i,e.attempt(n,i)),"linePrefix")));return r;function i(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,r;e.consume(n)}};t.tokenize=i},74:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8548),a=r(4436),s=d("text"),i=d("string"),o={resolveAll:c()};function d(e){return{tokenize:function(t){var r=this,n=this.parser.constructs[e],a=t.attempt(n,s,i);return s;function s(e){return d(e)?a(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),o;t.consume(e)}function o(e){return d(e)?(t.exit("data"),a(e)):(t.consume(e),o)}function d(e){var t=n[e],a=-1;if(null===e)return!0;if(t)for(;++a1&&e[h][1].end.offset-e[h][1].start.offset>1?2:1)>1?"strongSequence":"emphasisSequence",start:i(d(e[r][1].end),-p),end:d(e[r][1].end)},u={type:p>1?"strongSequence":"emphasisSequence",start:d(e[h][1].start),end:i(d(e[h][1].start),p)},c={type:p>1?"strongText":"emphasisText",start:d(e[r][1].end),end:d(e[h][1].start)},s={type:p>1?"strong":"emphasis",start:d(l.start),end:d(u.end)},e[r][1].end=d(l.start),e[h][1].start=d(u.end),f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=n(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=n(f,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",c,t]]),f=n(f,o(t.parser.constructs.insideSpan.null,e.slice(r+1,h),t)),f=n(f,[["exit",c,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[h][1].end.offset-e[h][1].start.offset?(g=2,f=n(f,[["enter",e[h][1],t],["exit",e[h][1],t]])):g=0,a(e,r-1,h-r+3,f),h=r+f.length-g-2;break}h=-1;for(;++h-1?void 0:4)}},exit:function(e){e.exit("blockQuote")}};e.exports=s},4867:function(e,t,r){"use strict";var n=r(8312),a={name:"characterEscape",tokenize:function(e,t,r){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),a};function a(a){return n(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(a)}}};e.exports=a},3322:function(e,t,r){"use strict";var n=r(3003),a=r(5506),s=r(6611),i=r(4162);function o(e){return e&&"object"===typeof e&&"default"in e?e:{default:e}}var d=o(n),c={name:"characterReference",tokenize:function(e,t,r){var n,o,c=this,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),u};function u(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),n=31,o=a,f(t))}function p(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,o=i,f):(e.enter("characterReferenceValue"),n=7,o=s,f(t))}function f(s){var i;return 59===s&&l?(i=e.exit("characterReferenceValue"),o!==a||d.default(c.sliceSerialize(i))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):r(s)):o(s)&&l++-1?void 0:4);function s(t){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(t)}function d(t){return t===o?(e.consume(t),a++,d):a-1||a(s.events,"linePrefix")<4?e.interrupt(s.parser.constructs.flow,r,t)(i):t(i)}},partial:!0};e.exports=o},9e3:function(e,t,r){"use strict";var n=r(9942),a=r(5436),s=r(7166),i=r(6064),o=r(7979),d=r(915),c=r(3396),l=r(1174),u={name:"definition",tokenize:function(e,t,r){var a,l=this;return function(t){return e.enter("definition"),o.call(l,e,u,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function u(t){return a=s(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),c(e,i(e,e.attempt(p,d(e,f,"whitespace"),d(e,f,"whitespace")),r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):r(t)}function f(s){return null===s||n(s)?(e.exit("definition"),l.parser.defined.indexOf(a)<0&&l.parser.defined.push(a),t(s)):r(s)}}},p={tokenize:function(e,t,r){return function(t){return a(t)?c(e,s)(t):r(t)};function s(t){return 34===t||39===t||40===t?l(e,d(e,i,"whitespace"),r,"definitionTitle","definitionTitleMarker","definitionTitleString")(t):r(t)}function i(e){return null===e||n(e)?t(e):r(e)}},partial:!0};e.exports=u},6064:function(e,t,r){"use strict";var n=r(1764),a=r(5436),s=r(9942);e.exports=function(e,t,r,i,o,d,c,l,u){var p=u||1/0,f=0;return function(t){if(60===t)return e.enter(i),e.enter(o),e.enter(d),e.consume(t),e.exit(d),g;if(n(t)||41===t)return r(t);return e.enter(i),e.enter(c),e.enter(l),e.enter("chunkString",{contentType:"string"}),y(t)};function g(r){return 62===r?(e.enter(d),e.consume(r),e.exit(d),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(r))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(l),g(t)):null===t||60===t||s(t)?r(t):(e.consume(t),92===t?m:h)}function m(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function y(s){return 40===s?++f>p?r(s):(e.consume(s),y):41===s?f--?(e.consume(s),y):(e.exit("chunkString"),e.exit(l),e.exit(c),e.exit(i),t(s)):null===s||a(s)?f?r(s):(e.exit("chunkString"),e.exit(l),e.exit(c),e.exit(i),t(s)):n(s)?r(s):(e.consume(s),92===s?v:y)}function v(t){return 40===t||41===t||92===t?(e.consume(t),y):y(t)}}},7979:function(e,t,r){"use strict";var n=r(9942),a=r(4396);e.exports=function(e,t,r,s,i,o){var d,c=this,l=0;return function(t){return e.enter(s),e.enter(i),e.consume(t),e.exit(i),e.enter(o),u};function u(a){return null===a||91===a||93===a&&!d||94===a&&!l&&"_hiddenFootnoteSupport"in c.parser.constructs||l>999?r(a):93===a?(e.exit(o),e.enter(i),e.consume(a),e.exit(i),e.exit(s),t):n(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(a))}function p(t){return null===t||91===t||93===t||n(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),d=d||!a(t),92===t?f:p)}function f(t){return 91===t||92===t||93===t?(e.consume(t),l++,p):p(t)}}},915:function(e,t,r){"use strict";var n=r(4396);e.exports=function(e,t,r,a){var s=a?a-1:1/0,i=0;return function(a){if(n(a))return e.enter(r),o(a);return t(a)};function o(a){return n(a)&&i++s&&"whitespace"===e[a][1].type&&(a-=2);"atxHeadingSequence"===e[a][1].type&&(s===a-1||a-4>s&&"whitespace"===e[a-2][1].type)&&(a-=s+1===a?2:4);a>s&&(r={type:"atxHeadingText",start:e[s][1].start,end:e[a][1].end},n={type:"chunkText",start:e[s][1].start,end:e[a][1].end,contentType:"text"},i(e,s,a-s+1,[["enter",r,t],["enter",n,t],["exit",n,t],["exit",r,t]]));return e}};e.exports=d},4651:function(e,t,r){"use strict";var n=r(6491),a=r(5506),s=r(9942),i=r(5436),o=r(4396),d=r(3496),c=r(1718),l=r(4304),u=r(2853),p={name:"htmlFlow",tokenize:function(e,t,r){var u,p,g,h,m,y=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),v};function v(a){return 33===a?(e.consume(a),b):47===a?(e.consume(a),E):63===a?(e.consume(a),u=3,y.interrupt?t:G):n(a)?(e.consume(a),g=d(a),p=!0,T):r(a)}function b(a){return 45===a?(e.consume(a),u=2,x):91===a?(e.consume(a),u=5,g="CDATA[",h=0,R):n(a)?(e.consume(a),u=4,y.interrupt?t:G):r(a)}function x(n){return 45===n?(e.consume(n),y.interrupt?t:G):r(n)}function R(n){return n===g.charCodeAt(h++)?(e.consume(n),h===g.length?y.interrupt?t:N:R):r(n)}function E(t){return n(t)?(e.consume(t),g=d(t),T):r(t)}function T(n){return null===n||47===n||62===n||i(n)?47!==n&&p&&l.indexOf(g.toLowerCase())>-1?(u=1,y.interrupt?t(n):N(n)):c.indexOf(g.toLowerCase())>-1?(u=6,47===n?(e.consume(n),w):y.interrupt?t(n):N(n)):(u=7,y.interrupt?r(n):p?S(n):j(n)):45===n||a(n)?(e.consume(n),g+=d(n),T):r(n)}function w(n){return 62===n?(e.consume(n),y.interrupt?t:N):r(n)}function j(t){return o(t)?(e.consume(t),j):D(t)}function S(t){return 47===t?(e.consume(t),D):58===t||95===t||n(t)?(e.consume(t),A):o(t)?(e.consume(t),S):D(t)}function A(t){return 45===t||46===t||58===t||95===t||a(t)?(e.consume(t),A):C(t)}function C(t){return 61===t?(e.consume(t),k):o(t)?(e.consume(t),C):S(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),m=t,_):o(t)?(e.consume(t),k):(m=void 0,P(t))}function _(t){return t===m?(e.consume(t),I):null===t||s(t)?r(t):(e.consume(t),_)}function P(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||i(t)?C(t):(e.consume(t),P)}function I(e){return 47===e||62===e||o(e)?S(e):r(e)}function D(t){return 62===t?(e.consume(t),O):r(t)}function O(t){return o(t)?(e.consume(t),O):null===t||s(t)?N(t):r(t)}function N(t){return 45===t&&2===u?(e.consume(t),M):60===t&&1===u?(e.consume(t),B):62===t&&4===u?(e.consume(t),W):63===t&&3===u?(e.consume(t),G):93===t&&5===u?(e.consume(t),H):!s(t)||6!==u&&7!==u?null===t||s(t)?F(t):(e.consume(t),N):e.check(f,W,F)(t)}function F(t){return e.exit("htmlFlowData"),L(t)}function L(t){return null===t?q(t):s(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),L):(e.enter("htmlFlowData"),N(t))}function M(t){return 45===t?(e.consume(t),G):N(t)}function B(t){return 47===t?(e.consume(t),g="",U):N(t)}function U(t){return 62===t&&l.indexOf(g.toLowerCase())>-1?(e.consume(t),W):n(t)&&g.length<8?(e.consume(t),g+=d(t),U):N(t)}function H(t){return 93===t?(e.consume(t),G):N(t)}function G(t){return 62===t?(e.consume(t),W):N(t)}function W(t){return null===t||s(t)?(e.exit("htmlFlowData"),q(t)):(e.consume(t),W)}function q(r){return e.exit("htmlFlow"),t(r)}},resolveTo:function(e){var t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},f={tokenize:function(e,t,r){return function(n){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),e.attempt(u,t,r)}},partial:!0};e.exports=p},9052:function(e,t,r){"use strict";var n=r(6491),a=r(5506),s=r(9942),i=r(5436),o=r(4396),d=r(915),c={name:"htmlText",tokenize:function(e,t,r){var c,l,u,p,f=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),g};function g(t){return 33===t?(e.consume(t),h):47===t?(e.consume(t),C):63===t?(e.consume(t),S):n(t)?(e.consume(t),P):r(t)}function h(t){return 45===t?(e.consume(t),m):91===t?(e.consume(t),l="CDATA[",u=0,R):n(t)?(e.consume(t),j):r(t)}function m(t){return 45===t?(e.consume(t),y):r(t)}function y(t){return null===t||62===t?r(t):45===t?(e.consume(t),v):b(t)}function v(e){return null===e||62===e?r(e):b(e)}function b(t){return null===t?r(t):45===t?(e.consume(t),x):s(t)?(p=b,B(t)):(e.consume(t),b)}function x(t){return 45===t?(e.consume(t),H):b(t)}function R(t){return t===l.charCodeAt(u++)?(e.consume(t),u===l.length?E:R):r(t)}function E(t){return null===t?r(t):93===t?(e.consume(t),T):s(t)?(p=E,B(t)):(e.consume(t),E)}function T(t){return 93===t?(e.consume(t),w):E(t)}function w(t){return 62===t?H(t):93===t?(e.consume(t),w):E(t)}function j(t){return null===t||62===t?H(t):s(t)?(p=j,B(t)):(e.consume(t),j)}function S(t){return null===t?r(t):63===t?(e.consume(t),A):s(t)?(p=S,B(t)):(e.consume(t),S)}function A(e){return 62===e?H(e):S(e)}function C(t){return n(t)?(e.consume(t),k):r(t)}function k(t){return 45===t||a(t)?(e.consume(t),k):_(t)}function _(t){return s(t)?(p=_,B(t)):o(t)?(e.consume(t),_):H(t)}function P(t){return 45===t||a(t)?(e.consume(t),P):47===t||62===t||i(t)?I(t):r(t)}function I(t){return 47===t?(e.consume(t),H):58===t||95===t||n(t)?(e.consume(t),D):s(t)?(p=I,B(t)):o(t)?(e.consume(t),I):H(t)}function D(t){return 45===t||46===t||58===t||95===t||a(t)?(e.consume(t),D):O(t)}function O(t){return 61===t?(e.consume(t),N):s(t)?(p=O,B(t)):o(t)?(e.consume(t),O):I(t)}function N(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),c=t,F):s(t)?(p=N,B(t)):o(t)?(e.consume(t),N):(e.consume(t),c=void 0,M)}function F(t){return t===c?(e.consume(t),L):null===t?r(t):s(t)?(p=F,B(t)):(e.consume(t),F)}function L(e){return 62===e||47===e||i(e)?I(e):r(e)}function M(t){return null===t||34===t||39===t||60===t||61===t||96===t?r(t):62===t||i(t)?I(t):(e.consume(t),M)}function B(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d(e,U,"linePrefix",f.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}function U(t){return e.enter("htmlTextData"),p(t)}function H(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),t):r(n)}}};e.exports=c},1806:function(e,t,r){"use strict";var n=r(5436),a=r(5395),s=r(9146),i=r(7166),o=r(1214),d=r(4436),c=r(6064),l=r(7979),u=r(1174),p=r(3396),f={name:"labelEnd",tokenize:function(e,t,r){var n,a,s=this,o=s.events.length;for(;o--;)if(("labelImage"===s.events[o][1].type||"labelLink"===s.events[o][1].type)&&!s.events[o][1]._balanced){n=s.events[o][1];break}return function(t){if(!n)return r(t);return n._inactive?c(t):(a=s.parser.defined.indexOf(i(s.sliceSerialize({start:n.end,end:s.now()})))>-1,e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),d)};function d(r){return 40===r?e.attempt(g,t,a?t:c)(r):91===r?e.attempt(h,t,a?e.attempt(m,t,c):c)(r):a?t(r):c(r)}function c(e){return n._balanced=!0,r(e)}},resolveTo:function(e,t){var r,n,i,c,l,u,p,f=e.length,g=0;for(;f--;)if(c=e[f][1],l){if("link"===c.type||"labelLink"===c.type&&c._inactive)break;"enter"===e[f][0]&&"labelLink"===c.type&&(c._inactive=!0)}else if(u){if("enter"===e[f][0]&&("labelImage"===c.type||"labelLink"===c.type)&&!c._balanced&&(l=f,"labelLink"!==c.type)){g=2;break}}else"labelEnd"===c.type&&(u=f);return r={type:"labelLink"===e[l][1].type?"link":"image",start:d(e[l][1].start),end:d(e[e.length-1][1].end)},n={type:"label",start:d(e[l][1].start),end:d(e[u][1].end)},i={type:"labelText",start:d(e[l+g+2][1].end),end:d(e[u-2][1].start)},p=a(p=[["enter",r,t],["enter",n,t]],e.slice(l+1,l+g+3)),p=a(p,[["enter",i,t]]),p=a(p,o(t.parser.constructs.insideSpan.null,e.slice(l+g+4,u-3),t)),p=a(p,[["exit",i,t],e[u-2],e[u-1],["exit",n,t]]),p=a(p,e.slice(u+1)),p=a(p,[["exit",r,t]]),s(e,l,e.length,p),e},resolveAll:function(e){var t,r=-1;for(;++r-1?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)}},u={tokenize:function(e,t,r){var n=this;return o(e,(function(e){return a(e)||!s(n.events,"listItemPrefixWhitespace")?r(e):t(e)}),"listItemPrefixWhitespace",n.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:5)},partial:!0},p={tokenize:function(e,t,r){var n=this;return o(e,(function(e){return s(n.events,"listItemIndent")===n.containerState.size?t(e):r(e)}),"listItemIndent",n.containerState.size+1)},partial:!0};e.exports=l},2853:function(e,t,r){"use strict";var n=r(9942),a=r(915),s={tokenize:function(e,t,r){return a(e,(function(e){return null===e||n(e)?t(e):r(e)}),"linePrefix")},partial:!0};e.exports=s},7219:function(e,t,r){"use strict";var n=r(9942),a=r(4436),s=r(915),i={name:"setextUnderline",tokenize:function(e,t,r){var a,i,o=this,d=o.events.length;for(;d--;)if("lineEnding"!==o.events[d][1].type&&"linePrefix"!==o.events[d][1].type&&"content"!==o.events[d][1].type){i="paragraph"===o.events[d][1].type;break}return function(t){if(!o.lazy&&(o.interrupt||i))return e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),a=t,c(t);return r(t)};function c(t){return t===a?(e.consume(t),c):(e.exit("setextHeadingLineSequence"),s(e,l,"lineSuffix")(t))}function l(a){return null===a||n(a)?(e.exit("setextHeadingLine"),t(a)):r(a)}},resolveTo:function(e,t){var r,n,s,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){r=o;break}"paragraph"===e[o][1].type&&(n=o)}else"content"===e[o][1].type&&e.splice(o,1),s||"definition"!==e[o][1].type||(s=o);i={type:"setextHeading",start:a(e[n][1].start),end:a(e[e.length-1][1].end)},e[n][1].type="setextHeadingText",s?(e.splice(n,0,["enter",i,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end=a(e[s][1].end)):e[r][1]=i;return e.push(["exit",i,t]),e}};e.exports=i},6852:function(e,t,r){"use strict";var n=r(9942),a=r(4396),s=r(915),i={name:"thematicBreak",tokenize:function(e,t,r){var i,o=0;return function(t){return e.enter("thematicBreak"),i=t,d(t)};function d(l){return l===i?(e.enter("thematicBreakSequence"),c(l)):a(l)?s(e,d,"whitespace")(l):o<3||null!==l&&!n(l)?r(l):(e.exit("thematicBreak"),t(l))}function c(t){return t===i?(e.consume(t),o++,c):(e.exit("thematicBreakSequence"),d(t))}}};e.exports=i},5395:function(e,t,r){"use strict";var n=r(9146);e.exports=function(e,t){return e.length?(n(e,e.length,0,t),e):t}},9146:function(e,t,r){"use strict";var n=r(9120);e.exports=function(e,t,r,a){var s,i=e.length,o=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,r=r>0?r:0,a.length<1e4)(s=Array.from(a)).unshift(t,r),n.apply(e,s);else for(r&&n.apply(e,[t,r]);o-1)return h();return e.tokenize.call(t?n({},v,t):v,y,g,h)(r)}}function g(t){return e(c,l),a}function h(e){return l.restore(),++d13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||65535===(65535&r)||65534===(65535&r)||r>1114111?"\ufffd":n(r)}},2252:function(e,t,r){"use strict";var n=r(3496);e.exports=function(e){for(var t,r,a,s=-1,i=[];++s-1&&(r[0]=r[0].slice(a)),i>0&&r.push(e[s].slice(0,i))),r}},6909:function(e,t,r){"use strict";var n=r(8548),a=r(9146),s=r(4436);function i(e,t){for(var r,n,s,i,o,d,c=e[t][1],l=e[t][2],u=t-1,p=[],f=c._tokenizer||l.parser[c.contentType](c.start),g=f.events,h=[],m={};c;){for(;e[++u][1]!==c;);p.push(u),c._tokenizer||(r=l.sliceStream(c),c.next||r.push(null),n&&f.defineSkip(c.start),c.isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(r),c.isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),n=c,c=c.next}for(c=n,s=g.length;s--;)"enter"===g[s][0]?i=!0:i&&g[s][1].type===g[s-1][1].type&&g[s][1].start.line!==g[s][1].end.line&&(y(g.slice(s+1,o)),c._tokenizer=c.next=void 0,c=c.previous,o=s+1);for(f.events=c._tokenizer=c.next=void 0,y(g.slice(0,o)),s=-1,d=0;++si.length;o&&i.push(a);try{r=e.apply(null,i)}catch(d){if(o&&n)throw d;return a(d)}o||(r&&"function"===typeof r.then?r.then(s,a):r instanceof Error?a(r):s(r))};function a(){n||(n=!0,r.apply(null,arguments))}function s(e){a(null,e)}}},3621:function(e,t,r){"use strict";var n=r(6459),a=r(2589),s=r(2032),i=r(23),o=r(9483),d=r(9433);e.exports=function e(){var t,r=[],a=o(),v={},b=-1;return x.data=function(e,r){if("string"===typeof e)return 2===arguments.length?(h("data",t),v[e]=r,x):l.call(v,e)&&v[e]||null;if(e)return h("data",t),v=e,x;return v},x.freeze=R,x.attachers=r,x.use=function(e){var n;if(h("use",t),null===e||void 0===e);else if("function"===typeof e)l.apply(null,arguments);else{if("object"!==typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?d(e):a(e)}n&&(v.settings=s(v.settings||{},n));return x;function a(e){d(e.plugins),e.settings&&(n=s(n||{},e.settings))}function o(e){if("function"===typeof e)l(e);else{if("object"!==typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?l.apply(null,e):a(e)}}function d(e){var t=-1;if(null===e||void 0===e);else{if("object"!==typeof e||!("length"in e))throw new Error("Expected a list of plugins, not `"+e+"`");for(;++t-1)throw new Error("`"+t+"` cannot be a path: did not expect `"+n.sep+"`")}function l(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function u(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}d.prototype.toString=function(e){return(this.contents||"").toString(e)},Object.defineProperty(d.prototype,"path",{get:function(){return this.history[this.history.length-1]},set:function(e){l(e,"path"),this.path!==e&&this.history.push(e)}}),Object.defineProperty(d.prototype,"dirname",{get:function(){return"string"===typeof this.path?n.dirname(this.path):void 0},set:function(e){u(this.path,"dirname"),this.path=n.join(e||"",this.basename)}}),Object.defineProperty(d.prototype,"basename",{get:function(){return"string"===typeof this.path?n.basename(this.path):void 0},set:function(e){l(e,"basename"),c(e,"basename"),this.path=n.join(this.dirname||"",e)}}),Object.defineProperty(d.prototype,"extname",{get:function(){return"string"===typeof this.path?n.extname(this.path):void 0},set:function(e){if(c(e,"extname"),u(this.path,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.indexOf(".",1)>-1)throw new Error("`extname` cannot contain multiple dots")}this.path=n.join(this.dirname,this.stem+(e||""))}}),Object.defineProperty(d.prototype,"stem",{get:function(){return"string"===typeof this.path?n.basename(this.path,this.extname):void 0},set:function(e){l(e,"stem"),c(e,"stem"),this.path=n.join(this.dirname||"",e+(this.extname||""))}})},8709:function(e,t,r){"use strict";var n=r(2040),a=r(5221);e.exports=a,a.prototype.message=function(e,t,r){var a=new n(e,t,r);this.path&&(a.name=this.path+":"+a.name,a.file=this.path);return a.fatal=!1,this.messages.push(a),a},a.prototype.info=function(){var e=this.message.apply(this,arguments);return e.fatal=null,e},a.prototype.fail=function(){var e=this.message.apply(this,arguments);throw e.fatal=!0,e}},1456:function(e,t){"use strict";function r(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}t.basename=function(e,t){var n,a,s,i,o=0,d=-1;if(void 0!==t&&"string"!==typeof t)throw new TypeError('"ext" argument must be a string');if(r(e),n=e.length,void 0===t||!t.length||t.length>e.length){for(;n--;)if(47===e.charCodeAt(n)){if(s){o=n+1;break}}else d<0&&(s=!0,d=n+1);return d<0?"":e.slice(o,d)}if(t===e)return"";a=-1,i=t.length-1;for(;n--;)if(47===e.charCodeAt(n)){if(s){o=n+1;break}}else a<0&&(s=!0,a=n+1),i>-1&&(e.charCodeAt(n)===t.charCodeAt(i--)?i<0&&(d=n):(i=-1,d=a));o===d?d=a:d<0&&(d=e.length);return e.slice(o,d)},t.dirname=function(e){var t,n,a;if(r(e),!e.length)return".";t=-1,a=e.length;for(;--a;)if(47===e.charCodeAt(a)){if(n){t=a;break}}else n||(n=!0);return t<0?47===e.charCodeAt(0)?"/":".":1===t&&47===e.charCodeAt(0)?"//":e.slice(0,t)},t.extname=function(e){var t,n,a,s=-1,i=0,o=-1,d=0;r(e),a=e.length;for(;a--;)if(47!==(n=e.charCodeAt(a)))o<0&&(t=!0,o=a+1),46===n?s<0?s=a:1!==d&&(d=1):s>-1&&(d=-1);else if(t){i=a+1;break}if(s<0||o<0||0===d||1===d&&s===o-1&&s===i+1)return"";return e.slice(s,o)},t.join=function(){var e,t=-1;for(;++t2){if((n=a.lastIndexOf("/"))!==a.length-1){n<0?(a="",s=0):s=(a=a.slice(0,n)).length-1-a.lastIndexOf("/"),i=d,o=0;continue}}else if(a.length){a="",s=0,i=d,o=0;continue}t&&(a=a.length?a+"/..":"..",s=2)}else a.length?a+="/"+e.slice(i+1,d):a=e.slice(i+1,d),s=d-i-1;i=d,o=0}else 46===r&&o>-1?o++:o=-1}return a}(e,!t),n.length||t||(n=".");n.length&&47===e.charCodeAt(e.length-1)&&(n+="/");return t?"/"+n:n}(e)},t.sep="/"},2859:function(e,t){"use strict";t.cwd=function(){return"/"}},7807:function(e){"use strict";var t,r="";e.exports=function(e,n){if("string"!==typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var a=e.length*n;if(t!==e||"undefined"===typeof t)t=e,r="";else if(r.length>=a)return r.substr(0,a);for(;a>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,a)}},17:function(e,t){"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0>>1,a=e[n];if(!(0>>1;ns(d,r))cs(l,d)?(e[n]=l,e[c]=r,n=c):(e[n]=d,e[o]=r,n=o);else{if(!(cs(l,r)))break e;e[n]=l,e[c]=r,n=c}}}return t}function s(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,d=o.now();t.unstable_now=function(){return o.now()-d}}var c=[],l=[],u=1,p=null,f=3,g=!1,h=!1,m=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=n(l);null!==t;){if(null===t.callback)a(l);else{if(!(t.startTime<=e))break;a(l),t.sortIndex=t.expirationTime,r(c,t)}t=n(l)}}function R(e){if(m=!1,x(e),!h)if(null!==n(c))h=!0,D(E);else{var t=n(l);null!==t&&O(R,t.startTime-e)}}function E(e,r){h=!1,m&&(m=!1,v(S),S=-1),g=!0;var s=f;try{for(x(r),p=n(c);null!==p&&(!(p.expirationTime>r)||e&&!k());){var i=p.callback;if("function"===typeof i){p.callback=null,f=p.priorityLevel;var o=i(p.expirationTime<=r);r=t.unstable_now(),"function"===typeof o?p.callback=o:p===n(c)&&a(c),x(r)}else a(c);p=n(c)}if(null!==p)var d=!0;else{var u=n(l);null!==u&&O(R,u.startTime-r),d=!1}return d}finally{p=null,f=s,g=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var T,w=!1,j=null,S=-1,A=5,C=-1;function k(){return!(t.unstable_now()-Ce||125i?(e.sortIndex=s,r(l,e),null===n(c)&&e===n(l)&&(m?(v(S),S=-1):m=!0,O(R,s-i))):(e.sortIndex=o,r(c,e),h||g||(h=!0,D(E))),e},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(e){var t=f;return function(){var r=f;f=t;try{return e.apply(this,arguments)}finally{f=r}}}},7086:function(e,t,r){"use strict";e.exports=r(17)},730:function(e){e.exports=function(e,t,r,n){var a=r?r.call(n,e,t):void 0;if(void 0!==a)return!!a;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),d=0;de.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,d=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){d=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(d)throw i}}}},e.exports.__esModule=!0,e.exports.default=e.exports},670:function(e,t,r){var n=r(4910),a=r(4161),s=r(1173);e.exports=function(e){var t=a();return function(){var r,a=n(e);if(t){var i=n(this).constructor;r=Reflect.construct(a,arguments,i)}else r=a.apply(this,arguments);return s(this,r)}},e.exports.__esModule=!0,e.exports.default=e.exports},3231:function(e,t,r){var n=r(4040);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},1121:function(e,t,r){var n=r(9443);function a(){return"undefined"!==typeof Reflect&&Reflect.get?(e.exports=a=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=a=function(e,t,r){var a=n(e,t);if(a){var s=Object.getOwnPropertyDescriptor(a,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},e.exports.__esModule=!0,e.exports.default=e.exports),a.apply(this,arguments)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},4910:function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},8724:function(e,t,r){var n=r(6196);e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},3203:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},4346:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},4161:function(e){e.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},608:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,s,i,o=[],d=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;d=!1}else for(;!(d=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);d=!0);}catch(e){c=!0,a=e}finally{try{if(!d&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports},6894:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},624:function(e,t,r){var n=r(3231);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s},e.exports.__esModule=!0,e.exports.default=e.exports},2412:function(e){e.exports=function(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n=0||(a[r]=e[r]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},1173:function(e,t,r){var n=r(7501).default,a=r(7266);e.exports=function(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6196:function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},131:function(e,t,r){var n=r(7358),a=r(608),s=r(5068),i=r(6894);e.exports=function(e,t){return n(e)||a(e,t)||s(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},9443:function(e,t,r){var n=r(4910);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},6027:function(e,t,r){var n=r(7501).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!==n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4040:function(e,t,r){var n=r(7501).default,a=r(6027);e.exports=function(e){var t=a(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},7501:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5068:function(e,t,r){var n=r(8106);e.exports=function(e,t){if(e){if("string"===typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},9952:function(e,t,r){var n=r(4910),a=r(6196),s=r(4346),i=r(6824);function o(t){var r="function"===typeof Map?new Map:void 0;return e.exports=o=function(e){if(null===e||!s(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return i(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,o(t)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},8784:function(e,t,r){!function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!==typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}var n=Object.freeze({__proto__:null,get DEFAULT_EXTENSIONS(){return j9},get File(){return W$},get buildExternalHelpers(){return hQ},get createConfigItem(){return h7},get createConfigItemAsync(){return f7},get createConfigItemSync(){return g7},get getEnv(){return IQ},get loadOptions(){return u7},get loadOptionsAsync(){return c7},get loadOptionsSync(){return l7},get loadPartialConfig(){return i7},get loadPartialConfigAsync(){return a7},get loadPartialConfigSync(){return s7},get parse(){return R9},get parseAsync(){return T9},get parseSync(){return E9},get resolvePlugin(){return CQ},get resolvePreset(){return kQ},get template(){return YU},get tokTypes(){return aB},get transform(){return l9},get transformAsync(){return p9},get transformFile(){return f9},get transformFileAsync(){return h9},get transformFileSync(){return g9},get transformFromAst(){return y9},get transformFromAstAsync(){return b9},get transformFromAstSync(){return v9},get transformSync(){return u9},get traverse(){return GK},get types(){return mR},get version(){return w9}});function a(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,s,i,o=[],d=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;d=!1}else for(;!(d=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);d=!0);}catch(l){c=!0,a=l}finally{try{if(!d&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return o}}function s(){s=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",d=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(C){c=function(e,t,r){return e[t]=r}}function l(e,t,r,a){var s=t&&t.prototype instanceof f?t:f,i=Object.create(s.prototype),o=new S(a||[]);return n(i,"_invoke",{value:E(e,r,o)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(C){return{type:"throw",arg:C}}}e.wrap=l;var p={};function f(){}function g(){}function h(){}var m={};c(m,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(A([])));v&&v!==t&&r.call(v,i)&&(m=v);var b=h.prototype=f.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function a(n,s,i,o){var d=u(e[n],e,s);if("throw"!==d.type){var c=d.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){a("next",e,i,o)}),(function(e){a("throw",e,i,o)})):t.resolve(l).then((function(e){c.value=e,i(c)}),(function(e){return a("throw",e,i,o)}))}o(d.arg)}var s;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){a(e,r,t,n)}))}return s=s?s.then(n,n):n()}})}function E(e,t,r){var n="suspendedStart";return function(a,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw s;return{value:void 0,done:!0}}for(r.method=a,r.arg=s;;){var i=r.delegate;if(i){var o=T(i,r);if(o){if(o===p)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var d=u(e,t,r);if("normal"===d.type){if(n=r.done?"completed":"suspendedYield",d.arg===p)continue;return{value:d.arg,done:r.done}}"throw"===d.type&&(n="completed",r.method="throw",r.arg=d.arg)}}}function T(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var s=a.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function A(e){if(e||""===e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n=0;--a){var s=this.tryEntries[a],i=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var o=r.call(s,"catchLoc"),d=r.call(s,"finallyLoc");if(o&&d){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;j(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function i(e,t,r,n,a,s,i){try{var o=e[s](i),d=o.value}catch(VZ){return void r(VZ)}o.done?t(d):Promise.resolve(d).then(n,a)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var s=e.apply(t,r);function o(e){i(s,n,a,o,d,"next",e)}function d(e){i(s,n,a,o,d,"throw",e)}o(void 0)}))}}function d(e,t){for(var r=0;r=0||(a[r]=e[r]);return a}function v(e,t){if(null==e)return{};var r,n,a=y(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e,t){return t||(t=e.slice(0)),e.raw=t,e}function R(e,t){return w(e)||a(e,t)||S(e,t)||k()}function E(e){return T(e)||j(e)||S(e)||C()}function T(e){if(Array.isArray(e))return A(e)}function w(e){if(Array.isArray(e))return e}function j(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function S(e,t){if(e){if("string"===typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function I(e){var t=P(e,"string");return"symbol"===typeof t?t:String(t)}var D=["Identifier","JSXIdentifier"],O=["MemberExpression"],N=["Identifier"],F=["Statement"],L=["Expression"],M=["Scopable","Pattern"],B=null,U=null,H=["VariableDeclaration"],G=null,W=null,q=null,K=["Flow","ImportDeclaration","ExportDeclaration","ImportSpecifier"],z=["RestElement"],V=["RestElement"],Y=["ExistsTypeAnnotation"],X=["NumberLiteralTypeAnnotation"],J=["ForOfStatement"],$=Object.freeze({__proto__:null,BindingIdentifier:N,BlockScoped:U,ExistentialTypeParam:Y,Expression:L,Flow:K,ForAwaitStatement:J,Generated:W,NumericLiteralTypeAnnotation:X,Pure:q,Referenced:B,ReferencedIdentifier:D,ReferencedMemberExpression:O,RestProperty:z,Scope:M,SpreadProperty:V,Statement:F,User:G,Var:H});function Q(e,t){for(var r=0,n=Object.keys(t);ra.length)return!1;for(var i=0,o=s.length-1;i1)for(var r=1;re)return!1;if((r+=t[n+1])>=e)return!0}return!1}function qi(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&Bi.test(String.fromCharCode(e)):Wi(e,Hi)))}function Ki(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&Ui.test(String.fromCharCode(e)):Wi(e,Hi)||Wi(e,Gi))))}function zi(e){for(var t=!0,r=0;r=48&&e<=57},ao={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},so={bin:function(e){return 48===e||49===e},oct:function(e){return e>=48&&e<=55},dec:function(e){return e>=48&&e<=57},hex:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}};function io(e,t,r,n,a,s){for(var i=r,o=n,d=a,c="",l=null,u=r,p=t.length;;){if(r>=p){s.unterminated(i,o,d),c+=t.slice(u,r);break}var f=t.charCodeAt(r);if(oo(e,f,t,r)){c+=t.slice(u,r);break}if(92===f){c+=t.slice(u,r);var g=co(t,r,n,a,"template"===e,s);null!==g.ch||l?c+=g.ch:l={pos:r,lineStart:n,curLine:a},r=g.pos,n=g.lineStart,a=g.curLine,u=r}else 8232===f||8233===f?(++a,n=++r):10===f||13===f?"template"===e?(c+=t.slice(u,r)+"\n",++r,13===f&&10===t.charCodeAt(r)&&++r,++a,u=n=r):s.unterminated(i,o,d):++r}return{pos:r,str:c,firstInvalidLoc:l,lineStart:n,curLine:a,containsInvalid:!!l}}function oo(e,t,r,n){return"template"===e?96===t||36===t&&123===r.charCodeAt(n+1):t===("double"===e?34:39)}function co(e,t,r,n,a,s){var i=!a;t++;var o=function(e){return{pos:t,ch:e,lineStart:r,curLine:n}},d=e.charCodeAt(t++);switch(d){case 110:return o("\n");case 114:return o("\r");case 120:var c,l=lo(e,t,r,n,2,!1,i,s);return c=l.code,t=l.pos,o(null===c?null:String.fromCharCode(c));case 117:var u,p=po(e,t,r,n,i,s);return u=p.code,t=p.pos,o(null===u?null:String.fromCodePoint(u));case 116:return o("\t");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:10===e.charCodeAt(t)&&++t;case 10:r=t,++n;case 8232:case 8233:return o("");case 56:case 57:if(a)return o(null);s.strictNumericEscape(t-1,r,n);default:if(d>=48&&d<=55){var f=t-1,g=e.slice(f,t+2).match(/^[0-7]+/)[0],h=parseInt(g,8);h>255&&(g=g.slice(0,-1),h=parseInt(g,8)),t+=g.length-1;var m=e.charCodeAt(t);if("0"!==g||56===m||57===m){if(a)return o(null);s.strictNumericEscape(f,r,n)}return o(String.fromCharCode(h))}return o(String.fromCharCode(d))}}function lo(e,t,r,n,a,s,i,o){var d,c=t,l=uo(e,t,r,n,16,a,s,!1,o,!i);return d=l.n,t=l.pos,null===d&&(i?o.invalidEscapeSequence(c,r,n):t=c-1),{code:d,pos:t}}function uo(e,t,r,n,a,s,i,o,d,c){for(var l=t,u=16===a?ao.hex:ao.decBinOct,p=16===a?so.hex:10===a?so.dec:8===a?so.oct:so.bin,f=!1,g=0,h=0,m=null==s?1/0:s;h=97?y-97+10:y>=65?y-65+10:no(y)?y-48:1/0)>=a){if(v<=9&&c)return{n:null,pos:t};if(v<=9&&d.invalidDigit(t,r,n,a))v=0;else{if(!i)break;v=0,f=!0}}++t,g=g*a+v}else{var b=e.charCodeAt(t-1),x=e.charCodeAt(t+1);if(o){if(Number.isNaN(x)||!p(x)||u.has(b)||u.has(x)){if(c)return{n:null,pos:t};d.unexpectedNumericSeparator(t,r,n)}}else{if(c)return{n:null,pos:t};d.numericSeparatorInEscapeSequence(t,r,n)}++t}}return t===l||null!=s&&t-l!==s||f?{n:null,pos:t}:{n:g,pos:t}}function po(e,t,r,n,a,s){var i;if(123===e.charCodeAt(t)){var o=lo(e,++t,r,n,e.indexOf("}",t)-t,!0,a,s);if(i=o.code,t=o.pos,++t,null!==i&&i>1114111){if(!a)return{code:null,pos:t};s.invalidCodePoint(t,r,n)}}else{var d=lo(e,t,r,n,4,!1,a,s);i=d.code,t=d.pos}return{code:i,pos:t}}var fo=["consequent","body","alternate"],go=["body","expressions"],ho=["left","init"],mo=["leadingComments","trailingComments","innerComments"],yo=["||","&&","??"],vo=["++","--"],bo=[">","<",">=","<="],xo=["==","===","!=","!=="],Ro=[].concat(xo,["in","instanceof"]),Eo=[].concat(E(Ro),bo),To=["-","/","%","*","**","&","|",">>",">>>","<<","^"],wo=["+"].concat(To,E(Eo),["|>"]),jo=["=","+="].concat(E(To.map((function(e){return e+"="}))),E(yo.map((function(e){return e+"="})))),So=["delete","!"],Ao=["+","-","~"],Co=["typeof"],ko=["void","throw"].concat(So,Ao,Co),_o={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]},Po=Symbol.for("var used to be block scoped"),Io=Symbol.for("should not be considered a local binding"),Do={},Oo={},No={},Fo={},Lo={},Mo={},Bo={};function Uo(e){return Array.isArray(e)?"array":null===e?"null":typeof e}function Ho(e){return{validate:e}}function Go(e){return"string"===typeof e?$o(e):$o.apply(void 0,E(e))}function Wo(e){return Ho(Go(e))}function qo(e){return{validate:e,optional:!0}}function Ko(e){return{validate:Go(e),optional:!0}}function zo(e){return rd(Zo("array"),Xo(e))}function Vo(e){return zo(Go(e))}function Yo(e){return Ho(Vo(e))}function Xo(e){function t(t,r,n){if(Array.isArray(n))for(var a=0;a=2&&"type"in t[0]&&"array"===t[0].type&&!("each"in t[1]))throw new Error('An assertValueType("array") validator can only be followed by an assertEach(...) validator.');return n}var nd=["aliases","builder","deprecatedAlias","fields","inherits","visitor","validate"],ad=["default","optional","deprecated","validate"],sd={};function id(){for(var e=arguments.length,t=new Array(e),r=0;r0:d&&"object"===typeof d)throw new Error("field defaults can only be primitives or empty arrays currently");n[i]={default:Array.isArray(d)?[]:d,optional:o.optional,deprecated:o.deprecated,validate:o.validate}}for(var c=t.visitor||r.visitor||[],l=t.aliases||r.aliases||[],u=t.builder||r.builder||t.visitor||[],p=0,f=Object.keys(t);p+s+1)throw new TypeError("RestElement must be last element of "+a)}}}),dd("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:$o("Expression"),optional:!0}}}),dd("SequenceExpression",{visitor:["expressions"],fields:{expressions:{validate:rd(Zo("array"),Xo($o("Expression")))}},aliases:["Expression"]}),dd("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:$o("Expression")}}}),dd("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:$o("Expression"),optional:!0},consequent:{validate:rd(Zo("array"),Xo($o("Statement")))}}}),dd("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:$o("Expression")},cases:{validate:rd(Zo("array"),Xo($o("SwitchCase")))}}}),dd("ThisExpression",{aliases:["Expression"]}),dd("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:$o("Expression")}}}),dd("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{block:{validate:rd($o("BlockStatement"),Object.assign((function(e){if(Ci.env.BABEL_TYPES_8_BREAKING&&!e.handler&&!e.finalizer)throw new TypeError("TryStatement expects either a handler or finalizer, or both")}),{oneOfNodeTypes:["BlockStatement"]}))},handler:{optional:!0,validate:$o("CatchClause")},finalizer:{optional:!0,validate:$o("BlockStatement")}}}),dd("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:$o("Expression")},operator:{validate:Jo.apply(void 0,E(ko))}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),dd("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:Ci.env.BABEL_TYPES_8_BREAKING?$o("Identifier","MemberExpression"):$o("Expression")},operator:{validate:Jo.apply(void 0,E(vo))}},visitor:["argument"],aliases:["Expression"]}),dd("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{declare:{validate:Zo("boolean"),optional:!0},kind:{validate:Jo("var","let","const","using","await using")},declarations:{validate:rd(Zo("array"),Xo($o("VariableDeclarator")))}},validate:function(e,t,r){if(Ci.env.BABEL_TYPES_8_BREAKING&&Fi("ForXStatement",e,{left:r})&&1!==r.declarations.length)throw new TypeError("Exactly one VariableDeclarator is required in the VariableDeclaration of a "+e.type)}}),dd("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:function(){if(!Ci.env.BABEL_TYPES_8_BREAKING)return $o("LVal");var e=$o("Identifier","ArrayPattern","ObjectPattern"),t=$o("Identifier");return function(r,n,a){(r.init?e:t)(r,n,a)}}()},definite:{optional:!0,validate:Zo("boolean")},init:{optional:!0,validate:$o("Expression")}}}),dd("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:$o("Expression")},body:{validate:$o("Statement")}}}),dd("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{validate:$o("Expression")},body:{validate:$o("Statement")}}}),dd("AssignmentPattern",{visitor:["left","right","decorators"],builder:["left","right"],aliases:["Pattern","PatternLike","LVal"],fields:Object.assign({},pd(),{left:{validate:$o("Identifier","ObjectPattern","ArrayPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression")},right:{validate:$o("Expression")},decorators:{validate:rd(Zo("array"),Xo($o("Decorator"))),optional:!0}})}),dd("ArrayPattern",{visitor:["elements","typeAnnotation"],builder:["elements"],aliases:["Pattern","PatternLike","LVal"],fields:Object.assign({},pd(),{elements:{validate:rd(Zo("array"),Xo(Qo("null","PatternLike","LVal")))}})}),dd("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["params","body","returnType","typeParameters"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},cd(),ld(),{expression:{validate:Zo("boolean")},body:{validate:$o("BlockStatement","Expression")},predicate:{validate:$o("DeclaredPredicate","InferredPredicate"),optional:!0}})}),dd("ClassBody",{visitor:["body"],fields:{body:{validate:rd(Zo("array"),Xo($o("ClassMethod","ClassPrivateMethod","ClassProperty","ClassPrivateProperty","ClassAccessorProperty","TSDeclareMethod","TSIndexSignature","StaticBlock")))}}}),dd("ClassExpression",{builder:["id","superClass","body","decorators"],visitor:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],aliases:["Scopable","Class","Expression"],fields:{id:{validate:$o("Identifier"),optional:!0},typeParameters:{validate:$o("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:$o("ClassBody")},superClass:{optional:!0,validate:$o("Expression")},superTypeParameters:{validate:$o("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:rd(Zo("array"),Xo($o("TSExpressionWithTypeArguments","ClassImplements"))),optional:!0},decorators:{validate:rd(Zo("array"),Xo($o("Decorator"))),optional:!0},mixins:{validate:$o("InterfaceExtends"),optional:!0}}}),dd("ClassDeclaration",{inherits:"ClassExpression",aliases:["Scopable","Class","Statement","Declaration"],fields:{id:{validate:$o("Identifier"),optional:!0},typeParameters:{validate:$o("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:$o("ClassBody")},superClass:{optional:!0,validate:$o("Expression")},superTypeParameters:{validate:$o("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:rd(Zo("array"),Xo($o("TSExpressionWithTypeArguments","ClassImplements"))),optional:!0},decorators:{validate:rd(Zo("array"),Xo($o("Decorator"))),optional:!0},mixins:{validate:$o("InterfaceExtends"),optional:!0},declare:{validate:Zo("boolean"),optional:!0},abstract:{validate:Zo("boolean"),optional:!0}},validate:function(){var e=$o("Identifier");return function(t,r,n){Ci.env.BABEL_TYPES_8_BREAKING&&(Fi("ExportDefaultDeclaration",t)||e(n,"id",n.id))}}()}),dd("ExportAllDeclaration",{builder:["source"],visitor:["source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{source:{validate:$o("StringLiteral")},exportKind:qo(Jo("type","value")),attributes:{optional:!0,validate:rd(Zo("array"),Xo($o("ImportAttribute")))},assertions:{optional:!0,validate:rd(Zo("array"),Xo($o("ImportAttribute")))}}}),dd("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{declaration:{validate:$o("TSDeclareFunction","FunctionDeclaration","ClassDeclaration","Expression")},exportKind:qo(Jo("value"))}}),dd("ExportNamedDeclaration",{builder:["declaration","specifiers","source"],visitor:["declaration","specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{declaration:{optional:!0,validate:rd($o("Declaration"),Object.assign((function(e,t,r){if(Ci.env.BABEL_TYPES_8_BREAKING&&r&&e.specifiers.length)throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration")}),{oneOfNodeTypes:["Declaration"]}),(function(e,t,r){if(Ci.env.BABEL_TYPES_8_BREAKING&&r&&e.source)throw new TypeError("Cannot export a declaration from a source")}))},attributes:{optional:!0,validate:rd(Zo("array"),Xo($o("ImportAttribute")))},assertions:{optional:!0,validate:rd(Zo("array"),Xo($o("ImportAttribute")))},specifiers:{default:[],validate:rd(Zo("array"),Xo(function(){var e=$o("ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"),t=$o("ExportSpecifier");return Ci.env.BABEL_TYPES_8_BREAKING?function(r,n,a){(r.source?e:t)(r,n,a)}:e}()))},source:{validate:$o("StringLiteral"),optional:!0},exportKind:qo(Jo("type","value"))}}),dd("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:$o("Identifier")},exported:{validate:$o("Identifier","StringLiteral")},exportKind:{validate:Jo("type","value"),optional:!0}}}),dd("ForOfStatement",{visitor:["left","right","body"],builder:["left","right","body","await"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:function(){if(!Ci.env.BABEL_TYPES_8_BREAKING)return $o("VariableDeclaration","LVal");var e=$o("VariableDeclaration"),t=$o("Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression");return function(r,n,a){Fi("VariableDeclaration",a)?e(r,n,a):t(r,n,a)}}()},right:{validate:$o("Expression")},body:{validate:$o("Statement")},await:{default:!1}}}),dd("ImportDeclaration",{builder:["specifiers","source"],visitor:["specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration"],fields:{attributes:{optional:!0,validate:rd(Zo("array"),Xo($o("ImportAttribute")))},assertions:{optional:!0,validate:rd(Zo("array"),Xo($o("ImportAttribute")))},module:{optional:!0,validate:Zo("boolean")},specifiers:{validate:rd(Zo("array"),Xo($o("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier")))},source:{validate:$o("StringLiteral")},importKind:{validate:Jo("type","typeof","value"),optional:!0}}}),dd("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:$o("Identifier")}}}),dd("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:$o("Identifier")}}}),dd("ImportSpecifier",{visitor:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:$o("Identifier")},imported:{validate:$o("Identifier","StringLiteral")},importKind:{validate:Jo("type","typeof","value"),optional:!0}}}),dd("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:rd($o("Identifier"),Object.assign((function(e,t,r){if(Ci.env.BABEL_TYPES_8_BREAKING){var n;switch(r.name){case"function":n="sent";break;case"new":n="target";break;case"import":n="meta"}if(!Fi("Identifier",e.property,{name:n}))throw new TypeError("Unrecognised MetaProperty")}}),{oneOfNodeTypes:["Identifier"]}))},property:{validate:$o("Identifier")}}});var fd=function(){return{abstract:{validate:Zo("boolean"),optional:!0},accessibility:{validate:Jo("public","private","protected"),optional:!0},static:{default:!1},override:{default:!1},computed:{default:!1},optional:{validate:Zo("boolean"),optional:!0},key:{validate:rd(function(){var e=$o("Identifier","StringLiteral","NumericLiteral"),t=$o("Expression");return function(r,n,a){(r.computed?t:e)(r,n,a)}}(),$o("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression"))}}},gd=function(){return Object.assign({},cd(),fd(),{params:{validate:rd(Zo("array"),Xo($o("Identifier","Pattern","RestElement","TSParameterProperty")))},kind:{validate:Jo("get","set","method","constructor"),default:"method"},access:{validate:rd(Zo("string"),Jo("public","private","protected")),optional:!0},decorators:{validate:rd(Zo("array"),Xo($o("Decorator"))),optional:!0}})};dd("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static","generator","async"],visitor:["key","params","body","decorators","returnType","typeParameters"],fields:Object.assign({},gd(),ld(),{body:{validate:$o("BlockStatement")}})}),dd("ObjectPattern",{visitor:["properties","typeAnnotation","decorators"],builder:["properties"],aliases:["Pattern","PatternLike","LVal"],fields:Object.assign({},pd(),{properties:{validate:rd(Zo("array"),Xo($o("RestElement","ObjectProperty")))}})}),dd("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],deprecatedAlias:"SpreadProperty",fields:{argument:{validate:$o("Expression")}}}),dd("Super",{aliases:["Expression"]}),dd("TaggedTemplateExpression",{visitor:["tag","quasi","typeParameters"],builder:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:$o("Expression")},quasi:{validate:$o("TemplateLiteral")},typeParameters:{validate:$o("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}}),dd("TemplateElement",{builder:["value","tail"],fields:{value:{validate:rd(ed({raw:{validate:Zo("string")},cooked:{validate:Zo("string"),optional:!0}}),(function(e){var t=e.value.raw,r=!1,n=function(){throw new Error("Internal @babel/types error.")},a=io("template",t,0,0,0,{unterminated:function(){r=!0},strictNumericEscape:n,invalidEscapeSequence:n,numericSeparatorInEscapeSequence:n,unexpectedNumericSeparator:n,invalidDigit:n,invalidCodePoint:n}),s=a.str,i=a.firstInvalidLoc;if(!r)throw new Error("Invalid raw");e.value.cooked=i?null:s}))},tail:{default:!1}}}),dd("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:{validate:rd(Zo("array"),Xo($o("TemplateElement")))},expressions:{validate:rd(Zo("array"),Xo($o("Expression","TSType")),(function(e,t,r){if(e.quasis.length!==r.length+1)throw new TypeError("Number of "+e.type+" quasis should be exactly one more than the number of expressions.\nExpected "+(r.length+1)+" quasis but got "+e.quasis.length)}))}}}),dd("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:rd(Zo("boolean"),Object.assign((function(e,t,r){if(Ci.env.BABEL_TYPES_8_BREAKING&&r&&!e.argument)throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument")}),{type:"boolean"})),default:!1},argument:{optional:!0,validate:$o("Expression")}}}),dd("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:$o("Expression")}}}),dd("Import",{aliases:["Expression"]}),dd("BigIntLiteral",{builder:["value"],fields:{value:{validate:Zo("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),dd("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:$o("Identifier")}}}),dd("OptionalMemberExpression",{builder:["object","property","computed","optional"],visitor:["object","property"],aliases:["Expression"],fields:{object:{validate:$o("Expression")},property:{validate:function(){var e=$o("Identifier"),t=$o("Expression"),r=Object.assign((function(r,n,a){(r.computed?t:e)(r,n,a)}),{oneOfNodeTypes:["Expression","Identifier"]});return r}()},computed:{default:!1},optional:{validate:Ci.env.BABEL_TYPES_8_BREAKING?rd(Zo("boolean"),td()):Zo("boolean")}}}),dd("OptionalCallExpression",{visitor:["callee","arguments","typeParameters","typeArguments"],builder:["callee","arguments","optional"],aliases:["Expression"],fields:{callee:{validate:$o("Expression")},arguments:{validate:rd(Zo("array"),Xo($o("Expression","SpreadElement","JSXNamespacedName","ArgumentPlaceholder")))},optional:{validate:Ci.env.BABEL_TYPES_8_BREAKING?rd(Zo("boolean"),td()):Zo("boolean")},typeArguments:{validate:$o("TypeParameterInstantiation"),optional:!0},typeParameters:{validate:$o("TSTypeParameterInstantiation"),optional:!0}}}),dd("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property"],fields:Object.assign({},fd(),{value:{validate:$o("Expression"),optional:!0},definite:{validate:Zo("boolean"),optional:!0},typeAnnotation:{validate:$o("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:rd(Zo("array"),Xo($o("Decorator"))),optional:!0},readonly:{validate:Zo("boolean"),optional:!0},declare:{validate:Zo("boolean"),optional:!0},variance:{validate:$o("Variance"),optional:!0}})}),dd("ClassAccessorProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property","Accessor"],fields:Object.assign({},fd(),{key:{validate:rd(function(){var e=$o("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","PrivateName"),t=$o("Expression");return function(r,n,a){(r.computed?t:e)(r,n,a)}}(),$o("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression","PrivateName"))},value:{validate:$o("Expression"),optional:!0},definite:{validate:Zo("boolean"),optional:!0},typeAnnotation:{validate:$o("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:rd(Zo("array"),Xo($o("Decorator"))),optional:!0},readonly:{validate:Zo("boolean"),optional:!0},declare:{validate:Zo("boolean"),optional:!0},variance:{validate:$o("Variance"),optional:!0}})}),dd("ClassPrivateProperty",{visitor:["key","value","decorators","typeAnnotation"],builder:["key","value","decorators","static"],aliases:["Property","Private"],fields:{key:{validate:$o("PrivateName")},value:{validate:$o("Expression"),optional:!0},typeAnnotation:{validate:$o("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:rd(Zo("array"),Xo($o("Decorator"))),optional:!0},static:{validate:Zo("boolean"),default:!1},readonly:{validate:Zo("boolean"),optional:!0},definite:{validate:Zo("boolean"),optional:!0},variance:{validate:$o("Variance"),optional:!0}}}),dd("ClassPrivateMethod",{builder:["kind","key","params","body","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["Function","Scopable","BlockParent","FunctionParent","Method","Private"],fields:Object.assign({},gd(),ld(),{kind:{validate:Jo("get","set","method"),default:"method"},key:{validate:$o("PrivateName")},body:{validate:$o("BlockStatement")}})}),dd("PrivateName",{visitor:["id"],aliases:["Private"],fields:{id:{validate:$o("Identifier")}}}),dd("StaticBlock",{visitor:["body"],fields:{body:{validate:rd(Zo("array"),Xo($o("Statement")))}},aliases:["Scopable","BlockParent","FunctionParent"]});var hd=id("Flow"),md=function(e){var t="DeclareClass"===e;hd(e,{builder:["id","typeParameters","extends","body"],visitor:["id","typeParameters","extends"].concat(E(t?["mixins","implements"]:[]),["body"]),aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({id:Wo("Identifier"),typeParameters:Ko("TypeParameterDeclaration"),extends:qo(Vo("InterfaceExtends"))},t?{mixins:qo(Vo("InterfaceExtends")),implements:qo(Vo("ClassImplements"))}:{},{body:Wo("ObjectTypeAnnotation")})})};hd("AnyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["FlowType"],fields:{elementType:Wo("FlowType")}}),hd("BooleanTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("BooleanLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:Ho(Zo("boolean"))}}),hd("NullLiteralTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("ClassImplements",{visitor:["id","typeParameters"],fields:{id:Wo("Identifier"),typeParameters:Ko("TypeParameterInstantiation")}}),md("DeclareClass"),hd("DeclareFunction",{visitor:["id"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:Wo("Identifier"),predicate:Ko("DeclaredPredicate")}}),md("DeclareInterface"),hd("DeclareModule",{builder:["id","body","kind"],visitor:["id","body"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:Wo(["Identifier","StringLiteral"]),body:Wo("BlockStatement"),kind:qo(Jo("CommonJS","ES"))}}),hd("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{typeAnnotation:Wo("TypeAnnotation")}}),hd("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:Wo("Identifier"),typeParameters:Ko("TypeParameterDeclaration"),right:Wo("FlowType")}}),hd("DeclareOpaqueType",{visitor:["id","typeParameters","supertype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:Wo("Identifier"),typeParameters:Ko("TypeParameterDeclaration"),supertype:Ko("FlowType"),impltype:Ko("FlowType")}}),hd("DeclareVariable",{visitor:["id"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:Wo("Identifier")}}),hd("DeclareExportDeclaration",{visitor:["declaration","specifiers","source"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{declaration:Ko("Flow"),specifiers:qo(Vo(["ExportSpecifier","ExportNamespaceSpecifier"])),source:Ko("StringLiteral"),default:qo(Zo("boolean"))}}),hd("DeclareExportAllDeclaration",{visitor:["source"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{source:Wo("StringLiteral"),exportKind:qo(Jo("type","value"))}}),hd("DeclaredPredicate",{visitor:["value"],aliases:["FlowPredicate"],fields:{value:Wo("Flow")}}),hd("ExistsTypeAnnotation",{aliases:["FlowType"]}),hd("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["FlowType"],fields:{typeParameters:Ko("TypeParameterDeclaration"),params:Ho(Vo("FunctionTypeParam")),rest:Ko("FunctionTypeParam"),this:Ko("FunctionTypeParam"),returnType:Wo("FlowType")}}),hd("FunctionTypeParam",{visitor:["name","typeAnnotation"],fields:{name:Ko("Identifier"),typeAnnotation:Wo("FlowType"),optional:qo(Zo("boolean"))}}),hd("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["FlowType"],fields:{id:Wo(["Identifier","QualifiedTypeIdentifier"]),typeParameters:Ko("TypeParameterInstantiation")}}),hd("InferredPredicate",{aliases:["FlowPredicate"]}),hd("InterfaceExtends",{visitor:["id","typeParameters"],fields:{id:Wo(["Identifier","QualifiedTypeIdentifier"]),typeParameters:Ko("TypeParameterInstantiation")}}),md("InterfaceDeclaration"),hd("InterfaceTypeAnnotation",{visitor:["extends","body"],aliases:["FlowType"],fields:{extends:qo(Vo("InterfaceExtends")),body:Wo("ObjectTypeAnnotation")}}),hd("IntersectionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:Ho(Vo("FlowType"))}}),hd("MixedTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("EmptyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["FlowType"],fields:{typeAnnotation:Wo("FlowType")}}),hd("NumberLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:Ho(Zo("number"))}}),hd("NumberTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties","internalSlots"],aliases:["FlowType"],builder:["properties","indexers","callProperties","internalSlots","exact"],fields:{properties:Ho(Vo(["ObjectTypeProperty","ObjectTypeSpreadProperty"])),indexers:{validate:Vo("ObjectTypeIndexer"),optional:!0,default:[]},callProperties:{validate:Vo("ObjectTypeCallProperty"),optional:!0,default:[]},internalSlots:{validate:Vo("ObjectTypeInternalSlot"),optional:!0,default:[]},exact:{validate:Zo("boolean"),default:!1},inexact:qo(Zo("boolean"))}}),hd("ObjectTypeInternalSlot",{visitor:["id","value","optional","static","method"],aliases:["UserWhitespacable"],fields:{id:Wo("Identifier"),value:Wo("FlowType"),optional:Ho(Zo("boolean")),static:Ho(Zo("boolean")),method:Ho(Zo("boolean"))}}),hd("ObjectTypeCallProperty",{visitor:["value"],aliases:["UserWhitespacable"],fields:{value:Wo("FlowType"),static:Ho(Zo("boolean"))}}),hd("ObjectTypeIndexer",{visitor:["id","key","value","variance"],aliases:["UserWhitespacable"],fields:{id:Ko("Identifier"),key:Wo("FlowType"),value:Wo("FlowType"),static:Ho(Zo("boolean")),variance:Ko("Variance")}}),hd("ObjectTypeProperty",{visitor:["key","value","variance"],aliases:["UserWhitespacable"],fields:{key:Wo(["Identifier","StringLiteral"]),value:Wo("FlowType"),kind:Ho(Jo("init","get","set")),static:Ho(Zo("boolean")),proto:Ho(Zo("boolean")),optional:Ho(Zo("boolean")),variance:Ko("Variance"),method:Ho(Zo("boolean"))}}),hd("ObjectTypeSpreadProperty",{visitor:["argument"],aliases:["UserWhitespacable"],fields:{argument:Wo("FlowType")}}),hd("OpaqueType",{visitor:["id","typeParameters","supertype","impltype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:Wo("Identifier"),typeParameters:Ko("TypeParameterDeclaration"),supertype:Ko("FlowType"),impltype:Wo("FlowType")}}),hd("QualifiedTypeIdentifier",{visitor:["id","qualification"],fields:{id:Wo("Identifier"),qualification:Wo(["Identifier","QualifiedTypeIdentifier"])}}),hd("StringLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:Ho(Zo("string"))}}),hd("StringTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("SymbolTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("ThisTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("TupleTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:Ho(Vo("FlowType"))}}),hd("TypeofTypeAnnotation",{visitor:["argument"],aliases:["FlowType"],fields:{argument:Wo("FlowType")}}),hd("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:Wo("Identifier"),typeParameters:Ko("TypeParameterDeclaration"),right:Wo("FlowType")}}),hd("TypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:Wo("FlowType")}}),hd("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["ExpressionWrapper","Expression"],fields:{expression:Wo("Expression"),typeAnnotation:Wo("TypeAnnotation")}}),hd("TypeParameter",{visitor:["bound","default","variance"],fields:{name:Ho(Zo("string")),bound:Ko("TypeAnnotation"),default:Ko("FlowType"),variance:Ko("Variance")}}),hd("TypeParameterDeclaration",{visitor:["params"],fields:{params:Ho(Vo("TypeParameter"))}}),hd("TypeParameterInstantiation",{visitor:["params"],fields:{params:Ho(Vo("FlowType"))}}),hd("UnionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:Ho(Vo("FlowType"))}}),hd("Variance",{builder:["kind"],fields:{kind:Ho(Jo("minus","plus"))}}),hd("VoidTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]}),hd("EnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:{id:Wo("Identifier"),body:Wo(["EnumBooleanBody","EnumNumberBody","EnumStringBody","EnumSymbolBody"])}}),hd("EnumBooleanBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:Ho(Zo("boolean")),members:Yo("EnumBooleanMember"),hasUnknownMembers:Ho(Zo("boolean"))}}),hd("EnumNumberBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:Ho(Zo("boolean")),members:Yo("EnumNumberMember"),hasUnknownMembers:Ho(Zo("boolean"))}}),hd("EnumStringBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:Ho(Zo("boolean")),members:Yo(["EnumStringMember","EnumDefaultedMember"]),hasUnknownMembers:Ho(Zo("boolean"))}}),hd("EnumSymbolBody",{aliases:["EnumBody"],visitor:["members"],fields:{members:Yo("EnumDefaultedMember"),hasUnknownMembers:Ho(Zo("boolean"))}}),hd("EnumBooleanMember",{aliases:["EnumMember"],visitor:["id"],fields:{id:Wo("Identifier"),init:Wo("BooleanLiteral")}}),hd("EnumNumberMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:Wo("Identifier"),init:Wo("NumericLiteral")}}),hd("EnumStringMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:Wo("Identifier"),init:Wo("StringLiteral")}}),hd("EnumDefaultedMember",{aliases:["EnumMember"],visitor:["id"],fields:{id:Wo("Identifier")}}),hd("IndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:Wo("FlowType"),indexType:Wo("FlowType")}}),hd("OptionalIndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:Wo("FlowType"),indexType:Wo("FlowType"),optional:Ho(Zo("boolean"))}});var yd=id("JSX");yd("JSXAttribute",{visitor:["name","value"],aliases:["Immutable"],fields:{name:{validate:$o("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:$o("JSXElement","JSXFragment","StringLiteral","JSXExpressionContainer")}}}),yd("JSXClosingElement",{visitor:["name"],aliases:["Immutable"],fields:{name:{validate:$o("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")}}}),yd("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["Immutable","Expression"],fields:Object.assign({openingElement:{validate:$o("JSXOpeningElement")},closingElement:{optional:!0,validate:$o("JSXClosingElement")},children:{validate:rd(Zo("array"),Xo($o("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")))}},{selfClosing:{validate:Zo("boolean"),optional:!0}})}),yd("JSXEmptyExpression",{}),yd("JSXExpressionContainer",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:$o("Expression","JSXEmptyExpression")}}}),yd("JSXSpreadChild",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:$o("Expression")}}}),yd("JSXIdentifier",{builder:["name"],fields:{name:{validate:Zo("string")}}}),yd("JSXMemberExpression",{visitor:["object","property"],fields:{object:{validate:$o("JSXMemberExpression","JSXIdentifier")},property:{validate:$o("JSXIdentifier")}}}),yd("JSXNamespacedName",{visitor:["namespace","name"],fields:{namespace:{validate:$o("JSXIdentifier")},name:{validate:$o("JSXIdentifier")}}}),yd("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["Immutable"],fields:{name:{validate:$o("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")},selfClosing:{default:!1},attributes:{validate:rd(Zo("array"),Xo($o("JSXAttribute","JSXSpreadAttribute")))},typeParameters:{validate:$o("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}}),yd("JSXSpreadAttribute",{visitor:["argument"],fields:{argument:{validate:$o("Expression")}}}),yd("JSXText",{aliases:["Immutable"],builder:["value"],fields:{value:{validate:Zo("string")}}}),yd("JSXFragment",{builder:["openingFragment","closingFragment","children"],visitor:["openingFragment","children","closingFragment"],aliases:["Immutable","Expression"],fields:{openingFragment:{validate:$o("JSXOpeningFragment")},closingFragment:{validate:$o("JSXClosingFragment")},children:{validate:rd(Zo("array"),Xo($o("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")))}}}),yd("JSXOpeningFragment",{aliases:["Immutable"]}),yd("JSXClosingFragment",{aliases:["Immutable"]});for(var vd=["Identifier","StringLiteral","Expression","Statement","Declaration","BlockStatement","ClassBody","Pattern"],bd={Declaration:["Statement"],Pattern:["PatternLike","LVal"]},xd=0,Rd=vd;xd=0)){if(Nt(o))return[o];if(bs(o))n.set(o.type,o);else if(Ir(o))a.has(o.types)||(t.push.apply(t,E(o.types)),a.add(o.types));else if(tr(o)){var d=pb(o.id);if(r.has(d)){var c,l=r.get(d);l.typeParameters?o.typeParameters&&((c=l.typeParameters.params).push.apply(c,E(o.typeParameters.params)),l.typeParameters.params=fb(l.typeParameters.params)):l=o.typeParameters}else r.set(d,o)}else s.push(o)}}for(var u,p=_(n);!(u=p()).done;){var f=R(u.value,2)[1];s.push(f)}for(var g,h=_(r);!(g=h()).done;){var m=R(g.value,2)[1];s.push(m)}return s}function gb(e){var t=fb(e);return 1===t.length?t[0]:bu(t)}function hb(e){return Te(e)?e.name:e.right.name+"."+hb(e.left)}function mb(e){for(var t=Array.from(e),r=new Map,n=new Map,a=new Set,s=[],i=0;i=0)){if(On(o))return[o];if(ks(o))n.set(o.type,o);else if(sa(o))a.has(o.types)||(t.push.apply(t,E(o.types)),a.add(o.types));else if(Jn(o)&&o.typeParameters){var d=hb(o.typeName);if(r.has(d)){var c,l=r.get(d);l.typeParameters?o.typeParameters&&((c=l.typeParameters.params).push.apply(c,E(o.typeParameters.params)),l.typeParameters.params=mb(l.typeParameters.params)):l=o.typeParameters}else r.set(d,o)}else s.push(o)}}for(var u,p=_(n);!(u=p()).done;){var f=R(u.value,2)[1];s.push(f)}for(var g,h=_(r);!(g=h()).done;){var m=R(g.value,2)[1];s.push(m)}return s}function yb(e){var t=e.map((function(e){return Ia(e)?e.typeAnnotation:e})),r=mb(t);return 1===r.length?r[0]:Kp(r)}var vb=Function.call.bind(Object.prototype.hasOwnProperty);function bb(e,t,r,n){return e&&"string"===typeof e.type?Eb(e,t,r,n):e}function xb(e,t,r,n){return Array.isArray(e)?e.map((function(e){return bb(e,t,r,n)})):bb(e,t,r,n)}function Rb(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!1),Eb(e,t,r,new Map)}function Eb(e,t,r,n){if(void 0===t&&(t=!0),void 0===r&&(r=!1),!e)return e;var a=e.type,s={type:e.type};if(Te(e))s.name=e.name,vb(e,"optional")&&"boolean"===typeof e.optional&&(s.optional=e.optional),vb(e,"typeAnnotation")&&(s.typeAnnotation=t?xb(e.typeAnnotation,!0,r,n):e.typeAnnotation);else{if(!vb(Fo,a))throw new Error('Unknown node type: "'+a+'"');for(var i=0,o=Object.keys(Fo[a]);i=Number.MAX_SAFE_INTEGER?Wx.uid=0:Wx.uid++},qx.keys={DeclareClass:["id"],DeclareFunction:["id"],DeclareModule:["id"],DeclareVariable:["id"],DeclareInterface:["id"],DeclareTypeAlias:["id"],DeclareOpaqueType:["id"],InterfaceDeclaration:["id"],TypeAlias:["id"],OpaqueType:["id"],CatchClause:["param"],LabeledStatement:["label"],UnaryExpression:["argument"],AssignmentExpression:["left"],ImportSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDefaultSpecifier:["local"],ImportDeclaration:["specifiers"],ExportSpecifier:["exported"],ExportNamespaceSpecifier:["exported"],ExportDefaultSpecifier:["exported"],FunctionDeclaration:["id","params"],FunctionExpression:["id","params"],ArrowFunctionExpression:["params"],ObjectMethod:["params"],ClassMethod:["params"],ClassPrivateMethod:["params"],ForInStatement:["left"],ForOfStatement:["left"],ClassDeclaration:["id"],ClassExpression:["id"],RestElement:["argument"],UpdateExpression:["argument"],ObjectProperty:["value"],AssignmentPattern:["left"],ArrayPattern:["elements"],ObjectPattern:["properties"],VariableDeclaration:["declarations"],VariableDeclarator:["id"]};var Yx=Function.call.bind(Object.prototype.toString);function Xx(e){return"[object RegExp]"===Yx(e)}function Jx(e){if("object"!==typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function $x(e){if(void 0===e)return lc("undefined");if(!0===e||!1===e)return mc(e);if(null===e)return hc();if("string"===typeof e)return fc(e);var t;if("number"===typeof e)return t=Number.isFinite(e)?gc(Math.abs(e)):Kd("/",Number.isNaN(e)?gc(0):gc(1),gc(0)),(e<0||Object.is(e,-0))&&(t=Oc("-",t)),t;if(Xx(e))return yc(e.source,e.toString().match(/\/([a-z]+|)$/)[1]);if(Array.isArray(e))return Wd(e.map($x));if(Jx(e)){for(var r=[],n=0,a=Object.keys(e);n=0)return!0}else if(s===e)return!0}return!1}function sR(e){return Xe(e)&&("var"!==e.kind||e[Po])}function iR(e){return Re(e)||at(e)||sR(e)}function oR(e){return!!Oi(e.type,"Immutable")||!!Te(e)&&"undefined"===e.name}function dR(e,t){if("object"!==typeof e||"object"!==typeof t||null==e||null==t)return e===t;if(e.type!==t.type)return!1;for(var r=Object.keys(Fo[e.type]||e.type),n=Do[e.type],a=0,s=r;a100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(o){var d=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*a;case"days":case"day":case"d":return d*n;case"hours":case"hour":case"hrs":case"hr":case"h":return d*r;case"minutes":case"minute":case"mins":case"min":case"m":return d*t;case"seconds":case"second":case"secs":case"sec":case"s":return d*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function o(a){var s=Math.abs(a);return s>=n?Math.round(a/n)+"d":s>=r?Math.round(a/r)+"h":s>=t?Math.round(a/t)+"m":s>=e?Math.round(a/e)+"s":a+"ms"}function d(a){var s=Math.abs(a);return s>=n?c(a,s,n,"day"):s>=r?c(a,s,r,"hour"):s>=t?c(a,s,t,"minute"):s>=e?c(a,s,e,"second"):a+" ms"}function c(e,t,r,n){var a=t>=1.5*r;return Math.round(e/r)+" "+n+(a?"s":"")}return WR=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return i(e);if("number"===r&&isFinite(e))return t.long?d(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},WR}function YR(e){function t(e){for(var t=0,n=0;n=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function n(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),this.useColors){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(a=n))})),t.splice(a,0,r)}}function a(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(VZ){}}function s(){var e;try{e=t.storage.getItem("debug")}catch(VZ){}return!e&&"undefined"!==typeof Ci&&"env"in Ci&&(e=Ci.env.DEBUG),e}function i(){try{return localStorage}catch(VZ){}}t.formatArgs=n,t.save=a,t.load=s,t.useColors=r,t.storage=i(),t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=XR(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(VZ){return"[UnexpectedJSONParseError]: "+VZ.message}}}(zR,zR.exports);var JR=zR.exports,$R=Rb,QR=Yc,ZR=Xc,eE=lc,tE=Fc,rE=Lc;function nE(e){if(!e.isExportDeclaration()||e.isExportAllDeclaration())throw new Error("Only default and named export declarations can be split.");if(e.isExportDefaultDeclaration()){var t=e.get("declaration"),r=t.isFunctionDeclaration()||t.isClassDeclaration(),n=t.isFunctionExpression()||t.isClassExpression(),a=t.isScope()?t.scope.parent:t.scope,s=t.node.id,i=!1;s?n&&a.hasBinding(s.name)&&(i=!0,s=a.generateUidIdentifier(s.name)):(i=!0,s=a.generateUidIdentifier("default"),(r||n)&&(t.node.id=$R(s)));var o=r?t.node:tE("var",[rE($R(s),t.node)]),d=QR(null,[ZR($R(s),eE("default"))]);return e.insertAfter(d),e.replaceWith(o),i&&a.registerDeclaration(e),e}if(e.get("specifiers").length>0)throw new Error("It doesn't make sense to split exported specifiers.");var c=e.get("declaration"),l=c.getOuterBindingIdentifiers(),u=Object.keys(l).map((function(e){return ZR(eE(e),eE(e))})),p=QR(null,u);return e.insertAfter(p),e.replaceWith(c.node),e}function aE(e){var t=e.context,r=e.node;if(r.computed&&t.maybeQueue(e.get("key")),r.decorators)for(var n,a=_(e.get("decorators"));!(n=a()).done;){var s=n.value;t.maybeQueue(s)}}var sE={FunctionParent:function(e){e.isArrowFunctionExpression()||(e.skip(),e.isMethod()&&aE(e))},Property:function(e){e.isObjectProperty()||(e.skip(),aE(e))}},iE={ReferencedIdentifier:function(e,t){var r=e.node;r.name===t.oldName&&(r.name=t.newName)},Scope:function(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||(e.skip(),e.isMethod()&&aE(e))},ObjectProperty:function(e,t){var r,n=e.node,a=e.scope,s=n.key.name;!n.shorthand||s!==t.oldName&&s!==t.newName||a.getBindingIdentifier(s)!==t.binding.identifier||(n.shorthand=!1,null!=(r=n.extra)&&r.shorthand&&(n.extra.shorthand=!1))},"AssignmentExpression|Declaration|VariableDeclarator":function(e,t){if(!e.isVariableDeclaration()){var r=e.getOuterBindingIdentifiers();for(var n in r)n===t.oldName&&(r[n].name=t.newName)}}},oE=function(){function e(e,t,r){this.newName=r,this.oldName=t,this.binding=e}var t=e.prototype;return t.maybeConvertFromExportDeclaration=function(e){var t=e.parentPath;if(t.isExportDeclaration()){if(t.isExportDefaultDeclaration()){var r=t.node.declaration;if(es(r)&&!r.id)return}t.isExportAllDeclaration()||nE(t)}},t.maybeConvertFromClassFunctionDeclaration=function(e){return e},t.maybeConvertFromClassFunctionExpression=function(e){return e},t.rename=function(){var e=this.binding,t=this.oldName,r=this.newName,n=e.scope,a=e.path,s=a.find((function(e){return e.isDeclaration()||e.isFunctionExpression()||e.isClassExpression()}));s&&s.getOuterBindingIdentifiers()[t]===e.identifier&&this.maybeConvertFromExportDeclaration(s),MK(arguments[0]||n.block,wR(iE),n,this,n.path,{discriminant:!0}),arguments[0]||(n.removeOwnBinding(t),n.bindings[r]=e,this.binding.identifier.name=r),s&&(this.maybeConvertFromClassFunctionDeclaration(a),this.maybeConvertFromClassFunctionExpression(a))},c(e)}(),dE=function(){function e(e){var t=e.identifier,r=e.scope,n=e.path,a=e.kind;this.identifier=void 0,this.scope=void 0,this.path=void 0,this.kind=void 0,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.identifier=t,this.scope=r,this.path=n,this.kind=a,"var"!==a&&"hoisted"!==a||!cE(n)||this.reassign(n),this.clearValue()}var t=e.prototype;return t.deoptValue=function(){this.clearValue(),this.hasDeoptedValue=!0},t.setValue=function(e){this.hasDeoptedValue||(this.hasValue=!0,this.value=e)},t.clearValue=function(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null},t.reassign=function(e){this.constant=!1,-1===this.constantViolations.indexOf(e)&&this.constantViolations.push(e)},t.reference=function(e){-1===this.referencePaths.indexOf(e)&&(this.referenced=!0,this.references++,this.referencePaths.push(e))},t.dereference=function(){this.references--,this.referenced=!!this.references},c(e)}();function cE(e){for(var t=e.parentPath,r=e.key;t;t=(n=t).parentPath,r=n.key,n){var n;if(t.isFunctionParent())return!1;if(t.isWhile()||t.isForXStatement()||t.isForStatement()&&"body"===r)return!0}return!1}var lE,uE,pE={builtin:{Array:!1,ArrayBuffer:!1,Atomics:!1,BigInt:!1,BigInt64Array:!1,BigUint64Array:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,globalThis:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,SharedArrayBuffer:!1,String:!1,Symbol:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},es5:{Array:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,propertyIsEnumerable:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1},es2015:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},es2017:{Array:!1,ArrayBuffer:!1,Atomics:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,SharedArrayBuffer:!1,String:!1,Symbol:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},browser:{AbortController:!1,AbortSignal:!1,addEventListener:!1,alert:!1,AnalyserNode:!1,Animation:!1,AnimationEffectReadOnly:!1,AnimationEffectTiming:!1,AnimationEffectTimingReadOnly:!1,AnimationEvent:!1,AnimationPlaybackEvent:!1,AnimationTimeline:!1,applicationCache:!1,ApplicationCache:!1,ApplicationCacheErrorEvent:!1,atob:!1,Attr:!1,Audio:!1,AudioBuffer:!1,AudioBufferSourceNode:!1,AudioContext:!1,AudioDestinationNode:!1,AudioListener:!1,AudioNode:!1,AudioParam:!1,AudioProcessingEvent:!1,AudioScheduledSourceNode:!1,"AudioWorkletGlobalScope ":!1,AudioWorkletNode:!1,AudioWorkletProcessor:!1,BarProp:!1,BaseAudioContext:!1,BatteryManager:!1,BeforeUnloadEvent:!1,BiquadFilterNode:!1,Blob:!1,BlobEvent:!1,blur:!1,BroadcastChannel:!1,btoa:!1,BudgetService:!1,ByteLengthQueuingStrategy:!1,Cache:!1,caches:!1,CacheStorage:!1,cancelAnimationFrame:!1,cancelIdleCallback:!1,CanvasCaptureMediaStreamTrack:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,ChannelMergerNode:!1,ChannelSplitterNode:!1,CharacterData:!1,clearInterval:!1,clearTimeout:!1,clientInformation:!1,ClipboardEvent:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,ConstantSourceNode:!1,ConvolverNode:!1,CountQueuingStrategy:!1,createImageBitmap:!1,Credential:!1,CredentialsContainer:!1,crypto:!1,Crypto:!1,CryptoKey:!1,CSS:!1,CSSConditionRule:!1,CSSFontFaceRule:!1,CSSGroupingRule:!1,CSSImportRule:!1,CSSKeyframeRule:!1,CSSKeyframesRule:!1,CSSMediaRule:!1,CSSNamespaceRule:!1,CSSPageRule:!1,CSSRule:!1,CSSRuleList:!1,CSSStyleDeclaration:!1,CSSStyleRule:!1,CSSStyleSheet:!1,CSSSupportsRule:!1,CustomElementRegistry:!1,customElements:!1,CustomEvent:!1,DataTransfer:!1,DataTransferItem:!1,DataTransferItemList:!1,defaultstatus:!1,defaultStatus:!1,DelayNode:!1,DeviceMotionEvent:!1,DeviceOrientationEvent:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DocumentType:!1,DOMError:!1,DOMException:!1,DOMImplementation:!1,DOMMatrix:!1,DOMMatrixReadOnly:!1,DOMParser:!1,DOMPoint:!1,DOMPointReadOnly:!1,DOMQuad:!1,DOMRect:!1,DOMRectReadOnly:!1,DOMStringList:!1,DOMStringMap:!1,DOMTokenList:!1,DragEvent:!1,DynamicsCompressorNode:!1,Element:!1,ErrorEvent:!1,event:!1,Event:!1,EventSource:!1,EventTarget:!1,external:!1,fetch:!1,File:!1,FileList:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FontFace:!1,FontFaceSetLoadEvent:!1,FormData:!1,frameElement:!1,frames:!1,GainNode:!1,Gamepad:!1,GamepadButton:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,Headers:!1,history:!1,History:!1,HTMLAllCollection:!1,HTMLAnchorElement:!1,HTMLAreaElement:!1,HTMLAudioElement:!1,HTMLBaseElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLContentElement:!1,HTMLDataElement:!1,HTMLDataListElement:!1,HTMLDetailsElement:!1,HTMLDialogElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLDocument:!1,HTMLElement:!1,HTMLEmbedElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormControlsCollection:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLLabelElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMarqueeElement:!1,HTMLMediaElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLMeterElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLOptionsCollection:!1,HTMLOutputElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPictureElement:!1,HTMLPreElement:!1,HTMLProgressElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLShadowElement:!1,HTMLSlotElement:!1,HTMLSourceElement:!1,HTMLSpanElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTimeElement:!1,HTMLTitleElement:!1,HTMLTrackElement:!1,HTMLUListElement:!1,HTMLUnknownElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,IdleDeadline:!1,IIRFilterNode:!1,Image:!1,ImageBitmap:!1,ImageBitmapRenderingContext:!1,ImageCapture:!1,ImageData:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,IntersectionObserver:!1,IntersectionObserverEntry:!1,Intl:!1,isSecureContext:!1,KeyboardEvent:!1,KeyframeEffect:!1,KeyframeEffectReadOnly:!1,length:!1,localStorage:!1,location:!0,Location:!1,locationbar:!1,matchMedia:!1,MediaDeviceInfo:!1,MediaDevices:!1,MediaElementAudioSourceNode:!1,MediaEncryptedEvent:!1,MediaError:!1,MediaKeyMessageEvent:!1,MediaKeySession:!1,MediaKeyStatusMap:!1,MediaKeySystemAccess:!1,MediaList:!1,MediaQueryList:!1,MediaQueryListEvent:!1,MediaRecorder:!1,MediaSettingsRange:!1,MediaSource:!1,MediaStream:!1,MediaStreamAudioDestinationNode:!1,MediaStreamAudioSourceNode:!1,MediaStreamEvent:!1,MediaStreamTrack:!1,MediaStreamTrackEvent:!1,menubar:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MIDIAccess:!1,MIDIConnectionEvent:!1,MIDIInput:!1,MIDIInputMap:!1,MIDIMessageEvent:!1,MIDIOutput:!1,MIDIOutputMap:!1,MIDIPort:!1,MimeType:!1,MimeTypeArray:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationEvent:!1,MutationObserver:!1,MutationRecord:!1,name:!1,NamedNodeMap:!1,NavigationPreloadManager:!1,navigator:!1,Navigator:!1,NetworkInformation:!1,Node:!1,NodeFilter:!1,NodeIterator:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,OfflineAudioContext:!1,offscreenBuffering:!1,OffscreenCanvas:!0,onabort:!0,onafterprint:!0,onanimationend:!0,onanimationiteration:!0,onanimationstart:!0,onappinstalled:!0,onauxclick:!0,onbeforeinstallprompt:!0,onbeforeprint:!0,onbeforeunload:!0,onblur:!0,oncancel:!0,oncanplay:!0,oncanplaythrough:!0,onchange:!0,onclick:!0,onclose:!0,oncontextmenu:!0,oncuechange:!0,ondblclick:!0,ondevicemotion:!0,ondeviceorientation:!0,ondeviceorientationabsolute:!0,ondrag:!0,ondragend:!0,ondragenter:!0,ondragleave:!0,ondragover:!0,ondragstart:!0,ondrop:!0,ondurationchange:!0,onemptied:!0,onended:!0,onerror:!0,onfocus:!0,ongotpointercapture:!0,onhashchange:!0,oninput:!0,oninvalid:!0,onkeydown:!0,onkeypress:!0,onkeyup:!0,onlanguagechange:!0,onload:!0,onloadeddata:!0,onloadedmetadata:!0,onloadstart:!0,onlostpointercapture:!0,onmessage:!0,onmessageerror:!0,onmousedown:!0,onmouseenter:!0,onmouseleave:!0,onmousemove:!0,onmouseout:!0,onmouseover:!0,onmouseup:!0,onmousewheel:!0,onoffline:!0,ononline:!0,onpagehide:!0,onpageshow:!0,onpause:!0,onplay:!0,onplaying:!0,onpointercancel:!0,onpointerdown:!0,onpointerenter:!0,onpointerleave:!0,onpointermove:!0,onpointerout:!0,onpointerover:!0,onpointerup:!0,onpopstate:!0,onprogress:!0,onratechange:!0,onrejectionhandled:!0,onreset:!0,onresize:!0,onscroll:!0,onsearch:!0,onseeked:!0,onseeking:!0,onselect:!0,onstalled:!0,onstorage:!0,onsubmit:!0,onsuspend:!0,ontimeupdate:!0,ontoggle:!0,ontransitionend:!0,onunhandledrejection:!0,onunload:!0,onvolumechange:!0,onwaiting:!0,onwheel:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,origin:!1,OscillatorNode:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,PannerNode:!1,parent:!1,Path2D:!1,PaymentAddress:!1,PaymentRequest:!1,PaymentRequestUpdateEvent:!1,PaymentResponse:!1,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceLongTaskTiming:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceNavigationTiming:!1,PerformanceObserver:!1,PerformanceObserverEntryList:!1,PerformancePaintTiming:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,PeriodicWave:!1,Permissions:!1,PermissionStatus:!1,personalbar:!1,PhotoCapabilities:!1,Plugin:!1,PluginArray:!1,PointerEvent:!1,PopStateEvent:!1,postMessage:!1,Presentation:!1,PresentationAvailability:!1,PresentationConnection:!1,PresentationConnectionAvailableEvent:!1,PresentationConnectionCloseEvent:!1,PresentationConnectionList:!1,PresentationReceiver:!1,PresentationRequest:!1,print:!1,ProcessingInstruction:!1,ProgressEvent:!1,PromiseRejectionEvent:!1,prompt:!1,PushManager:!1,PushSubscription:!1,PushSubscriptionOptions:!1,queueMicrotask:!1,RadioNodeList:!1,Range:!1,ReadableStream:!1,registerProcessor:!1,RemotePlayback:!1,removeEventListener:!1,Request:!1,requestAnimationFrame:!1,requestIdleCallback:!1,resizeBy:!1,ResizeObserver:!1,ResizeObserverEntry:!1,resizeTo:!1,Response:!1,RTCCertificate:!1,RTCDataChannel:!1,RTCDataChannelEvent:!1,RTCDtlsTransport:!1,RTCIceCandidate:!1,RTCIceGatherer:!1,RTCIceTransport:!1,RTCPeerConnection:!1,RTCPeerConnectionIceEvent:!1,RTCRtpContributingSource:!1,RTCRtpReceiver:!1,RTCRtpSender:!1,RTCSctpTransport:!1,RTCSessionDescription:!1,RTCStatsReport:!1,RTCTrackEvent:!1,screen:!1,Screen:!1,screenLeft:!1,ScreenOrientation:!1,screenTop:!1,screenX:!1,screenY:!1,ScriptProcessorNode:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,SecurityPolicyViolationEvent:!1,Selection:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerRegistration:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,ShadowRoot:!1,SharedWorker:!1,SourceBuffer:!1,SourceBufferList:!1,speechSynthesis:!1,SpeechSynthesisEvent:!1,SpeechSynthesisUtterance:!1,StaticRange:!1,status:!1,statusbar:!1,StereoPannerNode:!1,stop:!1,Storage:!1,StorageEvent:!1,StorageManager:!1,styleMedia:!1,StyleSheet:!1,StyleSheetList:!1,SubtleCrypto:!1,SVGAElement:!1,SVGAngle:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGComponentTransferFunctionElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDiscardElement:!1,SVGElement:!1,SVGEllipseElement:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEDropShadowElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGeometryElement:!1,SVGGradientElement:!1,SVGGraphicsElement:!1,SVGImageElement:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPathElement:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformList:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGUseElement:!1,SVGViewElement:!1,TaskAttributionTiming:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TextEvent:!1,TextMetrics:!1,TextTrack:!1,TextTrackCue:!1,TextTrackCueList:!1,TextTrackList:!1,TimeRanges:!1,toolbar:!1,top:!1,Touch:!1,TouchEvent:!1,TouchList:!1,TrackEvent:!1,TransitionEvent:!1,TreeWalker:!1,UIEvent:!1,URL:!1,URLSearchParams:!1,ValidityState:!1,visualViewport:!1,VisualViewport:!1,VTTCue:!1,WaveShaperNode:!1,WebAssembly:!1,WebGL2RenderingContext:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLQuery:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLSampler:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLSync:!1,WebGLTexture:!1,WebGLTransformFeedback:!1,WebGLUniformLocation:!1,WebGLVertexArrayObject:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,WritableStream:!1,XMLDocument:!1,XMLHttpRequest:!1,XMLHttpRequestEventTarget:!1,XMLHttpRequestUpload:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathExpression:!1,XPathResult:!1,XSLTProcessor:!1},worker:{addEventListener:!1,applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,clearInterval:!1,clearTimeout:!1,close:!0,console:!1,fetch:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!0,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onlanguagechange:!0,onmessage:!0,onoffline:!0,ononline:!0,onrejectionhandled:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,queueMicrotask:!1,removeEventListener:!1,Request:!1,Response:!1,self:!0,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,Worker:!1,WorkerGlobalScope:!1,XMLHttpRequest:!1},node:{__dirname:!1,__filename:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!0,global:!1,Intl:!1,module:!1,process:!1,queueMicrotask:!1,require:!1,setImmediate:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1},commonjs:{exports:!0,global:!1,module:!1,require:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,mocha:!1,run:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,spyOnProperty:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},jest:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fdescribe:!1,fit:!1,it:!1,jest:!1,pit:!1,require:!1,test:!1,xdescribe:!1,xit:!1,xtest:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notOk:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,throws:!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},nashorn:{__DIR__:!1,__FILE__:!1,__LINE__:!1,com:!1,edu:!1,exit:!1,java:!1,Java:!1,javafx:!1,JavaImporter:!1,javax:!1,JSAdapter:!1,load:!1,loadWithNewGlobal:!1,org:!1,Packages:!1,print:!1,quit:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{YAHOO:!1,YAHOO_config:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ln:!1,ls:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,set:!1,target:!1,tempdir:!1,test:!1,touch:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{_:!1,$:!1,Accounts:!1,AccountsClient:!1,AccountsCommon:!1,AccountsServer:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPRateLimiter:!1,DDPServer:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,ServiceConfiguration:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,ISODate:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,NumberInt:!1,NumberLong:!1,ObjectId:!1,PlanCache:!1,print:!1,printjson:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1},applescript:{$:!1,Application:!1,Automation:!1,console:!1,delay:!1,Library:!1,ObjC:!1,ObjectSpecifier:!1,Path:!1,Progress:!1,Ref:!1},serviceworker:{addEventListener:!1,applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,CacheStorage:!1,clearInterval:!1,clearTimeout:!1,Client:!1,clients:!1,Clients:!1,close:!0,console:!1,ExtendableEvent:!1,ExtendableMessageEvent:!1,fetch:!1,FetchEvent:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!1,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onfetch:!0,oninstall:!0,onlanguagechange:!0,onmessage:!0,onmessageerror:!0,onnotificationclick:!0,onnotificationclose:!0,onoffline:!0,ononline:!0,onpush:!0,onpushsubscriptionchange:!0,onrejectionhandled:!0,onsync:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,queueMicrotask:!1,registration:!1,removeEventListener:!1,Request:!1,Response:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerGlobalScope:!1,ServiceWorkerMessageEvent:!1,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,skipWaiting:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,WindowClient:!1,Worker:!1,WorkerGlobalScope:!1,XMLHttpRequest:!1},atomtest:{advanceClock:!1,fakeClearInterval:!1,fakeClearTimeout:!1,fakeSetInterval:!1,fakeSetTimeout:!1,resetTimeouts:!1,waitsForPromise:!1},embertest:{andThen:!1,click:!1,currentPath:!1,currentRouteName:!1,currentURL:!1,fillIn:!1,find:!1,findAll:!1,findWithAssert:!1,keyEvent:!1,pauseTest:!1,resumeTest:!1,triggerEvent:!1,visit:!1,wait:!1},protractor:{$:!1,$$:!1,browser:!1,by:!1,By:!1,DartObject:!1,element:!1,protractor:!1},"shared-node-browser":{clearInterval:!1,clearTimeout:!1,console:!1,setInterval:!1,setTimeout:!1,URL:!1,URLSearchParams:!1},webextensions:{browser:!1,chrome:!1,opr:!1},greasemonkey:{cloneInto:!1,createObjectIn:!1,exportFunction:!1,GM:!1,GM_addStyle:!1,GM_deleteValue:!1,GM_getResourceText:!1,GM_getResourceURL:!1,GM_getValue:!1,GM_info:!1,GM_listValues:!1,GM_log:!1,GM_openInTab:!1,GM_registerMenuCommand:!1,GM_setClipboard:!1,GM_setValue:!1,GM_xmlhttpRequest:!1,unsafeWindow:!1},devtools:{$:!1,$_:!1,$$:!1,$0:!1,$1:!1,$2:!1,$3:!1,$4:!1,$x:!1,chrome:!1,clear:!1,copy:!1,debug:!1,dir:!1,dirxml:!1,getEventListeners:!1,inspect:!1,keys:!1,monitor:!1,monitorEvents:!1,profile:!1,profileEnd:!1,queryObjects:!1,table:!1,undebug:!1,unmonitor:!1,unmonitorEvents:!1,values:!1}};function fE(){return uE?lE:(uE=1,lE=pE)}function gE(e){return null!=e&&e&&"false"!==e&&"0"!==e}var hE=(gE(Ci.env.BABEL_8_BREAKING),fE()),mE=Io,yE=$d,vE=Rb,bE=qx,xE=lc,RE=re,EE=Ma,TE=us,wE=rt,jE=at,SE=st,AE=it,CE=ot,kE=Re,_E=Te,PE=lt,IE=as,DE=is,OE=gs,NE=Ce,FE=Ne,LE=ds,ME=Za,BE=_e,UE=vt,HE=bt,GE=Rt,WE=qe,qE=Ve,KE=Xe,zE=Ns,VE=bc,YE=gc,XE=Ox,JE=Oc,$E=Fc,QE=Lc,ZE=yn,eT=vn,tT=Le,rT=Rn,nT=gt,aT=Dt,sT=fs;function iT(e,t){switch(null==e?void 0:e.type){default:var r;if(PE(e)||sT(e))if((SE(e)||CE(e)||PE(e))&&e.source)iT(e.source,t);else if((CE(e)||PE(e))&&null!=(r=e.specifiers)&&r.length)for(var n,a=_(e.specifiers);!(n=a()).done;)iT(n.value,t);else(AE(e)||CE(e))&&e.declaration&&iT(e.declaration,t);else OE(e)?iT(e.local,t):!IE(e)||NE(e)||BE(e)||GE(e)||t.push(e.value);break;case"MemberExpression":case"OptionalMemberExpression":case"JSXMemberExpression":iT(e.object,t),iT(e.property,t);break;case"Identifier":case"JSXIdentifier":t.push(e.name);break;case"CallExpression":case"OptionalCallExpression":case"NewExpression":iT(e.callee,t);break;case"ObjectExpression":case"ObjectPattern":for(var s,i=_(e.properties);!(s=i()).done;)iT(s.value,t);break;case"SpreadElement":case"RestElement":case"UnaryExpression":case"UpdateExpression":iT(e.argument,t);break;case"ObjectProperty":case"ObjectMethod":case"ClassProperty":case"ClassMethod":case"ClassPrivateProperty":case"ClassPrivateMethod":iT(e.key,t);break;case"ThisExpression":t.push("this");break;case"Super":t.push("super");break;case"Import":t.push("import");break;case"DoExpression":t.push("do");break;case"YieldExpression":t.push("yield"),iT(e.argument,t);break;case"AwaitExpression":t.push("await"),iT(e.argument,t);break;case"AssignmentExpression":iT(e.left,t);break;case"VariableDeclarator":case"FunctionExpression":case"FunctionDeclaration":case"ClassExpression":case"ClassDeclaration":case"PrivateName":iT(e.id,t);break;case"ParenthesizedExpression":iT(e.expression,t);break;case"MetaProperty":iT(e.meta,t),iT(e.property,t);break;case"JSXElement":iT(e.openingElement,t);break;case"JSXOpeningElement":iT(e.name,t);break;case"JSXFragment":iT(e.openingFragment,t);break;case"JSXOpeningFragment":t.push("Fragment");break;case"JSXNamespacedName":iT(e.namespace,t),iT(e.name,t)}}var oT={ForStatement:function(e){var t=e.get("init");if(t.isVar()){var r=e.scope;(r.getFunctionParent()||r.getProgramParent()).registerBinding("var",t)}},Declaration:function(e){e.isBlockScoped()||e.isImportDeclaration()||e.isExportDeclaration()||(e.scope.getFunctionParent()||e.scope.getProgramParent()).registerDeclaration(e)},ImportDeclaration:function(e){e.scope.getBlockParent().registerDeclaration(e)},ReferencedIdentifier:function(e,t){t.references.push(e)},ForXStatement:function(e,t){var r=e.get("left");if(r.isPattern()||r.isIdentifier())t.constantViolations.push(e);else if(r.isVar()){var n=e.scope;(n.getFunctionParent()||n.getProgramParent()).registerBinding("var",r)}},ExportDeclaration:{exit:function(e){var t=e.node,r=e.scope;if(!SE(t)){var n=t.declaration;if(jE(n)||kE(n)){var a=n.id;if(!a)return;var s=r.getBinding(a.name);null==s||s.reference(e)}else if(KE(n))for(var i,o=_(n.declarations);!(i=o()).done;)for(var d=i.value,c=0,l=Object.keys(bE(d));c1&&(r+=t),"_"+r},t.generateUidBasedOnNode=function(e,t){var r=[];iT(e,r);var n=r.join("$");return n=n.replace(/^_/,"")||t||"ref",this.generateUid(n.slice(0,20))},t.generateUidIdentifierBasedOnNode=function(e,t){return xE(this.generateUidBasedOnNode(e,t))},t.isStatic=function(e){if(WE(e)||UE(e)||rT(e))return!0;if(_E(e)){var t=this.getBinding(e.name);return t?t.constant:this.hasBinding(e.name)}return!1},t.maybeGenerateMemoised=function(e,t){if(this.isStatic(e))return null;var r=this.generateUidIdentifierBasedOnNode(e);return t?r:(this.push({id:r}),vE(r))},t.checkBlockScopedCollisions=function(e,t,r,n){if("param"!==t&&"local"!==e.kind&&("let"===t||"let"===e.kind||"const"===e.kind||"module"===e.kind||"param"===e.kind&&"const"===t))throw this.hub.buildError(n,'Duplicate declaration "'+r+'"',TypeError)},t.rename=function(e,t){var r=this.getBinding(e);r&&(t||(t=this.generateUidIdentifier(e).name),new oE(r,e,t).rename(arguments[2]))},t._renameFromMap=function(e,t,r,n){e[t]&&(e[r]=n,e[t]=null)},t.dump=function(){var e="-".repeat(60);console.log(e);var t=this;do{console.log("#",t.block.type);for(var r=0,n=Object.keys(t.bindings);r0)&&this.isPure(e.body,t);if(wE(e)){for(var i,o=_(e.body);!(i=o()).done;){var d=i.value;if(!this.isPure(d,t))return!1}return!0}if(EE(e))return this.isPure(e.left,t)&&this.isPure(e.right,t);if(RE(e)||eT(e)){for(var c,l=_(e.elements);!(c=l()).done;){var u=c.value;if(null!==u&&!this.isPure(u,t))return!1}return!0}if(FE(e)||ZE(e)){for(var p,f=_(e.properties);!(p=f()).done;){var g=p.value;if(!this.isPure(g,t))return!1}return!0}if(DE(e))return!(e.computed&&!this.isPure(e.key,t))&&!((null==(a=e.decorators)?void 0:a.length)>0);if(LE(e))return!(e.computed&&!this.isPure(e.key,t))&&!((null==(s=e.decorators)?void 0:s.length)>0)&&!((tT(e)||e.static)&&null!==e.value&&!this.isPure(e.value,t));if(qE(e))return this.isPure(e.argument,t);if(HE(e))return zE(e.tag,"String.raw")&&!this.hasBinding("String",!0)&&this.isPure(e.quasi,t);if(GE(e)){for(var h,m=_(e.expressions);!(h=m()).done;){var y=h.value;if(!this.isPure(y,t))return!1}return!0}return ME(e)},t.setData=function(e,t){return this.data[e]=t},t.getData=function(e){var t=this;do{var r=t.data[e];if(null!=r)return r}while(t=t.parent)},t.removeData=function(e){var t=this;do{null!=t.data[e]&&(t.data[e]=null)}while(t=t.parent)},t.init=function(){this.inited||(this.inited=!0,this.crawl())},t.crawl=function(){var e=this.path;this.references=Object.create(null),this.bindings=Object.create(null),this.globals=Object.create(null),this.uids=Object.create(null),this.data=Object.create(null);var t=this.getProgramParent();if(!t.crawling){var r={references:[],constantViolations:[],assignments:[]};if(this.crawling=!0,"Program"!==e.type&&TR(oT)){for(var n,a=_(oT.enter);!(n=a()).done;)n.value.call(r,e,r);var s=oT[e.type];if(s)for(var i,o=_(s.enter);!(i=o()).done;)i.value.call(r,e,r)}e.traverse(oT,r),this.crawling=!1;for(var d,c=_(r.assignments);!(d=c()).done;){for(var l=d.value,u=l.getBindingIdentifiers(),p=0,f=Object.keys(u);p0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[o-2]?2:"="===e[o-1]?1:0,i=new mT(3*o/4-s),n=s>0?o-4:o;var d=0;for(t=0,r=0;t>16&255,i[d++]=a>>8&255,i[d++]=255&a;return 2===s?(a=hT[e.charCodeAt(t)]<<2|hT[e.charCodeAt(t+1)]>>4,i[d++]=255&a):1===s&&(a=hT[e.charCodeAt(t)]<<10|hT[e.charCodeAt(t+1)]<<4|hT[e.charCodeAt(t+2)]>>2,i[d++]=a>>8&255,i[d++]=255&a),i}function xT(e){return gT[e>>18&63]+gT[e>>12&63]+gT[e>>6&63]+gT[63&e]}function RT(e,t,r){for(var n,a=[],s=t;sd?d:o+i));return 1===n?(t=e[r-1],a+=gT[t>>2],a+=gT[t<<4&63],a+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],a+=gT[t>>10],a+=gT[t>>4&63],a+=gT[t<<2&63],a+="="),s.push(a),s.join("")}function TT(e,t,r,n,a){var s,i,o=8*a-n-1,d=(1<>1,l=-7,u=r?a-1:0,p=r?-1:1,f=e[t+u];for(u+=p,s=f&(1<<-l)-1,f>>=-l,l+=o;l>0;s=256*s+e[t+u],u+=p,l-=8);for(i=s&(1<<-l)-1,s>>=-l,l+=n;l>0;i=256*i+e[t+u],u+=p,l-=8);if(0===s)s=1-c;else{if(s===d)return i?NaN:1/0*(f?-1:1);i+=Math.pow(2,n),s-=c}return(f?-1:1)*i*Math.pow(2,s-n)}function wT(e,t,r,n,a,s){var i,o,d,c=8*s-a-1,l=(1<>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,g=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-i))<1&&(i--,d*=2),(t+=i+u>=1?p/d:p*Math.pow(2,1-u))*d>=2&&(i++,d/=2),i+u>=l?(o=0,i=l):i+u>=1?(o=(t*d-1)*Math.pow(2,a),i+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,a),i=0));a>=8;e[r+f]=255&o,f+=g,o/=256,a-=8);for(i=i<0;e[r+f]=255&i,f+=g,i/=256,c-=8);e[r+f-g]|=128*h}var jT={}.toString,ST=Array.isArray||function(e){return"[object Array]"==jT.call(e)},AT=50;function CT(){return _T.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function kT(e,t){if(CT()=CT())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+CT().toString(16)+" bytes");return 0|e}function UT(e){return!(null==e||!e._isBuffer)}function HT(e,t){if(UT(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return yw(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return xw(e).length;default:if(n)return yw(e).length;t=(""+t).toLowerCase(),n=!0}}function GT(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return aw(this,t,r);case"utf8":case"utf-8":return ZT(this,t,r);case"ascii":return rw(this,t,r);case"latin1":case"binary":return nw(this,t,r);case"base64":return QT(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sw(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function WT(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function qT(e,t,r,n,a){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"===typeof t&&(t=_T.from(t,n)),UT(t))return 0===t.length?-1:KT(e,t,r,n,a);if("number"===typeof t)return t&=255,_T.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):KT(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function KT(e,t,r,n,a){var s,i=1,o=e.length,d=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,o/=2,d/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){var l=-1;for(s=r;so&&(r=o-d),s=r;s>=0;s--){for(var u=!0,p=0;pa&&(n=a):n=a;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var i=0;i239?4:c>223?3:c>191?2:1;if(a+u<=r)switch(u){case 1:c<128&&(l=c);break;case 2:128===(192&(s=e[a+1]))&&(d=(31&c)<<6|63&s)>127&&(l=d);break;case 3:s=e[a+1],i=e[a+2],128===(192&s)&&128===(192&i)&&(d=(15&c)<<12|(63&s)<<6|63&i)>2047&&(d<55296||d>57343)&&(l=d);break;case 4:s=e[a+1],i=e[a+2],o=e[a+3],128===(192&s)&&128===(192&i)&&128===(192&o)&&(d=(15&c)<<18|(63&s)<<12|(63&i)<<6|63&o)>65535&&d<1114112&&(l=d)}null===l?(l=65533,u=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),a+=u}return tw(n)}_T.TYPED_ARRAY_SUPPORT=void 0===Bs.TYPED_ARRAY_SUPPORT||Bs.TYPED_ARRAY_SUPPORT,CT(),_T.poolSize=8192,_T._augment=function(e){return e.__proto__=_T.prototype,e},_T.from=function(e,t,r){return PT(null,e,t,r)},_T.TYPED_ARRAY_SUPPORT&&(_T.prototype.__proto__=Uint8Array.prototype,_T.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&_T[Symbol.species]),_T.alloc=function(e,t,r){return DT(null,e,t,r)},_T.allocUnsafe=function(e){return OT(null,e)},_T.allocUnsafeSlow=function(e){return OT(null,e)},_T.isBuffer=Tw,_T.compare=function(e,t){if(!UT(e)||!UT(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,a=0,s=Math.min(r,n);a0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},_T.prototype.compare=function(e,t,r,n,a){if(!UT(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(a>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),o=Math.min(s,i),d=this.slice(n,a),c=e.slice(t,r),l=0;la)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return zT(this,e,t,r);case"utf8":case"utf-8":return VT(this,e,t,r);case"ascii":return YT(this,e,t,r);case"latin1":case"binary":return XT(this,e,t,r);case"base64":return JT(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $T(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},_T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ew=4096;function tw(e){var t=e.length;if(t<=ew)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var a="",s=t;sr)throw new RangeError("Trying to access beyond buffer length")}function ow(e,t,r,n,a,s){if(!UT(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function dw(e,t,r,n){t<0&&(t=65535+t+1);for(var a=0,s=Math.min(e.length-r,2);a>>8*(n?a:1-a)}function cw(e,t,r,n){t<0&&(t=4294967295+t+1);for(var a=0,s=Math.min(e.length-r,4);a>>8*(n?a:3-a)&255}function lw(e,t,r,n,a,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function uw(e,t,r,n,a){return a||lw(e,t,r,4),wT(e,t,r,n,23,4),r+4}function pw(e,t,r,n,a){return a||lw(e,t,r,8),wT(e,t,r,n,52,8),r+8}_T.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(a*=256);)n+=this[e+--t]*a;return n},_T.prototype.readUInt8=function(e,t){return t||iw(e,1,this.length),this[e]},_T.prototype.readUInt16LE=function(e,t){return t||iw(e,2,this.length),this[e]|this[e+1]<<8},_T.prototype.readUInt16BE=function(e,t){return t||iw(e,2,this.length),this[e]<<8|this[e+1]},_T.prototype.readUInt32LE=function(e,t){return t||iw(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},_T.prototype.readUInt32BE=function(e,t){return t||iw(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},_T.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||iw(e,t,this.length);for(var n=this[e],a=1,s=0;++s=(a*=128)&&(n-=Math.pow(2,8*t)),n},_T.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||iw(e,t,this.length);for(var n=t,a=1,s=this[e+--n];n>0&&(a*=256);)s+=this[e+--n]*a;return s>=(a*=128)&&(s-=Math.pow(2,8*t)),s},_T.prototype.readInt8=function(e,t){return t||iw(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},_T.prototype.readInt16LE=function(e,t){t||iw(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},_T.prototype.readInt16BE=function(e,t){t||iw(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},_T.prototype.readInt32LE=function(e,t){return t||iw(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},_T.prototype.readInt32BE=function(e,t){return t||iw(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},_T.prototype.readFloatLE=function(e,t){return t||iw(e,4,this.length),TT(this,e,!0,23,4)},_T.prototype.readFloatBE=function(e,t){return t||iw(e,4,this.length),TT(this,e,!1,23,4)},_T.prototype.readDoubleLE=function(e,t){return t||iw(e,8,this.length),TT(this,e,!0,52,8)},_T.prototype.readDoubleBE=function(e,t){return t||iw(e,8,this.length),TT(this,e,!1,52,8)},_T.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||ow(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+a]=e/s&255;return t+r},_T.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,1,255,0),_T.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},_T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,2,65535,0),_T.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):dw(this,e,t,!0),t+2},_T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,2,65535,0),_T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):dw(this,e,t,!1),t+2},_T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,4,4294967295,0),_T.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):cw(this,e,t,!0),t+4},_T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,4,4294967295,0),_T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):cw(this,e,t,!1),t+4},_T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);ow(this,e,t,r,a-1,-a)}var s=0,i=1,o=0;for(this[t]=255&e;++s>0)-o&255;return t+r},_T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);ow(this,e,t,r,a-1,-a)}var s=r-1,i=1,o=0;for(this[t+s]=255&e;--s>=0&&(i*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/i>>0)-o&255;return t+r},_T.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,1,127,-128),_T.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},_T.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,2,32767,-32768),_T.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):dw(this,e,t,!0),t+2},_T.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,2,32767,-32768),_T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):dw(this,e,t,!1),t+2},_T.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,4,2147483647,-2147483648),_T.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):cw(this,e,t,!0),t+4},_T.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||ow(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),_T.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):cw(this,e,t,!1),t+4},_T.prototype.writeFloatLE=function(e,t,r){return uw(this,e,t,!0,r)},_T.prototype.writeFloatBE=function(e,t,r){return uw(this,e,t,!1,r)},_T.prototype.writeDoubleLE=function(e,t,r){return pw(this,e,t,!0,r)},_T.prototype.writeDoubleBE=function(e,t,r){return pw(this,e,t,!1,r)},_T.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--a)e[a+t]=this[a+r];else if(s<1e3||!_T.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(s=t;s55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function vw(e){for(var t=[],r=0;r>8,a=r%256,s.push(a),s.push(n);return s}function xw(e){return bT(gw(e))}function Rw(e,t,r,n){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function Ew(e){return e!==e}function Tw(e){return null!=e&&(!!e._isBuffer||ww(e)||jw(e))}function ww(e){return!!e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function jw(e){return"function"===typeof e.readFloatLE&&"function"===typeof e.slice&&ww(e.slice(0,0))}var Sw,Aw={exports:{}};function Cw(){return Sw||(Sw=1,function(e,t){!function(e,r){r(t)}(0,(function(e){for(var t=",".charCodeAt(0),r=";".charCodeAt(0),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=new Uint8Array(64),s=new Uint8Array(128),i=0;i>>=1,c&&(a=-2147483648|-a),r[n]+=a,t}function p(e,r,n){return!(r>=n)&&e.charCodeAt(r)!==t}function f(e){e.sort(g)}function g(e,t){return e[0]-t[0]}function h(e){for(var n=new Int32Array(5),a=16384,s=a-36,i=new Uint8Array(a),o=i.subarray(0,s),c=0,l="",u=0;u0&&(c===a&&(l+=d.decode(i),c=0),i[c++]=r),0!==p.length){n[0]=0;for(var f=0;fs&&(l+=d.decode(o),i.copyWithin(0,s,c),c-=s),f>0&&(i[c++]=t),c=m(i,c,n,g,0),1!==g.length&&(c=m(i,c,n,g,1),c=m(i,c,n,g,2),c=m(i,c,n,g,3),4!==g.length&&(c=m(i,c,n,g,4)))}}}return l+d.decode(i.subarray(0,c))}function m(e,t,r,n,s){var i=n[s],o=i-r[s];r[s]=i,o=o<0?-o<<1|1:o<<1;do{var d=31&o;(o>>>=5)>0&&(d|=32),e[t++]=a[d]}while(o>0);return t}e.decode=c,e.encode=h,Object.defineProperty(e,"__esModule",{value:!0})}))}(0,Aw.exports)),Aw.exports}var kw,_w={exports:{}},Pw={exports:{}};function Iw(){return kw||(kw=1,function(e,t){!function(e,r){r(t)}(0,(function(e){for(var t=",".charCodeAt(0),r=";".charCodeAt(0),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=new Uint8Array(64),s=new Uint8Array(128),i=0;i>>=1,c&&(a=-2147483648|-a),r[n]+=a,t}function p(e,r,n){return!(r>=n)&&e.charCodeAt(r)!==t}function f(e){e.sort(g)}function g(e,t){return e[0]-t[0]}function h(e){for(var n=new Int32Array(5),a=16384,s=a-36,i=new Uint8Array(a),o=i.subarray(0,s),c=0,l="",u=0;u0&&(c===a&&(l+=d.decode(i),c=0),i[c++]=r),0!==p.length){n[0]=0;for(var f=0;fs&&(l+=d.decode(o),i.copyWithin(0,s,c),c-=s),f>0&&(i[c++]=t),c=m(i,c,n,g,0),1!==g.length&&(c=m(i,c,n,g,1),c=m(i,c,n,g,2),c=m(i,c,n,g,3),4!==g.length&&(c=m(i,c,n,g,4)))}}}return l+d.decode(i.subarray(0,c))}function m(e,t,r,n,s){var i=n[s],o=i-r[s];r[s]=i,o=o<0?-o<<1|1:o<<1;do{var d=31&o;(o>>>=5)>0&&(d|=32),e[t++]=a[d]}while(o>0);return t}e.decode=c,e.encode=h,Object.defineProperty(e,"__esModule",{value:!0})}))}(0,Pw.exports)),Pw.exports}var Dw,Ow={exports:{}};function Nw(){return Dw||(Dw=1,e=Ow,function(t,r){e.exports=r()}(0,(function(){var e,t=/^[\w+.-]+:\/\//,r=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function a(e){return t.test(e)}function s(e){return e.startsWith("//")}function i(e){return e.startsWith("/")}function o(e){return e.startsWith("file:")}function d(e){return/^[.?#]/.test(e)}function c(e){var t=r.exec(e);return u(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}function l(e){var t=n.exec(e),r=t[2];return u("file:","",t[1]||"","",i(r)?r:"/"+r,t[3]||"",t[4]||"")}function u(t,r,n,a,s,i,o){return{scheme:t,user:r,host:n,port:a,path:s,query:i,hash:o,type:e.Absolute}}function p(t){if(s(t)){var r=c("http:"+t);return r.scheme="",r.type=e.SchemeRelative,r}if(i(t)){var n=c("http://foo.com"+t);return n.scheme="",n.host="",n.type=e.AbsolutePath,n}if(o(t))return l(t);if(a(t))return c(t);var d=c("http://foo.com/"+t);return d.scheme="",d.host="",d.type=t?t.startsWith("?")?e.Query:t.startsWith("#")?e.Hash:e.RelativePath:e.Empty,d}function f(e){if(e.endsWith("/.."))return e;var t=e.lastIndexOf("/");return e.slice(0,t+1)}function g(e,t){h(t,t.type),"/"===e.path?e.path=t.path:e.path=f(t.path)+e.path}function h(t,r){for(var n=r<=e.RelativePath,a=t.path.split("/"),s=1,i=0,o=!1,d=1;da&&(a=i)}h(n,a);var o=n.query+n.hash;switch(a){case e.Hash:case e.Query:return o;case e.RelativePath:var c=n.path.slice(1);return c?d(r||t)&&!d(c)?"./"+c+o:c+o:o||".";case e.AbsolutePath:return n.path+o;default:return n.scheme+"//"+n.user+n.host+n.port+n.path+o}}return function(e){e[e.Empty=1]="Empty",e[e.Hash=2]="Hash",e[e.Query=3]="Query",e[e.RelativePath=4]="RelativePath",e[e.AbsolutePath=5]="AbsolutePath",e[e.SchemeRelative=6]="SchemeRelative",e[e.Absolute=7]="Absolute"}(e||(e={})),m}))),Ow.exports;var e}!function(e,t){!function(e,r){r(t,Iw(),Nw())}(0,(function(e,t,r){function n(e){return e&&"object"===typeof e&&"default"in e?e:{default:e}}var a=n(r);function s(e,t){return t&&!t.endsWith("/")&&(t+="/"),a.default(e,t)}function i(e){if(!e)return"";var t=e.lastIndexOf("/");return e.slice(0,t+1)}var o=0,d=1,l=2,u=3,p=4,f=1,g=2;function h(e,t){var r=m(e,0);if(r===e.length)return e;t||(e=e.slice());for(var n=r;n>1),s=e[a][o]-t;if(0===s)return x=!0,a;s<0?r=a+1:n=a-1}return x=!1,r-1}function E(e,t,r){for(var n=r+1;n=0&&e[n][o]===t;r=n--);return r}function w(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function j(e,t,r,n){var a=r.lastKey,s=r.lastNeedle,i=r.lastIndex,d=0,c=e.length-1;if(n===a){if(t===s)return x=-1!==i&&e[i][o]===t,i;t>=s?d=-1===i?0:i:c=i}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=R(e,t,d,c)}function S(e,t){for(var r=t.map(C),n=0;nt;n--)e[n]=e[n-1];e[t]=r}function C(){return{__proto__:null}}var k=function(t,r){var n="string"===typeof t?JSON.parse(t):t;if(!("sections"in n))return new M(n,r);var a=[],s=[],i=[],o=[];_(n,r,a,s,i,o,0,0,1/0,1/0);var d={version:3,file:n.file,names:o,sources:s,sourcesContent:i,mappings:a};return e.presortedDecodedMap(d)};function _(e,t,r,n,a,s,i,o,d,c){for(var l=e.sections,u=0;ug)return;for(var j=D(n,w),S=0===T?f:0,A=b[T],C=0;C=h)return;if(1!==k.length){var O=y+k[d],N=k[l],F=k[u];j.push(4===k.length?[P,O,N,F]:[P,O,N,F,v+k[p]])}else j.push([P])}}}function I(e,t){for(var r=0;r=a.length)return null;var s=a[r],i=G(s,t._decodedMemo,r,n,L);return-1===i?null:s[i]},e.originalPositionFor=function(t,r){var n=r.line,a=r.column,s=r.bias;if(--n<0)throw new Error(O);if(a<0)throw new Error(N);var i=e.decodedMappings(t);if(n>=i.length)return U(null,null,null,null);var o=i[n],c=G(o,t._decodedMemo,n,a,s||L);if(-1===c)return U(null,null,null,null);var f=o[c];if(1===f.length)return U(null,null,null,null);var g=t.names;return U(t.resolvedSources[f[d]],f[l]+1,f[u],5===f.length?g[f[p]]:null)},e.allGeneratedPositionsFor=function(e,t){return r(e,t.source,t.line,t.column,t.bias||F,!0)},e.generatedPositionFor=function(e,t){return r(e,t.source,t.line,t.column,t.bias||L,!1)},e.eachMapping=function(t,r){for(var n=e.decodedMappings(t),a=t.names,s=t.resolvedSources,i=0;i=0&&!(t>=e[n][s]);r=n--);return r}function h(e,t,r){for(var n=e.length;n>t;n--)e[n]=e[n-1];e[t]=r}function m(e){for(var t=e.length,r=t,n=r-1;n>=0&&!(e[n].length>0);r=n,n--);r1?String.fromCharCode(e).repeat(t):String.fromCharCode(e),10!==e?(this._mark(r.line,r.column,r.identifierName,r.identifierNamePos,r.filename),this._position.column+=t):(this._position.line++,this._position.column=0),this._canMarkIdName&&(r.identifierName=void 0,r.identifierNamePos=void 0)},t._append=function(e,t,r){var n=e.length,a=this._position;if(this._last=e.charCodeAt(n-1),++this._appendCount>4096?(this._str,this._buf+=this._str,this._str=e,this._appendCount=0):this._str+=e,r||this._map){var s=t.column,i=t.identifierName,o=t.identifierNamePos,d=t.filename,c=t.line;null==i&&null==o||!this._canMarkIdName||(t.identifierName=void 0,t.identifierNamePos=void 0);var l=e.indexOf("\n"),u=0;for(0!==l&&this._mark(c,s,i,o,d);-1!==l;)a.line++,a.column=0,(u=l+1)=0&&10===this._queue[r].char;r--)t++;return t===e&&10===this._last?t+1:t},t.endsWithCharAndNewline=function(){var e=this._queue,t=this._queueCursor;if(0!==t){if(10!==e[t-1].char)return;return t>1?e[t-2].char:this._last}},t.hasContent=function(){return 0!==this._queueCursor||!!this._last},t.exactSource=function(e,t){if(this._map){this.source("start",e);var r=e.identifierName,n=this._sourcePosition;r&&(this._canMarkIdName=!1,n.identifierName=r),t(),r&&(this._canMarkIdName=!0,n.identifierName=void 0,n.identifierNamePos=void 0),this.source("end",e)}else t()},t.source=function(e,t){this._map&&this._normalizePosition(e,t,0)},t.sourceWithOffset=function(e,t,r){this._map&&this._normalizePosition(e,t,r)},t.withSource=function(e,t,r){this._map&&this.source(e,t),r()},t._normalizePosition=function(e,t,r){var n=t[e],a=this._sourcePosition;n&&(a.line=n.line,a.column=Math.max(n.column+r,0),a.filename=t.filename)},t.getCurrentColumn=function(){for(var e=this._queue,t=this._queueCursor,r=-1,n=0,a=0;a":0,"&&":1,"|":2,"^":3,"&":4,"==":5,"===":5,"!=":5,"!==":5,"<":6,">":6,"<=":6,">=":6,in:6,instanceof:6,">>":7,"<<":7,">>>":7,"+":8,"-":8,"*":9,"/":9,"%":9,"**":10};function nS(e){return Bj(e)||tS(e)||Kj(e)}var aS=function(e,t){return fj(t,{superClass:e})},sS=function(e,t){return(kj(t)||Oj(t))&&t.object===e||(pj(t)||Dj(t)||_j(t))&&t.callee===e||Vj(t)&&t.tag===e||Gj(t)};function iS(e,t){return sj(t)}function oS(e,t,r){if(!(r.length<3))return $j(t)||Aj(t)||sj(t)||Xj(t)&&ij(r[r.length-3])}function dS(e,t){return sS(e,t)||aS(e,t)}function cS(e,t,r){return _S(r,3)}function lS(e,t,r){return!e.async&&_S(r,1)}function uS(e,t){if("**"===e.operator&&lj(t,{operator:"**"}))return t.left===e;if(aS(e,t))return!0;if(sS(e,t)||Jj(t)||dj(t))return!0;if(cj(t)){var r=t.operator,n=rS[r],a=e.operator,s=rS[a];if(n===s&&t.right===e&&!Cj(t)||n>s)return!0}}function pS(e,t){return sj(t)||Pj(t)||Aj(t)||$j(t)}function fS(e,t){return Sj(t,{objectType:e})}function gS(){return!0}function hS(e,t){return Mj(t)||Wj(t)||Hj(t)||zj(t)||qj(t)}function mS(e,t){return Mj(t)||Wj(t)}function yS(e,t){return(pj(t)||Dj(t)||_j(t)||Uj(t))&&!!t.typeParameters}function vS(e,t){return"in"===e.operator&&(Qj(t)||xj(t))}function bS(e,t){return!(Tj(t)||Yj(t)||Nj(t)||jj(t)&&t.test===e||Zj(t)&&t.test===e||Rj(t)&&t.right===e||Lj(t)&&t.discriminant===e||bj(t)&&t.expression===e)}function xS(e,t){return cj(t)||Jj(t)||sS(e,t)||dj(t)&&eS(e)||mj(t)&&e===t.test||aS(e,t)}function RS(e,t,r){return _S(r,5)}function ES(e,t){return sS(e,t)||lj(t,{operator:"**",left:e})||aS(e,t)}function TS(e,t,r){return _S(r,5)}function wS(e,t){return yj(t)||jS(e,t)}function jS(e,t){return!!(Jj(t)||cj(t)||mj(t,{test:e})||dj(t)||nS(t))||ES(e,t)}function SS(e,t){return pj(t,{callee:e})||kj(t,{object:e})}function AS(e,t){return!!Ij(e.left)||jS(e,t)}function CS(e,t){if(nS(t))return!0;switch(e.operator){case"||":return!!Cj(t)&&("??"===t.operator||"&&"===t.operator);case"&&":return Cj(t,{operator:"??"});case"??":return Cj(t)&&"??"!==t.operator}}function kS(e,t,r){var n;return!(null==(n=e.extra)||!n.parenthesized||!oj(t,{left:e})||!wj(t.right)&&!gj(t.right)||null!=t.right.id)||("let"===e.name?_S(r,kj(t,{object:e,computed:!0})||Oj(t,{object:e,computed:!0,optional:!1})?57:32):"async"===e.name&&Ej(t)&&e===t.left)}function _S(e,t){var r=1&t,n=2&t,a=4&t,s=8&t,i=16&t,o=32&t,d=e.length-1;if(!(d<=0)){for(var c=e[d],l=e[--d];d>=0;){if(r&&bj(l,{expression:c})||a&&vj(l,{declaration:c})||n&&ij(l,{body:c})||s&&Tj(l,{init:c})||i&&Rj(l,{left:c})||o&&Ej(l,{left:c}))return!0;if(!(d>0&&(sS(c,l)&&!_j(l)||Fj(l)&&l.expressions[0]===c||uj(l)&&!l.prefix||hj(l,{test:c})||cj(l,{left:c})||oj(l,{left:c}))))return!1;c=l,l=e[--d]}return!1}}var PS=No,IS=le,DS=Ie,OS=De;function NS(e){var t={};function r(e,r){var n=t[e];t[e]=n?function(e,t,a){var s=n(e,t,a);return null==s?r(e,t,a):s}:r}for(var n=0,a=Object.keys(e);n1}),EA(t))if(TA(t)){if(t.init===e)return}else if(t.left===e)return;this.semicolon()}function VA(e){this.print(e.id,e),e.definite&&this.tokenChar(33),this.print(e.id.typeAnnotation,e),e.init&&(this.space(),this.tokenChar(61),this.space(),this.print(e.init,e))}var YA=it,XA=ot;function JA(e,t){(YA(t)||XA(t))&&this._shouldPrintDecoratorsBeforeExport(t)||this.printJoin(e.decorators,e),e.declare&&(this.word("declare"),this.space()),e.abstract&&(this.word("abstract"),this.space()),this.word("class"),e.id&&(this.space(),this.print(e.id,e)),this.print(e.typeParameters,e),e.superClass&&(this.space(),this.word("extends"),this.space(),this.print(e.superClass,e),this.print(e.superTypeParameters,e)),e.implements&&(this.space(),this.word("implements"),this.space(),this.printList(e.implements,e)),this.space(),this.print(e.body,e)}function $A(e){this.tokenChar(123),0===e.body.length?this.tokenChar(125):(this.newline(),this.printSequence(e.body,e,{indent:!0}),this.endsWith(10)||this.newline(),this.rightBrace(e))}function QA(e){var t;this.printJoin(e.decorators,e);var r=null==(t=e.key.loc)||null==(t=t.end)?void 0:t.line;r&&this.catchUp(r),this.tsPrintClassMemberModifiers(e),e.computed?(this.tokenChar(91),this.print(e.key,e),this.tokenChar(93)):(this._variance(e),this.print(e.key,e)),e.optional&&this.tokenChar(63),e.definite&&this.tokenChar(33),this.print(e.typeAnnotation,e),e.value&&(this.space(),this.tokenChar(61),this.space(),this.print(e.value,e)),this.semicolon()}function ZA(e){var t;this.printJoin(e.decorators,e);var r=null==(t=e.key.loc)||null==(t=t.end)?void 0:t.line;r&&this.catchUp(r),this.tsPrintClassMemberModifiers(e),this.word("accessor",!0),this.space(),e.computed?(this.tokenChar(91),this.print(e.key,e),this.tokenChar(93)):(this._variance(e),this.print(e.key,e)),e.optional&&this.tokenChar(63),e.definite&&this.tokenChar(33),this.print(e.typeAnnotation,e),e.value&&(this.space(),this.tokenChar(61),this.space(),this.print(e.value,e)),this.semicolon()}function eC(e){this.printJoin(e.decorators,e),e.static&&(this.word("static"),this.space()),this.print(e.key,e),this.print(e.typeAnnotation,e),e.value&&(this.space(),this.tokenChar(61),this.space(),this.print(e.value,e)),this.semicolon()}function tC(e){this._classMethodHead(e),this.space(),this.print(e.body,e)}function rC(e){this._classMethodHead(e),this.space(),this.print(e.body,e)}function nC(e){var t;this.printJoin(e.decorators,e);var r=null==(t=e.key.loc)||null==(t=t.end)?void 0:t.line;r&&this.catchUp(r),this.tsPrintClassMemberModifiers(e),this._methodHead(e)}function aC(e){this.word("static"),this.space(),this.tokenChar(123),0===e.body.length?this.tokenChar(125):(this.newline(),this.printSequence(e.body,e,{indent:!0}),this.rightBrace(e))}var sC=Te;function iC(e,t,r){this.print(e.typeParameters,e);var n=hC.call(this,t,r);n&&this.sourceIdentifierName(n.name,n.pos),this.tokenChar(40),this._parameters(e.params,e),this.tokenChar(41);var a="ArrowFunctionExpression"===e.type;this.print(e.returnType,e,a),this._noLineTerminator=a}function oC(e,t){for(var r=e.length,n=0;n"),this.space(),this.print(e.body,e)}function gC(e,t){var r,n;return!!(e.typeParameters||e.returnType||e.predicate||t.typeAnnotation||t.optional||null!=(r=t.leadingComments)&&r.length||null!=(n=t.trailingComments)&&n.length)}function hC(e,t){var r=e;if(!r&&t){var n=t.type;"VariableDeclarator"===n?r=t.id:"AssignmentExpression"===n||"AssignmentPattern"===n?r=t.left:"ObjectProperty"===n||"ClassProperty"===n?t.computed&&"StringLiteral"!==t.key.type||(r=t.key):"ClassPrivateProperty"!==n&&"ClassAccessorProperty"!==n||(r=t.key)}if(r){var a,s,i;if("Identifier"===r.type)a={pos:null==(s=r.loc)?void 0:s.start,name:(null==(i=r.loc)?void 0:i.identifierName)||r.name};else if("PrivateName"===r.type){var o;a={pos:null==(o=r.loc)?void 0:o.start,name:"#"+r.id.name}}else if("StringLiteral"===r.type){var d;a={pos:null==(d=r.loc)?void 0:d.start,name:r.value}}return a}}var mC=at,yC=mn,vC=St,bC=ut,xC=pt,RC=Ga;function EC(e){"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space()),this.print(e.imported,e),e.local&&e.local.name!==e.imported.name&&(this.space(),this.word("as"),this.space(),this.print(e.local,e))}function TC(e){this.print(e.local,e)}function wC(e){this.print(e.exported,e)}function jC(e){"type"===e.exportKind&&(this.word("type"),this.space()),this.print(e.local,e),e.exported&&e.local.name!==e.exported.name&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e))}function SC(e){this.tokenChar(42),this.space(),this.word("as"),this.space(),this.print(e.exported,e)}var AC,CC,kC=!1;function _C(e){var t=this.format.importAttributesKeyword,r=e.attributes,n=e.assertions;!r||t||kC||(kC=!0,console.warn('You are using import attributes, without specifying the desired output syntax.\nPlease specify the "importAttributesKeyword" generator option, whose value can be one of:\n - "with" : `import { a } from "b" with { type: "json" };`\n - "assert" : `import { a } from "b" assert { type: "json" };`\n - "with-legacy" : `import { a } from "b" with type: "json";`\n'));var a="assert"===t||!t&&n;this.word(a?"assert":"with"),this.space(),a||"with"===t?(this.tokenChar(123),this.space(),this.printList(r||n,e),this.space(),this.tokenChar(125)):this.printList(r||n,e)}function PC(e){var t,r;this.word("export"),this.space(),"type"===e.exportKind&&(this.word("type"),this.space()),this.tokenChar(42),this.space(),this.word("from"),this.space(),null!=(t=e.attributes)&&t.length||null!=(r=e.assertions)&&r.length?(this.print(e.source,e,!0),this.space(),this._printAttributes(e)):this.print(e.source,e),this.semicolon()}function IC(e,t){mC(t.declaration)&&e._shouldPrintDecoratorsBeforeExport(t)&&e.printJoin(t.declaration.decorators,t)}function DC(e){if(IC(this,e),this.word("export"),this.space(),e.declaration){var t=e.declaration;this.print(t,e),RC(t)||this.semicolon()}else{"type"===e.exportKind&&(this.word("type"),this.space());for(var r,n,a=e.specifiers.slice(0),s=!1;;){var i=a[0];if(!yC(i)&&!vC(i))break;s=!0,this.print(a.shift(),e),a.length&&(this.tokenChar(44),this.space())}(a.length||!a.length&&!s)&&(this.tokenChar(123),a.length&&(this.space(),this.printList(a,e),this.space()),this.tokenChar(125)),e.source&&(this.space(),this.word("from"),this.space(),null!=(r=e.attributes)&&r.length||null!=(n=e.assertions)&&n.length?(this.print(e.source,e,!0),this.space(),this._printAttributes(e)):this.print(e.source,e)),this.semicolon()}}function OC(e){IC(this,e),this.word("export"),this.noIndentInnerCommentsHere(),this.space(),this.word("default"),this.space();var t=e.declaration;this.print(t,e),RC(t)||this.semicolon()}function NC(e){var t,r;this.word("import"),this.space();var n="type"===e.importKind||"typeof"===e.importKind;n?(this.noIndentInnerCommentsHere(),this.word(e.importKind),this.space()):e.module&&(this.noIndentInnerCommentsHere(),this.word("module"),this.space());for(var a=e.specifiers.slice(0),s=!!a.length;s;){var i=a[0];if(!bC(i)&&!xC(i))break;this.print(a.shift(),e),a.length&&(this.tokenChar(44),this.space())}a.length?(this.tokenChar(123),this.space(),this.printList(a,e),this.space(),this.tokenChar(125)):n&&!s&&(this.tokenChar(123),this.tokenChar(125)),(s||n)&&(this.space(),this.word("from"),this.space()),null!=(t=e.attributes)&&t.length||null!=(r=e.assertions)&&r.length?(this.print(e.source,e,!0),this.space(),this._printAttributes(e)):this.print(e.source,e),this.semicolon()}function FC(e){this.print(e.key),this.tokenChar(58),this.space(),this.print(e.value)}function LC(e){this.tokenChar(42),this.space(),this.word("as"),this.space(),this.print(e.local,e)}function MC(){if(CC)return AC;CC=1;var e={},t=e.hasOwnProperty,r=function(e,r){for(var n in e)t.call(e,n)&&r(n,e[n])},n=function(e,t){return t?(r(t,(function(t,r){e[t]=r})),e):e},a=function(e,t){for(var r=e.length,n=-1;++n=55296&&U<=56319&&M>L+1){var H=F.charCodeAt(L+1);if(H>=56320&&H<=57343){var G=(1024*(U-55296)+H-56320+65536).toString(16);w||(G=G.toUpperCase()),R+="\\u{"+G+"}",++L;continue}}}if(!s.escapeEverything){if(y.test(B)){R+=B;continue}if('"'==B){R+=E==B?'\\"':B;continue}if("`"==B){R+=E==B?"\\`":B;continue}if("'"==B){R+=E==B?"\\'":B;continue}}if("\0"!=B||x||m.test(F.charAt(L+1)))if(h.test(B))R+=g[B];else{var W=B.charCodeAt(0);if(s.minimal&&8232!=W&&8233!=W)R+=B;else{var q=W.toString(16);w||(q=q.toUpperCase());var K=q.length>2||x,z="\\"+(K?"u":"x")+("0000"+q).slice(K?-4:-2);R+=z}}else R+="\\0"}return s.wrap&&(R=E+R+E),"`"==E&&(R=R.replace(/\$\{/g,"\\${")),s.isScriptContext?R.replace(/<\/(script|style)/gi,"<\\/$1").replace(/\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n if (code === 47) {\n effects.consume(code)\n closingTag = true\n return tagCloseStart\n }\n if (code === 63) {\n effects.consume(code)\n marker = 3\n // To do:\n // tokenizer.concrete = true\n // To do: use `markdown-rs` style interrupt.\n // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer = String.fromCharCode(code)\n return tagName\n }\n return nok(code)\n }\n\n /**\n * After ` | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n marker = 2\n return commentOpenInside\n }\n if (code === 91) {\n effects.consume(code)\n marker = 5\n index = 0\n return cdataOpenInside\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n marker = 4\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside\n }\n return nok(code)\n }\n\n /**\n * After ` | \n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside\n }\n return nok(code)\n }\n\n /**\n * After ` | &<]]>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = 'CDATA['\n if (code === value.charCodeAt(index++)) {\n effects.consume(code)\n if (index === value.length) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation\n }\n return cdataOpenInside\n }\n return nok(code)\n }\n\n /**\n * After ` | \n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer = String.fromCharCode(code)\n return tagName\n }\n return nok(code)\n }\n\n /**\n * In tag name.\n *\n * ```markdown\n * > | \n * ^^\n * > | \n * ^^\n * ```\n *\n * @type {State}\n */\n function tagName(code) {\n if (\n code === null ||\n code === 47 ||\n code === 62 ||\n markdownLineEndingOrSpace(code)\n ) {\n const slash = code === 47\n const name = buffer.toLowerCase()\n if (!slash && !closingTag && htmlRawNames.includes(name)) {\n marker = 1\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code)\n }\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n marker = 6\n if (slash) {\n effects.consume(code)\n return basicSelfClosing\n }\n\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code)\n }\n marker = 7\n // Do not support complete HTML when interrupting.\n return self.interrupt && !self.parser.lazy[self.now().line]\n ? nok(code)\n : closingTag\n ? completeClosingTagAfter(code)\n : completeAttributeNameBefore(code)\n }\n\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n buffer += String.fromCharCode(code)\n return tagName\n }\n return nok(code)\n }\n\n /**\n * After closing slash of a basic tag name.\n *\n * ```markdown\n * > |
\n * ^\n * ```\n *\n * @type {State}\n */\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code)\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation\n }\n return nok(code)\n }\n\n /**\n * After closing slash of a complete tag name.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeClosingTagAfter\n }\n return completeEnd(code)\n }\n\n /**\n * At an attribute name.\n *\n * At first, this state is used after a complete tag name, after whitespace,\n * where it expects optional attributes or the end of the tag.\n * It is also reused after attributes, when expecting more optional\n * attributes.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code)\n return completeEnd\n }\n\n // ASCII alphanumerical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return completeAttributeName\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameBefore\n }\n return completeEnd(code)\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeName(code) {\n // ASCII alphanumerical and `-`, `.`, `:`, and `_`.\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return completeAttributeName\n }\n return completeAttributeNameAfter(code)\n }\n\n /**\n * After attribute name, at an optional initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameAfter\n }\n return completeAttributeNameBefore(code)\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 34 || code === 39) {\n effects.consume(code)\n markerB = code\n return completeAttributeValueQuoted\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n return completeAttributeValueUnquoted(code)\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuoted(code) {\n if (code === markerB) {\n effects.consume(code)\n markerB = null\n return completeAttributeValueQuotedAfter\n }\n if (code === null || markdownLineEnding(code)) {\n return nok(code)\n }\n effects.consume(code)\n return completeAttributeValueQuoted\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 47 ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96 ||\n markdownLineEndingOrSpace(code)\n ) {\n return completeAttributeNameAfter(code)\n }\n effects.consume(code)\n return completeAttributeValueUnquoted\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the\n * end of the tag.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code)\n }\n return nok(code)\n }\n\n /**\n * In certain circumstances of a complete tag where only an `>` is allowed.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code)\n return completeAfter\n }\n return nok(code)\n }\n\n /**\n * After `>` in a complete tag.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return continuation(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAfter\n }\n return nok(code)\n }\n\n /**\n * In continuation of any HTML kind.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuation(code) {\n if (code === 45 && marker === 2) {\n effects.consume(code)\n return continuationCommentInside\n }\n if (code === 60 && marker === 1) {\n effects.consume(code)\n return continuationRawTagOpen\n }\n if (code === 62 && marker === 4) {\n effects.consume(code)\n return continuationClose\n }\n if (code === 63 && marker === 3) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n if (code === 93 && marker === 5) {\n effects.consume(code)\n return continuationCdataInside\n }\n if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {\n effects.exit('htmlFlowData')\n return effects.check(\n blankLineBefore,\n continuationAfter,\n continuationStart\n )(code)\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return continuationStart(code)\n }\n effects.consume(code)\n return continuation\n }\n\n /**\n * In continuation, at eol.\n *\n * ```markdown\n * > | \n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStart(code) {\n return effects.check(\n nonLazyContinuationStart,\n continuationStartNonLazy,\n continuationAfter\n )(code)\n }\n\n /**\n * In continuation, at eol, before non-lazy content.\n *\n * ```markdown\n * > | \n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStartNonLazy(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return continuationBefore\n }\n\n /**\n * In continuation, before non-lazy content.\n *\n * ```markdown\n * | \n * > | asd\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return continuationStart(code)\n }\n effects.enter('htmlFlowData')\n return continuation(code)\n }\n\n /**\n * In comment continuation, after one `-`, expecting another.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In raw continuation, after `<`, at `/`.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code)\n buffer = ''\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In raw continuation, after ` | \n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase()\n if (htmlRawNames.includes(name)) {\n effects.consume(code)\n return continuationClose\n }\n return continuation(code)\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer += String.fromCharCode(code)\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code)\n return continuationClose\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return continuationAfter(code)\n }\n effects.consume(code)\n return continuationClose\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit('htmlFlow')\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuationStart(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return after\n }\n return nok(code)\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > |
\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return effects.attempt(blankLine, ok, nok)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nconst nonLazyContinuation = {\n tokenize: tokenizeNonLazyContinuation,\n partial: true\n}\n\n/** @type {Construct} */\nexport const codeFenced = {\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced,\n concrete: true\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this\n /** @type {Construct} */\n const closeStart = {\n tokenize: tokenizeCloseStart,\n partial: true\n }\n let initialPrefix = 0\n let sizeOpen = 0\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code)\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1]\n initialPrefix =\n tail && tail[1].type === 'linePrefix'\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n marker = code\n effects.enter('codeFenced')\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++\n effects.consume(code)\n return sequenceOpen\n }\n if (sizeOpen < 3) {\n return nok(code)\n }\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, infoBefore, 'whitespace')(code)\n : infoBefore(code)\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return self.interrupt\n ? ok(code)\n : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFencedFenceInfo')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return info(code)\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return infoBefore(code)\n }\n if (markdownSpace(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return factorySpace(effects, metaBefore, 'whitespace')(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return info\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code)\n }\n effects.enter('codeFencedFenceMeta')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return meta(code)\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceMeta')\n return infoBefore(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return meta\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code)\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return contentStart\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code)\n ? factorySpace(\n effects,\n beforeContentChunk,\n 'linePrefix',\n initialPrefix + 1\n )(code)\n : beforeContentChunk(code)\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFlowValue')\n return contentChunk(code)\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return beforeContentChunk(code)\n }\n effects.consume(code)\n return contentChunk\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit('codeFenced')\n return ok(code)\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0\n return startBefore\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return start\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter('codeFencedFence')\n return markdownSpace(code)\n ? factorySpace(\n effects,\n beforeSequenceClose,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : beforeSequenceClose(code)\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter('codeFencedFenceSequence')\n return sequenceClose(code)\n }\n return nok(code)\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++\n effects.consume(code)\n return sequenceClose\n }\n if (size >= sizeOpen) {\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, sequenceCloseAfter, 'whitespace')(code)\n : sequenceCloseAfter(code)\n }\n return nok(code)\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return ok(code)\n }\n return nok(code)\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this\n return start\n\n /**\n *\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code)\n }\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineStart\n }\n\n /**\n *\n *\n * @type {State}\n */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {\n asciiAlphanumeric,\n asciiDigit,\n asciiHexDigit\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this\n let size = 0\n /** @type {number} */\n let max\n /** @type {(code: Code) => boolean} */\n let test\n return start\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterReference')\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n return open\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter('characterReferenceMarkerNumeric')\n effects.consume(code)\n effects.exit('characterReferenceMarkerNumeric')\n return numeric\n }\n effects.enter('characterReferenceValue')\n max = 31\n test = asciiAlphanumeric\n return value(code)\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter('characterReferenceMarkerHexadecimal')\n effects.consume(code)\n effects.exit('characterReferenceMarkerHexadecimal')\n effects.enter('characterReferenceValue')\n max = 6\n test = asciiHexDigit\n return value\n }\n effects.enter('characterReferenceValue')\n max = 7\n test = asciiDigit\n return value(code)\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit('characterReferenceValue')\n if (\n test === asciiAlphanumeric &&\n !decodeNamedCharacterReference(self.sliceSerialize(token))\n ) {\n return nok(code)\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n effects.exit('characterReference')\n return ok\n }\n if (test(code) && size++ < max) {\n effects.consume(code)\n return value\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {asciiPunctuation} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n effects.exit('escapeMarker')\n return inside\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter('characterEscapeValue')\n effects.consume(code)\n effects.exit('characterEscapeValue')\n effects.exit('characterEscape')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start\n\n /** @type {State} */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, ok, 'linePrefix')\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factoryDestination} from 'micromark-factory-destination'\nimport {factoryLabel} from 'micromark-factory-label'\nimport {factoryTitle} from 'micromark-factory-title'\nimport {factoryWhitespace} from 'micromark-factory-whitespace'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {push, splice} from 'micromark-util-chunked'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n}\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n}\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n}\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n}\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1\n while (++index < events.length) {\n const token = events[index][1]\n if (\n token.type === 'labelImage' ||\n token.type === 'labelLink' ||\n token.type === 'labelEnd'\n ) {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2)\n token.type = 'data'\n index++\n }\n }\n return events\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length\n let offset = 0\n /** @type {Token} */\n let token\n /** @type {number | undefined} */\n let open\n /** @type {number | undefined} */\n let close\n /** @type {Array} */\n let media\n\n // Find an opening.\n while (index--) {\n token = events[index][1]\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (\n token.type === 'link' ||\n (token.type === 'labelLink' && token._inactive)\n ) {\n break\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true\n }\n } else if (close) {\n if (\n events[index][0] === 'enter' &&\n (token.type === 'labelImage' || token.type === 'labelLink') &&\n !token._balanced\n ) {\n open = index\n if (token.type !== 'labelLink') {\n offset = 2\n break\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index\n }\n }\n const group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n const label = {\n type: 'label',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[close][1].end)\n }\n const text = {\n type: 'labelText',\n start: Object.assign({}, events[open + offset + 2][1].end),\n end: Object.assign({}, events[close - 2][1].start)\n }\n media = [\n ['enter', group, context],\n ['enter', label, context]\n ]\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3))\n\n // Text open.\n media = push(media, [['enter', text, context]])\n\n // Always populated by defaults.\n\n // Between.\n media = push(\n media,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + offset + 4, close - 3),\n context\n )\n )\n\n // Text close, marker close, label close.\n media = push(media, [\n ['exit', text, context],\n events[close - 2],\n events[close - 1],\n ['exit', label, context]\n ])\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1))\n\n // Media close.\n media = push(media, [['exit', group, context]])\n splice(events, open, events.length, media)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Token} */\n let labelStart\n /** @type {boolean} */\n let defined\n\n // Find an opening.\n while (index--) {\n if (\n (self.events[index][1].type === 'labelImage' ||\n self.events[index][1].type === 'labelLink') &&\n !self.events[index][1]._balanced\n ) {\n labelStart = self.events[index][1]\n break\n }\n }\n return start\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code)\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code)\n }\n defined = self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n )\n effects.enter('labelEnd')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelEnd')\n return after\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(\n resourceConstruct,\n labelEndOk,\n defined ? labelEndOk : labelEndNok\n )(code)\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(\n referenceFullConstruct,\n labelEndOk,\n defined ? referenceNotFull : labelEndNok\n )(code)\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code)\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(\n referenceCollapsedConstruct,\n labelEndOk,\n labelEndNok\n )(code)\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n return ok(code)\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter('resource')\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n return resourceBefore\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceOpen)(code)\n : resourceOpen(code)\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code)\n }\n return factoryDestination(\n effects,\n resourceDestinationAfter,\n resourceDestinationMissing,\n 'resourceDestination',\n 'resourceDestinationLiteral',\n 'resourceDestinationLiteralMarker',\n 'resourceDestinationRaw',\n 'resourceDestinationString',\n 32\n )(code)\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceBetween)(code)\n : resourceEnd(code)\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code)\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n resourceTitleAfter,\n nok,\n 'resourceTitle',\n 'resourceTitleMarker',\n 'resourceTitleString'\n )(code)\n }\n return resourceEnd(code)\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceEnd)(code)\n : resourceEnd(code)\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n effects.exit('resource')\n return ok\n }\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this\n return referenceFull\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(\n self,\n effects,\n referenceFullAfter,\n referenceFullMissing,\n 'reference',\n 'referenceMarker',\n 'referenceString'\n )(code)\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n )\n ? ok(code)\n : nok(code)\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter('reference')\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n return referenceCollapsedOpen\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n effects.exit('reference')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n tokenize: tokenizeLabelStartImage,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelImage')\n effects.enter('labelImageMarker')\n effects.consume(code)\n effects.exit('labelImageMarker')\n return open\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelImage')\n return after\n }\n return nok(code)\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n *

!^a

\n *

!^a

\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\n\nimport {\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n if (unicodePunctuation(code)) {\n return 2\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {push, splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n tokenize: tokenizeAttention,\n resolveAll: resolveAllAttention\n}\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\nfunction resolveAllAttention(events, context) {\n let index = -1\n /** @type {number} */\n let open\n /** @type {Token} */\n let group\n /** @type {Token} */\n let text\n /** @type {Token} */\n let openingSequence\n /** @type {Token} */\n let closingSequence\n /** @type {number} */\n let use\n /** @type {Array} */\n let nextEvents\n /** @type {number} */\n let offset\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'attentionSequence' &&\n events[index][1]._close\n ) {\n open = index\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'attentionSequence' &&\n events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) ===\n context.sliceSerialize(events[index][1]).charCodeAt(0)\n ) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if (\n (events[open][1]._close || events[index][1]._open) &&\n (events[index][1].end.offset - events[index][1].start.offset) % 3 &&\n !(\n (events[open][1].end.offset -\n events[open][1].start.offset +\n events[index][1].end.offset -\n events[index][1].start.offset) %\n 3\n )\n ) {\n continue\n }\n\n // Number of markers to use from the sequence.\n use =\n events[open][1].end.offset - events[open][1].start.offset > 1 &&\n events[index][1].end.offset - events[index][1].start.offset > 1\n ? 2\n : 1\n const start = Object.assign({}, events[open][1].end)\n const end = Object.assign({}, events[index][1].start)\n movePoint(start, -use)\n movePoint(end, use)\n openingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start,\n end: Object.assign({}, events[open][1].end)\n }\n closingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: Object.assign({}, events[index][1].start),\n end\n }\n text = {\n type: use > 1 ? 'strongText' : 'emphasisText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n group = {\n type: use > 1 ? 'strong' : 'emphasis',\n start: Object.assign({}, openingSequence.start),\n end: Object.assign({}, closingSequence.end)\n }\n events[open][1].end = Object.assign({}, openingSequence.start)\n events[index][1].start = Object.assign({}, closingSequence.end)\n nextEvents = []\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [\n ['enter', events[open][1], context],\n ['exit', events[open][1], context]\n ])\n }\n\n // Opening.\n nextEvents = push(nextEvents, [\n ['enter', group, context],\n ['enter', openingSequence, context],\n ['exit', openingSequence, context],\n ['enter', text, context]\n ])\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(\n nextEvents,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n )\n\n // Closing.\n nextEvents = push(nextEvents, [\n ['exit', text, context],\n ['enter', closingSequence, context],\n ['exit', closingSequence, context],\n ['exit', group, context]\n ])\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2\n nextEvents = push(nextEvents, [\n ['enter', events[index][1], context],\n ['exit', events[index][1], context]\n ])\n } else {\n offset = 0\n }\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - offset - 2\n break\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data'\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null\n const previous = this.previous\n const before = classifyCharacter(previous)\n\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code\n effects.enter('attentionSequence')\n return inside(code)\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code)\n return inside\n }\n const token = effects.exit('attentionSequence')\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code)\n\n // Always populated by defaults.\n\n const open =\n !after || (after === 2 && before) || attentionMarkers.includes(code)\n const close =\n !before || (before === 2 && after) || attentionMarkers.includes(previous)\n token._open = Boolean(marker === 42 ? open : open && (before || !close))\n token._close = Boolean(marker === 42 ? close : close && (after || !open))\n return ok(code)\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * @param {number} offset\n * @returns {void}\n */\nfunction movePoint(point, offset) {\n point.column += offset\n point.offset += offset\n point._bufferIndex += offset\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiAtext,\n asciiControl\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0\n return start\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('autolink')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.enter('autolinkProtocol')\n return open\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return schemeOrEmailAtext\n }\n return emailAtext(code)\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1\n return schemeInsideOrEmailAtext(code)\n }\n return emailAtext(code)\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code)\n size = 0\n return urlInside\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (\n (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) &&\n size++ < 32\n ) {\n effects.consume(code)\n return schemeInsideOrEmailAtext\n }\n size = 0\n return emailAtext(code)\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit('autolinkProtocol')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code)\n }\n effects.consume(code)\n return urlInside\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code)\n return emailAtSignOrDot\n }\n if (asciiAtext(code)) {\n effects.consume(code)\n return emailAtext\n }\n return nok(code)\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | ab\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code)\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit('autolinkProtocol').type = 'autolinkEmail'\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n return emailValue(code)\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel\n effects.consume(code)\n return next\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this\n /** @type {NonNullable | undefined} */\n let marker\n /** @type {number} */\n let index\n /** @type {State} */\n let returnState\n return start\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('htmlText')\n effects.enter('htmlTextData')\n effects.consume(code)\n return open\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a c\n * ^\n * > | a c\n * ^\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n if (code === 63) {\n effects.consume(code)\n return instruction\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagOpen\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * > | a c\n * ^\n * > | a &<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentOpenInside\n }\n if (code === 91) {\n effects.consume(code)\n index = 0\n return cdataOpenInside\n }\n if (asciiAlpha(code)) {\n effects.consume(code)\n return declaration\n }\n return nok(code)\n }\n\n /**\n * In a comment, after ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return nok(code)\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 45) {\n effects.consume(code)\n return commentClose\n }\n if (markdownLineEnding(code)) {\n returnState = comment\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return comment\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return comment(code)\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62\n ? end(code)\n : code === 45\n ? commentClose(code)\n : comment(code)\n }\n\n /**\n * After ` | a &<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = 'CDATA['\n if (code === value.charCodeAt(index++)) {\n effects.consume(code)\n return index === value.length ? cdata : cdataOpenInside\n }\n return nok(code)\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a &<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataClose\n }\n if (markdownLineEnding(code)) {\n returnState = cdata\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return cdata\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code)\n }\n if (markdownLineEnding(code)) {\n returnState = declaration\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return declaration\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 63) {\n effects.consume(code)\n return instructionClose\n }\n if (markdownLineEnding(code)) {\n returnState = instruction\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return instruction\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagClose\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagClose\n }\n return tagCloseBetween(code)\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagCloseBetween\n }\n return end(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagOpen\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code)\n return end\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenBetween\n }\n return end(code)\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n return tagOpenAttributeNameAfter(code)\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeNameAfter\n }\n return tagOpenBetween(code)\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return tagOpenAttributeValueQuoted\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code)\n marker = undefined\n return tagOpenAttributeValueQuotedAfter\n }\n if (code === null) {\n return nok(code)\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueQuoted\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code)\n effects.exit('htmlTextData')\n effects.exit('htmlText')\n return ok\n }\n return nok(code)\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a \n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit('htmlTextData')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineEndingAfter\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code)\n ? factorySpace(\n effects,\n lineEndingAfterPrefix,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : lineEndingAfterPrefix(code)\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter('htmlTextData')\n return returnState(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n tokenize: tokenizeLabelStartLink,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelLink')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelLink')\n return after\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('hardBreakEscape')\n effects.consume(code)\n return after\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit('hardBreakEscape')\n return ok(code)\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n tokenize: tokenizeCodeText,\n resolve: resolveCodeText,\n previous\n}\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4\n let headEnterIndex = 3\n /** @type {number} */\n let index\n /** @type {number | undefined} */\n let enter\n\n // If we start and end with an EOL or a space.\n if (\n (events[headEnterIndex][1].type === 'lineEnding' ||\n events[headEnterIndex][1].type === 'space') &&\n (events[tailExitIndex][1].type === 'lineEnding' ||\n events[tailExitIndex][1].type === 'space')\n ) {\n index = headEnterIndex\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'codeTextData') {\n // Then we have padding.\n events[headEnterIndex][1].type = 'codeTextPadding'\n events[tailExitIndex][1].type = 'codeTextPadding'\n headEnterIndex += 2\n tailExitIndex -= 2\n break\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1\n tailExitIndex++\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') {\n enter = index\n }\n } else if (\n index === tailExitIndex ||\n events[index][1].type === 'lineEnding'\n ) {\n events[enter][1].type = 'codeTextData'\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n tailExitIndex -= index - enter - 2\n index = enter + 2\n }\n enter = undefined\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return (\n code !== 96 ||\n this.events[this.events.length - 1][1].type === 'characterEscape'\n )\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this\n let sizeOpen = 0\n /** @type {number} */\n let size\n /** @type {Token} */\n let token\n return start\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('codeText')\n effects.enter('codeTextSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code)\n sizeOpen++\n return sequenceOpen\n }\n effects.exit('codeTextSequence')\n return between(code)\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code)\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space')\n effects.consume(code)\n effects.exit('space')\n return between\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter('codeTextSequence')\n size = 0\n return sequenceClose(code)\n }\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return between\n }\n\n // Data.\n effects.enter('codeTextData')\n return data(code)\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (\n code === null ||\n code === 32 ||\n code === 96 ||\n markdownLineEnding(code)\n ) {\n effects.exit('codeTextData')\n return between(code)\n }\n effects.consume(code)\n return data\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code)\n size++\n return sequenceClose\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit('codeTextSequence')\n effects.exit('codeText')\n return ok(code)\n }\n\n // More or less accents: mark as data.\n token.type = 'codeTextData'\n return data(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n */\n\nimport {\n attention,\n autolink,\n blockQuote,\n characterEscape,\n characterReference,\n codeFenced,\n codeIndented,\n codeText,\n definition,\n hardBreakEscape,\n headingAtx,\n htmlFlow,\n htmlText,\n labelEnd,\n labelStartImage,\n labelStartLink,\n lineEnding,\n list,\n setextUnderline,\n thematicBreak\n} from 'micromark-core-commonmark'\nimport {resolver as resolveText} from './initialize/text.js'\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n}\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n}\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n}\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n}\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n}\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n}\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n}\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n}\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n}\n","/**\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Value} Value\n */\n\n/**\n * @callback Preprocessor\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {boolean | null | undefined} [end=false]\n * @returns {Array}\n */\n\nconst search = /[\\0\\t\\n\\r]/g\n\n/**\n * @returns {Preprocessor}\n */\nexport function preprocess() {\n let column = 1\n let buffer = ''\n /** @type {boolean | undefined} */\n let start = true\n /** @type {boolean | undefined} */\n let atCarriageReturn\n return preprocessor\n\n /** @type {Preprocessor} */\n function preprocessor(value, encoding, end) {\n /** @type {Array} */\n const chunks = []\n /** @type {RegExpMatchArray | null} */\n let match\n /** @type {number} */\n let next\n /** @type {number} */\n let startPosition\n /** @type {number} */\n let endPosition\n /** @type {Code} */\n let code\n\n // @ts-expect-error `Buffer` does allow an encoding.\n value = buffer + value.toString(encoding)\n startPosition = 0\n buffer = ''\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++\n }\n start = undefined\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition\n match = search.exec(value)\n endPosition =\n match && match.index !== undefined ? match.index : value.length\n code = value.charCodeAt(endPosition)\n if (!match) {\n buffer = value.slice(startPosition)\n break\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3)\n atCarriageReturn = undefined\n } else {\n if (atCarriageReturn) {\n chunks.push(-5)\n atCarriageReturn = undefined\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition))\n column += endPosition - startPosition\n }\n switch (code) {\n case 0: {\n chunks.push(65533)\n column++\n break\n }\n case 9: {\n next = Math.ceil(column / 4) * 4\n chunks.push(-2)\n while (column++ < next) chunks.push(-1)\n break\n }\n case 10: {\n chunks.push(-4)\n column = 1\n break\n }\n default: {\n atCarriageReturn = true\n column = 1\n }\n }\n }\n startPosition = endPosition + 1\n }\n if (end) {\n if (atCarriageReturn) chunks.push(-5)\n if (buffer) chunks.push(buffer)\n chunks.push(null)\n }\n return chunks\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCharCode(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base)\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 ||\n code === 11 ||\n (code > 13 && code < 32) ||\n // Control character (DEL) of C0, and C1 controls.\n (code > 126 && code < 160) ||\n // Lone high surrogates and low surrogates.\n (code > 55295 && code < 57344) ||\n // Noncharacters.\n (code > 64975 && code < 65008) /* eslint-disable no-bitwise */ ||\n (code & 65535) === 65535 ||\n (code & 65535) === 65534 /* eslint-enable no-bitwise */ ||\n // Out of range\n code > 1114111\n ) {\n return '\\uFFFD'\n }\n return String.fromCharCode(code)\n}\n","import {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nconst characterEscapeOrReference =\n /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @param {string} $2\n * @returns {string}\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1\n }\n\n // Reference.\n const head = $2.charCodeAt(0)\n if (head === 35) {\n const head = $2.charCodeAt(1)\n const hex = head === 120 || head === 88\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10)\n }\n return decodeNamedCharacterReference($2) || $0\n}\n","/**\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Value} Value\n *\n * @typedef {import('unist').Parent} UnistParent\n * @typedef {import('unist').Point} Point\n *\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Break} Break\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('mdast').Code} Code\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('mdast').HTML} HTML\n * @typedef {import('mdast').Image} Image\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').List} List\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('mdast').Text} Text\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('mdast').ReferenceType} ReferenceType\n * @typedef {import('../index.js').CompileData} CompileData\n */\n\n/**\n * @typedef {Root | Content} Node\n * @typedef {Extract} Parent\n *\n * @typedef {Omit & {type: 'fragment', children: Array}} Fragment\n */\n\n/**\n * @callback Transform\n * Extra transform, to change the AST afterwards.\n * @param {Root} tree\n * Tree to transform.\n * @returns {Root | undefined | null | void}\n * New tree or nothing (in which case the current tree is used).\n *\n * @callback Handle\n * Handle a token.\n * @param {CompileContext} this\n * Context.\n * @param {Token} token\n * Current token.\n * @returns {void}\n * Nothing.\n *\n * @typedef {Record} Handles\n * Token types mapping to handles\n *\n * @callback OnEnterError\n * Handle the case where the `right` token is open, but it is closed (by the\n * `left` token) or because we reached the end of the document.\n * @param {Omit} this\n * Context.\n * @param {Token | undefined} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {void}\n * Nothing.\n *\n * @callback OnExitError\n * Handle the case where the `right` token is open but it is closed by\n * exiting the `left` token.\n * @param {Omit} this\n * Context.\n * @param {Token} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {void}\n * Nothing.\n *\n * @typedef {[Token, OnEnterError | undefined]} TokenTuple\n * Open token on the stack, with an optional error handler for when\n * that token isn’t closed properly.\n */\n\n/**\n * @typedef Config\n * Configuration.\n *\n * We have our defaults, but extensions will add more.\n * @property {Array} canContainEols\n * Token types where line endings are used.\n * @property {Handles} enter\n * Opening handles.\n * @property {Handles} exit\n * Closing handles.\n * @property {Array} transforms\n * Tree transforms.\n *\n * @typedef {Partial} Extension\n * Change how markdown tokens from micromark are turned into mdast.\n *\n * @typedef CompileContext\n * mdast compiler context.\n * @property {Array} stack\n * Stack of nodes.\n * @property {Array} tokenStack\n * Stack of tokens.\n * @property {(key: Key) => CompileData[Key]} getData\n * Get data from the key/value store.\n * @property {(key: Key, value?: CompileData[Key]) => void} setData\n * Set data into the key/value store.\n * @property {(this: CompileContext) => void} buffer\n * Capture some of the output data.\n * @property {(this: CompileContext) => string} resume\n * Stop capturing and access the output data.\n * @property {(this: CompileContext, node: Kind, token: Token, onError?: OnEnterError) => Kind} enter\n * Enter a token.\n * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit\n * Exit a token.\n * @property {TokenizeContext['sliceSerialize']} sliceSerialize\n * Get the string value of a token.\n * @property {Config} config\n * Configuration.\n *\n * @typedef FromMarkdownOptions\n * Configuration for how to build mdast.\n * @property {Array> | null | undefined} [mdastExtensions]\n * Extensions for this utility to change how tokens are turned into a tree.\n *\n * @typedef {ParseOptions & FromMarkdownOptions} Options\n * Configuration.\n */\n\n// To do: micromark: create a registry of tokens?\n// To do: next major: don’t return given `Node` from `enter`.\n// To do: next major: remove setter/getter.\n\nimport {toString} from 'mdast-util-to-string'\nimport {parse} from 'micromark/lib/parse.js'\nimport {preprocess} from 'micromark/lib/preprocess.js'\nimport {postprocess} from 'micromark/lib/postprocess.js'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nimport {decodeString} from 'micromark-util-decode-string'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {stringifyPosition} from 'unist-util-stringify-position'\nconst own = {}.hasOwnProperty\n\n/**\n * @param value\n * Markdown to parse.\n * @param encoding\n * Character encoding for when `value` is `Buffer`.\n * @param options\n * Configuration.\n * @returns\n * mdast tree.\n */\nexport const fromMarkdown =\n /**\n * @type {(\n * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &\n * ((value: Value, options?: Options | null | undefined) => Root)\n * )}\n */\n\n /**\n * @param {Value} value\n * @param {Encoding | Options | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n */\n function (value, encoding, options) {\n if (typeof encoding !== 'string') {\n options = encoding\n encoding = undefined\n }\n return compiler(options)(\n postprocess(\n parse(options).document().write(preprocess()(value, encoding, true))\n )\n )\n }\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n }\n configure(config, (options || {}).mdastExtensions || [])\n\n /** @type {CompileData} */\n const data = {}\n return compile\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n }\n /** @type {Omit} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n setData,\n getData\n }\n /** @type {Array} */\n const listStack = []\n let index = -1\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (\n events[index][1].type === 'listOrdered' ||\n events[index][1].type === 'listUnordered'\n ) {\n if (events[index][0] === 'enter') {\n listStack.push(index)\n } else {\n const tail = listStack.pop()\n index = prepareList(events, tail, index)\n }\n }\n }\n index = -1\n while (++index < events.length) {\n const handler = config[events[index][0]]\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(\n Object.assign(\n {\n sliceSerialize: events[index][2].sliceSerialize\n },\n context\n ),\n events[index][1]\n )\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1]\n const handler = tail[1] || defaultOnError\n handler.call(context, undefined, tail[0])\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(\n events.length > 0\n ? events[0][1].start\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n ),\n end: point(\n events.length > 0\n ? events[events.length - 2][1].end\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n )\n }\n\n // Call transforms.\n index = -1\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree\n }\n return tree\n }\n\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n function prepareList(events, start, length) {\n let index = start - 1\n let containerBalance = -1\n let listSpread = false\n /** @type {Token | undefined} */\n let listItem\n /** @type {number | undefined} */\n let lineIndex\n /** @type {number | undefined} */\n let firstBlankLineIndex\n /** @type {boolean | undefined} */\n let atMarker\n while (++index <= length) {\n const event = events[index]\n if (\n event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered' ||\n event[1].type === 'blockQuote'\n ) {\n if (event[0] === 'enter') {\n containerBalance++\n } else {\n containerBalance--\n }\n atMarker = undefined\n } else if (event[1].type === 'lineEndingBlank') {\n if (event[0] === 'enter') {\n if (\n listItem &&\n !atMarker &&\n !containerBalance &&\n !firstBlankLineIndex\n ) {\n firstBlankLineIndex = index\n }\n atMarker = undefined\n }\n } else if (\n event[1].type === 'linePrefix' ||\n event[1].type === 'listItemValue' ||\n event[1].type === 'listItemMarker' ||\n event[1].type === 'listItemPrefix' ||\n event[1].type === 'listItemPrefixWhitespace'\n ) {\n // Empty.\n } else {\n atMarker = undefined\n }\n if (\n (!containerBalance &&\n event[0] === 'enter' &&\n event[1].type === 'listItemPrefix') ||\n (containerBalance === -1 &&\n event[0] === 'exit' &&\n (event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered'))\n ) {\n if (listItem) {\n let tailIndex = index\n lineIndex = undefined\n while (tailIndex--) {\n const tailEvent = events[tailIndex]\n if (\n tailEvent[1].type === 'lineEnding' ||\n tailEvent[1].type === 'lineEndingBlank'\n ) {\n if (tailEvent[0] === 'exit') continue\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n listSpread = true\n }\n tailEvent[1].type = 'lineEnding'\n lineIndex = tailIndex\n } else if (\n tailEvent[1].type === 'linePrefix' ||\n tailEvent[1].type === 'blockQuotePrefix' ||\n tailEvent[1].type === 'blockQuotePrefixWhitespace' ||\n tailEvent[1].type === 'blockQuoteMarker' ||\n tailEvent[1].type === 'listItemIndent'\n ) {\n // Empty\n } else {\n break\n }\n }\n if (\n firstBlankLineIndex &&\n (!lineIndex || firstBlankLineIndex < lineIndex)\n ) {\n listItem._spread = true\n }\n\n // Fix position.\n listItem.end = Object.assign(\n {},\n lineIndex ? events[lineIndex][1].start : event[1].end\n )\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])\n index++\n length++\n }\n\n // Create a new list item.\n if (event[1].type === 'listItemPrefix') {\n listItem = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n }\n // @ts-expect-error: `listItem` is most definitely defined, TS...\n events.splice(index, 0, ['enter', listItem, event[2]])\n index++\n length++\n firstBlankLineIndex = undefined\n atMarker = true\n }\n }\n }\n events[start][1]._spread = listSpread\n return length\n }\n\n /**\n * Set data.\n *\n * @template {keyof CompileData} Key\n * Field type.\n * @param {Key} key\n * Key of field.\n * @param {CompileData[Key]} [value]\n * New value.\n * @returns {void}\n * Nothing.\n */\n function setData(key, value) {\n data[key] = value\n }\n\n /**\n * Get data.\n *\n * @template {keyof CompileData} Key\n * Field type.\n * @param {Key} key\n * Key of field.\n * @returns {CompileData[Key]}\n * Value.\n */\n function getData(key) {\n return data[key]\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Node} create\n * Create a node.\n * @param {Handle} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n function open(token) {\n enter.call(this, create(token), token)\n if (and) and.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @returns {void}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n })\n }\n\n /**\n * @template {Node} Kind\n * Node type.\n * @this {CompileContext}\n * Context.\n * @param {Kind} node\n * Node to enter.\n * @param {Token} token\n * Corresponding token.\n * @param {OnEnterError | undefined} [errorHandler]\n * Handle the case where this token is open, but it is closed by something else.\n * @returns {Kind}\n * The given node.\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1]\n // @ts-expect-error: Assume `Node` can exist as a child of `parent`.\n parent.children.push(node)\n this.stack.push(node)\n this.tokenStack.push([token, errorHandler])\n // @ts-expect-error: `end` will be patched later.\n node.position = {\n start: point(token.start)\n }\n return node\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n function close(token) {\n if (and) and.call(this, token)\n exit.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * Context.\n * @param {Token} token\n * Corresponding token.\n * @param {OnExitError | undefined} [onExitError]\n * Handle the case where another token is open.\n * @returns {Node}\n * The closed node.\n */\n function exit(token, onExitError) {\n const node = this.stack.pop()\n const open = this.tokenStack.pop()\n if (!open) {\n throw new Error(\n 'Cannot close `' +\n token.type +\n '` (' +\n stringifyPosition({\n start: token.start,\n end: token.end\n }) +\n '): it’s not open'\n )\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0])\n } else {\n const handler = open[1] || defaultOnError\n handler.call(this, token, open[0])\n }\n }\n node.position.end = point(token.end)\n return node\n }\n\n /**\n * @this {CompileContext}\n * @returns {string}\n */\n function resume() {\n return toString(this.stack.pop())\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n setData('expectingFirstListItemValue', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (getData('expectingFirstListItemValue')) {\n const ancestor = this.stack[this.stack.length - 2]\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10)\n setData('expectingFirstListItemValue')\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.lang = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.meta = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (getData('flowCodeInside')) return\n this.buffer()\n setData('flowCodeInside', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '')\n setData('flowCodeInside')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1]\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length\n node.depth = depth\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n setData('setextHeadingSlurpLineEnding', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1]\n node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n setData('setextHeadingSlurpLineEnding')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1]\n let tail = node.children[node.children.length - 1]\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text()\n // @ts-expect-error: we’ll add `end` later.\n tail.position = {\n start: point(token.start)\n }\n // @ts-expect-error: Assume `parent` accepts `text`.\n node.children.push(tail)\n }\n this.stack.push(tail)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop()\n tail.value += this.sliceSerialize(token)\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1]\n // If we’re at a hard break, include the line ending in there.\n if (getData('atHardBreak')) {\n const tail = context.children[context.children.length - 1]\n tail.position.end = point(token.end)\n setData('atHardBreak')\n return\n }\n if (\n !getData('setextHeadingSlurpLineEnding') &&\n config.canContainEols.includes(context.type)\n ) {\n onenterdata.call(this, token)\n onexitdata.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n setData('atHardBreak', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (getData('inReference')) {\n /** @type {ReferenceType} */\n const referenceType = getData('referenceType') || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n setData('referenceType')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (getData('inReference')) {\n /** @type {ReferenceType} */\n const referenceType = getData('referenceType') || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n setData('referenceType')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token)\n const ancestor = this.stack[this.stack.length - 2]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string)\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1]\n const value = this.resume()\n const node = this.stack[this.stack.length - 1]\n // Assume a reference.\n setData('inReference', true)\n if (node.type === 'link') {\n /** @type {Array} */\n // @ts-expect-error: Assume static phrasing content.\n const children = fragment.children\n node.children = children\n } else {\n node.alt = value\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n setData('inReference')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n setData('referenceType', 'collapsed')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n setData('referenceType', 'full')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n setData('characterReferenceType', token.type)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token)\n const type = getData('characterReferenceType')\n /** @type {string} */\n let value\n if (type) {\n value = decodeNumericCharacterReference(\n data,\n type === 'characterReferenceMarkerNumeric' ? 10 : 16\n )\n setData('characterReferenceType')\n } else {\n const result = decodeNamedCharacterReference(data)\n value = result\n }\n const tail = this.stack.pop()\n tail.value += value\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = this.sliceSerialize(token)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = 'mailto:' + this.sliceSerialize(token)\n }\n\n //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n }\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n }\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n }\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n }\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n }\n }\n\n /** @returns {Heading} */\n function heading() {\n // @ts-expect-error `depth` will be set later.\n return {\n type: 'heading',\n depth: undefined,\n children: []\n }\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break'\n }\n }\n\n /** @returns {HTML} */\n function html() {\n return {\n type: 'html',\n value: ''\n }\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n }\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n }\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n }\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: []\n }\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: ''\n }\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n }\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Array>} extensions\n * @returns {void}\n */\nfunction configure(combined, extensions) {\n let index = -1\n while (++index < extensions.length) {\n const value = extensions[index]\n if (Array.isArray(value)) {\n configure(combined, value)\n } else {\n extension(combined, value)\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {void}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key\n for (key in extension) {\n if (own.call(extension, key)) {\n if (key === 'canContainEols') {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n } else if (key === 'transforms') {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n } else if (key === 'enter' || key === 'exit') {\n const right = extension[key]\n if (right) {\n Object.assign(combined[key], right)\n }\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error(\n 'Cannot close `' +\n left.type +\n '` (' +\n stringifyPosition({\n start: left.start,\n end: left.end\n }) +\n '): a different token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is open'\n )\n } else {\n throw new Error(\n 'Cannot close document, a token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is still open'\n )\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\nimport {subtokenize} from 'micromark-util-subtokenize'\n\n/**\n * @param {Array} events\n * @returns {Array}\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events\n}\n","/**\n * @typedef {import('micromark-util-types').Create} Create\n * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n */\n\nimport {combineExtensions} from 'micromark-util-combine-extensions'\nimport {content} from './initialize/content.js'\nimport {document} from './initialize/document.js'\nimport {flow} from './initialize/flow.js'\nimport {text, string} from './initialize/text.js'\nimport {createTokenizer} from './create-tokenizer.js'\nimport * as defaultConstructs from './constructs.js'\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * @returns {ParseContext}\n */\nexport function parse(options) {\n const settings = options || {}\n const constructs =\n /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])])\n\n /** @type {ParseContext} */\n const parser = {\n defined: [],\n lazy: {},\n constructs,\n content: create(content),\n document: create(document),\n flow: create(flow),\n string: create(string),\n text: create(text)\n }\n return parser\n\n /**\n * @param {InitialConstruct} initial\n */\n function create(initial) {\n return creator\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from)\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * @this {import('unified').Processor}\n * @type {import('unified').Plugin<[Options?] | void[], string, Root>}\n */\nexport default function remarkParse(options) {\n /** @type {import('unified').ParserFunction} */\n const parser = (doc) => {\n // Assume options.\n const settings = /** @type {Options} */ (this.data('settings'))\n\n return fromMarkdown(\n doc,\n Object.assign({}, settings, options, {\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: this.data('micromarkExtensions') || [],\n mdastExtensions: this.data('fromMarkdownExtensions') || []\n })\n )\n }\n\n Object.assign(this, {Parser: parser})\n}\n","import {asciiAlphanumeric} from 'micromark-util-character'\nimport {encode} from 'micromark-util-encode'\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''))\n if (!protocol) {\n return value\n }\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))\n ) {\n return value\n }\n return ''\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array} */\n const result = []\n let index = -1\n let start = 0\n let skip = 0\n while (++index < value.length) {\n const code = value.charCodeAt(index)\n /** @type {string} */\n let replace = ''\n\n // A correct percent encoded value.\n if (\n code === 37 &&\n asciiAlphanumeric(value.charCodeAt(index + 1)) &&\n asciiAlphanumeric(value.charCodeAt(index + 2))\n ) {\n skip = 2\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code)\n }\n }\n // Astral.\n else if (code > 55295 && code < 57344) {\n const next = value.charCodeAt(index + 1)\n\n // A correct surrogate pair.\n if (code < 56320 && next > 56319 && next < 57344) {\n replace = String.fromCharCode(code, next)\n skip = 1\n }\n // Lone surrogate.\n else {\n replace = '\\uFFFD'\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code)\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace))\n start = index + skip + 1\n replace = ''\n }\n if (skip) {\n index += skip\n skip = 0\n }\n }\n return result.join('') + value.slice(start)\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n */\n\n/**\n * @typedef {Record} Props\n * @typedef {null | undefined | string | Props | TestFunctionAnything | Array} Test\n * Check for an arbitrary node, unaware of TypeScript inferral.\n *\n * @callback TestFunctionAnything\n * Check if a node passes a test, unaware of TypeScript inferral.\n * @param {unknown} this\n * The given context.\n * @param {Node} node\n * A node.\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean | void}\n * Whether this node passes the test.\n */\n\n/**\n * @template {Node} Kind\n * Node type.\n * @typedef {Kind['type'] | Partial | TestFunctionPredicate | Array | TestFunctionPredicate>} PredicateTest\n * Check for a node that can be inferred by TypeScript.\n */\n\n/**\n * Check if a node passes a certain test.\n *\n * @template {Node} Kind\n * Node type.\n * @callback TestFunctionPredicate\n * Complex test function for a node that can be inferred by TypeScript.\n * @param {Node} node\n * A node.\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {node is Kind}\n * Whether this node passes the test.\n */\n\n/**\n * @callback AssertAnything\n * Check that an arbitrary value is a node, unaware of TypeScript inferral.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean}\n * Whether this is a node and passes a test.\n */\n\n/**\n * Check if a node is a node and passes a certain node test.\n *\n * @template {Node} Kind\n * Node type.\n * @callback AssertPredicate\n * Check that an arbitrary value is a specific node, aware of TypeScript.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {node is Kind}\n * Whether this is a node and passes a test.\n */\n\n/**\n * Check if `node` is a `Node` and whether it passes the given test.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @param test\n * A check for a specific node.\n * @param index\n * The node’s position in its parent.\n * @param parent\n * The node’s parent.\n * @returns\n * Whether `node` is a node and passes a test.\n */\nexport const is =\n /**\n * @type {(\n * (() => false) &\n * ((node: unknown, test: PredicateTest, index: number, parent: Parent, context?: unknown) => node is Kind) &\n * ((node: unknown, test: PredicateTest, index?: null | undefined, parent?: null | undefined, context?: unknown) => node is Kind) &\n * ((node: unknown, test: Test, index: number, parent: Parent, context?: unknown) => boolean) &\n * ((node: unknown, test?: Test, index?: null | undefined, parent?: null | undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [node]\n * @param {Test} [test]\n * @param {number | null | undefined} [index]\n * @param {Parent | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function is(node, test, index, parent, context) {\n const check = convert(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!is(parent) || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n // @ts-expect-error Looks like a node.\n return node && node.type && typeof node.type === 'string'\n ? Boolean(check.call(context, node, index, parent))\n : false\n }\n )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param test\n * * when nullish, checks if `node` is a `Node`.\n * * when `string`, works like passing `(node) => node.type === test`.\n * * when `function` checks if function passed the node is true.\n * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * * when `array`, checks if any one of the subtests pass.\n * @returns\n * An assertion.\n */\nexport const convert =\n /**\n * @type {(\n * ((test: PredicateTest) => AssertPredicate) &\n * ((test?: Test) => AssertAnything)\n * )}\n */\n (\n /**\n * @param {Test} [test]\n * @returns {AssertAnything}\n */\n function (test) {\n if (test === undefined || test === null) {\n return ok\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n if (typeof test === 'object') {\n return Array.isArray(test) ? anyFactory(test) : propsFactory(test)\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n throw new Error('Expected function, string, or object as test')\n }\n )\n\n/**\n * @param {Array} tests\n * @returns {AssertAnything}\n */\nfunction anyFactory(tests) {\n /** @type {Array} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @param {Array} parameters\n * @returns {boolean}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].call(this, ...parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Turn an object into a test for a node with a certain fields.\n *\n * @param {Props} check\n * @returns {AssertAnything}\n */\nfunction propsFactory(check) {\n return castFactory(all)\n\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n function all(node) {\n /** @type {string} */\n let key\n\n for (key in check) {\n // @ts-expect-error: hush, it sure works as an index.\n if (node[key] !== check[key]) return false\n }\n\n return true\n }\n}\n\n/**\n * Turn a string into a test for a node with a certain type.\n *\n * @param {string} check\n * @returns {AssertAnything}\n */\nfunction typeFactory(check) {\n return castFactory(type)\n\n /**\n * @param {Node} node\n */\n function type(node) {\n return node && node.type === check\n }\n}\n\n/**\n * Turn a custom test into a test for a node that passes that test.\n *\n * @param {TestFunctionAnything} check\n * @returns {AssertAnything}\n */\nfunction castFactory(check) {\n return assertion\n\n /**\n * @this {unknown}\n * @param {unknown} node\n * @param {Array} parameters\n * @returns {boolean}\n */\n function assertion(node, ...parameters) {\n return Boolean(\n node &&\n typeof node === 'object' &&\n 'type' in node &&\n // @ts-expect-error: fine.\n Boolean(check.call(this, node, ...parameters))\n )\n }\n}\n\nfunction ok() {\n return true\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n */\n\n/**\n * @typedef {boolean | 'skip'} Action\n * Union of the action types.\n *\n * @typedef {number} Index\n * Move to the sibling at `index` next (after node itself is completely\n * traversed).\n *\n * Useful if mutating the tree, such as removing the node the visitor is\n * currently on, or any of its previous siblings.\n * Results less than 0 or greater than or equal to `children.length` stop\n * traversing the parent.\n *\n * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple\n * List with one or two values, the first an action, the second an index.\n *\n * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult\n * Any value that can be returned from a visitor.\n */\n\n/**\n * @template {Node} [Visited=Node]\n * Visited node type.\n * @template {Parent} [Ancestor=Parent]\n * Ancestor type.\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform the parent of node (the last of `ancestors`).\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of an ancestor still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Array} ancestors\n * Ancestors of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * Tree type.\n * @template {Test} [Check=string]\n * Test type.\n * @typedef {Visitor, Check>, Extract, Parent>>} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parents`.\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from './color.js'\n\n/**\n * Continue traversing as normal.\n */\nexport const CONTINUE = true\n\n/**\n * Stop traversing immediately.\n */\nexport const EXIT = false\n\n/**\n * Do not traverse this node’s children.\n */\nexport const SKIP = 'skip'\n\n/**\n * Visit nodes, with ancestral information.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @param tree\n * Tree to traverse.\n * @param test\n * `unist-util-is`-compatible test\n * @param visitor\n * Handle each node.\n * @param reverse\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns\n * Nothing.\n */\nexport const visitParents =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void) &\n * ((tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {Visitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {void}\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n // @ts-expect-error no visitor given, so `visitor` is test.\n visitor = test\n test = null\n }\n\n const is = convert(test)\n const step = reverse ? -1 : 1\n\n factory(tree, undefined, [])()\n\n /**\n * @param {Node} node\n * @param {number | undefined} index\n * @param {Array} parents\n */\n function factory(node, index, parents) {\n /** @type {Record} */\n // @ts-expect-error: hush\n const value = node && typeof node === 'object' ? node : {}\n\n if (typeof value.type === 'string') {\n const name =\n // `hast`\n typeof value.tagName === 'string'\n ? value.tagName\n : // `xast`\n typeof value.name === 'string'\n ? value.name\n : undefined\n\n Object.defineProperty(visit, 'name', {\n value:\n 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'\n })\n }\n\n return visit\n\n function visit() {\n /** @type {ActionTuple} */\n let result = []\n /** @type {ActionTuple} */\n let subresult\n /** @type {number} */\n let offset\n /** @type {Array} */\n let grandparents\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n // @ts-expect-error looks like a parent.\n if (node.children && result[0] !== SKIP) {\n // @ts-expect-error looks like a parent.\n offset = (reverse ? node.children.length : -1) + step\n // @ts-expect-error looks like a parent.\n grandparents = parents.concat(node)\n\n // @ts-expect-error looks like a parent.\n while (offset > -1 && offset < node.children.length) {\n // @ts-expect-error looks like a parent.\n subresult = factory(node.children[offset], offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n\n return result\n }\n }\n }\n )\n\n/**\n * Turn a return value into a clean result.\n *\n * @param {VisitorResult} value\n * Valid return values from visitors.\n * @returns {ActionTuple}\n * Clean result.\n */\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return [value]\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n */\n\n/**\n * Check if `Child` can be a child of `Ancestor`.\n *\n * Returns the ancestor when `Child` can be a child of `Ancestor`, or returns\n * `never`.\n *\n * @template {Node} Ancestor\n * Node type.\n * @template {Node} Child\n * Node type.\n * @typedef {(\n * Ancestor extends Parent\n * ? Child extends Ancestor['children'][number]\n * ? Ancestor\n * : never\n * : never\n * )} ParentsOf\n */\n\n/**\n * @template {Node} [Visited=Node]\n * Visited node type.\n * @template {Parent} [Ancestor=Parent]\n * Ancestor type.\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform `parent`.\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of `parent` still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends Node ? number | null : never} index\n * Index of `node` in `parent`.\n * @param {Ancestor extends Node ? Ancestor | null : never} parent\n * Parent of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n */\n\n/**\n * Build a typed `Visitor` function from a node and all possible parents.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} Visited\n * Node type.\n * @template {Parent} Ancestor\n * Parent type.\n * @typedef {Visitor>} BuildVisitorFromMatch\n */\n\n/**\n * Build a typed `Visitor` function from a list of descendants and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} Descendant\n * Node type.\n * @template {Test} Check\n * Test type.\n * @typedef {(\n * BuildVisitorFromMatch<\n * import('unist-util-visit-parents/complex-types.js').Matches,\n * Extract\n * >\n * )} BuildVisitorFromDescendants\n */\n\n/**\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} [Tree=Node]\n * Node type.\n * @template {Test} [Check=string]\n * Test type.\n * @typedef {(\n * BuildVisitorFromDescendants<\n * import('unist-util-visit-parents/complex-types.js').InclusiveDescendant,\n * Check\n * >\n * )} BuildVisitor\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @param tree\n * Tree to traverse.\n * @param test\n * `unist-util-is`-compatible test\n * @param visitor\n * Handle each node.\n * @param reverse\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns\n * Nothing.\n */\nexport const visit =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void) &\n * ((tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {Visitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {void}\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n visitor = test\n test = null\n }\n\n visitParents(tree, test, overload, reverse)\n\n /**\n * @param {Node} node\n * @param {Array} parents\n */\n function overload(node, parents) {\n const parent = parents[parents.length - 1]\n return visitor(\n node,\n parent ? parent.children.indexOf(node) : null,\n parent\n )\n }\n }\n )\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n","/**\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * Node.\n * @returns {Position}\n * Position.\n */\nexport function position(node) {\n return {start: pointStart(node), end: pointEnd(node)}\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'start' | 'end'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * @returns {Point}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n // To do: next major: don’t return points when invalid.\n return {\n // @ts-expect-error: in practice, null is allowed.\n line: point.line || null,\n // @ts-expect-error: in practice, null is allowed.\n column: point.column || null,\n // @ts-expect-error: in practice, null is allowed.\n offset: point.offset > -1 ? point.offset : null\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Definition} Definition\n */\n\n/**\n * @typedef {Root | Content} Node\n *\n * @callback GetDefinition\n * Get a definition by identifier.\n * @param {string | null | undefined} [identifier]\n * Identifier of definition.\n * @returns {Definition | null}\n * Definition corresponding to `identifier` or `null`.\n */\n\nimport {visit} from 'unist-util-visit'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Find definitions in `tree`.\n *\n * Uses CommonMark precedence, which means that earlier definitions are\n * preferred over duplicate later definitions.\n *\n * @param {Node} tree\n * Tree to check.\n * @returns {GetDefinition}\n * Getter.\n */\nexport function definitions(tree) {\n /** @type {Record} */\n const cache = Object.create(null)\n\n if (!tree || !tree.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(tree, 'definition', (definition) => {\n const id = clean(definition.identifier)\n if (id && !own.call(cache, id)) {\n cache[id] = definition\n }\n })\n\n return definition\n\n /** @type {GetDefinition} */\n function definition(identifier) {\n const id = clean(identifier)\n // To do: next major: return `undefined` when not found.\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\n/**\n * @param {string | null | undefined} [value]\n * @returns {string}\n */\nfunction clean(value) {\n return String(value || '').toUpperCase()\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('hast').Element} Element\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {FootnoteReference} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function footnoteReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n const index = state.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n if (index === -1) {\n state.footnoteOrder.push(id)\n state.footnoteCounts[id] = 1\n counter = state.footnoteOrder.length\n } else {\n state.footnoteCounts[id]++\n counter = index + 1\n }\n\n const reuseCounter = state.footnoteCounts[id]\n\n /** @type {Element} */\n const link = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + state.clobberPrefix + 'fn-' + safeId,\n id:\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: ['footnote-label']\n },\n children: [{type: 'text', value: String(counter)}]\n }\n state.patch(node, link)\n\n /** @type {Element} */\n const sup = {\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [link]\n }\n state.patch(node, sup)\n return state.applyData(node, sup)\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Reference} Reference\n * @typedef {import('mdast').Root} Root\n *\n * @typedef {import('./state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} References\n */\n\n// To do: next major: always return array.\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {References} node\n * Reference node (image, link).\n * @returns {ElementContent | Array}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return {type: 'text', value: '![' + node.alt + suffix}\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | null | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === undefined || spread === null\n ? node.children.length > 1\n : spread\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {footnote} from './footnote.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n footnote,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n // To do: next major: return `undefined`.\n return null\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Code} Code\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n // To do: next major, use `node.lang` w/o regex, the splitting’s been going\n // on for years in remark now.\n const lang = node.lang ? node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/) : null\n /** @type {Properties} */\n const properties = {}\n\n if (lang) {\n properties.className = ['language-' + lang]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Footnote} Footnote\n * @typedef {import('../state.js').State} State\n */\n\nimport {footnoteReference} from './footnote-reference.js'\n\n// To do: when both:\n// * \n// * \n// …are archived, remove this (also from mdast).\n// These inline notes are not used in GFM.\n\n/**\n * Turn an mdast `footnote` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Footnote} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnote(state, node) {\n  const footnoteById = state.footnoteById\n  let no = 1\n\n  while (no in footnoteById) no++\n\n  const identifier = String(no)\n\n  footnoteById[identifier] = {\n    type: 'footnoteDefinition',\n    identifier,\n    children: [{type: 'paragraph', children: node.children}],\n    position: node.position\n  }\n\n  return footnoteReference(state, {\n    type: 'footnoteReference',\n    identifier,\n    position: node.position\n  })\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').HTML} Html\n * @typedef {import('../state.js').State} State\n * @typedef {import('../../index.js').Raw} Raw\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Raw | Element | null}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.dangerous) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  // To do: next major: return `undefined`.\n  return null\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(def.url || ''), alt: node.alt}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Image} Image\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(def.url || '')}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Link} Link\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').List} List\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastRoot | HastElement}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Table} Table\n * @typedef {import('../state.js').State} State\n */\n\nimport {pointStart, pointEnd} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start.line && end.line) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | null | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(node, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').Text} HastText\n * @typedef {import('mdast').Text} MdastText\n * @typedef {import('../state.js').State} State\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastText | HastElement}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('hast').Properties} HastProperties\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Text} HastText\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Definition} MdastDefinition\n * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition\n * @typedef {import('mdast').Parent} MdastParent\n * @typedef {import('mdast').Root} MdastRoot\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n * @typedef {Extract} MdastParents\n *\n * @typedef EmbeddedHastFields\n *   hast fields.\n * @property {string | null | undefined} [hName]\n *   Generate a specific element with this tag name instead.\n * @property {HastProperties | null | undefined} [hProperties]\n *   Generate an element with these properties instead.\n * @property {Array | null | undefined} [hChildren]\n *   Generate an element with this content instead.\n *\n * @typedef {Record & EmbeddedHastFields} MdastData\n *   mdast data with embedded hast fields.\n *\n * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData\n *   mdast node with embedded hast data.\n *\n * @typedef PointLike\n *   Point-like value.\n * @property {number | null | undefined} [line]\n *   Line.\n * @property {number | null | undefined} [column]\n *   Column.\n * @property {number | null | undefined} [offset]\n *   Offset.\n *\n * @typedef PositionLike\n *   Position-like value.\n * @property {PointLike | null | undefined} [start]\n *   Point-like value.\n * @property {PointLike | null | undefined} [end]\n *   Point-like value.\n *\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | null | undefined} parent\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   hast node.\n *\n * @callback HFunctionProps\n *   Signature of `state` for when props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {HastProperties} props\n *   Properties.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @callback HFunctionNoProps\n *   Signature of `state` for when no props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @typedef HFields\n *   Info on `state`.\n * @property {boolean} dangerous\n *   Whether HTML is allowed.\n * @property {string} clobberPrefix\n *   Prefix to use to prevent DOM clobbering.\n * @property {string} footnoteLabel\n *   Label to use to introduce the footnote section.\n * @property {string} footnoteLabelTagName\n *   HTML used for the footnote label.\n * @property {HastProperties} footnoteLabelProperties\n *   Properties on the HTML tag used for the footnote label.\n * @property {string} footnoteBackLabel\n *   Label to use from backreferences back to their footnote call.\n * @property {(identifier: string) => MdastDefinition | null} definition\n *   Definition cache.\n * @property {Record} footnoteById\n *   Footnote definitions by their identifier.\n * @property {Array} footnoteOrder\n *   Identifiers of order when footnote calls first appear in tree order.\n * @property {Record} footnoteCounts\n *   Counts for how often the same footnote was called.\n * @property {Handlers} handlers\n *   Applied handlers.\n * @property {Handler} unknownHandler\n *   Handler for any none not in `passThrough` or otherwise handled.\n * @property {(from: MdastNodes, node: HastNodes) => void} patch\n *   Copy a node’s positional info.\n * @property {(from: MdastNodes, to: Type) => Type | HastElement} applyData\n *   Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array | null | undefined} one\n *   Transform an mdast node to hast.\n * @property {(node: MdastNodes) => Array} all\n *   Transform the children of an mdast parent to hast.\n * @property {(nodes: Array, loose?: boolean | null | undefined) => Array} wrap\n *   Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment\n *   Like `state` but lower-level and usable on non-elements.\n *   Deprecated: use `patch` and `applyData`.\n * @property {Array} passThrough\n *   List of node types to pass through untouched (except for their children).\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree.\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` attribute on footnotes to prevent it from\n *   *clobbering*.\n * @property {string | null | undefined} [footnoteBackLabel='Back to content']\n *   Label to use from backreferences back to their footnote call (affects\n *   screen readers).\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n *   Label to use for the footnotes section (affects screen readers).\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n *   Properties to use on the footnote label (note that `id: 'footnote-label'`\n *   is always added as footnote calls use it with `aria-describedby` to\n *   provide an accessible label).\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n *   Tag name to use for the footnote label.\n * @property {Handlers | null | undefined} [handlers]\n *   Extra handlers for nodes.\n * @property {Array | null | undefined} [passThrough]\n *   List of custom mdast node types to pass through (keep) in hast (note that\n *   the node itself is passed, but eventual children are transformed).\n * @property {Handler | null | undefined} [unknownHandler]\n *   Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n *   Handle nodes.\n *\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} State\n *   Info passed around.\n */\n\nimport {visit} from 'unist-util-visit'\nimport {position, pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n *   mdast node to transform.\n * @param {Options | null | undefined} [options]\n *   Configuration.\n * @returns {State}\n *   `state` function.\n */\nexport function createState(tree, options) {\n  const settings = options || {}\n  const dangerous = settings.allowDangerousHtml || false\n  /** @type {Record} */\n  const footnoteById = {}\n\n  // To do: next major: add `options` to state, remove:\n  // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`,\n  // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`,\n  // `unknownHandler`.\n\n  // To do: next major: move to `state.options.allowDangerousHtml`.\n  state.dangerous = dangerous\n  // To do: next major: move to `state.options`.\n  state.clobberPrefix =\n    settings.clobberPrefix === undefined || settings.clobberPrefix === null\n      ? 'user-content-'\n      : settings.clobberPrefix\n  // To do: next major: move to `state.options`.\n  state.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelProperties = settings.footnoteLabelProperties || {\n    className: ['sr-only']\n  }\n  // To do: next major: move to `state.options`.\n  state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n  // To do: next major: move to `state.options`.\n  state.unknownHandler = settings.unknownHandler\n  // To do: next major: move to `state.options`.\n  state.passThrough = settings.passThrough\n\n  state.handlers = {...handlers, ...settings.handlers}\n\n  // To do: next major: replace utility with `definitionById` object, so we\n  // only walk once (as we need footnotes too).\n  state.definition = definitions(tree)\n  state.footnoteById = footnoteById\n  /** @type {Array} */\n  state.footnoteOrder = []\n  /** @type {Record} */\n  state.footnoteCounts = {}\n\n  state.patch = patch\n  state.applyData = applyData\n  state.one = oneBound\n  state.all = allBound\n  state.wrap = wrap\n  // To do: next major: remove `augment`.\n  state.augment = augment\n\n  visit(tree, 'footnoteDefinition', (definition) => {\n    const id = String(definition.identifier).toUpperCase()\n\n    // Mimick CM behavior of link definitions.\n    // See: .\n    if (!own.call(footnoteById, id)) {\n      footnoteById[id] = definition\n    }\n  })\n\n  // @ts-expect-error Hush, it’s fine!\n  return state\n\n  /**\n   * Finalise the created `right`, a hast node, from `left`, an mdast node.\n   *\n   * @param {MdastNodeWithData | PositionLike | null | undefined} left\n   * @param {HastElementContent} right\n   * @returns {HastElementContent}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function augment(left, right) {\n    // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n    if (left && 'data' in left && left.data) {\n      /** @type {MdastData} */\n      const data = left.data\n\n      if (data.hName) {\n        if (right.type !== 'element') {\n          right = {\n            type: 'element',\n            tagName: '',\n            properties: {},\n            children: []\n          }\n        }\n\n        right.tagName = data.hName\n      }\n\n      if (right.type === 'element' && data.hProperties) {\n        right.properties = {...right.properties, ...data.hProperties}\n      }\n\n      if ('children' in right && right.children && data.hChildren) {\n        right.children = data.hChildren\n      }\n    }\n\n    if (left) {\n      const ctx = 'type' in left ? left : {position: left}\n\n      if (!generated(ctx)) {\n        // @ts-expect-error: fine.\n        right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n      }\n    }\n\n    return right\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Create an element for `node`.\n   *\n   * @type {HFunctionProps}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function state(node, tagName, props, children) {\n    if (Array.isArray(props)) {\n      children = props\n      props = {}\n    }\n\n    // @ts-expect-error augmenting an element yields an element.\n    return augment(node, {\n      type: 'element',\n      tagName,\n      properties: props || {},\n      children: children || []\n    })\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Transform an mdast node into a hast node.\n   *\n   * @param {MdastNodes} node\n   *   mdast node.\n   * @param {MdastParents | null | undefined} [parent]\n   *   Parent of `node`.\n   * @returns {HastElementContent | Array | null | undefined}\n   *   Resulting hast node.\n   */\n  function oneBound(node, parent) {\n    // @ts-expect-error: that’s a state :)\n    return one(state, node, parent)\n  }\n\n  /**\n   * Transform the children of an mdast node into hast nodes.\n   *\n   * @param {MdastNodes} parent\n   *   mdast node to compile\n   * @returns {Array}\n   *   Resulting hast nodes.\n   */\n  function allBound(parent) {\n    // @ts-expect-error: that’s a state :)\n    return all(state, parent)\n  }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n *   mdast node to copy from.\n * @param {HastNodes} to\n *   hast node to copy into.\n * @returns {void}\n *   Nothing.\n */\nfunction patch(from, to) {\n  if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n *   Node type.\n * @param {MdastNodes} from\n *   mdast node to use data from.\n * @param {Type} to\n *   hast node to change.\n * @returns {Type | HastElement}\n *   Nothing.\n */\nfunction applyData(from, to) {\n  /** @type {Type | HastElement} */\n  let result = to\n\n  // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n  if (from && from.data) {\n    const hName = from.data.hName\n    const hChildren = from.data.hChildren\n    const hProperties = from.data.hProperties\n\n    if (typeof hName === 'string') {\n      // Transforming the node resulted in an element with a different name\n      // than wanted:\n      if (result.type === 'element') {\n        result.tagName = hName\n      }\n      // Transforming the node resulted in a non-element, which happens for\n      // raw, text, and root nodes (unless custom handlers are passed).\n      // The intent is likely to keep the content around (otherwise: pass\n      // `hChildren`).\n      else {\n        result = {\n          type: 'element',\n          tagName: hName,\n          properties: {},\n          children: []\n        }\n\n        // To do: next major: take the children from the `root`, or inject the\n        // raw/text/comment or so into the element?\n        // if ('children' in node) {\n        //   // @ts-expect-error: assume `children` are allowed in elements.\n        //   result.children = node.children\n        // } else {\n        //   // @ts-expect-error: assume `node` is allowed in elements.\n        //   result.children.push(node)\n        // }\n      }\n    }\n\n    if (result.type === 'element' && hProperties) {\n      result.properties = {...result.properties, ...hProperties}\n    }\n\n    if (\n      'children' in result &&\n      result.children &&\n      hChildren !== null &&\n      hChildren !== undefined\n    ) {\n      // @ts-expect-error: assume valid children are defined.\n      result.children = hChildren\n    }\n  }\n\n  return result\n}\n\n/**\n * Transform an mdast node into a hast node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   mdast node.\n * @param {MdastParents | null | undefined} [parent]\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   Resulting hast node.\n */\n// To do: next major: do not expose, keep bound.\nexport function one(state, node, parent) {\n  const type = node && node.type\n\n  // Fail on non-nodes.\n  if (!type) {\n    throw new Error('Expected node, got `' + node + '`')\n  }\n\n  if (own.call(state.handlers, type)) {\n    return state.handlers[type](state, node, parent)\n  }\n\n  if (state.passThrough && state.passThrough.includes(type)) {\n    // To do: next major: deep clone.\n    // @ts-expect-error: types of passed through nodes are expected to be added manually.\n    return 'children' in node ? {...node, children: all(state, node)} : node\n  }\n\n  if (state.unknownHandler) {\n    return state.unknownHandler(state, node, parent)\n  }\n\n  return defaultUnknownHandler(state, node)\n}\n\n/**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} parent\n *   mdast node to compile\n * @returns {Array}\n *   Resulting hast nodes.\n */\n// To do: next major: do not expose, keep bound.\nexport function all(state, parent) {\n  /** @type {Array} */\n  const values = []\n\n  if ('children' in parent) {\n    const nodes = parent.children\n    let index = -1\n    while (++index < nodes.length) {\n      const result = one(state, nodes[index], parent)\n\n      // To do: see if we van clean this? Can we merge texts?\n      if (result) {\n        if (index && nodes[index - 1].type === 'break') {\n          if (!Array.isArray(result) && result.type === 'text') {\n            result.value = result.value.replace(/^\\s+/, '')\n          }\n\n          if (!Array.isArray(result) && result.type === 'element') {\n            const head = result.children[0]\n\n            if (head && head.type === 'text') {\n              head.value = head.value.replace(/^\\s+/, '')\n            }\n          }\n        }\n\n        if (Array.isArray(result)) {\n          values.push(...result)\n        } else {\n          values.push(result)\n        }\n      }\n    }\n  }\n\n  return values\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   Unknown mdast node.\n * @returns {HastText | HastElement}\n *   Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n  const data = node.data || {}\n  /** @type {HastText | HastElement} */\n  const result =\n    'value' in node &&\n    !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n      ? {type: 'text', value: node.value}\n      : {\n          type: 'element',\n          tagName: 'div',\n          properties: {},\n          children: all(state, node)\n        }\n\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastContent} Type\n *   Node type.\n * @param {Array} nodes\n *   List of nodes to wrap.\n * @param {boolean | null | undefined} [loose=false]\n *   Whether to add line endings at start and end.\n * @returns {Array}\n *   Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n  /** @type {Array} */\n  const result = []\n  let index = -1\n\n  if (loose) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  while (++index < nodes.length) {\n    if (index) result.push({type: 'text', value: '\\n'})\n    result.push(nodes[index])\n  }\n\n  if (loose && nodes.length > 0) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  return result\n}\n","/**\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef NodeLike\n * @property {PositionLike | null | undefined} [position]\n */\n\n/**\n * Check if `node` is generated.\n *\n * @param {NodeLike | null | undefined} [node]\n *   Node to check.\n * @returns {boolean}\n *   Whether `node` is generated (does not have positional info).\n */\nexport function generated(node) {\n  return (\n    !node ||\n    !node.position ||\n    !node.position.start ||\n    !node.position.start.line ||\n    !node.position.start.column ||\n    !node.position.end ||\n    !node.position.end.line ||\n    !node.position.end.column\n  )\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Root} HastRoot\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Root} MdastRoot\n *\n * @typedef {import('./state.js').Options} Options\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n */\n\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * *   `hast-util-to-html` also has an option `allowDangerousHtml` which will\n *     output the raw HTML.\n *     This is typically discouraged as noted by the option name but is useful\n *     if you completely trust authors\n * *   `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n *     into standard hast nodes (`element`, `text`, etc).\n *     This is a heavy task as it needs a full HTML parser, but it is the only\n *     way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * 

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {HastNodes | null | undefined}\n * hast tree.\n */\n// To do: next major: always return a single `root`.\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, null)\n const foot = footer(state)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n // To do: next major: always return root?\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('./state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\nexport function footer(state) {\n /** @type {Array} */\n const listItems = []\n let index = -1\n\n while (++index < state.footnoteOrder.length) {\n const def = state.footnoteById[state.footnoteOrder[index]]\n\n if (!def) {\n continue\n }\n\n const content = state.all(def)\n const id = String(def.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let referenceIndex = 0\n /** @type {Array} */\n const backReferences = []\n\n while (++referenceIndex <= state.footnoteCounts[id]) {\n /** @type {Element} */\n const backReference = {\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (referenceIndex > 1 ? '-' + referenceIndex : ''),\n dataFootnoteBackref: true,\n className: ['data-footnote-backref'],\n ariaLabel: state.footnoteBackLabel\n },\n children: [{type: 'text', value: '↩'}]\n }\n\n if (referenceIndex > 1) {\n backReference.children.push({\n type: 'element',\n tagName: 'sup',\n children: [{type: 'text', value: String(referenceIndex)}]\n })\n }\n\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n backReferences.push(backReference)\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: state.clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(def, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: state.footnoteLabelTagName,\n properties: {\n // To do: use structured clone.\n ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: state.footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","import {visit} from 'unist-util-visit'\n\n/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Element} Element\n *\n * @callback AllowElement\n * @param {Element} element\n * @param {number} index\n * @param {Element|Root} parent\n * @returns {boolean|undefined}\n *\n * @typedef Options\n * @property {Array} [allowedElements]\n * @property {Array} [disallowedElements=[]]\n * @property {AllowElement} [allowElement]\n * @property {boolean} [unwrapDisallowed=false]\n */\n\n/**\n * @type {import('unified').Plugin<[Options], Root>}\n */\nexport default function rehypeFilter(options) {\n if (options.allowedElements && options.disallowedElements) {\n throw new TypeError(\n 'Only one of `allowedElements` and `disallowedElements` should be defined'\n )\n }\n\n if (\n options.allowedElements ||\n options.disallowedElements ||\n options.allowElement\n ) {\n return (tree) => {\n visit(tree, 'element', (node, index, parent_) => {\n const parent = /** @type {Element|Root} */ (parent_)\n /** @type {boolean|undefined} */\n let remove\n\n if (options.allowedElements) {\n remove = !options.allowedElements.includes(node.tagName)\n } else if (options.disallowedElements) {\n remove = options.disallowedElements.includes(node.tagName)\n }\n\n if (!remove && options.allowElement && typeof index === 'number') {\n remove = !options.allowElement(node, index, parent)\n }\n\n if (remove && typeof index === 'number') {\n if (options.unwrapDisallowed && node.children) {\n parent.children.splice(index, 1, ...node.children)\n } else {\n parent.children.splice(index, 1)\n }\n\n return index\n }\n\n return undefined\n })\n }\n }\n}\n","/**\n * Check if the given value is *inter-element whitespace*.\n *\n * @param {unknown} thing\n * Thing to check (typically `Node` or `string`).\n * @returns {boolean}\n * Whether the `value` is inter-element whitespace (`boolean`): consisting of\n * zero or more of space, tab (`\\t`), line feed (`\\n`), carriage return\n * (`\\r`), or form feed (`\\f`).\n * If a node is passed it must be a `Text` node, whose `value` field is\n * checked.\n */\nexport function whitespace(thing) {\n /** @type {string} */\n const value =\n // @ts-expect-error looks like a node.\n thing && typeof thing === 'object' && thing.type === 'text'\n ? // @ts-expect-error looks like a text.\n thing.value || ''\n : thing\n\n // HTML whitespace expression.\n // See .\n return typeof value === 'string' && value.replace(/[ \\t\\n\\f\\r]/g, '') === ''\n}\n","/**\n * `hast` is close to `React`, but differs in a couple of cases.\n *\n * To get a React property from a hast property, check if it is in\n * `hastToReact`, if it is, then use the corresponding value,\n * otherwise, use the hast property.\n *\n * @type {Record}\n */\nexport const hastToReact = {\n classId: 'classID',\n dataType: 'datatype',\n itemId: 'itemID',\n strokeDashArray: 'strokeDasharray',\n strokeDashOffset: 'strokeDashoffset',\n strokeLineCap: 'strokeLinecap',\n strokeLineJoin: 'strokeLinejoin',\n strokeMiterLimit: 'strokeMiterlimit',\n typeOf: 'typeof',\n xLinkActuate: 'xlinkActuate',\n xLinkArcRole: 'xlinkArcrole',\n xLinkHref: 'xlinkHref',\n xLinkRole: 'xlinkRole',\n xLinkShow: 'xlinkShow',\n xLinkTitle: 'xlinkTitle',\n xLinkType: 'xlinkType',\n xmlnsXLink: 'xmlnsXlink'\n}\n","import StyleToObject from './index.js';\n\nexport default StyleToObject;\n","const protocols = ['http', 'https', 'mailto', 'tel']\n\n/**\n * @param {string} uri\n * @returns {string}\n */\nexport function uriTransformer(uri) {\n const url = (uri || '').trim()\n const first = url.charAt(0)\n\n if (first === '#' || first === '/') {\n return url\n }\n\n const colon = url.indexOf(':')\n if (colon === -1) {\n return url\n }\n\n let index = -1\n\n while (++index < protocols.length) {\n const protocol = protocols[index]\n\n if (\n colon === protocol.length &&\n url.slice(0, protocol.length).toLowerCase() === protocol\n ) {\n return url\n }\n }\n\n index = url.indexOf('?')\n if (index !== -1 && colon > index) {\n return url\n }\n\n index = url.indexOf('#')\n if (index !== -1 && colon > index) {\n return url\n }\n\n // eslint-disable-next-line no-script-url\n return 'javascript:void(0)'\n}\n","/**\n * @template T\n * @typedef {import('react').ComponentType} ComponentType\n */\n\n/**\n * @template {import('react').ElementType} T\n * @typedef {import('react').ComponentPropsWithoutRef} ComponentPropsWithoutRef\n */\n\n/**\n * @typedef {import('react').ReactNode} ReactNode\n * @typedef {import('unist').Position} Position\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').DocType} Doctype\n * @typedef {import('property-information').Info} Info\n * @typedef {import('property-information').Schema} Schema\n * @typedef {import('./complex-types.js').ReactMarkdownProps} ReactMarkdownProps\n *\n * @typedef Raw\n * @property {'raw'} type\n * @property {string} value\n *\n * @typedef Context\n * @property {Options} options\n * @property {Schema} schema\n * @property {number} listDepth\n *\n * @callback TransformLink\n * @param {string} href\n * @param {Array} children\n * @param {string?} title\n * @returns {string}\n *\n * @callback TransformImage\n * @param {string} src\n * @param {string} alt\n * @param {string?} title\n * @returns {string}\n *\n * @typedef {import('react').HTMLAttributeAnchorTarget} TransformLinkTargetType\n *\n * @callback TransformLinkTarget\n * @param {string} href\n * @param {Array} children\n * @param {string?} title\n * @returns {TransformLinkTargetType|undefined}\n *\n * @typedef {keyof JSX.IntrinsicElements} ReactMarkdownNames\n *\n * To do: is `data-sourcepos` typeable?\n *\n * @typedef {ComponentPropsWithoutRef<'code'> & ReactMarkdownProps & {inline?: boolean}} CodeProps\n * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps\n * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps\n * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps\n * @typedef {ComponentPropsWithoutRef<'td'> & ReactMarkdownProps & {style?: Record, isHeader: false}} TableDataCellProps\n * @typedef {ComponentPropsWithoutRef<'th'> & ReactMarkdownProps & {style?: Record, isHeader: true}} TableHeaderCellProps\n * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps\n * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps\n *\n * @typedef {ComponentType} CodeComponent\n * @typedef {ComponentType} HeadingComponent\n * @typedef {ComponentType} LiComponent\n * @typedef {ComponentType} OrderedListComponent\n * @typedef {ComponentType} TableDataCellComponent\n * @typedef {ComponentType} TableHeaderCellComponent\n * @typedef {ComponentType} TableRowComponent\n * @typedef {ComponentType} UnorderedListComponent\n *\n * @typedef SpecialComponents\n * @property {CodeComponent|ReactMarkdownNames} code\n * @property {HeadingComponent|ReactMarkdownNames} h1\n * @property {HeadingComponent|ReactMarkdownNames} h2\n * @property {HeadingComponent|ReactMarkdownNames} h3\n * @property {HeadingComponent|ReactMarkdownNames} h4\n * @property {HeadingComponent|ReactMarkdownNames} h5\n * @property {HeadingComponent|ReactMarkdownNames} h6\n * @property {LiComponent|ReactMarkdownNames} li\n * @property {OrderedListComponent|ReactMarkdownNames} ol\n * @property {TableDataCellComponent|ReactMarkdownNames} td\n * @property {TableHeaderCellComponent|ReactMarkdownNames} th\n * @property {TableRowComponent|ReactMarkdownNames} tr\n * @property {UnorderedListComponent|ReactMarkdownNames} ul\n *\n * @typedef {Partial & SpecialComponents>} Components\n *\n * @typedef Options\n * @property {boolean} [sourcePos=false]\n * @property {boolean} [rawSourcePos=false]\n * @property {boolean} [skipHtml=false]\n * @property {boolean} [includeElementIndex=false]\n * @property {null|false|TransformLink} [transformLinkUri]\n * @property {TransformImage} [transformImageUri]\n * @property {TransformLinkTargetType|TransformLinkTarget} [linkTarget]\n * @property {Components} [components]\n */\n\nimport React from 'react'\nimport ReactIs from 'react-is'\nimport {whitespace} from 'hast-util-whitespace'\nimport {svg, find, hastToReact} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {stringify as commas} from 'comma-separated-tokens'\nimport style from 'style-to-object'\nimport {uriTransformer} from './uri-transformer.js'\n\nconst own = {}.hasOwnProperty\n\n// The table-related elements that must not contain whitespace text according\n// to React.\nconst tableElements = new Set(['table', 'thead', 'tbody', 'tfoot', 'tr'])\n\n/**\n * @param {Context} context\n * @param {Element|Root} node\n */\nexport function childrenToReact(context, node) {\n /** @type {Array} */\n const children = []\n let childIndex = -1\n /** @type {Comment|Doctype|Element|Raw|Text} */\n let child\n\n while (++childIndex < node.children.length) {\n child = node.children[childIndex]\n\n if (child.type === 'element') {\n children.push(toReact(context, child, childIndex, node))\n } else if (child.type === 'text') {\n // Currently, a warning is triggered by react for *any* white space in\n // tables.\n // So we drop it.\n // See: .\n // See: .\n // See: .\n // See: .\n if (\n node.type !== 'element' ||\n !tableElements.has(node.tagName) ||\n !whitespace(child)\n ) {\n children.push(child.value)\n }\n } else if (child.type === 'raw' && !context.options.skipHtml) {\n // Default behavior is to show (encoded) HTML.\n children.push(child.value)\n }\n }\n\n return children\n}\n\n/**\n * @param {Context} context\n * @param {Element} node\n * @param {number} index\n * @param {Element|Root} parent\n */\nfunction toReact(context, node, index, parent) {\n const options = context.options\n const transform =\n options.transformLinkUri === undefined\n ? uriTransformer\n : options.transformLinkUri\n const parentSchema = context.schema\n /** @type {ReactMarkdownNames} */\n // @ts-expect-error assume a known HTML/SVG element.\n const name = node.tagName\n /** @type {Record} */\n const properties = {}\n let schema = parentSchema\n /** @type {string} */\n let property\n\n if (parentSchema.space === 'html' && name === 'svg') {\n schema = svg\n context.schema = schema\n }\n\n if (node.properties) {\n for (property in node.properties) {\n if (own.call(node.properties, property)) {\n addProperty(properties, property, node.properties[property], context)\n }\n }\n }\n\n if (name === 'ol' || name === 'ul') {\n context.listDepth++\n }\n\n const children = childrenToReact(context, node)\n\n if (name === 'ol' || name === 'ul') {\n context.listDepth--\n }\n\n // Restore parent schema.\n context.schema = parentSchema\n\n // Nodes created by plugins do not have positional info, in which case we use\n // an object that matches the position interface.\n const position = node.position || {\n start: {line: null, column: null, offset: null},\n end: {line: null, column: null, offset: null}\n }\n const component =\n options.components && own.call(options.components, name)\n ? options.components[name]\n : name\n const basic = typeof component === 'string' || component === React.Fragment\n\n if (!ReactIs.isValidElementType(component)) {\n throw new TypeError(\n `Component for name \\`${name}\\` not defined or is not renderable`\n )\n }\n\n properties.key = index\n\n if (name === 'a' && options.linkTarget) {\n properties.target =\n typeof options.linkTarget === 'function'\n ? options.linkTarget(\n String(properties.href || ''),\n node.children,\n typeof properties.title === 'string' ? properties.title : null\n )\n : options.linkTarget\n }\n\n if (name === 'a' && transform) {\n properties.href = transform(\n String(properties.href || ''),\n node.children,\n typeof properties.title === 'string' ? properties.title : null\n )\n }\n\n if (\n !basic &&\n name === 'code' &&\n parent.type === 'element' &&\n parent.tagName !== 'pre'\n ) {\n properties.inline = true\n }\n\n if (\n !basic &&\n (name === 'h1' ||\n name === 'h2' ||\n name === 'h3' ||\n name === 'h4' ||\n name === 'h5' ||\n name === 'h6')\n ) {\n properties.level = Number.parseInt(name.charAt(1), 10)\n }\n\n if (name === 'img' && options.transformImageUri) {\n properties.src = options.transformImageUri(\n String(properties.src || ''),\n String(properties.alt || ''),\n typeof properties.title === 'string' ? properties.title : null\n )\n }\n\n if (!basic && name === 'li' && parent.type === 'element') {\n const input = getInputElement(node)\n properties.checked =\n input && input.properties ? Boolean(input.properties.checked) : null\n properties.index = getElementsBeforeCount(parent, node)\n properties.ordered = parent.tagName === 'ol'\n }\n\n if (!basic && (name === 'ol' || name === 'ul')) {\n properties.ordered = name === 'ol'\n properties.depth = context.listDepth\n }\n\n if (name === 'td' || name === 'th') {\n if (properties.align) {\n if (!properties.style) properties.style = {}\n // @ts-expect-error assume `style` is an object\n properties.style.textAlign = properties.align\n delete properties.align\n }\n\n if (!basic) {\n properties.isHeader = name === 'th'\n }\n }\n\n if (!basic && name === 'tr' && parent.type === 'element') {\n properties.isHeader = Boolean(parent.tagName === 'thead')\n }\n\n // If `sourcePos` is given, pass source information (line/column info from markdown source).\n if (options.sourcePos) {\n properties['data-sourcepos'] = flattenPosition(position)\n }\n\n if (!basic && options.rawSourcePos) {\n properties.sourcePosition = node.position\n }\n\n // If `includeElementIndex` is given, pass node index info to components.\n if (!basic && options.includeElementIndex) {\n properties.index = getElementsBeforeCount(parent, node)\n properties.siblingCount = getElementsBeforeCount(parent)\n }\n\n if (!basic) {\n properties.node = node\n }\n\n // Ensure no React warnings are emitted for void elements w/ children.\n return children.length > 0\n ? React.createElement(component, properties, children)\n : React.createElement(component, properties)\n}\n\n/**\n * @param {Element|Root} node\n * @returns {Element?}\n */\nfunction getInputElement(node) {\n let index = -1\n\n while (++index < node.children.length) {\n const child = node.children[index]\n\n if (child.type === 'element' && child.tagName === 'input') {\n return child\n }\n }\n\n return null\n}\n\n/**\n * @param {Element|Root} parent\n * @param {Element} [node]\n * @returns {number}\n */\nfunction getElementsBeforeCount(parent, node) {\n let index = -1\n let count = 0\n\n while (++index < parent.children.length) {\n if (parent.children[index] === node) break\n if (parent.children[index].type === 'element') count++\n }\n\n return count\n}\n\n/**\n * @param {Record} props\n * @param {string} prop\n * @param {unknown} value\n * @param {Context} ctx\n */\nfunction addProperty(props, prop, value, ctx) {\n const info = find(ctx.schema, prop)\n let result = value\n\n // Ignore nullish and `NaN` values.\n // eslint-disable-next-line no-self-compare\n if (result === null || result === undefined || result !== result) {\n return\n }\n\n // Accept `array`.\n // Most props are space-separated.\n if (Array.isArray(result)) {\n result = info.commaSeparated ? commas(result) : spaces(result)\n }\n\n if (info.property === 'style' && typeof result === 'string') {\n result = parseStyle(result)\n }\n\n if (info.space && info.property) {\n props[\n own.call(hastToReact, info.property)\n ? hastToReact[info.property]\n : info.property\n ] = result\n } else if (info.attribute) {\n props[info.attribute] = result\n }\n}\n\n/**\n * @param {string} value\n * @returns {Record}\n */\nfunction parseStyle(value) {\n /** @type {Record} */\n const result = {}\n\n try {\n style(value, iterator)\n } catch {\n // Silent.\n }\n\n return result\n\n /**\n * @param {string} name\n * @param {string} v\n */\n function iterator(name, v) {\n const k = name.slice(0, 4) === '-ms-' ? `ms-${name.slice(4)}` : name\n result[k.replace(/-([a-z])/g, styleReplacer)] = v\n }\n}\n\n/**\n * @param {unknown} _\n * @param {string} $1\n */\nfunction styleReplacer(_, $1) {\n return $1.toUpperCase()\n}\n\n/**\n * @param {Position|{start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null}}} pos\n * @returns {string}\n */\nfunction flattenPosition(pos) {\n return [\n pos.start.line,\n ':',\n pos.start.column,\n '-',\n pos.end.line,\n ':',\n pos.end.column\n ]\n .map(String)\n .join('')\n}\n","/**\n * @typedef {import('react').ReactNode} ReactNode\n * @typedef {import('react').ReactElement<{}>} ReactElement\n * @typedef {import('unified').PluggableList} PluggableList\n * @typedef {import('hast').Root} Root\n * @typedef {import('./rehype-filter.js').Options} FilterOptions\n * @typedef {import('./ast-to-react.js').Options} TransformOptions\n *\n * @typedef CoreOptions\n * @property {string} children\n *\n * @typedef PluginOptions\n * @property {PluggableList} [remarkPlugins=[]]\n * @property {PluggableList} [rehypePlugins=[]]\n * @property {import('remark-rehype').Options | undefined} [remarkRehypeOptions={}]\n *\n * @typedef LayoutOptions\n * @property {string} [className]\n *\n * @typedef {CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions} ReactMarkdownOptions\n *\n * @typedef Deprecation\n * @property {string} id\n * @property {string} [to]\n */\n\nimport React from 'react'\nimport {VFile} from 'vfile'\nimport {unified} from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport PropTypes from 'prop-types'\nimport {html} from 'property-information'\nimport rehypeFilter from './rehype-filter.js'\nimport {childrenToReact} from './ast-to-react.js'\n\nconst own = {}.hasOwnProperty\nconst changelog =\n 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'\n\n/** @type {Record} */\nconst deprecated = {\n plugins: {to: 'remarkPlugins', id: 'change-plugins-to-remarkplugins'},\n renderers: {to: 'components', id: 'change-renderers-to-components'},\n astPlugins: {id: 'remove-buggy-html-in-markdown-parser'},\n allowDangerousHtml: {id: 'remove-buggy-html-in-markdown-parser'},\n escapeHtml: {id: 'remove-buggy-html-in-markdown-parser'},\n source: {to: 'children', id: 'change-source-to-children'},\n allowNode: {\n to: 'allowElement',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes'\n },\n allowedTypes: {\n to: 'allowedElements',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes'\n },\n disallowedTypes: {\n to: 'disallowedElements',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes'\n },\n includeNodeIndex: {\n to: 'includeElementIndex',\n id: 'change-includenodeindex-to-includeelementindex'\n }\n}\n\n/**\n * React component to render markdown.\n *\n * @param {ReactMarkdownOptions} options\n * @returns {ReactElement}\n */\nexport function ReactMarkdown(options) {\n for (const key in deprecated) {\n if (own.call(deprecated, key) && own.call(options, key)) {\n const deprecation = deprecated[key]\n console.warn(\n `[react-markdown] Warning: please ${\n deprecation.to ? `use \\`${deprecation.to}\\` instead of` : 'remove'\n } \\`${key}\\` (see <${changelog}#${deprecation.id}> for more info)`\n )\n delete deprecated[key]\n }\n }\n\n const processor = unified()\n .use(remarkParse)\n .use(options.remarkPlugins || [])\n .use(remarkRehype, {\n ...options.remarkRehypeOptions,\n allowDangerousHtml: true\n })\n .use(options.rehypePlugins || [])\n .use(rehypeFilter, options)\n\n const file = new VFile()\n\n if (typeof options.children === 'string') {\n file.value = options.children\n } else if (options.children !== undefined && options.children !== null) {\n console.warn(\n `[react-markdown] Warning: please pass a string as \\`children\\` (not: \\`${options.children}\\`)`\n )\n }\n\n const hastNode = processor.runSync(processor.parse(file), file)\n\n if (hastNode.type !== 'root') {\n throw new TypeError('Expected a `root` node')\n }\n\n /** @type {ReactElement} */\n let result = React.createElement(\n React.Fragment,\n {},\n childrenToReact({options, schema: html, listDepth: 0}, hastNode)\n )\n\n if (options.className) {\n result = React.createElement('div', {className: options.className}, result)\n }\n\n return result\n}\n\nReactMarkdown.propTypes = {\n // Core options:\n children: PropTypes.string,\n // Layout options:\n className: PropTypes.string,\n // Filter options:\n allowElement: PropTypes.func,\n allowedElements: PropTypes.arrayOf(PropTypes.string),\n disallowedElements: PropTypes.arrayOf(PropTypes.string),\n unwrapDisallowed: PropTypes.bool,\n // Plugin options:\n remarkPlugins: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.string,\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n // prettier-ignore\n // type-coverage:ignore-next-line\n PropTypes.any\n )\n ])\n )\n ])\n ),\n rehypePlugins: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.string,\n PropTypes.object,\n PropTypes.func,\n PropTypes.arrayOf(\n // prettier-ignore\n // type-coverage:ignore-next-line\n PropTypes.any\n )\n ])\n )\n ])\n ),\n // Transform options:\n sourcePos: PropTypes.bool,\n rawSourcePos: PropTypes.bool,\n skipHtml: PropTypes.bool,\n includeElementIndex: PropTypes.bool,\n transformLinkUri: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n linkTarget: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n transformImageUri: PropTypes.func,\n components: PropTypes.object\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiControl,\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n}\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n}\nconst path = {\n tokenize: tokenizePath,\n partial: true\n}\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n}\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n}\nconst wwwAutolink = {\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n}\nconst protocolAutolink = {\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n}\nconst emailAutolink = {\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n}\n\n/** @type {ConstructRecord} */\nconst text = {}\n\n// To do: next major: expose functions that yields extension.\n\n/**\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n *\n * @type {Extension}\n */\nexport const gfmAutolinkLiteral = {\n text\n}\n\n/** @type {Code} */\nlet code = 48\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink\n code++\n if (code === 58) code = 65\n else if (code === 91) code = 97\n}\ntext[43] = emailAutolink\ntext[45] = emailAutolink\ntext[46] = emailAutolink\ntext[95] = emailAutolink\ntext[72] = [emailAutolink, protocolAutolink]\ntext[104] = [emailAutolink, protocolAutolink]\ntext[87] = [emailAutolink, wwwAutolink]\ntext[119] = [emailAutolink, wwwAutolink]\n\n// To do: perform email autolink literals on events, afterwards.\n// That’s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this\n /** @type {boolean | undefined} */\n let dot\n /** @type {boolean} */\n let data\n return start\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (\n !gfmAtext(code) ||\n !previousEmail.call(self, self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkEmail')\n return atext(code)\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code)\n return atext\n }\n if (code === 64) {\n effects.consume(code)\n return emailDomain\n }\n return nok(code)\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: \n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(\n emailDomainDotTrail,\n emailDomainAfter,\n emailDomainDot\n )(code)\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true\n effects.consume(code)\n return emailDomain\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we’d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn’t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code)\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code)\n dot = true\n return emailDomain\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: .\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail')\n effects.exit('literalAutolink')\n return ok(code)\n }\n return nok(code)\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this\n return wwwStart\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (\n (code !== 87 && code !== 119) ||\n !previousWww.call(self, self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkWww')\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(\n wwwPrefix,\n effects.attempt(domain, effects.attempt(path, wwwAfter), nok),\n nok\n )(code)\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this\n let buffer = ''\n let seen = false\n return protocolStart\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if (\n (code === 72 || code === 104) &&\n previousProtocol.call(self, self.previous) &&\n !previousUnbalanced(self.events)\n ) {\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkHttp')\n buffer += String.fromCodePoint(code)\n effects.consume(code)\n return protocolPrefixInside\n }\n return nok(code)\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code)\n effects.consume(code)\n return protocolPrefixInside\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase()\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code)\n return protocolSlashesInside\n }\n }\n return nok(code)\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code)\n if (seen) {\n return afterProtocol\n }\n seen = true\n return protocolSlashesInside\n }\n return nok(code)\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null ||\n asciiControl(code) ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)\n ? nok(code)\n : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code)\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0\n return wwwPrefixInside\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++\n effects.consume(code)\n return wwwPrefixInside\n }\n if (code === 46 && size === 3) {\n effects.consume(code)\n return wwwPrefixAfter\n }\n return nok(code)\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code)\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment\n /** @type {boolean | undefined} */\n let seen\n return domainInside\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code)\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: .\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code) ||\n (code !== 45 && unicodePunctuation(code))\n ) {\n return domainAfter(code)\n }\n seen = true\n effects.consume(code)\n return domainInside\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true\n }\n // Otherwise, it’s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment\n underscoreInLastSegment = undefined\n }\n effects.consume(code)\n return domainInside\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that’s GH says a dot is needed, but it’s not true:\n // \n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code)\n }\n return ok(code)\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0\n let sizeClose = 0\n return pathInside\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++\n effects.consume(code)\n return pathInside\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don’t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code)\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (\n code === 33 ||\n code === 34 ||\n code === 38 ||\n code === 39 ||\n code === 41 ||\n code === 42 ||\n code === 44 ||\n code === 46 ||\n code === 58 ||\n code === 59 ||\n code === 60 ||\n code === 63 ||\n code === 93 ||\n code === 95 ||\n code === 126\n ) {\n return effects.check(trail, ok, pathAtPunctuation)(code)\n }\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n effects.consume(code)\n return pathInside\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++\n }\n effects.consume(code)\n return pathInside\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (\n code === 33 ||\n code === 34 ||\n code === 39 ||\n code === 41 ||\n code === 42 ||\n code === 44 ||\n code === 46 ||\n code === 58 ||\n code === 59 ||\n code === 63 ||\n code === 95 ||\n code === 126\n ) {\n effects.consume(code)\n return trail\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code)\n return trailCharRefStart\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // .\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code)\n return trailBracketAfter\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n return nok(code)\n }\n\n /**\n * In trail, after `]`.\n *\n * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (\n code === null ||\n code === 40 ||\n code === 91 ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n return trail(code)\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharRefStart(code) {\n // When non-alpha, it’s not a trail.\n return asciiAlpha(code) ? trailCharRefInside(code) : nok(code)\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharRefInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code)\n return trail\n }\n if (asciiAlpha(code)) {\n effects.consume(code)\n return trailCharRefInside\n }\n\n // It’s not a trail.\n return nok(code)\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code)\n return after\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code)\n }\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return (\n code === null ||\n code === 40 ||\n code === 42 ||\n code === 95 ||\n code === 91 ||\n code === 93 ||\n code === 126 ||\n markdownLineEndingOrSpace(code)\n )\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code)\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash “inside” atext.\n // The reference code is a bit weird, but that’s what it results in.\n // Source: .\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code))\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return (\n code === 43 ||\n code === 45 ||\n code === 46 ||\n code === 95 ||\n asciiAlphanumeric(code)\n )\n}\n\n/**\n * @param {Array} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length\n let result = false\n while (index--) {\n const token = events[index][1]\n if (\n (token.type === 'labelLink' || token.type === 'labelImage') &&\n !token._balanced\n ) {\n result = true\n break\n }\n\n // If we’ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false\n break\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true\n }\n return result\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {blankLine} from 'micromark-core-commonmark'\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n}\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n }\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Array} */\n // @ts-expect-error It’s fine!\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {Token} */\n let labelStart\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1]\n if (token.type === 'labelImage') {\n labelStart = token\n break\n }\n\n // Exit if we’ve walked far enough.\n if (\n token.type === 'gfmFootnoteCall' ||\n token.type === 'labelLink' ||\n token.type === 'label' ||\n token.type === 'image' ||\n token.type === 'link'\n ) {\n break\n }\n }\n return start\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code)\n }\n const id = normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code)\n }\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return ok(code)\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length\n /** @type {Token | undefined} */\n let labelStart\n\n // Find an opening.\n while (index--) {\n if (\n events[index][1].type === 'labelImage' &&\n events[index][0] === 'enter'\n ) {\n labelStart = events[index][1]\n break\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = 'data'\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker'\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n }\n // Increment the end 1 character.\n marker.end.column++\n marker.end.offset++\n marker.end._bufferIndex++\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n }\n /** @type {Token} */\n const chunk = {\n type: 'chunkString',\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n }\n\n /** @type {Array} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1],\n events[index + 2],\n ['enter', call, context],\n // The `[`\n events[index + 3],\n events[index + 4],\n // The `^`.\n ['enter', marker, context],\n ['exit', marker, context],\n // Everything in between.\n ['enter', string, context],\n ['enter', chunk, context],\n ['exit', chunk, context],\n ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2],\n events[events.length - 1],\n ['exit', call, context]\n ]\n events.splice(index, events.length - index + 1, ...replacement)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this\n /** @type {Array} */\n // @ts-expect-error It’s fine!\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n let size = 0\n /** @type {boolean} */\n let data\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can’t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall')\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return callStart\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code)\n effects.enter('gfmFootnoteCallMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallMarker')\n effects.enter('gfmFootnoteCallString')\n effects.enter('chunkString').contentType = 'string'\n return callData\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n (code === 93 && !data) ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null ||\n code === 91 ||\n markdownLineEndingOrSpace(code)\n ) {\n return nok(code)\n }\n if (code === 93) {\n effects.exit('chunkString')\n const token = effects.exit('gfmFootnoteCallString')\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code)\n }\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n effects.exit('gfmFootnoteCall')\n return ok\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n size++\n effects.consume(code)\n return code === 92 ? callEscape : callData\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return callData\n }\n return callData(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this\n /** @type {Array} */\n // @ts-expect-error It’s fine!\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {string} */\n let identifier\n let size = 0\n /** @type {boolean | undefined} */\n let data\n return start\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true\n effects.enter('gfmFootnoteDefinitionLabel')\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n return labelAtMarker\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionMarker')\n effects.enter('gfmFootnoteDefinitionLabelString')\n effects.enter('chunkString').contentType = 'string'\n return labelInside\n }\n return nok(code)\n }\n\n /**\n * In label.\n *\n * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n (code === 93 && !data) ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null ||\n code === 91 ||\n markdownLineEndingOrSpace(code)\n ) {\n return nok(code)\n }\n if (code === 93) {\n effects.exit('chunkString')\n const token = effects.exit('gfmFootnoteDefinitionLabelString')\n identifier = normalizeIdentifier(self.sliceSerialize(token))\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n effects.exit('gfmFootnoteDefinitionLabel')\n return labelAfter\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n size++\n effects.consume(code)\n return code === 92 ? labelEscape : labelInside\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > \n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return labelInside\n }\n return labelInside(code)\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker')\n effects.consume(code)\n effects.exit('definitionMarker')\n if (!defined.includes(identifier)) {\n defined.push(identifier)\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(\n effects,\n whitespaceAfter,\n 'gfmFootnoteDefinitionWhitespace'\n )\n }\n return nok(code)\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok))\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition')\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'gfmFootnoteDefinitionIndent',\n 4 + 1\n )\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'gfmFootnoteDefinitionIndent' &&\n tail[2].sliceSerialize(tail[1], true).length === 4\n ? ok(code)\n : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean} [singleTilde=true]\n * Whether to support strikethrough with a single tilde.\n *\n * Single tildes work on github.com, but are technically prohibited by the\n * GFM spec.\n */\n\nimport {splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/**\n * Create an extension for `micromark` to enable GFM strikethrough syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM strikethrough syntax.\n */\nexport function gfmStrikethrough(options) {\n const options_ = options || {}\n let single = options_.singleTilde\n const tokenizer = {\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n }\n if (single === null || single === undefined) {\n single = true\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n }\n\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n function resolveAllStrikethrough(events, context) {\n let index = -1\n\n // Walk through all events.\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'strikethroughSequenceTemporary' &&\n events[index][1]._close\n ) {\n let open = index\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'strikethroughSequenceTemporary' &&\n events[open][1]._open &&\n // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset ===\n events[open][1].end.offset - events[open][1].start.offset\n ) {\n events[index][1].type = 'strikethroughSequence'\n events[open][1].type = 'strikethroughSequence'\n\n /** @type {Token} */\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n }\n\n /** @type {Token} */\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n\n // Opening.\n /** @type {Array} */\n const nextEvents = [\n ['enter', strikethrough, context],\n ['enter', events[open][1], context],\n ['exit', events[open][1], context],\n ['enter', text, context]\n ]\n const insideSpan = context.parser.constructs.insideSpan.null\n if (insideSpan) {\n // Between.\n splice(\n nextEvents,\n nextEvents.length,\n 0,\n resolveAll(insideSpan, events.slice(open + 1, index), context)\n )\n }\n\n // Closing.\n splice(nextEvents, nextEvents.length, 0, [\n ['exit', text, context],\n ['enter', events[index][1], context],\n ['exit', events[index][1], context],\n ['exit', strikethrough, context]\n ])\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - 2\n break\n }\n }\n }\n }\n index = -1\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = 'data'\n }\n }\n return events\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous\n const events = this.events\n let size = 0\n return start\n\n /** @type {State} */\n function start(code) {\n if (\n previous === 126 &&\n events[events.length - 1][1].type !== 'characterEscape'\n ) {\n return nok(code)\n }\n effects.enter('strikethroughSequenceTemporary')\n return more(code)\n }\n\n /** @type {State} */\n function more(code) {\n const before = classifyCharacter(previous)\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code)\n effects.consume(code)\n size++\n return more\n }\n if (size < 2 && !single) return nok(code)\n const token = effects.exit('strikethroughSequenceTemporary')\n const after = classifyCharacter(code)\n token._open = !after || (after === 2 && Boolean(before))\n token._close = !before || (before === 2 && Boolean(after))\n return ok(code)\n }\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\n\n// Deal with several changes in events, batching them together.\n//\n// Preferably, changes should be kept to a minimum.\n// Sometimes, it’s needed to change the list of events, because parsing can be\n// messy, and it helps to expose a cleaner interface of events to the compiler\n// and other users.\n// It can also help to merge many adjacent similar events.\n// And, in other cases, it’s needed to parse subcontent: pass some events\n// through another tokenizer and inject the result.\n\n/**\n * @typedef {[number, number, Array]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array}\n */\n this.map = []\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * @param {number} remove\n * @param {Array} add\n * @returns {void}\n */\n add(index, remove, add) {\n addImpl(this, index, remove, add)\n }\n\n // To do: not used here.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array} add\n // * @returns {void}\n // */\n // addBefore(index, remove, add) {\n // addImpl(this, index, remove, add, true)\n // }\n\n /**\n * Done, change the events.\n *\n * @param {Array} events\n * @returns {void}\n */\n consume(events) {\n this.map.sort((a, b) => a[0] - b[0])\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (this.map.length === 0) {\n return\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // . shiftLinks(events, jumps)\n\n let index = this.map.length\n /** @type {Array>} */\n const vecs = []\n while (index > 0) {\n index -= 1\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]))\n // eslint-disable-next-line unicorn/no-array-push-push\n vecs.push(this.map[index][2])\n\n // Truncate rest.\n events.length = this.map[index][0]\n }\n vecs.push([...events])\n events.length = 0\n let slice = vecs.pop()\n while (slice) {\n events.push(...slice)\n slice = vecs.pop()\n }\n\n // Truncate everything.\n this.map.length = 0\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array} add\n * @returns {void}\n */\nfunction addImpl(editMap, at, remove, add) {\n let index = 0\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (remove === 0 && add.length === 0) {\n return\n }\n while (index < editMap.map.length) {\n if (editMap.map[index][0] === at) {\n editMap.map[index][1] += remove\n\n // To do: before not used.\n // if (before) {\n // add.push(...editMap.map[index][2])\n // editMap.map[index][2] = add\n // } else {\n editMap.map[index][2].push(...add)\n // }\n\n return\n }\n index += 1\n }\n editMap.map.push([at, remove, add])\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array} events\n// * @param {Array} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// console.log('to do: links?', add, rmCurr)\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\n/**\n * @typedef {'left' | 'center' | 'right' | 'none'} Align\n */\n\n/**\n * Figure out the alignment of a GFM table.\n *\n * @param {Array} events\n * @param {number} index\n * @returns {Array}\n */\nexport function gfmTableAlign(events, index) {\n let inDelimiterRow = false\n /** @type {Array} */\n const align = []\n while (index < events.length) {\n const event = events[index]\n if (inDelimiterRow) {\n if (event[0] === 'enter') {\n // Start of alignment value: set a new column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n if (event[1].type === 'tableContent') {\n align.push(\n events[index + 1][1].type === 'tableDelimiterMarker'\n ? 'left'\n : 'none'\n )\n }\n }\n // Exits:\n // End of alignment value: change the column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n else if (event[1].type === 'tableContent') {\n if (events[index - 1][1].type === 'tableDelimiterMarker') {\n const alignIndex = align.length - 1\n align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right'\n }\n }\n // Done!\n else if (event[1].type === 'tableDelimiterRow') {\n break\n }\n } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {\n inDelimiterRow = true\n }\n index += 1\n }\n return align\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nimport {EditMap} from './edit-map.js'\nimport {gfmTableAlign} from './infer.js'\n\n// To do: next major: expose functions.\n\n/**\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n *\n * @type {Extension}\n */\nexport const gfmTable = {\n flow: {\n null: {\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this\n let size = 0\n let sizeB = 0\n /** @type {boolean | undefined} */\n let seen\n return start\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1\n while (index > -1) {\n const type = self.events[index][1].type\n if (\n type === 'lineEnding' ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === 'linePrefix'\n )\n index--\n else break\n }\n const tail = index > -1 ? self.events[index][1].type : null\n const next =\n tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code)\n }\n return next(code)\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead')\n effects.enter('tableRow')\n return headRowStart(code)\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code)\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1\n return headRowBreak(code)\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code)\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true\n effects.exit('tableRow')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return headDelimiterStart\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code)\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, 'whitespace')(code)\n }\n sizeB += 1\n if (seen) {\n seen = false\n // Header cell count.\n size += 1\n }\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n // Whether a delimiter was seen.\n seen = true\n return headRowBreak\n }\n\n // Anything else is cell data.\n effects.enter('data')\n return headRowData(code)\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit('data')\n return headRowBreak(code)\n }\n effects.consume(code)\n return code === 92 ? headRowEscape : headRowData\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code)\n return headRowData\n }\n return headRowData(code)\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code)\n }\n effects.enter('tableDelimiterRow')\n // Track if we’ve seen a `:` or `|`.\n seen = false\n if (markdownSpace(code)) {\n return factorySpace(\n effects,\n headDelimiterBefore,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n }\n return headDelimiterBefore(code)\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code)\n }\n if (code === 124) {\n seen = true\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return headDelimiterCellBefore\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code)\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, 'whitespace')(code)\n }\n return headDelimiterValueBefore(code)\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1\n seen = true\n effects.enter('tableDelimiterMarker')\n effects.consume(code)\n effects.exit('tableDelimiterMarker')\n return headDelimiterLeftAlignmentAfter\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code)\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code)\n }\n return headDelimiterNok(code)\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n return headDelimiterFiller(code)\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code)\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code)\n return headDelimiterFiller\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true\n effects.exit('tableDelimiterFiller')\n effects.enter('tableDelimiterMarker')\n effects.consume(code)\n effects.exit('tableDelimiterMarker')\n return headDelimiterRightAlignmentAfter\n }\n effects.exit('tableDelimiterFiller')\n return headDelimiterRightAlignmentAfter(code)\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, 'whitespace')(code)\n }\n return headDelimiterCellAfter(code)\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code)\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code)\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow')\n effects.exit('tableHead')\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code)\n }\n return headDelimiterNok(code)\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code)\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow')\n return bodyRowBreak(code)\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return bodyRowBreak\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow')\n return ok(code)\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, 'whitespace')(code)\n }\n\n // Anything else is cell content.\n effects.enter('data')\n return bodyRowData(code)\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit('data')\n return bodyRowBreak(code)\n }\n effects.consume(code)\n return code === 92 ? bodyRowEscape : bodyRowData\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code)\n return bodyRowData\n }\n return bodyRowData(code)\n }\n}\n\n/** @type {Resolver} */\n// eslint-disable-next-line complexity\nfunction resolveTable(events, context) {\n let index = -1\n let inFirstCellAwaitingPipe = true\n /** @type {RowKind} */\n let rowKind = 0\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0]\n /** @type {Range} */\n let cell = [0, 0, 0, 0]\n let afterHeadAwaitingFirstBodyRow = false\n let lastTableEnd = 0\n /** @type {Token | undefined} */\n let currentTable\n /** @type {Token | undefined} */\n let currentBody\n /** @type {Token | undefined} */\n let currentCell\n const map = new EditMap()\n while (++index < events.length) {\n const event = events[index]\n const token = event[1]\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody)\n currentBody = undefined\n lastTableEnd = 0\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n }\n map.add(index, 0, [['enter', currentTable, context]])\n } else if (\n token.type === 'tableRow' ||\n token.type === 'tableDelimiterRow'\n ) {\n inFirstCellAwaitingPipe = true\n currentCell = undefined\n lastCell = [0, 0, 0, 0]\n cell = [0, index + 1, 0, 0]\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n }\n map.add(index, 0, [['enter', currentBody, context]])\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1\n }\n // Cell data.\n else if (\n rowKind &&\n (token.type === 'data' ||\n token.type === 'tableDelimiterMarker' ||\n token.type === 'tableDelimiterFiller')\n ) {\n inFirstCellAwaitingPipe = false\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1]\n currentCell = flushCell(\n map,\n context,\n lastCell,\n rowKind,\n undefined,\n currentCell\n )\n lastCell = [0, 0, 0, 0]\n }\n cell[2] = index\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1]\n currentCell = flushCell(\n map,\n context,\n lastCell,\n rowKind,\n undefined,\n currentCell\n )\n }\n lastCell = cell\n cell = [lastCell[1], index, 0, 0]\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true\n lastTableEnd = index\n } else if (\n token.type === 'tableRow' ||\n token.type === 'tableDelimiterRow'\n ) {\n lastTableEnd = index\n if (lastCell[1] !== 0) {\n cell[0] = cell[1]\n currentCell = flushCell(\n map,\n context,\n lastCell,\n rowKind,\n index,\n currentCell\n )\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell)\n }\n rowKind = 0\n } else if (\n rowKind &&\n (token.type === 'data' ||\n token.type === 'tableDelimiterMarker' ||\n token.type === 'tableDelimiterFiller')\n ) {\n cell[3] = index\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody)\n }\n map.consume(context.events)\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1\n while (++index < context.events.length) {\n const event = context.events[index]\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index)\n }\n }\n return events\n}\n\n/// Generate a cell.\n/**\n *\n * @param {EditMap} map\n * @param {TokenizeContext} context\n * @param {Range} range\n * @param {RowKind} rowKind\n * @param {number | undefined} rowEnd\n * @param {Token | undefined} previousCell\n * @returns {Token | undefined}\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName =\n rowKind === 1\n ? 'tableHeader'\n : rowKind === 2\n ? 'tableDelimiter'\n : 'tableData'\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent'\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]))\n map.add(range[0], 0, [['exit', previousCell, context]])\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1])\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n }\n map.add(range[1], 0, [['enter', previousCell, context]])\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2])\n const relatedEnd = getPoint(context.events, range[3])\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n }\n map.add(range[2], 0, [['enter', valueToken, context]])\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]]\n const end = context.events[range[3]]\n start[1].end = Object.assign({}, end[1].end)\n start[1].type = 'chunkText'\n start[1].contentType = 'text'\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1\n const b = range[3] - range[2] - 1\n map.add(a, b, [])\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]])\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd))\n map.add(rowEnd, 0, [['exit', previousCell, context]])\n previousCell = undefined\n }\n return previousCell\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {EditMap} map\n * @param {TokenizeContext} context\n * @param {number} index\n * @param {Token} table\n * @param {Token | undefined} tableBody\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array} */\n const exits = []\n const related = getPoint(context.events, index)\n if (tableBody) {\n tableBody.end = Object.assign({}, related)\n exits.push(['exit', tableBody, context])\n }\n table.end = Object.assign({}, related)\n exits.push(['exit', table, context])\n map.add(index + 1, 0, exits)\n}\n\n/**\n * @param {Array} events\n * @param {number} index\n * @returns {readonly Point}\n */\nfunction getPoint(events, index) {\n const event = events[index]\n const side = event[0] === 'enter' ? 'start' : 'end'\n return event[1][side]\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEndingOrSpace,\n markdownLineEnding,\n markdownSpace\n} from 'micromark-util-character'\nconst tasklistCheck = {\n tokenize: tokenizeTasklistCheck\n}\n\n// To do: next major: expose function to make extension.\n\n/**\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM task list items syntax.\n *\n * @type {Extension}\n */\nexport const gfmTaskListItem = {\n text: {\n [91]: tasklistCheck\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this\n return open\n\n /**\n * At start of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null ||\n // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem\n ) {\n return nok(code)\n }\n effects.enter('taskListCheck')\n effects.enter('taskListCheckMarker')\n effects.consume(code)\n effects.exit('taskListCheckMarker')\n return inside\n }\n\n /**\n * In task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // Currently we match how GH works in files.\n // To match how GH works in comments, use `markdownSpace` (`[\\t ]`) instead\n // of `markdownLineEndingOrSpace` (`[\\t\\n\\r ]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked')\n effects.consume(code)\n effects.exit('taskListCheckValueUnchecked')\n return close\n }\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked')\n effects.consume(code)\n effects.exit('taskListCheckValueChecked')\n return close\n }\n return nok(code)\n }\n\n /**\n * At close of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker')\n effects.consume(code)\n effects.exit('taskListCheckMarker')\n effects.exit('taskListCheck')\n return after\n }\n return nok(code)\n }\n\n /**\n * @type {State}\n */\n function after(code) {\n // EOL in paragraph means there must be something else after it.\n if (markdownLineEnding(code)) {\n return ok(code)\n }\n\n // Space or tab?\n // Check what comes after.\n if (markdownSpace(code)) {\n return effects.check(\n {\n tokenize: spaceThenNonSpace\n },\n ok,\n nok\n )(code)\n }\n\n // EOF, or non-whitespace, both wrong.\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction spaceThenNonSpace(effects, ok, nok) {\n return factorySpace(effects, after, 'whitespace')\n\n /**\n * After whitespace, after task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // EOF means there was nothing, so bad.\n // EOL means there’s content after it, so good.\n // Impossible to have more spaces.\n // Anything else is good.\n return code === null ? nok(code) : ok(code)\n }\n}\n","/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n","/**\n * @typedef {import('mdast').Parent} MdastParent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').Text} Text\n * @typedef {import('unist-util-visit-parents').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n */\n\n/**\n * @typedef {Content | Root} Node\n * @typedef {Extract} Parent\n * @typedef {Exclude} ContentParent\n *\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[Root, ...Array, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) — whole match\n * * `...capture` (`Array`) — matches from regex capture groups\n * * `match` (`RegExpMatchObject`) — info on the match\n * @returns {Array | PhrasingContent | string | false | undefined | null}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * …or when `false`, do not replace at all\n * * …or when `string`, replace with a text node of that value\n * * …or when `Node` or `Array`, replace with those nodes\n *\n * @typedef {string | RegExp} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array} FindAndReplaceList\n * Several find and replaces, in array form.\n * @typedef {Record} FindAndReplaceSchema\n * Several find and replaces, in object form.\n * @typedef {[Find, Replace]} FindAndReplaceTuple\n * Find and replace in tuple form.\n * @typedef {string | ReplaceFunction} Replace\n * Thing to replace with.\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n * @typedef {Array} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore.\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param tree\n * Tree to change.\n * @param find\n * Patterns to find.\n * @param replace\n * Things to replace with (when `find` is `Find`) or configuration.\n * @param options\n * Configuration (when `find` is not `Find`).\n * @returns\n * Given, modified, tree.\n */\n// To do: next major: remove `find` & `replace` combo, remove schema.\nexport const findAndReplace =\n /**\n * @type {(\n * ((tree: Tree, find: Find, replace?: Replace | null | undefined, options?: Options | null | undefined) => Tree) &\n * ((tree: Tree, schema: FindAndReplaceSchema | FindAndReplaceList, options?: Options | null | undefined) => Tree)\n * )}\n **/\n (\n /**\n * @template {Node} Tree\n * @param {Tree} tree\n * @param {Find | FindAndReplaceSchema | FindAndReplaceList} find\n * @param {Replace | Options | null | undefined} [replace]\n * @param {Options | null | undefined} [options]\n * @returns {Tree}\n */\n function (tree, find, replace, options) {\n /** @type {Options | null | undefined} */\n let settings\n /** @type {FindAndReplaceSchema|FindAndReplaceList} */\n let schema\n\n if (typeof find === 'string' || find instanceof RegExp) {\n // @ts-expect-error don’t expect options twice.\n schema = [[find, replace]]\n settings = options\n } else {\n schema = find\n // @ts-expect-error don’t expect replace twice.\n settings = replace\n }\n\n if (!settings) {\n settings = {}\n }\n\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(schema)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n // To do next major: don’t return the given tree.\n return tree\n\n /** @type {import('unist-util-visit-parents/complex-types.js').BuildVisitor} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parent | undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = parents[index]\n\n if (\n ignored(\n parent,\n // @ts-expect-error: TS doesn’t understand but it’s perfect.\n grandparent ? grandparent.children.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n return handler(node, parents)\n }\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node.\n * @param {Array} parents\n * Parents.\n * @returns {VisitorResult}\n * Result.\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n // @ts-expect-error: TS is wrong, some of these children can be text.\n const index = parent.children.indexOf(node)\n let change = false\n /** @type {Array} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n // @ts-expect-error: stack is fine.\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn’t a match after all.\n if (value !== false) {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n }\n )\n\n/**\n * Turn a schema into pairs.\n *\n * @param {FindAndReplaceSchema | FindAndReplaceList} schema\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(schema) {\n /** @type {Pairs} */\n const result = []\n\n if (typeof schema !== 'object') {\n throw new TypeError('Expected array or object as schema')\n }\n\n if (Array.isArray(schema)) {\n let index = -1\n\n while (++index < schema.length) {\n result.push([\n toExpression(schema[index][0]),\n toFunction(schema[index][1])\n ])\n }\n } else {\n /** @type {string} */\n let key\n\n for (key in schema) {\n if (own.call(schema, key)) {\n result.push([toExpression(key), toFunction(schema[key])])\n }\n }\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Find.\n * @returns {RegExp}\n * Expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Replace.\n * @returns {ReplaceFunction}\n * Function.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function' ? replace : () => replace\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","/**\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-from-markdown').Transform} FromMarkdownTransform\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n *\n * @typedef {import('mdast-util-find-and-replace').ReplaceFunction} ReplaceFunction\n * @typedef {import('mdast-util-find-and-replace').RegExpMatchObject} RegExpMatchObject\n */\n\nimport {ccount} from 'ccount'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n// To do: next major: expose functions instead of extensions.\n\n/**\n * Extension for `mdast-util-from-markdown` to enable GFM autolink literals.\n *\n * @type {FromMarkdownExtension}\n */\nexport const gfmAutolinkLiteralFromMarkdown = {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n}\n\n/**\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n *\n * @type {ToMarkdownExtension}\n */\nexport const gfmAutolinkLiteralToMarkdown = {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {character: ':', before: '[ps]', after: '\\\\/', inConstruct, notInConstruct}\n ]\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = /** @type {Link} */ (this.stack[this.stack.length - 1])\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/g, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n * @returns {Link | Array | false}\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n * @returns {Link | false}\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string | undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n\n if (!trailExec) {\n return [url, undefined]\n }\n\n url = url.slice(0, trailExec.index)\n\n let trail = trailExec[0]\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean | null | undefined} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n (!email || code !== 47)\n )\n}\n","/**\n * @typedef {import('../types.js').AssociationId} AssociationId\n */\n\nimport {decodeString} from 'micromark-util-decode-string'\n\n/**\n * Get an identifier from an association to match it to others.\n *\n * Associations are nodes that match to something else through an ID:\n * .\n *\n * The `label` of an association is the string value: character escapes and\n * references work, and casing is intact.\n * The `identifier` is used to match one association to another:\n * controversially, character escapes and references don’t work in this\n * matching: `©` does not match `©`, and `\\+` does not match `+`.\n *\n * But casing is ignored (and whitespace) is trimmed and collapsed: ` A\\nb`\n * matches `a b`.\n * So, we do prefer the label when figuring out how we’re going to serialize:\n * it has whitespace, casing, and we can ignore most useless character\n * escapes and all character references.\n *\n * @type {AssociationId}\n */\nexport function association(node) {\n if (node.label || !node.identifier) {\n return node.label || ''\n }\n\n return decodeString(node.identifier)\n}\n","/**\n * @typedef {import('../types.js').FlowContent} FlowContent\n * @typedef {import('../types.js').Node} Node\n * @typedef {import('../types.js').Parent} Parent\n * @typedef {import('../types.js').State} State\n * @typedef {import('../types.js').TrackFields} TrackFields\n */\n\n/**\n * @param {Parent & {children: Array}} parent\n * Parent of flow nodes.\n * @param {State} state\n * Info passed around about the current state.\n * @param {TrackFields} info\n * Info on where we are in the document we are generating.\n * @returns {string}\n * Serialized children, joined by (blank) lines.\n */\nexport function containerFlow(parent, state, info) {\n const indexStack = state.indexStack\n const children = parent.children || []\n const tracker = state.createTracker(info)\n /** @type {Array} */\n const results = []\n let index = -1\n\n indexStack.push(-1)\n\n while (++index < children.length) {\n const child = children[index]\n\n indexStack[indexStack.length - 1] = index\n\n results.push(\n tracker.move(\n state.handle(child, parent, state, {\n before: '\\n',\n after: '\\n',\n ...tracker.current()\n })\n )\n )\n\n if (child.type !== 'list') {\n state.bulletLastUsed = undefined\n }\n\n if (index < children.length - 1) {\n results.push(\n tracker.move(between(child, children[index + 1], parent, state))\n )\n }\n }\n\n indexStack.pop()\n\n return results.join('')\n}\n\n/**\n * @param {Node} left\n * @param {Node} right\n * @param {Parent} parent\n * @param {State} state\n * @returns {string}\n */\nfunction between(left, right, parent, state) {\n let index = state.join.length\n\n while (index--) {\n const result = state.join[index](left, right, parent, state)\n\n if (result === true || result === 1) {\n break\n }\n\n if (typeof result === 'number') {\n return '\\n'.repeat(1 + result)\n }\n\n if (result === false) {\n return '\\n\\n\\n\\n'\n }\n }\n\n return '\\n\\n'\n}\n","/**\n * @typedef {import('../types.js').IndentLines} IndentLines\n */\n\nconst eol = /\\r?\\n|\\r/g\n\n/**\n * @type {IndentLines}\n */\nexport function indentLines(value, map) {\n /** @type {Array} */\n const result = []\n let start = 0\n let line = 0\n /** @type {RegExpExecArray | null} */\n let match\n\n while ((match = eol.exec(value))) {\n one(value.slice(start, match.index))\n result.push(match[0])\n start = match.index + match[0].length\n line++\n }\n\n one(value.slice(start))\n\n return result.join('')\n\n /**\n * @param {string} value\n */\n function one(value) {\n result.push(map(value, line, !value))\n }\n}\n","/**\n * @typedef {import('../types.js').Unsafe} Unsafe\n */\n\n/**\n * @param {Unsafe} pattern\n * @returns {RegExp}\n */\nexport function patternCompile(pattern) {\n if (!pattern._compiled) {\n const before =\n (pattern.atBreak ? '[\\\\r\\\\n][\\\\t ]*' : '') +\n (pattern.before ? '(?:' + pattern.before + ')' : '')\n\n pattern._compiled = new RegExp(\n (before ? '(' + before + ')' : '') +\n (/[|\\\\{}()[\\]^$+*?.-]/.test(pattern.character) ? '\\\\' : '') +\n pattern.character +\n (pattern.after ? '(?:' + pattern.after + ')' : ''),\n 'g'\n )\n }\n\n return pattern._compiled\n}\n","/**\n * @typedef {import('../types.js').Unsafe} Unsafe\n * @typedef {import('../types.js').ConstructName} ConstructName\n */\n\n/**\n * @param {Array} stack\n * @param {Unsafe} pattern\n * @returns {boolean}\n */\nexport function patternInScope(stack, pattern) {\n return (\n listInScope(stack, pattern.inConstruct, true) &&\n !listInScope(stack, pattern.notInConstruct, false)\n )\n}\n\n/**\n * @param {Array} stack\n * @param {Unsafe['inConstruct']} list\n * @param {boolean} none\n * @returns {boolean}\n */\nfunction listInScope(stack, list, none) {\n if (typeof list === 'string') {\n list = [list]\n }\n\n if (!list || list.length === 0) {\n return none\n }\n\n let index = -1\n\n while (++index < list.length) {\n if (stack.includes(list[index])) {\n return true\n }\n }\n\n return false\n}\n","/**\n * @typedef {import('../types.js').State} State\n * @typedef {import('../types.js').SafeConfig} SafeConfig\n */\n\nimport {patternCompile} from './pattern-compile.js'\nimport {patternInScope} from './pattern-in-scope.js'\n\n/**\n * Make a string safe for embedding in markdown constructs.\n *\n * In markdown, almost all punctuation characters can, in certain cases,\n * result in something.\n * Whether they do is highly subjective to where they happen and in what\n * they happen.\n *\n * To solve this, `mdast-util-to-markdown` tracks:\n *\n * * Characters before and after something;\n * * What “constructs” we are in.\n *\n * This information is then used by this function to escape or encode\n * special characters.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {string | null | undefined} input\n * Raw value to make safe.\n * @param {SafeConfig} config\n * Configuration.\n * @returns {string}\n * Serialized markdown safe for embedding.\n */\nexport function safe(state, input, config) {\n const value = (config.before || '') + (input || '') + (config.after || '')\n /** @type {Array} */\n const positions = []\n /** @type {Array} */\n const result = []\n /** @type {Record} */\n const infos = {}\n let index = -1\n\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n\n if (!patternInScope(state.stack, pattern)) {\n continue\n }\n\n const expression = patternCompile(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n while ((match = expression.exec(value))) {\n const before = 'before' in pattern || Boolean(pattern.atBreak)\n const after = 'after' in pattern\n const position = match.index + (before ? match[1].length : 0)\n\n if (positions.includes(position)) {\n if (infos[position].before && !before) {\n infos[position].before = false\n }\n\n if (infos[position].after && !after) {\n infos[position].after = false\n }\n } else {\n positions.push(position)\n infos[position] = {before, after}\n }\n }\n }\n\n positions.sort(numerical)\n\n let start = config.before ? config.before.length : 0\n const end = value.length - (config.after ? config.after.length : 0)\n index = -1\n\n while (++index < positions.length) {\n const position = positions[index]\n\n // Character before or after matched:\n if (position < start || position >= end) {\n continue\n }\n\n // If this character is supposed to be escaped because it has a condition on\n // the next character, and the next character is definitly being escaped,\n // then skip this escape.\n if (\n (position + 1 < end &&\n positions[index + 1] === position + 1 &&\n infos[position].after &&\n !infos[position + 1].before &&\n !infos[position + 1].after) ||\n (positions[index - 1] === position - 1 &&\n infos[position].before &&\n !infos[position - 1].before &&\n !infos[position - 1].after)\n ) {\n continue\n }\n\n if (start !== position) {\n // If we have to use a character reference, an ampersand would be more\n // correct, but as backslashes only care about punctuation, either will\n // do the trick\n result.push(escapeBackslashes(value.slice(start, position), '\\\\'))\n }\n\n start = position\n\n if (\n /[!-/:-@[-`{-~]/.test(value.charAt(position)) &&\n (!config.encode || !config.encode.includes(value.charAt(position)))\n ) {\n // Character escape.\n result.push('\\\\')\n } else {\n // Character reference.\n result.push(\n '&#x' + value.charCodeAt(position).toString(16).toUpperCase() + ';'\n )\n start++\n }\n }\n\n result.push(escapeBackslashes(value.slice(start, end), config.after))\n\n return result.join('')\n}\n\n/**\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction numerical(a, b) {\n return a - b\n}\n\n/**\n * @param {string} value\n * @param {string} after\n * @returns {string}\n */\nfunction escapeBackslashes(value, after) {\n const expression = /\\\\(?=[!-/:-@[-`{-~])/g\n /** @type {Array} */\n const positions = []\n /** @type {Array} */\n const results = []\n const whole = value + after\n let index = -1\n let start = 0\n /** @type {RegExpExecArray | null} */\n let match\n\n while ((match = expression.exec(whole))) {\n positions.push(match.index)\n }\n\n while (++index < positions.length) {\n if (start !== positions[index]) {\n results.push(value.slice(start, positions[index]))\n }\n\n results.push('\\\\')\n start = positions[index]\n }\n\n results.push(value.slice(start))\n\n return results.join('')\n}\n","/**\n * @typedef {import('../types.js').CreateTracker} CreateTracker\n * @typedef {import('../types.js').TrackCurrent} TrackCurrent\n * @typedef {import('../types.js').TrackMove} TrackMove\n * @typedef {import('../types.js').TrackShift} TrackShift\n */\n\n/**\n * Track positional info in the output.\n *\n * @type {CreateTracker}\n */\nexport function track(config) {\n // Defaults are used to prevent crashes when older utilities somehow activate\n // this code.\n /* c8 ignore next 5 */\n const options = config || {}\n const now = options.now || {}\n let lineShift = options.lineShift || 0\n let line = now.line || 1\n let column = now.column || 1\n\n return {move, current, shift}\n\n /**\n * Get the current tracked info.\n *\n * @type {TrackCurrent}\n */\n function current() {\n return {now: {line, column}, lineShift}\n }\n\n /**\n * Define an increased line shift (the typical indent for lines).\n *\n * @type {TrackShift}\n */\n function shift(value) {\n lineShift += value\n }\n\n /**\n * Move past some generated markdown.\n *\n * @type {TrackMove}\n */\n function move(input) {\n // eslint-disable-next-line unicorn/prefer-default-parameters\n const value = input || ''\n const chunks = value.split(/\\r?\\n|\\r/g)\n const tail = chunks[chunks.length - 1]\n line += chunks.length - 1\n column =\n chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift\n return value\n }\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Map} Map\n */\n\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {association} from 'mdast-util-to-markdown/lib/util/association.js'\nimport {containerFlow} from 'mdast-util-to-markdown/lib/util/container-flow.js'\nimport {indentLines} from 'mdast-util-to-markdown/lib/util/indent-lines.js'\nimport {safe} from 'mdast-util-to-markdown/lib/util/safe.js'\nimport {track} from 'mdast-util-to-markdown/lib/util/track.js'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n// To do: next major: rename `context` -> `state`, `safeOptions` to `info`, use\n// utilities on `state`.\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteDefinition: enterFootnoteDefinition,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteCallString: enterFootnoteCallString\n },\n exit: {\n gfmFootnoteDefinition: exitFootnoteDefinition,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteCallString: exitFootnoteCallString\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown() {\n return {\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['phrasing', 'label', 'reference']}],\n handlers: {footnoteDefinition, footnoteReference}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = /** @type {FootnoteDefinition} */ (\n this.stack[this.stack.length - 1]\n )\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = /** @type {FootnoteDefinition} */ (\n this.stack[this.stack.length - 1]\n )\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, context, safeOptions) {\n const tracker = track(safeOptions)\n let value = tracker.move('[^')\n const exit = context.enter('footnoteReference')\n const subexit = context.enter('reference')\n value += tracker.move(\n safe(context, association(node), {\n ...tracker.current(),\n before: value,\n after: ']'\n })\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\nfunction footnoteDefinition(node, _, context, safeOptions) {\n const tracker = track(safeOptions)\n let value = tracker.move('[^')\n const exit = context.enter('footnoteDefinition')\n const subexit = context.enter('label')\n value += tracker.move(\n safe(context, association(node), {\n ...tracker.current(),\n before: value,\n after: ']'\n })\n )\n subexit()\n value += tracker.move(\n ']:' + (node.children && node.children.length > 0 ? ' ' : '')\n )\n tracker.shift(4)\n value += tracker.move(\n indentLines(containerFlow(node, context, tracker.current()), map)\n )\n exit()\n\n return value\n}\n\n/** @type {Map} */\nfunction map(line, index, blank) {\n if (index === 0) {\n return line\n }\n\n return (blank ? '' : ' ') + line\n}\n","/**\n * @typedef {import('../types.js').Handle} Handle\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').Parent} Parent\n * @typedef {import('../types.js').PhrasingContent} PhrasingContent\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * Serialize the children of a parent that contains phrasing children.\n *\n * These children will be joined flush together.\n *\n * @param {Parent & {children: Array}} parent\n * Parent of flow nodes.\n * @param {State} state\n * Info passed around about the current state.\n * @param {Info} info\n * Info on where we are in the document we are generating.\n * @returns {string}\n * Serialized children, joined together.\n */\nexport function containerPhrasing(parent, state, info) {\n const indexStack = state.indexStack\n const children = parent.children || []\n /** @type {Array} */\n const results = []\n let index = -1\n let before = info.before\n\n indexStack.push(-1)\n let tracker = state.createTracker(info)\n\n while (++index < children.length) {\n const child = children[index]\n /** @type {string} */\n let after\n\n indexStack[indexStack.length - 1] = index\n\n if (index + 1 < children.length) {\n /** @type {Handle} */\n // @ts-expect-error: hush, it’s actually a `zwitch`.\n let handle = state.handle.handlers[children[index + 1].type]\n /** @type {Handle} */\n // @ts-expect-error: hush, it’s actually a `zwitch`.\n if (handle && handle.peek) handle = handle.peek\n after = handle\n ? handle(children[index + 1], parent, state, {\n before: '',\n after: '',\n ...tracker.current()\n }).charAt(0)\n : ''\n } else {\n after = info.after\n }\n\n // In some cases, html (text) can be found in phrasing right after an eol.\n // When we’d serialize that, in most cases that would be seen as html\n // (flow).\n // As we can’t escape or so to prevent it from happening, we take a somewhat\n // reasonable approach: replace that eol with a space.\n // See: \n if (\n results.length > 0 &&\n (before === '\\r' || before === '\\n') &&\n child.type === 'html'\n ) {\n results[results.length - 1] = results[results.length - 1].replace(\n /(\\r?\\n|\\r)$/,\n ' '\n )\n before = ' '\n\n // To do: does this work to reset tracker?\n tracker = state.createTracker(info)\n tracker.move(results.join(''))\n }\n\n results.push(\n tracker.move(\n state.handle(child, parent, state, {\n ...tracker.current(),\n before,\n after\n })\n )\n )\n\n before = results[results.length - 1].slice(-1)\n }\n\n indexStack.pop()\n\n return results.join('')\n}\n","/**\n * @typedef {import('mdast').Delete} Delete\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {containerPhrasing} from 'mdast-util-to-markdown/lib/util/container-phrasing.js'\nimport {track} from 'mdast-util-to-markdown/lib/util/track.js'\n\n// To do: next major: expose functions.\n// To do: next major: use `state`, state utilities.\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: \n *\n * @type {Array}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.peek = peekDelete\n\n/**\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n *\n * @type {FromMarkdownExtension}\n */\nexport const gfmStrikethroughFromMarkdown = {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n}\n\n/**\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n *\n * @type {ToMarkdownExtension}\n */\nexport const gfmStrikethroughToMarkdown = {\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: {delete: handleDelete}\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, context, safeOptions) {\n const tracker = track(safeOptions)\n const exit = context.enter('strikethrough')\n let value = tracker.move('~~')\n value += containerPhrasing(node, context, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../types.js').Parent} Parent\n * @typedef {import('../types.js').State} State\n */\n\nimport {patternCompile} from '../util/pattern-compile.js'\n\ninlineCode.peek = inlineCodePeek\n\n/**\n * @param {InlineCode} node\n * @param {Parent | undefined} _\n * @param {State} state\n * @returns {string}\n */\nexport function inlineCode(node, _, state) {\n let value = node.value || ''\n let sequence = '`'\n let index = -1\n\n // If there is a single grave accent on its own in the code, use a fence of\n // two.\n // If there are two in a row, use one.\n while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) {\n sequence += '`'\n }\n\n // If this is not just spaces or eols (tabs don’t count), and either the\n // first or last character are a space, eol, or tick, then pad with spaces.\n if (\n /[^ \\r\\n]/.test(value) &&\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) || /^`|`$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can’t escape characters in `inlineCode`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n const expression = patternCompile(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.charCodeAt(position) === 10 /* `\\n` */ &&\n value.charCodeAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n}\n\n/**\n * @returns {string}\n */\nfunction inlineCodePeek() {\n return '`'\n}\n","/**\n * @typedef Options\n * Configuration (optional).\n * @property {string|null|ReadonlyArray} [align]\n * One style for all columns, or styles for their respective columns.\n * Each style is either `'l'` (left), `'r'` (right), or `'c'` (center).\n * Other values are treated as `''`, which doesn’t place the colon in the\n * alignment row but does align left.\n * *Only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean} [padding=true]\n * Whether to add a space of padding between delimiters and cells.\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {boolean} [delimiterStart=true]\n * Whether to begin each row with the delimiter.\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean} [delimiterEnd=true]\n * Whether to end each row with the delimiter.\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean} [alignDelimiters=true]\n * Whether to align the delimiters.\n * By default, they are aligned:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {(value: string) => number} [stringLength]\n * Function to detect the length of table cell content.\n * This is used when aligning the delimiters (`|`) between table cells.\n * Full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source.\n * To fix this, you can pass this function, which receives the cell content\n * and returns its “visible” size.\n * Note that what is and isn’t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n */\n\n/**\n * @typedef {Options} MarkdownTableOptions\n * @todo\n * Remove next major.\n */\n\n/**\n * Generate a markdown ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)) table..\n *\n * @param {ReadonlyArray>} table\n * Table data (matrix of strings).\n * @param {Options} [options]\n * Configuration (optional).\n * @returns {string}\n */\nexport function markdownTable(table, options = {}) {\n const align = (options.align || []).concat()\n const stringLength = options.stringLength || defaultStringLength\n /** @type {Array} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array>} Cells per row. */\n const cellMatrix = []\n /** @type {Array>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don’t align delimiters, but otherwise we’d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (options.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n options.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (options.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (options.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (options.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n options.padding !== false &&\n // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(options.alignDelimiters === false && cell === '') &&\n (options.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (options.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (options.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (options.padding !== false) {\n line.push(' ')\n }\n\n if (\n options.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n options.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string|null|undefined} [value]\n * @returns {string}\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string} value\n * @returns {number}\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * @param {string|null|undefined} value\n * @returns {number}\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n","/**\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('mdast').InlineCode} InlineCode\n *\n * @typedef {import('markdown-table').MarkdownTableOptions} MarkdownTableOptions\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Context} ToMarkdownContext\n * @typedef {import('mdast-util-to-markdown').SafeOptions} SafeOptions\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [tableCellPadding=true]\n * Whether to add a space of padding between delimiters and cells.\n * @property {boolean | null | undefined} [tablePipeAlign=true]\n * Whether to align the delimiters.\n * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]\n * Function to detect the length of table cell content, used when aligning\n * the delimiters between cells\n */\n\nimport {containerPhrasing} from 'mdast-util-to-markdown/lib/util/container-phrasing.js'\nimport {inlineCode} from 'mdast-util-to-markdown/lib/handle/inline-code.js'\nimport {markdownTable} from 'markdown-table'\n\n// To do: next major: use `state` and `state` utilities from `mdast-util-to-markdown`.\n// To do: next major: use `defaultHandlers.inlineCode`.\n// To do: next major: expose functions.\n\n/**\n * Extension for `mdast-util-from-markdown` to enable GFM tables.\n *\n * @type {FromMarkdownExtension}\n */\nexport const gfmTableFromMarkdown = {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterTable(token) {\n /** @type {Array<'left' | 'right' | 'center' | 'none'>} */\n // @ts-expect-error: `align` is custom.\n const align = token._align\n this.enter(\n {\n type: 'table',\n align: align.map((d) => (d === 'none' ? null : d)),\n children: []\n },\n token\n )\n this.setData('inTable', true)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitTable(token) {\n this.exit(token)\n this.setData('inTable')\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterRow(token) {\n this.enter({type: 'tableRow', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exit(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterCell(token) {\n this.enter({type: 'tableCell', children: []}, token)\n}\n\n// Overwrite the default code text data handler to unescape escaped pipes when\n// they are in tables.\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.getData('inTable')) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = /** @type {InlineCode} */ (this.stack[this.stack.length - 1])\n node.value = value\n this.exit(token)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @returns {string}\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don’t (but can’t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM tables in\n * markdown.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM tables.\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const padding = settings.tableCellPadding\n const alignDelimiters = settings.tablePipeAlign\n const stringLength = settings.stringLength\n const around = padding ? ' ' : '|'\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // \n {atBreak: true, character: '-', after: '[:|-]'}\n ],\n handlers: {\n table: handleTable,\n tableRow: handleTableRow,\n tableCell: handleTableCell,\n inlineCode: inlineCodeWithTable\n }\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Table} node\n */\n function handleTable(node, _, context, safeOptions) {\n return serializeData(\n handleTableAsData(node, context, safeOptions),\n node.align\n )\n }\n\n /**\n * This function isn’t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n */\n function handleTableRow(node, _, context, safeOptions) {\n const row = handleTableRowAsData(node, context, safeOptions)\n const value = serializeData([row])\n // `markdown-table` will always add an align row\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n */\n function handleTableCell(node, _, context, safeOptions) {\n const exit = context.enter('tableCell')\n const subexit = context.enter('phrasing')\n const value = containerPhrasing(node, context, {\n ...safeOptions,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * @param {Array>} matrix\n * @param {Array | null | undefined} [align]\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n // @ts-expect-error: `markdown-table` types should support `null`.\n alignDelimiters,\n // @ts-expect-error: `markdown-table` types should support `null`.\n padding,\n // @ts-expect-error: `markdown-table` types should support `null`.\n stringLength\n })\n }\n\n /**\n * @param {Table} node\n * @param {ToMarkdownContext} context\n * @param {SafeOptions} safeOptions\n */\n function handleTableAsData(node, context, safeOptions) {\n const children = node.children\n let index = -1\n /** @type {Array>} */\n const result = []\n const subexit = context.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(\n children[index],\n context,\n safeOptions\n )\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @param {TableRow} node\n * @param {ToMarkdownContext} context\n * @param {SafeOptions} safeOptions\n */\n function handleTableRowAsData(node, context, safeOptions) {\n const children = node.children\n let index = -1\n /** @type {Array} */\n const result = []\n const subexit = context.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(\n children[index],\n node,\n context,\n safeOptions\n )\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n */\n function inlineCodeWithTable(node, parent, context) {\n let value = inlineCode(node, parent, context)\n\n if (context.stack.includes('tableCell')) {\n value = value.replace(/\\|/g, '\\\\$&')\n }\n\n return value\n }\n}\n","/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('../types.js').Map} Map\n * @typedef {import('../types.js').Parent} Parent\n * @typedef {import('../types.js').State} State\n * @typedef {import('../types.js').Info} Info\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkListItemIndent} from '../util/check-list-item-indent.js'\n\n/**\n * @param {ListItem} node\n * @param {Parent | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function listItem(node, parent, state, info) {\n const listItemIndent = checkListItemIndent(state)\n let bullet = state.bulletCurrent || checkBullet(state)\n\n // Add the marker value for ordered lists.\n if (parent && parent.type === 'list' && parent.ordered) {\n bullet =\n (typeof parent.start === 'number' && parent.start > -1\n ? parent.start\n : 1) +\n (state.options.incrementListMarker === false\n ? 0\n : parent.children.indexOf(node)) +\n bullet\n }\n\n let size = bullet.length + 1\n\n if (\n listItemIndent === 'tab' ||\n (listItemIndent === 'mixed' &&\n ((parent && parent.type === 'list' && parent.spread) || node.spread))\n ) {\n size = Math.ceil(size / 4) * 4\n }\n\n const tracker = state.createTracker(info)\n tracker.move(bullet + ' '.repeat(size - bullet.length))\n tracker.shift(size)\n const exit = state.enter('listItem')\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n\n return value\n\n /** @type {Map} */\n function map(line, index, blank) {\n if (index) {\n return (blank ? '' : ' '.repeat(size)) + line\n }\n\n return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line\n }\n}\n","/**\n * @typedef {import('../types.js').State} State\n * @typedef {import('../types.js').Options} Options\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkListItemIndent(state) {\n const style = state.options.listItemIndent || 'tab'\n\n // To do: remove in a major.\n // @ts-expect-error: deprecated.\n if (style === 1 || style === '1') {\n return 'one'\n }\n\n if (style !== 'tab' && style !== 'one' && style !== 'mixed') {\n throw new Error(\n 'Cannot serialize items with `' +\n style +\n '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'\n )\n }\n\n return style\n}\n","/**\n * @typedef {import('../types.js').State} State\n * @typedef {import('../types.js').Options} Options\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBullet(state) {\n const marker = state.options.bullet || '*'\n\n if (marker !== '*' && marker !== '+' && marker !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bullet`, expected `*`, `+`, or `-`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\n/**\n * @typedef {Extract} Parents\n */\n\nimport {listItem} from 'mdast-util-to-markdown/lib/handle/list-item.js'\nimport {track} from 'mdast-util-to-markdown/lib/util/track.js'\n\n// To do: next major: rename `context` -> `state`, `safeOptions` -> `info`, use\n// `track` from `state`.\n// To do: next major: replace exports with functions.\n// To do: next major: use `defaulthandlers.listItem`.\n\n/**\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n *\n * @type {FromMarkdownExtension}\n */\nexport const gfmTaskListItemFromMarkdown = {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n}\n\n/**\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n *\n * @type {ToMarkdownExtension}\n */\nexport const gfmTaskListItemToMarkdown = {\n unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],\n handlers: {listItem: listItemWithTaskListItem}\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCheck(token) {\n const node = /** @type {ListItem} */ (this.stack[this.stack.length - 2])\n // We’re always in a paragraph, in a list item.\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = /** @type {Parents} */ (this.stack[this.stack.length - 2])\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean'\n ) {\n const node = /** @type {Paragraph} */ (this.stack[this.stack.length - 1])\n const head = node.children[0]\n\n if (head && head.type === 'text') {\n const siblings = parent.children\n let index = -1\n /** @type {Paragraph | undefined} */\n let firstParaghraph\n\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParaghraph = sibling\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {ListItem} node\n */\nfunction listItemWithTaskListItem(node, parent, context, safeOptions) {\n const head = node.children[0]\n const checkable =\n typeof node.checked === 'boolean' && head && head.type === 'paragraph'\n const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '\n const tracker = track(safeOptions)\n\n if (checkable) {\n tracker.move(checkbox)\n }\n\n let value = listItem(node, parent, context, {\n ...safeOptions,\n ...tracker.current()\n })\n\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n /**\n * @param {string} $0\n * @returns {string}\n */\n function check($0) {\n return $0 + checkbox\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('micromark-extension-gfm').Options & import('mdast-util-gfm').Options} Options\n */\n\nimport {gfm} from 'micromark-extension-gfm'\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\n\n/**\n * Plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists).\n *\n * @type {import('unified').Plugin<[Options?]|void[], Root>}\n */\nexport default function remarkGfm(options = {}) {\n const data = this.data()\n\n add('micromarkExtensions', gfm(options))\n add('fromMarkdownExtensions', gfmFromMarkdown())\n add('toMarkdownExtensions', gfmToMarkdown(options))\n\n /**\n * @param {string} field\n * @param {unknown} value\n */\n function add(field, value) {\n const list = /** @type {unknown[]} */ (\n // Other extensions\n /* c8 ignore next 2 */\n data[field] ? data[field] : (data[field] = [])\n )\n\n list.push(value)\n }\n}\n","/**\n * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions\n * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */\n\nimport {\n combineExtensions,\n combineHtmlExtensions\n} from 'micromark-util-combine-extensions'\nimport {\n gfmAutolinkLiteral,\n gfmAutolinkLiteralHtml\n} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'\nimport {\n gfmStrikethrough,\n gfmStrikethroughHtml\n} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\nimport {\n gfmTaskListItem,\n gfmTaskListItemHtml\n} from 'micromark-extension-gfm-task-list-item'\n\n/**\n * Create an extension for `micromark` to enable GFM syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-strikethrough`.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * syntax.\n */\nexport function gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral,\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable,\n gfmTaskListItem\n ])\n}\n\n/**\n * Create an extension for `micromark` to support GFM when serializing to HTML.\n *\n * @param {HtmlOptions | null | undefined} [options]\n * Configuration.\n *\n * Passed to `micromark-extens-gfm-footnote`.\n * @returns {HtmlExtension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM when serializing to HTML.\n */\nexport function gfmHtml(options) {\n return combineHtmlExtensions([\n gfmAutolinkLiteralHtml,\n gfmFootnoteHtml(options),\n gfmStrikethroughHtml,\n gfmTableHtml,\n gfmTagfilterHtml,\n gfmTaskListItemHtml\n ])\n}\n","/**\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * @typedef {import('mdast-util-gfm-table').Options} Options\n * Configuration.\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @returns {Array}\n * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown,\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown,\n gfmTableFromMarkdown,\n gfmTaskListItemFromMarkdown\n ]\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown,\n gfmFootnoteToMarkdown(),\n gfmStrikethroughToMarkdown,\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown\n ]\n }\n}\n","/**\n * @typedef {import('./core.js').HChild} Child\n * Acceptable child value.\n * @typedef {import('./core.js').HProperties} Properties\n * Acceptable value for element properties.\n * @typedef {import('./core.js').HResult} Result\n * Result from a `h` (or `s`) call.\n *\n * @typedef {import('./jsx-classic.js').Element} s.JSX.Element\n * @typedef {import('./jsx-classic.js').IntrinsicAttributes} s.JSX.IntrinsicAttributes\n * @typedef {import('./jsx-classic.js').IntrinsicElements} s.JSX.IntrinsicElements\n * @typedef {import('./jsx-classic.js').ElementChildrenAttribute} s.JSX.ElementChildrenAttribute\n */\n\nimport {svg} from 'property-information'\nimport {core} from './core.js'\nimport {svgCaseSensitiveTagNames} from './svg-case-sensitive-tag-names.js'\n\nexport const s = core(svg, 'g', svgCaseSensitiveTagNames)\n","export const svgCaseSensitiveTagNames = [\n 'altGlyph',\n 'altGlyphDef',\n 'altGlyphItem',\n 'animateColor',\n 'animateMotion',\n 'animateTransform',\n 'clipPath',\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n 'foreignObject',\n 'glyphRef',\n 'linearGradient',\n 'radialGradient',\n 'solidColor',\n 'textArea',\n 'textPath'\n]\n","/**\n * Map of web namespaces.\n *\n * @type {Record}\n */\nexport const webNamespaces = {\n html: 'http://www.w3.org/1999/xhtml',\n mathml: 'http://www.w3.org/1998/Math/MathML',\n svg: 'http://www.w3.org/2000/svg',\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace',\n xmlns: 'http://www.w3.org/2000/xmlns/'\n}\n","/**\n * @typedef {import('vfile').VFile} VFile\n * @typedef {import('property-information').Schema} Schema\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Point} Point\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Content} Content\n * @typedef {import('parse5').DefaultTreeAdapterMap} DefaultTreeAdapterMap\n * @typedef {import('parse5').Token.ElementLocation} P5ElementLocation\n * @typedef {import('parse5').Token.Location} P5Location\n */\n\n/**\n * @typedef {Content | Root} Node\n * @typedef {DefaultTreeAdapterMap['document']} P5Document\n * @typedef {DefaultTreeAdapterMap['documentFragment']} P5DocumentFragment\n * @typedef {DefaultTreeAdapterMap['documentType']} P5DocumentType\n * @typedef {DefaultTreeAdapterMap['commentNode']} P5Comment\n * @typedef {DefaultTreeAdapterMap['textNode']} P5Text\n * @typedef {DefaultTreeAdapterMap['element']} P5Element\n * @typedef {DefaultTreeAdapterMap['node']} P5Node\n * @typedef {DefaultTreeAdapterMap['template']} P5Template\n *\n * @typedef {'html' | 'svg'} Space\n * Namespace.\n *\n * @typedef Options\n * Configuration.\n * @property {Space | null | undefined} [space='html']\n * Which space the document is in.\n *\n * When an `` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it.\n * @property {VFile | null | undefined} [file]\n * File used to add positional info to nodes.\n *\n * If given, the file should represent the original HTML source.\n * @property {boolean} [verbose=false]\n * Whether to add extra positional info about starting tags, closing tags,\n * and attributes to elements.\n *\n * > 👉 **Note**: only used when `file` is given.\n *\n * @typedef State\n * Info passed around about the current state.\n * @property {Schema} schema\n * Current schema.\n * @property {VFile | undefined} file\n * Corresponding file.\n * @property {boolean | undefined} verbose\n * Add extra positional info.\n * @property {boolean} location\n * Whether location info was found.\n */\n\nimport {h, s} from 'hastscript'\nimport {html, svg, find} from 'property-information'\nimport {location} from 'vfile-location'\nimport {webNamespaces} from 'web-namespaces'\n\nconst own = {}.hasOwnProperty\n/** @type {unknown} */\n// type-coverage:ignore-next-line\nconst proto = Object.prototype\n\n/**\n * Transform a `parse5` AST to hast.\n *\n * @param {P5Node} tree\n * `parse5` tree to transform.\n * @param {Options | VFile | null | undefined} [options]\n * Configuration.\n * @returns {Node}\n * hast tree.\n */\nexport function fromParse5(tree, options) {\n const options_ = options || {}\n /** @type {Options} */\n let settings\n /** @type {VFile | undefined} */\n let file\n\n if (isFile(options_)) {\n file = options_\n settings = {}\n } else {\n file = options_.file || undefined\n settings = options_\n }\n\n return one(\n {\n schema: settings.space === 'svg' ? svg : html,\n file,\n verbose: settings.verbose,\n location: false\n },\n tree\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {P5Node} node\n * p5 node.\n * @returns {Node}\n * hast node.\n */\nfunction one(state, node) {\n /** @type {Node} */\n let result\n\n switch (node.nodeName) {\n case '#comment': {\n const reference = /** @type {P5Comment} */ (node)\n result = {type: 'comment', value: reference.data}\n patch(state, reference, result)\n return result\n }\n\n case '#document':\n case '#document-fragment': {\n const reference = /** @type {P5Document | P5DocumentFragment} */ (node)\n const quirksMode =\n 'mode' in reference\n ? reference.mode === 'quirks' || reference.mode === 'limited-quirks'\n : false\n\n result = {\n type: 'root',\n children: all(state, node.childNodes),\n data: {quirksMode}\n }\n\n if (state.file && state.location) {\n const doc = String(state.file)\n const loc = location(doc)\n const start = loc.toPoint(0)\n const end = loc.toPoint(doc.length)\n // @ts-expect-error: always defined as we give valid input.\n result.position = {start, end}\n }\n\n return result\n }\n\n case '#documentType': {\n const reference = /** @type {P5DocumentType} */ (node)\n // @ts-expect-error Types are out of date.\n result = {type: 'doctype'}\n patch(state, reference, result)\n return result\n }\n\n case '#text': {\n const reference = /** @type {P5Text} */ (node)\n result = {type: 'text', value: reference.value}\n patch(state, reference, result)\n return result\n }\n\n // Element.\n default: {\n const reference = /** @type {P5Element} */ (node)\n result = element(state, reference)\n return result\n }\n }\n}\n\n/**\n * Transform children.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {Array} nodes\n * Nodes.\n * @returns {Array}\n * hast nodes.\n */\nfunction all(state, nodes) {\n let index = -1\n /** @type {Array} */\n const result = []\n\n while (++index < nodes.length) {\n // @ts-expect-error Assume no roots in `nodes`.\n result[index] = one(state, nodes[index])\n }\n\n return result\n}\n\n/**\n * Transform an element.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {P5Element} node\n * `parse5` node to transform.\n * @returns {Element}\n * hast node.\n */\nfunction element(state, node) {\n const schema = state.schema\n\n state.schema = node.namespaceURI === webNamespaces.svg ? svg : html\n\n // Props.\n let index = -1\n /** @type {Record} */\n const props = {}\n\n while (++index < node.attrs.length) {\n const attribute = node.attrs[index]\n const name =\n (attribute.prefix ? attribute.prefix + ':' : '') + attribute.name\n if (!own.call(proto, name)) {\n props[name] = attribute.value\n }\n }\n\n // Build.\n const fn = state.schema.space === 'svg' ? s : h\n const result = fn(node.tagName, props, all(state, node.childNodes))\n patch(state, node, result)\n\n // Switch content.\n if (result.tagName === 'template') {\n const reference = /** @type {P5Template} */ (node)\n const pos = reference.sourceCodeLocation\n const startTag = pos && pos.startTag && position(pos.startTag)\n const endTag = pos && pos.endTag && position(pos.endTag)\n\n /** @type {Root} */\n // @ts-expect-error Types are wrong.\n const content = one(state, reference.content)\n\n if (startTag && endTag && state.file) {\n content.position = {start: startTag.end, end: endTag.start}\n }\n\n result.content = content\n }\n\n state.schema = schema\n\n return result\n}\n\n/**\n * Patch positional info from `from` onto `to`.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {P5Node} from\n * p5 node.\n * @param {Node} to\n * hast node.\n * @returns {void}\n * Nothing.\n */\nfunction patch(state, from, to) {\n if ('sourceCodeLocation' in from && from.sourceCodeLocation && state.file) {\n const position = createLocation(state, to, from.sourceCodeLocation)\n\n if (position) {\n state.location = true\n to.position = position\n }\n }\n}\n\n/**\n * Create clean positional information.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {Node} node\n * hast node.\n * @param {P5ElementLocation} location\n * p5 location info.\n * @returns {Position | undefined}\n * Position, or nothing.\n */\nfunction createLocation(state, node, location) {\n const result = position(location)\n\n if (node.type === 'element') {\n const tail = node.children[node.children.length - 1]\n\n // Bug for unclosed with children.\n // See: .\n if (\n result &&\n !location.endTag &&\n tail &&\n tail.position &&\n tail.position.end\n ) {\n result.end = Object.assign({}, tail.position.end)\n }\n\n if (state.verbose) {\n /** @type {Record} */\n const props = {}\n /** @type {string} */\n let key\n\n if (location.attrs) {\n for (key in location.attrs) {\n if (own.call(location.attrs, key)) {\n props[find(state.schema, key).property] = position(\n location.attrs[key]\n )\n }\n }\n }\n\n node.data = {\n position: {\n // @ts-expect-error: assume not `undefined`.\n opening: position(location.startTag),\n closing: location.endTag ? position(location.endTag) : null,\n properties: props\n }\n }\n }\n }\n\n return result\n}\n\n/**\n * Turn a p5 location into a position.\n *\n * @param {P5Location} loc\n * Location.\n * @returns {Position | undefined}\n * Position or nothing.\n */\nfunction position(loc) {\n const start = point({\n line: loc.startLine,\n column: loc.startCol,\n offset: loc.startOffset\n })\n const end = point({\n line: loc.endLine,\n column: loc.endCol,\n offset: loc.endOffset\n })\n // @ts-expect-error `undefined` is fine.\n return start || end ? {start, end} : undefined\n}\n\n/**\n * Filter out invalid points.\n *\n * @param {Point} point\n * Point with potentially `undefined` values.\n * @returns {Point | undefined}\n * Point or nothing.\n */\nfunction point(point) {\n return point.line && point.column ? point : undefined\n}\n\n/**\n * Check if something is a file.\n *\n * @param {VFile | Options} value\n * File or options.\n * @returns {value is VFile}\n * Whether `value` is a file.\n */\nfunction isFile(value) {\n return 'messages' in value\n}\n","/**\n * @typedef {import('vfile').VFile} VFile\n * @typedef {import('vfile').Value} Value\n */\n\n/**\n * @typedef Point\n * unist point, where `line` and `column` can be `undefined`.\n * @property {number | undefined} line\n * Line.\n * @property {number | undefined} column\n * Column.\n * @property {number | undefined} [offset]\n * Offset.\n *\n * @typedef PointLike\n * unist point, allowed as input.\n * @property {number | null | undefined} [line]\n * Line.\n * @property {number | null | undefined} [column]\n * Column.\n * @property {number | null | undefined} [offset]\n * Offset.\n *\n * @callback ToPoint\n * Get a line/column-based `point` from `offset`.\n * @param {number | null | undefined} [offset]\n * Something that should be an `offset.\n * @returns {Point}\n * Point, line/column are undefined for invalid or out of bounds input.\n *\n * @callback ToOffset\n * Get an offset from a line/column-based `point`.\n * @param {Point | null | undefined} [point]\n * Something that should be a `point.\n * @returns {number}\n * Offset or `-1` for invalid or out of bounds input.\n *\n * @typedef Location\n * Accessors for index.\n * @property {ToPoint} toPoint\n * Get a line/column-based `point` from `offset`.\n * @property {ToOffset} toOffset\n * Get an offset from a line/column-based `point`.\n */\n\n/**\n * Index the given document so you can translate between line/column and offset\n * based positional info.\n *\n * @param {VFile | Value} file\n * File to index.\n * @returns {Location}\n * Accessors for index.\n */\nexport function location(file) {\n const value = String(file)\n /** @type {Array} */\n const indices = []\n const search = /\\r?\\n|\\r/g\n\n while (search.test(value)) {\n indices.push(search.lastIndex)\n }\n\n indices.push(value.length + 1)\n\n return {toPoint, toOffset}\n\n /** @type {ToPoint} */\n function toPoint(offset) {\n let index = -1\n\n if (\n typeof offset === 'number' &&\n offset > -1 &&\n offset < indices[indices.length - 1]\n ) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (index > 0 ? indices[index - 1] : 0) + 1,\n offset\n }\n }\n }\n }\n\n return {line: undefined, column: undefined, offset: undefined}\n }\n\n /** @type {ToOffset} */\n function toOffset(point) {\n const line = point && point.line\n const column = point && point.column\n\n if (\n typeof line === 'number' &&\n typeof column === 'number' &&\n !Number.isNaN(line) &&\n !Number.isNaN(column) &&\n line - 1 in indices\n ) {\n const offset = (indices[line - 2] || 0) + column - 1 || 0\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n return offset\n }\n }\n\n return -1\n }\n}\n","/**\n * @callback Handler\n * Handle a value, with a certain ID field set to a certain value.\n * The ID field is passed to `zwitch`, and it’s value is this function’s\n * place on the `handlers` record.\n * @param {...any} parameters\n * Arbitrary parameters passed to the zwitch.\n * The first will be an object with a certain ID field set to a certain value.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback UnknownHandler\n * Handle values that do have a certain ID field, but it’s set to a value\n * that is not listed in the `handlers` record.\n * @param {unknown} value\n * An object with a certain ID field set to an unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback InvalidHandler\n * Handle values that do not have a certain ID field.\n * @param {unknown} value\n * Any unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {void|null|undefined|never}\n * This should crash or return nothing.\n */\n\n/**\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record} [Handlers=Record]\n * @typedef Options\n * Configuration (required).\n * @property {Invalid} [invalid]\n * Handler to use for invalid values.\n * @property {Unknown} [unknown]\n * Handler to use for unknown values.\n * @property {Handlers} [handlers]\n * Handlers to use.\n */\n\nconst own = {}.hasOwnProperty\n\n/**\n * Handle values based on a field.\n *\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record} [Handlers=Record]\n * @param {string} key\n * Field to switch on.\n * @param {Options} [options]\n * Configuration (required).\n * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters): ReturnType, (...parameters: Parameters): ReturnType}}\n */\nexport function zwitch(key, options) {\n const settings = options || {}\n\n /**\n * Handle one value.\n *\n * Based on the bound `key`, a respective handler will be called.\n * If `value` is not an object, or doesn’t have a `key` property, the special\n * “invalid” handler will be called.\n * If `value` has an unknown `key`, the special “unknown” handler will be\n * called.\n *\n * All arguments, and the context object, are passed through to the handler,\n * and it’s result is returned.\n *\n * @this {unknown}\n * Any context object.\n * @param {unknown} [value]\n * Any value.\n * @param {...unknown} parameters\n * Arbitrary parameters passed to the zwitch.\n * @property {Handler} invalid\n * Handle for values that do not have a certain ID field.\n * @property {Handler} unknown\n * Handle values that do have a certain ID field, but it’s set to a value\n * that is not listed in the `handlers` record.\n * @property {Handlers} handlers\n * Record of handlers.\n * @returns {unknown}\n * Anything.\n */\n function one(value, ...parameters) {\n /** @type {Handler|undefined} */\n let fn = one.invalid\n const handlers = one.handlers\n\n if (value && own.call(value, key)) {\n // @ts-expect-error Indexable.\n const id = String(value[key])\n // @ts-expect-error Indexable.\n fn = own.call(handlers, id) ? handlers[id] : one.unknown\n }\n\n if (fn) {\n return fn.call(this, value, ...parameters)\n }\n }\n\n one.handlers = settings.handlers || {}\n one.invalid = settings.invalid\n one.unknown = settings.unknown\n\n // @ts-expect-error: matches!\n return one\n}\n","/**\n * @typedef {import('parse5').DefaultTreeAdapterMap} DefaultTreeAdapterMap\n * @typedef {DefaultTreeAdapterMap['document']} P5Document\n * @typedef {DefaultTreeAdapterMap['documentFragment']} P5Fragment\n * @typedef {DefaultTreeAdapterMap['element']} P5Element\n * @typedef {DefaultTreeAdapterMap['node']} P5Node\n * @typedef {DefaultTreeAdapterMap['documentType']} P5Doctype\n * @typedef {DefaultTreeAdapterMap['commentNode']} P5Comment\n * @typedef {DefaultTreeAdapterMap['textNode']} P5Text\n * @typedef {DefaultTreeAdapterMap['parentNode']} P5Parent\n * @typedef {import('parse5').Token.Attribute} P5Attribute\n * @typedef {Exclude} P5Child\n * @typedef {import('property-information').Schema} Schema\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').DocType} Doctype\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').Content} Content\n */\n\n/**\n * @typedef {Content | Root} Node\n * @typedef {'html' | 'svg'} Space\n *\n * @typedef Options\n * Configuration.\n * @property {Space | null | undefined} [space='html']\n * Which space the document is in.\n *\n * When an `` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it.\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {html, svg, find} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {webNamespaces} from 'web-namespaces'\nimport {zwitch} from 'zwitch'\n\nconst own = {}.hasOwnProperty\n\n/** @type {(from: Node, schema: Schema) => P5Node} */\nconst one = zwitch('type', {handlers: {root, element, text, comment, doctype}})\n\n/**\n * Transform a hast tree to Parse5’s AST.\n *\n * @param {Node} tree\n * Tree to transform.\n * @param {Options | Space | null | undefined} [options]\n * Configuration.\n * @returns {P5Node}\n * `parse5` node.\n */\nexport function toParse5(tree, options) {\n const space = options && typeof options === 'object' ? options.space : options\n return one(tree, space === 'svg' ? svg : html)\n}\n\n/**\n * @param {Root} node\n * @param {Schema} schema\n * Current schema.\n * @returns {P5Document}\n */\nfunction root(node, schema) {\n /** @type {P5Document} */\n const result = {\n nodeName: '#document',\n // @ts-expect-error: `parse5` uses enums, which are actually strings.\n mode: (node.data || {}).quirksMode ? 'quirks' : 'no-quirks',\n childNodes: []\n }\n result.childNodes = all(node.children, result, schema)\n patch(node, result)\n return result\n}\n\n/**\n * @param {Root} node\n * @param {Schema} schema\n * Current schema.\n * @returns {P5Fragment}\n */\nfunction fragment(node, schema) {\n /** @type {P5Fragment} */\n const result = {nodeName: '#document-fragment', childNodes: []}\n result.childNodes = all(node.children, result, schema)\n patch(node, result)\n return result\n}\n\n/**\n * @param {Doctype} node\n * @returns {P5Doctype}\n */\nfunction doctype(node) {\n /** @type {P5Doctype} */\n const result = {\n nodeName: '#documentType',\n name: 'html',\n publicId: '',\n systemId: '',\n // @ts-expect-error: change to `null` in a major?\n parentNode: undefined\n }\n\n patch(node, result)\n return result\n}\n\n/**\n * @param {Text} node\n * @returns {P5Text}\n */\nfunction text(node) {\n /** @type {P5Text} */\n const result = {\n nodeName: '#text',\n value: node.value,\n // @ts-expect-error: no `parentNode`\n parentNode: undefined\n }\n patch(node, result)\n return result\n}\n\n/**\n * @param {Comment} node\n * @returns {P5Comment}\n */\nfunction comment(node) {\n /** @type {P5Comment} */\n const result = {\n nodeName: '#comment',\n data: node.value,\n // @ts-expect-error: no `parentNode`\n parentNode: undefined\n }\n\n patch(node, result)\n\n return result\n}\n\n/**\n * @param {Element} node\n * @param {Schema} schema\n * Current schema.\n * @returns {P5Element}\n * `parse5` node.\n */\nfunction element(node, schema) {\n const parentSchema = schema\n let currentSchema = parentSchema\n\n if (\n node.type === 'element' &&\n node.tagName.toLowerCase() === 'svg' &&\n parentSchema.space === 'html'\n ) {\n currentSchema = svg\n }\n\n /** @type {Array} */\n const attrs = []\n /** @type {string} */\n let prop\n\n if (node.properties) {\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(\n currentSchema,\n prop,\n node.properties[prop]\n )\n\n if (result) {\n attrs.push(result)\n }\n }\n }\n }\n\n /** @type {P5Element} */\n const result = {\n nodeName: node.tagName,\n tagName: node.tagName,\n attrs,\n // @ts-expect-error: html and svg both have a space.\n namespaceURI: webNamespaces[currentSchema.space],\n childNodes: [],\n // @ts-expect-error: no `parentNode`\n parentNode: undefined\n }\n result.childNodes = all(node.children, result, currentSchema)\n patch(node, result)\n\n if (node.tagName === 'template' && node.content) {\n // @ts-expect-error: `parse5` types are wrong.\n result.content = fragment(node.content, currentSchema)\n }\n\n return result\n}\n\n/**\n * Handle a property.\n *\n * @param {Schema} schema\n * Current schema.\n * @param {string} prop\n * Key.\n * @param {Array | string | number | boolean | null | undefined} value\n * hast property value.\n * @returns {P5Attribute | void}\n * Field for runtime, optional.\n */\nfunction createProperty(schema, prop, value) {\n const info = find(schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === undefined ||\n value === null ||\n value === false ||\n (typeof value === 'number' && Number.isNaN(value)) ||\n (!value && info.boolean)\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n /** @type {P5Attribute} */\n const attribute = {\n name: info.attribute,\n value: value === true ? '' : String(value)\n }\n\n if (info.space && info.space !== 'html' && info.space !== 'svg') {\n const index = attribute.name.indexOf(':')\n\n if (index < 0) {\n attribute.prefix = ''\n } else {\n attribute.name = attribute.name.slice(index + 1)\n attribute.prefix = info.attribute.slice(0, index)\n }\n\n attribute.namespace = webNamespaces[info.space]\n }\n\n return attribute\n}\n\n/**\n * Transform all hast nodes.\n *\n * @param {Array} children\n * List of children.\n * @param {P5Parent} parentNode\n * `parse5` parent node.\n * @param {Schema} schema\n * Current schema.\n * @returns {Array}\n * Transformed children.\n */\nfunction all(children, parentNode, schema) {\n let index = -1\n /** @type {Array} */\n const results = []\n\n if (children) {\n while (++index < children.length) {\n /** @type {P5Child} */\n // @ts-expect-error assume no document.\n const child = one(children[index], schema)\n\n child.parentNode = parentNode\n\n results.push(child)\n }\n }\n\n return results\n}\n\n/**\n * Add position info from `from` to `to`.\n *\n * @param {Node} from\n * hast node.\n * @param {P5Node} to\n * `parse5` node.\n * @returns {void}\n * Nothing.\n */\nfunction patch(from, to) {\n const position = from.position\n\n if (position && position.start && position.end) {\n to.sourceCodeLocation = {\n startLine: position.start.line,\n startCol: position.start.column,\n // @ts-expect-error assume this is set.\n startOffset: position.start.offset,\n endLine: position.end.line,\n endCol: position.end.column,\n // @ts-expect-error assume this is set.\n endOffset: position.end.offset\n }\n }\n}\n","/**\n * List of HTML void tag names.\n *\n * @type {Array}\n */\nexport const htmlVoidElements = [\n 'area',\n 'base',\n 'basefont',\n 'bgsound',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'frame',\n 'hr',\n 'image',\n 'img',\n 'input',\n 'isindex',\n 'keygen',\n 'link',\n 'menuitem',\n 'meta',\n 'nextid',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]\n","/**\n * @typedef {import('vfile').VFile} VFile\n * @typedef {import('parse5').Document} P5Document\n * @typedef {import('parse5').DocumentFragment} P5Fragment\n * @typedef {Omit} P5Element\n * @typedef {import('parse5').Attribute} P5Attribute\n * @typedef {Omit & {startOffset: number|undefined, endOffset: number|undefined}} P5Location\n * @typedef {import('parse5').ParserOptions} P5ParserOptions\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').DocType} Doctype\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').Content} Content\n * @typedef {Root|Content} Node\n * @typedef {import('../complex-types').Raw} Raw\n *\n * @typedef {Omit & {value: {stitch: Node}}} Stitch\n *\n * @typedef Options\n * @property {Array} [passThrough]\n * List of custom hast node types to pass through (keep) in hast.\n * If the passed through nodes have children, those children are expected to\n * be hast and will be handled.\n *\n * @typedef HiddenTokenizer\n * @property {Array} __mixins\n * Way too simple, but works for us.\n * @property {HiddenPreprocessor} preprocessor\n * @property {(value: string) => void} write\n * @property {() => number} _consume\n * @property {Array} tokenQueue\n * @property {string} state\n * @property {string} returnState\n * @property {number} charRefCode\n * @property {Array} tempBuff\n * @property {Function} _flushCodePointsConsumedAsCharacterReference\n * @property {string} lastStartTagName\n * @property {number} consumedAfterSnapshot\n * @property {boolean} active\n * @property {HiddenToken|undefined} currentCharacterToken\n * @property {HiddenToken|undefined} currentToken\n * @property {unknown} currentAttr\n * @property {Function} NAMED_CHARACTER_REFERENCE_STATE\n * @property {Function} NUMERIC_CHARACTER_REFERENCE_END_STATE\n *\n * @typedef {Record & {location: P5Location}} HiddenToken\n *\n * @typedef HiddenPreprocessor\n * @property {string|undefined} html\n * @property {number} pos\n * @property {number} lastGapPos\n * @property {number} lastCharPos\n * @property {Array} gapStack\n * @property {boolean} skipNextNewLine\n * @property {boolean} lastChunkWritten\n * @property {boolean} endOfChunkHit\n *\n * @typedef HiddenLocationTracker\n * @property {P5Location|undefined} currentAttrLocation\n * @property {P5Location} ctLoc\n * @property {HiddenPosTracker} posTracker\n *\n * @typedef HiddenPosTracker\n * @property {boolean} isEol\n * @property {number} lineStartPos\n * @property {number} droppedBufferSize\n * @property {number} offset\n * @property {number} col\n * @property {number} line\n */\n\n// @ts-expect-error: untyped.\nimport Parser from 'parse5/lib/parser/index.js'\nimport {pointStart, pointEnd} from 'unist-util-position'\nimport {visit} from 'unist-util-visit'\nimport {fromParse5} from 'hast-util-from-parse5'\nimport {toParse5} from 'hast-util-to-parse5'\nimport {htmlVoidElements} from 'html-void-elements'\nimport {webNamespaces} from 'web-namespaces'\nimport {zwitch} from 'zwitch'\n\nconst inTemplateMode = 'IN_TEMPLATE_MODE'\nconst dataState = 'DATA_STATE'\nconst characterToken = 'CHARACTER_TOKEN'\nconst startTagToken = 'START_TAG_TOKEN'\nconst endTagToken = 'END_TAG_TOKEN'\nconst commentToken = 'COMMENT_TOKEN'\nconst doctypeToken = 'DOCTYPE_TOKEN'\n\n/** @type {P5ParserOptions} */\nconst parseOptions = {sourceCodeLocationInfo: true, scriptingEnabled: false}\n\n/**\n * Given a hast tree and an optional vfile (for positional info), return a new\n * parsed-again hast tree.\n *\n * @param tree\n * Original hast tree.\n * @param file\n * Virtual file for positional info, optional.\n * @param options\n * Configuration.\n */\nexport const raw =\n /**\n * @type {(\n * ((tree: Node, file: VFile|undefined, options?: Options) => Node) &\n * ((tree: Node, options?: Options) => Node)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {VFile} [file]\n * @param {Options} [options]\n */\n function (tree, file, options) {\n let index = -1\n const parser = new Parser(parseOptions)\n const one = zwitch('type', {\n handlers: {root, element, text, comment, doctype, raw: handleRaw},\n // @ts-expect-error: hush.\n unknown\n })\n /** @type {boolean|undefined} */\n let stitches\n /** @type {HiddenTokenizer|undefined} */\n let tokenizer\n /** @type {HiddenPreprocessor|undefined} */\n let preprocessor\n /** @type {HiddenPosTracker|undefined} */\n let posTracker\n /** @type {HiddenLocationTracker|undefined} */\n let locationTracker\n\n if (isOptions(file)) {\n options = file\n file = undefined\n }\n\n if (options && options.passThrough) {\n while (++index < options.passThrough.length) {\n // @ts-expect-error: hush.\n one.handlers[options.passThrough[index]] = stitch\n }\n }\n\n const result = fromParse5(\n documentMode(tree) ? document() : fragment(),\n file\n )\n\n if (stitches) {\n visit(result, 'comment', (node, index, parent) => {\n const stitch = /** @type {Stitch} */ (/** @type {unknown} */ (node))\n if (stitch.value.stitch && parent !== null && index !== null) {\n // @ts-expect-error: assume the stitch is allowed.\n parent.children[index] = stitch.value.stitch\n return index\n }\n })\n }\n\n // Unpack if possible and when not given a `root`.\n if (\n tree.type !== 'root' &&\n result.type === 'root' &&\n result.children.length === 1\n ) {\n return result.children[0]\n }\n\n return result\n\n /**\n * @returns {P5Fragment}\n */\n function fragment() {\n /** @type {P5Element} */\n const context = {\n nodeName: 'template',\n tagName: 'template',\n attrs: [],\n namespaceURI: webNamespaces.html,\n childNodes: []\n }\n /** @type {P5Element} */\n const mock = {\n nodeName: 'documentmock',\n tagName: 'documentmock',\n attrs: [],\n namespaceURI: webNamespaces.html,\n childNodes: []\n }\n /** @type {P5Fragment} */\n const doc = {nodeName: '#document-fragment', childNodes: []}\n\n parser._bootstrap(mock, context)\n parser._pushTmplInsertionMode(inTemplateMode)\n parser._initTokenizerForFragmentParsing()\n parser._insertFakeRootElement()\n parser._resetInsertionMode()\n parser._findFormInFragmentContext()\n\n tokenizer = parser.tokenizer\n /* c8 ignore next */\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n preprocessor = tokenizer.preprocessor\n locationTracker = tokenizer.__mixins[0]\n posTracker = locationTracker.posTracker\n\n one(tree)\n\n resetTokenizer()\n\n parser._adoptNodes(mock.childNodes[0], doc)\n\n return doc\n }\n\n /**\n * @returns {P5Document}\n */\n function document() {\n /** @type {P5Document} */\n const doc = parser.treeAdapter.createDocument()\n\n parser._bootstrap(doc, undefined)\n tokenizer = parser.tokenizer\n /* c8 ignore next */\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n preprocessor = tokenizer.preprocessor\n locationTracker = tokenizer.__mixins[0]\n posTracker = locationTracker.posTracker\n\n one(tree)\n\n resetTokenizer()\n\n return doc\n }\n\n /**\n * @param {Array} nodes\n * @returns {void}\n */\n function all(nodes) {\n let index = -1\n\n /* istanbul ignore else - invalid nodes, see rehypejs/rehype-raw#7. */\n if (nodes) {\n while (++index < nodes.length) {\n one(nodes[index])\n }\n }\n }\n\n /**\n * @param {Root} node\n * @returns {void}\n */\n function root(node) {\n all(node.children)\n }\n\n /**\n * @param {Element} node\n * @returns {void}\n */\n function element(node) {\n resetTokenizer()\n parser._processInputToken(startTag(node))\n\n all(node.children)\n\n if (!htmlVoidElements.includes(node.tagName)) {\n resetTokenizer()\n parser._processInputToken(endTag(node))\n }\n }\n\n /**\n * @param {Text} node\n * @returns {void}\n */\n function text(node) {\n resetTokenizer()\n parser._processInputToken({\n type: characterToken,\n chars: node.value,\n location: createParse5Location(node)\n })\n }\n\n /**\n * @param {Doctype} node\n * @returns {void}\n */\n function doctype(node) {\n resetTokenizer()\n parser._processInputToken({\n type: doctypeToken,\n name: 'html',\n forceQuirks: false,\n publicId: '',\n systemId: '',\n location: createParse5Location(node)\n })\n }\n\n /**\n * @param {Comment|Stitch} node\n * @returns {void}\n */\n function comment(node) {\n resetTokenizer()\n parser._processInputToken({\n type: commentToken,\n data: node.value,\n location: createParse5Location(node)\n })\n }\n\n /**\n * @param {Raw} node\n * @returns {void}\n */\n function handleRaw(node) {\n const start = pointStart(node)\n const line = start.line || 1\n const column = start.column || 1\n const offset = start.offset || 0\n\n /* c8 ignore next 4 */\n if (!preprocessor) throw new Error('Expected `preprocessor`')\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n if (!posTracker) throw new Error('Expected `posTracker`')\n if (!locationTracker) throw new Error('Expected `locationTracker`')\n\n // Reset preprocessor:\n // See: .\n preprocessor.html = undefined\n preprocessor.pos = -1\n preprocessor.lastGapPos = -1\n preprocessor.lastCharPos = -1\n preprocessor.gapStack = []\n preprocessor.skipNextNewLine = false\n preprocessor.lastChunkWritten = false\n preprocessor.endOfChunkHit = false\n\n // Reset preprocessor mixin:\n // See: .\n posTracker.isEol = false\n posTracker.lineStartPos = -column + 1 // Looks weird, but ensures we get correct positional info.\n posTracker.droppedBufferSize = offset\n posTracker.offset = 0\n posTracker.col = 1\n posTracker.line = line\n\n // Reset location tracker:\n // See: .\n locationTracker.currentAttrLocation = undefined\n locationTracker.ctLoc = createParse5Location(node)\n\n // See the code for `parse` and `parseFragment`:\n // See: .\n tokenizer.write(node.value)\n parser._runParsingLoop(null)\n\n // Character references hang, so if we ended there, we need to flush\n // those too.\n // We reset the preprocessor as if the document ends here.\n // Then one single call to the relevant state does the trick, parse5\n // consumes the whole token.\n if (\n tokenizer.state === 'NAMED_CHARACTER_REFERENCE_STATE' ||\n tokenizer.state === 'NUMERIC_CHARACTER_REFERENCE_END_STATE'\n ) {\n preprocessor.lastChunkWritten = true\n tokenizer[tokenizer.state](tokenizer._consume())\n }\n }\n\n /**\n * @param {Node} node\n */\n function stitch(node) {\n stitches = true\n\n /** @type {Node} */\n let clone\n\n // Recurse, because to somewhat handle `[]` (where `[]` denotes the\n // passed through node).\n if ('children' in node) {\n clone = {\n ...node,\n children: raw(\n {type: 'root', children: node.children},\n file,\n options\n // @ts-expect-error Assume a given parent yields a parent.\n ).children\n }\n } else {\n clone = {...node}\n }\n\n // Hack: `value` is supposed to be a string, but as none of the tools\n // (`parse5` or `hast-util-from-parse5`) looks at it, we can pass nodes\n // through.\n comment({type: 'comment', value: {stitch: clone}})\n }\n\n function resetTokenizer() {\n /* c8 ignore next 2 */\n if (!tokenizer) throw new Error('Expected `tokenizer`')\n if (!posTracker) throw new Error('Expected `posTracker`')\n\n // Process final characters if they’re still there after hibernating.\n // Similar to:\n // See: .\n const token = tokenizer.currentCharacterToken\n\n if (token) {\n token.location.endLine = posTracker.line\n token.location.endCol = posTracker.col + 1\n token.location.endOffset = posTracker.offset + 1\n parser._processInputToken(token)\n }\n\n // Reset tokenizer:\n // See: .\n // Especially putting it back in the `data` state is useful: some elements,\n // like textareas and iframes, change the state.\n // See GH-7.\n // But also if broken HTML is in `raw`, and then a correct element is given.\n // See GH-11.\n tokenizer.tokenQueue = []\n tokenizer.state = dataState\n tokenizer.returnState = ''\n tokenizer.charRefCode = -1\n tokenizer.tempBuff = []\n tokenizer.lastStartTagName = ''\n tokenizer.consumedAfterSnapshot = -1\n tokenizer.active = false\n tokenizer.currentCharacterToken = undefined\n tokenizer.currentToken = undefined\n tokenizer.currentAttr = undefined\n }\n }\n )\n/**\n * @param {Element} node\n * @returns {HiddenToken}\n */\nfunction startTag(node) {\n /** @type {P5Location} */\n const location = Object.assign(createParse5Location(node))\n // @ts-expect-error extra positional info.\n location.startTag = Object.assign({}, location)\n\n // Untyped token.\n return {\n type: startTagToken,\n tagName: node.tagName,\n selfClosing: false,\n attrs: attributes(node),\n location\n }\n}\n\n/**\n * @param {Element} node\n * @returns {Array}\n */\nfunction attributes(node) {\n return toParse5({\n tagName: node.tagName,\n type: 'element',\n properties: node.properties,\n children: []\n // @ts-expect-error Assume element.\n }).attrs\n}\n\n/**\n * @param {Element} node\n * @returns {HiddenToken}\n */\nfunction endTag(node) {\n /** @type {P5Location} */\n const location = Object.assign(createParse5Location(node))\n // @ts-expect-error extra positional info.\n location.startTag = Object.assign({}, location)\n\n // Untyped token.\n return {\n type: endTagToken,\n tagName: node.tagName,\n attrs: [],\n location\n }\n}\n\n/**\n * @param {Node} node\n */\nfunction unknown(node) {\n throw new Error('Cannot compile `' + node.type + '` node')\n}\n\n/**\n * @param {Node} node\n * @returns {boolean}\n */\nfunction documentMode(node) {\n const head = node.type === 'root' ? node.children[0] : node\n return Boolean(\n head &&\n (head.type === 'doctype' ||\n (head.type === 'element' && head.tagName === 'html'))\n )\n}\n\n/**\n * @param {Node|Stitch} node\n * @returns {P5Location}\n */\nfunction createParse5Location(node) {\n const start = pointStart(node)\n const end = pointEnd(node)\n\n return {\n startLine: start.line,\n startCol: start.column,\n startOffset: start.offset,\n endLine: end.line,\n endCol: end.column,\n endOffset: end.offset\n }\n}\n\n/**\n * @param {VFile|Options|undefined} value\n * @return {value is Options}\n */\nfunction isOptions(value) {\n return Boolean(value && !('message' in value && 'messages' in value))\n}\n","/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast-util-raw').Options} Options\n * @typedef {import('hast-util-raw')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {raw} from 'hast-util-raw'\n\n/**\n * Plugin to parse the tree again (and raw nodes).\n * Keeping positional info OK. 🙌\n *\n * @type {import('unified').Plugin<[Options?] | Array, Root>}\n */\nexport default function rehypeRaw(options = {}) {\n return (tree, file) => {\n // Assume that when a root was given, it’s also returned.\n const result = /** @type {Root} */ (raw(tree, file, options))\n return result\n }\n}\n","// This module is generated by `script/`.\n/* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */\nexport const regex = /[\\0-\\x1F!-,\\.\\/:-@\\[-\\^`\\{-\\xA9\\xAB-\\xB4\\xB6-\\xB9\\xBB-\\xBF\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0378\\u0379\\u037E\\u0380-\\u0385\\u0387\\u038B\\u038D\\u03A2\\u03F6\\u0482\\u0530\\u0557\\u0558\\u055A-\\u055F\\u0589-\\u0590\\u05BE\\u05C0\\u05C3\\u05C6\\u05C8-\\u05CF\\u05EB-\\u05EE\\u05F3-\\u060F\\u061B-\\u061F\\u066A-\\u066D\\u06D4\\u06DD\\u06DE\\u06E9\\u06FD\\u06FE\\u0700-\\u070F\\u074B\\u074C\\u07B2-\\u07BF\\u07F6-\\u07F9\\u07FB\\u07FC\\u07FE\\u07FF\\u082E-\\u083F\\u085C-\\u085F\\u086B-\\u089F\\u08B5\\u08C8-\\u08D2\\u08E2\\u0964\\u0965\\u0970\\u0984\\u098D\\u098E\\u0991\\u0992\\u09A9\\u09B1\\u09B3-\\u09B5\\u09BA\\u09BB\\u09C5\\u09C6\\u09C9\\u09CA\\u09CF-\\u09D6\\u09D8-\\u09DB\\u09DE\\u09E4\\u09E5\\u09F2-\\u09FB\\u09FD\\u09FF\\u0A00\\u0A04\\u0A0B-\\u0A0E\\u0A11\\u0A12\\u0A29\\u0A31\\u0A34\\u0A37\\u0A3A\\u0A3B\\u0A3D\\u0A43-\\u0A46\\u0A49\\u0A4A\\u0A4E-\\u0A50\\u0A52-\\u0A58\\u0A5D\\u0A5F-\\u0A65\\u0A76-\\u0A80\\u0A84\\u0A8E\\u0A92\\u0AA9\\u0AB1\\u0AB4\\u0ABA\\u0ABB\\u0AC6\\u0ACA\\u0ACE\\u0ACF\\u0AD1-\\u0ADF\\u0AE4\\u0AE5\\u0AF0-\\u0AF8\\u0B00\\u0B04\\u0B0D\\u0B0E\\u0B11\\u0B12\\u0B29\\u0B31\\u0B34\\u0B3A\\u0B3B\\u0B45\\u0B46\\u0B49\\u0B4A\\u0B4E-\\u0B54\\u0B58-\\u0B5B\\u0B5E\\u0B64\\u0B65\\u0B70\\u0B72-\\u0B81\\u0B84\\u0B8B-\\u0B8D\\u0B91\\u0B96-\\u0B98\\u0B9B\\u0B9D\\u0BA0-\\u0BA2\\u0BA5-\\u0BA7\\u0BAB-\\u0BAD\\u0BBA-\\u0BBD\\u0BC3-\\u0BC5\\u0BC9\\u0BCE\\u0BCF\\u0BD1-\\u0BD6\\u0BD8-\\u0BE5\\u0BF0-\\u0BFF\\u0C0D\\u0C11\\u0C29\\u0C3A-\\u0C3C\\u0C45\\u0C49\\u0C4E-\\u0C54\\u0C57\\u0C5B-\\u0C5F\\u0C64\\u0C65\\u0C70-\\u0C7F\\u0C84\\u0C8D\\u0C91\\u0CA9\\u0CB4\\u0CBA\\u0CBB\\u0CC5\\u0CC9\\u0CCE-\\u0CD4\\u0CD7-\\u0CDD\\u0CDF\\u0CE4\\u0CE5\\u0CF0\\u0CF3-\\u0CFF\\u0D0D\\u0D11\\u0D45\\u0D49\\u0D4F-\\u0D53\\u0D58-\\u0D5E\\u0D64\\u0D65\\u0D70-\\u0D79\\u0D80\\u0D84\\u0D97-\\u0D99\\u0DB2\\u0DBC\\u0DBE\\u0DBF\\u0DC7-\\u0DC9\\u0DCB-\\u0DCE\\u0DD5\\u0DD7\\u0DE0-\\u0DE5\\u0DF0\\u0DF1\\u0DF4-\\u0E00\\u0E3B-\\u0E3F\\u0E4F\\u0E5A-\\u0E80\\u0E83\\u0E85\\u0E8B\\u0EA4\\u0EA6\\u0EBE\\u0EBF\\u0EC5\\u0EC7\\u0ECE\\u0ECF\\u0EDA\\u0EDB\\u0EE0-\\u0EFF\\u0F01-\\u0F17\\u0F1A-\\u0F1F\\u0F2A-\\u0F34\\u0F36\\u0F38\\u0F3A-\\u0F3D\\u0F48\\u0F6D-\\u0F70\\u0F85\\u0F98\\u0FBD-\\u0FC5\\u0FC7-\\u0FFF\\u104A-\\u104F\\u109E\\u109F\\u10C6\\u10C8-\\u10CC\\u10CE\\u10CF\\u10FB\\u1249\\u124E\\u124F\\u1257\\u1259\\u125E\\u125F\\u1289\\u128E\\u128F\\u12B1\\u12B6\\u12B7\\u12BF\\u12C1\\u12C6\\u12C7\\u12D7\\u1311\\u1316\\u1317\\u135B\\u135C\\u1360-\\u137F\\u1390-\\u139F\\u13F6\\u13F7\\u13FE-\\u1400\\u166D\\u166E\\u1680\\u169B-\\u169F\\u16EB-\\u16ED\\u16F9-\\u16FF\\u170D\\u1715-\\u171F\\u1735-\\u173F\\u1754-\\u175F\\u176D\\u1771\\u1774-\\u177F\\u17D4-\\u17D6\\u17D8-\\u17DB\\u17DE\\u17DF\\u17EA-\\u180A\\u180E\\u180F\\u181A-\\u181F\\u1879-\\u187F\\u18AB-\\u18AF\\u18F6-\\u18FF\\u191F\\u192C-\\u192F\\u193C-\\u1945\\u196E\\u196F\\u1975-\\u197F\\u19AC-\\u19AF\\u19CA-\\u19CF\\u19DA-\\u19FF\\u1A1C-\\u1A1F\\u1A5F\\u1A7D\\u1A7E\\u1A8A-\\u1A8F\\u1A9A-\\u1AA6\\u1AA8-\\u1AAF\\u1AC1-\\u1AFF\\u1B4C-\\u1B4F\\u1B5A-\\u1B6A\\u1B74-\\u1B7F\\u1BF4-\\u1BFF\\u1C38-\\u1C3F\\u1C4A-\\u1C4C\\u1C7E\\u1C7F\\u1C89-\\u1C8F\\u1CBB\\u1CBC\\u1CC0-\\u1CCF\\u1CD3\\u1CFB-\\u1CFF\\u1DFA\\u1F16\\u1F17\\u1F1E\\u1F1F\\u1F46\\u1F47\\u1F4E\\u1F4F\\u1F58\\u1F5A\\u1F5C\\u1F5E\\u1F7E\\u1F7F\\u1FB5\\u1FBD\\u1FBF-\\u1FC1\\u1FC5\\u1FCD-\\u1FCF\\u1FD4\\u1FD5\\u1FDC-\\u1FDF\\u1FED-\\u1FF1\\u1FF5\\u1FFD-\\u203E\\u2041-\\u2053\\u2055-\\u2070\\u2072-\\u207E\\u2080-\\u208F\\u209D-\\u20CF\\u20F1-\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F-\\u215F\\u2189-\\u24B5\\u24EA-\\u2BFF\\u2C2F\\u2C5F\\u2CE5-\\u2CEA\\u2CF4-\\u2CFF\\u2D26\\u2D28-\\u2D2C\\u2D2E\\u2D2F\\u2D68-\\u2D6E\\u2D70-\\u2D7E\\u2D97-\\u2D9F\\u2DA7\\u2DAF\\u2DB7\\u2DBF\\u2DC7\\u2DCF\\u2DD7\\u2DDF\\u2E00-\\u2E2E\\u2E30-\\u3004\\u3008-\\u3020\\u3030\\u3036\\u3037\\u303D-\\u3040\\u3097\\u3098\\u309B\\u309C\\u30A0\\u30FB\\u3100-\\u3104\\u3130\\u318F-\\u319F\\u31C0-\\u31EF\\u3200-\\u33FF\\u4DC0-\\u4DFF\\u9FFD-\\u9FFF\\uA48D-\\uA4CF\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA62C-\\uA63F\\uA673\\uA67E\\uA6F2-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA7C0\\uA7C1\\uA7CB-\\uA7F4\\uA828-\\uA82B\\uA82D-\\uA83F\\uA874-\\uA87F\\uA8C6-\\uA8CF\\uA8DA-\\uA8DF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA954-\\uA95F\\uA97D-\\uA97F\\uA9C1-\\uA9CE\\uA9DA-\\uA9DF\\uA9FF\\uAA37-\\uAA3F\\uAA4E\\uAA4F\\uAA5A-\\uAA5F\\uAA77-\\uAA79\\uAAC3-\\uAADA\\uAADE\\uAADF\\uAAF0\\uAAF1\\uAAF7-\\uAB00\\uAB07\\uAB08\\uAB0F\\uAB10\\uAB17-\\uAB1F\\uAB27\\uAB2F\\uAB5B\\uAB6A-\\uAB6F\\uABEB\\uABEE\\uABEF\\uABFA-\\uABFF\\uD7A4-\\uD7AF\\uD7C7-\\uD7CA\\uD7FC-\\uD7FF\\uE000-\\uF8FF\\uFA6E\\uFA6F\\uFADA-\\uFAFF\\uFB07-\\uFB12\\uFB18-\\uFB1C\\uFB29\\uFB37\\uFB3D\\uFB3F\\uFB42\\uFB45\\uFBB2-\\uFBD2\\uFD3E-\\uFD4F\\uFD90\\uFD91\\uFDC8-\\uFDEF\\uFDFC-\\uFDFF\\uFE10-\\uFE1F\\uFE30-\\uFE32\\uFE35-\\uFE4C\\uFE50-\\uFE6F\\uFE75\\uFEFD-\\uFF0F\\uFF1A-\\uFF20\\uFF3B-\\uFF3E\\uFF40\\uFF5B-\\uFF65\\uFFBF-\\uFFC1\\uFFC8\\uFFC9\\uFFD0\\uFFD1\\uFFD8\\uFFD9\\uFFDD-\\uFFFF]|\\uD800[\\uDC0C\\uDC27\\uDC3B\\uDC3E\\uDC4E\\uDC4F\\uDC5E-\\uDC7F\\uDCFB-\\uDD3F\\uDD75-\\uDDFC\\uDDFE-\\uDE7F\\uDE9D-\\uDE9F\\uDED1-\\uDEDF\\uDEE1-\\uDEFF\\uDF20-\\uDF2C\\uDF4B-\\uDF4F\\uDF7B-\\uDF7F\\uDF9E\\uDF9F\\uDFC4-\\uDFC7\\uDFD0\\uDFD6-\\uDFFF]|\\uD801[\\uDC9E\\uDC9F\\uDCAA-\\uDCAF\\uDCD4-\\uDCD7\\uDCFC-\\uDCFF\\uDD28-\\uDD2F\\uDD64-\\uDDFF\\uDF37-\\uDF3F\\uDF56-\\uDF5F\\uDF68-\\uDFFF]|\\uD802[\\uDC06\\uDC07\\uDC09\\uDC36\\uDC39-\\uDC3B\\uDC3D\\uDC3E\\uDC56-\\uDC5F\\uDC77-\\uDC7F\\uDC9F-\\uDCDF\\uDCF3\\uDCF6-\\uDCFF\\uDD16-\\uDD1F\\uDD3A-\\uDD7F\\uDDB8-\\uDDBD\\uDDC0-\\uDDFF\\uDE04\\uDE07-\\uDE0B\\uDE14\\uDE18\\uDE36\\uDE37\\uDE3B-\\uDE3E\\uDE40-\\uDE5F\\uDE7D-\\uDE7F\\uDE9D-\\uDEBF\\uDEC8\\uDEE7-\\uDEFF\\uDF36-\\uDF3F\\uDF56-\\uDF5F\\uDF73-\\uDF7F\\uDF92-\\uDFFF]|\\uD803[\\uDC49-\\uDC7F\\uDCB3-\\uDCBF\\uDCF3-\\uDCFF\\uDD28-\\uDD2F\\uDD3A-\\uDE7F\\uDEAA\\uDEAD-\\uDEAF\\uDEB2-\\uDEFF\\uDF1D-\\uDF26\\uDF28-\\uDF2F\\uDF51-\\uDFAF\\uDFC5-\\uDFDF\\uDFF7-\\uDFFF]|\\uD804[\\uDC47-\\uDC65\\uDC70-\\uDC7E\\uDCBB-\\uDCCF\\uDCE9-\\uDCEF\\uDCFA-\\uDCFF\\uDD35\\uDD40-\\uDD43\\uDD48-\\uDD4F\\uDD74\\uDD75\\uDD77-\\uDD7F\\uDDC5-\\uDDC8\\uDDCD\\uDDDB\\uDDDD-\\uDDFF\\uDE12\\uDE38-\\uDE3D\\uDE3F-\\uDE7F\\uDE87\\uDE89\\uDE8E\\uDE9E\\uDEA9-\\uDEAF\\uDEEB-\\uDEEF\\uDEFA-\\uDEFF\\uDF04\\uDF0D\\uDF0E\\uDF11\\uDF12\\uDF29\\uDF31\\uDF34\\uDF3A\\uDF45\\uDF46\\uDF49\\uDF4A\\uDF4E\\uDF4F\\uDF51-\\uDF56\\uDF58-\\uDF5C\\uDF64\\uDF65\\uDF6D-\\uDF6F\\uDF75-\\uDFFF]|\\uD805[\\uDC4B-\\uDC4F\\uDC5A-\\uDC5D\\uDC62-\\uDC7F\\uDCC6\\uDCC8-\\uDCCF\\uDCDA-\\uDD7F\\uDDB6\\uDDB7\\uDDC1-\\uDDD7\\uDDDE-\\uDDFF\\uDE41-\\uDE43\\uDE45-\\uDE4F\\uDE5A-\\uDE7F\\uDEB9-\\uDEBF\\uDECA-\\uDEFF\\uDF1B\\uDF1C\\uDF2C-\\uDF2F\\uDF3A-\\uDFFF]|\\uD806[\\uDC3B-\\uDC9F\\uDCEA-\\uDCFE\\uDD07\\uDD08\\uDD0A\\uDD0B\\uDD14\\uDD17\\uDD36\\uDD39\\uDD3A\\uDD44-\\uDD4F\\uDD5A-\\uDD9F\\uDDA8\\uDDA9\\uDDD8\\uDDD9\\uDDE2\\uDDE5-\\uDDFF\\uDE3F-\\uDE46\\uDE48-\\uDE4F\\uDE9A-\\uDE9C\\uDE9E-\\uDEBF\\uDEF9-\\uDFFF]|\\uD807[\\uDC09\\uDC37\\uDC41-\\uDC4F\\uDC5A-\\uDC71\\uDC90\\uDC91\\uDCA8\\uDCB7-\\uDCFF\\uDD07\\uDD0A\\uDD37-\\uDD39\\uDD3B\\uDD3E\\uDD48-\\uDD4F\\uDD5A-\\uDD5F\\uDD66\\uDD69\\uDD8F\\uDD92\\uDD99-\\uDD9F\\uDDAA-\\uDEDF\\uDEF7-\\uDFAF\\uDFB1-\\uDFFF]|\\uD808[\\uDF9A-\\uDFFF]|\\uD809[\\uDC6F-\\uDC7F\\uDD44-\\uDFFF]|[\\uD80A\\uD80B\\uD80E-\\uD810\\uD812-\\uD819\\uD824-\\uD82B\\uD82D\\uD82E\\uD830-\\uD833\\uD837\\uD839\\uD83D\\uD83F\\uD87B-\\uD87D\\uD87F\\uD885-\\uDB3F\\uDB41-\\uDBFF][\\uDC00-\\uDFFF]|\\uD80D[\\uDC2F-\\uDFFF]|\\uD811[\\uDE47-\\uDFFF]|\\uD81A[\\uDE39-\\uDE3F\\uDE5F\\uDE6A-\\uDECF\\uDEEE\\uDEEF\\uDEF5-\\uDEFF\\uDF37-\\uDF3F\\uDF44-\\uDF4F\\uDF5A-\\uDF62\\uDF78-\\uDF7C\\uDF90-\\uDFFF]|\\uD81B[\\uDC00-\\uDE3F\\uDE80-\\uDEFF\\uDF4B-\\uDF4E\\uDF88-\\uDF8E\\uDFA0-\\uDFDF\\uDFE2\\uDFE5-\\uDFEF\\uDFF2-\\uDFFF]|\\uD821[\\uDFF8-\\uDFFF]|\\uD823[\\uDCD6-\\uDCFF\\uDD09-\\uDFFF]|\\uD82C[\\uDD1F-\\uDD4F\\uDD53-\\uDD63\\uDD68-\\uDD6F\\uDEFC-\\uDFFF]|\\uD82F[\\uDC6B-\\uDC6F\\uDC7D-\\uDC7F\\uDC89-\\uDC8F\\uDC9A-\\uDC9C\\uDC9F-\\uDFFF]|\\uD834[\\uDC00-\\uDD64\\uDD6A-\\uDD6C\\uDD73-\\uDD7A\\uDD83\\uDD84\\uDD8C-\\uDDA9\\uDDAE-\\uDE41\\uDE45-\\uDFFF]|\\uD835[\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDEC1\\uDEDB\\uDEFB\\uDF15\\uDF35\\uDF4F\\uDF6F\\uDF89\\uDFA9\\uDFC3\\uDFCC\\uDFCD]|\\uD836[\\uDC00-\\uDDFF\\uDE37-\\uDE3A\\uDE6D-\\uDE74\\uDE76-\\uDE83\\uDE85-\\uDE9A\\uDEA0\\uDEB0-\\uDFFF]|\\uD838[\\uDC07\\uDC19\\uDC1A\\uDC22\\uDC25\\uDC2B-\\uDCFF\\uDD2D-\\uDD2F\\uDD3E\\uDD3F\\uDD4A-\\uDD4D\\uDD4F-\\uDEBF\\uDEFA-\\uDFFF]|\\uD83A[\\uDCC5-\\uDCCF\\uDCD7-\\uDCFF\\uDD4C-\\uDD4F\\uDD5A-\\uDFFF]|\\uD83B[\\uDC00-\\uDDFF\\uDE04\\uDE20\\uDE23\\uDE25\\uDE26\\uDE28\\uDE33\\uDE38\\uDE3A\\uDE3C-\\uDE41\\uDE43-\\uDE46\\uDE48\\uDE4A\\uDE4C\\uDE50\\uDE53\\uDE55\\uDE56\\uDE58\\uDE5A\\uDE5C\\uDE5E\\uDE60\\uDE63\\uDE65\\uDE66\\uDE6B\\uDE73\\uDE78\\uDE7D\\uDE7F\\uDE8A\\uDE9C-\\uDEA0\\uDEA4\\uDEAA\\uDEBC-\\uDFFF]|\\uD83C[\\uDC00-\\uDD2F\\uDD4A-\\uDD4F\\uDD6A-\\uDD6F\\uDD8A-\\uDFFF]|\\uD83E[\\uDC00-\\uDFEF\\uDFFA-\\uDFFF]|\\uD869[\\uDEDE-\\uDEFF]|\\uD86D[\\uDF35-\\uDF3F]|\\uD86E[\\uDC1E\\uDC1F]|\\uD873[\\uDEA2-\\uDEAF]|\\uD87A[\\uDFE1-\\uDFFF]|\\uD87E[\\uDE1E-\\uDFFF]|\\uD884[\\uDF4B-\\uDFFF]|\\uDB40[\\uDC00-\\uDCFF\\uDDF0-\\uDFFF]/g\n","import { regex } from './regex.js'\n\nconst own = Object.hasOwnProperty\n\n/**\n * Slugger.\n */\nexport default class BananaSlug {\n /**\n * Create a new slug class.\n */\n constructor () {\n /** @type {Record} */\n // eslint-disable-next-line no-unused-expressions\n this.occurrences\n\n this.reset()\n }\n\n /**\n * Generate a unique slug.\n *\n * Tracks previously generated slugs: repeated calls with the same value\n * will result in different slugs.\n * Use the `slug` function to get same slugs.\n *\n * @param {string} value\n * String of text to slugify\n * @param {boolean} [maintainCase=false]\n * Keep the current case, otherwise make all lowercase\n * @return {string}\n * A unique slug string\n */\n slug (value, maintainCase) {\n const self = this\n let result = slug(value, maintainCase === true)\n const originalSlug = result\n\n while (own.call(self.occurrences, result)) {\n self.occurrences[originalSlug]++\n result = originalSlug + '-' + self.occurrences[originalSlug]\n }\n\n self.occurrences[result] = 0\n\n return result\n }\n\n /**\n * Reset - Forget all previous slugs\n *\n * @return void\n */\n reset () {\n this.occurrences = Object.create(null)\n }\n}\n\n/**\n * Generate a slug.\n *\n * Does not track previously generated slugs: repeated calls with the same value\n * will result in the exact same slug.\n * Use the `GithubSlugger` class to get unique slugs.\n *\n * @param {string} value\n * String of text to slugify\n * @param {boolean} [maintainCase=false]\n * Keep the current case, otherwise make all lowercase\n * @return {string}\n * A unique slug string\n */\nexport function slug (value, maintainCase) {\n if (typeof value !== 'string') return ''\n if (!maintainCase) value = value.toLowerCase()\n return value.replace(regex, '').replace(/ /g, '-')\n}\n","/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Content} Content\n */\n\n/**\n * @typedef {Root | Content} Node\n */\n\nconst own = {}.hasOwnProperty\n\n/**\n * Check if `node`is an element and has a `field` property.\n *\n * @param {unknown} node\n * Thing to check (typically `Element`).\n * @param {unknown} field\n * Field name to check (typically `string`).\n * @returns {boolean}\n * Whether `node` is an element that has a `field` property.\n */\nexport function hasProperty(node, field) {\n const value =\n typeof field === 'string' &&\n isNode(node) &&\n node.type === 'element' &&\n node.properties &&\n own.call(node.properties, field) &&\n node.properties[field]\n\n return value !== null && value !== undefined && value !== false\n}\n\n/**\n * @param {unknown} value\n * @returns {value is Node}\n */\nfunction isNode(value) {\n return Boolean(value && typeof value === 'object' && 'type' in value)\n}\n","/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Content} Content\n */\n\n/**\n * @typedef {Root | Content} Node\n */\n\n// To do next major: return `undefined`.\n/**\n * Get the rank (`1` to `6`) of headings (`h1` to `h6`).\n *\n * @param {Node} node\n * Node to check.\n * @returns {number | null}\n * Rank of the heading or `null` if not a heading.\n */\nexport function headingRank(node) {\n const name =\n (node && node.type === 'element' && node.tagName.toLowerCase()) || ''\n const code =\n name.length === 2 && name.charCodeAt(0) === 104 /* `h` */\n ? name.charCodeAt(1)\n : 0\n return code > 48 /* `0` */ && code < 55 /* `7` */ ? code - 48 /* `0` */ : null\n}\n","/**\n * @fileoverview\n * Get the plain-text value of a hast node.\n * @longdescription\n * ## Use\n *\n * ```js\n * import {h} from 'hastscript'\n * import {toString} from 'hast-util-to-string'\n *\n * toString(h('p', 'Alpha'))\n * //=> 'Alpha'\n * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))\n * //=> 'Bold and italic.'\n * ```\n *\n * ## API\n *\n * ### `toString(node)`\n *\n * Transform a node to a string.\n */\n\n/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Element} Element\n * @typedef {Root|Root['children'][number]} Node\n */\n\n/**\n * Get the plain-text value of a hast node.\n *\n * @param {Node} node\n * @returns {string}\n */\nexport function toString(node) {\n // “The concatenation of data of all the Text node descendants of the context\n // object, in tree order.”\n if ('children' in node) {\n return all(node)\n }\n\n // “Context object’s data.”\n return 'value' in node ? node.value : ''\n}\n\n/**\n * @param {Node} node\n * @returns {string}\n */\nfunction one(node) {\n if (node.type === 'text') {\n return node.value\n }\n\n return 'children' in node ? all(node) : ''\n}\n\n/**\n * @param {Root|Element} node\n * @returns {string}\n */\nfunction all(node) {\n let index = -1\n /** @type {string[]} */\n const result = []\n\n while (++index < node.children.length) {\n result[index] = one(node.children[index])\n }\n\n return result.join('')\n}\n","/**\n * @typedef {import('hast').Root} Root\n */\n\n/**\n * @typedef Options\n * Configuration (optional).\n * @property {string} [prefix='']\n * Prefix to add in front of `id`s.\n */\n\nimport Slugger from 'github-slugger'\nimport {hasProperty} from 'hast-util-has-property'\nimport {headingRank} from 'hast-util-heading-rank'\nimport {toString} from 'hast-util-to-string'\nimport {visit} from 'unist-util-visit'\n\nconst slugs = new Slugger()\n\n/**\n * Plugin to add `id`s to headings.\n *\n * @type {import('unified').Plugin<[Options?]|Array, Root>}\n */\nexport default function rehypeSlug(options = {}) {\n const prefix = options.prefix || ''\n\n return (tree) => {\n slugs.reset()\n\n visit(tree, 'element', (node) => {\n if (headingRank(node) && node.properties && !hasProperty(node, 'id')) {\n node.properties.id = prefix + slugs.slug(toString(node))\n }\n })\n }\n}\n","/**\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('hast').Element} Element\n */\n\n/**\n * @typedef {null | undefined | string | TestFunctionAnything | Array} Test\n * Check for an arbitrary element, unaware of TypeScript inferral.\n *\n * @callback TestFunctionAnything\n * Check if an element passes a test, unaware of TypeScript inferral.\n * @param {Element} element\n * An element.\n * @param {number | null | undefined} [index]\n * The element’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The element’s parent.\n * @returns {boolean | void}\n * Whether this element passes the test.\n */\n\n/**\n * @template {Element} T\n * Element type.\n * @typedef {T['tagName'] | TestFunctionPredicate | Array>} PredicateTest\n * Check for an element that can be inferred by TypeScript.\n */\n\n/**\n * Check if an element passes a certain node test.\n *\n * @template {Element} T\n * Element type.\n * @callback TestFunctionPredicate\n * Complex test function for an element that can be inferred by TypeScript.\n * @param {Element} element\n * An element.\n * @param {number | null | undefined} [index]\n * The element’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The element’s parent.\n * @returns {element is T}\n * Whether this element passes the test.\n */\n\n/**\n * @callback AssertAnything\n * Check that an arbitrary value is an element, unaware of TypeScript inferral.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean}\n * Whether this is an element and passes a test.\n */\n\n/**\n * Check if a node is an element and passes a certain node test\n *\n * @template {Element} T\n * Element type.\n * @callback AssertPredicate\n * Check that an arbitrary value is a specific element, aware of TypeScript.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {node is T}\n * Whether this is an element and passes a test.\n */\n\n/**\n * Check if `node` is an `Element` and whether it passes the given test.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @param test\n * A check for a specific element.\n * @param index\n * The node’s position in its parent.\n * @param parent\n * The node’s parent.\n * @returns\n * Whether `node` is an element and passes a test.\n */\nexport const isElement =\n /**\n * @type {(\n * (() => false) &\n * ((node: unknown, test?: PredicateTest, index?: number, parent?: Parent, context?: unknown) => node is T) &\n * ((node: unknown, test: Test, index?: number, parent?: Parent, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [node]\n * @param {Test | undefined} [test]\n * @param {number | null | undefined} [index]\n * @param {Parent | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function (node, test, index, parent, context) {\n const check = convertElement(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index for child node')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!parent.type || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n // @ts-expect-error Looks like a node.\n if (!node || !node.type || typeof node.type !== 'string') {\n return false\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n return check.call(context, node, index, parent)\n }\n )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param test\n * * When nullish, checks if `node` is an `Element`.\n * * When `string`, works like passing `(element) => element.tagName === test`.\n * * When `function` checks if function passed the element is true.\n * * When `array`, checks any one of the subtests pass.\n * @returns\n * An assertion.\n */\nexport const convertElement =\n /**\n * @type {(\n * ((test: T['tagName'] | TestFunctionPredicate) => AssertPredicate) &\n * ((test?: Test) => AssertAnything)\n * )}\n */\n (\n /**\n * @param {Test | null | undefined} [test]\n * @returns {AssertAnything}\n */\n function (test) {\n if (test === undefined || test === null) {\n return element\n }\n\n if (typeof test === 'string') {\n return tagNameFactory(test)\n }\n\n if (typeof test === 'object') {\n return anyFactory(test)\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n throw new Error('Expected function, string, or array as test')\n }\n )\n\n/**\n * Handle multiple tests.\n *\n * @param {Array} tests\n * @returns {AssertAnything}\n */\nfunction anyFactory(tests) {\n /** @type {Array} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convertElement(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @param {Array} parameters\n * @returns {boolean}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].call(this, ...parameters)) {\n return true\n }\n }\n\n return false\n }\n}\n\n/**\n * Turn a string into a test for an element with a certain tag name.\n *\n * @param {string} check\n * @returns {AssertAnything}\n */\nfunction tagNameFactory(check) {\n return tagName\n\n /**\n * @param {unknown} node\n * @returns {boolean}\n */\n function tagName(node) {\n return element(node) && node.tagName === check\n }\n}\n\n/**\n * Turn a custom test into a test for an element that passes that test.\n *\n * @param {TestFunctionAnything} check\n * @returns {AssertAnything}\n */\nfunction castFactory(check) {\n return assertion\n\n /**\n * @this {unknown}\n * @param {unknown} node\n * @param {Array} parameters\n * @returns {boolean}\n */\n function assertion(node, ...parameters) {\n // @ts-expect-error: fine.\n return element(node) && Boolean(check.call(this, node, ...parameters))\n }\n}\n\n/**\n * Make sure something is an element.\n *\n * @param {unknown} node\n * @returns {node is Element}\n */\nfunction element(node) {\n return Boolean(\n node &&\n typeof node === 'object' &&\n // @ts-expect-error Looks like a node.\n node.type === 'element' &&\n // @ts-expect-error Looks like an element.\n typeof node.tagName === 'string'\n )\n}\n","/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Parent} Parent\n * @typedef {import('hast').Element} Element\n * @typedef {Element['children'][number]} ElementChild\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast-util-is-element').Test} Test\n *\n * @typedef {'prepend'|'append'|'wrap'|'before'|'after'} Behavior\n *\n * @callback Build\n * @param {Element} node\n * @returns {ElementChild|ElementChild[]}\n *\n * @typedef Options\n * Configuration.\n * @property {Behavior} [behavior='prepend']\n * How to create links.\n * @property {Behavior} [behaviour]\n * Please use `behavior` instead\n * @property {Properties} [properties]\n * Extra properties to set on the link when injecting.\n * Defaults to `{ariaHidden: true, tabIndex: -1}` when `'prepend'` or\n * `'append'`.\n * @property {ElementChild|ElementChild[]|Build} [content={type: 'element', tagName: 'span', properties: {className: ['icon', 'icon-link']}, children: []}]\n * hast nodes to insert in the link.\n * @property {ElementChild|ElementChild[]|Build} [group]\n * hast node to wrap the heading and link with, if `behavior` is `'before'` or\n * `'after'`.\n * There is no default.\n * @property {Test} [test]\n * Test to define which heading elements are linked.\n * Any test that can be given to `hast-util-is-element` is supported.\n * The default (no test) is to link all headings.\n * Can be used to link only h1-h3, or for example all except h1.\n */\n\nimport extend from 'extend'\nimport {hasProperty} from 'hast-util-has-property'\nimport {headingRank} from 'hast-util-heading-rank'\nimport {convertElement} from 'hast-util-is-element'\nimport {visit, SKIP} from 'unist-util-visit'\n\n/** @type {Element} */\nconst contentDefaults = {\n type: 'element',\n tagName: 'span',\n properties: {className: ['icon', 'icon-link']},\n children: []\n}\n\n/**\n * Plugin to automatically add links to headings (h1-h6).\n *\n * @type {import('unified').Plugin<[Options?]|void[], Root>}\n */\nexport default function rehypeAutolinkHeadings(options = {}) {\n let props = options.properties\n const behavior = options.behaviour || options.behavior || 'prepend'\n const content = options.content || contentDefaults\n const group = options.group\n const is = convertElement(options.test)\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n let method\n\n if (behavior === 'wrap') {\n method = wrap\n } else if (behavior === 'before' || behavior === 'after') {\n method = around\n } else {\n if (!props) {\n props = {ariaHidden: 'true', tabIndex: -1}\n }\n\n method = inject\n }\n\n return (tree) => {\n visit(tree, 'element', (node, index, parent) => {\n if (\n headingRank(node) &&\n hasProperty(node, 'id') &&\n is(node, index, parent)\n ) {\n return method(node, index, parent)\n }\n })\n }\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n function inject(node) {\n node.children[behavior === 'prepend' ? 'unshift' : 'push'](\n create(node, extend(true, {}, props), toChildren(content, node))\n )\n\n return [SKIP]\n }\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n function around(node, index, parent) {\n // Uncommon.\n /* c8 ignore next */\n if (typeof index !== 'number' || !parent) return\n\n const link = create(\n node,\n extend(true, {}, props),\n toChildren(content, node)\n )\n let nodes = behavior === 'before' ? [link, node] : [node, link]\n\n if (group) {\n const grouping = toNode(group, node)\n\n if (grouping && !Array.isArray(grouping) && grouping.type === 'element') {\n grouping.children = nodes\n nodes = [grouping]\n }\n }\n\n parent.children.splice(index, 1, ...nodes)\n\n return [SKIP, index + nodes.length]\n }\n\n /** @type {import('unist-util-visit/complex-types').Visitor} */\n function wrap(node) {\n node.children = [create(node, extend(true, {}, props), node.children)]\n return [SKIP]\n }\n\n /**\n * @param {ElementChild|ElementChild[]|Build} value\n * @param {Element} node\n * @returns {ElementChild[]}\n */\n function toChildren(value, node) {\n const result = toNode(value, node)\n return Array.isArray(result) ? result : [result]\n }\n\n /**\n * @param {ElementChild|ElementChild[]|Build} value\n * @param {Element} node\n * @returns {ElementChild|ElementChild[]}\n */\n function toNode(value, node) {\n if (typeof value === 'function') return value(node)\n return extend(true, Array.isArray(value) ? [] : {}, value)\n }\n\n /**\n * @param {Element} node\n * @param {Properties} props\n * @param {ElementChild[]} children\n * @returns {Element}\n */\n function create(node, props, children) {\n return {\n type: 'element',\n tagName: 'a',\n properties: Object.assign({}, props, {\n // Fix hast types and make them required.\n /* c8 ignore next */\n href: '#' + (node.properties || {}).id\n }),\n children\n }\n }\n}\n","import { Element, Comment, Literal, ElementContent, RootContent, Properties } from 'hast';\nimport { RehypeAttrsOptions } from './';\n\nexport const getURLParameters = (url: string = '') =>\n ((url.match(/([^?=&]+)(=([^&]*))/g) || []) as string[]).reduce(\n (a: Record, v: string) => (\n (a[v.slice(0, v.indexOf('=')) as keyof typeof a] = v.slice(v.indexOf('=') + 1)), a\n ),\n {}\n )\n\nexport const prevChild = (data: Literal[] = [], index: number): Comment | undefined => {\n let i = index;\n while (i > -1) {\n i--;\n if (!data[i]) return\n if ((data[i] && data[i].value && (data[i].value as string).replace(/(\\n|\\s)/g, '') !== '') || data[i].type !== 'text') {\n if (!/^rehype:/.test(data[i].value as string) || (data[i].type as string) !== 'comment') return;\n return data[i] as unknown as Comment;\n }\n }\n return;\n}\n\nexport const nextChild = (data: RootContent[] | ElementContent[] = [], index: number, tagName?: string, codeBlockParames?: boolean): ElementContent | undefined => {\n let i = index;\n while (i < data.length) {\n i++;\n if (tagName) {\n const element = data[i] as Literal & Element;\n if (element && element.value && (element.value as string).replace(/(\\n|\\s)/g, '') !== '' || data[i] && (data[i].type as string) === 'element') {\n return element.tagName === tagName ? element : undefined\n }\n } else {\n const element = data[i] as ElementContent & Literal;\n if (!element || element.type === 'element') return;\n if (element.type === 'text' && element.value.replace(/(\\n|\\s)/g, '') !== '') return;\n if (element.type && /^(comment|raw)$/ig.test(element.type)) {\n if (element.value && !/^rehype:/.test(element.value.replace(/^(\\s+)?/, '$2') || '')) {\n return\n };\n if (codeBlockParames) {\n const nextNode = nextChild(data, i, 'pre', codeBlockParames)\n if (nextNode) return;\n element.value = (element.value || '').replace(/^(\\n|\\s)+/, '')\n return element;\n } else {\n element.value = (element.value || '').replace(/^(\\n|\\s)+/, '')\n return element;\n }\n }\n }\n }\n return\n}\n\n/**\n * 获取代码注视的位置\n * @param data 数据\n * @param index 当前数据所在的位置\n * @returns 返回 当前参数数据 Object,`{}`\n */\nexport const getCommentObject = ({ value = '' }: Comment): Properties => {\n const param = getURLParameters(value.replace(/^/, '$1').replace(/^rehype:/, ''));\n Object.keys(param).forEach((keyName: string) => {\n if (param[keyName] === 'true') {\n param[keyName] = true;\n }\n if (param[keyName] === 'false') {\n param[keyName] = false;\n }\n if (typeof param[keyName] === 'string' && !/^0/.test(param[keyName] as string) && !isNaN(+param[keyName])) {\n param[keyName] = +param[keyName];\n }\n })\n return param;\n}\n\nexport type DataConfig = {\n 'data-config': Properties\n}\n\nexport const propertiesHandle = (defaultAttrs?: Properties | null, attrs?: Properties, type?: RehypeAttrsOptions['properties']): Properties | DataConfig => {\n if (type === 'string') {\n return { ...defaultAttrs, 'data-config': JSON.stringify({ ...attrs, rehyp: true })}\n } else if (type === 'attr') {\n return { ...defaultAttrs, ...attrs}\n }\n return { ...defaultAttrs, 'data-config': { ...attrs, rehyp: true }}\n}","import { Plugin } from 'unified';\nimport { Root, Element, Comment, Properties, Literal } from 'hast';\nimport { visit } from 'unist-util-visit';\nimport { propertiesHandle, nextChild, prevChild, getCommentObject } from './utils';\n\nexport type RehypeAttrsOptions = {\n /**\n * ## `data`\n * \n * ```markdown\n * text\n * \n * ```\n * 👇👇👇👇👇\n * ```html\n *

text

\n * ```\n * \n * ## `string`\n * \n * ```markdown\n * text\n * \n * ```\n * \n * 👇👇👇👇👇\n * \n * ```html\n *

text

\n * ```\n * \n * ## attr\n * \n * ```markdown\n * text\n * \n * ```\n * 👇👇👇👇👇\n * ```html\n *

text

\n * ```\n * @default `data`\n */\n properties?: 'data' | 'string' | 'attr';\n /**\n * Code block passing parameters\n */\n codeBlockParames?: boolean;\n}\n\nconst rehypeAttrs: Plugin<[RehypeAttrsOptions?], Root> = (options = {}) => {\n const { properties = 'data', codeBlockParames = true } = options;\n return (tree) => {\n visit(tree, 'element', (node, index, parent) => {\n if (codeBlockParames && node.tagName === 'pre' && node && Array.isArray(node.children) && parent && Array.isArray(parent.children) && parent.children.length > 1) {\n const firstChild = node.children[0] as Element;\n if (firstChild && firstChild.tagName === 'code' && typeof index === 'number') {\n const child = prevChild(parent.children as Literal[], index);\n if (child) {\n const attr = getCommentObject(child);\n if (Object.keys(attr).length > 0) {\n node.properties = { ...node.properties, ...{ 'data-type': 'rehyp' } }\n firstChild.properties = propertiesHandle(firstChild.properties, attr, properties) as Properties\n }\n }\n }\n }\n\n if (/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(node.tagName) && parent && Array.isArray(parent.children) && typeof index === 'number') {\n const child = nextChild(parent.children, index, '', codeBlockParames)\n if (child) {\n const attr = getCommentObject(child as Comment)\n if (Object.keys(attr).length > 0) {\n node.properties = propertiesHandle(node.properties, attr, properties) as Properties\n }\n }\n }\n });\n }\n}\n\n\nexport default rehypeAttrs\n","import type { Plugin } from 'unified';\nimport type { Root, RootContent, Literal } from 'hast';\nimport { visit } from 'unist-util-visit';\n\n/**\n * Raw string of HTML embedded into HTML AST.\n */\nexport interface Raw extends Literal {\n /**\n * Node type.\n */\n type: 'raw'\n}\n\n// Register nodes in content.\ndeclare module 'hast' {\n interface RootContentMap {\n /**\n * Raw string of HTML embedded into HTML AST.\n */\n raw: Raw\n }\n interface ElementContentMap {\n /**\n * Raw string of HTML embedded into HTML AST.\n */\n raw: Raw\n }\n}\n\n\nexport type RehypeIgnoreOptions = {\n /**\n * Character to use for opening delimiter, by default `rehype:ignore:start`\n */\n openDelimiter?: string;\n /**\n * Character to use for closing delimiter, by default `rehype:ignore:end`\n */\n closeDelimiter?: string;\n}\n\nconst rehypeIgnore: Plugin<[RehypeIgnoreOptions?], Root> = (options = {}) => {\n const { openDelimiter = 'rehype:ignore:start', closeDelimiter = 'rehype:ignore:end' } = options;\n return (tree) => {\n visit(tree, (node: Root | RootContent, index, parent) => {\n if (node.type === 'element' || node.type === 'root') {\n // const start = node.children.findIndex((item) => item.type === 'comment' && item.value === openDelimiter);\n // const end = node.children.findIndex((item) => item.type === 'comment' && item.value === closeDelimiter);\n // if (start > -1 && end > -1) {\n // node.children = node.children.filter((_, idx) => idx < start || idx > end);\n // }\n let start = false;\n node.children = node.children.filter((item) => {\n if (item.type === 'raw' || item.type === 'comment') {\n let str = (item.value || '').trim();\n str = str.replace(/^/, '$1')\n if (str === openDelimiter) {\n start = true;\n return false;\n }\n if (str === closeDelimiter) {\n start = false;\n return false;\n }\n }\n \n return !start;\n })\n }\n });\n }\n}\n\nexport default rehypeIgnore;\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [cascade=true]\n * Whether to drop parent nodes if they had children, but all their children\n * were filtered out.\n */\n\nimport {convert} from 'unist-util-is'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Create a new `tree` of copies of all nodes that pass `test`.\n *\n * The tree is walked in *preorder* (NLR), visiting the node itself, then its\n * head, etc.\n *\n * @param tree\n * Tree to filter.\n * @param options\n * Configuration (optional).\n * @param test\n * `unist-util-is` compatible test.\n * @returns\n * New filtered tree.\n *\n * `null` is returned if `tree` itself didn’t pass the test, or is cascaded\n * away.\n */\nexport const filter =\n /**\n * @type {(\n * ((node: Tree, options: Options | null | undefined, test: Check | null | undefined) => import('./complex-types.js').Matches) &\n * ((node: Tree, test: Check) => import('./complex-types.js').Matches) &\n * ((node: Tree, options?: Options | null | undefined) => Tree)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Options | Test | null | undefined} [options]\n * @param {Test | null | undefined} [test]\n * @returns {Node | null}\n */\n function (tree, options, test) {\n const is = convert(test || options)\n /** @type {boolean | null | undefined} */\n const cascadeRaw =\n options && typeof options === 'object' && 'cascade' in options\n ? /** @type {boolean | null | undefined} */ (options.cascade)\n : undefined\n const cascade =\n cascadeRaw === undefined || cascadeRaw === null ? true : cascadeRaw\n\n return preorder(tree)\n\n /**\n * @param {Node} node\n * Current node.\n * @param {number | undefined} [index]\n * Index of `node` in `parent`.\n * @param {Parent | undefined} [parent]\n * Parent node.\n * @returns {Node | null}\n * Shallow copy of `node`.\n */\n function preorder(node, index, parent) {\n /** @type {Array} */\n const children = []\n\n if (!is(node, index, parent)) return null\n\n // @ts-expect-error: Looks like a parent.\n if (node.children) {\n let childIndex = -1\n\n // @ts-expect-error Looks like a parent.\n while (++childIndex < node.children.length) {\n // @ts-expect-error Looks like a parent.\n const result = preorder(node.children[childIndex], childIndex, node)\n\n if (result) {\n children.push(result)\n }\n }\n\n // @ts-expect-error Looks like a parent.\n if (cascade && node.children.length > 0 && children.length === 0)\n return null\n }\n\n // Create a shallow clone, using the new children.\n /** @type {typeof node} */\n // @ts-expect-error all the fields will be copied over.\n const next = {}\n /** @type {string} */\n let key\n\n for (key in node) {\n if (own.call(node, key)) {\n // @ts-expect-error: Looks like a record.\n next[key] = key === 'children' ? children : node[key]\n }\n }\n\n return next\n }\n }\n )\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Root} Root\n * @typedef Options options\n * Configuration.\n * @property {boolean} [showLineNumbers]\n * Set `showLineNumbers` to `true` to always display line number\n * @property {boolean} [ignoreMissing]\n * Set `ignoreMissing` to `true` to ignore unsupported languages and line highlighting when no language is specified\n * @property {string} [defaultLanguage]\n * Uses the specified language as the default if none is specified. Takes precedence over `ignoreMissing`.\n * Note: The language must be registered with refractor.\n */\n\nimport { visit } from 'unist-util-visit'\nimport { toString } from 'hast-util-to-string'\nimport { filter } from 'unist-util-filter'\nimport rangeParser from 'parse-numeric-range'\n\nconst getLanguage = (node) => {\n const className = node.properties.className\n //@ts-ignore\n for (const classListItem of className) {\n if (classListItem.slice(0, 9) === 'language-') {\n return classListItem.slice(9).toLowerCase()\n }\n }\n return null\n}\n\n/**\n * @param {import('refractor/lib/core').Refractor} refractor\n * @param {string} defaultLanguage\n * @return {void}\n */\nconst checkIfLanguageIsRegistered = (refractor, defaultLanguage) => {\n if (defaultLanguage && !refractor.registered(defaultLanguage)) {\n throw new Error(`The default language \"${defaultLanguage}\" is not registered with refractor.`)\n }\n}\n\n/**\n * Create a closure that determines if we have to highlight the given index\n *\n * @param {string} meta\n * @return { (index:number) => boolean }\n */\nconst calculateLinesToHighlight = (meta) => {\n const RE = /{([\\d,-]+)}/\n // Remove space between {} e.g. {1, 3}\n const parsedMeta = meta\n .split(',')\n .map((str) => str.trim())\n .join()\n if (RE.test(parsedMeta)) {\n const strlineNumbers = RE.exec(parsedMeta)[1]\n const lineNumbers = rangeParser(strlineNumbers)\n return (index) => lineNumbers.includes(index + 1)\n } else {\n return () => false\n }\n}\n\n/**\n * Check if we want to start the line numbering from a given number or 1\n * showLineNumbers=5, will start the numbering from 5\n * @param {string} meta\n * @returns {number}\n */\nconst calculateStartingLine = (meta) => {\n const RE = /showLineNumbers=(?\\d+)/i\n // pick the line number after = using a named capturing group\n if (RE.test(meta)) {\n const {\n groups: { lines },\n } = RE.exec(meta)\n return Number(lines)\n }\n return 1\n}\n\n/**\n * Create container AST for node lines\n *\n * @param {number} number\n * @return {Element[]}\n */\nconst createLineNodes = (number) => {\n const a = new Array(number)\n for (let i = 0; i < number; i++) {\n a[i] = {\n type: 'element',\n tagName: 'span',\n properties: { className: [] },\n children: [],\n }\n }\n return a\n}\n\n/**\n * Split multiline text nodes into individual nodes with positioning\n * Add a node start and end line position information for each text node\n *\n * @return { (ast:Element['children']) => Element['children'] }\n *\n */\nconst addNodePositionClosure = () => {\n let startLineNum = 1\n /**\n * @param {Element['children']} ast\n * @return {Element['children']}\n */\n const addNodePosition = (ast) => {\n return ast.reduce((result, node) => {\n if (node.type === 'text') {\n const value = /** @type {string} */ (node.value)\n const numLines = (value.match(/\\n/g) || '').length\n if (numLines === 0) {\n node.position = {\n // column: 1 is needed to avoid error with @next/mdx\n // https://github.com/timlrx/rehype-prism-plus/issues/44\n start: { line: startLineNum, column: 1 },\n end: { line: startLineNum, column: 1 },\n }\n result.push(node)\n } else {\n const lines = value.split('\\n')\n for (const [i, line] of lines.entries()) {\n result.push({\n type: 'text',\n value: i === lines.length - 1 ? line : line + '\\n',\n position: {\n start: { line: startLineNum + i, column: 1 },\n end: { line: startLineNum + i, column: 1 },\n },\n })\n }\n }\n startLineNum = startLineNum + numLines\n\n return result\n }\n\n if (Object.prototype.hasOwnProperty.call(node, 'children')) {\n const initialLineNum = startLineNum\n // @ts-ignore\n node.children = addNodePosition(node.children, startLineNum)\n result.push(node)\n node.position = {\n start: { line: initialLineNum, column: 1 },\n end: { line: startLineNum, column: 1 },\n }\n return result\n }\n\n result.push(node)\n return result\n }, [])\n }\n return addNodePosition\n}\n\n/**\n * Rehype prism plugin generator that highlights code blocks with refractor (prismjs)\n *\n * Pass in your own refractor object with the required languages registered:\n * https://github.com/wooorm/refractor#refractorregistersyntax\n *\n * @param {import('refractor/lib/core').Refractor} refractor\n * @return {import('unified').Plugin<[Options?], Root>}\n */\nconst rehypePrismGenerator = (refractor) => {\n return (options = {}) => {\n checkIfLanguageIsRegistered(refractor, options.defaultLanguage)\n return (tree) => {\n visit(tree, 'element', visitor)\n }\n\n /**\n * @param {Element} node\n * @param {number} index\n * @param {Element} parent\n */\n function visitor(node, index, parent) {\n if (!parent || parent.tagName !== 'pre' || node.tagName !== 'code') {\n return\n }\n\n let meta = /** @type {string} */ (node?.data?.meta || node?.properties?.metastring || '')\n // Coerce className to array\n if (node.properties.className) {\n if (typeof node.properties.className === 'boolean') {\n node.properties.className = []\n } else if (!Array.isArray(node.properties.className)) {\n node.properties.className = [node.properties.className]\n }\n } else {\n node.properties.className = []\n }\n\n let lang = getLanguage(node)\n // If no language is set on the code block, use defaultLanguage if specified\n if (!lang && options.defaultLanguage) {\n lang = options.defaultLanguage\n node.properties.className.push(`language-${lang}`)\n }\n node.properties.className.push('code-highlight')\n\n /** @type {Element} */\n let refractorRoot\n\n // Syntax highlight\n if (lang) {\n try {\n let rootLang\n if (lang?.includes('diff-')) {\n rootLang = lang.split('-')[1]\n } else {\n rootLang = lang\n }\n // @ts-ignore\n refractorRoot = refractor.highlight(toString(node), rootLang)\n // @ts-ignore className is already an array\n parent.properties.className = (parent.properties.className || []).concat(\n 'language-' + rootLang\n )\n } catch (err) {\n if (options.ignoreMissing && /Unknown language/.test(err.message)) {\n refractorRoot = node\n } else {\n throw err\n }\n }\n } else {\n refractorRoot = node\n }\n\n refractorRoot.children = addNodePositionClosure()(refractorRoot.children)\n\n // Add position info to root\n if (refractorRoot.children.length > 0) {\n refractorRoot.position = {\n start: { line: refractorRoot.children[0].position.start.line, column: 0 },\n end: {\n line: refractorRoot.children[refractorRoot.children.length - 1].position.end.line,\n column: 0,\n },\n }\n } else {\n refractorRoot.position = {\n start: { line: 0, column: 0 },\n end: { line: 0, column: 0 },\n }\n }\n\n const shouldHighlightLine = calculateLinesToHighlight(meta)\n const startingLineNumber = calculateStartingLine(meta)\n const codeLineArray = createLineNodes(refractorRoot.position.end.line)\n\n const falseShowLineNumbersStr = [\n 'showlinenumbers=false',\n 'showlinenumbers=\"false\"',\n 'showlinenumbers={false}',\n ]\n for (const [i, line] of codeLineArray.entries()) {\n // Default class name for each line\n line.properties.className = ['code-line']\n\n // Syntax highlight\n const treeExtract = filter(\n refractorRoot,\n (node) => node.position.start.line <= i + 1 && node.position.end.line >= i + 1\n )\n line.children = treeExtract.children\n\n // Line number\n if (\n (meta.toLowerCase().includes('showLineNumbers'.toLowerCase()) ||\n options.showLineNumbers) &&\n !falseShowLineNumbersStr.some((str) => meta.toLowerCase().includes(str))\n ) {\n line.properties.line = [(i + startingLineNumber).toString()]\n line.properties.className.push('line-number')\n }\n\n // Line highlight\n if (shouldHighlightLine(i)) {\n line.properties.className.push('highlight-line')\n }\n\n // Diff classes\n if (\n (lang === 'diff' || lang?.includes('diff-')) &&\n toString(line).substring(0, 1) === '-'\n ) {\n line.properties.className.push('deleted')\n } else if (\n (lang === 'diff' || lang?.includes('diff-')) &&\n toString(line).substring(0, 1) === '+'\n ) {\n line.properties.className.push('inserted')\n }\n }\n\n // Remove possible trailing line when splitting by \\n which results in empty array\n if (\n codeLineArray.length > 0 &&\n toString(codeLineArray[codeLineArray.length - 1]).trim() === ''\n ) {\n codeLineArray.pop()\n }\n\n node.children = codeLineArray\n }\n }\n}\n\nexport default rehypePrismGenerator\n","import { refractor as refractorAll } from 'refractor/lib/all.js'\nimport rehypePrismGenerator from './generator.js'\n\n/**\n * Rehype prism plugin that highlights code blocks with refractor (prismjs)\n * This supports all the languages and should be used on the server side.\n *\n * Consider using rehypePrismCommon or rehypePrismGenerator to generate a plugin\n * that supports your required languages.\n */\nconst rehypePrismAll = rehypePrismGenerator(refractorAll)\n\nexport default rehypePrismAll\n","import { refractor as refractorCommon } from 'refractor/lib/common.js'\nimport rehypePrismGenerator from './generator.js'\n\n/**\n * Rehype prism plugin that highlights code blocks with refractor (prismjs)\n * Supported languages: https://github.com/wooorm/refractor#data\n *\n * Consider using rehypePrismGenerator to generate a plugin\n * that supports your required languages.\n */\nconst rehypePrismCommon = rehypePrismGenerator(refractorCommon)\n\nexport default rehypePrismCommon\n","const rtlRange = '\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC'\nconst ltrRange =\n 'A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6' +\n '\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\\u200E\\u2C00-\\uFB1C' +\n '\\uFE00-\\uFE6F\\uFEFD-\\uFFFF'\n\n/* eslint-disable no-misleading-character-class */\nconst rtl = new RegExp('^[^' + ltrRange + ']*[' + rtlRange + ']')\nconst ltr = new RegExp('^[^' + rtlRange + ']*[' + ltrRange + ']')\n/* eslint-enable no-misleading-character-class */\n\n/**\n * Detect the direction of text: left-to-right, right-to-left, or neutral\n *\n * @param {string} value\n * @returns {'rtl'|'ltr'|'neutral'}\n */\nexport function direction(value) {\n const source = String(value || '')\n return rtl.test(source) ? 'rtl' : ltr.test(source) ? 'ltr' : 'neutral'\n}\n","/**\n * @typedef {import('./types.js').SelectState} SelectState\n * @typedef {import('./types.js').Node} Node\n * @typedef {import('./types.js').ElementChild} ElementChild\n * @typedef {import('./types.js').Direction} Direction\n * @typedef {import('unist-util-visit/complex-types.js').Visitor} Visitor\n */\n\nimport {direction} from 'direction'\nimport {toString} from 'hast-util-to-string'\nimport {svg} from 'property-information'\nimport {visit, EXIT, SKIP} from 'unist-util-visit'\n\n/**\n * Enter a node.\n *\n * The caller is responsible for calling the return value `exit`.\n *\n * @param {SelectState} state\n * Current state.\n *\n * Will be mutated: `exit` undos the changes.\n * @param {Node} node\n * Node to enter.\n * @returns {() => void}\n * Call to exit.\n */\n// eslint-disable-next-line complexity\nexport function enterState(state, node) {\n const schema = state.schema\n const language = state.language\n const currentDirection = state.direction\n const editableOrEditingHost = state.editableOrEditingHost\n /** @type {Direction | undefined} */\n let dirInferred\n\n if (node.type === 'element' && node.properties) {\n const lang = node.properties.xmlLang || node.properties.lang\n const type = node.properties.type || 'text'\n const dir = dirProperty(node)\n\n if (lang !== undefined && lang !== null) {\n state.language = String(lang)\n }\n\n if (schema && schema.space === 'html') {\n if (node.properties.contentEditable === 'true') {\n state.editableOrEditingHost = true\n }\n\n if (node.tagName === 'svg') {\n state.schema = svg\n }\n\n // See: .\n // Explicit `[dir=rtl]`.\n if (dir === 'rtl') {\n dirInferred = dir\n } else if (\n // Explicit `[dir=ltr]`.\n dir === 'ltr' ||\n // HTML with an invalid or no `[dir]`.\n (dir !== 'auto' && node.tagName === 'html') ||\n // `input[type=tel]` with an invalid or no `[dir]`.\n (dir !== 'auto' && node.tagName === 'input' && type === 'tel')\n ) {\n dirInferred = 'ltr'\n // `[dir=auto]` or `bdi` with an invalid or no `[dir]`.\n } else if (dir === 'auto' || node.tagName === 'bdi') {\n if (node.tagName === 'textarea') {\n // Check contents of `