plan-review 1.0.4 → 1.1.0

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.
@@ -15,6 +15,32 @@
15
15
  --border: #2a2a4a;
16
16
  --danger: #e74c3c;
17
17
  --success: #2ecc71;
18
+
19
+ /* Mermaid node-role palette — same chroma, different hues */
20
+ --role-start: oklch(0.72 0.12 200); /* teal */
21
+ --role-process: oklch(0.72 0.05 260); /* slate */
22
+ --role-decision: oklch(0.78 0.14 75); /* amber */
23
+ --role-end: oklch(0.72 0.14 150); /* green */
24
+ --role-error: oklch(0.68 0.17 25); /* red */
25
+ --role-io: oklch(0.72 0.12 290); /* violet */
26
+
27
+ /* Mermaid sequence-actor palette — 6-hue cycle */
28
+ --actor-0: oklch(0.72 0.12 200); /* teal */
29
+ --actor-1: oklch(0.74 0.14 75); /* amber */
30
+ --actor-2: oklch(0.72 0.14 150); /* green */
31
+ --actor-3: oklch(0.72 0.12 290); /* violet */
32
+ --actor-4: oklch(0.68 0.17 25); /* red */
33
+ --actor-5: oklch(0.74 0.10 320); /* magenta */
34
+
35
+ /* Yes/No branch palette — palette-aligned default (B).
36
+ Semantic variant (A) toggles via body.yesno-semantic. */
37
+ --edge-yes: var(--accent);
38
+ --edge-no: #f59e0b;
39
+ }
40
+
41
+ body.yesno-semantic {
42
+ --edge-yes: var(--success); /* green */
43
+ --edge-no: var(--danger); /* red */
18
44
  }
19
45
 
20
46
  * { margin: 0; padding: 0; box-sizing: border-box; }
