azdiffs 0.0.0-stage → 0.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.
Files changed (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -2
  3. package/THIRD_PARTY_NOTICES.md +4514 -0
  4. package/dist/cli.js +4768 -0
  5. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-D7saE-jO.js +1 -0
  6. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DOwGbBTQ.js +1 -0
  7. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +1 -0
  8. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-Cjr34xFt.js +1 -0
  9. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-BjjJ4Yb8.js +1 -0
  10. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-iY62N_zR.js +1 -0
  11. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-CrHRklAE.js +1 -0
  12. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-WC7fEryq.js +1 -0
  13. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +1 -0
  14. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-BhUkafpV.js +1 -0
  15. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-_RVmv4sD.js +1 -0
  16. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-BJrgfbSD.js +1 -0
  17. package/dist/web/assets/_organization.index-hKcWlBrk.js +1 -0
  18. package/dist/web/assets/bat-qdxAdBWQ.js +1 -0
  19. package/dist/web/assets/bicep-CUHmPFLl.js +1 -0
  20. package/dist/web/assets/c-B0t_Dlza.js +1 -0
  21. package/dist/web/assets/cmake-Bj61d0ZC.js +1 -0
  22. package/dist/web/assets/commit-diff-view-CQeZylif.js +1 -0
  23. package/dist/web/assets/commits-view-B_TQ6AnD.js +13 -0
  24. package/dist/web/assets/conflicts-view-CnGEkjaP.js +8 -0
  25. package/dist/web/assets/core-D5Wev6DN.js +12 -0
  26. package/dist/web/assets/core-DfsS1UI1.js +12 -0
  27. package/dist/web/assets/cpp-DGR_3gb-.js +1 -0
  28. package/dist/web/assets/csharp-dmMxLVLW.js +1 -0
  29. package/dist/web/assets/css-CBDjU9xM.js +1 -0
  30. package/dist/web/assets/dart-CHZY9Xhz.js +1 -0
  31. package/dist/web/assets/dev.diff-DH1qvnWe.js +1 -0
  32. package/dist/web/assets/diff-woXpYk--.js +1 -0
  33. package/dist/web/assets/docker-IyjqRm3v.js +1 -0
  34. package/dist/web/assets/dotenv-CuH5my32.js +1 -0
  35. package/dist/web/assets/engine-javascript-C4Jk_eU2.js +141 -0
  36. package/dist/web/assets/engine-javascript-DpLLfDIa.js +141 -0
  37. package/dist/web/assets/engine-oniguruma-BfcA8yDp.js +1 -0
  38. package/dist/web/assets/engine-oniguruma-D--T0LcV.js +1 -0
  39. package/dist/web/assets/file-header-keBlejWu.js +49 -0
  40. package/dist/web/assets/files-view-Bu3bjrNf.js +1460 -0
  41. package/dist/web/assets/fsharp-D13ZGOAj.js +1 -0
  42. package/dist/web/assets/go-rLFTqkRN.js +1 -0
  43. package/dist/web/assets/grammars-DmFYBwmS.js +2 -0
  44. package/dist/web/assets/graphql-Br4JsJsw.js +1 -0
  45. package/dist/web/assets/groovy-CacY0gHj.js +1 -0
  46. package/dist/web/assets/hcl-Dh228itO.js +1 -0
  47. package/dist/web/assets/highlights-BJb1-tzP.js +1 -0
  48. package/dist/web/assets/highlights-CIgHM7EF-ByjlShdO.js +1 -0
  49. package/dist/web/assets/home-page-Y5jGxOav.js +1 -0
  50. package/dist/web/assets/html-Cyo-BRss.js +1 -0
  51. package/dist/web/assets/inbox-jP8QPtzZ.js +1 -0
  52. package/dist/web/assets/index-B297yCgq.js +11 -0
  53. package/dist/web/assets/index-CjZUV4-4.css +1 -0
  54. package/dist/web/assets/ini-B5eOa1yu.js +1 -0
  55. package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  56. package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  57. package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  58. package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  59. package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  60. package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  61. package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  62. package/dist/web/assets/java-r7y4bhRH.js +1 -0
  63. package/dist/web/assets/javascript-anBMbNY-.js +1 -0
  64. package/dist/web/assets/json-qhed-kSA.js +1 -0
  65. package/dist/web/assets/json5-BR5RXkoi.js +1 -0
  66. package/dist/web/assets/jsonc-CYpm1nAK.js +1 -0
  67. package/dist/web/assets/jsx-Bz0zcwM4.js +1 -0
  68. package/dist/web/assets/kotlin-DhhofPvG.js +1 -0
  69. package/dist/web/assets/langs_worker-Dyqdnub0.js +1 -0
  70. package/dist/web/assets/less-DVTAwKKz.js +1 -0
  71. package/dist/web/assets/lib-C2gVWm_O.js +1 -0
  72. package/dist/web/assets/lib-rf_jxHx0.js +1 -0
  73. package/dist/web/assets/lineChanges-Dw4ZXwVU.js +9 -0
  74. package/dist/web/assets/loader-BljfpPoZ.js +1 -0
  75. package/dist/web/assets/loader-C-ieOA_A.js +1 -0
  76. package/dist/web/assets/lua-mGgFNKt2.js +1 -0
  77. package/dist/web/assets/makefile-Dixweg8N.js +1 -0
  78. package/dist/web/assets/markdown-BYOwaDjH.js +1 -0
  79. package/dist/web/assets/overview-view-cEOsI9TY.js +2 -0
  80. package/dist/web/assets/php-DTciGFRO.js +1 -0
  81. package/dist/web/assets/pierre-dark-DMS-zpcK.js +1 -0
  82. package/dist/web/assets/pierre-light-BHq6aQNU.js +1 -0
  83. package/dist/web/assets/powershell-QtSnmXcu.js +1 -0
  84. package/dist/web/assets/properties-CHTuaqAW.js +1 -0
  85. package/dist/web/assets/proto-DB4EqR-F.js +1 -0
  86. package/dist/web/assets/pull-request-layout-DsDKURcq.js +35 -0
  87. package/dist/web/assets/python-gzcpVVnB.js +1 -0
  88. package/dist/web/assets/razor-3kKIP6Di.js +1 -0
  89. package/dist/web/assets/rolldown-runtime-BLXQ4ufn.js +1 -0
  90. package/dist/web/assets/routes-BruvNNp9.js +1 -0
  91. package/dist/web/assets/rust-DpiIf5JO.js +1 -0
  92. package/dist/web/assets/scala-BiFt_7mu.js +1 -0
  93. package/dist/web/assets/scss-DC8XIxmG.js +1 -0
  94. package/dist/web/assets/shellscript-CLZ0U2zV.js +1 -0
  95. package/dist/web/assets/shiki-DueA5xDi.js +1 -0
  96. package/dist/web/assets/shiki-DxP4sN1Z-caEk3oPG.js +1 -0
  97. package/dist/web/assets/shortcut-help-Cb0be4f3.js +1 -0
  98. package/dist/web/assets/sql-CEbI0hMM.js +1 -0
  99. package/dist/web/assets/stream-tokenizer-7LLwu37w-C37tUWGx.js +12 -0
  100. package/dist/web/assets/stream-tokenizer-B5Ok5N3S.js +4 -0
  101. package/dist/web/assets/svelte-iJTmbwM3.js +1 -0
  102. package/dist/web/assets/swift-CyEgAFGc.js +1 -0
  103. package/dist/web/assets/terraform-DswuEJGm.js +1 -0
  104. package/dist/web/assets/themes-BKc5vU6v.js +1 -0
  105. package/dist/web/assets/themes-SQq_asFq.js +1 -0
  106. package/dist/web/assets/toml-CcmNWLt0.js +1 -0
  107. package/dist/web/assets/tsx-udAQXfEw.js +1 -0
  108. package/dist/web/assets/typescript-bsJCZSQ-.js +1 -0
  109. package/dist/web/assets/utils-Tkdy0sOA.js +1 -0
  110. package/dist/web/assets/vb-DOwzaHZ0.js +1 -0
  111. package/dist/web/assets/vue-Dz_q6gML.js +1 -0
  112. package/dist/web/assets/wasm-C7N7kd8H.js +1 -0
  113. package/dist/web/assets/worker-B--T_fs_.js +7 -0
  114. package/dist/web/assets/xml-Bz5Z3pZJ.js +1 -0
  115. package/dist/web/assets/yaml-rwi0_p6S.js +1 -0
  116. package/dist/web/favicon.svg +5 -0
  117. package/dist/web/index.html +16 -0
  118. package/package.json +41 -4
@@ -0,0 +1,49 @@
1
+ import{n as e,r as t,t as n}from"./rolldown-runtime-BLXQ4ufn.js";import{A as r,B as i,Bn as a,C as o,Ct as s,Dt as c,E as l,Et as u,F as d,H as f,Mt as p,N as m,Nn as h,Nt as g,Rt as _,St as v,T as y,Tt as b,_n as x,dn as S,ft as C,gn as w,ht as T,jt as E,k as D,lt as O,mt as k,un as A,vn as ee,w as j,xt as M,yn as N,zn as te}from"./index-B297yCgq.js";import{$ as P,Bn as ne,G as re,Hn as ie,J as ae,K as oe,N as se,P as ce,Q as le,R as ue,Vn as de,X as fe,Y as pe,Z as me,_ as he,et as ge,j as _e,q as ve,tt as ye,v as be,z as xe}from"./pull-request-layout-DsDKURcq.js";import{a as Se,i as Ce,n as we,o as Te,r as Ee,s as De,t as Oe}from"./lib-rf_jxHx0.js";import{_ as ke,g as Ae,n as je}from"./inbox-jP8QPtzZ.js";var Me={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},F=t(a(),1),I=te();function Ne(e){if(e.isDeleted||Pe(e).length===0)return{kind:`deleted`};if(e.comments[0]?.commentType===`system`)return{kind:`system`};let t=e.threadContext;if(t===null)return{kind:`pull-request`};let n=ue(t.filePath);if(n.length===0)return{kind:`pull-request`};let r=t.rightFileEnd??t.rightFileStart;if(r!==null&&r.line>0){let e=t.rightFileStart?.line??r.line;return{kind:`line`,path:n,side:`additions`,lineNumber:r.line,startLineNumber:Math.min(e,r.line)}}let i=t.leftFileEnd??t.leftFileStart;if(i!==null&&i.line>0){let e=t.leftFileStart?.line??i.line;return{kind:`line`,path:n,side:`deletions`,lineNumber:i.line,startLineNumber:Math.min(e,i.line)}}return{kind:`file`,path:n}}function Pe(e){return e.comments.filter(e=>!e.isDeleted)}var Fe=new Set([`fixed`,`closed`,`wontFix`,`byDesign`]);function Ie(e){return e!==null&&Fe.has(e)}function Le(e){let t=e.publishedDate??e.comments[0]?.publishedDate??null,n=t===null?NaN:Date.parse(t);return Number.isNaN(n)?0:n}function Re(e,t){return Le(e)-Le(t)||e.id-t.id}var ze={active:`Active`,pending:`Pending`,fixed:`Resolved`,wontFix:`Won't fix`,closed:`Closed`,byDesign:`By design`,unknown:`Unknown`};function Be(e){let t=e.side??`additions`,n=e.endSide??t;return n===t?{side:t,startLine:Math.min(e.start,e.end),endLine:Math.max(e.start,e.end)}:{side:n,startLine:e.end,endLine:e.end}}function Ve(e){let{file:t,comparison:n}=e,r=xe(t.path),i;if(`side`in e){let n=t.change===`added`?`additions`:t.change===`deleted`?`deletions`:e.side,a=Math.max(1,Math.min(e.startLine,e.endLine)),o=Math.max(1,e.startLine,e.endLine);i=s(r,{side:n===`additions`?`right`:`left`,startLine:a,endLine:o,endLineLength:Math.max(0,e.endLineLength)})}else i=s(r,null);return{threadContext:i,pullRequestThreadContext:{changeTrackingId:t.changeTrackingId,iterationContext:{firstComparingIteration:n.baseIteration??n.iteration,secondComparingIteration:n.iteration}}}}function He(e,t){return e.kind===`file`?`new|file|${e.path}`:`new|line|${t}|${e.side}|${e.startLine}|${e.endLine}|${e.path}`}function Ue(e,t){let n=e.split(`|`);if(n[0]!==`new`)return null;if(n[1]===`file`&&n.length>=3)return{kind:`file`,path:n.slice(2).join(`|`)};if(n[1]!==`line`||n.length<7)return null;let[,,r,i,a,o]=n;if(Number(r)!==t||i!==`additions`&&i!==`deletions`)return null;let s=Number(a),c=Number(o);return!Number.isInteger(s)||!Number.isInteger(c)||s<1?null:{kind:`line`,path:n.slice(6).join(`|`),side:i,startLine:s,endLine:c}}var We=`new|pull-request`,L=e=>`reply|${e}`,Ge=(e,t)=>`edit|${e}|${t}`,R=e=>`thread|${e}`;function Ke(e){if(e.kind===`file`)return`this file`;let t=e.startLine===e.endLine?`line ${e.endLine}`:`lines ${e.startLine}–${e.endLine}`;return e.side===`deletions`?`${t} (old version)`:t}function qe(e){return`azdiffs:drafts:${e.organization.toLowerCase()}:${e.repositoryId.toLowerCase()}:${e.pullRequestId}`}function Je(e,t){let n=qe(t),r=null,i=()=>{if(r!==null)return r;r={};try{let t=e?.getItem(n)??null,i=t===null?null:JSON.parse(t);if(typeof i==`object`&&i&&!Array.isArray(i))for(let[e,t]of Object.entries(i))typeof t==`string`&&t.trim().length>0&&(r[e]=t)}catch{}return r},a=()=>{let t=i();try{Object.keys(t).length===0?e?.removeItem(n):e?.setItem(n,JSON.stringify(t))}catch{}};return{read:e=>i()[e]??``,write(e,t){let n=i();if(t.trim().length===0){if(!(e in n))return;delete n[e]}else{if(n[e]===t)return;n[e]=t}a()},clear(e){let t=i();e in t&&(delete t[e],a())},keys:()=>Object.keys(i())}}function Ye(){try{return globalThis.sessionStorage??null}catch{return null}}var Xe={composers:[],replies:new Set,editing:new Set,busy:new Set,errors:new Map,focus:null};function Ze(e={}){let t={...Xe,...e},n=new Set;return{get:()=>t,update(e){t={...t,...e(t)};for(let e of n)e()},subscribe(e){return n.add(e),()=>n.delete(e)}}}function z(e,t,n){if(e.has(t)===n)return e;let r=new Set(e);return n?r.add(t):r.delete(t),r}function Qe(e,t,n){if(n===null&&!e.has(t))return e;let r=new Map(e);return n===null?r.delete(t):r.set(t,n),r}function B(e,t){return(0,F.useSyncExternalStore)(e.subscribe,()=>t(e.get()))}var $e=-1;function et(){return $e--}function tt(e){return e<0}function nt(e,t,n,r,i=new Date().toISOString()){return{id:e,parentCommentId:r,author:t,content:n,commentType:`text`,publishedDate:i,lastUpdatedDate:i,isDeleted:!1,likes:0}}function rt(e,t,n,r,i=new Date().toISOString()){return{id:e,status:`active`,isDeleted:!1,publishedDate:i,lastUpdatedDate:i,comments:[nt(e,t,n,0,i)],threadContext:r?.threadContext??null,pullRequestThreadContext:r?.pullRequestThreadContext??null,identities:[]}}function it(e,t){return[...(e??[]).filter(e=>e.id!==t.id),t]}function at(e,t,n){let r=(e??[]).filter(e=>e.id!==n.id),i=r.findIndex(e=>e.id===t);return i===-1?[...r,n]:r.map((e,t)=>t===i?n:e)}function ot(e,t){return(e??[]).filter(e=>e.id!==t)}function st(e,t,n){return(e??[]).map(e=>e.id===t?{...e,...n(e)}:e)}function ct(e){return{comments:e,lastUpdatedDate:new Date().toISOString()}}function lt(e,t,n){return st(e,t,e=>ct([...e.comments.filter(e=>e.id!==n.id),n]))}function ut(e,t,n,r){return st(e,t,e=>{let t=e.comments.filter(e=>e.id!==r.id||e.id===n);return ct(t.some(e=>e.id===n)?t.map(e=>e.id===n?r:e):[...t,r])})}function dt(e,t,n){return st(e,t,e=>ct(e.comments.filter(e=>e.id!==n)))}function ft(e,t,n,r){return st(e,t,e=>ct(e.comments.map(e=>e.id===n?{...e,...r}:e)))}var pt=(0,F.createContext)(null);function mt({controller:e,children:t}){return(0,I.jsx)(pt.Provider,{value:e,children:t})}function ht(){return(0,F.useContext)(pt)}var gt=(e,t)=>e.toLowerCase()===t.toLowerCase();function _t(e){let{scope:t,comparison:n}=e,r=h(),i=O(t.organization),a=(0,F.useMemo)(()=>i.data===void 0?null:{id:i.data.id,displayName:i.data.displayName,...i.data.uniqueName===void 0?{}:{uniqueName:i.data.uniqueName}},[i.data]),o=(0,F.useMemo)(()=>Ze(),[]),s=(0,F.useMemo)(()=>Je(Ye(),{organization:t.organization,repositoryId:t.repositoryId,pullRequestId:t.pullRequestId}),[t.organization,t.repositoryId,t.pullRequestId]),l=(0,F.useRef)({input:e,me:a});l.current={input:e,me:a};let d=n?.iteration??0,f=n?.since??0,p=e.threadsKey??ce.threads(t,d,f),m=(0,F.useRef)(p);m.current=p;let g=(0,F.useMemo)(()=>ce.allThreads(t),[t]),_=e=>r.setQueryData(m.current,e),y=async e=>{o.update(t=>({busy:z(t.busy,e,!0),errors:Qe(t.errors,e,null)})),await r.cancelQueries({queryKey:m.current})},x=e=>{o.update(t=>({busy:z(t.busy,e,!1)})),r.isMutating({mutationKey:g})<=1&&r.invalidateQueries({queryKey:g})},S=(e,t)=>o.update(n=>({errors:Qe(n.errors,e,t)})),w=()=>C(t.organization),T={project:t.project,repositoryId:t.repositoryId,pullRequestId:t.pullRequestId},E=ie({mutationKey:g,retry:!1,mutationFn:({content:e,context:t})=>M(w(),{...T,content:e,...t===null?{}:{threadContext:t.threadContext,pullRequestThreadContext:t.pullRequestThreadContext}}),onMutate:async({key:e,content:t,context:n,tempId:r})=>{await y(e);let i=l.current.me;i!==null&&_(e=>it(e,rt(r,i,t,n)))},onSuccess:(e,{key:t,tempId:n})=>{_(t=>at(t,n,e)),s.clear(t)},onError:(e,{key:t,entry:n,tempId:r})=>{_(e=>ot(e,r)),o.update(r=>({composers:n===null||r.composers.some(e=>e.key===n.key)?r.composers:[...r.composers,n],errors:Qe(r.errors,t,e),focus:t}))},onSettled:(e,t,{key:n})=>x(n)}),D=ie({mutationKey:g,retry:!1,mutationFn:({thread:e,status:t})=>u(w(),{...T,threadId:e.id,status:t}),onMutate:async({thread:e,status:t})=>{await y(R(e.id)),_(n=>st(n,e.id,()=>({status:t})))},onSuccess:(e,{thread:t})=>_(n=>st(n,t.id,()=>({status:e.status,lastUpdatedDate:e.lastUpdatedDate}))),onError:(e,{thread:t,previous:n})=>{_(e=>st(e,t.id,()=>({status:n}))),S(R(t.id),e)},onSettled:(e,t,{thread:n})=>x(R(n.id))}),A=ie({mutationKey:g,retry:!1,mutationFn:({thread:e,content:t})=>b(w(),{...T,threadId:e.id,parentCommentId:e.comments[0]?.id??1,content:t}),onMutate:async({thread:e,content:t,tempId:n})=>{await y(L(e.id));let r=l.current.me;r!==null&&_(i=>lt(i,e.id,nt(n,r,t,e.comments[0]?.id??1)))},onSuccess:(e,{thread:t,tempId:n,resolve:r})=>{_(r=>ut(r,t.id,n,e)),s.clear(L(t.id)),r&&D.mutate({thread:t,status:`fixed`,previous:t.status})},onError:(e,{thread:t,tempId:n})=>{_(e=>dt(e,t.id,n)),o.update(n=>({replies:z(n.replies,t.id,!0),errors:Qe(n.errors,L(t.id),e),focus:L(t.id)}))},onSettled:(e,t,{thread:n})=>x(L(n.id))}),ee=ie({mutationKey:g,retry:!1,mutationFn:({thread:e,comment:t,content:n})=>c(w(),{...T,threadId:e.id,commentId:t.id,content:n}),onMutate:({thread:e,comment:t})=>y(Ge(e.id,t.id)),onSuccess:(e,{thread:t,comment:n})=>{_(r=>ft(r,t.id,n.id,{content:e.content,lastUpdatedDate:e.lastUpdatedDate??new Date().toISOString()})),s.clear(Ge(t.id,n.id)),o.update(e=>({editing:z(e.editing,Ge(t.id,n.id),!1)}))},onError:(e,{thread:t,comment:n})=>S(Ge(t.id,n.id),e),onSettled:(e,t,{thread:n,comment:r})=>x(Ge(n.id,r.id))}),j=ie({mutationKey:g,retry:!1,mutationFn:({thread:e,comment:t})=>v(w(),{...T,threadId:e.id,commentId:t.id}),onMutate:async({thread:e,comment:t})=>{await y(R(e.id)),_(n=>ft(n,e.id,t.id,{isDeleted:!0}))},onError:(e,{thread:t,comment:n})=>{_(e=>ft(e,t.id,n.id,{isDeleted:!1})),S(R(t.id),e)},onSettled:(e,t,{thread:n})=>x(R(n.id))}),N=(0,F.useRef)({create:E,status:D,reply:A,edit:ee,remove:j});N.current={create:E,status:D,reply:A,edit:ee,remove:j};let te=(0,F.useRef)(null),P=`${d}:${f}:${e.files.length}`;return(0,F.useEffect)(()=>{if(n===null||e.files.length===0||te.current===P)return;te.current=P;let t=new Set(e.files.map(e=>e.path)),r=[];for(let e of s.keys()){let n=Ue(e,f);n!==null&&t.has(n.path)&&r.push({key:e,anchor:n})}r.length!==0&&o.update(e=>({composers:[...e.composers,...r.filter(t=>!e.composers.some(e=>e.key===t.key))]}))},[n,e.files,s,o,f,P]),(0,F.useMemo)(()=>{let e=e=>a!==null&&gt(e.author.id,a.id);return{organization:t.organization,store:o,drafts:s,me:a,isMine:e,describe:e=>se(e,{repository:l.current.input.repositoryName,method:k(t.organization)}),openComposer(e){let t=He(e,f),n={key:t,anchor:e};return o.update(e=>({composers:e.composers.some(e=>e.key===t)?e.composers:[...e.composers,n],focus:t})),n},closeComposer(e){o.update(t=>({composers:t.composers.filter(t=>t.key!==e),errors:Qe(t.errors,e,null),focus:t.focus===e?null:t.focus}))},submitComposer(e,t){let r=t.trim();if(r.length===0||o.get().busy.has(e.key))return;let i=l.current.input.files.find(t=>t.path===e.anchor.path);if(i===void 0||n===null)return;let a={iteration:n.iteration,...n.since>0?{baseIteration:n.since}:{}},{anchor:s}=e,c=s.kind===`file`?Ve({file:i,comparison:a}):Ve({file:i,comparison:a,side:s.side,startLine:s.startLine,endLine:s.endLine,endLineLength:l.current.input.lineText(s.path,s.side,s.endLine)?.length??0});o.update(t=>({composers:t.composers.filter(t=>t.key!==e.key),busy:z(t.busy,e.key,!0)})),N.current.create.mutate({key:e.key,entry:e,content:r,context:c,tempId:et()})},commentOnPullRequest(e){let t=e.trim(),n=We;t.length===0||o.get().busy.has(n)||(o.update(e=>({busy:z(e.busy,n,!0)})),N.current.create.mutate({key:n,entry:null,content:t,context:null,tempId:et()}))},setReplyOpen(e,t){o.update(n=>({replies:z(n.replies,e,t),errors:t?n.errors:Qe(n.errors,L(e),null),focus:t?L(e):n.focus}))},reply(e,t,n={}){let r=t.trim(),i=L(e.id);r.length===0||o.get().busy.has(i)||(o.update(t=>({replies:z(t.replies,e.id,!1),busy:z(t.busy,i,!0)})),N.current.reply.mutate({thread:e,content:r,resolve:n.resolve===!0,tempId:et()}))},setEditing(e,t,n){let r=Ge(e,t);n||s.clear(r),o.update(e=>({editing:z(e.editing,r,n),errors:Qe(e.errors,r,null),focus:n?r:e.focus}))},edit(t,n,r){let i=r.trim(),a=Ge(t.id,n.id);i.length!==0&&!o.get().busy.has(a)&&e(n)&&(i===n.content.trim()?(o.update(e=>({editing:z(e.editing,a,!1)})),s.clear(a)):(o.update(e=>({busy:z(e.busy,a,!0)})),N.current.edit.mutate({thread:t,comment:n,content:i})))},remove(t,n){let r=R(t.id);!o.get().busy.has(r)&&e(n)&&(o.update(e=>({busy:z(e.busy,r,!0)})),N.current.remove.mutate({thread:t,comment:n}))},setStatus(e,t){let n=R(e.id);o.get().busy.has(n)||e.status===t||(o.update(e=>({busy:z(e.busy,n,!0)})),N.current.status.mutate({thread:e,status:t,previous:e.status}))},clearError(e){o.update(t=>({errors:Qe(t.errors,e,null)}))}}},[o,s,a,t.organization,f,n])}var vt=(e,t)=>e.toLowerCase()===t.toLowerCase();async function yt(e,t){let n=(e,t=!1)=>({ok:!1,problem:e,pushed:t}),r,i;try{if(r=await e.branchHead(),r===null)return n({kind:`branch-gone`});if(!vt(r,t.expectedHead))return n({kind:`stale`});i=await e.readFile(r)}catch(e){return n({kind:`failed`,error:e})}let a=ae(i);if(!a.ok)return n({kind:`not-text`});let o=ve(a.file,t.startLine,t.endLine);if(o===null||!pe(o,t.original))return n({kind:`lines-changed`});let s=re(i,t.startLine,t.endLine,ge(t.suggestion));if(!s.ok)return n({kind:s.reason===`not-text`?`not-text`:`lines-changed`});try{return{ok:!0,commitId:(await e.push({oldObjectId:r,contentBase64:ye(s.bytes),message:t.message})).commitId}}catch(e){return n(p(e)?{kind:`stale`}:{kind:`failed`,error:e},!0)}}var bt=`The lines changed since this suggestion was made.`;function xt(e){return`New commits were pushed to ${e}. Refresh to see them, then apply.`}var St=(0,F.createContext)(null);function Ct({value:e,children:t}){return(0,I.jsx)(St.Provider,{value:e,children:t})}function wt(){return(0,F.useContext)(St)}var Tt=()=>void 0,Et=()=>()=>{};function Dt(e,t){return(0,F.useSyncExternalStore)(e?.subscribe??Et,e===null?Tt:()=>e.state(t))}function Ot(e,t){return`https://dev.azure.com/${[e.organization,e.project,`_git`,e.repository,`commit`].map(encodeURIComponent).join(`/`)}/${t}`}var kt=(e,t)=>e.toLowerCase()===t.toLowerCase(),At=`Newer changes were pushed — refresh to apply.`;function jt(e){let{pullRequest:t,latest:n,since:r}=e;return t.status===`active`?n===null||n.sourceCommit===null?`Loading the latest changes…`:t.lastMergeSourceCommit!==null&&!kt(t.lastMergeSourceCommit,n.sourceCommit)?At:r===null?null:`Show all changes (not "since update") to apply suggestions.`:`This pull request is ${t.status}.`}function Mt(e){let t=h(),n=(0,F.useRef)(e);n.current=e;let r=(0,F.useMemo)(()=>{let e=new Map,t=new Set;return{get:t=>e.get(t),set(n,r){r===null?e.delete(n):e.set(n,r);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}},[]),i=(0,F.useRef)(new Set),{pullRequest:a,review:o,scope:s,location:c}=e,l=o.me,u=l!==null&&kt(l.id,a.author.id),d=jt(e);return(0,F.useMemo)(()=>{let e=(e,t)=>{let n=a.sourceBranch;switch(e.kind){case`stale`:return{phase:`error`,message:xt(n),signIn:null};case`branch-gone`:return{phase:`error`,message:`The source branch ${n} no longer exists.`,signIn:null};case`lines-changed`:return{phase:`error`,message:bt,signIn:null};case`not-text`:return{phase:`error`,message:`Only UTF-8 text files can be changed from azdiffs. Apply this suggestion in Azure DevOps.`,signIn:null};case`failed`:{let{error:n}=e;if(T(n)||A(n,`unauthorized`))return{phase:`error`,message:``,signIn:n};if(t&&A(n,`network`))return{phase:`error`,message:`The connection failed after the commit was sent, so it may have landed. Refresh to check before applying again.`,signIn:null};let r=o.describe(n);return{phase:`error`,message:r.kind===`message`?r.message:``,signIn:r.kind===`sign-in`?n:null}}}},l=e=>{t.invalidateQueries({queryKey:_e.detail(c)}),t.invalidateQueries({queryKey:ce.iterations(s)}),e&&t.invalidateQueries({queryKey:ce.allThreads(s)})};return{newSideLines(e,t,r){if(t<1||r<t)return null;let i=[];for(let a=t;a<=r;a++){let t=n.current.lineText(e,`additions`,a);if(t===null)return null;i.push(t)}return i},viewerIsAuthor:u,blocked:d,organization:s.organization,pullRequestId:a.pullRequestId,branch:a.sourceBranch,pullRequestUrl:_(c),state:r.get,subscribe:r.subscribe,clear:e=>{i.current.has(e)||r.set(e,null)},apply(t){let u=n.current,d=u.latest?.sourceCommit??null;if(i.current.has(t.key)||jt(u)!==null||d===null||r.get(t.key)?.phase===`done`)return;i.current.add(t.key),r.set(t.key,{phase:`busy`});let f=C(s.organization),p={project:s.project,repositoryId:s.repositoryId},m=`/${t.path.replace(/^\/+/,``)}`;yt({branchHead:()=>E(f,{...p,branch:a.sourceRefName}),readFile:async e=>new Uint8Array((await de(f,{...p,path:m,commitId:e})).bytes),push:e=>g(f,{...p,branch:a.sourceRefName,path:m,...e})},{path:m,startLine:t.startLine,endLine:t.endLine,original:t.original,suggestion:t.suggestion,expectedHead:d,message:t.message}).then(n=>{if(n.ok){r.set(t.key,{phase:`done`,commitId:n.commitId,url:Ot(c,n.commitId)});let e=t.resolve&&t.thread.status!==`fixed`;e&&o.setStatus(t.thread,`fixed`),l(!e)}else r.set(t.key,e(n.problem,n.pushed)),(n.pushed||n.problem.kind===`stale`)&&l(!0)}).finally(()=>{i.current.delete(t.key)})}}},[d,u,a,o,s,c,r,t])}var Nt=new Map;function Pt(e){return`${e.organization.toLowerCase()}:${e.repositoryId}:${e.pullRequestId}:${e.iteration}`}function Ft(e,t){Nt.set(e,t)}function It(e){return Nt.get(e)}var Lt=new Set([`bun.lock`,`bun.lockb`,`package-lock.json`,`npm-shrinkwrap.json`,`pnpm-lock.yaml`,`yarn.lock`,`cargo.lock`,`packages.lock.json`,`composer.lock`,`gemfile.lock`,`poetry.lock`]),Rt=[`.lock`,`.min.js`,`.min.css`,`.snap`,`.designer.cs`,`.g.cs`,`.g.i.cs`],zt=new Set([`dist`,`node_modules`]);function Bt(e){let t=e.replace(/^\/+/,``).split(`/`),n=(t.at(-1)??``).toLowerCase();return n.length===0?!1:Lt.has(n)||Rt.some(e=>n.endsWith(e)&&n.length>e.length)?!0:t.slice(0,-1).some(e=>zt.has(e))}function Vt({concurrency:e=6,run:t}){let n=[],r=new Set,i=new Map,a=!1;function o(){for(;!a&&i.size<e&&n.length>0;){let e=n.shift(),r=new AbortController;i.set(e,r),t(e,r.signal).catch(()=>{}).finally(()=>{i.delete(e),o()})}}return{add(e){if(!a){for(let t of e)r.has(t)||(r.add(t),n.push(t));o()}},prioritize(e){if(a)return;let t=e.filter(e=>!i.has(e)&&(!r.has(e)||n.includes(e)));if(t.length===0)return;let s=new Set(t);n=[...t,...n.filter(e=>!s.has(e))];for(let e of t)r.add(e);o()},forget(e){i.has(e)||(r.delete(e),n=n.filter(t=>t!==e))},pending:()=>[...n],running:()=>i.size,dispose(){a=!0,n=[];for(let e of i.values())e.abort();i.clear()}}}var Ht=8192;function Ut(e,t={}){if(e.byteLength===0)return{kind:`text`,text:``};let n=Wt(e);if(n===null&&e.subarray(0,Ht).includes(0))return{kind:`binary`};if(!t.ignoreLimits&&e.byteLength>1048576)return{kind:`too-large`,reason:`size`,bytes:e.byteLength};let r=new TextDecoder(n??`utf-8`).decode(e);return!t.ignoreLimits&&Gt(r)>2e4?{kind:`too-large`,reason:`long-line`,bytes:e.byteLength}:{kind:`text`,text:r}}function Wt(e){return e.byteLength<2?null:e[0]===255&&e[1]===254?`utf-16le`:e[0]===254&&e[1]===255?`utf-16be`:null}function Gt(e){let t=0,n=0;for(;n<=e.length;){let r=e.indexOf(`
2
+ `,n);r===-1&&(r=e.length),r-n>t&&(t=r-n),n=r+1}return t}function Kt(e,t){return e.change===`added`?null:e.originalObjectId===void 0?t===null?{kind:`missing`,reason:`Azure DevOps reported no base commit`}:{kind:`item`,path:xe(e.originalPath??e.path),commitId:t}:{kind:`blob`,objectId:e.originalObjectId}}function qt(e){return e.change===`deleted`?null:e.objectId===void 0?{kind:`missing`,reason:`Azure DevOps reported no version of this file`}:{kind:`blob`,objectId:e.objectId}}function Jt(e){return e.kind===`blob`?`blob:${e.objectId}`:e.kind===`item`?`item:${e.commitId}:${e.path}`:`missing:${e.reason}`}var Yt=18e5;function Xt(e,t,n,r){if(r.kind===`missing`)return Promise.reject(Error(r.reason));let i=C(t.organization),a={project:t.project,repositoryId:t.repositoryId};return e.fetchQuery({queryKey:ce.content(t,n),queryFn:async({signal:e})=>{let t=r.kind===`blob`?await ne(i,{...a,objectId:r.objectId,signal:e}):await de(i,{...a,path:r.path,commitId:r.commitId,signal:e});return new Uint8Array(t.bytes)},staleTime:1/0,gcTime:Yt,retry:!1})}function Zt(e,t){let n=h(),[r,i]=(0,F.useState)(()=>new Map),[a,o]=(0,F.useState)(null),s=(0,F.useRef)(new Map),c=(0,F.useRef)(new Set),l=(0,F.useRef)(new Map),u=(0,F.useRef)({waiting:new Map,sources:new Map,keys:new Map}),d=(0,F.useRef)(null),f=(0,F.useCallback)(()=>{d.current===null&&(d.current=setTimeout(()=>{d.current=null,i(new Map(s.current))},16))},[]),p=(0,F.useCallback)((e,t,n)=>{let r=s.current.get(e);r!==void 0&&(s.current.set(e,{...r,[t]:n}),f())},[f]),m=(0,F.useCallback)((e,t,n)=>{let r=Ut(n,{ignoreLimits:c.current.has(e)});p(e,t,{state:`loaded`,content:r})},[p]),g=(0,F.useMemo)(()=>e===null?null:Vt({run:async(t,r)=>{let i=u.current.sources.get(t),a=()=>u.current.waiting.get(t)??[];if(i===void 0)return;let s=ce.content(e,t),c=()=>void n.cancelQueries({queryKey:s,exact:!0});r.addEventListener(`abort`,c,{once:!0});try{let o=await Xt(n,e,t,i);if(r.aborted)return;l.current.set(t,o);for(let{path:e,side:t}of a())m(e,t,o)}catch(e){if(r.aborted)return;(T(e)||A(e,`unauthorized`))&&o(t=>t??e);let t=e instanceof Error?e.message:`Could not load this file`;for(let{path:e,side:n}of a())p(e,n,{state:`error`,message:t})}finally{r.removeEventListener(`abort`,c)}}}),[e,n,m,p]);(0,F.useEffect)(()=>()=>g?.dispose(),[g]),(0,F.useEffect)(()=>{if(g===null||t===null)return;let r={waiting:new Map,sources:new Map,keys:new Map},a=new Map,o=t.files.length>1e3?300:t.files.length,c=[];t.files.forEach((e,n)=>{let i={old:Kt(e,t.baseCommit),new:qt(e)},s={old:null,new:null},l={old:{state:`absent`},new:{state:`absent`}};for(let t of[`old`,`new`]){let a=i[t];if(a===null)continue;let u=Jt(a);s[t]=u,r.sources.set(u,a);let d=r.waiting.get(u)??[];d.push({path:e.path,side:t}),r.waiting.set(u,d),l[t]=n<o?{state:`pending`}:{state:`idle`},n<o&&c.push(u)}r.keys.set(e.path,s),a.set(e.path,l)}),u.current=r,s.current=a,i(new Map(a));for(let[t,i]of r.waiting){let r=l.current.get(t)??(e===null?void 0:n.getQueryData(ce.content(e,t)));if(r!==void 0){l.current.set(t,r);for(let{path:e,side:t}of i)m(e,t,r)}}let d=c.filter(e=>!l.current.has(e));for(let e of d)g.forget(e);g.add(d)},[g,t,e,n,m]);let _=(0,F.useCallback)(e=>{let t=[];for(let n of e){let e=u.current.keys.get(n);e?.old!=null&&t.push(e.old),e?.new!=null&&t.push(e.new)}return t},[]),v=(0,F.useCallback)(e=>{if(g===null)return;let t=_(e).filter(e=>!l.current.has(e));for(let e of t)for(let{path:t,side:n}of u.current.waiting.get(e)??[])s.current.get(t)?.[n].state===`idle`&&p(t,n,{state:`pending`});g.prioritize(t)},[g,_,p]),y=(0,F.useCallback)(e=>{if(g===null)return;let t=_([e]).filter(e=>!l.current.has(e));for(let e of t){g.forget(e);for(let t of u.current.waiting.get(e)??[])p(t.path,t.side,{state:`pending`})}g.prioritize(t)},[g,_,p]),b=(0,F.useCallback)(()=>{o(null);for(let[e,t]of s.current)(t.old.state===`error`||t.new.state===`error`)&&y(e)},[y]),x=(0,F.useCallback)(e=>{c.current.add(e);let t=u.current.keys.get(e);for(let n of[`old`,`new`]){let r=t?.[n],i=r==null?void 0:l.current.get(r);i!==void 0&&m(e,n,i)}},[m]);return(0,F.useEffect)(()=>()=>{d.current!==null&&clearTimeout(d.current)},[]),{sides:r,prioritize:v,retry:y,loadLarge:x,sessionError:a,retryFailed:b,inFlight:()=>g?.running()??0}}var Qt={diffStyle:`split`,overflow:`scroll`,panelWidth:280,panelCollapsed:!1,commentFilter:`all`},$t=`azdiffs:files-view`;function en(e){return Math.round(Math.min(640,Math.max(180,e)))}function tn(e){if(e===null)return Qt;try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return Qt;let n=Object.fromEntries(Object.entries(t));return{diffStyle:n.diffStyle===`unified`?`unified`:`split`,overflow:n.overflow===`wrap`?`wrap`:`scroll`,panelWidth:typeof n.panelWidth==`number`&&Number.isFinite(n.panelWidth)?en(n.panelWidth):Qt.panelWidth,panelCollapsed:n.panelCollapsed===!0,commentFilter:n.commentFilter===`active`||n.commentFilter===`hidden`?n.commentFilter:`all`}}catch{return Qt}}function nn(){try{return globalThis.localStorage??null}catch{return null}}var rn=tn(nn()?.getItem($t)??null),an=new Set;function on(e){let t={...rn,...e};t.panelWidth=en(t.panelWidth),rn=t;try{nn()?.setItem($t,JSON.stringify(rn))}catch{}for(let e of an)e()}function sn(e){return an.add(e),()=>an.delete(e)}function cn(){return(0,F.useSyncExternalStore)(sn,()=>rn)}var ln=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,un=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dn={};function fn(e,t){return((t||dn).jsx?un:ln).test(e)}var pn=/\/\*(?:[^*]|\*(?!\/))*\*\//g,mn=/\n/g,hn=/^\s*/,gn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,_n=/^:\s*/,vn=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,yn=/^[;\s]*/,bn=`
3
+ `,xn=`/`,Sn=`*`,Cn=``,wn=`comment`,Tn=`declaration`;function En(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(mn);t&&(n+=t.length);var i=e.lastIndexOf(bn);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(hn)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(xn==e.charAt(0)&&Sn==e.charAt(1)){for(var n=2;Cn!=e.charAt(n)&&(Sn!=e.charAt(n)||xn!=e.charAt(n+1));)++n;if(n+=2,Cn===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:wn,comment:o})}}function f(){var e=a(),t=c(gn);if(t){if(d(),!c(_n))return s(`property missing ':'`);var n=c(vn),r=e({type:Tn,property:t[0].replace(pn,Cn).trim(),value:n?n[0].replace(pn,Cn).trim():Cn});return c(yn),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function Dn(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=En(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var On=An(`end`),kn=An(`start`);function An(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function jn(e){let t=kn(e),n=On(e);if(t&&n)return{start:t,end:n}}function Mn(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Pn(e.position):`start`in e||`end`in e?Pn(e):`line`in e||`column`in e?Nn(e):``}function Nn(e){return Fn(e&&e.line)+`:`+Fn(e&&e.column)}function Pn(e){return Nn(e&&e.start)+`-`+Nn(e&&e.end)}function Fn(e){return e&&typeof e==`number`?e:1}var In=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Mn(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(In.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var Ln={}.hasOwnProperty,Rn=new Map,zn=/[A-Z]/g,Bn=/-([a-z])/g,Vn=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Hn=new Set([`td`,`th`]),Un=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Wn(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=tr(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=er(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Te:Se,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Gn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Gn(e,t,n){if(t.type===`element`)return Kn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qn(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Yn(e,t,n);if(t.type===`mdxjsEsm`)return Jn(e,t);if(t.type===`root`)return Xn(e,t,n);if(t.type===`text`)return Zn(e,t)}function Kn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Te,e.schema=i),e.ancestors.push(t);let a=sr(e,t.tagName,!1),o=nr(e,t),s=ir(e,t);return Vn.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Oe(e)})),Qn(e,o,a,t),$n(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qn(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}cr(e,t.position)}function Jn(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cr(e,t.position)}function Yn(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Te,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:sr(e,t.name,!0),o=rr(e,t),s=ir(e,t);return Qn(e,o,a,t),$n(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xn(e,t,n){let r={};return $n(r,ir(e,t)),e.create(t,e.Fragment,r,n)}function Zn(e,t){return t.value}function Qn(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function er(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function tr(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=kn(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function nr(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ln.call(t.properties,i)){let a=ar(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Hn.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function rr(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cr(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else cr(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ir(e,t){let n=[],r=-1,i=e.passKeys?new Map:Rn;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Gn(e,a,o);s!==void 0&&n.push(s)}return n}function ar(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=De(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?Ee(n):we(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:lr(n):or(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?Me[r.property]||r.property:r.attribute,n]}function or(e,t){let n={};try{Dn(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Bn,fr))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new In("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Un+`#cannot-parse-style-attribute`,r}return n}function sr(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=fn(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=fn(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ln.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);cr(e)}function cr(e,t){let n=new In("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Un+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function lr(e){let t={},n;for(n in e)Ln.call(e,n)&&(t[ur(n)]=e[n]);return t}function ur(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(zn,dr);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function dr(e){return`-`+e.toLowerCase()}function fr(e,t){return t.toUpperCase()}var pr={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},mr={};function hr(e,t){let n=t||mr;return gr(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function gr(e,t,n){if(vr(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return _r(e.children,t,n)}return Array.isArray(e)?_r(e,t,n):``}function _r(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=gr(e[i],t,n);return r.join(``)}function vr(e){return!!(e&&typeof e==`object`)}var yr=document.createElement(`i`);function br(e){let t=`&`+e+`;`;yr.innerHTML=t;let n=yr.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function V(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function H(e,t){return e.length>0?(V(e,e.length,0,t),e):t}var xr={}.hasOwnProperty;function Sr(e){let t={},n=-1;for(;++n<e.length;)Cr(t,e[n]);return t}function Cr(e,t){let n;for(n in t){let r=(xr.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){xr.call(r,a)||(r[a]=[]);let e=i[a];wr(r[a],Array.isArray(e)?e:e?[e]:[])}}}function wr(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);V(e,0,0,r)}function Tr(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function U(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var W=Nr(/[A-Za-z]/),G=Nr(/[\dA-Za-z]/),Er=Nr(/[#-'*+\--9=?A-Z^-~]/);function Dr(e){return e!==null&&(e<32||e===127)}var Or=Nr(/\d/),kr=Nr(/[\dA-Fa-f]/),Ar=Nr(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}var jr=Nr(/\p{P}|\p{S}/u),Mr=Nr(/\s/);function Nr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pr(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&G(e.charCodeAt(n+1))&&G(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return J(r)?(e.enter(n),s(r)):t(r)}function s(r){return J(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Fr(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&J(t)?(e.enter(r),c(t)):l(t)}function c(t){return J(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Ir={tokenize:Lr};function Lr(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return K(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Rr=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){zr(this,e,t,n,!1)}addBefore(e,t,n){zr(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function zr(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Br={tokenize:Hr},Vr={tokenize:Ur};function Hr(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Rr;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Vr,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Vr,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return K(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Rr;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ur(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Wr(e){if(e===null||q(e)||Mr(e))return 1;if(jr(e))return 2}function Gr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Kr={name:`attention`,resolveAll:qr,tokenize:Jr};function qr(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Yr(o,-a),Yr(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=H(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=H(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=H(r,Gr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=H(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=H(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),V(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Jr(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Wr(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Wr(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Yr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Xr={name:`autolink`,tokenize:Zr};function Zr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return W(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||G(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||G(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Dr(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Er(t)?(e.consume(t),l):n(t)}function u(e){return G(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||G(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Qr={partial:!0,tokenize:$r};function $r(e,t,n){return r;function r(t){return J(t)?Y(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||K(e)?t(e):n(e)}}var ei={continuation:{tokenize:ni},exit:ri,name:`blockQuote`,tokenize:ti};function ti(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return J(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ni(e,t,n){let r=this;return i;function i(t){return J(t)?Y(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ei,t,n)(r)}}function ri(e){e.exit(`blockQuote`)}var ii={name:`characterEscape`,tokenize:ai};function ai(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ar(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var oi={name:`characterReference`,tokenize:si};function si(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=G,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=kr,u):(e.enter(`characterReferenceValue`),a=7,o=Or,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===G&&!br(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var ci={partial:!0,tokenize:li};function li(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var ui={concrete:!0,name:`codeFenced`,tokenize:di};function di(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||K(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ci,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Y(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||K(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&J(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(ci,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),J(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var fi={name:`codeIndented`,tokenize:mi},pi={partial:!0,tokenize:hi};function mi(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Fr(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):K(t)?e.attempt(pi,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||K(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function hi(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):K(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Fr(e,t,a,`linePrefix`,4,4)(o)}function a(e){return K(e)?i(e):n(e)}}var gi={name:`codeText`,previous:vi,resolve:_i,tokenize:yi};function _i(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vi(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function yi(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||K(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var bi=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&xi(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),xi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),xi(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);xi(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);xi(this.left,t.reverse())}}}};function xi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Si(e){let t={},n=-1,r,i,a,o,s,c,l,u=new bi(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ci(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return V(e,0,1/0,u.slice(0)),!l}function Ci(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var wi={resolve:Ei,tokenize:Di},Ti={partial:!0,tokenize:Oi};function Ei(e){return Si(e),e}function Di(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):K(t)?e.check(Ti,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Oi(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,a,`linePrefix`)}function a(i){if(i===null||K(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ki(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Dr(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||K(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||q(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Dr(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ai(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):K(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!J(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function ji(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Mi(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):J(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ni={name:`definition`,tokenize:Fi},Pi={partial:!0,tokenize:Ii};function Fi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ai.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return q(t)?Mi(e,l)(t):l(t)}function l(t){return ki(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Pi,d,d)(t)}function d(t){return J(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ii(e,t,n){return r;function r(t){return q(t)?Mi(e,i)(t):n(t)}function i(t){return ji(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return J(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var Li={name:`hardBreakEscape`,tokenize:Ri};function Ri(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var zi={name:`headingAtx`,resolve:Bi,tokenize:Vi};function Bi(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};V(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Vi(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||q(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):J(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||q(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Hi=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Ui=[`pre`,`script`,`style`,`textarea`],Wi={concrete:!0,name:`htmlFlow`,resolveTo:Ki,tokenize:qi},Gi={partial:!0,tokenize:Ji};function Ki(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qi(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):W(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):W(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return W(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||q(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Ui.includes(l)?(i=1,r.interrupt?t(s):O(s)):Hi.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||G(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return J(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||W(t)?(e.consume(t),b):J(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):J(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):J(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||q(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||J(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):J(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Gi,re,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(ci,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Ui.includes(n)?(e.consume(t),ne):O(t)}return W(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||K(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function Ji(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Qr,t,n)}}var Yi={name:`htmlText`,tokenize:Xi};function Xi(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):W(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):W(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):K(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):K(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return W(t)?(e.consume(t),S):n(t)}function S(t){return t===45||G(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,M(t)):J(t)?(e.consume(t),C):j(t)}function w(t){return t===45||G(t)?(e.consume(t),w):t===47||t===62||q(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||W(t)?(e.consume(t),E):K(t)?(o=T,M(t)):J(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,M(t)):J(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,M(t)):J(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):K(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||q(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||q(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return J(t)?Y(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var Zi={name:`labelEnd`,resolveAll:ta,resolveTo:na,tokenize:ra},Qi={tokenize:ia},$i={tokenize:aa},ea={tokenize:oa};function ta(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&V(e,0,e.length,n),e}function na(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=H(o,e.slice(i+1,i+r+3)),o=H(o,[[`enter`,l,t]]),o=H(o,Gr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=H(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=H(o,e.slice(a+1)),o=H(o,[[`exit`,s,t]]),V(e,i,e.length,o),e}function ra(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(U(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Qi,u,o?u:d)(t):t===91?e.attempt($i,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ea,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function ia(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return q(t)?Mi(e,a)(t):a(t)}function a(t){return t===41?u(t):ki(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return q(t)?Mi(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?ji(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return q(t)?Mi(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function aa(e,t,n){let r=this;return i;function i(t){return Ai.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function oa(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var sa={name:`labelStartImage`,resolveAll:Zi.resolveAll,tokenize:ca};function ca(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var la={name:`labelStartLink`,resolveAll:Zi.resolveAll,tokenize:ua};function ua(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var da={name:`lineEnding`,tokenize:fa};function fa(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}}var pa={name:`thematicBreak`,tokenize:ma};function ma(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),J(t)?Y(e,s,`whitespace`)(t):s(t))}}var X={continuation:{tokenize:va},exit:ba,name:`list`,tokenize:_a},ha={partial:!0,tokenize:xa},ga={partial:!0,tokenize:ya};function _a(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Or(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(pa,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Or(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Qr,r.interrupt?n:u,e.attempt(ha,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return J(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function va(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Qr,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!J(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ga,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(X,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ya(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ba(e){e.exit(this.containerState.type)}function xa(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!J(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Sa={name:`setextUnderline`,resolveTo:Ca,tokenize:wa};function Ca(e,t){let n=new Rr,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function wa(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),J(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Ta={tokenize:Ea};function Ea(e){let t=this,n=e.attempt(Qr,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wi,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Da={resolveAll:ja()},Oa=Aa(`string`),ka=Aa(`text`);function Aa(e){return{resolveAll:ja(e===`text`?Ma:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function ja(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Ma(e,t){let n=new Rr,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Na=e({attentionMarkers:()=>Va,contentInitial:()=>Fa,disable:()=>Ha,document:()=>Pa,flow:()=>La,flowInitial:()=>Ia,insideSpan:()=>Ba,string:()=>Ra,text:()=>za}),Pa={42:X,43:X,45:X,48:X,49:X,50:X,51:X,52:X,53:X,54:X,55:X,56:X,57:X,62:ei},Fa={91:Ni},Ia={[-2]:fi,[-1]:fi,32:fi},La={35:zi,42:pa,45:[Sa,pa],60:Wi,61:Sa,95:pa,96:ui,126:ui},Ra={38:oi,92:ii},za={[-5]:da,[-4]:da,[-3]:da,33:sa,38:oi,42:Kr,60:[Xr,Yi],91:la,92:[Li,ii],93:Zi,95:Kr,96:gi},Ba={null:[Kr,Da]},Va={null:[42,95]},Ha={null:[]};function Ua(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=H(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Gr(a,l.events,l),l.events):[]}function f(e,t){return Ga(p(e),t)}function p(e){return Wa(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){K(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&V(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Wa(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ga(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
4
+ `;break;case-3:o=`\r
5
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Ka(e){let t={constructs:Sr([Na,...(e||{}).extensions||[]]),content:n(Ir),defined:[],document:n(Br),flow:n(Ta),lazy:{},string:n(Oa),text:n(ka)};return t;function n(e){return n;function n(n){return Ua(t,e,n)}}}function qa(e){for(;!Si(e););return e}var Ja=/[\0\t\n\r]/g;function Ya(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Ja.lastIndex=c;let n=Ja.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Xa=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Za(e){return e.replace(Xa,Qa)}function Qa(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Tr(n.slice(t?2:1),t?16:10)}return br(n)||e}var $a={}.hasOwnProperty;function eo(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),to(n)(qa(Ka(n).document().write(Ya()(e,t,!0))))}function to(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(xe),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(_e),blockQuote:o(fe),characterEscape:E,characterReference:E,codeFenced:o(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(pe,s),codeText:o(me,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(ve),hardBreakTrailing:o(ve),htmlFlow:o(ye,s),htmlFlowData:E,htmlText:o(ye,s),htmlTextData:E,image:o(be),label:s,link:o(xe),listItem:o(Ce),listItemValue:p,listOrdered:o(Se,f),listUnordered:o(Se),paragraph:o(we),reference:ae,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(_e),strong:o(Te),thematicBreak:o(De)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(j),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(ee),htmlTextData:D,image:l(N),label:P,labelText:te,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};ro(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),$a.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||ao).call(o,void 0,e[0])}for(r.position={start:no(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:no(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:no(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Mn({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ao).call(this,e,r[0])),n.position.end=no(e.end)}function d(){return hr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=U(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ee(),n.position={start:no(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=no(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=no(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Za(t),n.identifier=U(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Tr(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=br(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=no(e.end)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[],position:void 0}}function pe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function me(){return{type:`inlineCode`,value:``,position:void 0}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ge(){return{type:`emphasis`,children:[],position:void 0}}function _e(){return{type:`heading`,depth:0,children:[],position:void 0}}function ve(){return{type:`break`,position:void 0}}function ye(){return{type:`html`,value:``,position:void 0}}function be(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function xe(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function we(){return{type:`paragraph`,children:[],position:void 0}}function Te(){return{type:`strong`,children:[],position:void 0}}function Ee(){return{type:`text`,value:``,position:void 0}}function De(){return{type:`thematicBreak`,position:void 0}}}function no(e){return{line:e.line,column:e.column,offset:e.offset}}function ro(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ro(e,r):io(e,r)}}function io(e,t){let n;for(n in t)if($a.call(t,n))switch(n){case`canContainEols`:case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ao(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Mn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Mn({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Mn({start:t.start,end:t.end})+`) is still open`)}function oo(e){let t=this;t.parser=n;function n(n){return eo(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function so(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function co(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
6
+ `}]}function lo(e,t){let n=t.value?t.value+`
7
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function uo(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fo(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function po(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Pr(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function mo(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ho(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function go(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function _o(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return go(e,t);let i={src:Pr(r.url||``)};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function vo(e,t){let n={src:Pr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function yo(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function bo(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return go(e,t);let i={href:Pr(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xo(e,t){let n={href:Pr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function So(e,t,n){let r=e.all(t),i=n?Co(n):wo(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
8
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
9
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Co(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let{children:n}=e,r=-1;for(;!t&&++r<n.length;)t=wo(n[r])}return t}function wo(e){let{spread:t}=e;return t??e.children.length>1}function To(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Eo(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Do(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Oo(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ko(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=kn(t.children[1]),o=On(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Ao(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function jo(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Mo=9,No=32;function Po(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Fo(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Fo(t.slice(i),i>0,!1)),a.join(``)}function Fo(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Mo||t===No;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Mo||t===No;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Io(e,t){let n={type:`text`,value:Po(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Lo(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Ro={blockquote:so,break:co,code:lo,delete:uo,emphasis:fo,footnoteReference:po,heading:mo,html:ho,imageReference:_o,image:vo,inlineCode:yo,linkReference:bo,link:xo,listItem:So,list:To,paragraph:Eo,root:Do,strong:Oo,table:ko,tableCell:jo,tableRow:Ao,text:Io,thematicBreak:Lo,toml:zo,yaml:zo,definition:zo,footnoteDefinition:zo};function zo(){}var{defineProperty:Bo}=Object,Vo=typeof self==`object`?self:globalThis,Ho=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Vo[e](t)},Uo=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Bo(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Vo[e]==`function`?Ho(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Ho(a,o),i)};return r},Wo=e=>Uo(new Map,e)(0),Go=``,{toString:Ko}={},{keys:qo,is:Jo}=Object,Yo=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Ko.call(e).slice(8,-1);switch(n){case`Array`:return[1,Go];case`Object`:return[2,Go];case`Date`:return[3,Go];case`RegExp`:return[4,Go];case`Map`:return[5,Go];case`Set`:return[6,Go];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Xo=([e,t])=>e===0&&(t===`function`||t===`symbol`),Zo=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Yo(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Jo(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of qo(o))(e||!Xo(Yo(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Go:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Xo(Yo(n))||Xo(Yo(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Xo(Yo(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Qo=(e,{json:t,lossy:n}={})=>{let r=[];return Zo(!(t||n),!!t,new Map,r)(e),r},$o=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Wo(Qo(e,t)):structuredClone(e):(e,t)=>Wo(Qo(e,t));function es(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function ts(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ns(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||es,r=e.options.footnoteBackLabel||ts,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=[],l=-1;for(;++l<e.footnoteOrder.length;){let t=e.footnoteById.get(e.footnoteOrder[l]);t&&(s[l]=e.all(t))}for(l=-1;++l<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;let a=s[l],o=String(i.identifier).toUpperCase(),u=Pr(o.toLowerCase()),d=0,f=[],p=e.footnoteCounts.get(o);for(;p!==void 0&&++d<=p;){f.length>0&&f.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(l,d);typeof e==`string`&&(e={type:`text`,value:e}),f.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+u+(d>1?`-`+d:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(l,d),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let m=a[a.length-1];if(m&&m.type===`element`&&m.tagName===`p`){let e=m.children[m.children.length-1];e&&e.type===`text`?e.value+=` `:m.children.push({type:`text`,value:` `}),m.children.push(...f)}else a.push(...f);let h={type:`element`,tagName:`li`,properties:{id:t+`fn-`+u},children:e.wrap(a,!0)};e.patch(i,h),c.push(h)}if(c.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...$o(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
10
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(c,!0)},{type:`text`,value:`
11
+ `}]}}var rs=(function(e){if(e==null)return cs;if(typeof e==`function`)return ss(e);if(typeof e==`object`)return Array.isArray(e)?is(e):as(e);if(typeof e==`string`)return os(e);throw Error(`Expected function, string, or object as test`)});function is(e){let t=[],n=-1;for(;++n<e.length;)t[n]=rs(e[n]);return ss(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function as(e){let t=e;return ss(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function os(e){return ss(t);function t(t){return t&&t.type===e}}function ss(e){return t;function t(t,n,r){return!!(ls(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function cs(){return!0}function ls(e){return typeof e==`object`&&!!e&&`type`in e}function us(e){return e}var ds=[],fs=`skip`;function ps(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=rs(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+us(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=ds;if(s&&r&&(o=ms(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=d(t.children[e],e,r)();if(n[0]===!1)return n;e=typeof n[1]==`number`?n[1]:e+u}}}if(c&&r){let r=ms(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function ms(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ds:[e]}function hs(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?ps(e,i,_s(a),o):ps(e,i,gs(a),o)}function gs(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?_s(e.enter):e.enter,exit:typeof e.exit==`function`?_s(e.exit):e.exit}}function _s(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var vs={}.hasOwnProperty,ys={};function bs(e,t){let n=t||ys,r=new Map,i=new Map,a={all:s,applyData:Ss,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Ro,...n.handlers},one:o,options:n,patch:xs,wrap:ws};return hs(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=String(e.identifier).toUpperCase();e.type===`definition`?r.has(t)||r.set(t,e):i.has(t)||i.set(t,e)}}),a;function o(e,t){let{type:n}=e,r=a.handlers[n];if(vs.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e;return{...$o(n),children:a.all(e)}}return $o(e)}return(a.options.unknownHandler||Cs)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Ts(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Ts(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function xs(e,t){e.position&&(t.position=jn(e))}function Ss(e,t){let n=t;if(e&&e.data){let{hChildren:t,hName:r,hProperties:i}=e.data;typeof r==`string`&&(n.type===`element`?n.tagName=r:n={type:`element`,tagName:r,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,$o(i)),`children`in n&&n.children&&t!=null&&(n.children=t)}return n}function Cs(e,t){let n=t.data||{},r=`value`in t&&!(vs.call(n,`hProperties`)||vs.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ws(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
12
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
13
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
14
+ `}),n}function Ts(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Es(e,t){let n=bs(e,t),r=n.one(e,void 0),i=ns(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
15
+ `},i)),a}function Ds(e,t){return e&&`run`in e?async function(n,r){let i=Es(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Es(n,{file:r,...e||t})}}function Os(e){if(e)throw e}var ks=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function As(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function js(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ms(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ms(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Z={basename:Ns,dirname:Ps,extname:Fs,join:Is,sep:`/`};function Ns(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);zs(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Ps(e){if(zs(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Fs(e){zs(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Is(...e){let t=-1,n;for(;++t<e.length;)zs(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Ls(n)}function Ls(e){zs(e);let t=e.codePointAt(0)===47,n=Rs(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Rs(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function zs(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Bs={cwd:Vs};function Vs(){return`/`}function Hs(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Us(e){if(typeof e==`string`)e=new URL(e);else if(!Hs(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Ws(e)}function Ws(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Gs=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Ks=class{constructor(e){let t;t=e?Hs(e)?{path:e}:typeof e==`string`||Xs(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Bs.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Gs.length;){let e=Gs[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Gs.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Z.basename(this.path):void 0}set basename(e){Js(e,`basename`),qs(e,`basename`),this.path=Z.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Z.dirname(this.path):void 0}set dirname(e){Ys(this.basename,`dirname`),this.path=Z.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Z.extname(this.path):void 0}set extname(e){if(qs(e,`extname`),Ys(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Z.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Hs(e)&&(e=Us(e)),Js(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Z.basename(this.path,this.extname):void 0}set stem(e){Js(e,`stem`),qs(e,`stem`),this.path=Z.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new In(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function qs(e,t){if(e&&e.includes(Z.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Z.sep+"`")}function Js(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ys(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Xs(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Zs=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Qs={}.hasOwnProperty,$s=new class e extends Zs{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=js()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ks.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(nc(`data`,this.frozen),this.namespace[e]=t,this):Qs.call(this.namespace,e)&&this.namespace[e]||void 0:e?(nc(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ac(e),n=this.parser||this.Parser;return ec(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ec(`process`,this.parser||this.Parser),tc(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ac(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);sc(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ec(`processSync`,this.parser||this.Parser),tc(`processSync`,this.compiler||this.Compiler),this.process(e,r),ic(`processSync`,`process`,t),n;function r(e,r){t=!0,Os(e),n=r}}run(e,t,n){rc(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ac(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),ic(`runSync`,`run`,n),r;function i(e,t){Os(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ac(t),r=this.compiler||this.Compiler;return tc(`stringify`,r),rc(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(nc(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ks.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;)i(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];As(o)&&As(r)&&(r=(0,ks.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ec(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function tc(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function nc(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rc(e){if(!As(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ic(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ac(e){return oc(e)?e:new Ks(e)}function oc(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function sc(e){return typeof e==`string`||cc(e)}function cc(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var lc=[],uc={allowDangerousHtml:!0},dc=/^(https?|ircs?|mailto|xmpp)$/i,fc=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function pc(e){let t=mc(e),n=hc(e);return gc(t.runSync(t.parse(n),n),e)}function mc(e){let t=e.rehypePlugins||lc,n=e.remarkPlugins||lc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uc}:uc;return $s().use(oo).use(n).use(Ds,r).use(t)}function hc(e){let t=e.children||``,n=new Ks;return typeof t==`string`?n.value=t:``+t,n}function gc(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||_c;for(let e of fc)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return hs(e,l),Wn(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in pr)if(Object.hasOwn(pr,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=pr[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function _c(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||dc.test(e.slice(0,t))?e:``}function vc(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function yc(e,t,n){let r=rs((n||{}).ignore||[]),i=bc(t),a=-1;for(;++a<i.length;)ps(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return fs}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i!==!1){if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(i===!1||d[0].length===0){let t=e.value.codePointAt(n)||0;o.lastIndex=n+(/[uv]/.test(o.flags)&&t>65535?2:1)}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function bc(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([xc(e[0]),Sc(e[1])])}return t}function xc(e){return typeof e==`string`?new RegExp(vc(e),`g`):e}function Sc(e){return typeof e==`function`?e:function(){return e}}var Cc=`phrasing`,wc=[`autolink`,`link`,`image`,`label`];function Tc(){return{transforms:[Nc],enter:{literalAutolink:Dc,literalAutolinkEmail:Oc,literalAutolinkHttp:Oc,literalAutolinkWww:Oc},exit:{literalAutolink:Mc,literalAutolinkEmail:jc,literalAutolinkHttp:kc,literalAutolinkWww:Ac}}}function Ec(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Cc,notInConstruct:wc},{character:`.`,before:`[Ww]{3}`,inConstruct:Cc,notInConstruct:wc},{character:`:`,before:`[PSps]`,after:`\\/`,inConstruct:Cc,notInConstruct:wc}]}}function Dc(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function Oc(e){this.config.enter.autolinkProtocol.call(this,e)}function kc(e){this.config.exit.autolinkProtocol.call(this,e)}function Ac(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function jc(e){this.config.exit.autolinkEmail.call(this,e)}function Mc(e){this.exit(e)}function Nc(e){yc(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,Pc],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,Lc],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Ic],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Fc]],{ignore:[`link`,`linkReference`]})}function Pc(e,t,n,r,i){if(!Bc(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),jr(n.charCodeAt(0))||!Rc(n))return!1;let o=zc(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function Fc(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function Ic(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function Lc(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function Rc(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function zc(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=Ce(e,`(`),a=Ce(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Bc(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||Mr(t)||jr(t)}Xc.peek=Yc;function Vc(){this.buffer()}function Hc(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Uc(){this.buffer()}function Wc(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Gc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Kc(e){this.exit(e)}function qc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=U(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Jc(e){this.exit(e)}function Yc(){return`[`}function Xc(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Zc(){return{enter:{gfmFootnoteCallString:Vc,gfmFootnoteCall:Hc,gfmFootnoteDefinitionLabelString:Uc,gfmFootnoteDefinition:Wc},exit:{gfmFootnoteCallString:Gc,gfmFootnoteCall:Kc,gfmFootnoteDefinitionLabelString:qc,gfmFootnoteDefinition:Jc}}}function Qc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Xc},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
16
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?el:$c))),s(),o}}function $c(e,t,n){return t===0?e:el(e,t,n)}function el(e,t,n){return(n?``:` `)+e}var tl=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];ol.attention=sl,ol.peek=cl;function nl(){return{canContainEols:[`delete`],enter:{strikethrough:il},exit:{strikethrough:al}}}function rl(){return{handlers:{delete:ol},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:tl}]}}function il(e){this.enter({type:`delete`,children:[],position:void 0},e)}function al(e){this.exit(e)}function ol(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function sl(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function cl(){return`~`}function ll(e){return e.length}function ul(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ll,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=dl(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=fl(r[d]);else{let e=fl(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
17
+ `)}function dl(e){return e==null?``:String(e)}function fl(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var pl=rs([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ml(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),hl);return i(),o}function hl(e,t,n){return`>`+(n?``:` `)+e}function gl(e,t){return _l(e,t.inConstruct,!0)&&!_l(e,t.notInConstruct,!1)}function _l(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function vl(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
18
+ `&&!e.before&&!e.after&&gl(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
19
+ `}function yl(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function bl(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function xl(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Sl(e,t,n,r){let i=xl(n),a=e.value||``;if(bl(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Cl);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(yl(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
20
+ `,encode:["`"],...o.current()})),t()}return u+=o.move(`
21
+ `),a&&(u+=o.move(a+`
22
+ `)),u+=o.move(s),c(),u}function Cl(e,t,n){return(n?``:` `)+e}function wl(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Tl(e,t,n,r){let i=wl(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
23
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function El(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Dl(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function Ol(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function kl(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Al(e,t,n){let r=Wr(e),i=Wr(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function jl(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:W(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!W(a))return;for(;a===45||G(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&Ui.includes(o)?1:Hi.includes(o)?6:7}var Ml=new Map([[`*`,!1],[`_`,!0]]);function Nl(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function Pl(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=Ml.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=Wr(u.charCodeAt(u.length-1)),f=Wr((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(Ll(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:Nl(e,t,a),index:o}}}function Fl(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?Dl(n.value):Ol(n.value),i=kl(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function Il(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=Ul(e,c,r,i),u=Pl(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function Ll(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function Rl(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!Ar(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function zl(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?Dl(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
24
+ `)&&l.type===`html`&&jl(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(Wl(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=Bl(l,f.attention,t,c);if(!e)continue;a.push(e),s=Ol(e.sequences[0])}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=Ol(n)}}return r.pop(),a}function Bl(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=Rl(e.type,a,o),c=s[0],l=n.enter(i),u=n.createTracker(r.current());u.move(c);let d=zl(e,n,{...u.current(),before:c,after:c});if(l(),d.length!==0)return r.move(c),r.move(Wl(d,c,c)),r.move(c),{children:d,sequences:s}}function Vl(e,t,n,r){let i=Ul(e,t,n,r),a=Pl(i,n,r);for(;a;){let o=Il(e,t,a,n,r);if(!o)return;t=o.chosen,i=o.tokens,a=o.mistake}return i}function Hl(e,t,n,r){let i=n,a=-1;for(;++a<e.length;){let o=e[a];if(typeof o==`string`){i=``;continue}let s=a===e.length-1?r:``,c=o.sequences.find(function(t){let r=t.charAt(0);return r!==i.charAt(0)&&r!==s.charAt(0)||e.length===1&&Ml.has(r)&&t.length>n.length})||o.sequences[0];c!==o.sequences[0]&&t.set(o,c),Hl(o.children,t,c,c),i=c}}function Ul(e,t,n,r){let i=[],a,o=Ol(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===Dl(n)&&Fl([e],!0),a=void 0,i.push(e),e.value&&(o=Ol(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=Dl(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=Ul(n.children,t,c,c),m=p[0].value,h=Al(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&Fl(p,!0);let g=Ol(p[p.length-1].value),_=Al(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&Fl(p,!1),h.outside&&d!==`
25
+ `&&d!==`\r`&&Fl(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function Wl(e,t,n){let r=new Map;Hl(e,r,t,n);let i=(r.size>0?Vl(e,r,t,n):void 0)||Vl(e,new Map,t,n)||Ul(e,new Map,t,n),a=``;for(let e of i)a+=e.value;return a}Gl.attention=Kl,Gl.peek=ql;function Gl(e,t,n,r){let i=n.enter(`phrasing`),a=Bl(e,Kl,n,n.createTracker(r)),o=a?Wl([a],r.before,r.after):``;return i(),o}function Kl(e,t){return{construct:`emphasis`,markers:El(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function ql(e,t,n){return n.options.emphasis||`*`}function Jl(e,t){let n=!1;return hs(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&hr(e)&&(t.options.setext||n))}function Yl(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Jl(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
26
+ `,after:`
27
+ `});return r(),t(),o+`
28
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
29
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
30
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=kl(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Xl.peek=Zl;function Xl(e){return e.value||``}function Zl(){return`<`}Ql.peek=$l;function Ql(e,t,n,r){let i=wl(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function $l(){return`!`}eu.peek=tu;function eu(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function tu(){return`!`}nu.peek=ru;function nu(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function ru(){return"`"}function iu(e,t){let n=hr(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}au.peek=ou;function au(e,t,n,r){let i=wl(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(iu(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/^<|[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
31
+ `||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ou(e,t,n){return iu(e,n)?`<`:`[`}su.peek=cu;function su(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function cu(){return`[`}function lu(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function uu(e){let t=lu(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function du(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function fu(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function pu(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?du(n):lu(n),s=e.ordered?o===`.`?`)`:`.`:uu(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),fu(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function mu(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function hu(e,t,n,r){let i=mu(n),a=n.bulletCurrent||lu(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function gu(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function _u(e,t,n,r){if(!e.children.some(function(e){return pl(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function vu(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}yu.attention=bu,yu.peek=xu;function yu(e,t,n,r){let i=n.enter(`phrasing`),a=Bl(e,bu,n,n.createTracker(r)),o=a?Wl([a],r.before,r.after):``;return i(),o}function bu(e,t){return{construct:`strong`,markers:vu(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function xu(e,t,n){return n.options.strong||`*`}function Su(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function Cu(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function wu(e,t,n){let r=(fu(n)+(n.options.ruleSpaces?` `:``)).repeat(Cu(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Tu={blockquote:ml,break:vl,code:Sl,definition:Tl,emphasis:Gl,hardBreak:vl,heading:Yl,html:Xl,image:Ql,imageReference:eu,inlineCode:nu,link:au,linkReference:su,list:pu,listItem:hu,paragraph:gu,root:_u,strong:yu,text:Su,thematicBreak:wu};function Eu(){return{enter:{table:Du,tableData:ju,tableHeader:ju,tableRow:ku},exit:{codeText:Mu,table:Ou,tableData:Au,tableHeader:Au,tableRow:Au}}}function Du(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function Ou(e){this.exit(e),this.data.inTable=void 0}function ku(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function Au(e){this.exit(e)}function ju(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function Mu(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Nu));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Nu(e,t){return t===`|`?t:e}function Pu(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[Fu],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
32
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
33
+ `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return ul(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=Tu.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function Fu(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&Iu(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function Iu(e,t){let n=!1;return hs(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&hr(e)&&(t.options.setext||n))}function Lu(){return{exit:{taskListCheckValueChecked:zu,taskListCheckValueUnchecked:zu,paragraph:Bu}}}function Ru(){return{handlers:{paragraph:Vu},join:[Hu]}}function zu(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Bu(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function Vu(e,t,n,r){if(!t||t.type!==`listItem`||Uu(t)!==e)return Tu.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+Tu.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function Hu(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=Uu(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function Uu(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function Wu(){return[Tc(),Zc(),nl(),Eu(),Lu()]}function Gu(e){return{extensions:[Ec(),Qc(e),rl(),Pu(e),Ru()]}}var Ku={tokenize:ad,partial:!0},qu={tokenize:od,partial:!0},Ju={tokenize:sd,partial:!0},Yu={tokenize:cd,partial:!0},Xu={tokenize:ld,partial:!0},Zu={name:`wwwAutolink`,tokenize:rd,previous:ud},Qu={name:`protocolAutolink`,tokenize:id,previous:dd},$u={name:`emailAutolink`,tokenize:nd,previous:fd},Q={};function ed(){return{text:Q}}for(var td=48;td<123;)Q[td]=$u,td++,td===58?td=65:td===91&&(td=97);Q[43]=$u,Q[45]=$u,Q[46]=$u,Q[95]=$u,Q[72]=[$u,Qu],Q[104]=[$u,Qu],Q[87]=[$u,Zu],Q[119]=[$u,Zu];function nd(e,t,n){let r=this,i,a;return o;function o(t){return!pd(t)||!fd.call(r,r.previous)||md(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return pd(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Xu,u,l)(t):t===45||t===95||G(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&W(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function rd(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!ud.call(r,r.previous)||md(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Ku,e.attempt(qu,e.attempt(Ju,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function id(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&dd.call(r,r.previous)&&!md(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(W(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Dr(t)||q(t)||Mr(t)||jr(t)?n(t):e.attempt(qu,e.attempt(Ju,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function ad(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function od(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Yu,c,s)(t):t===null||q(t)||Mr(t)||t!==45&&jr(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function sd(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Yu,t,a)(o):o===null||q(o)||Mr(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function cd(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||q(o)||Mr(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||q(e)||Mr(e)?t(e):r(e)}function a(e){return W(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):W(t)?(e.consume(t),o):n(t)}}function ld(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return G(e)?n(e):t(e)}}function ud(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||q(e)}function dd(e){return!W(e)}function fd(e){return!(e===47||pd(e))}function pd(e){return e===43||e===45||e===46||e===95||G(e)}function md(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hd={tokenize:Cd,partial:!0};function gd(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bd,continuation:{tokenize:xd},exit:Sd}},text:{91:{name:`gfmFootnoteCall`,tokenize:yd},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_d,resolveTo:vd}}}}function _d(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vd(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xd(e,t,n){return e.check(Qr,t,e.attempt(hd,t,n))}function Sd(e){e.exit(`gfmFootnoteDefinition`)}function Cd(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wd(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&V(o,o.length,0,Gr(s,e.slice(r+1,n),t)),V(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),V(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Wr(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Wr(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Td=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Ed(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Ed(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Dd(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Od(){return{flow:{null:{name:`table`,tokenize:kd,resolveAll:Ad}}}}function kd(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Ad(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Td;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Md(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=jd(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=jd(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=jd(f,t,o,i,n,d)):(o[0]=o[1],d=jd(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Md(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Dd(t.events,n))}return e}function jd(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Nd(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Nd(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Nd(t.events,n[2]),a=Nd(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Nd(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Md(e,t,n,r,i){let a=[],o=Nd(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Nd(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pd={name:`tasklistCheck`,tokenize:Id};function Fd(){return{text:{91:Pd}}}function Id(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Ld},t,n)(r):n(r)}}function Ld(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rd(e){return Sr([ed(),gd(),wd(e),Od(),Fd()])}var zd={};function Bd(e){let t=this,n=e||zd,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rd(n)),a.push(Wu()),o.push(Gu(n))}var Vd=/<!--[\s\S]*?-->/g;function Hd(e){return e.replace(Vd,``)}function Ud(){let e=t=>{t.children!==void 0&&(t.children=t.children.filter(e=>{if(e.type!==`html`)return!0;let t=Hd(e.value??``);return t.trim().length!==0&&(e.type=`text`,e.value=t,!0)}));for(let n of t.children??[])e(n)};return e}var Wd=[Bd,Ud],Gd=`dataAzdBlockIndex`;function Kd(e){let t=e.properties?.className,n=(Array.isArray(t)?t:[]).find(e=>typeof e==`string`&&e.startsWith(`language-`));return n===void 0?``:n.slice(9).toLowerCase()}function qd(){return e=>{let t=new Map,n=e=>{if(e.type===`element`&&e.tagName===`pre`){let n=e.children?.find(e=>e.tagName===`code`);if(n!==void 0){let e=Kd(n),r=t.get(e)??0;t.set(e,r+1),n.properties={...n.properties,[Gd]:r}}}for(let t of e.children??[])n(t)};n(e)}}var Jd=[qd];function Yd(e){return e.type===`text`?e.value??``:(e.children??[]).map(Yd).join(``)}function Xd({children:e}){return(0,I.jsx)(`pre`,{className:`my-1.5 overflow-x-auto rounded border border-border bg-raised p-2 font-mono text-xs`,children:e})}var Zd={a:({href:e,children:t})=>e===void 0||e.length===0?(0,I.jsx)(`span`,{children:t}):(0,I.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent underline-offset-2 hover:underline`,children:t}),img:({src:e,alt:t})=>{let n=t!==void 0&&t.length>0?`Image: ${t}`:`Image`;return typeof e==`string`&&e.length>0?(0,I.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent underline-offset-2 hover:underline`,children:n}):(0,I.jsx)(`span`,{children:n})},pre:({children:e})=>(0,I.jsx)(Xd,{children:e}),code:({children:e,className:t})=>(0,I.jsx)(`code`,{className:t===void 0?`rounded bg-raised px-1 py-px font-mono text-[0.92em]`:`${t} font-mono`,children:e}),table:({children:e})=>(0,I.jsx)(`div`,{className:`my-1.5 overflow-x-auto`,children:(0,I.jsx)(`table`,{className:`border-collapse text-xs [&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-0.5 [&_th]:border [&_th]:border-border [&_th]:px-2 [&_th]:py-0.5`,children:e})})};function Qd(e){let t=_c(e);return/^(https?:|mailto:|#)/i.test(t)?t:``}function $d(e){return{...Zd,pre:({node:t,children:n})=>{let r=t?.children?.find(e=>e.tagName===`code`);if(r!==void 0){let t=e({language:Kd(r),text:Yd(r),index:Number(r.properties?.[Gd]??0)});if(t!==null)return(0,I.jsx)(I.Fragment,{children:t})}return(0,I.jsx)(Xd,{children:n})}}}var ef=(0,F.memo)(function({source:e,codeBlock:t}){let n=(0,F.useMemo)(()=>t===void 0?Zd:$d(t),[t]);return(0,I.jsx)(`div`,{className:`azd-markdown min-w-0 break-words text-[13px] leading-relaxed text-fg`,children:(0,I.jsx)(pc,{remarkPlugins:Wd,rehypePlugins:Jd,components:n,urlTransform:Qd,children:e})})}),tf={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},nf={heading:`### `,quote:`> `,"bulleted-list":`- `,"task-list":`- [ ] `},rf=/^(\s*)(?:[-*+] \[[ xX]\] |[-*+] |\d+[.)] )/;function af(e,t){if(typeof t==`object`)return yf(e,t.lines);switch(t){case`bold`:case`italic`:case`strikethrough`:case`code`:return sf(e,tf[t]);case`link`:return uf(e);case`code-block`:return vf(e);default:return gf(e,t)}}function of(e){return[Math.min(e.selectionStart,e.selectionEnd),Math.max(e.selectionStart,e.selectionEnd)]}function sf(e,t){let{text:n}=e,[r,i]=of(e),a=n.slice(r,i),o=t.length;if(n.slice(r-o,r)===t&&n.slice(i,i+o)===t&&(t!==`_`||n.slice(r-2,r)!==`__`))return{text:n.slice(0,r-o)+a+n.slice(i+o),selectionStart:r-o,selectionEnd:i-o};if(a.length>=2*o&&a.startsWith(t)&&a.endsWith(t)){let e=a.slice(o,a.length-o);return{text:n.slice(0,r)+e+n.slice(i),selectionStart:r,selectionEnd:r+e.length}}let s=a.length-a.trimStart().length,c=a.length-a.trimEnd().length;if(a.trim().length===0)return{text:`${n.slice(0,r)}${t}${t}${n.slice(i)}`,selectionStart:r+o,selectionEnd:r+o};let l=r+s,u=i-c,d=n.slice(l,u);return{text:`${n.slice(0,l)}${t}${d}${t}${n.slice(u)}`,selectionStart:l+o,selectionEnd:u+o}}var cf=/^https?:\/\/\S+$/i;function lf(e){return cf.test(e.trim())}function uf(e){let{text:t}=e,[n,r]=of(e),i=t.slice(n,r);if(lf(i)){let e=`[](${i.trim()})`;return{text:t.slice(0,n)+e+t.slice(r),selectionStart:n+1,selectionEnd:n+1}}let a=`[${i}](url)`,o=n+i.length+3;return{text:t.slice(0,n)+a+t.slice(r),selectionStart:o,selectionEnd:o+3}}function df(e,t){let[n,r]=of(e),i=e.text.slice(n,r);if(n===r||!lf(t)||lf(i)||i.includes(`
34
+ `))return null;let a=`[${i}](${t.trim()})`,o=n+a.length;return{text:e.text.slice(0,n)+a+e.text.slice(r),selectionStart:o,selectionEnd:o}}function ff(e,t,n){let r=e.lastIndexOf(`
35
+ `,t-1)+1,i=n>t&&e[n-1]===`
36
+ `?n-1:n,a=e.indexOf(`
37
+ `,i);return[r,a===-1?e.length:a]}function pf(e,t){return e===`numbered-list`?`${t+1}. `:nf[e]}function mf(e,t){return t===`numbered-list`?/^\s*\d+[.)] /.test(e):t===`bulleted-list`?/^\s*[-*+] (?!\[[ xX]\] )/.test(e):t===`task-list`?/^\s*[-*+] \[[ xX]\] /.test(e):t===`heading`?/^#{1,6} /.test(e):e.startsWith(`>`)}function hf(e,t){return t===`heading`?e.replace(/^#{1,6} /,``):t===`quote`?e.replace(/^> ?/,``):e.replace(rf,`$1`)}function gf(e,t){let{text:n}=e,[r,i]=of(e),[a,o]=ff(n,r,i),s=n.slice(a,o).split(`
38
+ `),c=s.map(e=>s.length===1||t===`quote`||e.trim().length>0),l=s.every((e,n)=>!c[n]||mf(e,t)),u=0,d=s.map((e,n)=>{if(!c[n])return e;if(l)return hf(e,t);let r=t===`bulleted-list`||t===`numbered-list`||t===`task-list`,i=r?e.replace(rf,`$1`):e,a=r?/^\s*/.exec(i)?.[0]??``:``;return`${a}${pf(t,u++)}${i.slice(a.length)}`}).join(`
39
+ `),f=n.slice(0,a)+d+n.slice(o);if(r===i&&s.length===1){let e=d.length-(o-a),t=Math.max(a,r+e);return{text:f,selectionStart:t,selectionEnd:t}}return{text:f,selectionStart:a,selectionEnd:a+d.length}}function _f(e,t,n,r){let i=t===0||e[t-1]===`
40
+ `?``:`
41
+ `,a=n===e.length||e[n]===`
42
+ `?``:`
43
+ `;return{text:`${e.slice(0,t)}${i}${r}${a}${e.slice(n)}`,offset:t+i.length}}function vf(e){let{text:t}=e,[n,r]=of(e),i=t.slice(n,r),a=/^```[^\n]*\n([\s\S]*)\n```$/.exec(i);if(a!==null){let e=a[1]??``;return{text:t.slice(0,n)+e+t.slice(r),selectionStart:n,selectionEnd:n+e.length}}let o=i.replace(/\n$/,``),s=_f(t,n,r,`\`\`\`\n${o}\n\`\`\``),c=s.offset+4;return{text:s.text,selectionStart:c,selectionEnd:c+o.length}}function yf(e,t){let[n,r]=of(e),i=me(t),a=_f(e.text,n,r,i.text);return{text:a.text,selectionStart:a.offset+i.innerStart,selectionEnd:a.offset+i.innerEnd}}function bf(e,t){let n=e.slice(0,t).split(`
44
+ `).slice(0,-1),r=null;for(let e of n){let t=/^ {0,3}(`{3,}|~{3,})/.exec(e)?.[1];t!==void 0&&(r===null?r=t:t[0]===r[0]&&t.length>=r.length&&e.trim()===t&&(r=null))}return r!==null}function xf(e){let{text:t}=e,[n,r]=of(e);if(n!==r)return null;let i=t.lastIndexOf(`
45
+ `,n-1)+1,a=t.indexOf(`
46
+ `,n),o=a===-1?t.length:a,s=t.slice(i,o);if(bf(t,i))return null;let c=/^(\s*)([-*+] \[[ xX]\] |[-*+] |(\d+)([.)]) )/.exec(s);if(c===null)return null;let[l,u=``,d=``,f,p]=c;if(n<i+l.length)return null;if(s.slice(l.length).trim().length===0)return{text:t.slice(0,i)+t.slice(o),selectionStart:i,selectionEnd:i};let m=`\n${u}${f===void 0?/\[[ xX]\]/.test(d)?`${d[0]??`-`} [ ] `:d:`${Number(f)+1}${p??`.`} `}`,h=n+m.length;return{text:t.slice(0,n)+m+t.slice(n),selectionStart:h,selectionEnd:h}}function Sf(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;let i=0;for(;i<r-n&&e[e.length-1-i]===t[t.length-1-i];)i++;return{start:n,end:e.length-i,insert:t.slice(n,t.length-i)}}var Cf=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform??``);function $({children:e}){return(0,I.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:`size-4 shrink-0`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:e})}var wf=[[{action:`heading`,label:`Heading`,shortcut:null,icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M4 3v10M12 3v10M4 8h8`})})},{action:`bold`,label:`Bold`,shortcut:{key:`b`,shift:!1,label:`B`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{strokeWidth:`1.9`,d:`M5 3h3.75a2.5 2.5 0 0 1 0 5H5zM5 8h4.25a2.5 2.5 0 0 1 0 5H5z`})})},{action:`italic`,label:`Italic`,shortcut:{key:`i`,shift:!1,label:`I`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M7.5 3H12M4 13h4.5M10 3 6 13`})})},{action:`strikethrough`,label:`Strikethrough`,shortcut:{key:`x`,shift:!0,label:`Shift+X`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M2.75 8h10.5M11 4.75C10.5 3.75 9.4 3 8 3 6.3 3 5 4 5 5.3c0 .8.4 1.4 1.1 1.8M5 11.25C5.5 12.25 6.6 13 8 13c1.7 0 3-1 3-2.3 0-.5-.15-.95-.45-1.3`})})}],[{action:`quote`,label:`Quote`,shortcut:{code:`Period`,shift:!0,label:`Shift+.`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M3 3.5v9M6.5 5h6.5M6.5 8h6.5M6.5 11h4`})})},{action:`code`,label:`Inline code`,shortcut:{key:`e`,shift:!1,label:`E`},icon:(0,I.jsx)($,{children:(0,I.jsx)(`path`,{d:`M5.75 4.5 2.5 8l3.25 3.5M10.25 4.5 13.5 8l-3.25 3.5`})})},{action:`code-block`,label:`Code block`,shortcut:null,icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`rect`,{x:`2`,y:`2.75`,width:`12`,height:`10.5`,rx:`1.75`}),(0,I.jsx)(`path`,{d:`M6.25 6.25 4.75 8l1.5 1.75M9.75 6.25 11.25 8l-1.5 1.75`})]})},{action:`link`,label:`Link`,shortcut:{key:`k`,shift:!1,label:`K`},icon:(0,I.jsx)(i,{className:`size-4`})}],[{action:`bulleted-list`,label:`Bulleted list`,shortcut:{code:`Digit8`,shift:!0,label:`Shift+8`},icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`path`,{d:`M6.5 4h6.5M6.5 8h6.5M6.5 12h6.5`}),(0,I.jsx)(`path`,{strokeWidth:`2.2`,d:`M3.25 4h.01M3.25 8h.01M3.25 12h.01`})]})},{action:`numbered-list`,label:`Numbered list`,shortcut:{code:`Digit7`,shift:!0,label:`Shift+7`},icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`path`,{d:`M7 4h6M7 8h6M7 12h6`}),(0,I.jsx)(`path`,{strokeWidth:`1.25`,d:`M2.75 3.25 3.75 2.75v3M2.5 10.25c.3-.5 1.9-.6 1.6.5L2.5 13h2`})]})},{action:`task-list`,label:`Task list`,shortcut:null,icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`rect`,{x:`2.25`,y:`2.75`,width:`3.5`,height:`3.5`,rx:`.75`}),(0,I.jsx)(`path`,{d:`M2.5 11.25 3.6 12.4 5.75 10M8 4.5h5M8 11.25h5`})]})}]],Tf={action:`suggestion`,label:`Suggest change`,shortcut:{key:`g`,shift:!1,label:`G`},icon:(0,I.jsxs)($,{children:[(0,I.jsx)(`path`,{d:`M8 2.75v5M5.5 5.25h5M5.5 11.5h5`}),(0,I.jsx)(`rect`,{x:`2.25`,y:`1.75`,width:`11.5`,height:`12.5`,rx:`2`})]})},Ef=[...wf.flat(),Tf],Df=Cf?`⌘`:`Ctrl+`;function Of(e){return Cf?`⌘${e.label.replace(`Shift+`,`⇧`)}`:`${Df}${e.label}`}function kf(e){return e.shortcut===null?e.label:`${e.label} (${Of(e.shortcut)})`}function Af(e,t){if(!(Cf?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)||e.altKey)return null;for(let n of Ef){let r=n.shortcut;if(r!==null&&r.shift===e.shiftKey&&(n.action!==`suggestion`||t)&&(r.code===void 0?e.key.toLowerCase()===r.key:e.code===r.code))return n.action}return null}var jf=`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted transition-colors hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--azd-focus)] disabled:cursor-not-allowed disabled:opacity-50`;function Mf({onAction:e,suggestion:t,disabled:n,label:r}){let i=t?[...wf,[Tf]]:wf,a=i.flat(),[o,s]=(0,F.useState)(0),c=(0,F.useRef)([]),l=e=>{let t=null;e.key===`ArrowRight`?t=(o+1)%a.length:e.key===`ArrowLeft`?t=(o-1+a.length)%a.length:e.key===`Home`?t=0:e.key===`End`&&(t=a.length-1),t!==null&&(e.preventDefault(),s(t),c.current[t]?.focus())},u=0;return(0,I.jsx)(`div`,{role:`toolbar`,"aria-label":r,"aria-orientation":`horizontal`,onKeyDown:l,className:`flex min-w-0 flex-wrap items-center gap-px`,"data-testid":`markdown-toolbar`,children:i.map((t,r)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-px`,children:[r>0&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-4 w-px shrink-0 bg-[var(--azd-border)]`}),t.map(t=>{let r=u++,i=t.action===`suggestion`;return(0,I.jsxs)(`button`,{ref:e=>{c.current[r]=e},type:`button`,tabIndex:r===o?0:-1,"aria-label":t.label,title:kf(t),...t.shortcut?.key===void 0?{}:{"aria-keyshortcuts":`${Cf?`Meta`:`Control`}+${t.shortcut.shift?`Shift+`:``}${t.shortcut.key.toUpperCase()}`},disabled:n,onMouseDown:e=>e.preventDefault(),onFocus:()=>s(r),onClick:()=>e(t.action),className:i?`inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-1.5 text-xs font-medium text-muted transition-colors hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--azd-focus)] disabled:cursor-not-allowed disabled:opacity-50`:jf,"data-action":t.action,children:[t.icon,i&&(0,I.jsx)(`span`,{className:`hidden @[27rem]:inline`,children:`Suggest change`})]},t.action)})]},t[0]?.action??r))})}function Nf({original:e,suggestion:t,where:n,children:r}){let i=e===null?t.map(e=>({kind:`added`,text:e})):P(e,t),a=e!==null&&t.length===0;return(0,I.jsxs)(`figure`,{className:`my-1.5 overflow-hidden rounded-[8px] border border-border bg-canvas`,"data-testid":`suggested-change`,"data-diff":e===null?`false`:`true`,children:[(0,I.jsxs)(`figcaption`,{className:`flex min-w-0 items-center gap-2 border-b border-border bg-header px-2.5 py-1 text-xs`,children:[(0,I.jsx)(`span`,{className:`font-medium text-fg`,children:`Suggested change`}),n!=null&&e!==null&&(0,I.jsx)(`span`,{className:`truncate text-muted tabular-nums`,children:n}),a&&(0,I.jsx)(`span`,{className:`text-muted`,children:`deletes these lines`}),(0,I.jsx)(`span`,{className:`ml-auto`,children:(0,I.jsx)(Pf,{text:t.join(`
47
+ `)})})]}),i.length===0?(0,I.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted`,children:`Empty suggestion.`}):(0,I.jsx)(`div`,{className:`overflow-x-auto py-1 font-mono text-xs leading-5 [tab-size:4]`,children:i.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex min-w-max ${e===null?``:t.kind===`removed`?`bg-deleted/12`:`bg-added/12`}`,"data-row":e===null?`text`:t.kind,children:[e!==null&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`w-6 shrink-0 select-none text-center ${t.kind===`removed`?`text-deleted`:`text-added`}`,children:t.kind===`removed`?`−`:`+`}),e!==null&&(0,I.jsx)(`span`,{className:`sr-only`,children:t.kind===`removed`?`Removed: `:`Added: `}),(0,I.jsx)(`span`,{className:`whitespace-pre pr-3 text-fg ${e===null?`pl-2.5`:``}`,children:t.text.length===0?` `:t.text})]},n))}),r!=null&&(0,I.jsx)(`div`,{className:`border-t border-border px-2.5 py-1.5`,children:r})]})}function Pf({text:e}){let[t,n]=(0,F.useState)(`idle`),r=(0,F.useRef)(void 0);(0,F.useEffect)(()=>()=>window.clearTimeout(r.current),[]);let i=async()=>{try{await navigator.clipboard.writeText(e),n(`copied`)}catch{n(`failed`)}window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(`idle`),1500)};return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>void i(),className:`inline-flex h-6 items-center gap-1 rounded-md px-1.5 text-xs text-muted hover:bg-hover hover:text-fg`,title:`Copy the suggested text`,children:[t===`copied`?(0,I.jsx)(j,{className:`size-3.5`}):(0,I.jsx)(m,{className:`size-3.5`}),(0,I.jsx)(`span`,{"aria-live":`polite`,children:t===`copied`?`Copied`:t===`failed`?`Copy failed`:`Copy`})]})}function Ff(e,t){let n=Sf(e.value,t.text);if(e.focus(),n.start!==n.end||n.insert.length>0){e.setSelectionRange(n.start,n.end);let r=!1;try{r=n.insert.length>0?document.execCommand(`insertText`,!1,n.insert):document.execCommand(`delete`,!1)}catch{r=!1}r&&e.value===t.text||(e.setRangeText(t.text,0,e.value.length),e.dispatchEvent(new Event(`input`,{bubbles:!0})))}e.setSelectionRange(t.selectionStart,t.selectionEnd)}function If(e){return{text:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}}var Lf=`inline-flex h-7 items-center rounded-[7px] border border-border bg-raised px-2.5 text-xs font-medium text-fg hover:border-border-strong hover:bg-hover disabled:cursor-not-allowed disabled:opacity-50`,Rf=`inline-flex h-7 items-center rounded-[7px] bg-primary px-2.5 text-xs font-medium text-primary-fg hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,zf=`h-6 rounded-md px-2 text-xs font-medium text-muted hover:text-fg aria-selected:bg-[var(--azd-selected)] aria-selected:text-fg`,Bf=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform??``);function Vf({drafts:e,draftKey:t,label:n,placeholder:r=`Leave a comment (Markdown)`,initialText:i=``,submitLabel:a,secondary:o,onSubmit:s,onCancel:c,busy:l,problem:u,autoFocus:d,onFocused:f,returnFocus:p,testId:m=`composer`,suggestion:h}){let[g,_]=(0,F.useState)(()=>{let n=e.read(t);return n.length>0?n:i}),[v,y]=(0,F.useState)(`write`),[b,x]=(0,F.useState)(!1),S=(0,F.useRef)(null),C=(0,F.useRef)(null),w=(0,F.useId)();(0,F.useEffect)(()=>{d&&(S.current?.focus(),f?.())},[d,f]),(0,F.useEffect)(()=>{b&&C.current?.focus()},[b]);let T=n=>{_(n),e.write(t,n===i?``:n)},E=g.trim().length===0,D=e=>{l||E||e(g)},O=()=>{e.clear(t),x(!1),c(),p?.()},k=()=>{l||(E||g===i?O():x(!0))},A=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),e.stopPropagation(),b||D(s)):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),b?(x(!1),S.current?.focus()):k())},ee=e=>{let t=S.current;t===null||l||(e!==`suggestion`||h!==void 0)&&Ff(t,af(If(t),e===`suggestion`?{kind:`suggestion`,lines:h?.original??[]}:e))},j=e=>{let t=e.currentTarget,n=Af(e,h!==void 0);if(n!==null)e.preventDefault(),e.stopPropagation(),ee(n);else if(e.key===`Enter`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.nativeEvent.isComposing){let n=xf(If(t));n!==null&&(e.preventDefault(),Ff(t,n))}},M=e=>{let t=e.clipboardData.getData(`text/plain`),n=df(If(e.currentTarget),t);n!==null&&(e.preventDefault(),Ff(e.currentTarget,n))},N=h?.original??null,te=(0,F.useCallback)(e=>{if(e.language!==`suggestion`)return null;let t=oe(g)[e.index]?.lines??le(e.text);return(0,I.jsx)(Nf,{original:N,suggestion:t})},[N,g]),P=Bf?`⌘↵`:`Ctrl+Enter`;return(0,I.jsxs)(`div`,{className:`max-w-3xl overflow-hidden rounded-[10px] border border-border bg-surface text-fg shadow-[0_1px_2px_rgb(0_0_0/0.08)] focus-within:border-border-strong`,"data-testid":m,onKeyDown:A,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border px-2 py-1.5`,role:`tablist`,children:[(0,I.jsx)(`button`,{type:`button`,role:`tab`,id:`${w}-write`,"aria-selected":v===`write`,"aria-controls":`${w}-panel`,className:zf,onClick:()=>{y(`write`),requestAnimationFrame(()=>S.current?.focus())},children:`Write`}),(0,I.jsx)(`button`,{type:`button`,role:`tab`,id:`${w}-preview`,"aria-selected":v===`preview`,"aria-controls":`${w}-panel`,className:zf,onClick:()=>y(`preview`),children:`Preview`}),(0,I.jsx)(`span`,{className:`ml-auto truncate pl-2 text-xs text-muted`,children:n})]}),(0,I.jsxs)(`div`,{id:`${w}-panel`,role:`tabpanel`,"aria-labelledby":`${w}-${v}`,className:`px-2 pt-2`,children:[v===`write`&&(0,I.jsx)(`div`,{className:`@container pb-1.5`,children:(0,I.jsx)(Mf,{label:`Formatting for ${n.charAt(0).toLowerCase()}${n.slice(1)}`,suggestion:h!==void 0,disabled:l,onAction:ee})}),v===`write`?(0,I.jsx)(`textarea`,{ref:S,"data-markdown-editor":``,"aria-label":n,placeholder:r,value:g,disabled:l,onChange:e=>T(e.currentTarget.value),onKeyDown:j,onPaste:M,rows:Math.min(12,Math.max(3,g.split(`
48
+ `).length+1)),className:`block w-full resize-y rounded-[7px] border border-border bg-canvas px-2.5 py-2 font-sans text-[13px] leading-relaxed text-fg placeholder:text-muted focus:border-[var(--azd-focus)] focus:outline-none disabled:opacity-60`}):(0,I.jsx)(`div`,{className:`min-h-[4.5rem] rounded-[7px] border border-border bg-canvas px-2.5 py-2 text-[13px]`,children:E?(0,I.jsx)(`p`,{className:`text-xs text-muted`,children:`Nothing to preview.`}):(0,I.jsx)(ef,{source:g,codeBlock:te})})]}),u!=null&&(0,I.jsx)(`div`,{className:`px-2 pt-2`,children:u}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 px-2 py-2`,children:b?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-xs text-fg`,role:`alert`,children:`Discard this comment?`}),(0,I.jsx)(`button`,{type:`button`,className:Lf,onClick:O,children:`Discard`}),(0,I.jsx)(`button`,{ref:C,type:`button`,className:Lf,onClick:()=>{x(!1),S.current?.focus()},children:`Keep editing`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:l?`Sending…`:`${P} to send · Esc to cancel`}),(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,className:Lf,onClick:k,disabled:l,children:`Cancel`}),o!==void 0&&(0,I.jsx)(`button`,{type:`button`,className:Lf,onClick:()=>D(o.onSubmit),disabled:l||E,children:o.label}),(0,I.jsx)(`button`,{type:`button`,className:Rf,onClick:()=>D(s),disabled:l||E,children:a})]})]})})]})}function Hf({review:e,errorKey:t,error:n,organization:r}){let i=e.describe(n);return i.kind===`sign-in`?(0,I.jsx)(`div`,{"data-testid":`write-problem`,children:(0,I.jsx)(je,{variant:`inline`,error:n,organization:r,onRetry:()=>e.clearError(t)})}):(0,I.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,"data-testid":`write-problem`,children:i.message})}var Uf=/@<([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})>/gi;function Wf(e){return e.replace(/[\\`*_{}[\]()#+\-.!|<>~]/g,e=>`\\${e}`)}function Gf(e,t){if(t.length===0||!e.includes(`@<`))return e;let n=new Map(t.map(e=>[e.id.toLowerCase(),e]));return e.replace(Uf,(e,t)=>{let r=n.get(t.toLowerCase());return r===void 0?e:`**@${Wf(r.displayName)}**`})}function Kf({path:e,where:t,branch:n,defaultMessage:r,canResolve:i,busy:a,problem:o,onConfirm:s,onClose:c}){let l=(0,F.useId)(),u=(0,F.useId)(),[d,f]=(0,F.useState)(r),[p,m]=(0,F.useState)(!0),h=d.trim().length===0;return(0,I.jsx)(he,{titleId:l,busy:a,onClose:c,testId:`apply-suggestion-dialog`,children:(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a||h||s({message:d.trim(),resolve:i&&p})},className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:l,className:`text-[16px] font-semibold text-fg-strong`,children:`Commit suggestion`}),(0,I.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:`One commit on the source branch replaces the lines with the suggestion.`})]}),(0,I.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1.5 rounded-[8px] bg-raised px-3 py-2 text-[13px]`,children:[(0,I.jsx)(`dt`,{className:`text-muted`,children:`File`}),(0,I.jsx)(`dd`,{className:`truncate font-mono text-xs leading-5 text-fg`,title:e,children:e}),(0,I.jsx)(`dt`,{className:`text-muted`,children:`Lines`}),(0,I.jsx)(`dd`,{className:`tabular-nums text-fg`,children:t}),(0,I.jsx)(`dt`,{className:`text-muted`,children:`Branch`}),(0,I.jsx)(`dd`,{className:`truncate font-mono text-xs leading-5 text-fg`,title:n,children:n})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`label`,{htmlFor:u,className:`block text-xs font-medium text-muted`,children:`Commit message`}),(0,I.jsx)(`textarea`,{id:u,value:d,disabled:a,onChange:e=>f(e.target.value),rows:4,className:`w-full resize-y rounded-[8px] border border-border bg-canvas px-2.5 py-2 font-mono text-xs text-fg focus:border-[var(--azd-focus)] focus:outline-none disabled:opacity-60`})]}),i&&(0,I.jsxs)(`label`,{className:`flex items-start gap-2.5 text-[13px] text-fg`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:p,disabled:a,onChange:e=>m(e.target.checked),className:`mt-0.5 accent-[var(--azd-accent)]`}),`Resolve thread`]}),o,(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:c,disabled:a,className:ee,children:`Cancel`}),(0,I.jsx)(`button`,{type:`submit`,disabled:a||h,className:x,"data-testid":`apply-suggestion-confirm`,children:a?`Committing…`:`Commit suggestion`})]})]})})}function qf(e,t){return e===t?`Line ${t}`:`Lines ${e}–${t}`}function Jf({thread:e,comment:t,block:n}){let r=wt(),i=(0,F.useMemo)(()=>oe(t.content),[t.content]),a=i[n.index]?.lines??le(n.text),o=Ne(e),s=o.kind===`line`&&o.side===`additions`?o:null,c=r===null||s===null?null:r.newSideLines(s.path,s.startLineNumber,s.lineNumber),l=s===null?null:qf(s.startLineNumber,s.lineNumber),u=r?.viewerIsAuthor===!0&&s!==null&&n.index===0&&!tt(e.id)&&!tt(t.id);return(0,I.jsx)(Nf,{original:c,suggestion:a,where:l,children:u&&r!==null&&s!==null?(0,I.jsx)(Yf,{environment:r,thread:e,comment:t,blockCount:i.length,path:s.path,startLine:s.startLineNumber,endLine:s.lineNumber,original:c,suggestion:a}):null})}function Yf({environment:e,thread:t,comment:n,blockCount:r,path:i,startLine:a,endLine:o,original:s,suggestion:c}){let l=`${t.id}:${n.id}`,u=Dt(e,l),[f,p]=(0,F.useState)(!1),m=(0,F.useRef)(null);if(u?.phase===`done`)return(0,I.jsxs)(`p`,{className:`text-xs text-fg`,role:`status`,"data-testid":`suggestion-applied`,children:[`Suggestion committed to `,(0,I.jsx)(`span`,{className:`font-mono`,children:e.branch}),` `,(0,I.jsx)(`a`,{href:u.url,target:`_blank`,rel:`noreferrer noopener`,className:`font-mono text-accent underline-offset-2 hover:underline`,children:u.commitId.slice(0,8)})]});if(r>1)return(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 text-xs text-muted`,children:[`This comment has `,r,` suggestions; azdiffs applies one at a time.`,(0,I.jsxs)(`a`,{href:e.pullRequestUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 font-medium text-accent underline-offset-2 hover:underline`,children:[`Apply in Azure DevOps`,(0,I.jsx)(d,{className:`size-3`})]})]});let h=e.blocked??(s===null?`The lines this suggestion replaces are not loaded here.`:null);if(h!==null||s===null)return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted`,children:[(0,I.jsx)(`button`,{type:`button`,className:N,disabled:!0,children:`Apply suggestion`}),(0,I.jsx)(`span`,{"data-testid":`apply-blocked`,children:h})]});let g=u?.phase===`busy`,_=()=>{p(!1),e.clear(l),requestAnimationFrame(()=>m.current?.focus())},v=u?.phase===`error`?u.signIn===null?(0,I.jsx)(`p`,{role:`alert`,className:`text-[13px] text-danger`,"data-testid":`apply-problem`,children:u.message}):(0,I.jsx)(je,{variant:`inline`,error:u.signIn,organization:e.organization,onRetry:()=>e.clear(l)}):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{ref:m,type:`button`,className:N,onClick:()=>p(!0),"data-testid":`apply-suggestion`,children:`Apply suggestion`}),f&&(0,I.jsx)(Kf,{path:i,where:qf(a,o),branch:e.branch,defaultMessage:fe({reviewer:n.author.displayName,pullRequestId:e.pullRequestId,threadId:t.id}),canResolve:!Ie(t.status),busy:g,problem:v,onConfirm:({message:n,resolve:r})=>e.apply({key:l,thread:t,path:i,startLine:a,endLine:o,original:s,suggestion:c,message:n,resolve:r}),onClose:_})]})}var Xf={active:`text-accent`,pending:`text-accent`},Zf=[`active`,`pending`,`fixed`,`wontFix`,`closed`],Qf=`rounded-md px-1.5 py-0.5 text-xs text-muted hover:bg-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`;function $f({thread:e}){if(e.status===null)return null;let t=Ie(e.status);return(0,I.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-raised px-2 text-xs leading-5 shadow-[0_0_0_1px_var(--azd-border)] ${Xf[e.status]??`text-muted`}`,"data-testid":`thread-status`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:t?`✓`:`●`}),ze[e.status]]})}function ep({thread:e,label:t}){let n=ht(),r=Pe(e),[i,a]=(0,F.useState)(()=>!Ie(e.status)),o=r[0];if(o===void 0)return null;let s=r.slice(1),c=tt(e.id);return(0,I.jsxs)(`article`,{className:`max-w-3xl overflow-hidden rounded-[10px] border border-border bg-surface text-[13px] text-fg`,"data-testid":`thread`,"data-thread-id":c?void 0:e.id,"data-sending":c?`true`:void 0,"aria-label":t??`Comment thread by ${o.author.displayName}`,"aria-busy":c,children:[(0,I.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 px-3 py-2`,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-muted`,children:i?(0,I.jsx)(y,{className:`size-3.5`}):(0,I.jsx)(l,{className:`size-3.5`})}),(0,I.jsx)(`span`,{className:`sr-only`,children:i?`Collapse thread`:`Expand thread`}),(0,I.jsx)(S,{name:o.author.displayName,size:`sm`}),(0,I.jsx)(`span`,{className:`shrink-0 font-medium`,children:o.author.displayName}),(0,I.jsx)(`time`,{className:`shrink-0 text-xs text-muted`,dateTime:o.publishedDate??void 0,title:Ae(o.publishedDate),children:ke(o.publishedDate)}),!i&&(0,I.jsxs)(`span`,{className:`min-w-0 truncate text-muted`,children:[lp(Gf(o.content,e.identities)),s.length>0?` · ${s.length} ${s.length===1?`reply`:`replies`}`:``]})]}),c?(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:`Sending…`}):(0,I.jsx)($f,{thread:e})]}),i&&(0,I.jsxs)(`div`,{className:`border-t border-border px-3 pt-2.5 pb-3`,children:[(0,I.jsx)(np,{thread:e,comment:o,review:n}),s.length>0&&(0,I.jsx)(`ol`,{className:`mt-3 space-y-3 border-l-2 border-border pl-3`,children:s.map(t=>(0,I.jsxs)(`li`,{children:[(0,I.jsx)(tp,{comment:t,thread:e,review:n}),(0,I.jsx)(np,{thread:e,comment:t,review:n})]},t.id))}),n!==null&&!c&&(0,I.jsx)(ap,{thread:e,review:n})]})]})}function tp({comment:e,thread:t,review:n}){return(0,I.jsxs)(`p`,{className:`mb-1 flex items-center gap-2`,children:[(0,I.jsx)(S,{name:e.author.displayName,size:`sm`}),(0,I.jsx)(`span`,{className:`font-medium`,children:e.author.displayName}),(0,I.jsx)(`time`,{className:`text-xs text-muted`,dateTime:e.publishedDate??void 0,title:Ae(e.publishedDate),children:ke(e.publishedDate)}),tt(e.id)&&(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:`Sending…`}),n!==null&&(0,I.jsx)(ip,{thread:t,comment:e,review:n})]})}function np({thread:e,comment:t,review:n}){let r=Ge(e.id,t.id),i=B(n?.store??sp,e=>n!==null&&e.editing.has(r)),a=e.comments.find(e=>!e.isDeleted)?.id===t.id,o=(0,F.useCallback)(n=>n.language===`suggestion`?(0,I.jsx)(Jf,{thread:e,comment:t,block:n}):null,[e,t]);return n!==null&&i?(0,I.jsx)(rp,{thread:e,comment:t,review:n}):(0,I.jsxs)(`div`,{className:`group/comment relative`,children:[(0,I.jsx)(ef,{source:Gf(t.content,e.identities),codeBlock:o}),a&&n!==null&&(0,I.jsx)(`div`,{className:`mt-0.5 flex justify-end`,children:(0,I.jsx)(ip,{thread:e,comment:t,review:n})})]})}function rp({thread:e,comment:t,review:n}){let r=Ge(e.id,t.id),i=B(n.store,e=>e.busy.has(r)),a=B(n.store,e=>e.errors.get(r)),o=B(n.store,e=>e.focus===r),s=op(e);return(0,I.jsx)(`div`,{className:`my-1`,children:(0,I.jsx)(Vf,{suggestion:s,drafts:n.drafts,draftKey:r,label:`Edit comment`,initialText:t.content,submitLabel:`Save`,busy:i,autoFocus:o,onFocused:()=>n.store.update(()=>({focus:null})),onSubmit:r=>n.edit(e,t,r),onCancel:()=>n.setEditing(e.id,t.id,!1),problem:a===void 0?null:(0,I.jsx)(Hf,{review:n,errorKey:r,error:a,organization:n.organization}),testId:`comment-editor`})})}function ip({thread:e,comment:t,review:n}){let[r,i]=(0,F.useState)(!1),a=B(n.store,t=>t.busy.has(R(e.id))),o=(0,F.useRef)(null),s=(0,F.useRef)(null);return(0,F.useEffect)(()=>{r&&s.current?.focus()},[r]),!n.isMine(t)||tt(t.id)||tt(e.id)||t.commentType!==`text`?null:r?(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 text-xs`,children:[(0,I.jsx)(`span`,{role:`alert`,children:`Delete this comment?`}),(0,I.jsx)(`button`,{ref:s,type:`button`,className:`${Qf} text-danger`,onClick:()=>{i(!1),n.remove(e,t)},children:`Delete`}),(0,I.jsx)(`button`,{type:`button`,className:Qf,onClick:()=>{i(!1),requestAnimationFrame(()=>o.current?.focus())},onKeyDown:e=>{e.key===`Escape`&&i(!1)},children:`Cancel`})]}):(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,className:Qf,disabled:a,"aria-label":`Edit comment`,onClick:()=>n.setEditing(e.id,t.id,!0),children:`Edit`}),(0,I.jsx)(`button`,{ref:o,type:`button`,className:Qf,disabled:a,"aria-label":`Delete comment`,onClick:()=>i(!0),children:`Delete`})]})}function ap({thread:e,review:t}){let n=L(e.id),r=B(t.store,t=>t.replies.has(e.id)),i=B(t.store,e=>e.busy.has(n)),a=B(t.store,e=>e.errors.get(n)),o=B(t.store,e=>e.focus===n),s=B(t.store,t=>t.busy.has(R(e.id))),c=B(t.store,t=>t.errors.get(R(e.id))),l=(0,F.useRef)(null),u=t.drafts.read(n).length>0,d=Ie(e.status),f=e.comments.length>=500,p=r||u&&!i,m=op(e);return(0,I.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[p?(0,I.jsx)(Vf,{suggestion:m,drafts:t.drafts,draftKey:n,label:`Reply`,placeholder:`Reply (Markdown)`,submitLabel:`Reply`,secondary:d?void 0:{label:`Reply & resolve`,onSubmit:n=>t.reply(e,n,{resolve:!0})},busy:i,autoFocus:o,onFocused:()=>t.store.update(()=>({focus:null})),onSubmit:n=>t.reply(e,n),onCancel:()=>t.setReplyOpen(e.id,!1),returnFocus:()=>requestAnimationFrame(()=>l.current?.focus()),problem:a===void 0?null:(0,I.jsx)(Hf,{review:t,errorKey:n,error:a,organization:t.organization}),testId:`reply-composer`}):null,(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[!p&&(0,I.jsx)(`button`,{ref:l,type:`button`,disabled:f,title:f?`This thread has reached 500 comments`:void 0,onClick:()=>t.setReplyOpen(e.id,!0),className:`h-7 min-w-0 flex-1 rounded-[7px] border border-border bg-canvas px-2.5 text-left text-xs text-muted hover:border-border-strong hover:text-fg disabled:opacity-50`,children:`Reply…`}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2 ${p?`ml-auto`:``}`,children:[(0,I.jsx)(`button`,{type:`button`,className:N,disabled:s,onClick:()=>t.setStatus(e,d?`active`:`fixed`),children:d?`Reopen`:`Resolve`}),(0,I.jsx)(`label`,{className:`sr-only`,htmlFor:`status-${e.id}`,children:`Thread status`}),(0,I.jsxs)(`select`,{id:`status-${e.id}`,value:e.status??`unknown`,disabled:s,onChange:n=>t.setStatus(e,n.currentTarget.value),className:`h-6 rounded-md border border-border bg-raised px-1.5 text-xs text-fg hover:border-border-strong disabled:opacity-50`,"data-testid":`status-select`,children:[e.status!==null&&!Zf.includes(e.status)&&(0,I.jsx)(`option`,{value:e.status,disabled:!0,children:ze[e.status]}),Zf.map(e=>(0,I.jsx)(`option`,{value:e,children:ze[e]},e))]})]})]}),c!==void 0&&(0,I.jsx)(Hf,{review:t,errorKey:R(e.id),error:c,organization:t.organization})]})}function op(e){let t=wt(),n=Ne(e);if(t===null||n.kind!==`line`||n.side!==`additions`)return;let r=t.newSideLines(n.path,n.startLineNumber,n.lineNumber);return r===null?void 0:{original:r}}var sp={get:()=>cp,update:()=>{},subscribe:()=>()=>{}},cp={composers:[],replies:new Set,editing:new Set,busy:new Set,errors:new Map,focus:null};function lp(e){return(e.split(`
49
+ `).find(e=>e.trim().length>0)??``).replace(/[`*_#>[\]()!\\]/g,``).trim().slice(0,140)}var up={added:`Added`,modified:`Modified`,deleted:`Deleted`,renamed:`Renamed`},dp={added:`text-added`,modified:`text-modified`,deleted:`text-deleted`,renamed:`text-renamed`};function fp({change:e,path:t}){return(0,I.jsxs)(`span`,{title:up[e],"data-testid":`change-marker`,"data-change":e,"data-path":t,className:`inline-flex shrink-0 ${dp[e]}`,children:[(0,I.jsx)(o,{change:e}),(0,I.jsx)(`span`,{className:`sr-only`,children:up[e]})]})}function pp(e){let t=e.lastIndexOf(`/`);return t===-1?{name:e,directory:``}:{name:e.slice(t+1),directory:e.slice(0,t)}}function mp({summary:e,generated:t,collapsed:n,onToggleCollapsed:i,viewed:a,onViewedChange:o,onCommentOnFile:s,webUrl:c,conflict:u}){let{file:p}=e,{name:h,directory:g}=pp(p.path),[_,v]=(0,F.useState)(!1),b=()=>{navigator.clipboard.writeText(p.path).then(()=>{v(!0),window.setTimeout(()=>v(!1),1200)},()=>v(!1))},x=[...s===void 0?[]:[{label:`Comment on file`,icon:(0,I.jsx)(r,{className:`size-3.5`}),onSelect:s,testId:`comment-on-file`}],{label:`Copy path`,icon:(0,I.jsx)(m,{className:`size-3.5`}),onSelect:b},{label:`Open file in Azure DevOps`,icon:(0,I.jsx)(d,{className:`size-3.5`}),onSelect:()=>window.open(c,`_blank`,`noopener,noreferrer`)}],S=e.stats;return(0,I.jsxs)(`div`,{className:`azd-file-header flex items-center gap-2 bg-header pr-2 pl-2 font-sans text-[13px] text-fg ${n?``:`shadow-[inset_0_-1px_0_var(--azd-border)]`}`,style:{height:44},"data-testid":`file-header`,"data-path":p.path,children:[(0,I.jsx)(`button`,{type:`button`,onClick:i,"aria-expanded":!n,"aria-label":`${n?`Expand`:`Collapse`} ${p.path}`,title:n?`Expand (x)`:`Collapse (x)`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg`,children:n?(0,I.jsx)(l,{className:`size-3.5`}):(0,I.jsx)(y,{className:`size-3.5`})}),(0,I.jsx)(fp,{change:p.change,path:p.path}),(0,I.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,title:p.path,children:[(0,I.jsx)(`span`,{className:`shrink-0 truncate font-medium text-fg-strong`,children:h}),g.length>0&&(0,I.jsx)(`span`,{className:`min-w-0 truncate text-muted [direction:rtl] [text-align:left]`,children:(0,I.jsx)(`bdi`,{children:g})}),p.change===`renamed`&&p.originalPath!==void 0&&(0,I.jsxs)(`span`,{className:`min-w-0 shrink truncate text-xs text-muted`,children:[`from `,(0,I.jsx)(`span`,{className:`font-mono`,children:p.originalPath})]})]}),(0,I.jsx)(`button`,{type:`button`,onClick:b,"aria-label":`Copy path ${p.path}`,title:`Copy path`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg`,children:_?(0,I.jsx)(`span`,{className:`text-[10px] text-fg`,children:`✓`}):(0,I.jsx)(m,{className:`size-3.5`})}),u,t&&(0,I.jsx)(`span`,{className:`shrink-0 rounded-md px-1.5 text-xs leading-5 text-muted shadow-[0_0_0_1px_var(--azd-border)]`,children:`Generated file`}),(0,I.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-3 pl-2`,children:[e.threadCount>0&&(0,I.jsxs)(`span`,{title:`${e.threadCount} comment ${e.threadCount===1?`thread`:`threads`}`,className:`flex items-center gap-1 text-xs tabular-nums text-muted`,children:[(0,I.jsx)(D,{className:`size-3.5`}),e.threadCount,(0,I.jsx)(`span`,{className:`sr-only`,children:` comment threads`})]}),S!==null&&(0,I.jsx)(w,{additions:S.additions,deletions:S.deletions}),o!==void 0&&(0,I.jsxs)(I.Fragment,{children:[(S!==null||e.threadCount>0)&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border`}),(0,I.jsxs)(`label`,{className:`flex h-7 cursor-pointer items-center gap-2 rounded-md px-1.5 text-[13px] text-muted hover:bg-hover hover:text-fg has-[:checked]:text-fg`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:a===!0,onChange:e=>o(e.currentTarget.checked),"aria-label":`Viewed ${p.path}`,className:`size-3.5`}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`Viewed`})]})]}),(0,I.jsx)(be,{label:`File actions for ${p.path}`,entries:x,trigger:e=>(0,I.jsx)(`button`,{type:`button`,...e,ref:e.ref,"aria-label":`More actions for ${p.path}`,title:`More actions`,className:`inline-flex size-7 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg aria-expanded:bg-hover aria-expanded:text-fg`,"data-testid":`file-menu-button`,children:(0,I.jsx)(f,{className:`size-4`})})})]})]})}export{Re as A,mt as C,We as D,B as E,Be as M,Le as N,Ke as O,wt as S,_t as T,Ft as _,Vf as a,Ct as b,cn as c,Kt as d,Jt as f,Bt as g,Vt as h,Hf as i,Ie as j,Ne as k,Xt as l,Ut as m,mp as n,ef as o,Zt as p,ep as r,on as s,up as t,qt as u,It as v,ht as w,Mt as x,Pt as y};