plan-review 0.2.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/browser/app.js +22 -21
- package/dist/browser/index.html +163 -21
- package/dist/formatter.js +26 -11
- package/dist/formatter.js.map +1 -1
- package/dist/index.js +134 -8
- package/dist/index.js.map +1 -1
- package/dist/navigator.d.ts +1 -1
- package/dist/navigator.js +5 -4
- package/dist/navigator.js.map +1 -1
- package/dist/output.js +10 -2
- package/dist/output.js.map +1 -1
- package/dist/server/routes.d.ts +1 -0
- package/dist/server/routes.js +70 -1
- package/dist/server/routes.js.map +1 -1
- package/dist/session.d.ts +25 -0
- package/dist/session.js +133 -0
- package/dist/session.js.map +1 -0
- package/dist/transport.d.ts +2 -0
- package/dist/transport.js +5 -0
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +7 -6
- package/package.json +4 -3
- package/skills/plan-review/SKILL.md +42 -0
package/README.md
CHANGED
|
@@ -81,6 +81,23 @@ Any markdown with headings gets split into reviewable sections.
|
|
|
81
81
|
- **file** — write to `<input>.review.md` or custom path
|
|
82
82
|
- **claude** — pipe directly to Claude Code CLI
|
|
83
83
|
|
|
84
|
+
## Saved sessions
|
|
85
|
+
|
|
86
|
+
Review progress is auto-saved as you work. If you close the terminal or browser and re-run `plan-review` on the same file, you'll be prompted to resume where you left off.
|
|
87
|
+
|
|
88
|
+
Sessions are stored in `~/.plan-review/sessions/`.
|
|
89
|
+
|
|
90
|
+
### Commands
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
plan-review plan.md --fresh Skip session resume, start clean
|
|
94
|
+
plan-review sessions List all saved sessions
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Manual cleanup
|
|
98
|
+
|
|
99
|
+
Delete files in `~/.plan-review/sessions/` to remove old sessions.
|
|
100
|
+
|
|
84
101
|
## License
|
|
85
102
|
|
|
86
103
|
MIT
|
package/dist/browser/app.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/* bundled with preact */
|
|
2
|
-
"use strict";(()=>{var te,x,Oe,zt,B,He,je,Fe,_e,V,F,Ue,ke,de,ge,It,K={},Y=[],Et=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ne=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function be(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lt(t,e,n){var i,r,s,o={};for(s in e)s=="key"?i=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?te.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return X(t,o,i,r,null)}function X(t,e,n,i,r){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Oe,__i:-1,__u:0};return r==null&&x.vnode!=null&&x.vnode(s),s}function j(t){return t.children}function J(t,e){this.props=t,this.context=e}function O(t,e){if(e==null)return t.__?O(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?O(t):null}function Dt(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],s=E({},e);s.__v=e.__v+1,x.vnode&&x.vnode(s),xe(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??O(e),!!(32&e.__u),r),s.__v=e.__v,s.__.__k[s.__i]=s,Qe(i,s,r),e.__e=e.__=null,s.__e!=n&&Ze(s)}}function Ze(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Ze(t)}function qe(t){(!t.__d&&(t.__d=!0)&&B.push(t)&&!ee.__r++||He!=x.debounceRendering)&&((He=x.debounceRendering)||je)(ee)}function ee(){try{for(var t,e=1;B.length;)B.length>e&&B.sort(Fe),t=B.shift(),e=B.length,Dt(t)}finally{B.length=ee.__r=0}}function Ge(t,e,n,i,r,s,o,l,u,a,p){var c,h,_,g,v,w,d,m=i&&i.__k||Y,C=e.length;for(u=Bt(n,e,m,u,C),c=0;c<C;c++)(_=n.__k[c])!=null&&(h=_.__i!=-1&&m[_.__i]||K,_.__i=c,w=xe(t,_,h,r,s,o,l,u,a,p),g=_.__e,_.ref&&h.ref!=_.ref&&(h.ref&&ve(h.ref,null,_),p.push(_.ref,_.__c||g,_)),v==null&&g!=null&&(v=g),(d=!!(4&_.__u))||h.__k===_.__k?(u=We(_,u,t,d),d&&h.__e&&(h.__e=null)):typeof _.type=="function"&&w!==void 0?u=w:g&&(u=g.nextSibling),_.__u&=-7);return n.__e=v,u}function Bt(t,e,n,i,r){var s,o,l,u,a,p=n.length,c=p,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[s]=X(null,o,null,null,null):ne(o)?o=t.__k[s]=X(j,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=X(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+h,o.__=t,o.__b=t.__b+1,l=null,(a=o.__i=Ht(o,n,u,c))!=-1&&(c--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(r>p?h--:r<p&&h++),typeof o.type!="function"&&(o.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<p;s++)(l=n[s])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=O(l)),Xe(l,l));return i}function We(t,e,n,i){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=We(r[s],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=O(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ht(t,e,n,i){var r,s,o,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(i>(p?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((a=e[o=r>=0?r--:s++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return o}return-1}function Ne(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Et.test(e)?n:n+"px"}function Q(t,e,n,i,r){var s,o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Ne(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Ne(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Ue,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n[F]=i[F]:(n[F]=ke,t.addEventListener(e,s?ge:de,s)):t.removeEventListener(e,s?ge:de,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Me(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[V]==null)e[V]=ke++;else if(e[V]<n[F])return;return n(x.event?x.event(e):e)}}}function xe(t,e,n,i,r,s,o,l,u,a){var p,c,h,_,g,v,w,d,m,C,T,I,N,A,fe,P=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),s=[l=e.__e=n.__e]),(p=x.__b)&&p(e);e:if(typeof P=="function")try{if(d=e.props,m=P.prototype&&P.prototype.render,C=(p=P.contextType)&&i[p.__c],T=p?C?C.props.value:p.__:i,n.__c?w=(c=e.__c=n.__c).__=c.__E:(m?e.__c=c=new P(d,T):(e.__c=c=new J(d,T),c.constructor=P,c.render=Nt),C&&C.sub(c),c.state||(c.state={}),c.__n=i,h=c.__d=!0,c.__h=[],c._sb=[]),m&&c.__s==null&&(c.__s=c.state),m&&P.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=E({},c.__s)),E(c.__s,P.getDerivedStateFromProps(d,c.__s))),_=c.props,g=c.state,c.__v=e,h)m&&P.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),m&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(m&&P.getDerivedStateFromProps==null&&d!==_&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(d,T),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(d,c.__s,T)===!1){e.__v!=n.__v&&(c.props=d,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(M){M&&(M.__=e)}),Y.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(d,c.__s,T),m&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(_,g,v)})}if(c.context=T,c.props=d,c.__P=t,c.__e=!1,I=x.__r,N=0,m)c.state=c.__s,c.__d=!1,I&&I(e),p=c.render(c.props,c.state,c.context),Y.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,I&&I(e),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++N<25);c.state=c.__s,c.getChildContext!=null&&(i=E(E({},i),c.getChildContext())),m&&!h&&c.getSnapshotBeforeUpdate!=null&&(v=c.getSnapshotBeforeUpdate(_,g)),A=p!=null&&p.type===j&&p.key==null?Ve(p.props.children):p,l=Ge(t,ne(A)?A:[A],e,n,i,r,s,o,l,u,a),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),w&&(c.__E=c.__=null)}catch(M){if(e.__v=null,u||s!=null)if(M.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,e.__e=l}else{for(fe=s.length;fe--;)be(s[fe]);me(e)}else e.__e=n.__e,e.__k=n.__k,M.then||me(e);x.__e(M,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qt(n.__e,e,n,i,r,s,o,u,a);return(p=x.diffed)&&p(e),128&e.__u?void 0:l}function me(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(me))}function Qe(t,e,n){for(var i=0;i<n.length;i++)ve(n[i],n[++i],n[++i]);x.__c&&x.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){x.__e(s,r.__v)}})}function Ve(t){return typeof t!="object"||t==null||t.__b>0?t:ne(t)?t.map(Ve):E({},t)}function qt(t,e,n,i,r,s,o,l,u){var a,p,c,h,_,g,v,w=n.props||K,d=e.props,m=e.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(a=0;a<s.length;a++)if((_=s[a])&&"setAttribute"in _==!!m&&(m?_.localName==m:_.nodeType==3)){t=_,s[a]=null;break}}if(t==null){if(m==null)return document.createTextNode(d);t=document.createElementNS(r,m,d.is&&d),l&&(x.__m&&x.__m(e,s),l=!1),s=null}if(m==null)w===d||l&&t.data==d||(t.data=d);else{if(s=s&&te.call(t.childNodes),!l&&s!=null)for(w={},a=0;a<t.attributes.length;a++)w[(_=t.attributes[a]).name]=_.value;for(a in w)_=w[a],a=="dangerouslySetInnerHTML"?c=_:a=="children"||a in d||a=="value"&&"defaultValue"in d||a=="checked"&&"defaultChecked"in d||Q(t,a,null,_,r);for(a in d)_=d[a],a=="children"?h=_:a=="dangerouslySetInnerHTML"?p=_:a=="value"?g=_:a=="checked"?v=_:l&&typeof _!="function"||w[a]===_||Q(t,a,_,w[a],r);if(p)l||c&&(p.__html==c.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(c&&(t.innerHTML=""),Ge(e.type=="template"?t.content:t,ne(h)?h:[h],e,n,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:n.__k&&O(n,0),l,u),s!=null)for(a=s.length;a--;)be(s[a]);l||(a="value",m=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[a]||m=="progress"&&!g||m=="option"&&g!=w[a])&&Q(t,a,g,w[a],r),a="checked",v!=null&&v!=t[a]&&Q(t,a,v,w[a],r))}return t}function ve(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){x.__e(r,n)}}function Xe(t,e,n){var i,r;if(x.unmount&&x.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||ve(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){x.__e(s,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Xe(i[r],e,n||typeof t.type!="function");n||be(t.__e),t.__c=t.__=t.__e=void 0}function Nt(t,e,n){return this.constructor(t,n)}function Je(t,e,n){var i,r,s,o;e==document&&(e=document.documentElement),x.__&&x.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],xe(e,t=(!i&&n||e).__k=Lt(j,null,[t]),r||K,K,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?te.call(e.childNodes):null,s,!i&&n?n:r?r.__e:e.firstChild,i,o),Qe(s,t,o)}te=Y.slice,x={__e:function(t,e,n,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),o=r.__d),o)return r.__E=r}catch(l){t=l}throw t}},Oe=0,zt=function(t){return t!=null&&t.constructor===void 0},J.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=E({},this.state),typeof t=="function"&&(t=t(E({},n),this.props)),t&&E(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),qe(this))},J.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qe(this))},J.prototype.render=j,B=[],je=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fe=function(t,e){return t.__v.__b-e.__v.__b},ee.__r=0,_e=Math.random().toString(8),V="__d"+_e,F="__a"+_e,Ue=/(PointerCapture)$|Capture$/i,ke=0,de=Me(!1),ge=Me(!0),It=0;var ie,y,we,Ke,ye=0,ot=[],S=x,Ye=S.__b,et=S.__r,tt=S.diffed,nt=S.__c,rt=S.unmount,it=S.__;function lt(t,e){S.__h&&S.__h(y,t,ye||e),ye=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function $(t){return ye=1,Mt(ct,t)}function Mt(t,e,n){var i=lt(ie++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):ct(void 0,e),function(l){var u=i.__N?i.__N[0]:i.__[0],a=i.t(u,l);u!==a&&(i.__N=[a,i.__[1]],i.__c.setState({}))}],i.__c=y,!y.__f)){var r=function(l,u,a){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!s||s.call(this,l,u,a);var c=i.__c.props!==l;return p.some(function(h){if(h.__N){var _=h.__[0];h.__=h.__N,h.__N=void 0,_!==h.__[0]&&(c=!0)}}),s&&s.call(this,l,u,a)||c};y.__f=!0;var s=y.shouldComponentUpdate,o=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=s;s=void 0,r(l,u,a),s=p}o&&o.call(this,l,u,a)},y.shouldComponentUpdate=r}return i.__N||i.__}function at(t,e){var n=lt(ie++,3);!S.__s&&Ft(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ot(){for(var t;t=ot.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(re),e.__h.some(Se),e.__h=[]}catch(n){e.__h=[],S.__e(n,t.__v)}}}S.__b=function(t){y=null,Ye&&Ye(t)},S.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),it&&it(t,e)},S.__r=function(t){et&&et(t),ie=0;var e=(y=t.__c).__H;e&&(we===y?(e.__h=[],y.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(re),e.__h.some(Se),e.__h=[],ie=0)),we=y},S.diffed=function(t){tt&&tt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ot.push(e)!==1&&Ke===S.requestAnimationFrame||((Ke=S.requestAnimationFrame)||jt)(Ot)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),we=y=null},S.__c=function(t,e){e.some(function(n){try{n.__h.some(re),n.__h=n.__h.filter(function(i){return!i.__||Se(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],S.__e(i,n.__v)}}),nt&&nt(t,e)},S.unmount=function(t){rt&&rt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(i){try{re(i)}catch(r){e=r}}),n.__H=void 0,e&&S.__e(e,n.__v))};var st=typeof requestAnimationFrame=="function";function jt(t){var e,n=function(){clearTimeout(i),st&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);st&&(e=requestAnimationFrame(n))}function re(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function Se(t){var e=y;t.__c=t.__(),y=e}function Ft(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function ct(t,e){return typeof e=="function"?e(t):e}var Ut=0;function f(t,e,n,i,r,s){e||(e={});var o,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?o=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ut,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(l in o)u[l]===void 0&&(u[l]=o[l]);return x.vnode&&x.vnode(a),a}function ut({doc:t,comments:e,activeSection:n,onNavigate:i}){let r=new Set(e.map(o=>o.sectionId));if(t.mode==="plan"){let o=t.sections.filter(l=>l.level===2);return f("nav",{class:"toc-panel",children:o.map(l=>{let u=t.sections.filter(a=>a.parent===l.id);return f("div",{class:"toc-milestone",children:[f("h3",{children:l.heading}),f("ul",{children:u.map(a=>f("li",{class:`toc-item${n===a.id?" active":""}${r.has(a.id)?" commented":""}`,onClick:()=>i(a.id),children:[f("span",{class:"toc-marker",children:r.has(a.id)?"\u2713":"\xA0"}),f("span",{class:"toc-id",children:a.id}),f("span",{class:"toc-heading",children:a.heading})]},a.id))})]},l.id)})})}let s=t.sections.filter(o=>o.level>=2);return f("nav",{class:"toc-panel",children:f("ul",{children:s.map(o=>f("li",{class:`toc-item${n===o.id?" active":""}${r.has(o.id)?" commented":""}`,onClick:()=>i(o.id),children:[f("span",{class:"toc-marker",children:r.has(o.id)?"\u2713":"\xA0"}),f("span",{class:"toc-heading",children:o.heading})]},o.id))})})}function $e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=$e();function gt(t){q=t}var G={exec:()=>null};function b(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(R.caret,"$1"),n=n.replace(r,o),i},getRegex:()=>new RegExp(n,e)};return i}var R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Zt=/^(?:[ \t]*(?:\n|$))+/,Gt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,W=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ae=/(?:[*+-]|\d{1,9}[.)])/,mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,kt=b(mt).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vt=b(mt).replace(/bull/g,Ae).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xt=/^[^\n]+/,ze=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jt=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ze).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kt=b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ae).getRegex(),ue="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ie=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yt=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ie).replace("tag",ue).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bt=b(Pe).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex(),en=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bt).getRegex(),Ee={blockquote:en,code:Gt,def:Jt,fences:Wt,heading:Qt,hr:W,html:Yt,lheading:kt,list:Kt,newline:Zt,paragraph:bt,table:G,text:Xt},pt=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex(),tn={...Ee,lheading:Vt,table:pt,paragraph:b(Pe).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ue).getRegex()},nn={...Ee,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ie).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(Pe).replace("hr",W).replace("heading",` *#{1,6} *[^
|
|
3
|
-
]`).replace("lheading",
|
|
2
|
+
"use strict";(()=>{var ne,v,Ze,Mt,D,Oe,We,Qe,me,X,F,Ve,ve,ke,be,qt,Y={},ee=[],Nt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,re=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function we(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function jt(t,e,n){var i,r,s,o={};for(s in e)s=="key"?i=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ne.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return J(t,o,i,r,null)}function J(t,e,n,i,r){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Ze,__i:-1,__u:0};return r==null&&v.vnode!=null&&v.vnode(s),s}function M(t){return t.children}function K(t,e){this.props=t,this.context=e}function O(t,e){if(e==null)return t.__?O(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?O(t):null}function Ot(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],s=E({},e);s.__v=e.__v+1,v.vnode&&v.vnode(s),ye(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??O(e),!!(32&e.__u),r),s.__v=e.__v,s.__.__k[s.__i]=s,Ye(i,s,r),e.__e=e.__=null,s.__e!=n&&Xe(s)}}function Xe(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Xe(t)}function Fe(t){(!t.__d&&(t.__d=!0)&&D.push(t)&&!te.__r++||Oe!=v.debounceRendering)&&((Oe=v.debounceRendering)||We)(te)}function te(){try{for(var t,e=1;D.length;)D.length>e&&D.sort(Qe),t=D.shift(),e=D.length,Ot(t)}finally{D.length=te.__r=0}}function Je(t,e,n,i,r,s,o,l,u,a,p){var c,h,d,_,g,w,k,b=i&&i.__k||ee,m=e.length;for(u=Ft(n,e,b,u,m),c=0;c<m;c++)(d=n.__k[c])!=null&&(h=d.__i!=-1&&b[d.__i]||Y,d.__i=c,w=ye(t,d,h,r,s,o,l,u,a,p),_=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&Te(h.ref,null,d),p.push(d.ref,d.__c||_,d)),g==null&&_!=null&&(g=_),(k=!!(4&d.__u))||h.__k===d.__k?(u=Ke(d,u,t,k),k&&h.__e&&(h.__e=null)):typeof d.type=="function"&&w!==void 0?u=w:_&&(u=_.nextSibling),d.__u&=-7);return n.__e=g,u}function Ft(t,e,n,i,r){var s,o,l,u,a,p=n.length,c=p,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[s]=J(null,o,null,null,null):re(o)?o=t.__k[s]=J(M,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=J(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+h,o.__=t,o.__b=t.__b+1,l=null,(a=o.__i=Gt(o,n,u,c))!=-1&&(c--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(r>p?h--:r<p&&h++),typeof o.type!="function"&&(o.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<p;s++)(l=n[s])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=O(l)),tt(l,l));return i}function Ke(t,e,n,i){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=Ke(r[s],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=O(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Gt(t,e,n,i){var r,s,o,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(i>(p?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((a=e[o=r>=0?r--:s++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return o}return-1}function Ge(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Nt.test(e)?n:n+"px"}function V(t,e,n,i,r){var s,o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Ge(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Ge(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Ve,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n[F]=i[F]:(n[F]=ve,t.addEventListener(e,s?be:ke,s)):t.removeEventListener(e,s?be:ke,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Ue(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[X]==null)e[X]=ve++;else if(e[X]<n[F])return;return n(v.event?v.event(e):e)}}}function ye(t,e,n,i,r,s,o,l,u,a){var p,c,h,d,_,g,w,k,b,m,T,$,R,A,ge,I=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),s=[l=e.__e=n.__e]),(p=v.__b)&&p(e);e:if(typeof I=="function")try{if(k=e.props,b=I.prototype&&I.prototype.render,m=(p=I.contextType)&&i[p.__c],T=p?m?m.props.value:p.__:i,n.__c?w=(c=e.__c=n.__c).__=c.__E:(b?e.__c=c=new I(k,T):(e.__c=c=new K(k,T),c.constructor=I,c.render=Zt),m&&m.sub(c),c.state||(c.state={}),c.__n=i,h=c.__d=!0,c.__h=[],c._sb=[]),b&&c.__s==null&&(c.__s=c.state),b&&I.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=E({},c.__s)),E(c.__s,I.getDerivedStateFromProps(k,c.__s))),d=c.props,_=c.state,c.__v=e,h)b&&I.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),b&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(b&&I.getDerivedStateFromProps==null&&k!==d&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(k,T),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(k,c.__s,T)===!1){e.__v!=n.__v&&(c.props=k,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(j){j&&(j.__=e)}),ee.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(k,c.__s,T),b&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(d,_,g)})}if(c.context=T,c.props=k,c.__P=t,c.__e=!1,$=v.__r,R=0,b)c.state=c.__s,c.__d=!1,$&&$(e),p=c.render(c.props,c.state,c.context),ee.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,$&&$(e),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++R<25);c.state=c.__s,c.getChildContext!=null&&(i=E(E({},i),c.getChildContext())),b&&!h&&c.getSnapshotBeforeUpdate!=null&&(g=c.getSnapshotBeforeUpdate(d,_)),A=p!=null&&p.type===M&&p.key==null?et(p.props.children):p,l=Je(t,re(A)?A:[A],e,n,i,r,s,o,l,u,a),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),w&&(c.__E=c.__=null)}catch(j){if(e.__v=null,u||s!=null)if(j.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,e.__e=l}else{for(ge=s.length;ge--;)we(s[ge]);xe(e)}else e.__e=n.__e,e.__k=n.__k,j.then||xe(e);v.__e(j,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=Ut(n.__e,e,n,i,r,s,o,u,a);return(p=v.diffed)&&p(e),128&e.__u?void 0:l}function xe(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(xe))}function Ye(t,e,n){for(var i=0;i<n.length;i++)Te(n[i],n[++i],n[++i]);v.__c&&v.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){v.__e(s,r.__v)}})}function et(t){return typeof t!="object"||t==null||t.__b>0?t:re(t)?t.map(et):E({},t)}function Ut(t,e,n,i,r,s,o,l,u){var a,p,c,h,d,_,g,w=n.props||Y,k=e.props,b=e.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(a=0;a<s.length;a++)if((d=s[a])&&"setAttribute"in d==!!b&&(b?d.localName==b:d.nodeType==3)){t=d,s[a]=null;break}}if(t==null){if(b==null)return document.createTextNode(k);t=document.createElementNS(r,b,k.is&&k),l&&(v.__m&&v.__m(e,s),l=!1),s=null}if(b==null)w===k||l&&t.data==k||(t.data=k);else{if(s=s&&ne.call(t.childNodes),!l&&s!=null)for(w={},a=0;a<t.attributes.length;a++)w[(d=t.attributes[a]).name]=d.value;for(a in w)d=w[a],a=="dangerouslySetInnerHTML"?c=d:a=="children"||a in k||a=="value"&&"defaultValue"in k||a=="checked"&&"defaultChecked"in k||V(t,a,null,d,r);for(a in k)d=k[a],a=="children"?h=d:a=="dangerouslySetInnerHTML"?p=d:a=="value"?_=d:a=="checked"?g=d:l&&typeof d!="function"||w[a]===d||V(t,a,d,w[a],r);if(p)l||c&&(p.__html==c.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(c&&(t.innerHTML=""),Je(e.type=="template"?t.content:t,re(h)?h:[h],e,n,i,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:n.__k&&O(n,0),l,u),s!=null)for(a=s.length;a--;)we(s[a]);l||(a="value",b=="progress"&&_==null?t.removeAttribute("value"):_!=null&&(_!==t[a]||b=="progress"&&!_||b=="option"&&_!=w[a])&&V(t,a,_,w[a],r),a="checked",g!=null&&g!=t[a]&&V(t,a,g,w[a],r))}return t}function Te(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){v.__e(r,n)}}function tt(t,e,n){var i,r;if(v.unmount&&v.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Te(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){v.__e(s,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&tt(i[r],e,n||typeof t.type!="function");n||we(t.__e),t.__c=t.__=t.__e=void 0}function Zt(t,e,n){return this.constructor(t,n)}function nt(t,e,n){var i,r,s,o;e==document&&(e=document.documentElement),v.__&&v.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],ye(e,t=(!i&&n||e).__k=jt(M,null,[t]),r||Y,Y,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?ne.call(e.childNodes):null,s,!i&&n?n:r?r.__e:e.firstChild,i,o),Ye(s,t,o)}ne=ee.slice,v={__e:function(t,e,n,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),o=r.__d),o)return r.__E=r}catch(l){t=l}throw t}},Ze=0,Mt=function(t){return t!=null&&t.constructor===void 0},K.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=E({},this.state),typeof t=="function"&&(t=t(E({},n),this.props)),t&&E(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Fe(this))},K.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Fe(this))},K.prototype.render=M,D=[],We=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qe=function(t,e){return t.__v.__b-e.__v.__b},te.__r=0,me=Math.random().toString(8),X="__d"+me,F="__a"+me,Ve=/(PointerCapture)$|Capture$/i,ve=0,ke=Ue(!1),be=Ue(!0),qt=0;var G,S,Se,rt,se=0,pt=[],C=v,it=C.__b,st=C.__r,ot=C.diffed,lt=C.__c,at=C.unmount,ct=C.__;function $e(t,e){C.__h&&C.__h(S,t,se||e),se=0;var n=S.__H||(S.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function P(t){return se=1,Wt(dt,t)}function Wt(t,e,n){var i=$e(G++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):dt(void 0,e),function(l){var u=i.__N?i.__N[0]:i.__[0],a=i.t(u,l);u!==a&&(i.__N=[a,i.__[1]],i.__c.setState({}))}],i.__c=S,!S.__f)){var r=function(l,u,a){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!s||s.call(this,l,u,a);var c=i.__c.props!==l;return p.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(c=!0)}}),s&&s.call(this,l,u,a)||c};S.__f=!0;var s=S.shouldComponentUpdate,o=S.componentWillUpdate;S.componentWillUpdate=function(l,u,a){if(this.__e){var p=s;s=void 0,r(l,u,a),s=p}o&&o.call(this,l,u,a)},S.shouldComponentUpdate=r}return i.__N||i.__}function Re(t,e){var n=$e(G++,3);!C.__s&&ft(n.__H,e)&&(n.__=t,n.u=e,S.__H.__h.push(n))}function ht(t){return se=5,Le(function(){return{current:t}},[])}function Le(t,e){var n=$e(G++,7);return ft(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Qt(){for(var t;t=pt.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ie),e.__h.some(Ce),e.__h=[]}catch(n){e.__h=[],C.__e(n,t.__v)}}}C.__b=function(t){S=null,it&&it(t)},C.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ct&&ct(t,e)},C.__r=function(t){st&&st(t),G=0;var e=(S=t.__c).__H;e&&(Se===S?(e.__h=[],S.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(ie),e.__h.some(Ce),e.__h=[],G=0)),Se=S},C.diffed=function(t){ot&&ot(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(pt.push(e)!==1&&rt===C.requestAnimationFrame||((rt=C.requestAnimationFrame)||Vt)(Qt)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Se=S=null},C.__c=function(t,e){e.some(function(n){try{n.__h.some(ie),n.__h=n.__h.filter(function(i){return!i.__||Ce(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],C.__e(i,n.__v)}}),lt&<(t,e)},C.unmount=function(t){at&&at(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(i){try{ie(i)}catch(r){e=r}}),n.__H=void 0,e&&C.__e(e,n.__v))};var ut=typeof requestAnimationFrame=="function";function Vt(t){var e,n=function(){clearTimeout(i),ut&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);ut&&(e=requestAnimationFrame(n))}function ie(t){var e=S,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),S=e}function Ce(t){var e=S;t.__c=t.__(),S=e}function ft(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function dt(t,e){return typeof e=="function"?e(t):e}var Xt=0;function f(t,e,n,i,r,s){e||(e={});var o,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?o=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xt,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(l in o)u[l]===void 0&&(u[l]=o[l]);return v.vnode&&v.vnode(a),a}function _t({doc:t,comments:e,activeSection:n,onNavigate:i}){let r=new Set(e.map(o=>o.sectionId));if(t.mode==="plan"){let o=t.sections.filter(l=>l.level===2);return f("nav",{class:"toc-panel",children:o.map(l=>{let u=t.sections.filter(a=>a.parent===l.id);return f("div",{class:"toc-milestone",children:[f("h3",{children:l.heading}),f("ul",{children:u.map(a=>f("li",{class:`toc-item${n===a.id?" active":""}${r.has(a.id)?" commented":""}`,onClick:()=>i(a.id),children:[f("span",{class:"toc-marker",children:r.has(a.id)?"\u2713":"\xA0"}),f("span",{class:"toc-id",children:a.id}),f("span",{class:"toc-heading",children:a.heading})]},a.id))})]},l.id)})})}let s=t.sections.filter(o=>o.level>=2);return f("nav",{class:"toc-panel",children:f("ul",{children:s.map(o=>f("li",{class:`toc-item${n===o.id?" active":""}${r.has(o.id)?" commented":""}`,onClick:()=>i(o.id),children:[f("span",{class:"toc-marker",children:r.has(o.id)?"\u2713":"\xA0"}),f("span",{class:"toc-heading",children:o.heading})]},o.id))})})}function ze(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var N=ze();function vt(t){N=t}var W={exec:()=>null};function x(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(L.caret,"$1"),n=n.replace(r,o),i},getRegex:()=>new RegExp(n,e)};return i}var L={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Jt=/^(?:[ \t]*(?:\n|$))+/,Kt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Q=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,en=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ee=/(?:[*+-]|\d{1,9}[.)])/,wt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yt=x(wt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),tn=x(wt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Be=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nn=/^[^\n]+/,He=/(?!\s*\])(?:\\.|[^\[\]\\])+/,rn=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",He).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sn=x(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ee).getRegex(),pe="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",De=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,on=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",De).replace("tag",pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Tt=x(Be).replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ln=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Tt).getRegex(),Me={blockquote:ln,code:Kt,def:rn,fences:Yt,heading:en,hr:Q,html:on,lheading:yt,list:sn,newline:Jt,paragraph:Tt,table:W,text:nn},gt=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),an={...Me,lheading:tn,table:gt,paragraph:x(Be).replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex()},cn={...Me,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",De).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:W,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(Be).replace("hr",Q).replace("heading",` *#{1,6} *[^
|
|
3
|
+
]`).replace("lheading",yt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},un=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,St=/^( {2,}|\\)\n(?!\s*$)/,hn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,he=/[\p{P}\p{S}]/u,qe=/[\s\p{P}\p{S}]/u,Ct=/[^\s\p{P}\p{S}]/u,fn=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qe).getRegex(),$t=/(?!~)[\p{P}\p{S}]/u,dn=/(?!~)[\s\p{P}\p{S}]/u,_n=/(?:[^\s\p{P}\p{S}]|~)/u,gn=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Rt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mn=x(Rt,"u").replace(/punct/g,he).getRegex(),kn=x(Rt,"u").replace(/punct/g,$t).getRegex(),Lt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bn=x(Lt,"gu").replace(/notPunctSpace/g,Ct).replace(/punctSpace/g,qe).replace(/punct/g,he).getRegex(),xn=x(Lt,"gu").replace(/notPunctSpace/g,_n).replace(/punctSpace/g,dn).replace(/punct/g,$t).getRegex(),vn=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ct).replace(/punctSpace/g,qe).replace(/punct/g,he).getRegex(),wn=x(/\\(punct)/,"gu").replace(/punct/g,he).getRegex(),yn=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Tn=x(De).replace("(?:-->|$)","-->").getRegex(),Sn=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Tn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ae=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cn=x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ae).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),At=x(/^!?\[(label)\]\[(ref)\]/).replace("label",ae).replace("ref",He).getRegex(),Pt=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",He).getRegex(),$n=x("reflink|nolink(?!\\()","g").replace("reflink",At).replace("nolink",Pt).getRegex(),Ne={_backpedal:W,anyPunctuation:wn,autolink:yn,blockSkip:gn,br:St,code:pn,del:W,emStrongLDelim:mn,emStrongRDelimAst:bn,emStrongRDelimUnd:vn,escape:un,link:Cn,nolink:Pt,punctuation:fn,reflink:At,reflinkSearch:$n,tag:Sn,text:hn,url:W},Rn={...Ne,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",ae).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae).getRegex()},Ae={...Ne,emStrongRDelimAst:xn,emStrongLDelim:kn,url:x(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ln={...Ae,br:x(St).replace("{2,}","*").getRegex(),text:x(Ae.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},oe={normal:Me,gfm:an,pedantic:cn},U={normal:Ne,gfm:Ae,breaks:Ln,pedantic:Rn},An={"&":"&","<":"<",">":">",'"':""","'":"'"},mt=t=>An[t];function z(t,e){if(e){if(L.escapeTest.test(t))return t.replace(L.escapeReplace,mt)}else if(L.escapeTestNoEncode.test(t))return t.replace(L.escapeReplaceNoEncode,mt);return t}function kt(t){try{t=encodeURI(t).replace(L.percentDecode,"%")}catch{return null}return t}function bt(t,e){let n=t.replace(L.findPipe,(s,o,l)=>{let u=!1,a=o;for(;--a>=0&&l[a]==="\\";)u=!u;return u?"|":" |"}),i=n.split(L.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(L.slashPipe,"|");return i}function Z(t,e,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i;){let s=t.charAt(i-r-1);if(s===e&&!n)r++;else if(s!==e&&n)r++;else break}return t.slice(0,i-r)}function Pn(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])n++;else if(t[i]===e[1]&&(n--,n<0))return i;return n>0?-2:-1}function xt(t,e,n,i,r){let s=e.href,o=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,u}function In(t,e,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
|
|
4
4
|
`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=r.length?s.slice(r.length):s}).join(`
|
|
5
|
-
`)}var
|
|
6
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=
|
|
5
|
+
`)}var ce=class{options;rules;lexer;constructor(t){this.options=t||N}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z(n,`
|
|
6
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=In(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let i=Z(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Z(e[0],`
|
|
7
7
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Z(e[0],`
|
|
8
8
|
`).split(`
|
|
9
9
|
`),i="",r="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let a=l.join(`
|
|
10
10
|
`),p=a.replace(this.rules.other.blockquoteSetextReplace,`
|
|
11
11
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
12
12
|
${a}`:a,r=r?`${r}
|
|
13
|
-
${p}`:p;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=c,n.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let
|
|
13
|
+
${p}`:p;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=c,n.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let d=h,_=d.raw+`
|
|
14
14
|
`+n.join(`
|
|
15
|
-
`),
|
|
15
|
+
`),g=this.blockquote(_);s[s.length-1]=g,i=i.substring(0,i.length-d.raw.length)+g.raw,r=r.substring(0,r.length-d.text.length)+g.text;break}else if(h?.type==="list"){let d=h,_=d.raw+`
|
|
16
16
|
`+n.join(`
|
|
17
|
-
`),
|
|
17
|
+
`),g=this.list(_);s[s.length-1]=g,i=i.substring(0,i.length-h.raw.length)+g.raw,r=r.substring(0,r.length-d.raw.length)+g.raw,n=_.substring(s.at(-1).raw.length).split(`
|
|
18
18
|
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let u=!1,a="",p="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;a=e[0],t=t.substring(a.length);let c=e[2].split(`
|
|
19
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
20
|
-
`,1)[0],
|
|
21
|
-
`,t=t.substring(h.length+1),u=!0),!u){let
|
|
22
|
-
`,1)[0],A;if(h=
|
|
23
|
-
`+A.slice(
|
|
24
|
-
`+h}!
|
|
25
|
-
`,t=t.substring(
|
|
26
|
-
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of r)s.rows.push(
|
|
27
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=
|
|
28
|
-
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],i=!1){for(this.options.pedantic&&(e=e.replace(
|
|
19
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),h=t.split(`
|
|
20
|
+
`,1)[0],d=!c.trim(),_=0;if(this.options.pedantic?(_=2,p=c.trimStart()):d?_=e[1].length+1:(_=e[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,p=c.slice(_),_+=e[1].length),d&&this.rules.other.blankLine.test(h)&&(a+=h+`
|
|
21
|
+
`,t=t.substring(h.length+1),u=!0),!u){let k=this.rules.other.nextBulletRegex(_),b=this.rules.other.hrRegex(_),m=this.rules.other.fencesBeginRegex(_),T=this.rules.other.headingBeginRegex(_),$=this.rules.other.htmlBeginRegex(_);for(;t;){let R=t.split(`
|
|
22
|
+
`,1)[0],A;if(h=R,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),m.test(h)||T.test(h)||$.test(h)||k.test(h)||b.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=_||!h.trim())p+=`
|
|
23
|
+
`+A.slice(_);else{if(d||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(c)||T.test(c)||b.test(c))break;p+=`
|
|
24
|
+
`+h}!d&&!h.trim()&&(d=!0),a+=R+`
|
|
25
|
+
`,t=t.substring(R.length+1),c=A.slice(_)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(o=!0));let g=null,w;this.options.gfm&&(g=this.rules.other.listIsTask.exec(p),g&&(w=g[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:a,task:!!g,checked:w,loose:!1,text:p,tokens:[]}),r.raw+=a}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){let a=r.items[u].tokens.filter(c=>c.type==="space"),p=a.length>0&&a.some(c=>this.rules.other.anyLine.test(c.raw));r.loose=p}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:i,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=bt(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
26
|
+
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of r)s.rows.push(bt(o,s.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[u]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
27
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Pn(e[2],"()");if(s===-2)return;if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),xt(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return xt(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...i[0]].length-1,o,l,u=s,a=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(i=p.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(l=[...o].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&s%3&&!((s+l)%3)){a+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+a);let c=[...i[0]][0].length,h=t.slice(0,s+i.index+c+l);if(Math.min(s,l)%2){let _=h.slice(1,-1);return{type:"em",raw:h,text:_,tokens:this.lexer.inlineTokens(_)}}let d=h.slice(2,-2);return{type:"strong",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,i;return e[2]==="@"?(n=e[1],i="mailto:"+n):(n=e[1],i=n),{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},B=class Pe{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:L,block:oe.normal,inline:U.normal};this.options.pedantic?(n.block=oe.pedantic,n.inline=U.pedantic):this.options.gfm&&(n.block=oe.gfm,this.options.breaks?n.inline=U.breaks:n.inline=U.gfm),this.tokenizer.rules=n}static get rules(){return{block:oe,inline:U}}static lex(e,n){return new Pe(n).lex(e)}static lexInline(e,n){return new Pe(n).inlineTokens(e)}lex(e){e=e.replace(L.carriageReturn,`
|
|
28
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],i=!1){for(this.options.pedantic&&(e=e.replace(L.tabCharGlobal," ").replace(L.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let o=n.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
|
|
29
29
|
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
30
30
|
`+r.raw,o.text+=`
|
|
31
31
|
`+r.text,this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
@@ -34,7 +34,7 @@ ${p}`:p;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
34
34
|
`+r.raw,o.text+=`
|
|
35
35
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r),i=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=`
|
|
36
36
|
`+r.raw,o.text+=`
|
|
37
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let i=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(a=>(l=a.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let a=n.at(-1);l.type==="text"&&a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,i,o)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let u=e;if(this.options.extensions?.startInline){let a=1/0,p=e.slice(1),c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},p),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let a=n.at(-1);a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return n}},
|
|
37
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let i=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(a=>(l=a.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let a=n.at(-1);l.type==="text"&&a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,i,o)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let u=e;if(this.options.extensions?.startInline){let a=1/0,p=e.slice(1),c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},p),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let a=n.at(-1);a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return n}},ue=class{options;parser;constructor(t){this.options=t||N}space(t){return""}code({text:t,lang:e,escaped:n}){let i=(e||"").match(L.notSpaceStart)?.[0],r=t.replace(L.endingNewline,"")+`
|
|
38
38
|
`;return i?'<pre><code class="language-'+z(i)+'">'+(n?r:z(r,!0))+`</code></pre>
|
|
39
39
|
`:"<pre><code>"+(n?r:z(r,!0))+`</code></pre>
|
|
40
40
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -52,6 +52,7 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
52
52
|
`}tablerow({text:t}){return`<tr>
|
|
53
53
|
${t}</tr>
|
|
54
54
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
55
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let i=this.parser.parseInline(n),r=
|
|
56
|
-
`+this.renderer.text(l);n?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,n=this.renderer){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let o=s;switch(o.type){case"escape":{i+=n.text(o);break}case"html":{i+=n.html(o);break}case"link":{i+=n.link(o);break}case"image":{i+=n.image(o);break}case"strong":{i+=n.strong(o);break}case"em":{i+=n.em(o);break}case"codespan":{i+=n.codespan(o);break}case"br":{i+=n.br(o);break}case"del":{i+=n.del(o);break}case"text":{i+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},
|
|
57
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}}},
|
|
55
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let i=this.parser.parseInline(n),r=kt(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+z(e)+'"'),s+=">"+i+"</a>",s}image({href:t,title:e,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=kt(t);if(r===null)return z(n);t=r;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${z(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},je=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},H=class Ie{options;renderer;textRenderer;constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new je}static parse(e,n){return new Ie(n).parse(e)}static parseInline(e,n){return new Ie(n).parseInline(e)}parse(e,n=!0){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){i+=u||"";continue}}let o=s;switch(o.type){case"space":{i+=this.renderer.space(o);continue}case"hr":{i+=this.renderer.hr(o);continue}case"heading":{i+=this.renderer.heading(o);continue}case"code":{i+=this.renderer.code(o);continue}case"table":{i+=this.renderer.table(o);continue}case"blockquote":{i+=this.renderer.blockquote(o);continue}case"list":{i+=this.renderer.list(o);continue}case"html":{i+=this.renderer.html(o);continue}case"paragraph":{i+=this.renderer.paragraph(o);continue}case"text":{let l=o,u=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],u+=`
|
|
56
|
+
`+this.renderer.text(l);n?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,n=this.renderer){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let o=s;switch(o.type){case"escape":{i+=n.text(o);break}case"html":{i+=n.html(o);break}case"link":{i+=n.link(o);break}case"image":{i+=n.image(o);break}case"strong":{i+=n.strong(o);break}case"em":{i+=n.em(o);break}case"codespan":{i+=n.codespan(o);break}case"br":{i+=n.br(o);break}case"del":{i+=n.del(o);break}case"text":{i+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},le=class{options;block;constructor(t){this.options=t||N}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?B.lex:B.lexInline}provideParser(){return this.block?H.parse:H.parseInline}},fe=class{defaults=ze();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=H;Renderer=ue;TextRenderer=je;Lexer=B;Tokenizer=ce;Hooks=le;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let i of t)switch(n=n.concat(e.call(this,i)),i.type){case"table":{let r=i;for(let s of r.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of r.rows)for(let o of s)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=i;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=i;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(s=>{let o=r[s].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=e.renderers[r.name];s?e.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),n.renderer){let r=this.defaults.renderer||new ue(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new ce(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new le;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=r[o];le.passThroughHooks.has(s)?r[o]=a=>{if(this.defaults.async)return Promise.resolve(l.call(r,a)).then(c=>u.call(r,c));let p=l.call(r,a);return u.call(r,p)}:r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),r&&(l=l.concat(r.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return B.lex(t,e??this.defaults)}parser(t,e){return H.parse(t,e??this.defaults)}parseMarkdown(t){return(n,i)=>{let r={...i},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);let l=s.hooks?s.hooks.provideLexer():t?B.lex:B.lexInline,u=s.hooks?s.hooks.provideParser():t?H.parse:H.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(a=>l(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>u(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let a=l(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let p=u(a,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(a){return o(a)}}}onError(t,e){return n=>{if(n.message+=`
|
|
57
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}}},q=new fe;function y(t,e){return q.parse(t,e)}y.options=y.setOptions=function(t){return q.setOptions(t),y.defaults=q.defaults,vt(y.defaults),y};y.getDefaults=ze;y.defaults=N;y.use=function(...t){return q.use(...t),y.defaults=q.defaults,vt(y.defaults),y};y.walkTokens=function(t,e){return q.walkTokens(t,e)};y.parseInline=q.parseInline;y.Parser=H;y.parser=H.parse;y.Renderer=ue;y.TextRenderer=je;y.Lexer=B;y.lexer=B.lex;y.Tokenizer=ce;y.Hooks=le;y.parse=y;var Gn=y.options,Un=y.setOptions,Zn=y.use,Wn=y.walkTokens,Qn=y.parseInline;var Vn=H.parse,Xn=B.lex;function de(t){let e=document.createElement("div");return e.innerHTML=t,(e.textContent??"").replace(/\s+/g," ").trim()}var zn=new fe;function It(t){let e=[],n=0,i=new fe;return i.use({renderer:{paragraph(r){let o=`<p>${this.parser.parseInline(r.tokens)}</p>`;return e.push({index:n++,innerHtml:o,text:de(o)}),""},list(r){let s=r.ordered?"ol":"ul",o=r.ordered?"list-style:decimal":"list-style:disc";for(let l of r.items){let a=`<li>${this.parser.parse(l.tokens,!!l.loose).trimEnd()}</li>`,p=`<${s} style="${o};padding-left:1.5em">${a}</${s}>`;e.push({index:n++,innerHtml:p,text:de(a)})}return""},code(r){let s=r.lang??"",o=r.text.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),l=s?`<pre><code class="language-${s}">${o}</code></pre>`:`<pre><code>${o}</code></pre>`;return e.push({index:n++,innerHtml:l,text:r.text.trim()}),""},blockquote(r){let o=`<blockquote>${zn.parser(r.tokens)}</blockquote>`.trimEnd();return e.push({index:n++,innerHtml:o,text:de(o)}),""},heading(r){let s=this.parser.parseInline(r.tokens),o=`<h${r.depth}>${s}</h${r.depth}>`;return e.push({index:n++,innerHtml:o,text:de(o)}),""},table(r){let o=`<thead><tr>${r.header.map(d=>{let _=d.align?` align="${d.align}"`:"",g=this.parser.parseInline(d.tokens);return`<th${_}>${g}</th>`}).join("")}</tr></thead>`,u=`<tbody>${r.rows.map(d=>`<tr>${d.map(g=>{let w=g.align?` align="${g.align}"`:"",k=this.parser.parseInline(g.tokens);return`<td${w}>${k}</td>`}).join("")}</tr>`).join("")}</tbody>`,a=`<table>${o}${u}</table>`,p=r.header.map(d=>d.text).join(" | "),c=r.rows.map(d=>d.map(_=>_.text).join(" | ")),h=[p,...c].join(`
|
|
58
|
+
`);return e.push({index:n++,innerHtml:a,text:h}),""}}}),i.parse(t),e}function En(t,e,n,i){return i&&!t?"\u25C6":e?"\u25B6":n?"\u25C0":t?"\u2014":"+"}function zt({block:t,isInRange:e,isRangeStart:n,isRangeEnd:i,hasComment:r,isPendingComment:s,isHovered:o,onGutterClick:l,onMouseEnter:u,onMouseLeave:a}){let p=["line-block",o&&!e?"hovered":"",e?"in-range":"",r&&!e?"has-comment":"",s&&!e&&!r?"pending-comment":""].filter(Boolean).join(" ");return f("div",{class:p,onMouseEnter:()=>u(t.index),onMouseLeave:()=>a(),children:[f("div",{class:"line-gutter",onClick:c=>l(t.index,c.shiftKey),title:e?void 0:"Click to start selection",children:En(e,n,i,r)}),f("div",{class:"line-inner",dangerouslySetInnerHTML:{__html:t.innerHtml}})]})}function Et({section:t,mode:e,isActive:n,pendingAnchor:i,commentedLines:r,onLineComment:s,onSectionComment:o}){let l=e==="plan"?t.level===3:t.level>=2,u=e==="plan"&&t.level===3&&t.dependencies,a=Le(()=>It(t.body),[t.body]),[p,c]=P(null),[h,d]=P(null),_=(g,w)=>{if(h===null||!w)d(g);else{let k=Math.min(h,g),b=Math.max(h,g),m=a.slice(k,b+1).map(T=>T.text);s(t.id,k,b,m),d(null)}};return f("div",{id:`section-${t.id}`,class:`section-view${n?" active":""}${i===null?" being-commented":""}`,children:[f("h2",{children:t.heading}),u&&f("div",{class:"section-meta",children:[t.dependencies.dependsOn.length>0&&f("span",{children:["Depends on: ",t.dependencies.dependsOn.join(", ")]}),t.dependencies.blocks.length>0&&f("span",{children:["Blocks: ",t.dependencies.blocks.join(", ")]}),t.relatedFiles&&t.relatedFiles.length>0&&f("span",{children:["Files: ",t.relatedFiles.join(", ")]}),t.verification&&f("span",{children:["Verify: ",t.verification]})]}),h!==null&&f("div",{class:"range-start-hint",children:"Shift-click another line to select a range, or shift-click the same line to comment on it alone."}),f("div",{class:"section-body",children:a.map(g=>{let w=h!==null&&p!==null&&g.index>=Math.min(h,p)&&g.index<=Math.max(h,p),k=h!==null&&p!==null&&g.index===Math.min(h,p),b=h!==null&&p!==null&&g.index===Math.max(h,p),m=i!=null&&g.index>=i.startLine&&g.index<=i.endLine;return f(zt,{block:g,isInRange:w,isRangeStart:k,isRangeEnd:b,hasComment:r.has(g.index),isPendingComment:m,isHovered:p===g.index,onGutterClick:_,onMouseEnter:c,onMouseLeave:()=>c(null)},g.index)})}),l&&f("span",{class:"add-section-comment-link",onClick:()=>o(t.id),children:"Add comment to entire section"})]})}function _e({sectionId:t,anchor:e,onSubmit:n,onCancel:i,initialText:r=""}){let[s,o]=P(r),l=()=>{let a=s.trim();a&&(n(t,a,e),o(""))},u=e?e.startLine===e.endLine?`Commenting on line ${e.startLine+1}:`:`Commenting on lines ${e.startLine+1}\u2013${e.endLine+1}:`:"Commenting on entire section:";return f("div",{class:"comment-input",children:[f("div",{class:e?"comment-anchor-label":"comment-section-label",children:u}),e&&f("div",{class:"comment-anchor-quote",children:e.lineTexts.map((a,p)=>f("p",{children:a},p))}),f("textarea",{placeholder:"Add a comment...",value:s,onInput:a=>o(a.target.value)}),f("div",{class:"comment-input-actions",children:[f("button",{class:"add-btn",onClick:l,children:"Add"}),f("button",{class:"cancel-btn",onClick:i,children:"Cancel"})]})]})}function Bt({comment:t,onEdit:e,onDelete:n}){let[i,r]=P(!1);if(i)return f(_e,{sectionId:t.sectionId,anchor:t.anchor,initialText:t.text,onSubmit:(o,l)=>{e(l),r(!1)},onCancel:()=>r(!1)});let s=t.anchor?t.anchor.startLine===t.anchor.endLine?`Line ${t.anchor.startLine+1}`:`Lines ${t.anchor.startLine+1}\u2013${t.anchor.endLine+1}`:null;return f("div",{class:"comment-card",children:[s?f(M,{children:[f("div",{class:"comment-anchor-label",children:s}),f("div",{class:"comment-anchor-quote",children:t.anchor.lineTexts.map((o,l)=>f("p",{children:o},l))})]}):f("div",{class:"comment-section-label",children:"Entire section"}),f("div",{class:"comment-text",children:t.text}),f("div",{class:"comment-actions",children:[f("button",{onClick:()=>r(!0),children:"Edit"}),f("button",{class:"delete",onClick:n,children:"Delete"})]})]})}function Bn(t){return[...t].sort((e,n)=>{let i=e.comment.anchor?.startLine??1/0,r=n.comment.anchor?.startLine??1/0;return i-r})}function Ht({comments:t,sections:e,commentingTarget:n,onAdd:i,onEdit:r,onDelete:s,onCancelComment:o}){let l=a=>e.find(p=>p.id===a)?.heading??a,u=new Map;return t.forEach((a,p)=>{let c=u.get(a.sectionId)??[];c.push({comment:a,index:p}),u.set(a.sectionId,c)}),f("aside",{class:"comment-sidebar",children:[f("h2",{children:["Comments (",t.length,")"]}),n&&f("div",{class:"commenting-for",children:[f("h3",{children:l(n.sectionId)}),f(_e,{sectionId:n.sectionId,anchor:n.anchor,onSubmit:i,onCancel:o})]}),Array.from(u.entries()).map(([a,p])=>f("div",{class:"comment-group",children:[f("h3",{children:l(a)}),Bn(p).map(({comment:c,index:h})=>f(Bt,{comment:c,onEdit:d=>r(h,d),onDelete:()=>s(h)},h))]},a)),t.length===0&&!n&&f("p",{class:"no-comments",children:"No comments yet. Hover a line and click + to start."})]})}function Dt(){let[t,e]=P(null),[n,i]=P([]),[r,s]=P(null),[o,l]=P(null),[u,a]=P(!1),[p,c]=P(null),h=ht(!1);Re(()=>{if(!h.current&&(h.current=n.length>0||t!==null,!h.current))return;let m=setTimeout(()=>{fetch("/api/session",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n,activeSection:r})}).catch(()=>{})},500);return()=>clearTimeout(m)},[n,r]),Re(()=>{fetch("/api/doc").then(m=>m.json()).then(m=>e(m.document)).catch(m=>c(m.message))},[]);let d=m=>{s(m),document.getElementById(`section-${m}`)?.scrollIntoView({behavior:"smooth"})},_=(m,T,$)=>{i(R=>[...R,{sectionId:m,text:T,timestamp:new Date,anchor:$}]),l(null)},g=(m,T)=>{i($=>$.map((R,A)=>A===m?{...R,text:T}:R))},w=m=>{i(T=>T.filter(($,R)=>R!==m))},k=async()=>{try{(await fetch("/api/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n})})).ok&&a(!0)}catch{c("Failed to submit review")}},b=new Map;for(let m of n)if(m.anchor){let T=b.get(m.sectionId)??new Set;for(let $=m.anchor.startLine;$<=m.anchor.endLine;$++)T.add($);b.set(m.sectionId,T)}return u?f("div",{class:"submitted",children:"Review submitted. You can close this tab."}):p?f("div",{class:"loading",children:["Error: ",p]}):t?f("div",{class:"app",children:[f("header",{class:"top-bar",children:[f("h1",{children:t.title}),f("span",{class:"mode-badge",children:t.mode}),f("span",{class:"comment-count",children:[n.length," comment",n.length!==1?"s":""]}),f("button",{class:"submit-btn",onClick:k,disabled:n.length===0,children:"Submit Review"})]}),f("div",{class:"panels",children:[f(_t,{doc:t,comments:n,activeSection:r,onNavigate:d}),f("main",{class:"content-area",children:t.sections.map(m=>f(Et,{section:m,mode:t.mode,isActive:r===m.id,pendingAnchor:o?.sectionId===m.id?o.anchor??null:void 0,commentedLines:b.get(m.id)??new Set,onLineComment:(T,$,R,A)=>l({sectionId:T,anchor:{type:"lines",startLine:$,endLine:R,lineTexts:A}}),onSectionComment:T=>l({sectionId:T})},m.id))}),f(Ht,{comments:n,sections:t.sections,commentingTarget:o,onAdd:_,onEdit:g,onDelete:w,onCancelComment:()=>l(null)})]})]}):f("div",{class:"loading",children:"Loading..."})}nt(f(Dt,{}),document.getElementById("app"));})();
|