@@ -155,6 +181,134 @@ body {
155
181
  .commenting-for h3,
156
182
  .comment-group h3 { font-size: 13px; color: var(--accent); margin: 12px 0 8px; }
157
183
 
184
+ .comment-group.orphan h3 {
185
+ color: var(--text-secondary);
186
+ font-style: italic;
187
+ cursor: help;
188
+ }
189
+ .orphan-badge {
190
+ display: inline-block;
191
+ margin-right: 6px;
192
+ color: #e8a33b;
193
+ font-style: normal;
194
+ }
195
+ .orphan-suffix {
196
+ margin-left: 4px;
197
+ font-size: 11px;
198
+ color: var(--text-secondary);
199
+ text-transform: uppercase;
200
+ letter-spacing: 0.5px;
201
+ }
202
+
203
+ /* Mermaid: before the runtime replaces the <pre> with SVG it still looks like a
204
+ code block; after rendering, mermaid injects an <svg> into the same element,
205
+ so we keep styles neutral on the container and just make sure it's centered
206
+ and readable on both states. */
207
+ pre.mermaid {
208
+ background: transparent;
209
+ padding: 8px 0;
210
+ text-align: center;
211
+ white-space: pre-wrap;
212
+ word-break: break-word;
213
+ }
214
+ pre.mermaid[data-processed="true"] svg {
215
+ max-width: 100%;
216
+ height: auto;
217
+ }
218
+
219
+ /* Display math block — centered, breathing room. Inline math inherits paragraph flow. */
220
+ .math-display {
221
+ text-align: center;
222
+ overflow-x: auto;
223
+ padding: 8px 0;
224
+ }
225
+ .math-inline {
226
+ /* KaTeX injects its own styles once loaded; pre-render we just keep it inline. */
227
+ font-family: 'Latin Modern Math', 'Times New Roman', serif;
228
+ }
229
+
230
+ /* GFM admonitions: > [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION].
231
+ Left border color and title label follow GitHub's palette. */
232
+ .admonition {
233
+ border-left: 4px solid var(--accent);
234
+ padding: 8px 12px;
235
+ margin: 12px 0;
236
+ background: rgba(0, 173, 181, 0.08);
237
+ border-radius: 0 4px 4px 0;
238
+ }
239
+ .admonition .admonition-title {
240
+ font-weight: 600;
241
+ font-size: 12px;
242
+ text-transform: uppercase;
243
+ letter-spacing: 0.5px;
244
+ margin: 0 0 6px;
245
+ color: var(--accent);
246
+ }
247
+ .admonition-note { border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
248
+ .admonition-note .admonition-title { color: #3b82f6; }
249
+ .admonition-tip { border-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
250
+ .admonition-tip .admonition-title { color: #22c55e; }
251
+ .admonition-important { border-color: #a855f7; background: rgba(168, 85, 247, 0.08); }
252
+ .admonition-important .admonition-title { color: #a855f7; }
253
+ .admonition-warning { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
254
+ .admonition-warning .admonition-title { color: #f59e0b; }
255
+ .admonition-caution { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
256
+ .admonition-caution .admonition-title { color: #ef4444; }
257
+
258
+ /* Inline HTML that browsers ship with light-theme defaults — rebase for dark. */
259
+ kbd {
260
+ display: inline-block;
261
+ padding: 1px 6px;
262
+ font-family: 'Menlo', 'Monaco', monospace;
263
+ font-size: 11px;
264
+ line-height: 1.4;
265
+ color: var(--text-primary);
266
+ background: var(--bg-primary);
267
+ border: 1px solid var(--border);
268
+ border-bottom-width: 2px;
269
+ border-radius: 4px;
270
+ vertical-align: middle;
271
+ }
272
+ sub, sup { font-size: 0.75em; line-height: 0; }
273
+
274
+ /* <details>/<summary>: browsers handle open/close natively; just make it look on-theme. */
275
+ details {
276
+ border: 1px solid var(--border);
277
+ border-radius: 4px;
278
+ padding: 4px 10px;
279
+ margin: 8px 0;
280
+ }
281
+ details summary {
282
+ cursor: pointer;
283
+ font-weight: 500;
284
+ color: var(--accent);
285
+ }
286
+ details[open] summary { margin-bottom: 6px; }
287
+
288
+ /* GFM footnotes — marked-footnote emits <section class="footnotes">. */
289
+ section.footnotes {
290
+ margin-top: 24px;
291
+ padding-top: 12px;
292
+ border-top: 1px solid var(--border);
293
+ font-size: 12px;
294
+ color: var(--text-secondary);
295
+ }
296
+ section.footnotes ol { padding-left: 20px; list-style: decimal; }
297
+ section.footnotes li { margin-bottom: 4px; }
298
+ section.footnotes p { margin: 0; display: inline; }
299
+
300
+ /* Inline footnote references: <sup><a data-footnote-ref ...>N</a></sup>.
301
+ Default <a> color is too dim on the dark bg — bump to accent so the
302
+ reference marker actually reads. */
303
+ .line-inner sup > a[data-footnote-ref],
304
+ section.footnotes a[data-footnote-backref] {
305
+ color: var(--accent);
306
+ text-decoration: none;
307
+ padding: 0 2px;
308
+ }
309
+ .line-inner sup > a[data-footnote-ref]:hover,
310
+ section.footnotes a[data-footnote-backref]:hover { text-decoration: underline; }
311
+
158
312
  .comment-card {
159
313
  padding: 10px;
160
314
  margin-bottom: 8px;
@@ -293,8 +447,38 @@ body {
293
447
  .line-inner p { margin: 0; }
294
448
  .line-inner pre { background: var(--bg-secondary); padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
295
449
  .line-inner code { background: var(--bg-secondary); padding: 2px 6px; border-radius: 3px; font-size: 13px; }
296
- .line-inner ul { list-style: disc; }
297
- .line-inner ol { list-style: decimal; }
450
+
451
+ /* Inline links: browser default (rgb(0, 0, 238)) is too saturated on the dark
452
+ background. Use a muted teal in line with the rest of the palette. */
453
+ .line-inner a {
454
+ color: #66c4ca;
455
+ text-decoration: underline;
456
+ text-underline-offset: 2px;
457
+ }
458
+ .line-inner a:hover { color: var(--accent-hover); }
459
+
460
+ /* Lists: the `* { padding: 0 }` reset at the top of this file wipes the
461
+ browser default padding that gives bullets room to sit to the left of the
462
+ text, so we re-add padding explicitly. Nested lists need their own padding
463
+ too — otherwise sub-items render flush with the parent bullet and visually
464
+ "flatten" into a single column. */
465
+ .line-inner ul { list-style: disc; padding-left: 1.5em; margin: 0; }
466
+ .line-inner ol { list-style: decimal; padding-left: 1.5em; margin: 0; }
467
+ .line-inner ul ul { list-style: circle; }
468
+ .line-inner ul ul ul { list-style: square; }
469
+ .line-inner li { margin: 2px 0; }
470
+
471
+ /* GFM task-list items. marked's list tokenizer wraps loose items' bodies in
472
+ <p>, which default-displays block and stacks the checkbox above the label.
473
+ Pull the <p> back inline and strip the bullet. (The .task-list-item class
474
+ only lives on top-level items; nested task items come out of plain marked
475
+ with an <input> directly in the <li>, targeted via the second selector.) */
476
+ .line-inner li.task-list-item,
477
+ .line-inner li:has(> input[type="checkbox"]) {
478
+ list-style: none;
479
+ }
480
+ .line-inner li.task-list-item > p { display: inline; margin: 0; }
481
+ .line-inner li input[type="checkbox"] { margin-right: 6px; vertical-align: middle; }
298
482
  .line-inner blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--text-secondary); margin: 0; }
299
483
  .line-inner h3, .line-inner h4 { font-size: 14px; margin: 4px 0; }
300
484
  .line-inner table { width: 100%; border-collapse: collapse; margin: 4px 0; font-size: 13px; }
@@ -353,68 +537,202 @@ body {
353
537
  letter-spacing: 0.03em;
354
538
  margin-bottom: 6px;
355
539
  }
540
+
541
+ /* ── Mermaid node coloring ──────────────────────────────────
542
+ Mermaid renders each node as <g class="node"> with an inner
543
+ rect/polygon/path. We tag the <g> with data-role (set by
544
+ applyRoles in mermaid.ts) and paint via !important because
545
+ mermaid's theme system injects inline fill/stroke styles. */
546
+
547
+ pre.mermaid[data-processed="true"] g.node[data-role="start"] > * { fill: color-mix(in srgb, var(--role-start) 20%, var(--bg-primary)) !important; stroke: var(--role-start) !important; }
548
+ pre.mermaid[data-processed="true"] g.node[data-role="process"] > * { fill: color-mix(in srgb, var(--role-process) 18%, var(--bg-primary)) !important; stroke: var(--role-process) !important; }
549
+ pre.mermaid[data-processed="true"] g.node[data-role="decision"] > * { fill: color-mix(in srgb, var(--role-decision) 22%, var(--bg-primary)) !important; stroke: var(--role-decision) !important; stroke-width: 2px !important; }
550
+ pre.mermaid[data-processed="true"] g.node[data-role="end"] > * { fill: color-mix(in srgb, var(--role-end) 20%, var(--bg-primary)) !important; stroke: var(--role-end) !important; }
551
+ pre.mermaid[data-processed="true"] g.node[data-role="error"] > * { fill: color-mix(in srgb, var(--role-error) 20%, var(--bg-primary)) !important; stroke: var(--role-error) !important; }
552
+ pre.mermaid[data-processed="true"] g.node[data-role="io"] > * { fill: color-mix(in srgb, var(--role-io) 20%, var(--bg-primary)) !important; stroke: var(--role-io) !important; }
553
+
554
+ /* Node labels — mermaid may inject white/black fills on foreignObject spans */
555
+ pre.mermaid[data-processed="true"] g.node foreignObject span,
556
+ pre.mermaid[data-processed="true"] g.node text { color: var(--text-primary) !important; fill: var(--text-primary) !important; font-weight: 500 !important; }
557
+ pre.mermaid[data-processed="true"] g.node[data-role="decision"] foreignObject span,
558
+ pre.mermaid[data-processed="true"] g.node[data-role="decision"] text { color: var(--role-decision) !important; fill: var(--role-decision) !important; font-weight: 600 !important; }
559
+
560
+ /* Sequence actors — 6-hue cycle, lifeline matches actor hue */
561
+ pre.mermaid[data-processed="true"] rect.actor[data-actor-idx="0"], pre.mermaid[data-processed="true"] g.actor[data-actor-idx="0"] rect { fill: color-mix(in srgb, var(--actor-0) 22%, var(--bg-primary)) !important; stroke: var(--actor-0) !important; stroke-width: 2px !important; }
562
+ pre.mermaid[data-processed="true"] rect.actor[data-actor-idx="1"], pre.mermaid[data-processed="true"] g.actor[data-actor-idx="1"] rect { fill: color-mix(in srgb, var(--actor-1) 22%, var(--bg-primary)) !important; stroke: var(--actor-1) !important; stroke-width: 2px !important; }
563
+ pre.mermaid[data-processed="true"] rect.actor[data-actor-idx="2"], pre.mermaid[data-processed="true"] g.actor[data-actor-idx="2"] rect { fill: color-mix(in srgb, var(--actor-2) 22%, var(--bg-primary)) !important; stroke: var(--actor-2) !important; stroke-width: 2px !important; }
564
+ pre.mermaid[data-processed="true"] rect.actor[data-actor-idx="3"], pre.mermaid[data-processed="true"] g.actor[data-actor-idx="3"] rect { fill: color-mix(in srgb, var(--actor-3) 22%, var(--bg-primary)) !important; stroke: var(--actor-3) !important; stroke-width: 2px !important; }
565
+ pre.mermaid[data-processed="true"] rect.actor[data-actor-idx="4"], pre.mermaid[data-processed="true"] g.actor[data-actor-idx="4"] rect { fill: color-mix(in srgb, var(--actor-4) 22%, var(--bg-primary)) !important; stroke: var(--actor-4) !important; stroke-width: 2px !important; }
566
+ pre.mermaid[data-processed="true"] rect.actor[data-actor-idx="5"], pre.mermaid[data-processed="true"] g.actor[data-actor-idx="5"] rect { fill: color-mix(in srgb, var(--actor-5) 22%, var(--bg-primary)) !important; stroke: var(--actor-5) !important; stroke-width: 2px !important; }
567
+
568
+ pre.mermaid[data-processed="true"] line.actor-line[data-actor-idx="0"] { stroke: var(--actor-0) !important; stroke-opacity: 0.45; stroke-width: 1.5px !important; }
569
+ pre.mermaid[data-processed="true"] line.actor-line[data-actor-idx="1"] { stroke: var(--actor-1) !important; stroke-opacity: 0.45; stroke-width: 1.5px !important; }
570
+ pre.mermaid[data-processed="true"] line.actor-line[data-actor-idx="2"] { stroke: var(--actor-2) !important; stroke-opacity: 0.45; stroke-width: 1.5px !important; }
571
+ pre.mermaid[data-processed="true"] line.actor-line[data-actor-idx="3"] { stroke: var(--actor-3) !important; stroke-opacity: 0.45; stroke-width: 1.5px !important; }
572
+ pre.mermaid[data-processed="true"] line.actor-line[data-actor-idx="4"] { stroke: var(--actor-4) !important; stroke-opacity: 0.45; stroke-width: 1.5px !important; }
573
+ pre.mermaid[data-processed="true"] line.actor-line[data-actor-idx="5"] { stroke: var(--actor-5) !important; stroke-opacity: 0.45; stroke-width: 1.5px !important; }
574
+
575
+ pre.mermaid[data-processed="true"] text.actor,
576
+ pre.mermaid[data-processed="true"] g.actor text,
577
+ pre.mermaid[data-processed="true"] g.actor foreignObject span {
578
+ fill: var(--text-primary) !important;
579
+ color: var(--text-primary) !important;
580
+ font-weight: 600 !important;
581
+ }
582
+
583
+ /* Yes/No branch edges — lines + arrowheads + label chips */
584
+ pre.mermaid[data-processed="true"] path.edge-yes,
585
+ pre.mermaid[data-processed="true"] .edge-yes path.flowchart-link,
586
+ pre.mermaid[data-processed="true"] .edge-yes .path,
587
+ pre.mermaid[data-processed="true"] g.edge-yes > path {
588
+ stroke: var(--edge-yes) !important;
589
+ stroke-width: 2.5px !important;
590
+ stroke-dasharray: none !important;
591
+ fill: none !important;
592
+ }
593
+ pre.mermaid[data-processed="true"] path.edge-no,
594
+ pre.mermaid[data-processed="true"] .edge-no path.flowchart-link,
595
+ pre.mermaid[data-processed="true"] .edge-no .path,
596
+ pre.mermaid[data-processed="true"] g.edge-no > path {
597
+ stroke: var(--edge-no) !important;
598
+ stroke-width: 2.5px !important;
599
+ stroke-dasharray: 6 4 !important;
600
+ fill: none !important;
601
+ }
602
+
603
+ pre.mermaid[data-processed="true"] g.edge-yes marker path { fill: var(--edge-yes) !important; stroke: var(--edge-yes) !important; }
604
+ pre.mermaid[data-processed="true"] g.edge-no marker path { fill: var(--edge-no) !important; stroke: var(--edge-no) !important; }
605
+
606
+ /* Branch-label chips — render as compact circular badges with just the
607
+ glyph. Original "Yes"/"No" text is hidden (font-size: 0); the icon is
608
+ restored at normal size via ::before. Background rect is transparent so
609
+ only the round span shows. */
610
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-yes-label rect,
611
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-no-label rect {
612
+ fill: transparent !important;
613
+ }
614
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-yes-label foreignObject div,
615
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-no-label foreignObject div {
616
+ background: transparent !important;
617
+ }
618
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-yes-label foreignObject span,
619
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-no-label foreignObject span {
620
+ display: inline-flex !important;
621
+ align-items: center !important;
622
+ justify-content: center !important;
623
+ width: 20px !important;
624
+ height: 20px !important;
625
+ border-radius: 50% !important;
626
+ padding: 0 !important;
627
+ font-size: 0 !important;
628
+ font-weight: 700 !important;
629
+ color: var(--bg-primary) !important;
630
+ line-height: 1 !important;
631
+ box-shadow: 0 0 0 2px var(--bg-primary) !important;
632
+ }
633
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-yes-label foreignObject span {
634
+ background: var(--edge-yes) !important;
635
+ }
636
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-no-label foreignObject span {
637
+ background: var(--edge-no) !important;
638
+ }
639
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-yes-label foreignObject span::before,
640
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-no-label foreignObject span::before {
641
+ font-size: 12px !important;
642
+ line-height: 1 !important;
643
+ }
644
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-yes-label foreignObject span::before {
645
+ content: "✓";
646
+ }
647
+ pre.mermaid[data-processed="true"] g.edgeLabel.edge-no-label foreignObject span::before {
648
+ content: "✗";
649
+ }
356
650
  </style>
357
651
  </head>
358
652
  <body>
359
653
  <div id="app"></div>
360
654
  <script>/* bundled with preact */
361
- "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&&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} *[^
362
- ]`).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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},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(`
363
- `).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(`
364
- `)}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,`
365
- `)}}}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],`
366
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Z(e[0],`
655
+ "use strict";(()=>{var le,y,Xe,Wt,q,We,Je,Ye,xe,ne,W,et,$e,ve,we,Vt,se={},oe=[],Kt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ce=Array.isArray;function B(t,e){for(var n in e)t[n]=e[n];return t}function Se(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Qt(t,e,n){var i,r,s,a={};for(s in e)s=="key"?i=e[s]:s=="ref"?r=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?le.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return re(t,a,i,r,null)}function re(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??++Xe,__i:-1,__u:0};return r==null&&y.vnode!=null&&y.vnode(s),s}function D(t){return t.children}function ie(t,e){this.props=t,this.context=e}function F(t,e){if(e==null)return t.__?F(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"?F(t):null}function Xt(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],s=B({},e);s.__v=e.__v+1,y.vnode&&y.vnode(s),Te(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??F(e),!!(32&e.__u),r),s.__v=e.__v,s.__.__k[s.__i]=s,it(i,s,r),e.__e=e.__=null,s.__e!=n&&tt(s)}}function tt(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}),tt(t)}function Ve(t){(!t.__d&&(t.__d=!0)&&q.push(t)&&!ae.__r++||We!=y.debounceRendering)&&((We=y.debounceRendering)||Je)(ae)}function ae(){try{for(var t,e=1;q.length;)q.length>e&&q.sort(Ye),t=q.shift(),e=q.length,Xt(t)}finally{q.length=ae.__r=0}}function nt(t,e,n,i,r,s,a,o,c,l,p){var u,h,d,m,g,x,b,k=i&&i.__k||oe,_=e.length;for(c=Jt(n,e,k,c,_),u=0;u<_;u++)(d=n.__k[u])!=null&&(h=d.__i!=-1&&k[d.__i]||se,d.__i=u,x=Te(t,d,h,r,s,a,o,c,l,p),m=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&Ce(h.ref,null,d),p.push(d.ref,d.__c||m,d)),g==null&&m!=null&&(g=m),(b=!!(4&d.__u))||h.__k===d.__k?(c=rt(d,c,t,b),b&&h.__e&&(h.__e=null)):typeof d.type=="function"&&x!==void 0?c=x:m&&(c=m.nextSibling),d.__u&=-7);return n.__e=g,c}function Jt(t,e,n,i,r){var s,a,o,c,l,p=n.length,u=p,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(a=e[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=t.__k[s]=re(null,a,null,null,null):ce(a)?a=t.__k[s]=re(D,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=t.__k[s]=re(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,c=s+h,a.__=t,a.__b=t.__b+1,o=null,(l=a.__i=Yt(a,n,c,u))!=-1&&(u--,(o=n[l])&&(o.__u|=2)),o==null||o.__v==null?(l==-1&&(r>p?h--:r<p&&h++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,a.__u|=4))):t.__k[s]=null;if(u)for(s=0;s<p;s++)(o=n[s])!=null&&(2&o.__u)==0&&(o.__e==i&&(i=F(o)),ot(o,o));return i}function rt(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=rt(r[s],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=F(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Yt(t,e,n,i){var r,s,a,o=t.key,c=t.type,l=e[n],p=l!=null&&(2&l.__u)==0;if(l===null&&o==null||p&&o==l.key&&c==l.type)return n;if(i>(p?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((l=e[a=r>=0?r--:s++])!=null&&(2&l.__u)==0&&o==l.key&&c==l.type)return a}return-1}function Ke(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Kt.test(e)?n:n+"px"}function te(t,e,n,i,r){var s,a;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||Ke(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Ke(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(et,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n[W]=i[W]:(n[W]=$e,t.addEventListener(e,s?we:ve,s)):t.removeEventListener(e,s?we:ve,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 Qe(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[ne]==null)e[ne]=$e++;else if(e[ne]<n[W])return;return n(y.event?y.event(e):e)}}}function Te(t,e,n,i,r,s,a,o,c,l){var p,u,h,d,m,g,x,b,k,_,v,S,C,R,I,P=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),s=[o=e.__e=n.__e]),(p=y.__b)&&p(e);e:if(typeof P=="function")try{if(b=e.props,k=P.prototype&&P.prototype.render,_=(p=P.contextType)&&i[p.__c],v=p?_?_.props.value:p.__:i,n.__c?x=(u=e.__c=n.__c).__=u.__E:(k?e.__c=u=new P(b,v):(e.__c=u=new ie(b,v),u.constructor=P,u.render=tn),_&&_.sub(u),u.state||(u.state={}),u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),k&&u.__s==null&&(u.__s=u.state),k&&P.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=B({},u.__s)),B(u.__s,P.getDerivedStateFromProps(b,u.__s))),d=u.props,m=u.state,u.__v=e,h)k&&P.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),k&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(k&&P.getDerivedStateFromProps==null&&b!==d&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,v),e.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,v)===!1){e.__v!=n.__v&&(u.props=b,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(Z){Z&&(Z.__=e)}),oe.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&a.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,v),k&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(d,m,g)})}if(u.context=v,u.props=b,u.__P=t,u.__e=!1,S=y.__r,C=0,k)u.state=u.__s,u.__d=!1,S&&S(e),p=u.render(u.props,u.state,u.context),oe.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,S&&S(e),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++C<25);u.state=u.__s,u.getChildContext!=null&&(i=B(B({},i),u.getChildContext())),k&&!h&&u.getSnapshotBeforeUpdate!=null&&(g=u.getSnapshotBeforeUpdate(d,m)),R=p!=null&&p.type===D&&p.key==null?st(p.props.children):p,o=nt(t,ce(R)?R:[R],e,n,i,r,s,a,o,c,l),u.base=e.__e,e.__u&=-161,u.__h.length&&a.push(u),x&&(u.__E=u.__=null)}catch(Z){if(e.__v=null,c||s!=null)if(Z.then){for(e.__u|=c?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;s[s.indexOf(o)]=null,e.__e=o}else{for(I=s.length;I--;)Se(s[I]);ye(e)}else e.__e=n.__e,e.__k=n.__k,Z.then||ye(e);y.__e(Z,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):o=e.__e=en(n.__e,e,n,i,r,s,a,c,l);return(p=y.diffed)&&p(e),128&e.__u?void 0:o}function ye(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ye))}function it(t,e,n){for(var i=0;i<n.length;i++)Ce(n[i],n[++i],n[++i]);y.__c&&y.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){y.__e(s,r.__v)}})}function st(t){return typeof t!="object"||t==null||t.__b>0?t:ce(t)?t.map(st):B({},t)}function en(t,e,n,i,r,s,a,o,c){var l,p,u,h,d,m,g,x=n.props||se,b=e.props,k=e.type;if(k=="svg"?r="http://www.w3.org/2000/svg":k=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((d=s[l])&&"setAttribute"in d==!!k&&(k?d.localName==k:d.nodeType==3)){t=d,s[l]=null;break}}if(t==null){if(k==null)return document.createTextNode(b);t=document.createElementNS(r,k,b.is&&b),o&&(y.__m&&y.__m(e,s),o=!1),s=null}if(k==null)x===b||o&&t.data==b||(t.data=b);else{if(s=s&&le.call(t.childNodes),!o&&s!=null)for(x={},l=0;l<t.attributes.length;l++)x[(d=t.attributes[l]).name]=d.value;for(l in x)d=x[l],l=="dangerouslySetInnerHTML"?u=d:l=="children"||l in b||l=="value"&&"defaultValue"in b||l=="checked"&&"defaultChecked"in b||te(t,l,null,d,r);for(l in b)d=b[l],l=="children"?h=d:l=="dangerouslySetInnerHTML"?p=d:l=="value"?m=d:l=="checked"?g=d:o&&typeof d!="function"||x[l]===d||te(t,l,d,x[l],r);if(p)o||u&&(p.__html==u.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(u&&(t.innerHTML=""),nt(e.type=="template"?t.content:t,ce(h)?h:[h],e,n,i,k=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,a,s?s[0]:n.__k&&F(n,0),o,c),s!=null)for(l=s.length;l--;)Se(s[l]);o||(l="value",k=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[l]||k=="progress"&&!m||k=="option"&&m!=x[l])&&te(t,l,m,x[l],r),l="checked",g!=null&&g!=t[l]&&te(t,l,g,x[l],r))}return t}function Ce(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){y.__e(r,n)}}function ot(t,e,n){var i,r;if(y.unmount&&y.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ce(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){y.__e(s,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&ot(i[r],e,n||typeof t.type!="function");n||Se(t.__e),t.__c=t.__=t.__e=void 0}function tn(t,e,n){return this.constructor(t,n)}function at(t,e,n){var i,r,s,a;e==document&&(e=document.documentElement),y.__&&y.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,s=[],a=[],Te(e,t=(!i&&n||e).__k=Qt(D,null,[t]),r||se,se,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?le.call(e.childNodes):null,s,!i&&n?n:r?r.__e:e.firstChild,i,a),it(s,t,a)}le=oe.slice,y={__e:function(t,e,n,i){for(var r,s,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(o){t=o}throw t}},Xe=0,Wt=function(t){return t!=null&&t.constructor===void 0},ie.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=B({},this.state),typeof t=="function"&&(t=t(B({},n),this.props)),t&&B(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Ve(this))},ie.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ve(this))},ie.prototype.render=D,q=[],Je=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ye=function(t,e){return t.__v.__b-e.__v.__b},ae.__r=0,xe=Math.random().toString(8),ne="__d"+xe,W="__a"+xe,et=/(PointerCapture)$|Capture$/i,$e=0,ve=Qe(!1),we=Qe(!0),Vt=0;var V,T,Re,lt,pe=0,_t=[],L=y,ct=L.__b,ut=L.__r,pt=L.diffed,ht=L.__c,dt=L.unmount,ft=L.__;function Ae(t,e){L.__h&&L.__h(T,t,pe||e),pe=0;var n=T.__H||(T.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function E(t){return pe=1,nn(bt,t)}function nn(t,e,n){var i=Ae(V++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):bt(void 0,e),function(o){var c=i.__N?i.__N[0]:i.__[0],l=i.t(c,o);c!==l&&(i.__N=[l,i.__[1]],i.__c.setState({}))}],i.__c=T,!T.__f)){var r=function(o,c,l){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,o,c,l);var u=i.__c.props!==o;return p.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(u=!0)}}),s&&s.call(this,o,c,l)||u};T.__f=!0;var s=T.shouldComponentUpdate,a=T.componentWillUpdate;T.componentWillUpdate=function(o,c,l){if(this.__e){var p=s;s=void 0,r(o,c,l),s=p}a&&a.call(this,o,c,l)},T.shouldComponentUpdate=r}return i.__N||i.__}function K(t,e){var n=Ae(V++,3);!L.__s&&kt(n.__H,e)&&(n.__=t,n.u=e,T.__H.__h.push(n))}function gt(t){return pe=5,Ee(function(){return{current:t}},[])}function Ee(t,e){var n=Ae(V++,7);return kt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function rn(){for(var t;t=_t.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ue),e.__h.some(Le),e.__h=[]}catch(n){e.__h=[],L.__e(n,t.__v)}}}L.__b=function(t){T=null,ct&&ct(t)},L.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ft&&ft(t,e)},L.__r=function(t){ut&&ut(t),V=0;var e=(T=t.__c).__H;e&&(Re===T?(e.__h=[],T.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(ue),e.__h.some(Le),e.__h=[],V=0)),Re=T},L.diffed=function(t){pt&&pt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(_t.push(e)!==1&&lt===L.requestAnimationFrame||((lt=L.requestAnimationFrame)||sn)(rn)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Re=T=null},L.__c=function(t,e){e.some(function(n){try{n.__h.some(ue),n.__h=n.__h.filter(function(i){return!i.__||Le(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],L.__e(i,n.__v)}}),ht&&ht(t,e)},L.unmount=function(t){dt&&dt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(i){try{ue(i)}catch(r){e=r}}),n.__H=void 0,e&&L.__e(e,n.__v))};var mt=typeof requestAnimationFrame=="function";function sn(t){var e,n=function(){clearTimeout(i),mt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);mt&&(e=requestAnimationFrame(n))}function ue(t){var e=T,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),T=e}function Le(t){var e=T;t.__c=t.__(),T=e}function kt(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function bt(t,e){return typeof e=="function"?e(t):e}var on=0;function f(t,e,n,i,r,s){e||(e={});var a,o,c=e;if("ref"in c)for(o in c={},e)o=="ref"?a=e[o]:c[o]=e[o];var l={type:t,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--on,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(a=t.defaultProps))for(o in a)c[o]===void 0&&(c[o]=a[o]);return y.vnode&&y.vnode(l),l}function xt({doc:t,comments:e,activeSection:n,onNavigate:i}){let r=new Set(e.map(a=>a.sectionId));if(t.mode==="plan"){let a=t.sections.filter(o=>o.level===2);return f("nav",{class:"toc-panel",children:a.map(o=>{let c=t.sections.filter(l=>l.parent===o.id);return f("div",{class:"toc-milestone",children:[f("h3",{children:o.heading}),f("ul",{children:c.map(l=>f("li",{class:`toc-item${n===l.id?" active":""}${r.has(l.id)?" commented":""}`,onClick:()=>i(l.id),children:[f("span",{class:"toc-marker",children:r.has(l.id)?"\u2713":"\xA0"}),f("span",{class:"toc-id",children:l.id}),f("span",{class:"toc-heading",children:l.heading})]},l.id))})]},o.id)})})}let s=t.sections.filter(a=>a.level>=2);return f("nav",{class:"toc-panel",children:f("ul",{children:s.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-heading",children:a.heading})]},a.id))})})}function Be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var j=Be();function Tt(t){j=t}var J={exec:()=>null};function w(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(A.caret,"$1"),n=n.replace(r,a),i},getRegex:()=>new RegExp(n,e)};return i}var A={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")},an=/^(?:[ \t]*(?:\n|$))+/,ln=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Y=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,un=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Me=/(?:[*+-]|\d{1,9}[.)])/,Ct=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rt=w(Ct).replace(/bull/g,Me).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(),pn=w(Ct).replace(/bull/g,Me).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(),He=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hn=/^[^\n]+/,qe=/(?!\s*\])(?:\\.|[^\[\]\\])+/,dn=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fn=w(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Me).getRegex(),ge="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]*?(?:-->|$))/,mn=w("^ {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",ge).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lt=w(He).replace("hr",Y).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",ge).getRegex(),_n=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Lt).getRegex(),Ne={blockquote:_n,code:ln,def:dn,fences:cn,heading:un,hr:Y,html:mn,lheading:Rt,list:fn,newline:an,paragraph:Lt,table:J,text:hn},vt=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Y).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",ge).getRegex(),gn={...Ne,lheading:pn,table:vt,paragraph:w(He).replace("hr",Y).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vt).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",ge).getRegex()},kn={...Ne,html:w(`^ *(?: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:J,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(He).replace("hr",Y).replace("heading",` *#{1,6} *[^
656
+ ]`).replace("lheading",Rt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,At=/^( {2,}|\\)\n(?!\s*$)/,vn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ke=/[\p{P}\p{S}]/u,Oe=/[\s\p{P}\p{S}]/u,Et=/[^\s\p{P}\p{S}]/u,wn=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Oe).getRegex(),Pt=/(?!~)[\p{P}\p{S}]/u,yn=/(?!~)[\s\p{P}\p{S}]/u,$n=/(?:[^\s\p{P}\p{S}]|~)/u,Sn=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,It=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Tn=w(It,"u").replace(/punct/g,ke).getRegex(),Cn=w(It,"u").replace(/punct/g,Pt).getRegex(),zt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rn=w(zt,"gu").replace(/notPunctSpace/g,Et).replace(/punctSpace/g,Oe).replace(/punct/g,ke).getRegex(),Ln=w(zt,"gu").replace(/notPunctSpace/g,$n).replace(/punctSpace/g,yn).replace(/punct/g,Pt).getRegex(),An=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Et).replace(/punctSpace/g,Oe).replace(/punct/g,ke).getRegex(),En=w(/\\(punct)/,"gu").replace(/punct/g,ke).getRegex(),Pn=w(/^<(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(),In=w(De).replace("(?:-->|$)","-->").getRegex(),zn=w("^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",In).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),fe=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Bn=w(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",fe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bt=w(/^!?\[(label)\]\[(ref)\]/).replace("label",fe).replace("ref",qe).getRegex(),Mt=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",qe).getRegex(),Mn=w("reflink|nolink(?!\\()","g").replace("reflink",Bt).replace("nolink",Mt).getRegex(),je={_backpedal:J,anyPunctuation:En,autolink:Pn,blockSkip:Sn,br:At,code:xn,del:J,emStrongLDelim:Tn,emStrongRDelimAst:Rn,emStrongRDelimUnd:An,escape:bn,link:Bn,nolink:Mt,punctuation:wn,reflink:Bt,reflinkSearch:Mn,tag:zn,text:vn,url:J},Hn={...je,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",fe).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fe).getRegex()},Pe={...je,emStrongRDelimAst:Ln,emStrongLDelim:Cn,url:w(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},qn={...Pe,br:w(At).replace("{2,}","*").getRegex(),text:w(Pe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},he={normal:Ne,gfm:gn,pedantic:kn},Q={normal:je,gfm:Pe,breaks:qn,pedantic:Hn},Dn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wt=t=>Dn[t];function z(t,e){if(e){if(A.escapeTest.test(t))return t.replace(A.escapeReplace,wt)}else if(A.escapeTestNoEncode.test(t))return t.replace(A.escapeReplaceNoEncode,wt);return t}function yt(t){try{t=encodeURI(t).replace(A.percentDecode,"%")}catch{return null}return t}function $t(t,e){let n=t.replace(A.findPipe,(s,a,o)=>{let c=!1,l=a;for(;--l>=0&&o[l]==="\\";)c=!c;return c?"|":" |"}),i=n.split(A.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(A.slashPipe,"|");return i}function X(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 Nn(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 St(t,e,n,i,r){let s=e.href,a=e.title||null,o=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,c}function On(t,e,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
657
+ `).map(s=>{let a=s.match(n.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=r.length?s.slice(r.length):s}).join(`
658
+ `)}var me=class{options;rules;lexer;constructor(t){this.options=t||j}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:X(n,`
659
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=On(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=X(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:X(e[0],`
660
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=X(e[0],`
367
661
  `).split(`
368
- `),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(`
369
- `),p=a.replace(this.rules.other.blockquoteSetextReplace,`
662
+ `),i="",r="",s=[];for(;n.length>0;){let a=!1,o=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))o.push(n[c]),a=!0;else if(!a)o.push(n[c]);else break;n=n.slice(c);let l=o.join(`
663
+ `),p=l.replace(this.rules.other.blockquoteSetextReplace,`
370
664
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
371
- ${a}`:a,r=r?`${r}
372
- ${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+`
665
+ ${l}`:l,r=r?`${r}
666
+ ${p}`:p;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=u,n.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let d=h,m=d.raw+`
373
667
  `+n.join(`
374
- `),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+`
668
+ `),g=this.blockquote(m);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,m=d.raw+`
375
669
  `+n.join(`
376
- `),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(`
377
- `);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(`
378
- `,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),h=t.split(`
379
- `,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+`
380
- `,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(`
381
- `,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+=`
382
- `+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+=`
383
- `+h}!d&&!h.trim()&&(d=!0),a+=R+`
384
- `,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(`
385
- `):[],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)===`
386
- `?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,`
387
- `),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+=`
388
- `: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+=`
389
- `+r.raw,o.text+=`
390
- `+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+=`
391
- `+r.raw,o.text+=`
392
- `+r.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(a=>{u=a.call({lexer:this},l),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let o=n.at(-1);i&&o?.type==="paragraph"?(o.raw+=`
393
- `+r.raw,o.text+=`
394
- `+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+=`
395
- `+r.raw,o.text+=`
396
- `+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,"")+`
670
+ `),g=this.list(m);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=m.substring(s.at(-1).raw.length).split(`
671
+ `);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),a=!1;for(;t;){let c=!1,l="",p="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let u=e[2].split(`
672
+ `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),h=t.split(`
673
+ `,1)[0],d=!u.trim(),m=0;if(this.options.pedantic?(m=2,p=u.trimStart()):d?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,p=u.slice(m),m+=e[1].length),d&&this.rules.other.blankLine.test(h)&&(l+=h+`
674
+ `,t=t.substring(h.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),_=this.rules.other.fencesBeginRegex(m),v=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m);for(;t;){let C=t.split(`
675
+ `,1)[0],R;if(h=C,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),R=h):R=h.replace(this.rules.other.tabCharGlobal," "),_.test(h)||v.test(h)||S.test(h)||b.test(h)||k.test(h))break;if(R.search(this.rules.other.nonSpaceChar)>=m||!h.trim())p+=`
676
+ `+R.slice(m);else{if(d||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(u)||v.test(u)||k.test(u))break;p+=`
677
+ `+h}!d&&!h.trim()&&(d=!0),l+=C+`
678
+ `,t=t.substring(C.length+1),u=R.slice(m)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(a=!0));let g=null,x;this.options.gfm&&(g=this.rules.other.listIsTask.exec(p),g&&(x=g[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:l,task:!!g,checked:x,loose:!1,text:p,tokens:[]}),r.raw+=l}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){let l=r.items[c].tokens.filter(u=>u.type==="space"),p=l.length>0&&l.some(u=>this.rules.other.anyLine.test(u.raw));r.loose=p}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].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=$t(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
679
+ `):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of r)s.rows.push($t(a,s.header.length).map((o,c)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[c]})));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)===`
680
+ `?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=X(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Nn(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).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)),St(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 St(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,a,o,c=s,l=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(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){c+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+l);let u=[...i[0]][0].length,h=t.slice(0,s+i.index+u+o);if(Math.min(s,o)%2){let m=h.slice(1,-1);return{type:"em",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}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}}}},M=class Ie{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||j,this.options.tokenizer=this.options.tokenizer||new me,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:A,block:he.normal,inline:Q.normal};this.options.pedantic?(n.block=he.pedantic,n.inline=Q.pedantic):this.options.gfm&&(n.block=he.gfm,this.options.breaks?n.inline=Q.breaks:n.inline=Q.gfm),this.tokenizer.rules=n}static get rules(){return{block:he,inline:Q}}static lex(e,n){return new Ie(n).lex(e)}static lexInline(e,n){return new Ie(n).inlineTokens(e)}lex(e){e=e.replace(A.carriageReturn,`
681
+ `),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(A.tabCharGlobal," ").replace(A.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(a=>(r=a.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 a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
682
+ `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
683
+ `+r.raw,a.text+=`
684
+ `+r.text,this.inlineQueue.at(-1).src=a.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 a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
685
+ `+r.raw,a.text+=`
686
+ `+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),c;this.options.extensions.startBlock.forEach(l=>{c=l.call({lexer:this},o),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let a=n.at(-1);i&&a?.type==="paragraph"?(a.raw+=`
687
+ `+r.raw,a.text+=`
688
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.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 a=n.at(-1);a?.type==="text"?(a.raw+=`
689
+ `+r.raw,a.text+=`
690
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);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 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 o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)o.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,a="";for(;e;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(l=>(o=l.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let l=n.at(-1);o.type==="text"&&l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,i,a)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let l=1/0,p=e.slice(1),u;this.options.extensions.startInline.forEach(h=>{u=h.call({lexer:this},p),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=e.substring(0,l+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),s=!0;let l=n.at(-1);l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return n}},_e=class{options;parser;constructor(t){this.options=t||j}space(t){return""}code({text:t,lang:e,escaped:n}){let i=(e||"").match(A.notSpaceStart)?.[0],r=t.replace(A.endingNewline,"")+`
397
691
  `;return i?'<pre><code class="language-'+z(i)+'">'+(n?r:z(r,!0))+`</code></pre>
398
692
  `:"<pre><code>"+(n?r:z(r,!0))+`</code></pre>
399
693
  `}blockquote({tokens:t}){return`<blockquote>
400
694
  ${this.parser.parse(t)}</blockquote>
401
695
  `}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
402
696
  `}hr(t){return`<hr>
403
- `}list(t){let e=t.ordered,n=t.start,i="";for(let o=0;o<t.items.length;o++){let l=t.items[o];i+=this.listitem(l)}let r=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
697
+ `}list(t){let e=t.ordered,n=t.start,i="";for(let a=0;a<t.items.length;a++){let o=t.items[a];i+=this.listitem(o)}let r=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
404
698
  `+i+"</"+r+`>
405
699
  `}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+z(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
406
700
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
407
- `}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
701
+ `}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
408
702
  <thead>
409
703
  `+e+`</thead>
410
704
  `+i+`</table>
411
705
  `}tablerow({text:t}){return`<tr>
412
706
  ${t}</tr>
413
707
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
414
- `}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+=`
415
- `+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+=`
416
- 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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),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(`
417
- `);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"));})();
708
+ `}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=yt(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=yt(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)}},Ze=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 ze{options;renderer;textRenderer;constructor(e){this.options=e||j,this.options.renderer=this.options.renderer||new _e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ze}static parse(e,n){return new ze(n).parse(e)}static parseInline(e,n){return new ze(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 o=s,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){i+=c||"";continue}}let a=s;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let o=a,c=this.renderer.text(o);for(;r+1<e.length&&e[r+1].type==="text";)o=e[++r],c+=`
709
+ `+this.renderer.text(o);n?i+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):i+=c;continue}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}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 o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=o||"";continue}}let a=s;switch(a.type){case"escape":{i+=n.text(a);break}case"html":{i+=n.html(a);break}case"link":{i+=n.link(a);break}case"image":{i+=n.image(a);break}case"strong":{i+=n.strong(a);break}case"em":{i+=n.em(a);break}case"codespan":{i+=n.codespan(a);break}case"br":{i+=n.br(a);break}case"del":{i+=n.del(a);break}case"text":{i+=n.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return i}},de=class{options;block;constructor(t){this.options=t||j}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?M.lex:M.lexInline}provideParser(){return this.block?H.parse:H.parseInline}},ee=class{defaults=Be();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=H;Renderer=_e;TextRenderer=Ze;Lexer=M;Tokenizer=me;Hooks=de;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 a of s)n=n.concat(this.walkTokens(a.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 a=r[s].flat(1/0);n=n.concat(this.walkTokens(a,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(...a){let o=r.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}: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 _e(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 a=s,o=n.renderer[a],c=r[a];r[a]=(...l)=>{let p=o.apply(r,l);return p===!1&&(p=c.apply(r,l)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new me(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 a=s,o=n.tokenizer[a],c=r[a];r[a]=(...l)=>{let p=o.apply(r,l);return p===!1&&(p=c.apply(r,l)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new de;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 a=s,o=n.hooks[a],c=r[a];de.passThroughHooks.has(s)?r[a]=l=>{if(this.defaults.async)return Promise.resolve(o.call(r,l)).then(u=>c.call(r,u));let p=o.call(r,l);return c.call(r,p)}:r[a]=(...l)=>{let p=o.apply(r,l);return p===!1&&(p=c.apply(r,l)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),r&&(o=o.concat(r.call(this,a))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return M.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},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(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 o=s.hooks?s.hooks.provideLexer():t?M.lex:M.lexInline,c=s.hooks?s.hooks.provideParser():t?H.parse:H.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(l=>o(l,s)).then(l=>s.hooks?s.hooks.processAllTokens(l):l).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>c(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=o(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let p=c(l,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(l){return a(l)}}}onError(t,e){return n=>{if(n.message+=`
710
+ 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}}},O=new ee;function $(t,e){return O.parse(t,e)}$.options=$.setOptions=function(t){return O.setOptions(t),$.defaults=O.defaults,Tt($.defaults),$};$.getDefaults=Be;$.defaults=j;$.use=function(...t){return O.use(...t),$.defaults=O.defaults,Tt($.defaults),$};$.walkTokens=function(t,e){return O.walkTokens(t,e)};$.parseInline=O.parseInline;$.Parser=H;$.parser=H.parse;$.Renderer=_e;$.TextRenderer=Ze;$.Lexer=M;$.lexer=M.lex;$.Tokenizer=me;$.Hooks=de;$.parse=$;var kr=$.options,br=$.setOptions,xr=$.use,vr=$.walkTokens,wr=$.parseInline;var yr=H.parse,$r=M.lex;function jn(t,e){let n={type:"footnotes",raw:e,rawItems:[],items:[]};return{name:"footnote",level:"block",childTokens:["content"],tokenizer(i){t.hasFootnotes||(this.lexer.tokens.push(n),t.tokens=this.lexer.tokens,t.hasFootnotes=!0,n.rawItems=[],n.items=[]);let r=/^\[\^([^\]\n]+)\]:(?:[ \t]+|[\n]*?|$)([^\n]*?(?:\n|$)(?:\n*?[ ]{4,}[^\n]*)*)/.exec(i);if(r){let[s,a,o=""]=r,c=o.split(`
711
+ `).reduce((u,h)=>u+`
712
+ `+h.replace(/^(?:[ ]{4}|[\t])/,""),""),l=c.trimEnd().split(`
713
+ `).pop();c+=l&&/^[ \t]*?[>\-*][ ]|[`]{3,}$|^[ \t]*?[|].+[|]$/.test(l)?`
714
+
715
+ `:"";let p={type:"footnote",raw:s,label:a,refs:[],content:this.lexer.blockTokens(c)};return n.rawItems.push(p),p}},renderer(){return""}}}function Zn(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function Fn(t,e=!1,n=!1){let i=0;return{name:"footnoteRef",level:"inline",tokenizer(r){let s=/^\[\^([^\]\n]+)\]/.exec(r);if(s){let[a,o]=s,c=this.lexer.tokens[0],l=c.rawItems.filter(d=>d.label===o);if(!l.length)return;let p=l[0],u=c.items.filter(d=>d.label===o)[0],h={type:"footnoteRef",raw:a,index:p.refs.length,id:"",label:o};return u?(h.id=u.refs[0].id,u.refs.push(h)):(i++,h.id=String(i),p.refs.push(h),c.items.push(p)),h}},renderer({index:r,id:s,label:a}){i=0;let o=encodeURIComponent(a),c=n?Zn(a):s,l=r>0?`-${r+1}`:"";return`<sup><a id="${t}ref-${o}${l}" href="#${t+o}" data-${t}ref aria-describedby="${t}label">${e?`[${c}]`:c}</a></sup>`}}}function Gn(t,e,n,i,r,s){return{name:"footnotes",renderer({raw:a,items:o=[]}){if(o.length===0)return"";let c=o.reduce((h,{label:d,content:m,refs:g})=>{let x=encodeURIComponent(d),b=this.parser.parse(m).trimEnd(),k=b.endsWith("</p>"),_=`<li id="${t+x}">
716
+ `;return _+=k?b.replace(/<\/p>$/,""):b,g.forEach((v,S)=>{let C=s.replace("{0}",d),R,I;if(S>0){let P=S+1;R=`\u21A9<sup>${P}</sup>`,I=`-${P}`}else R="\u21A9",I="";_+=` <a href="#${t}ref-${x}${I}" data-${t}backref aria-label="${C}">${R}</a>`}),_+=k?`</p>
717
+ `:`
718
+ `,_+=`</li>
719
+ `,h+_},""),l="";n&&(l+=`<hr data-${e}footnotes>
720
+ `);let p="";i&&(p=` class="${i}"`);let u="";return r&&(u=` class="${r}"`),l+=`<section${p} data-${e}footnotes>
721
+ `,l+=`<h2 id="${t}label"${u}>${a.trimEnd()}</h2>
722
+ `,l+=`<ol>
723
+ ${c}</ol>
724
+ `,l+=`</section>
725
+ `,l}}}function Fe(t={}){let{prefixId:e="footnote-",prefixData:n="",description:i="Footnotes",refMarkers:r=!1,footnoteDivider:s=!1,keepLabels:a=!1,sectionClass:o="footnotes",headingClass:c="sr-only",backRefLabel:l="Back to reference {0}"}=t,p={hasFootnotes:!1,tokens:[]};return{extensions:[jn(p,i),Fn(e,r,a),Gn(e,n,s,o,c,l)],walkTokens(u){u.type==="footnotes"&&p.tokens.indexOf(u)===0&&u.items.length&&(p.tokens[0]={type:"space",raw:""},p.tokens.push(u)),p.hasFootnotes&&(p.hasFootnotes=!1)}}}function qt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Ht={tada:"\u{1F389}",rocket:"\u{1F680}",warning:"\u26A0\uFE0F",fire:"\u{1F525}",sparkles:"\u2728",thinking:"\u{1F914}",eyes:"\u{1F440}",bug:"\u{1F41B}",wrench:"\u{1F527}",hammer:"\u{1F528}",check:"\u2705",heavy_check_mark:"\u2714\uFE0F",x:"\u274C",question:"\u2753",exclamation:"\u2757",thumbsup:"\u{1F44D}",thumbsdown:"\u{1F44E}",clap:"\u{1F44F}",pray:"\u{1F64F}",ok_hand:"\u{1F44C}",heart:"\u2764\uFE0F",star:"\u2B50",zap:"\u26A1",boom:"\u{1F4A5}",package:"\u{1F4E6}",book:"\u{1F4D6}",memo:"\u{1F4DD}",pencil:"\u270F\uFE0F",mag:"\u{1F50D}",lock:"\u{1F512}",key:"\u{1F511}",gear:"\u2699\uFE0F",arrow_right:"\u27A1\uFE0F",arrow_left:"\u2B05\uFE0F"};function Ge(t){return t.replace(/:([a-z0-9_+-]+):/g,(e,n)=>Object.prototype.hasOwnProperty.call(Ht,n)?Ht[n]:e)}var Un={name:"mathInline",level:"inline",start(t){let e=t.indexOf("$");return e===-1?void 0:e},tokenizer(t){if(t.startsWith("$$"))return;let e=/^\$(?!\s)([^\n$]+?)(?<!\s)\$/.exec(t);if(e)return{type:"mathInline",raw:e[0],text:e[1]}},renderer(t){return`<span class="math-inline">${qt(t.text)}</span>`}};function N(t){let e=document.createElement("div");return e.innerHTML=t,(e.textContent??"").replace(/\s+/g," ").trim()}var Ue=new ee;function Dt(t){let e=[],n=0,i=(t.match(/^\[\^[^\]\n]+\]:/gm)??[]).length,r={name:"mathBlock",level:"block",start(o){let c=o.indexOf("$$");return c===-1?void 0:c},tokenizer(o){let c=/^\$\$([\s\S]+?)\$\$/.exec(o);if(c)return{type:"mathBlock",raw:c[0],text:c[1].trim()}},renderer(o){let c=o.text,l=`<div class="math-display">${qt(c)}</div>`;return e.push({index:n++,innerHtml:l,text:c}),""}},s={name:"docusaurusAdmonition",level:"block",start(o){let c=o.indexOf(":::");return c===-1?void 0:c},tokenizer(o){let c=/^:::(note|tip|info|warning|danger|caution|important)\b(?:[ \t]+(.+))?\n([\s\S]*?)\n:::(?=\n|$)/.exec(o);if(c)return{type:"docusaurusAdmonition",raw:c[0],kind:c[1].toLowerCase(),title:c[2]?.trim()??"",body:c[3]}},renderer(o){let c=o,l=c.kind==="info"?"note":c.kind==="danger"?"caution":c.kind,p=c.title||c.kind.charAt(0).toUpperCase()+c.kind.slice(1),u=Ue.parse(c.body).trimEnd(),h=`<blockquote class="admonition admonition-${l}"><p class="admonition-title">${p}</p>${u}</blockquote>`;return e.push({index:n++,innerHtml:h,text:`${p}: ${N(u)}`}),""}},a=new ee;a.use(Fe()),a.use({extensions:[Un,r,s]}),a.use({renderer:{paragraph(o){let c=this.parser.parseInline(o.tokens),l=Ge(`<p>${c}</p>`);return e.push({index:n++,innerHtml:l,text:N(l)}),""},list(o){let c=o.ordered?"ol":"ul",l=typeof o.start=="number"?o.start:1;for(let p=0;p<o.items.length;p++){let u=o.items[p],h=Ue.parser(u.tokens).trimEnd(),d=u.task?`<input type="checkbox" disabled${u.checked?" checked":""}> `:"",m=`<li${u.task?' class="task-list-item"':""}>${d}${h}</li>`,g=o.ordered?`<ol start="${l+p}">${m}</ol>`:`<${c}>${m}</${c}>`;e.push({index:n++,innerHtml:Ge(g),text:N(m)})}return""},code(o){let c=o.lang??"",l=o.text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");if(c==="mermaid"){let u=`<pre class="mermaid">${l}</pre>`;return e.push({index:n++,innerHtml:u,text:o.text.trim()}),""}let p=c?`<pre><code class="language-${c}">${l}</code></pre>`:`<pre><code>${l}</code></pre>`;return e.push({index:n++,innerHtml:p,text:o.text.trim()}),""},blockquote(o){let c=Ue.parser(o.tokens),l=/\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i.exec(c.slice(0,200));if(l){let u=l[1].toLowerCase(),h=u.charAt(0).toUpperCase()+u.slice(1),d=c.replace(/\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i,""),m=`<blockquote class="admonition admonition-${u}"><p class="admonition-title">${h}</p>${d}</blockquote>`;return e.push({index:n++,innerHtml:m,text:`${h}: ${N(d)}`}),""}let p=`<blockquote>${c}</blockquote>`.trimEnd();return e.push({index:n++,innerHtml:p,text:N(p)}),""},hr(){return e.push({index:n++,innerHtml:"<hr>",text:"---"}),""},html(o){if("pre"in o){let c=o.text;return e.push({index:n++,innerHtml:c,text:N(c)}),""}return o.text},image(o){let c=o.href??"",l=/^[a-z][a-z0-9+.-]*:/i.test(c),p=c.startsWith("/")||c.startsWith("#");c&&!l&&!p&&(c="/_assets/"+c.split("/").map(encodeURIComponent).join("/"));let u=m=>m.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;"),h=` alt="${u(o.text??"")}"`,d=o.title?` title="${u(o.title)}"`:"";return`<img src="${u(c)}"${h}${d}>`},heading(o){let c=this.parser.parseInline(o.tokens),l=Ge(`<h${o.depth}>${c}</h${o.depth}>`);return e.push({index:n++,innerHtml:l,text:N(l)}),""},table(o){let l=`<thead><tr>${o.header.map(x=>{let b=x.align?` align="${x.align}"`:"",k=this.parser.parseInline(x.tokens);return`<th${b}>${k}</th>`}).join("")}</tr></thead>`,u=`<tbody>${o.rows.map(x=>`<tr>${x.map(k=>{let _=k.align?` align="${k.align}"`:"",v=this.parser.parseInline(k.tokens);return`<td${_}>${v}</td>`}).join("")}</tr>`).join("")}</tbody>`,h=`<table>${l}${u}</table>`,d=o.header.map(x=>x.text).join(" | "),m=o.rows.map(x=>x.map(b=>b.text).join(" | ")),g=[d,...m].join(`
726
+ `);return e.push({index:n++,innerHtml:h,text:g}),""}}}),a.parse(t);for(let o=0;o<i;o++)e.pop();if(i>0){let o=new ee;o.use(Fe());let c=o.parse(t),l=/<section class="footnotes"[\s\S]*?<\/section>/.exec(c);l&&e.push({index:n++,innerHtml:l[0],text:N(l[0])})}return Wn(e)}function Wn(t){let e=(r,s)=>({open:(r.match(new RegExp(`<${s}\\b`,"gi"))??[]).length,close:(r.match(new RegExp(`</${s}>`,"gi"))??[]).length}),n=[],i=0;for(;i<t.length;){let r=t[i],{open:s,close:a}=e(r.innerHtml,"details");if(s<=a){n.push({...r,index:n.length}),i++;continue}let o=r.innerHtml,c=r.text,l=s-a,p=i+1;for(;p<t.length&&l>0;){let u=t[p];o+=u.innerHtml,c+=`
727
+ `+u.text;let h=e(u.innerHtml,"details");l+=h.open-h.close,p++}n.push({index:n.length,innerHtml:o,text:c}),i=p}return n}function Vn(t,e,n,i){return i&&!t?"\u25C6":e?"\u25B6":n?"\u25C0":t?"\u2014":"+"}function Nt({block:t,isInRange:e,isRangeStart:n,isRangeEnd:i,hasComment:r,isPendingComment:s,isHovered:a,onGutterClick:o,onMouseEnter:c,onMouseLeave:l}){let p=["line-block",a&&!e?"hovered":"",e?"in-range":"",r&&!e?"has-comment":"",s&&!e&&!r?"pending-comment":""].filter(Boolean).join(" ");return f("div",{class:p,onMouseEnter:()=>c(t.index),onMouseLeave:()=>l(),children:[f("div",{class:"line-gutter",onClick:u=>o(t.index,u.shiftKey),title:e?void 0:"Click to start selection",children:Vn(e,n,i,r)}),f("div",{class:"line-inner",dangerouslySetInnerHTML:{__html:t.innerHtml}})]})}function Ot({section:t,mode:e,isActive:n,pendingAnchor:i,commentedLines:r,onLineComment:s,onSectionComment:a}){let o=e==="plan"?t.level===3:t.level>=2,c=e==="plan"&&t.level===3&&t.dependencies,l=Ee(()=>Dt(t.body),[t.body]),[p,u]=E(null),[h,d]=E(null),m=(g,x)=>{if(h===null||!x)d(g);else{let b=Math.min(h,g),k=Math.max(h,g),_=l.slice(b,k+1).map(v=>v.text);s(t.id,b,k,_),d(null)}};return f("div",{id:`section-${t.id}`,class:`section-view${n?" active":""}${i===null?" being-commented":""}`,children:[f("h2",{children:t.heading}),c&&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:l.map(g=>{let x=h!==null&&p!==null&&g.index>=Math.min(h,p)&&g.index<=Math.max(h,p),b=h!==null&&p!==null&&g.index===Math.min(h,p),k=h!==null&&p!==null&&g.index===Math.max(h,p),_=i!=null&&g.index>=i.startLine&&g.index<=i.endLine;return f(Nt,{block:g,isInRange:x,isRangeStart:b,isRangeEnd:k,hasComment:r.has(g.index),isPendingComment:_,isHovered:p===g.index,onGutterClick:m,onMouseEnter:u,onMouseLeave:()=>u(null)},g.index)})}),o&&f("span",{class:"add-section-comment-link",onClick:()=>a(t.id),children:"Add comment to entire section"})]})}function be({sectionId:t,anchor:e,onSubmit:n,onCancel:i,initialText:r=""}){let[s,a]=E(r),o=()=>{let l=s.trim();l&&(n(t,l,e),a(""))},c=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:c}),e&&f("div",{class:"comment-anchor-quote",children:e.lineTexts.map((l,p)=>f("p",{children:l},p))}),f("textarea",{placeholder:"Add a comment...",value:s,onInput:l=>a(l.target.value)}),f("div",{class:"comment-input-actions",children:[f("button",{class:"add-btn",onClick:o,children:"Add"}),f("button",{class:"cancel-btn",onClick:i,children:"Cancel"})]})]})}function jt({comment:t,onEdit:e,onDelete:n}){let[i,r]=E(!1);if(i)return f(be,{sectionId:t.sectionId,anchor:t.anchor,initialText:t.text,onSubmit:(a,o)=>{e(o),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(D,{children:[f("div",{class:"comment-anchor-label",children:s}),f("div",{class:"comment-anchor-quote",children:t.anchor.lineTexts.map((a,o)=>f("p",{children:a},o))})]}):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 Kn(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 Zt({comments:t,sections:e,commentingTarget:n,onAdd:i,onEdit:r,onDelete:s,onCancelComment:a}){let o=new Set(e.map(u=>u.id)),c=u=>!o.has(u),l=u=>e.find(h=>h.id===u)?.heading??u,p=new Map;return t.forEach((u,h)=>{let d=p.get(u.sectionId)??[];d.push({comment:u,index:h}),p.set(u.sectionId,d)}),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(be,{sectionId:n.sectionId,anchor:n.anchor,onSubmit:i,onCancel:a})]}),Array.from(p.entries()).map(([u,h])=>{let d=c(u);return f("div",{class:d?"comment-group orphan":"comment-group",children:[f("h3",{title:d?"This comment is anchored to a section that no longer exists in the plan. The plan may have changed since the comment was written.":void 0,children:[d&&f("span",{class:"orphan-badge","aria-label":"orphan section",children:"\u26A0"}),l(u),d&&f("span",{class:"orphan-suffix",children:" (orphan)"})]}),Kn(h).map(({comment:m,index:g})=>f(jt,{comment:m,onEdit:x=>r(g,x),onDelete:()=>s(g)},g))]},u)}),t.length===0&&!n&&f("p",{class:"no-comments",children:"No comments yet. Hover a line and click + to start."})]})}var Qn="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs",Xn=[{role:"decision",re:/\b([A-Za-z_][A-Za-z0-9_]*)\s*\{\{?[^}]+\}\}?/g},{role:"start",re:/\b([A-Za-z_][A-Za-z0-9_]*)\s*\(\(\s*(?:start|begin|init)[^)]*\)\)/gi},{role:"end",re:/\b([A-Za-z_][A-Za-z0-9_]*)\s*\(\(\s*(?:end|done|finish|complete)[^)]*\)\)/gi},{role:"start",re:/\b([A-Za-z_][A-Za-z0-9_]*)\s*\(\[\s*(?:start|begin)[^\]]*\]\)/gi},{role:"end",re:/\b([A-Za-z_][A-Za-z0-9_]*)\s*\(\[\s*(?:end|done|finish)[^\]]*\]\)/gi},{role:"error",re:/\b([A-Za-z_][A-Za-z0-9_]*)\s*\[[^\]]*\b(?:error|fail|abort|reject|invalid)[^\]]*\]/gi},{role:"io",re:/\b([A-Za-z_][A-Za-z0-9_]*)\s*\[[/\\][^\]]+[/\\]\]/g}];function Jn(t){let e={};for(let{role:n,re:i}of Xn){i.lastIndex=0;let r;for(;(r=i.exec(t))!==null;)e[r[1]]||(e[r[1]]=n)}return e}var Yn=/^(?:yes|true|ok|success|pass|1)$/i,er=/^(?:no|false|fail|error|reject|0)$/i;function tr(t){let e=/([A-Za-z_][A-Za-z0-9_]*)\s*(?:-->|---|==>|-\.->)\s*\|([^|]+)\|\s*([A-Za-z_][A-Za-z0-9_]*)/g,n=[],i;for(;(i=e.exec(t))!==null;){let r=i[2].trim(),s=Yn.test(r)?"yes":er.test(r)?"no":null;n.push({from:i[1],to:i[3],branch:s,label:r})}return n}function nr(t,e){let n=Object.keys(e);for(let i of t.querySelectorAll("g.node")){let r=i.id??"",s=null;for(let a of n)if(new RegExp(`(^|[-_])${a}([-_]|$)`).test(r)){s=a;break}s?i.setAttribute("data-role",e[s]):i.setAttribute("data-role",i.querySelector("polygon")?"decision":"process")}}function rr(t,e){for(let n of e){if(!n.branch)continue;let i=`edge-${n.branch}`,r=`edge-${n.branch}-label`,s=`[id*="_${n.from}_${n.to}_"], [id*="-${n.from}-${n.to}-"]`;for(let o of t.querySelectorAll(s))o.classList.add(i);let a=n.label.trim().toLowerCase();for(let o of t.querySelectorAll("g.edgeLabel, .edgeLabel"))(o.textContent??"").trim().toLowerCase()===a&&o.classList.add(r)}}function ir(t){let e=new Map,n=0;for(let r of t.querySelectorAll("rect.actor")){let s=Math.round(parseFloat(r.getAttribute("x")??"0"));e.has(s)||e.set(s,n++);let a=e.get(s)%6;r.setAttribute("data-actor-idx",String(a));let o=r.parentElement;o&&o.classList.contains("actor")&&o.setAttribute("data-actor-idx",String(a))}t.querySelectorAll("line.actor-line").forEach((r,s)=>r.setAttribute("data-actor-idx",String(s%6)))}var G=null;function sr(){return G||(G=new Promise((t,e)=>{let n=window;if(n.__mermaid){t(n.__mermaid);return}let i="plan-review:mermaid-loaded",r=()=>{n.__mermaid?t(n.__mermaid):e(new Error("mermaid module missing after load"))};window.addEventListener(i,r,{once:!0});let s=document.createElement("script");s.type="module",s.textContent=`
728
+ import mermaid from '${Qn}';
729
+ window.__mermaid = mermaid;
730
+ window.dispatchEvent(new Event('${i}'));
731
+ `,s.onerror=()=>e(new Error("mermaid script tag error")),document.head.appendChild(s)}),G.catch(()=>{G=null}),G)}async function Ft(t=document){let e=t.querySelectorAll("pre.mermaid:not([data-processed])");if(e.length===0)return;let n;try{n=await sr()}catch{return}n.initialize({startOnLoad:!1,theme:"dark",securityLevel:"loose",fontFamily:"inherit"}),await Promise.all(Array.from(e).map(async i=>{let r=i.textContent??"",s=Jn(r),a=tr(r);try{await n.run({nodes:[i]})}catch{return}let o=i.querySelector("svg");o&&(nr(o,s),rr(o,a),ir(o))}))}var or="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.mjs",ar="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css",U=null;function lr(){if(document.querySelector("link[data-plan-review-katex]"))return;let t=document.createElement("link");t.rel="stylesheet",t.href=ar,t.setAttribute("data-plan-review-katex","1"),document.head.appendChild(t)}function cr(){return U||(lr(),U=new Promise((t,e)=>{let n=window;if(n.__katex){t(n.__katex);return}let i="plan-review:katex-loaded",r=()=>{n.__katex?t(n.__katex):e(new Error("katex module missing after load"))};window.addEventListener(i,r,{once:!0});let s=document.createElement("script");s.type="module",s.textContent=`
732
+ import katex from '${or}';
733
+ window.__katex = katex;
734
+ window.dispatchEvent(new Event('${i}'));
735
+ `,s.onerror=()=>e(new Error("katex script tag error")),document.head.appendChild(s)}),U.catch(()=>{U=null}),U)}async function Gt(t=document){let e=t.querySelectorAll(".math-inline:not([data-processed]), .math-display:not([data-processed])");if(e.length===0)return;let n;try{n=await cr()}catch{return}for(let i of Array.from(e)){let r=(i.textContent??"").trim(),s=i.classList.contains("math-display");try{n.render(r,i,{displayMode:s,throwOnError:!1}),i.setAttribute("data-processed","true")}catch{}}}function Ut(){let[t,e]=E(null),[n,i]=E([]),[r,s]=E(null),[a,o]=E(null),[c,l]=E(!1),[p,u]=E(null),h=gt(!1);K(()=>{if(!h.current&&(h.current=n.length>0||t!==null,!h.current))return;let _=setTimeout(()=>{try{let v=fetch("/api/session",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n,activeSection:r})});v&&typeof v.catch=="function"&&v.catch(()=>{})}catch{}},500);return()=>clearTimeout(_)},[n,r]),K(()=>{fetch("/api/doc").then(_=>_.json()).then(_=>{e(_.document),i(_.document.comments??[]);let v=_.initialState?.activeSection??null;v&&s(v)}).catch(_=>u(_.message))},[]),K(()=>{t&&(Ft(),Gt())},[t]),K(()=>{if(c)return;let _=R=>{try{let I=fetch(R,{method:"POST",keepalive:!0});I&&typeof I.catch=="function"&&I.catch(()=>{})}catch{}},v=setInterval(()=>{document.visibilityState==="visible"&&_("/api/heartbeat")},5e3),S=()=>{document.visibilityState==="visible"?_("/api/heartbeat"):_("/api/pause")};document.addEventListener("visibilitychange",S);let C=()=>{navigator.sendBeacon?.("/api/cancel")};return window.addEventListener("beforeunload",C),_("/api/heartbeat"),()=>{clearInterval(v),document.removeEventListener("visibilitychange",S),window.removeEventListener("beforeunload",C)}},[c]);let d=_=>{s(_),document.getElementById(`section-${_}`)?.scrollIntoView({behavior:"smooth"})},m=(_,v,S)=>{i(C=>[...C,{sectionId:_,text:v,timestamp:new Date,anchor:S}]),o(null)},g=(_,v)=>{i(S=>S.map((C,R)=>R===_?{...C,text:v}:C))},x=_=>{i(v=>v.filter((S,C)=>C!==_))},b=async()=>{try{(await fetch("/api/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n})})).ok&&l(!0)}catch{u("Failed to submit review")}},k=new Map;for(let _ of n)if(_.anchor){let v=k.get(_.sectionId)??new Set;for(let S=_.anchor.startLine;S<=_.anchor.endLine;S++)v.add(S);k.set(_.sectionId,v)}return c?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:b,disabled:n.length===0,children:"Submit Review"})]}),f("div",{class:"panels",children:[f(xt,{doc:t,comments:n,activeSection:r,onNavigate:d}),f("main",{class:"content-area",children:t.sections.map(_=>f(Ot,{section:_,mode:t.mode,isActive:r===_.id,pendingAnchor:a?.sectionId===_.id?a.anchor??null:void 0,commentedLines:k.get(_.id)??new Set,onLineComment:(v,S,C,R)=>o({sectionId:v,anchor:{type:"lines",startLine:S,endLine:C,lineTexts:R}}),onSectionComment:v=>o({sectionId:v})},_.id))}),f(Zt,{comments:n,sections:t.sections,commentingTarget:a,onAdd:m,onEdit:g,onDelete:x,onCancelComment:()=>o(null)})]})]}):f("div",{class:"loading",children:"Loading..."})}at(f(Ut,{}),document.getElementById("app"));})();
418
736
  </script>
419
737
  </body>
420
738
  </html>