@phosart/devtool 0.3.2 → 0.3.3

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 (164) hide show
  1. package/build/client/editor/_app/immutable/assets/{0.Ux16ViYx.css → 0.BMnYWEys.css} +1 -1
  2. package/build/client/editor/_app/immutable/assets/0.BMnYWEys.css.br +0 -0
  3. package/build/client/editor/_app/immutable/assets/0.BMnYWEys.css.gz +0 -0
  4. package/build/client/editor/_app/immutable/chunks/{CBMGMT01.js → 36fRYPqv.js} +1 -1
  5. package/build/client/editor/_app/immutable/chunks/36fRYPqv.js.br +0 -0
  6. package/build/client/editor/_app/immutable/chunks/36fRYPqv.js.gz +0 -0
  7. package/build/client/editor/_app/immutable/chunks/{BFkkllAS.js → BDsuxU11.js} +1 -1
  8. package/build/client/editor/_app/immutable/chunks/BDsuxU11.js.br +1 -0
  9. package/build/client/editor/_app/immutable/chunks/BDsuxU11.js.gz +0 -0
  10. package/build/client/editor/_app/immutable/chunks/{CBMG66Ob.js → BY8Jsuov.js} +1 -1
  11. package/build/client/editor/_app/immutable/chunks/BY8Jsuov.js.br +0 -0
  12. package/build/client/editor/_app/immutable/chunks/BY8Jsuov.js.gz +0 -0
  13. package/build/client/editor/_app/immutable/chunks/{BomMr_SJ.js → Ba5SSrNi.js} +1 -1
  14. package/build/client/editor/_app/immutable/chunks/Ba5SSrNi.js.br +0 -0
  15. package/build/client/editor/_app/immutable/chunks/Ba5SSrNi.js.gz +0 -0
  16. package/build/client/editor/_app/immutable/chunks/{TKefEoMN.js → BiZuc77T.js} +1 -1
  17. package/build/client/editor/_app/immutable/chunks/BiZuc77T.js.br +0 -0
  18. package/build/client/editor/_app/immutable/chunks/BiZuc77T.js.gz +0 -0
  19. package/build/client/editor/_app/immutable/chunks/{DG3gtbPS.js → C7QddZX6.js} +1 -1
  20. package/build/client/editor/_app/immutable/chunks/C7QddZX6.js.br +0 -0
  21. package/build/client/editor/_app/immutable/chunks/C7QddZX6.js.gz +0 -0
  22. package/build/client/editor/_app/immutable/chunks/{BFrNG_16.js → C9apqzJz.js} +1 -1
  23. package/build/client/editor/_app/immutable/chunks/C9apqzJz.js.br +0 -0
  24. package/build/client/editor/_app/immutable/chunks/C9apqzJz.js.gz +0 -0
  25. package/build/client/editor/_app/immutable/chunks/CGRPYk0Z.js +3 -0
  26. package/build/client/editor/_app/immutable/chunks/CGRPYk0Z.js.br +0 -0
  27. package/build/client/editor/_app/immutable/chunks/CGRPYk0Z.js.gz +0 -0
  28. package/build/client/editor/_app/immutable/chunks/{D338WAuH.js → CWeHQSrA.js} +1 -1
  29. package/build/client/editor/_app/immutable/chunks/CWeHQSrA.js.br +0 -0
  30. package/build/client/editor/_app/immutable/chunks/CWeHQSrA.js.gz +0 -0
  31. package/build/client/editor/_app/immutable/chunks/{ByNbHZHE.js → D6oxHNYy.js} +1 -1
  32. package/build/client/editor/_app/immutable/chunks/D6oxHNYy.js.br +0 -0
  33. package/build/client/editor/_app/immutable/chunks/D6oxHNYy.js.gz +0 -0
  34. package/build/client/editor/_app/immutable/chunks/{DGnDs2M4.js → DAsycyym.js} +1 -1
  35. package/build/client/editor/_app/immutable/chunks/DAsycyym.js.br +0 -0
  36. package/build/client/editor/_app/immutable/chunks/DAsycyym.js.gz +0 -0
  37. package/build/client/editor/_app/immutable/chunks/{BmRN1zm0.js → DaWb7mMs.js} +1 -1
  38. package/build/client/editor/_app/immutable/chunks/DaWb7mMs.js.br +0 -0
  39. package/build/client/editor/_app/immutable/chunks/DaWb7mMs.js.gz +0 -0
  40. package/build/client/editor/_app/immutable/chunks/{C64_a0rj.js → Dg3PYjM6.js} +1 -1
  41. package/build/client/editor/_app/immutable/chunks/Dg3PYjM6.js.br +0 -0
  42. package/build/client/editor/_app/immutable/chunks/Dg3PYjM6.js.gz +0 -0
  43. package/build/client/editor/_app/immutable/chunks/{B9zDOVGT.js → Dj5A_YN9.js} +1 -1
  44. package/build/client/editor/_app/immutable/chunks/Dj5A_YN9.js.br +0 -0
  45. package/build/client/editor/_app/immutable/chunks/Dj5A_YN9.js.gz +0 -0
  46. package/build/client/editor/_app/immutable/chunks/{B1GIV-2D.js → Y3Jw1gDP.js} +1 -1
  47. package/build/client/editor/_app/immutable/chunks/Y3Jw1gDP.js.br +0 -0
  48. package/build/client/editor/_app/immutable/chunks/Y3Jw1gDP.js.gz +0 -0
  49. package/build/client/editor/_app/immutable/chunks/{DPqQ6q9T.js → _QiFnDly.js} +1 -1
  50. package/build/client/editor/_app/immutable/chunks/_QiFnDly.js.br +0 -0
  51. package/build/client/editor/_app/immutable/chunks/_QiFnDly.js.gz +0 -0
  52. package/build/client/editor/_app/immutable/entry/{app.D5XlxorX.js → app.BV0kyKCW.js} +2 -2
  53. package/build/client/editor/_app/immutable/entry/app.BV0kyKCW.js.br +0 -0
  54. package/build/client/editor/_app/immutable/entry/app.BV0kyKCW.js.gz +0 -0
  55. package/build/client/editor/_app/immutable/entry/start.D-Sr3qC_.js +1 -0
  56. package/build/client/editor/_app/immutable/entry/start.D-Sr3qC_.js.br +2 -0
  57. package/build/client/editor/_app/immutable/entry/start.D-Sr3qC_.js.gz +0 -0
  58. package/build/client/editor/_app/immutable/nodes/{0.COJVMh4B.js → 0.C818YFK2.js} +1 -1
  59. package/build/client/editor/_app/immutable/nodes/0.C818YFK2.js.br +0 -0
  60. package/build/client/editor/_app/immutable/nodes/0.C818YFK2.js.gz +0 -0
  61. package/build/client/editor/_app/immutable/nodes/{1.DJaftbwV.js → 1.DLP9aYs0.js} +1 -1
  62. package/build/client/editor/_app/immutable/nodes/1.DLP9aYs0.js.br +0 -0
  63. package/build/client/editor/_app/immutable/nodes/1.DLP9aYs0.js.gz +0 -0
  64. package/build/client/editor/_app/immutable/nodes/{2.hSg-60Cn.js → 2.BVlID6hX.js} +1 -1
  65. package/build/client/editor/_app/immutable/nodes/2.BVlID6hX.js.br +0 -0
  66. package/build/client/editor/_app/immutable/nodes/2.BVlID6hX.js.gz +0 -0
  67. package/build/client/editor/_app/immutable/nodes/{3.QrFuulIk.js → 3.CNi9wRJI.js} +1 -1
  68. package/build/client/editor/_app/immutable/nodes/3.CNi9wRJI.js.br +0 -0
  69. package/build/client/editor/_app/immutable/nodes/3.CNi9wRJI.js.gz +0 -0
  70. package/build/client/editor/_app/immutable/nodes/{4.C5GE3M0L.js → 4.DjfUZW-0.js} +2 -2
  71. package/build/client/editor/_app/immutable/nodes/4.DjfUZW-0.js.br +0 -0
  72. package/build/client/editor/_app/immutable/nodes/4.DjfUZW-0.js.gz +0 -0
  73. package/build/client/editor/_app/immutable/nodes/{5.BYmoKSds.js → 5.DpzxICR_.js} +1 -1
  74. package/build/client/editor/_app/immutable/nodes/5.DpzxICR_.js.br +0 -0
  75. package/build/client/editor/_app/immutable/nodes/5.DpzxICR_.js.gz +0 -0
  76. package/build/client/editor/_app/immutable/nodes/6.CMSmT3-z.js +1 -0
  77. package/build/client/editor/_app/immutable/nodes/6.CMSmT3-z.js.br +0 -0
  78. package/build/client/editor/_app/immutable/nodes/6.CMSmT3-z.js.gz +0 -0
  79. package/build/client/editor/_app/immutable/nodes/{7.CNlICHs1.js → 7.KYo096cz.js} +1 -1
  80. package/build/client/editor/_app/immutable/nodes/7.KYo096cz.js.br +0 -0
  81. package/build/client/editor/_app/immutable/nodes/7.KYo096cz.js.gz +0 -0
  82. package/build/client/editor/_app/version.json +1 -1
  83. package/build/client/editor/_app/version.json.br +0 -0
  84. package/build/client/editor/_app/version.json.gz +0 -0
  85. package/build/server/chunks/{0-Dfk_TJeb.js → 0-Cl82DFHp.js} +3 -3
  86. package/build/server/chunks/{0-Dfk_TJeb.js.map → 0-Cl82DFHp.js.map} +1 -1
  87. package/build/server/chunks/{1-CxKhMY3h.js → 1-WZpvXsvK.js} +2 -2
  88. package/build/server/chunks/{1-CxKhMY3h.js.map → 1-WZpvXsvK.js.map} +1 -1
  89. package/build/server/chunks/{2-BVitWtY7.js → 2-BSdBJsoK.js} +2 -2
  90. package/build/server/chunks/{2-BVitWtY7.js.map → 2-BSdBJsoK.js.map} +1 -1
  91. package/build/server/chunks/{3-6rwM2N3L.js → 3-DwVuBR19.js} +2 -2
  92. package/build/server/chunks/{3-6rwM2N3L.js.map → 3-DwVuBR19.js.map} +1 -1
  93. package/build/server/chunks/{4-unIEe-sR.js → 4-C9UZaWrt.js} +3 -3
  94. package/build/server/chunks/{4-unIEe-sR.js.map → 4-C9UZaWrt.js.map} +1 -1
  95. package/build/server/chunks/{5-VgpV3S3k.js → 5-CJ1jxAcG.js} +2 -2
  96. package/build/server/chunks/{5-VgpV3S3k.js.map → 5-CJ1jxAcG.js.map} +1 -1
  97. package/build/server/chunks/{6-BoPXva6f.js → 6-Camf_PqY.js} +2 -2
  98. package/build/server/chunks/{6-BoPXva6f.js.map → 6-Camf_PqY.js.map} +1 -1
  99. package/build/server/chunks/{7-Cz84aPi5.js → 7-CZ8SjQUv.js} +2 -2
  100. package/build/server/chunks/{7-Cz84aPi5.js.map → 7-CZ8SjQUv.js.map} +1 -1
  101. package/build/server/chunks/{_page.svelte-dnxmJ_RW.js → _page.svelte-B6Fk2uaq.js} +5 -5
  102. package/build/server/chunks/{_page.svelte-dnxmJ_RW.js.map → _page.svelte-B6Fk2uaq.js.map} +1 -1
  103. package/build/server/index.js +1 -1
  104. package/build/server/index.js.map +1 -1
  105. package/build/server/manifest.js +9 -9
  106. package/build/server/manifest.js.map +1 -1
  107. package/package.json +1 -1
  108. package/build/client/editor/_app/immutable/assets/0.Ux16ViYx.css.br +0 -0
  109. package/build/client/editor/_app/immutable/assets/0.Ux16ViYx.css.gz +0 -0
  110. package/build/client/editor/_app/immutable/chunks/B1GIV-2D.js.br +0 -0
  111. package/build/client/editor/_app/immutable/chunks/B1GIV-2D.js.gz +0 -0
  112. package/build/client/editor/_app/immutable/chunks/B9zDOVGT.js.br +0 -0
  113. package/build/client/editor/_app/immutable/chunks/B9zDOVGT.js.gz +0 -0
  114. package/build/client/editor/_app/immutable/chunks/BFkkllAS.js.br +0 -1
  115. package/build/client/editor/_app/immutable/chunks/BFkkllAS.js.gz +0 -0
  116. package/build/client/editor/_app/immutable/chunks/BFrNG_16.js.br +0 -0
  117. package/build/client/editor/_app/immutable/chunks/BFrNG_16.js.gz +0 -0
  118. package/build/client/editor/_app/immutable/chunks/BmRN1zm0.js.br +0 -0
  119. package/build/client/editor/_app/immutable/chunks/BmRN1zm0.js.gz +0 -0
  120. package/build/client/editor/_app/immutable/chunks/BomMr_SJ.js.br +0 -0
  121. package/build/client/editor/_app/immutable/chunks/BomMr_SJ.js.gz +0 -0
  122. package/build/client/editor/_app/immutable/chunks/ByNbHZHE.js.br +0 -0
  123. package/build/client/editor/_app/immutable/chunks/ByNbHZHE.js.gz +0 -0
  124. package/build/client/editor/_app/immutable/chunks/C64_a0rj.js.br +0 -0
  125. package/build/client/editor/_app/immutable/chunks/C64_a0rj.js.gz +0 -0
  126. package/build/client/editor/_app/immutable/chunks/CBMG66Ob.js.br +0 -0
  127. package/build/client/editor/_app/immutable/chunks/CBMG66Ob.js.gz +0 -0
  128. package/build/client/editor/_app/immutable/chunks/CBMGMT01.js.br +0 -0
  129. package/build/client/editor/_app/immutable/chunks/CBMGMT01.js.gz +0 -0
  130. package/build/client/editor/_app/immutable/chunks/D338WAuH.js.br +0 -0
  131. package/build/client/editor/_app/immutable/chunks/D338WAuH.js.gz +0 -0
  132. package/build/client/editor/_app/immutable/chunks/DG3gtbPS.js.br +0 -0
  133. package/build/client/editor/_app/immutable/chunks/DG3gtbPS.js.gz +0 -0
  134. package/build/client/editor/_app/immutable/chunks/DGnDs2M4.js.br +0 -0
  135. package/build/client/editor/_app/immutable/chunks/DGnDs2M4.js.gz +0 -0
  136. package/build/client/editor/_app/immutable/chunks/DPqQ6q9T.js.br +0 -0
  137. package/build/client/editor/_app/immutable/chunks/DPqQ6q9T.js.gz +0 -0
  138. package/build/client/editor/_app/immutable/chunks/TKefEoMN.js.br +0 -0
  139. package/build/client/editor/_app/immutable/chunks/TKefEoMN.js.gz +0 -0
  140. package/build/client/editor/_app/immutable/chunks/YzpLcnjN.js +0 -3
  141. package/build/client/editor/_app/immutable/chunks/YzpLcnjN.js.br +0 -0
  142. package/build/client/editor/_app/immutable/chunks/YzpLcnjN.js.gz +0 -0
  143. package/build/client/editor/_app/immutable/entry/app.D5XlxorX.js.br +0 -0
  144. package/build/client/editor/_app/immutable/entry/app.D5XlxorX.js.gz +0 -0
  145. package/build/client/editor/_app/immutable/entry/start.BhTJ0i9W.js +0 -1
  146. package/build/client/editor/_app/immutable/entry/start.BhTJ0i9W.js.br +0 -2
  147. package/build/client/editor/_app/immutable/entry/start.BhTJ0i9W.js.gz +0 -0
  148. package/build/client/editor/_app/immutable/nodes/0.COJVMh4B.js.br +0 -0
  149. package/build/client/editor/_app/immutable/nodes/0.COJVMh4B.js.gz +0 -0
  150. package/build/client/editor/_app/immutable/nodes/1.DJaftbwV.js.br +0 -0
  151. package/build/client/editor/_app/immutable/nodes/1.DJaftbwV.js.gz +0 -0
  152. package/build/client/editor/_app/immutable/nodes/2.hSg-60Cn.js.br +0 -0
  153. package/build/client/editor/_app/immutable/nodes/2.hSg-60Cn.js.gz +0 -0
  154. package/build/client/editor/_app/immutable/nodes/3.QrFuulIk.js.br +0 -0
  155. package/build/client/editor/_app/immutable/nodes/3.QrFuulIk.js.gz +0 -0
  156. package/build/client/editor/_app/immutable/nodes/4.C5GE3M0L.js.br +0 -0
  157. package/build/client/editor/_app/immutable/nodes/4.C5GE3M0L.js.gz +0 -0
  158. package/build/client/editor/_app/immutable/nodes/5.BYmoKSds.js.br +0 -0
  159. package/build/client/editor/_app/immutable/nodes/5.BYmoKSds.js.gz +0 -0
  160. package/build/client/editor/_app/immutable/nodes/6.C2Oepmc8.js +0 -1
  161. package/build/client/editor/_app/immutable/nodes/6.C2Oepmc8.js.br +0 -2
  162. package/build/client/editor/_app/immutable/nodes/6.C2Oepmc8.js.gz +0 -0
  163. package/build/client/editor/_app/immutable/nodes/7.CNlICHs1.js.br +0 -0
  164. package/build/client/editor/_app/immutable/nodes/7.CNlICHs1.js.gz +0 -0
@@ -1,4 +1,4 @@
1
- import{g as Zt,c as ft,a as ne,d as sl,p as cl,f as pe,b as qe,s as Jt}from"../chunks/C-A59nkV.js";import{m as Ft,y as Vn,av as vt,t as Ve,q as Wn,U as fl,bn as hl,A as Qn,aC as pl,aE as ml,aL as dl,aF as gl,au as yl,a_ as xl,bo as kl,p as nt,f as Qe,n as Oe,a as rt,h as He,b as Yn,g as A,k as bl,o as wl,e as vl,d as he,c as j,r as M,s as oe,$ as Sl,j as Ze,u as Ce,i as Cl}from"../chunks/DPUojd5V.js";import{s as ht,r as pt,i as Fe}from"../chunks/BIHqivCG.js";import{I as mt,c as dt,h as Al,e as Il,g as Kn,d as Nt,b as El,r as _l}from"../chunks/CBMGMT01.js";import{i as Tl}from"../chunks/YzpLcnjN.js";import{M as Gn,C as Xn}from"../chunks/CBMG66Ob.js";import{a as Pl,g as zl}from"../chunks/D338WAuH.js";import{A as Zn,T as Jn,I as er}from"../chunks/ByNbHZHE.js";import{O as tr}from"../chunks/DPqQ6q9T.js";import{g as Dl,L as Ll,T as en,S as Fl,f as Nl}from"../chunks/DGnDs2M4.js";import{T as nr}from"../chunks/B9zDOVGT.js";import{T as rr,S as Ol}from"../chunks/BomMr_SJ.js";function ir(e,n,t=!1,r=!1,i=!1,o=!1){var l=e,a="";if(t){var u=e;Ft&&(l=Vn(vt(u)))}Ve(()=>{var s=fl;if(a===(a=n()??"")){Ft&&Wn();return}if(t&&!Ft){s.nodes=null,u.innerHTML=a,a!==""&&Zt(vt(u),u.lastChild);return}if(s.nodes!==null&&(hl(s.nodes.start,s.nodes.end),s.nodes=null),a!==""){if(Ft){Qn.data;for(var f=Wn(),c=f;f!==null&&(f.nodeType!==pl||f.data!=="");)c=f,f=ml(f);if(f===null)throw dl(),gl;Zt(Qn,c),l=Vn(f);return}var p=r?xl:i?kl:void 0,h=yl(r?"svg":i?"math":"template",p);h.innerHTML=a;var g=r||i?h:h.content;if(Zt(vt(g),g.lastChild),r||i)for(;vt(g);)l.before(vt(g));else l.before(g)}})}var Rl=new Set(["$$slots","$$events","$$legacy"]);function Ml(e,n){nt(n,!0);let t=pt(n,Rl);const r=[["path",{d:"m6 9 6 6 6-6"}]];mt(e,ht({name:"chevron-down"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Bl=new Set(["$$slots","$$events","$$legacy"]);function $l(e,n){nt(n,!0);let t=pt(n,Bl);const r=[["path",{d:"m18 15-6-6-6 6"}]];mt(e,ht({name:"chevron-up"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var jl=new Set(["$$slots","$$events","$$legacy"]);function ql(e,n){nt(n,!0);let t=pt(n,jl);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M8 12h8"}],["path",{d:"M12 8v8"}]];mt(e,ht({name:"circle-plus"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Hl=new Set(["$$slots","$$events","$$legacy"]);function lr(e,n){nt(n,!0);let t=pt(n,Hl);const r=[["line",{x1:"2",x2:"22",y1:"2",y2:"22"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9"}]];mt(e,ht({name:"image-off"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Ul=new Set(["$$slots","$$events","$$legacy"]);function Vl(e,n){nt(n,!0);let t=pt(n,Ul);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];mt(e,ht({name:"image"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Wl=new Set(["$$slots","$$events","$$legacy"]);function Ql(e,n){nt(n,!0);let t=pt(n,Wl);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];mt(e,ht({name:"pencil"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}function or(e){if(e)throw e}var tn,ar;function Yl(){if(ar)return tn;ar=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):n.call(s)==="[object Array]"},o=function(s){if(!s||n.call(s)!=="[object Object]")return!1;var f=e.call(s,"constructor"),c=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!f&&!c)return!1;var p;for(p in s);return typeof p>"u"||e.call(s,p)},l=function(s,f){t&&f.name==="__proto__"?t(s,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):s[f.name]=f.newValue},a=function(s,f){if(f==="__proto__")if(e.call(s,f)){if(r)return r(s,f).value}else return;return s[f]};return tn=function u(){var s,f,c,p,h,g,w=arguments[0],v=1,x=arguments.length,I=!1;for(typeof w=="boolean"&&(I=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});v<x;++v)if(s=arguments[v],s!=null)for(f in s)c=a(w,f),p=a(s,f),w!==p&&(I&&p&&(o(p)||(h=i(p)))?(h?(h=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},l(w,{name:f,newValue:u(I,g,p)})):typeof p<"u"&&l(w,{name:f,newValue:p}));return w},tn}var Kl=Yl();const nn=Dl(Kl);function kn(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gl(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(u,...s){const f=e[++o];let c=-1;if(u){l(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?Xl(f,a)(...s):l(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function Xl(e,n){let t;return r;function r(...l){const a=e.length>l.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(s){const f=s;if(a&&t)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}function At(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ur(e.position):"start"in e||"end"in e?ur(e):"line"in e||"column"in e?bn(e):""}function bn(e){return sr(e&&e.line)+":"+sr(e&&e.column)}function ur(e){return bn(e&&e.start)+"-"+bn(e&&e.end)}function sr(e){return e&&typeof e=="number"?e:1}class ke extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=At(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ke.prototype.file="";ke.prototype.name="";ke.prototype.reason="";ke.prototype.message="";ke.prototype.stack="";ke.prototype.column=void 0;ke.prototype.line=void 0;ke.prototype.ancestors=void 0;ke.prototype.cause=void 0;ke.prototype.fatal=void 0;ke.prototype.place=void 0;ke.prototype.ruleId=void 0;ke.prototype.source=void 0;const Ne={basename:Zl,dirname:Jl,extname:eo,join:to,sep:"/"};function Zl(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Pt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function Jl(e){if(Pt(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function eo(e){Pt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function to(...e){let n=-1,t;for(;++n<e.length;)Pt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":no(t)}function no(e){Pt(e);const n=e.codePointAt(0)===47;let t=ro(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function ro(e,n){let t="",r=0,i=-1,o=0,l=-1,a,u;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function Pt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const io={cwd:lo};function lo(){return"/"}function wn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oo(e){if(typeof e=="string")e=new URL(e);else if(!wn(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return ao(e)}function ao(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const rn=["history","path","basename","stem","extname","dirname"];class uo{constructor(n){let t;n?wn(n)?t={path:n}:typeof n=="string"||so(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":io.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rn.length;){const o=rn[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)rn.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?Ne.basename(this.path):void 0}set basename(n){on(n,"basename"),ln(n,"basename"),this.path=Ne.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Ne.dirname(this.path):void 0}set dirname(n){cr(this.basename,"dirname"),this.path=Ne.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Ne.extname(this.path):void 0}set extname(n){if(ln(n,"extname"),cr(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ne.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){wn(n)&&(n=oo(n)),on(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Ne.basename(this.path,this.extname):void 0}set stem(n){on(n,"stem"),ln(n,"stem"),this.path=Ne.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new ke(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ln(e,n){if(e&&e.includes(Ne.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Ne.sep+"`")}function on(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function cr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function so(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const co=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),fo={}.hasOwnProperty;class zn extends co{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=Gl()}copy(){const n=new zn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(nn(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(sn("data",this.frozen),this.namespace[n]=t,this):fo.call(this.namespace,n)&&this.namespace[n]||void 0:n?(sn("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=Ot(n),r=this.parser||this.Parser;return an("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),an("process",this.parser||this.Parser),un("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=Ot(n),u=r.parse(a);r.run(u,a,function(f,c,p){if(f||!c||!p)return s(f);const h=c,g=r.stringify(h,p);mo(g)?p.value=g:p.result=g,s(f,p)});function s(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),an("processSync",this.parser||this.Parser),un("processSync",this.compiler||this.Compiler),this.process(n,i),hr("processSync","process",t),r;function i(o,l){t=!0,or(o),r=l}}run(n,t,r){fr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const u=Ot(t);i.run(n,u,s);function s(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),hr("runSync","run",r),i;function o(l,a){or(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=Ot(t),i=this.compiler||this.Compiler;return un("stringify",i),fr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(sn("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new 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");a(s.plugins),s.settings&&(i.settings=nn(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const c=s[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===s){p=c;break}if(p===-1)r.push([s,...f]);else if(f.length>0){let[h,...g]=f;const w=r[p][1];kn(w)&&kn(h)&&(h=nn(!0,w,h)),r[p]=[s,h,...g]}}}}const ho=new zn().freeze();function an(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function un(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sn(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fr(e){if(!kn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ot(e){return po(e)?e:new uo(e)}function po(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mo(e){return typeof e=="string"||go(e)}function go(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yo={};function Dn(e,n){const t=yo,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Gr(e,r,i)}function Gr(e,n,t){if(xo(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return pr(e.children,n,t)}return Array.isArray(e)?pr(e,n,t):""}function pr(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Gr(e[i],n,t);return r.join("")}function xo(e){return!!(e&&typeof e=="object")}const mr=document.createElement("i");function Ln(e){const n="&"+e+";";mr.innerHTML=n;const t=mr.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function Ie(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function _e(e,n){return e.length>0?(Ie(e,e.length,0,n),e):n}const dr={}.hasOwnProperty;function Xr(e){const n={};let t=-1;for(;++t<e.length;)ko(n,e[t]);return n}function ko(e,n){let t;for(t in n){const i=(dr.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){dr.call(i,l)||(i[l]=[]);const a=o[l];bo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function bo(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);Ie(e,0,0,r)}function Zr(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Le(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ye=Ye(/[A-Za-z]/),ge=Ye(/[\dA-Za-z]/),wo=Ye(/[#-'*+\--9=?A-Z^-~]/);function Ht(e){return e!==null&&(e<32||e===127)}const vn=Ye(/\d/),vo=Ye(/[\dA-Fa-f]/),So=Ye(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}const Qt=Ye(new RegExp("\\p{P}|\\p{S}","u")),tt=Ye(/\s/);function Ye(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function gt(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&ge(e.charCodeAt(t+1))&&ge(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function U(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return q(u)?(e.enter(t),a(u)):n(u)}function a(u){return q(u)&&o++<i?(e.consume(u),a):(e.exit(t),n(u))}}const Co={tokenize:Ao};function Ao(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),U(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Io={tokenize:Eo},gr={tokenize:_o};function Eo(e){const n=this,t=[];let r=0,i,o,l;return a;function a(C){if(r<t.length){const L=t[r];return n.containerState=L[1],e.attempt(L[0].continuation,u,s)(C)}return s(C)}function u(C){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&I();const L=n.events.length;let F=L,k;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){k=n.events[F][1].end;break}x(r);let $=L;for(;$<n.events.length;)n.events[$][1].end={...k},$++;return Ie(n.events,F+1,0,n.events.slice(L)),n.events.length=$,s(C)}return a(C)}function s(C){if(r===t.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(gr,f,c)(C)}function f(C){return i&&I(),x(r),p(C)}function c(C){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(C)}function p(C){return n.containerState={},e.attempt(gr,h,g)(C)}function h(C){return r++,t.push([n.currentConstruct,n.containerState]),p(C)}function g(C){if(C===null){i&&I(),x(0),e.consume(C);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(C)}function w(C){if(C===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return z(C)?(e.consume(C),v(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(C),w)}function v(C,L){const F=n.sliceStream(C);if(L&&F.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(F),n.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<l&&(!i.events[k][1].end||i.events[k][1].end.offset>l))return;const $=n.events.length;let W=$,B,y;for(;W--;)if(n.events[W][0]==="exit"&&n.events[W][1].type==="chunkFlow"){if(B){y=n.events[W][1].end;break}B=!0}for(x(r),k=$;k<n.events.length;)n.events[k][1].end={...y},k++;Ie(n.events,W+1,0,n.events.slice($)),n.events.length=k}}function x(C){let L=t.length;for(;L-- >C;){const F=t[L];n.containerState=F[1],F[0].exit.call(n,e)}t.length=C}function I(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function _o(e,n,t){return U(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ct(e){if(e===null||X(e)||tt(e))return 1;if(Qt(e))return 2}function Yt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const Sn={name:"attention",resolveAll:To,tokenize:Po};function To(e,n){let t=-1,r,i,o,l,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};yr(c,-u),yr(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=_e(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=_e(s,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),s=_e(s,Yt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=_e(s,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=_e(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,Ie(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Po(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ct(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=ct(u),c=!f||f===2&&i||t.includes(u),p=!i||i===2&&f||t.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),n(u)}}function yr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const zo={name:"autolink",tokenize:Do};function Do(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ye(h)?(e.consume(h),l):h===64?t(h):s(h)}function l(h){return h===43||h===45||h===46||ge(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||ge(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||Ht(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):wo(h)?(e.consume(h),s):t(h)}function f(h){return ge(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||ge(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const zt={partial:!0,tokenize:Lo};function Lo(e,n,t){return r;function r(o){return q(o)?U(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?n(o):t(o)}}const Jr={continuation:{tokenize:No},exit:Oo,name:"blockQuote",tokenize:Fo};function Fo(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return q(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function No(e,n,t){const r=this;return i;function i(l){return q(l)?U(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Jr,n,t)(l)}}function Oo(e){e.exit("blockQuote")}const ei={name:"characterEscape",tokenize:Ro};function Ro(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return So(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ti={name:"characterReference",tokenize:Mo};function Mo(e,n,t){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=ge,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=vo,f):(e.enter("characterReferenceValue"),o=7,l=vn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===ge&&!Ln(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const xr={partial:!0,tokenize:$o},kr={concrete:!0,name:"codeFenced",tokenize:Bo};function Bo(e,n,t){const r=this,i={partial:!0,tokenize:F};let o=0,l=0,a;return u;function u(k){return s(k)}function s(k){const $=r.events[r.events.length-1];return o=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(k)}function f(k){return k===a?(l++,e.consume(k),f):l<3?t(k):(e.exit("codeFencedFenceSequence"),q(k)?U(e,c,"whitespace")(k):c(k))}function c(k){return k===null||z(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(xr,w,L)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(k)):q(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),U(e,h,"whitespace")(k)):k===96&&k===a?t(k):(e.consume(k),p)}function h(k){return k===null||z(k)?c(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(k)):k===96&&k===a?t(k):(e.consume(k),g)}function w(k){return e.attempt(i,L,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return o>0&&q(k)?U(e,I,"linePrefix",o+1)(k):I(k)}function I(k){return k===null||z(k)?e.check(xr,w,L)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||z(k)?(e.exit("codeFlowValue"),I(k)):(e.consume(k),C)}function L(k){return e.exit("codeFenced"),n(k)}function F(k,$,W){let B=0;return y;function y(D){return k.enter("lineEnding"),k.consume(D),k.exit("lineEnding"),T}function T(D){return k.enter("codeFencedFence"),q(D)?U(k,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):_(D)}function _(D){return D===a?(k.enter("codeFencedFenceSequence"),P(D)):W(D)}function P(D){return D===a?(B++,k.consume(D),P):B>=l?(k.exit("codeFencedFenceSequence"),q(D)?U(k,R,"whitespace")(D):R(D)):W(D)}function R(D){return D===null||z(D)?(k.exit("codeFencedFence"),$(D)):W(D)}}}function $o(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const cn={name:"codeIndented",tokenize:qo},jo={partial:!0,tokenize:Ho};function qo(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),U(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?u(s):z(s)?e.attempt(jo,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||z(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function Ho(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):U(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):z(l)?i(l):t(l)}}const Uo={name:"codeText",previous:Wo,resolve:Vo,tokenize:Qo};function Vo(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||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),n-=r-i-2,r=i+2),i=void 0);return e}function Wo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Qo(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||z(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",s(c))}}class Yo{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&St(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),St(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),St(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);St(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);St(this.left,t.reverse())}}}function St(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ni(e){const n={};let t=-1,r,i,o,l,a,u,s;const f=new Yo(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Ko(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return Ie(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function Ko(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=t,g=0,w=0;const v=[w];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(w=p+1,v.push(w),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const x=a.slice(v[p],v[p+1]),I=o.pop();u.push([I,I+x.length-1]),e.splice(I,2,x)}for(u.reverse(),p=-1;++p<u.length;)s[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return s}const Go={resolve:Zo,tokenize:Jo},Xo={partial:!0,tokenize:ea};function Zo(e){return ni(e),e}function Jo(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?e.check(Xo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function ea(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),U(e,o,"linePrefix")}function o(l){if(l===null||z(l))return t(l);const 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?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function ri(e,n,t,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||Ht(x)?t(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||z(x)?t(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function w(x){return!f&&(x===null||x===41||X(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(x)):f<s&&x===40?(e.consume(x),f++,w):x===41?(e.consume(x),f--,w):x===null||x===32||x===40||Ht(x)?t(x):(e.consume(x),x===92?v:w)}function v(x){return x===40||x===41||x===92?(e.consume(x),w):w(x)}}function ii(e,n,t,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!q(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function li(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):t(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?t(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),U(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||z(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function It(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):q(i)?U(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const ta={name:"definition",tokenize:ra},na={partial:!0,tokenize:ia};function ra(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return ii.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return X(h)?It(e,s)(h):s(h)}function s(h){return ri(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(na,c,c)(h)}function c(h){return q(h)?U(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function ia(e,n,t){return r;function r(a){return X(a)?It(e,i)(a):t(a)}function i(a){return li(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return q(a)?U(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?n(a):t(a)}}const la={name:"hardBreakEscape",tokenize:oa};function oa(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const aa={name:"headingAtx",resolve:ua,tokenize:sa};function ua(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Ie(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function sa(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||X(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||z(f)?(e.exit("atxHeading"),n(f)):q(f)?U(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||X(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const ca=["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"],br=["pre","script","style","textarea"],fa={concrete:!0,name:"htmlFlow",resolveTo:ma,tokenize:da},ha={partial:!0,tokenize:ya},pa={partial:!0,tokenize:ga};function ma(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function da(e,n,t){const r=this;let i,o,l,a,u;return s;function s(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?n:m):ye(d)?(e.consume(d),l=String.fromCharCode(d),v):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ye(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const ae="CDATA[";return d===ae.charCodeAt(a++)?(e.consume(d),a===ae.length?r.interrupt?n:_:g):t(d)}function w(d){return ye(d)?(e.consume(d),l=String.fromCharCode(d),v):t(d)}function v(d){if(d===null||d===47||d===62||X(d)){const ae=d===47,me=l.toLowerCase();return!ae&&!o&&br.includes(me)?(i=1,r.interrupt?n(d):_(d)):ca.includes(l.toLowerCase())?(i=6,ae?(e.consume(d),x):r.interrupt?n(d):_(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?I(d):C(d))}return d===45||ge(d)?(e.consume(d),l+=String.fromCharCode(d),v):t(d)}function x(d){return d===62?(e.consume(d),r.interrupt?n:_):t(d)}function I(d){return q(d)?(e.consume(d),I):y(d)}function C(d){return d===47?(e.consume(d),y):d===58||d===95||ye(d)?(e.consume(d),L):q(d)?(e.consume(d),C):y(d)}function L(d){return d===45||d===46||d===58||d===95||ge(d)?(e.consume(d),L):F(d)}function F(d){return d===61?(e.consume(d),k):q(d)?(e.consume(d),F):C(d)}function k(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),u=d,$):q(d)?(e.consume(d),k):W(d)}function $(d){return d===u?(e.consume(d),u=null,B):d===null||z(d)?t(d):(e.consume(d),$)}function W(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||X(d)?F(d):(e.consume(d),W)}function B(d){return d===47||d===62||q(d)?C(d):t(d)}function y(d){return d===62?(e.consume(d),T):t(d)}function T(d){return d===null||z(d)?_(d):q(d)?(e.consume(d),T):t(d)}function _(d){return d===45&&i===2?(e.consume(d),re):d===60&&i===1?(e.consume(d),Q):d===62&&i===4?(e.consume(d),Z):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),ee):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ha,fe,P)(d)):d===null||z(d)?(e.exit("htmlFlowData"),P(d)):(e.consume(d),_)}function P(d){return e.check(pa,R,fe)(d)}function R(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),D}function D(d){return d===null||z(d)?P(d):(e.enter("htmlFlowData"),_(d))}function re(d){return d===45?(e.consume(d),m):_(d)}function Q(d){return d===47?(e.consume(d),l="",ie):_(d)}function ie(d){if(d===62){const ae=l.toLowerCase();return br.includes(ae)?(e.consume(d),Z):_(d)}return ye(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),ie):_(d)}function ee(d){return d===93?(e.consume(d),m):_(d)}function m(d){return d===62?(e.consume(d),Z):d===45&&i===2?(e.consume(d),m):_(d)}function Z(d){return d===null||z(d)?(e.exit("htmlFlowData"),fe(d)):(e.consume(d),Z)}function fe(d){return e.exit("htmlFlow"),n(d)}}function ga(e,n,t){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function ya(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(zt,n,t)}}const xa={name:"htmlText",tokenize:ka};function ka(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),F):m===63?(e.consume(m),C):ye(m)?(e.consume(m),W):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):ye(m)?(e.consume(m),I):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):z(m)?(l=c,Q(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?re(m):m===45?p(m):c(m)}function g(m){const Z="CDATA[";return m===Z.charCodeAt(o++)?(e.consume(m),o===Z.length?w:g):t(m)}function w(m){return m===null?t(m):m===93?(e.consume(m),v):z(m)?(l=w,Q(m)):(e.consume(m),w)}function v(m){return m===93?(e.consume(m),x):w(m)}function x(m){return m===62?re(m):m===93?(e.consume(m),x):w(m)}function I(m){return m===null||m===62?re(m):z(m)?(l=I,Q(m)):(e.consume(m),I)}function C(m){return m===null?t(m):m===63?(e.consume(m),L):z(m)?(l=C,Q(m)):(e.consume(m),C)}function L(m){return m===62?re(m):C(m)}function F(m){return ye(m)?(e.consume(m),k):t(m)}function k(m){return m===45||ge(m)?(e.consume(m),k):$(m)}function $(m){return z(m)?(l=$,Q(m)):q(m)?(e.consume(m),$):re(m)}function W(m){return m===45||ge(m)?(e.consume(m),W):m===47||m===62||X(m)?B(m):t(m)}function B(m){return m===47?(e.consume(m),re):m===58||m===95||ye(m)?(e.consume(m),y):z(m)?(l=B,Q(m)):q(m)?(e.consume(m),B):re(m)}function y(m){return m===45||m===46||m===58||m===95||ge(m)?(e.consume(m),y):T(m)}function T(m){return m===61?(e.consume(m),_):z(m)?(l=T,Q(m)):q(m)?(e.consume(m),T):B(m)}function _(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,P):z(m)?(l=_,Q(m)):q(m)?(e.consume(m),_):(e.consume(m),R)}function P(m){return m===i?(e.consume(m),i=void 0,D):m===null?t(m):z(m)?(l=P,Q(m)):(e.consume(m),P)}function R(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||X(m)?B(m):(e.consume(m),R)}function D(m){return m===47||m===62||X(m)?B(m):t(m)}function re(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function Q(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ie}function ie(m){return q(m)?U(e,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ee(m)}function ee(m){return e.enter("htmlTextData"),l(m)}}const Fn={name:"labelEnd",resolveAll:Sa,resolveTo:Ca,tokenize:Aa},ba={tokenize:Ia},wa={tokenize:Ea},va={tokenize:_a};function Sa(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&Ie(e,0,e.length,t),e}function Ca(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=_e(a,e.slice(o+1,o+r+3)),a=_e(a,[["enter",f,n]]),a=_e(a,Yt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=_e(a,[["exit",f,n],e[l-2],e[l-1],["exit",s,n]]),a=_e(a,e.slice(l+1)),a=_e(a,[["exit",u,n]]),Ie(e,o,e.length,a),e}function Aa(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(Le(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):t(p)}function u(p){return p===40?e.attempt(ba,f,l?f:c)(p):p===91?e.attempt(wa,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(va,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function Ia(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return X(c)?It(e,o)(c):o(c)}function o(c){return c===41?f(c):ri(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return X(c)?It(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?li(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return X(c)?It(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function Ea(e,n,t){const r=this;return i;function i(a){return ii.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function _a(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const Ta={name:"labelStartImage",resolveAll:Fn.resolveAll,tokenize:Pa};function Pa(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const za={name:"labelStartLink",resolveAll:Fn.resolveAll,tokenize:Da};function Da(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const fn={name:"lineEnding",tokenize:La};function La(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),U(e,n,"linePrefix")}}const qt={name:"thematicBreak",tokenize:Fa};function Fa(e,n,t){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||z(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),q(s)?U(e,a,"whitespace")(s):a(s))}}const xe={continuation:{tokenize:Ma},exit:$a,name:"list",tokenize:Ra},Na={partial:!0,tokenize:ja},Oa={partial:!0,tokenize:Ba};function Ra(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:vn(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(qt,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return vn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(zt,r.interrupt?t:f,e.attempt(Na,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return q(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Ma(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(zt,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!q(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Oa,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(xe,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ba(e,n,t){const r=this;return U(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function $a(e){e.exit(this.containerState.type)}function ja(e,n,t){const r=this;return U(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!q(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const wr={name:"setextUnderline",resolveTo:qa,tokenize:Ha};function qa(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function Ha(e,n,t){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):t(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),q(s)?U(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||z(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const Ua={tokenize:Va};function Va(e){const n=this,t=e.attempt(zt,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Go,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Wa={resolveAll:ai()},Qa=oi("string"),Ya=oi("text");function oi(e){return{resolveAll:ai(e==="text"?Ka:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),o(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ai(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function Ka(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Ga={42:xe,43:xe,45:xe,48:xe,49:xe,50:xe,51:xe,52:xe,53:xe,54:xe,55:xe,56:xe,57:xe,62:Jr},Xa={91:ta},Za={[-2]:cn,[-1]:cn,32:cn},Ja={35:aa,42:qt,45:[wr,qt],60:fa,61:wr,95:qt,96:kr,126:kr},eu={38:ti,92:ei},tu={[-5]:fn,[-4]:fn,[-3]:fn,33:Ta,38:ti,42:Sn,60:[zo,xa],91:za,92:[la,ei],93:Fn,95:Sn,96:Uo},nu={null:[Sn,Wa]},ru={null:[42,95]},iu={null:[]},lu=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ru,contentInitial:Xa,disable:iu,document:Ga,flow:Ja,flowInitial:Za,insideSpan:nu,string:eu,text:tu},Symbol.toStringTag,{value:"Module"}));function ou(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:$(F),check:$(k),consume:I,enter:C,exit:L,interrupt:$(k,{interrupt:!0})},s={code:null,containerState:{},defineSkip:w,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&o.push(n),s;function c(T){return l=_e(l,T),v(),l[l.length-1]!==null?[]:(W(n,0),s.events=Yt(o,s.events,s),s.events)}function p(T,_){return uu(h(T),_)}function h(T){return au(l,T)}function g(){const{_bufferIndex:T,_index:_,line:P,column:R,offset:D}=r;return{_bufferIndex:T,_index:_,line:P,column:R,offset:D}}function w(T){i[T.line]=T.column,y()}function v(){let T;for(;r._index<l.length;){const _=l[r._index];if(typeof _=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<_.length;)x(_.charCodeAt(r._bufferIndex));else x(_)}}function x(T){f=f(T)}function I(T){z(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,y()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function C(T,_){const P=_||{};return P.type=T,P.start=g(),s.events.push(["enter",P,s]),a.push(P),P}function L(T){const _=a.pop();return _.end=g(),s.events.push(["exit",_,s]),_}function F(T,_){W(T,_.from)}function k(T,_){_.restore()}function $(T,_){return P;function P(R,D,re){let Q,ie,ee,m;return Array.isArray(R)?fe(R):"tokenize"in R?fe([R]):Z(R);function Z(Y){return we;function we(le){const se=le!==null&&Y[le],Ee=le!==null&&Y.null,je=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return fe(je)(le)}}function fe(Y){return Q=Y,ie=0,Y.length===0?re:d(Y[ie])}function d(Y){return we;function we(le){return m=B(),ee=Y,Y.partial||(s.currentConstruct=Y),Y.name&&s.parser.constructs.disable.null.includes(Y.name)?me():Y.tokenize.call(_?Object.assign(Object.create(s),_):s,u,ae,me)(le)}}function ae(Y){return T(ee,m),D}function me(Y){return m.restore(),++ie<Q.length?d(Q[ie]):re}}}function W(T,_){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&Ie(s.events,_,s.events.length-_,T.resolve(s.events.slice(_),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function B(){const T=g(),_=s.previous,P=s.currentConstruct,R=s.events.length,D=Array.from(a);return{from:R,restore:re};function re(){r=T,s.previous=_,s.currentConstruct=P,s.events.length=R,a=D,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function au(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function uu(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
1
+ import{g as Zt,c as ft,a as ne,d as sl,p as cl,f as pe,b as qe,s as Jt}from"../chunks/C-A59nkV.js";import{m as Ft,y as Vn,av as vt,t as Ve,q as Wn,U as fl,bn as hl,A as Qn,aC as pl,aE as ml,aL as dl,aF as gl,au as yl,a_ as xl,bo as kl,p as nt,f as Qe,n as Oe,a as rt,h as He,b as Yn,g as A,k as bl,o as wl,e as vl,d as he,c as j,r as M,s as oe,$ as Sl,j as Ze,u as Ce,i as Cl}from"../chunks/DPUojd5V.js";import{s as ht,r as pt,i as Fe}from"../chunks/BIHqivCG.js";import{I as mt,c as dt,h as Al,e as Il,g as Kn,d as Nt,b as El,r as _l}from"../chunks/36fRYPqv.js";import{i as Tl}from"../chunks/CGRPYk0Z.js";import{M as Gn,C as Xn}from"../chunks/BY8Jsuov.js";import{a as Pl,g as zl}from"../chunks/CWeHQSrA.js";import{A as Zn,T as Jn,I as er}from"../chunks/D6oxHNYy.js";import{O as tr}from"../chunks/_QiFnDly.js";import{g as Dl,L as Ll,T as en,S as Fl,f as Nl}from"../chunks/DAsycyym.js";import{T as nr}from"../chunks/Dj5A_YN9.js";import{T as rr,S as Ol}from"../chunks/Ba5SSrNi.js";function ir(e,n,t=!1,r=!1,i=!1,o=!1){var l=e,a="";if(t){var u=e;Ft&&(l=Vn(vt(u)))}Ve(()=>{var s=fl;if(a===(a=n()??"")){Ft&&Wn();return}if(t&&!Ft){s.nodes=null,u.innerHTML=a,a!==""&&Zt(vt(u),u.lastChild);return}if(s.nodes!==null&&(hl(s.nodes.start,s.nodes.end),s.nodes=null),a!==""){if(Ft){Qn.data;for(var f=Wn(),c=f;f!==null&&(f.nodeType!==pl||f.data!=="");)c=f,f=ml(f);if(f===null)throw dl(),gl;Zt(Qn,c),l=Vn(f);return}var p=r?xl:i?kl:void 0,h=yl(r?"svg":i?"math":"template",p);h.innerHTML=a;var g=r||i?h:h.content;if(Zt(vt(g),g.lastChild),r||i)for(;vt(g);)l.before(vt(g));else l.before(g)}})}var Rl=new Set(["$$slots","$$events","$$legacy"]);function Ml(e,n){nt(n,!0);let t=pt(n,Rl);const r=[["path",{d:"m6 9 6 6 6-6"}]];mt(e,ht({name:"chevron-down"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Bl=new Set(["$$slots","$$events","$$legacy"]);function $l(e,n){nt(n,!0);let t=pt(n,Bl);const r=[["path",{d:"m18 15-6-6-6 6"}]];mt(e,ht({name:"chevron-up"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var jl=new Set(["$$slots","$$events","$$legacy"]);function ql(e,n){nt(n,!0);let t=pt(n,jl);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M8 12h8"}],["path",{d:"M12 8v8"}]];mt(e,ht({name:"circle-plus"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Hl=new Set(["$$slots","$$events","$$legacy"]);function lr(e,n){nt(n,!0);let t=pt(n,Hl);const r=[["line",{x1:"2",x2:"22",y1:"2",y2:"22"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9"}]];mt(e,ht({name:"image-off"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Ul=new Set(["$$slots","$$events","$$legacy"]);function Vl(e,n){nt(n,!0);let t=pt(n,Ul);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];mt(e,ht({name:"image"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}var Wl=new Set(["$$slots","$$events","$$legacy"]);function Ql(e,n){nt(n,!0);let t=pt(n,Wl);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];mt(e,ht({name:"pencil"},()=>t,{get iconNode(){return r},children:(i,o)=>{var l=ft(),a=Qe(l);dt(a,()=>n.children??Oe),ne(i,l)},$$slots:{default:!0}})),rt()}function or(e){if(e)throw e}var tn,ar;function Yl(){if(ar)return tn;ar=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):n.call(s)==="[object Array]"},o=function(s){if(!s||n.call(s)!=="[object Object]")return!1;var f=e.call(s,"constructor"),c=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!f&&!c)return!1;var p;for(p in s);return typeof p>"u"||e.call(s,p)},l=function(s,f){t&&f.name==="__proto__"?t(s,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):s[f.name]=f.newValue},a=function(s,f){if(f==="__proto__")if(e.call(s,f)){if(r)return r(s,f).value}else return;return s[f]};return tn=function u(){var s,f,c,p,h,g,w=arguments[0],v=1,x=arguments.length,I=!1;for(typeof w=="boolean"&&(I=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});v<x;++v)if(s=arguments[v],s!=null)for(f in s)c=a(w,f),p=a(s,f),w!==p&&(I&&p&&(o(p)||(h=i(p)))?(h?(h=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},l(w,{name:f,newValue:u(I,g,p)})):typeof p<"u"&&l(w,{name:f,newValue:p}));return w},tn}var Kl=Yl();const nn=Dl(Kl);function kn(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gl(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(u,...s){const f=e[++o];let c=-1;if(u){l(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?Xl(f,a)(...s):l(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function Xl(e,n){let t;return r;function r(...l){const a=e.length>l.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(s){const f=s;if(a&&t)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}function At(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ur(e.position):"start"in e||"end"in e?ur(e):"line"in e||"column"in e?bn(e):""}function bn(e){return sr(e&&e.line)+":"+sr(e&&e.column)}function ur(e){return bn(e&&e.start)+"-"+bn(e&&e.end)}function sr(e){return e&&typeof e=="number"?e:1}class ke extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=At(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ke.prototype.file="";ke.prototype.name="";ke.prototype.reason="";ke.prototype.message="";ke.prototype.stack="";ke.prototype.column=void 0;ke.prototype.line=void 0;ke.prototype.ancestors=void 0;ke.prototype.cause=void 0;ke.prototype.fatal=void 0;ke.prototype.place=void 0;ke.prototype.ruleId=void 0;ke.prototype.source=void 0;const Ne={basename:Zl,dirname:Jl,extname:eo,join:to,sep:"/"};function Zl(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Pt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function Jl(e){if(Pt(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function eo(e){Pt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function to(...e){let n=-1,t;for(;++n<e.length;)Pt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":no(t)}function no(e){Pt(e);const n=e.codePointAt(0)===47;let t=ro(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function ro(e,n){let t="",r=0,i=-1,o=0,l=-1,a,u;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function Pt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const io={cwd:lo};function lo(){return"/"}function wn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oo(e){if(typeof e=="string")e=new URL(e);else if(!wn(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return ao(e)}function ao(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const rn=["history","path","basename","stem","extname","dirname"];class uo{constructor(n){let t;n?wn(n)?t={path:n}:typeof n=="string"||so(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":io.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rn.length;){const o=rn[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)rn.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?Ne.basename(this.path):void 0}set basename(n){on(n,"basename"),ln(n,"basename"),this.path=Ne.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Ne.dirname(this.path):void 0}set dirname(n){cr(this.basename,"dirname"),this.path=Ne.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Ne.extname(this.path):void 0}set extname(n){if(ln(n,"extname"),cr(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ne.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){wn(n)&&(n=oo(n)),on(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Ne.basename(this.path,this.extname):void 0}set stem(n){on(n,"stem"),ln(n,"stem"),this.path=Ne.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new ke(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ln(e,n){if(e&&e.includes(Ne.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Ne.sep+"`")}function on(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function cr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function so(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const co=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),fo={}.hasOwnProperty;class zn extends co{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=Gl()}copy(){const n=new zn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(nn(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(sn("data",this.frozen),this.namespace[n]=t,this):fo.call(this.namespace,n)&&this.namespace[n]||void 0:n?(sn("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=Ot(n),r=this.parser||this.Parser;return an("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),an("process",this.parser||this.Parser),un("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=Ot(n),u=r.parse(a);r.run(u,a,function(f,c,p){if(f||!c||!p)return s(f);const h=c,g=r.stringify(h,p);mo(g)?p.value=g:p.result=g,s(f,p)});function s(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),an("processSync",this.parser||this.Parser),un("processSync",this.compiler||this.Compiler),this.process(n,i),hr("processSync","process",t),r;function i(o,l){t=!0,or(o),r=l}}run(n,t,r){fr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const u=Ot(t);i.run(n,u,s);function s(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),hr("runSync","run",r),i;function o(l,a){or(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=Ot(t),i=this.compiler||this.Compiler;return un("stringify",i),fr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(sn("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new 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");a(s.plugins),s.settings&&(i.settings=nn(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const c=s[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===s){p=c;break}if(p===-1)r.push([s,...f]);else if(f.length>0){let[h,...g]=f;const w=r[p][1];kn(w)&&kn(h)&&(h=nn(!0,w,h)),r[p]=[s,h,...g]}}}}const ho=new zn().freeze();function an(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function un(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sn(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fr(e){if(!kn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ot(e){return po(e)?e:new uo(e)}function po(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mo(e){return typeof e=="string"||go(e)}function go(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yo={};function Dn(e,n){const t=yo,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Gr(e,r,i)}function Gr(e,n,t){if(xo(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return pr(e.children,n,t)}return Array.isArray(e)?pr(e,n,t):""}function pr(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Gr(e[i],n,t);return r.join("")}function xo(e){return!!(e&&typeof e=="object")}const mr=document.createElement("i");function Ln(e){const n="&"+e+";";mr.innerHTML=n;const t=mr.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function Ie(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function _e(e,n){return e.length>0?(Ie(e,e.length,0,n),e):n}const dr={}.hasOwnProperty;function Xr(e){const n={};let t=-1;for(;++t<e.length;)ko(n,e[t]);return n}function ko(e,n){let t;for(t in n){const i=(dr.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){dr.call(i,l)||(i[l]=[]);const a=o[l];bo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function bo(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);Ie(e,0,0,r)}function Zr(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Le(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ye=Ye(/[A-Za-z]/),ge=Ye(/[\dA-Za-z]/),wo=Ye(/[#-'*+\--9=?A-Z^-~]/);function Ht(e){return e!==null&&(e<32||e===127)}const vn=Ye(/\d/),vo=Ye(/[\dA-Fa-f]/),So=Ye(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}const Qt=Ye(new RegExp("\\p{P}|\\p{S}","u")),tt=Ye(/\s/);function Ye(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function gt(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&ge(e.charCodeAt(t+1))&&ge(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function U(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return q(u)?(e.enter(t),a(u)):n(u)}function a(u){return q(u)&&o++<i?(e.consume(u),a):(e.exit(t),n(u))}}const Co={tokenize:Ao};function Ao(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),U(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Io={tokenize:Eo},gr={tokenize:_o};function Eo(e){const n=this,t=[];let r=0,i,o,l;return a;function a(C){if(r<t.length){const L=t[r];return n.containerState=L[1],e.attempt(L[0].continuation,u,s)(C)}return s(C)}function u(C){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&I();const L=n.events.length;let F=L,k;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){k=n.events[F][1].end;break}x(r);let $=L;for(;$<n.events.length;)n.events[$][1].end={...k},$++;return Ie(n.events,F+1,0,n.events.slice(L)),n.events.length=$,s(C)}return a(C)}function s(C){if(r===t.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(gr,f,c)(C)}function f(C){return i&&I(),x(r),p(C)}function c(C){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(C)}function p(C){return n.containerState={},e.attempt(gr,h,g)(C)}function h(C){return r++,t.push([n.currentConstruct,n.containerState]),p(C)}function g(C){if(C===null){i&&I(),x(0),e.consume(C);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(C)}function w(C){if(C===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return z(C)?(e.consume(C),v(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(C),w)}function v(C,L){const F=n.sliceStream(C);if(L&&F.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(F),n.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<l&&(!i.events[k][1].end||i.events[k][1].end.offset>l))return;const $=n.events.length;let W=$,B,y;for(;W--;)if(n.events[W][0]==="exit"&&n.events[W][1].type==="chunkFlow"){if(B){y=n.events[W][1].end;break}B=!0}for(x(r),k=$;k<n.events.length;)n.events[k][1].end={...y},k++;Ie(n.events,W+1,0,n.events.slice($)),n.events.length=k}}function x(C){let L=t.length;for(;L-- >C;){const F=t[L];n.containerState=F[1],F[0].exit.call(n,e)}t.length=C}function I(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function _o(e,n,t){return U(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ct(e){if(e===null||X(e)||tt(e))return 1;if(Qt(e))return 2}function Yt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const Sn={name:"attention",resolveAll:To,tokenize:Po};function To(e,n){let t=-1,r,i,o,l,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};yr(c,-u),yr(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=_e(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=_e(s,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),s=_e(s,Yt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=_e(s,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=_e(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,Ie(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Po(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ct(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=ct(u),c=!f||f===2&&i||t.includes(u),p=!i||i===2&&f||t.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),n(u)}}function yr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const zo={name:"autolink",tokenize:Do};function Do(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ye(h)?(e.consume(h),l):h===64?t(h):s(h)}function l(h){return h===43||h===45||h===46||ge(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||ge(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||Ht(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):wo(h)?(e.consume(h),s):t(h)}function f(h){return ge(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||ge(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const zt={partial:!0,tokenize:Lo};function Lo(e,n,t){return r;function r(o){return q(o)?U(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?n(o):t(o)}}const Jr={continuation:{tokenize:No},exit:Oo,name:"blockQuote",tokenize:Fo};function Fo(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return q(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function No(e,n,t){const r=this;return i;function i(l){return q(l)?U(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Jr,n,t)(l)}}function Oo(e){e.exit("blockQuote")}const ei={name:"characterEscape",tokenize:Ro};function Ro(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return So(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ti={name:"characterReference",tokenize:Mo};function Mo(e,n,t){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=ge,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=vo,f):(e.enter("characterReferenceValue"),o=7,l=vn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===ge&&!Ln(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const xr={partial:!0,tokenize:$o},kr={concrete:!0,name:"codeFenced",tokenize:Bo};function Bo(e,n,t){const r=this,i={partial:!0,tokenize:F};let o=0,l=0,a;return u;function u(k){return s(k)}function s(k){const $=r.events[r.events.length-1];return o=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(k)}function f(k){return k===a?(l++,e.consume(k),f):l<3?t(k):(e.exit("codeFencedFenceSequence"),q(k)?U(e,c,"whitespace")(k):c(k))}function c(k){return k===null||z(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(xr,w,L)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(k)):q(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),U(e,h,"whitespace")(k)):k===96&&k===a?t(k):(e.consume(k),p)}function h(k){return k===null||z(k)?c(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(k)):k===96&&k===a?t(k):(e.consume(k),g)}function w(k){return e.attempt(i,L,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return o>0&&q(k)?U(e,I,"linePrefix",o+1)(k):I(k)}function I(k){return k===null||z(k)?e.check(xr,w,L)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||z(k)?(e.exit("codeFlowValue"),I(k)):(e.consume(k),C)}function L(k){return e.exit("codeFenced"),n(k)}function F(k,$,W){let B=0;return y;function y(D){return k.enter("lineEnding"),k.consume(D),k.exit("lineEnding"),T}function T(D){return k.enter("codeFencedFence"),q(D)?U(k,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):_(D)}function _(D){return D===a?(k.enter("codeFencedFenceSequence"),P(D)):W(D)}function P(D){return D===a?(B++,k.consume(D),P):B>=l?(k.exit("codeFencedFenceSequence"),q(D)?U(k,R,"whitespace")(D):R(D)):W(D)}function R(D){return D===null||z(D)?(k.exit("codeFencedFence"),$(D)):W(D)}}}function $o(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const cn={name:"codeIndented",tokenize:qo},jo={partial:!0,tokenize:Ho};function qo(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),U(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?u(s):z(s)?e.attempt(jo,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||z(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function Ho(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):U(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):z(l)?i(l):t(l)}}const Uo={name:"codeText",previous:Wo,resolve:Vo,tokenize:Qo};function Vo(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||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),n-=r-i-2,r=i+2),i=void 0);return e}function Wo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Qo(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||z(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",s(c))}}class Yo{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&St(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),St(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),St(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);St(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);St(this.left,t.reverse())}}}function St(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ni(e){const n={};let t=-1,r,i,o,l,a,u,s;const f=new Yo(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Ko(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return Ie(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function Ko(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=t,g=0,w=0;const v=[w];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(w=p+1,v.push(w),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const x=a.slice(v[p],v[p+1]),I=o.pop();u.push([I,I+x.length-1]),e.splice(I,2,x)}for(u.reverse(),p=-1;++p<u.length;)s[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return s}const Go={resolve:Zo,tokenize:Jo},Xo={partial:!0,tokenize:ea};function Zo(e){return ni(e),e}function Jo(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?e.check(Xo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function ea(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),U(e,o,"linePrefix")}function o(l){if(l===null||z(l))return t(l);const 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?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function ri(e,n,t,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||Ht(x)?t(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||z(x)?t(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function w(x){return!f&&(x===null||x===41||X(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(x)):f<s&&x===40?(e.consume(x),f++,w):x===41?(e.consume(x),f--,w):x===null||x===32||x===40||Ht(x)?t(x):(e.consume(x),x===92?v:w)}function v(x){return x===40||x===41||x===92?(e.consume(x),w):w(x)}}function ii(e,n,t,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!q(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function li(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):t(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?t(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),U(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||z(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function It(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):q(i)?U(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const ta={name:"definition",tokenize:ra},na={partial:!0,tokenize:ia};function ra(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return ii.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return X(h)?It(e,s)(h):s(h)}function s(h){return ri(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(na,c,c)(h)}function c(h){return q(h)?U(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function ia(e,n,t){return r;function r(a){return X(a)?It(e,i)(a):t(a)}function i(a){return li(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return q(a)?U(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?n(a):t(a)}}const la={name:"hardBreakEscape",tokenize:oa};function oa(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const aa={name:"headingAtx",resolve:ua,tokenize:sa};function ua(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Ie(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function sa(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||X(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||z(f)?(e.exit("atxHeading"),n(f)):q(f)?U(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||X(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const ca=["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"],br=["pre","script","style","textarea"],fa={concrete:!0,name:"htmlFlow",resolveTo:ma,tokenize:da},ha={partial:!0,tokenize:ya},pa={partial:!0,tokenize:ga};function ma(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function da(e,n,t){const r=this;let i,o,l,a,u;return s;function s(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?n:m):ye(d)?(e.consume(d),l=String.fromCharCode(d),v):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ye(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const ae="CDATA[";return d===ae.charCodeAt(a++)?(e.consume(d),a===ae.length?r.interrupt?n:_:g):t(d)}function w(d){return ye(d)?(e.consume(d),l=String.fromCharCode(d),v):t(d)}function v(d){if(d===null||d===47||d===62||X(d)){const ae=d===47,me=l.toLowerCase();return!ae&&!o&&br.includes(me)?(i=1,r.interrupt?n(d):_(d)):ca.includes(l.toLowerCase())?(i=6,ae?(e.consume(d),x):r.interrupt?n(d):_(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?I(d):C(d))}return d===45||ge(d)?(e.consume(d),l+=String.fromCharCode(d),v):t(d)}function x(d){return d===62?(e.consume(d),r.interrupt?n:_):t(d)}function I(d){return q(d)?(e.consume(d),I):y(d)}function C(d){return d===47?(e.consume(d),y):d===58||d===95||ye(d)?(e.consume(d),L):q(d)?(e.consume(d),C):y(d)}function L(d){return d===45||d===46||d===58||d===95||ge(d)?(e.consume(d),L):F(d)}function F(d){return d===61?(e.consume(d),k):q(d)?(e.consume(d),F):C(d)}function k(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),u=d,$):q(d)?(e.consume(d),k):W(d)}function $(d){return d===u?(e.consume(d),u=null,B):d===null||z(d)?t(d):(e.consume(d),$)}function W(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||X(d)?F(d):(e.consume(d),W)}function B(d){return d===47||d===62||q(d)?C(d):t(d)}function y(d){return d===62?(e.consume(d),T):t(d)}function T(d){return d===null||z(d)?_(d):q(d)?(e.consume(d),T):t(d)}function _(d){return d===45&&i===2?(e.consume(d),re):d===60&&i===1?(e.consume(d),Q):d===62&&i===4?(e.consume(d),Z):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),ee):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ha,fe,P)(d)):d===null||z(d)?(e.exit("htmlFlowData"),P(d)):(e.consume(d),_)}function P(d){return e.check(pa,R,fe)(d)}function R(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),D}function D(d){return d===null||z(d)?P(d):(e.enter("htmlFlowData"),_(d))}function re(d){return d===45?(e.consume(d),m):_(d)}function Q(d){return d===47?(e.consume(d),l="",ie):_(d)}function ie(d){if(d===62){const ae=l.toLowerCase();return br.includes(ae)?(e.consume(d),Z):_(d)}return ye(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),ie):_(d)}function ee(d){return d===93?(e.consume(d),m):_(d)}function m(d){return d===62?(e.consume(d),Z):d===45&&i===2?(e.consume(d),m):_(d)}function Z(d){return d===null||z(d)?(e.exit("htmlFlowData"),fe(d)):(e.consume(d),Z)}function fe(d){return e.exit("htmlFlow"),n(d)}}function ga(e,n,t){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function ya(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(zt,n,t)}}const xa={name:"htmlText",tokenize:ka};function ka(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),F):m===63?(e.consume(m),C):ye(m)?(e.consume(m),W):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):ye(m)?(e.consume(m),I):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):z(m)?(l=c,Q(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?re(m):m===45?p(m):c(m)}function g(m){const Z="CDATA[";return m===Z.charCodeAt(o++)?(e.consume(m),o===Z.length?w:g):t(m)}function w(m){return m===null?t(m):m===93?(e.consume(m),v):z(m)?(l=w,Q(m)):(e.consume(m),w)}function v(m){return m===93?(e.consume(m),x):w(m)}function x(m){return m===62?re(m):m===93?(e.consume(m),x):w(m)}function I(m){return m===null||m===62?re(m):z(m)?(l=I,Q(m)):(e.consume(m),I)}function C(m){return m===null?t(m):m===63?(e.consume(m),L):z(m)?(l=C,Q(m)):(e.consume(m),C)}function L(m){return m===62?re(m):C(m)}function F(m){return ye(m)?(e.consume(m),k):t(m)}function k(m){return m===45||ge(m)?(e.consume(m),k):$(m)}function $(m){return z(m)?(l=$,Q(m)):q(m)?(e.consume(m),$):re(m)}function W(m){return m===45||ge(m)?(e.consume(m),W):m===47||m===62||X(m)?B(m):t(m)}function B(m){return m===47?(e.consume(m),re):m===58||m===95||ye(m)?(e.consume(m),y):z(m)?(l=B,Q(m)):q(m)?(e.consume(m),B):re(m)}function y(m){return m===45||m===46||m===58||m===95||ge(m)?(e.consume(m),y):T(m)}function T(m){return m===61?(e.consume(m),_):z(m)?(l=T,Q(m)):q(m)?(e.consume(m),T):B(m)}function _(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,P):z(m)?(l=_,Q(m)):q(m)?(e.consume(m),_):(e.consume(m),R)}function P(m){return m===i?(e.consume(m),i=void 0,D):m===null?t(m):z(m)?(l=P,Q(m)):(e.consume(m),P)}function R(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||X(m)?B(m):(e.consume(m),R)}function D(m){return m===47||m===62||X(m)?B(m):t(m)}function re(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function Q(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ie}function ie(m){return q(m)?U(e,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ee(m)}function ee(m){return e.enter("htmlTextData"),l(m)}}const Fn={name:"labelEnd",resolveAll:Sa,resolveTo:Ca,tokenize:Aa},ba={tokenize:Ia},wa={tokenize:Ea},va={tokenize:_a};function Sa(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&Ie(e,0,e.length,t),e}function Ca(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=_e(a,e.slice(o+1,o+r+3)),a=_e(a,[["enter",f,n]]),a=_e(a,Yt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=_e(a,[["exit",f,n],e[l-2],e[l-1],["exit",s,n]]),a=_e(a,e.slice(l+1)),a=_e(a,[["exit",u,n]]),Ie(e,o,e.length,a),e}function Aa(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(Le(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):t(p)}function u(p){return p===40?e.attempt(ba,f,l?f:c)(p):p===91?e.attempt(wa,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(va,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function Ia(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return X(c)?It(e,o)(c):o(c)}function o(c){return c===41?f(c):ri(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return X(c)?It(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?li(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return X(c)?It(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function Ea(e,n,t){const r=this;return i;function i(a){return ii.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function _a(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const Ta={name:"labelStartImage",resolveAll:Fn.resolveAll,tokenize:Pa};function Pa(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const za={name:"labelStartLink",resolveAll:Fn.resolveAll,tokenize:Da};function Da(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const fn={name:"lineEnding",tokenize:La};function La(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),U(e,n,"linePrefix")}}const qt={name:"thematicBreak",tokenize:Fa};function Fa(e,n,t){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||z(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),q(s)?U(e,a,"whitespace")(s):a(s))}}const xe={continuation:{tokenize:Ma},exit:$a,name:"list",tokenize:Ra},Na={partial:!0,tokenize:ja},Oa={partial:!0,tokenize:Ba};function Ra(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:vn(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(qt,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return vn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(zt,r.interrupt?t:f,e.attempt(Na,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return q(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Ma(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(zt,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!q(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Oa,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(xe,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ba(e,n,t){const r=this;return U(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function $a(e){e.exit(this.containerState.type)}function ja(e,n,t){const r=this;return U(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!q(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const wr={name:"setextUnderline",resolveTo:qa,tokenize:Ha};function qa(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function Ha(e,n,t){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):t(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),q(s)?U(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||z(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const Ua={tokenize:Va};function Va(e){const n=this,t=e.attempt(zt,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Go,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Wa={resolveAll:ai()},Qa=oi("string"),Ya=oi("text");function oi(e){return{resolveAll:ai(e==="text"?Ka:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),o(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ai(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function Ka(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Ga={42:xe,43:xe,45:xe,48:xe,49:xe,50:xe,51:xe,52:xe,53:xe,54:xe,55:xe,56:xe,57:xe,62:Jr},Xa={91:ta},Za={[-2]:cn,[-1]:cn,32:cn},Ja={35:aa,42:qt,45:[wr,qt],60:fa,61:wr,95:qt,96:kr,126:kr},eu={38:ti,92:ei},tu={[-5]:fn,[-4]:fn,[-3]:fn,33:Ta,38:ti,42:Sn,60:[zo,xa],91:za,92:[la,ei],93:Fn,95:Sn,96:Uo},nu={null:[Sn,Wa]},ru={null:[42,95]},iu={null:[]},lu=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ru,contentInitial:Xa,disable:iu,document:Ga,flow:Ja,flowInitial:Za,insideSpan:nu,string:eu,text:tu},Symbol.toStringTag,{value:"Module"}));function ou(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:$(F),check:$(k),consume:I,enter:C,exit:L,interrupt:$(k,{interrupt:!0})},s={code:null,containerState:{},defineSkip:w,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&o.push(n),s;function c(T){return l=_e(l,T),v(),l[l.length-1]!==null?[]:(W(n,0),s.events=Yt(o,s.events,s),s.events)}function p(T,_){return uu(h(T),_)}function h(T){return au(l,T)}function g(){const{_bufferIndex:T,_index:_,line:P,column:R,offset:D}=r;return{_bufferIndex:T,_index:_,line:P,column:R,offset:D}}function w(T){i[T.line]=T.column,y()}function v(){let T;for(;r._index<l.length;){const _=l[r._index];if(typeof _=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<_.length;)x(_.charCodeAt(r._bufferIndex));else x(_)}}function x(T){f=f(T)}function I(T){z(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,y()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function C(T,_){const P=_||{};return P.type=T,P.start=g(),s.events.push(["enter",P,s]),a.push(P),P}function L(T){const _=a.pop();return _.end=g(),s.events.push(["exit",_,s]),_}function F(T,_){W(T,_.from)}function k(T,_){_.restore()}function $(T,_){return P;function P(R,D,re){let Q,ie,ee,m;return Array.isArray(R)?fe(R):"tokenize"in R?fe([R]):Z(R);function Z(Y){return we;function we(le){const se=le!==null&&Y[le],Ee=le!==null&&Y.null,je=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return fe(je)(le)}}function fe(Y){return Q=Y,ie=0,Y.length===0?re:d(Y[ie])}function d(Y){return we;function we(le){return m=B(),ee=Y,Y.partial||(s.currentConstruct=Y),Y.name&&s.parser.constructs.disable.null.includes(Y.name)?me():Y.tokenize.call(_?Object.assign(Object.create(s),_):s,u,ae,me)(le)}}function ae(Y){return T(ee,m),D}function me(Y){return m.restore(),++ie<Q.length?d(Q[ie]):re}}}function W(T,_){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&Ie(s.events,_,s.events.length-_,T.resolve(s.events.slice(_),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function B(){const T=g(),_=s.previous,P=s.currentConstruct,R=s.events.length,D=Array.from(a);return{from:R,restore:re};function re(){r=T,s.previous=_,s.currentConstruct=P,s.events.length=R,a=D,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function au(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function uu(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
2
2
  `;break}case-3:{l=`\r
3
3
  `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function su(e){const r={constructs:Xr([lu,...(e||{}).extensions||[]]),content:i(Co),defined:[],document:i(Io),flow:i(Ua),lazy:{},string:i(Qa),text:i(Ya)};return r;function i(o){return l;function l(a){return ou(r,o,a)}}}function cu(e){for(;!ni(e););return e}const vr=/[\0\t\n\r]/g;function fu(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(vr.lastIndex=c,s=vr.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){n=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const hu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pu(e){return e.replace(hu,mu)}function mu(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return Zr(t.slice(o?2:1),o?16:10)}return Ln(t)||e}const ui={}.hasOwnProperty;function du(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),gu(t)(cu(su(t).document().write(fu()(e,n,!0))))}function gu(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(V),autolinkProtocol:B,autolinkEmail:B,atxHeading:o(te),blockQuote:o(Ee),characterEscape:B,characterReference:B,codeFenced:o(je),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(je,l),codeText:o(xt,l),codeTextData:B,data:B,codeFlowValue:B,definition:o(Ke),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Ge),hardBreakEscape:o(de),hardBreakTrailing:o(de),htmlFlow:o(Te,l),htmlFlowData:B,htmlText:o(Te,l),htmlTextData:B,image:o(Pe),label:l,link:o(V),listItem:o(ze),listItemValue:p,listOrdered:o(K,c),listUnordered:o(K),paragraph:o(ve),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(te),strong:o(kt),thematicBreak:o(ul)},exit:{atxHeading:u(),atxHeadingSequence:F,autolink:u(),autolinkEmail:se,autolinkProtocol:le,blockQuote:u(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:Y,characterReference:we,codeFenced:u(v),codeFencedFence:w,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:u(x),codeText:u(D),codeTextData:y,data:y,definition:u(),definitionDestinationString:L,definitionLabelString:I,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(_),hardBreakTrailing:u(_),htmlFlow:u(P),htmlFlowData:y,htmlText:u(R),htmlTextData:y,image:u(Q),label:ee,labelText:ie,lineEnding:T,link:u(re),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ae,resourceDestinationString:m,resourceTitleString:Z,resource:fe,setextHeading:u(W),setextHeadingLineSequence:$,setextHeadingText:k,strong:u(),thematicBreak:u()}};si(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(b){let E={type:"root",children:[]};const N={stack:[E],tokenStack:[],config:n,enter:a,exit:s,buffer:l,resume:f,data:t},H=[];let G=-1;for(;++G<b.length;)if(b[G][1].type==="listOrdered"||b[G][1].type==="listUnordered")if(b[G][0]==="enter")H.push(G);else{const De=H.pop();G=i(b,De,G)}for(G=-1;++G<b.length;){const De=n[b[G][0]];ui.call(De,b[G][1].type)&&De[b[G][1].type].call(Object.assign({sliceSerialize:b[G][2].sliceSerialize},N),b[G][1])}if(N.tokenStack.length>0){const De=N.tokenStack[N.tokenStack.length-1];(De[1]||Sr).call(N,void 0,De[0])}for(E.position={start:Ue(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:Ue(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},G=-1;++G<n.transforms.length;)E=n.transforms[G](E)||E;return E}function i(b,E,N){let H=E-1,G=-1,De=!1,Xe,Me,bt,wt;for(;++H<=N;){const Se=b[H];switch(Se[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Se[0]==="enter"?G++:G--,wt=void 0;break}case"lineEndingBlank":{Se[0]==="enter"&&(Xe&&!wt&&!G&&!bt&&(bt=H),wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wt=void 0}if(!G&&Se[0]==="enter"&&Se[1].type==="listItemPrefix"||G===-1&&Se[0]==="exit"&&(Se[1].type==="listUnordered"||Se[1].type==="listOrdered")){if(Xe){let lt=H;for(Me=void 0;lt--;){const Be=b[lt];if(Be[1].type==="lineEnding"||Be[1].type==="lineEndingBlank"){if(Be[0]==="exit")continue;Me&&(b[Me][1].type="lineEndingBlank",De=!0),Be[1].type="lineEnding",Me=lt}else if(!(Be[1].type==="linePrefix"||Be[1].type==="blockQuotePrefix"||Be[1].type==="blockQuotePrefixWhitespace"||Be[1].type==="blockQuoteMarker"||Be[1].type==="listItemIndent"))break}bt&&(!Me||bt<Me)&&(Xe._spread=!0),Xe.end=Object.assign({},Me?b[Me][1].start:Se[1].end),b.splice(Me||H,0,["exit",Xe,Se[2]]),H++,N++}if(Se[1].type==="listItemPrefix"){const lt={type:"listItem",_spread:!1,start:Object.assign({},Se[1].start),end:void 0};Xe=lt,b.splice(H,0,["enter",lt,Se[2]]),H++,N++,bt=void 0,wt=!0}}}return b[E][1]._spread=De,N}function o(b,E){return N;function N(H){a.call(this,b(H),H),E&&E.call(this,H)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(b,E,N){this.stack[this.stack.length-1].children.push(b),this.stack.push(b),this.tokenStack.push([E,N||void 0]),b.position={start:Ue(E.start),end:void 0}}function u(b){return E;function E(N){b&&b.call(this,N),s.call(this,N)}}function s(b,E){const N=this.stack.pop(),H=this.tokenStack.pop();if(H)H[0].type!==b.type&&(E?E.call(this,b,H[0]):(H[1]||Sr).call(this,b,H[0]));else throw new Error("Cannot close `"+b.type+"` ("+At({start:b.start,end:b.end})+"): it’s not open");N.position.end=Ue(b.end)}function f(){return Dn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(b){if(this.data.expectingFirstListItemValue){const E=this.stack[this.stack.length-2];E.start=Number.parseInt(this.sliceSerialize(b),10),this.data.expectingFirstListItemValue=void 0}}function h(){const b=this.resume(),E=this.stack[this.stack.length-1];E.lang=b}function g(){const b=this.resume(),E=this.stack[this.stack.length-1];E.meta=b}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const b=this.resume(),E=this.stack[this.stack.length-1];E.value=b.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const b=this.resume(),E=this.stack[this.stack.length-1];E.value=b.replace(/(\r?\n|\r)$/g,"")}function I(b){const E=this.resume(),N=this.stack[this.stack.length-1];N.label=E,N.identifier=Le(this.sliceSerialize(b)).toLowerCase()}function C(){const b=this.resume(),E=this.stack[this.stack.length-1];E.title=b}function L(){const b=this.resume(),E=this.stack[this.stack.length-1];E.url=b}function F(b){const E=this.stack[this.stack.length-1];if(!E.depth){const N=this.sliceSerialize(b).length;E.depth=N}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function $(b){const E=this.stack[this.stack.length-1];E.depth=this.sliceSerialize(b).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function B(b){const N=this.stack[this.stack.length-1].children;let H=N[N.length-1];(!H||H.type!=="text")&&(H=al(),H.position={start:Ue(b.start),end:void 0},N.push(H)),this.stack.push(H)}function y(b){const E=this.stack.pop();E.value+=this.sliceSerialize(b),E.position.end=Ue(b.end)}function T(b){const E=this.stack[this.stack.length-1];if(this.data.atHardBreak){const N=E.children[E.children.length-1];N.position.end=Ue(b.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(E.type)&&(B.call(this,b),y.call(this,b))}function _(){this.data.atHardBreak=!0}function P(){const b=this.resume(),E=this.stack[this.stack.length-1];E.value=b}function R(){const b=this.resume(),E=this.stack[this.stack.length-1];E.value=b}function D(){const b=this.resume(),E=this.stack[this.stack.length-1];E.value=b}function re(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const E=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=E,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function Q(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const E=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=E,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function ie(b){const E=this.sliceSerialize(b),N=this.stack[this.stack.length-2];N.label=pu(E),N.identifier=Le(E).toLowerCase()}function ee(){const b=this.stack[this.stack.length-1],E=this.resume(),N=this.stack[this.stack.length-1];if(this.data.inReference=!0,N.type==="link"){const H=b.children;N.children=H}else N.alt=E}function m(){const b=this.resume(),E=this.stack[this.stack.length-1];E.url=b}function Z(){const b=this.resume(),E=this.stack[this.stack.length-1];E.title=b}function fe(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ae(b){const E=this.resume(),N=this.stack[this.stack.length-1];N.label=E,N.identifier=Le(this.sliceSerialize(b)).toLowerCase(),this.data.referenceType="full"}function me(b){this.data.characterReferenceType=b.type}function Y(b){const E=this.sliceSerialize(b),N=this.data.characterReferenceType;let H;N?(H=Zr(E,N==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=Ln(E);const G=this.stack[this.stack.length-1];G.value+=H}function we(b){const E=this.stack.pop();E.position.end=Ue(b.end)}function le(b){y.call(this,b);const E=this.stack[this.stack.length-1];E.url=this.sliceSerialize(b)}function se(b){y.call(this,b);const E=this.stack[this.stack.length-1];E.url="mailto:"+this.sliceSerialize(b)}function Ee(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ge(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function de(){return{type:"break"}}function Te(){return{type:"html",value:""}}function Pe(){return{type:"image",title:null,url:"",alt:null}}function V(){return{type:"link",title:null,url:"",children:[]}}function K(b){return{type:"list",ordered:b.type==="listOrdered",start:null,spread:b._spread,children:[]}}function ze(b){return{type:"listItem",spread:b._spread,checked:null,children:[]}}function ve(){return{type:"paragraph",children:[]}}function kt(){return{type:"strong",children:[]}}function al(){return{type:"text",value:""}}function ul(){return{type:"thematicBreak"}}}function Ue(e){return{line:e.line,column:e.column,offset:e.offset}}function si(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?si(e,r):yu(e,r)}}function yu(e,n){let t;for(t in n)if(ui.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function Sr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+At({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+At({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+At({start:n.start,end:n.end})+") is still open")}function xu(e){const n=this;n.parser=t;function t(r){return du(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Ut(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function ku(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Kt=(function(e){if(e==null)return Su;if(typeof e=="function")return Gt(e);if(typeof e=="object")return Array.isArray(e)?bu(e):wu(e);if(typeof e=="string")return vu(e);throw new Error("Expected function, string, or object as test")});function bu(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=Kt(e[t]);return Gt(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function wu(e){const n=e;return Gt(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function vu(e){return Gt(n);function n(t){return t&&t.type===e}}function Gt(e){return n;function n(t,r,i){return!!(Cu(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Su(){return!0}function Cu(e){return e!==null&&typeof e=="object"&&"type"in e}const ci=[],Au=!0,Cn=!1,Iu="skip";function fi(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=Kt(i),l=r?-1:1;a(e,void 0,[])();function a(u,s,f){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=ci,g,w,v;if((!n||o(u,s,f[f.length-1]||void 0))&&(h=Eu(t(u,f)),h[0]===Cn))return h;if("children"in u&&u.children){const x=u;if(x.children&&h[0]!==Iu)for(w=(r?x.children.length:-1)+l,v=f.concat(x);w>-1&&w<x.children.length;){const I=x.children[w];if(g=a(I,w,v)(),g[0]===Cn)return g;w=typeof g[1]=="number"?g[1]:w+l}}return h}}}function Eu(e){return Array.isArray(e)?e:typeof e=="number"?[Au,e]:e==null?ci:[e]}function _u(e,n,t){const i=Kt((t||{}).ignore||[]),o=Tu(n);let l=-1;for(;++l<o.length;)fi(e,"text",a);function a(s,f){let c=-1,p;for(;++c<f.length;){const h=f[c],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return u(s,f)}function u(s,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let g=0;const v=c.children.indexOf(s);let x=!1,I=[];p.lastIndex=0;let C=p.exec(s.value);for(;C;){const L=C.index,F={index:C.index,input:C.input,stack:[...f,s]};let k=h(...C,F);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=L+1:(g!==L&&I.push({type:"text",value:s.value.slice(g,L)}),Array.isArray(k)?I.push(...k):k&&I.push(k),g=L+C[0].length,x=!0),!p.global)break;C=p.exec(s.value)}return x?(g<s.value.length&&I.push({type:"text",value:s.value.slice(g)}),c.children.splice(v,1,...I)):I=[s],v+I.length}}function Tu(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const i=t[r];n.push([Pu(i[0]),zu(i[1])])}return n}function Pu(e){return typeof e=="string"?new RegExp(ku(e),"g"):e}function zu(e){return typeof e=="function"?e:function(){return e}}const hn="phrasing",pn=["autolink","link","image","label"];function Du(){return{transforms:[Bu],enter:{literalAutolink:Fu,literalAutolinkEmail:mn,literalAutolinkHttp:mn,literalAutolinkWww:mn},exit:{literalAutolink:Mu,literalAutolinkEmail:Ru,literalAutolinkHttp:Nu,literalAutolinkWww:Ou}}}function Lu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hn,notInConstruct:pn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hn,notInConstruct:pn},{character:":",before:"[ps]",after:"\\/",inConstruct:hn,notInConstruct:pn}]}}function Fu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mn(e){this.config.enter.autolinkProtocol.call(this,e)}function Nu(e){this.config.exit.autolinkProtocol.call(this,e)}function Ou(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function Ru(e){this.config.exit.autolinkEmail.call(this,e)}function Mu(e){this.exit(e)}function Bu(e){_u(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$u],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ju]],{ignore:["link","linkReference"]})}function $u(e,n,t,r,i){let o="";if(!hi(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!qu(t)))return!1;const l=Hu(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function ju(e,n,t,r){return!hi(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function qu(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Hu(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=Ut(e,"(");let o=Ut(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function hi(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||tt(t)||Qt(t))&&(!n||t!==47)}pi.peek=Zu;function Uu(){this.buffer()}function Vu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Wu(){this.buffer()}function Qu(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Yu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Le(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Ku(e){this.exit(e)}function Gu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Le(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Xu(e){this.exit(e)}function Zu(){return"["}function pi(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function Ju(){return{enter:{gfmFootnoteCallString:Uu,gfmFootnoteCall:Vu,gfmFootnoteDefinitionLabelString:Wu,gfmFootnoteDefinition:Qu},exit:{gfmFootnoteCallString:Yu,gfmFootnoteCall:Ku,gfmFootnoteDefinitionLabelString:Gu,gfmFootnoteDefinition:Xu}}}function es(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:pi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let u=a.move("[^");const s=o.enter("footnoteDefinition"),f=o.enter("label");return u+=a.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((n?`
4
4
  `:" ")+o.indentLines(o.containerFlow(r,a.current()),n?mi:ts))),s(),u}}function ts(e,n,t){return n===0?e:mi(e,n,t)}function mi(e,n,t){return(t?"":" ")+e}const ns=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];di.peek=as;function rs(){return{canContainEols:["delete"],enter:{strikethrough:ls},exit:{strikethrough:os}}}function is(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ns}],handlers:{delete:di}}}function ls(e){this.enter({type:"delete",children:[]},e)}function os(e){this.exit(e)}function di(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function as(){return"~"}function us(e){return e.length}function ss(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||us,o=[],l=[],a=[],u=[];let s=0,f=-1;for(;++f<e.length;){const w=[],v=[];let x=-1;for(e[f].length>s&&(s=e[f].length);++x<e[f].length;){const I=cs(e[f][x]);if(t.alignDelimiters!==!1){const C=i(I);v[x]=C,(u[x]===void 0||C>u[x])&&(u[x]=C)}w.push(I)}l[f]=w,a[f]=v}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<s;)o[c]=Cr(r[c]);else{const w=Cr(r);for(;++c<s;)o[c]=w}c=-1;const p=[],h=[];for(;++c<s;){const w=o[c];let v="",x="";w===99?(v=":",x=":"):w===108?v=":":w===114&&(x=":");let I=t.alignDelimiters===!1?1:Math.max(1,u[c]-v.length-x.length);const C=v+"-".repeat(I)+x;t.alignDelimiters!==!1&&(I=v.length+I+x.length,I>u[c]&&(u[c]=I),h[c]=I),p[c]=C}l.splice(1,0,p),a.splice(1,0,h),f=-1;const g=[];for(;++f<l.length;){const w=l[f],v=a[f];c=-1;const x=[];for(;++c<s;){const I=w[c]||"";let C="",L="";if(t.alignDelimiters!==!1){const F=u[c]-(v[c]||0),k=o[c];k===114?C=" ".repeat(F):k===99?F%2?(C=" ".repeat(F/2+.5),L=" ".repeat(F/2-.5)):(C=" ".repeat(F/2),L=C):L=" ".repeat(F)}t.delimiterStart!==!1&&!c&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&I==="")&&(t.delimiterStart!==!1||c)&&x.push(" "),t.alignDelimiters!==!1&&x.push(C),x.push(I),t.alignDelimiters!==!1&&x.push(L),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||c!==s-1)&&x.push("|")}g.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
@@ -34,4 +34,4 @@ import{g as Zt,c as ft,a as ne,d as sl,p as cl,f as pe,b as qe,s as Jt}from"../c
34
34
  \f\r "&'<=>\``.split("")],[`\0
35
35
  \f\r "&'<=>\``.split(""),`\0
36
36
  \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Fh(e,n,t,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let l=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let u;i.space==="html"&&e.tagName==="svg"&&(r.schema=tl);const s=Nh(r,e.properties),f=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,f&&(l=!1),(s||!o||!_h(e,n,t))&&(a.push("<",e.tagName,s?" "+s:""),l&&(i.space==="svg"||r.settings.closeSelfClosing)&&(u=s.charAt(s.length-1),(!r.settings.tightSelfClosing||u==="/"||u&&u!=='"'&&u!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(f),!l&&(!o||!Un(e,n,t))&&a.push("</"+e.tagName+">"),a.join("")}function Nh(e,n){const t=[];let r=-1,i;if(n){for(i in n)if(n[i]!==null&&n[i]!==void 0){const o=Oh(e,i,n[i]);o&&t.push(o)}}for(;++r<t.length;){const o=e.settings.tightAttributes?t[r].charAt(t[r].length-1):void 0;r!==t.length-1&&o!=='"'&&o!=="'"&&(t[r]+=" ")}return t.join("")}function Oh(e,n,t){const r=$f(e.schema,n),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1;let l=e.quote,a;if(r.overloadedBoolean&&(t===r.attribute||t==="")?t=!0:(r.boolean||r.overloadedBoolean)&&(typeof t!="string"||t===r.attribute||t==="")&&(t=!!t),t==null||t===!1||typeof t=="number"&&Number.isNaN(t))return"";const u=st(r.attribute,Object.assign({},e.settings.characterReferences,{subset:jt.name[i][o]}));return t===!0||(t=Array.isArray(t)?(r.commaSeparated?fh:hh)(t,{padLeft:!e.settings.tightCommaSeparatedLists}):String(t),e.settings.collapseEmptyAttributes&&!t)?u:(e.settings.preferUnquoted&&(a=st(t,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:jt.unquoted[i][o]}))),a!==t&&(e.settings.quoteSmart&&Ut(t,l)>Ut(t,e.alternative)&&(l=e.alternative),a=l+st(t,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?jt.single:jt.double)[i][o],attribute:!0}))+l),u+(a&&"="+a))}const Rh=["<","&"];function ol(e,n,t,r){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?e.value:st(e.value,Object.assign({},r.settings.characterReferences,{subset:Rh}))}function Mh(e,n,t,r){return r.settings.allowDangerousHtml?e.value:ol(e,n,t,r)}function Bh(e,n,t,r){return r.all(e)}const $h=fs("type",{invalid:jh,unknown:qh,handlers:{comment:sh,doctype:ch,element:Fh,raw:Mh,root:Bh,text:ol}});function jh(e){throw new Error("Expected node, not `"+e+"`")}function qh(e){const n=e;throw new Error("Cannot compile unknown node `"+n.type+"`")}const Hh={},Uh={},Vh=[];function Wh(e,n){const t=n||Hh,r=t.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Qh,all:Yh,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||Ff,characterReferences:t.characterReferences||Uh,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?tl:Hf,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Qh(e,n,t){return $h(e,n,t,this)}function Yh(e){const n=[],t=e&&e.children||Vh;let r=-1;for(;++r<t.length;)n[r]=this.one(t[r],r,e);return n.join("")}function Kh(e){const n=this,t={...n.data("settings"),...e};n.compiler=r;function r(i){return Wh(i,t)}}function Yr(e){return ho().use(xu).use(Oc).use(Sf).use(Lf).use(Kh).processSync(e).toString()}var Kr=pe("<button><!></button>"),Gh=pe('<div class="flex items-center gap-2"><div class="my-4 flex w-64 grow items-center gap-x-2 pr-4"><label><i class="fa-solid fa-search"></i></label> <div class="relative flex grow overflow-visible"><!></div></div> <div class="btn-group preset-outlined-surface-200-800"><!> <!></div></div>'),Xh=pe('<div class="text-center text-warning-500">Character name required</div>'),Zh=pe('<div class="text-center text-warning-500">A character already exists with that name</div>'),Jh=pe(`<!> <div class="mx-5 mb-8 flex max-w-100 flex-row items-center"><i class="fa-solid fa-info-circle mr-2 text-blue-300"></i> <div class="text-surface-contrast-300-700 italic">Note that this image will represent the character on the Character page, but is not
37
- added to any gallery!</div></div>`,1),ep=pe('<div class="m-4 min-w-100"><!> <!></div>'),tp=pe('<div class="h-128 w-128 shrink-0 max-lg:h-64 max-lg:w-64"><!></div>'),np=pe('<button title="move up" class="btn-icon preset-tonal"><!></button>'),rp=pe('<button title="move down" class="btn-icon preset-tonal"><!></button>'),ip=pe('<div class="mx-3 mt-3 border-l-3 border-l-primary-200-800 pl-3 text-xl font-extralight italic max-lg:text-lg"></div>'),lp=pe('<div class="my-8 flex"><!> <div class="flex grow flex-col items-stretch"><div class="flex items-center gap-3 border-b border-surface-600-400 pb-3"><div class="mr-4 flex h-24 min-h-24 w-24 min-w-24 items-center justify-center overflow-hidden rounded-full border border-surface-600-400 max-lg:h-16 max-lg:min-h-16 max-lg:w-16 max-lg:min-w-16"><!></div> <div class="pb-2 text-6xl font-extralight max-lg:text-3xl"> </div> <div class="px-2 pb-2 text-6xl font-extralight max-lg:text-3xl" style="transform: scaleX(0.1);">|</div> <div class="pt-3 pb-2 text-xl font-light text-surface-800-200"> </div> <div class="grow"></div> <div class="flex flex-col justify-around gap-2"><!> <!></div> <div><button class="btn preset-filled-primary-200-800"><!> Edit</button></div></div> <!> <div class="mx-3 mt-3 max-h-80 min-w-0 shrink overflow-x-auto overflow-y-scroll"></div></div></div>'),op=pe('<button class="btn preset-filled-primary-50-950 p-3"><!> <span>Save</span></button>'),ap=pe('<div class="h-full cursor-pointer rounded-2xl border p-3">Saving...</div>'),up=pe('<div class="flex items-center gap-x-3 py-1 pr-4"><div><button style="line-height: 1;"><div class="flex items-center"><!> <span class="font-normal">Delete</span></div> <div class="text-[8pt]">(requires shift-click)</div></button></div> <div><!> <!></div></div>'),sp=pe('<div class="flex flex-col items-center"><!> <button style="line-height: 1;"><div class="flex items-center"><!> <span class="font-normal">Remove Thumbnail</span></div> <div class="text-[8pt]">(requires shift-click)</div></button></div>'),cp=pe("<pre> </pre>"),fp=pe('<div class="min-h-[75vh] min-w-[50vw] p-3"><div class="grid grid-cols-2 grid-rows-1"><div><!> <!> <!> <!></div> <div class="flex flex-col items-center"><div><!></div> <div><!></div></div></div> <div><!></div></div>'),hp=pe('<div class="absolute right-3 bottom-2 z-10"><!></div> <div class="flex flex-col overflow-hidden text-surface-contrast-50-950"></div> <!>',1);function Ap(e,n){const t=cl();nt(n,!0);let r=He(Yn(Object.values(n.data.characters))),i=He(Yn(new WeakMap(Object.values(A(r)).map(v=>[v,v.name])))),o=He(!1),l=He(!1),a=He(""),u=He(null);const s=Ce(()=>A(u)??!0),f=Pl(),c=zl();bl(()=>{A(u)===!1?window.localStorage.setItem("is-character-view-partial","true"):A(u)===!0&&window.localStorage.removeItem("is-character-view-partial")}),wl(()=>{window.localStorage.getItem("is-character-view-partial")&&he(u,!1);const v=x=>{he(o,x.shiftKey,!0)};return window.addEventListener("keydown",v),window.addEventListener("keyup",v),()=>{window.removeEventListener("keydown",v),window.removeEventListener("keyup",v)}});async function p(){he(l,!0);try{await fetch(_l("/api/characters/save"),{method:"POST",body:JSON.stringify(A(r)),headers:{"Content-Type":"application/json"}}),c.epoch+=1,f.reset(),he(i,new WeakMap(Object.values(A(r)).map(v=>[v,v.name])),!0)}finally{he(l,!1),Tl()}}let h=He(""),g=He(null);const w=Ce(()=>A(h)?Nl.go(A(h),A(r),{keys:["name","short_description","description"]}).map(v=>{const x=A(r).findIndex(I=>I.name===v.obj.name);return[v.obj,x]}):A(r).map((v,x)=>[v,x]));Al("75i7xh",v=>{vl(()=>{Sl.title="Character Editor | Art Site Editor"})}),Ll(e,{title:"Characters",navRight:x=>{var I=Gh(),C=j(I),L=j(C),F=oe(L,2),k=j(F);Fl(k,{get id(){return`${t}-search-box`},autoFocus:!0,class:"input h-8 w-0 grow",noReportValidation:!0,acceptSuggestionOnEnter:!0,get options(){return n.data.characters},onSelect:(y,T)=>{if(T){const _=A(r).findIndex(P=>P.name===T.name);he(g,[T,_],!0)}},get search(){return A(h)},set search(y){he(h,y,!0)}}),M(F),M(C);var $=oe(C,2),W=j($);nr(W,{tooltip:"hide character portraits",placement:"bottom",children:(T,_=Oe)=>{var P=Kr();let R;var D=j(P);lr(D,{}),M(P),Kn(P,_),Ve(()=>R=Nt(P,1,"btn-icon btn",null,R,{"preset-filled":!A(s)})),qe("click",P,()=>{he(u,!1)}),ne(T,P)},$$slots:{default:!0}});var B=oe(W,2);nr(B,{tooltip:"show character portraits",placement:"bottom",children:(T,_=Oe)=>{var P=Kr();let R;var D=j(P);Vl(D,{}),M(P),Kn(P,_),Ve(()=>R=Nt(P,1,"btn-icon btn",null,R,{"preset-filled":A(s)})),qe("click",P,()=>{he(u,!0)}),ne(T,P)},$$slots:{default:!0}}),M($),M(I),Ve(()=>El(L,"for",`${t}-search-box`)),ne(x,I)},children:(x,I)=>{var C=hp(),L=Qe(C),F=j(L);Gn(F,{title:"New Character",class:"preset-filled-primary-50-950",onClose:()=>{he(a,"")},icon:T=>{ql(T,{size:"8pt"})},children:(T,_=Oe)=>{var P=ep(),R=j(P);en(R,{label:"Character name",get value(){return A(a)},set value(m){he(a,m,!0)}});var D=oe(R,2);{var re=m=>{var Z=Xh();ne(m,Z)},Q=m=>{var Z=Zh();ne(m,Z)},ie=Ce(()=>A(r).find(m=>m.name===A(a))),ee=m=>{var Z=Jh(),fe=Qe(Z);{let d=Ce(()=>`Drag a character image here to add ${A(a)}!`);Zn(fe,{get title(){return A(d)},class:"m-2",galleryPath:{character:"",for:"full"},existingIdentifiers:[],onUpload:ae=>{he(r,[...ae.map((me,Y)=>({description:"",index:A(r).length+Y,name:Y===0?A(a):me.file.name,picture:{alt:"",image:me.piece.image},pronouns:"",type:"Character",short_description:void 0,thumbnail:void 0})),...A(r)],!0),p(),_()()}})}Ze(2),ne(m,Z)};Fe(D,m=>{A(a)?A(ie)?m(Q,1):m(ee,-1):m(re)})}M(P),ne(T,P)},$$slots:{icon:!0,default:!0}}),M(L);var k=oe(L,2);Il(k,21,()=>A(w),([B,y])=>`${y}-${A(r).length}`,(B,y)=>{var T=Ce(()=>Cl(A(y),2));let _=()=>A(T)[0],P=()=>A(T)[1];const R=Ce(()=>A(i).get(_())??_().name);var D=lp(),re=j(D);{var Q=V=>{var K=tp(),ze=j(K);{let ve=Ce(()=>({character:A(R),for:"full"}));tr(ze,{get galleryPath(){return A(ve)}})}M(K),ne(V,K)};Fe(re,V=>{A(s)&&V(Q)})}var ie=oe(re,2),ee=j(ie),m=j(ee),Z=j(m);{var fe=V=>{{let K=Ce(()=>({character:A(R),for:A(s)||_().thumbnail?"thumb":"full"}));tr(V,{class:"object-cover object-center",get galleryPath(){return A(K)}})}},d=V=>{lr(V,{})};Fe(Z,V=>{_().thumbnail||!A(s)?V(fe):V(d,-1)})}M(m);var ae=oe(m,2),me=j(ae,!0);M(ae);var Y=oe(ae,4),we=j(Y,!0);M(Y);var le=oe(Y,4),se=j(le);{var Ee=V=>{var K=np(),ze=j(K);$l(ze,{}),M(K),qe("click",K,ve=>{ve.preventDefault(),ve.stopPropagation(),he(r,[...A(r).slice(0,P()-1),_(),A(r)[P()-1],...A(r).slice(P()+1)],!0),p()}),ne(V,K)};Fe(se,V=>{P()>0&&V(Ee)})}var je=oe(se,2);{var xt=V=>{var K=rp(),ze=j(K);Ml(ze,{}),M(K),qe("click",K,ve=>{ve.preventDefault(),ve.stopPropagation(),he(r,[...A(r).slice(0,P()),A(r)[P()+1],_(),...A(r).slice(P()+2)],!0),p()}),ne(V,K)};Fe(je,V=>{P()<A(r).length-1&&V(xt)})}M(le);var Ke=oe(le,2),Ge=j(Ke),te=j(Ge);Ql(te,{}),Ze(),M(Ge),M(Ke),M(ee);var de=oe(ee,2);{var Te=V=>{var K=ip();ir(K,()=>Yr(_().short_description),!0),M(K),ne(V,K)};Fe(de,V=>{_().short_description&&V(Te)})}var Pe=oe(de,2);ir(Pe,()=>Yr(_().description),!0),M(Pe),M(ie),M(D),Ve(()=>{Jt(me,_().name),Jt(we,_().pronouns)}),qe("click",Ge,()=>{he(g,[_(),P()],!0)}),ne(B,D)}),M(k);var $=oe(k,2);{var W=B=>{const y=Ce(()=>{const[R,D]=A(g);return{character:R,i:D}}),T=Ce(()=>A(i).get(A(y).character)??A(y).character.name);var _=()=>!0,P=R=>{R||(he(g,null),he(h,""))};Gn(B,{headless:!0,get title(){return`Edit ${A(y).character.name??""}`},get open(){return _()},set open(D){P(D)},modalRight:(D,re=Oe)=>{var Q=up(),ie=j(Q),ee=j(ie);let m;var Z=j(ee),fe=j(Z);rr(fe,{size:16}),Ze(2),M(Z),Ze(2),M(ee),M(ie);var d=oe(ie,2),ae=j(d);{var me=le=>{var se=op(),Ee=j(se);Ol(Ee,{size:16}),Ze(2),M(se),qe("click",se,()=>{p()}),ne(le,se)},Y=le=>{var se=ap();ne(le,se)};Fe(ae,le=>{A(l)?le(Y,-1):le(me)})}var we=oe(ae,2);Fe(we,le=>{}),M(d),M(Q),Ve(()=>{m=Nt(ee,1,"btn flex flex-col items-center preset-filled-error-50-950 p-3",null,m,{"cursor-pointer":A(o),"cursor-not-allowed":!A(o)}),ee.disabled=!A(o)}),qe("click",ee,le=>{le.shiftKey&&(he(r,[...A(r).slice(0,A(y).i),...A(r).slice(A(y).i+1)],!0),p(),re()())}),ne(D,Q)},children:(D,re)=>{var Q=fp(),ie=j(Q),ee=j(ie),m=j(ee);en(m,{label:"Name",get value(){return A(y).character.name},set value(te){A(y).character.name=te}});var Z=oe(m,2);en(Z,{label:"Pronouns",get value(){return A(y).character.pronouns},set value(te){A(y).character.pronouns=te}});var fe=oe(Z,2),d=()=>A(y).character.short_description??"",ae=te=>A(y).character.short_description=te;Jn(fe,{label:"Tagline / Short Description",get value(){return d()},set value(te){ae(te)}});var me=oe(fe,2);Jn(me,{label:"Description",big:!0,get value(){return A(y).character.description},set value(te){A(y).character.description=te}}),M(ee);var Y=oe(ee,2),we=j(Y),le=j(we);{let te=Ce(()=>({character:A(T),for:"full"}));er(le,{get galleryPath(){return A(te)},alts:null,isComic:null,isDeindexed:null,isNsfw:null,get resource(){return A(y).character.picture},set resource(de){A(y).character.picture=de},get alt(){return A(y).character.picture.alt},set alt(de){A(y).character.picture.alt=de}})}M(we);var se=oe(we,2),Ee=j(se);{var je=te=>{var de=sp(),Te=j(de);{let ve=Ce(()=>({character:A(T),for:"thumb"}));er(Te,{get galleryPath(){return A(ve)},alts:null,isComic:null,isDeindexed:null,isNsfw:null,get resource(){return A(y).character.thumbnail},set resource(kt){A(y).character.thumbnail=kt},get alt(){return A(y).character.thumbnail.alt},set alt(kt){A(y).character.thumbnail.alt=kt}})}var Pe=oe(Te,2);let V;var K=j(Pe),ze=j(K);rr(ze,{size:16}),Ze(2),M(K),Ze(2),M(Pe),M(de),Ve(()=>{V=Nt(Pe,1,"mb-2 btn flex items-center preset-filled-warning-50-950 py-2",null,V,{"cursor-pointer":A(o),"cursor-not-allowed":!A(o)}),Pe.disabled=!A(o)}),qe("click",Pe,ve=>{ve.shiftKey&&(A(y).character.thumbnail=void 0,p())}),ne(te,de)},xt=te=>{{let de=Ce(()=>({character:A(y).character.name,for:"thumb"}));Zn(te,{title:"Drag an image to add a character thumbnail",class:"m-2",get galleryPath(){return A(de)},existingIdentifiers:[],onUpload:Te=>{A(y).character.thumbnail=Te[0].piece,p()}})}};Fe(Ee,te=>{A(y).character.thumbnail?te(je):te(xt,-1)})}M(se),M(Y),M(ie);var Ke=oe(ie,2),Ge=j(Ke);Xn(Ge,{title:"Advanced",class:"my-3",children:(te,de)=>{Xn(te,{title:"JSON",initial:!1,class:"mt-2 no-scrollbar overflow-scroll border-t",children:(Te,Pe)=>{var V=cp(),K=j(V,!0);M(V),Ve(ze=>Jt(K,ze),[()=>JSON.stringify(A(y).character,null,4)]),ne(Te,V)},$$slots:{default:!0}})},$$slots:{default:!0}}),M(Ke),M(Q),ne(D,Q)},$$slots:{modalRight:!0,default:!0}})};Fe($,B=>{A(g)&&B(W)})}ne(x,C)},$$slots:{navRight:!0,default:!0}}),rt()}sl(["click"]);export{Ap as component};
37
+ added to any gallery!</div></div>`,1),ep=pe('<div class="m-4 min-w-100"><!> <!></div>'),tp=pe('<div class="h-128 w-128 shrink-0 max-xl:h-64 max-xl:w-64"><!></div>'),np=pe('<button title="move up" class="btn-icon preset-tonal"><!></button>'),rp=pe('<button title="move down" class="btn-icon preset-tonal"><!></button>'),ip=pe('<div class="mx-3 mt-3 border-l-3 border-l-primary-200-800 pl-3 text-xl font-extralight italic max-xl:text-lg"></div>'),lp=pe('<div class="my-8 flex"><!> <div class="flex grow flex-col items-stretch"><div class="flex items-center gap-3 border-b border-surface-600-400 pb-3"><div class="mr-4 flex h-24 min-h-24 w-24 min-w-24 items-center justify-center overflow-hidden rounded-full border border-surface-600-400 max-xl:h-16 max-xl:min-h-16 max-xl:w-16 max-xl:min-w-16"><!></div> <div class="pb-2 text-6xl font-extralight max-xl:text-3xl"> </div> <div class="px-2 pb-2 text-6xl font-extralight max-xl:text-3xl" style="transform: scaleX(0.1);">|</div> <div class="pt-3 pb-2 text-xl font-light text-surface-800-200"> </div> <div class="grow"></div> <div class="flex flex-col justify-around gap-2"><!> <!></div> <div><button class="btn preset-filled-primary-200-800"><!> Edit</button></div></div> <!> <div class="mx-3 mt-3 max-h-80 min-w-0 shrink overflow-x-auto overflow-y-scroll"></div></div></div>'),op=pe('<button class="btn preset-filled-primary-50-950 p-3"><!> <span>Save</span></button>'),ap=pe('<div class="h-full cursor-pointer rounded-2xl border p-3">Saving...</div>'),up=pe('<div class="flex items-center gap-x-3 py-1 pr-4"><div><button style="line-height: 1;"><div class="flex items-center"><!> <span class="font-normal">Delete</span></div> <div class="text-[8pt]">(requires shift-click)</div></button></div> <div><!> <!></div></div>'),sp=pe('<div class="flex flex-col items-center"><!> <button style="line-height: 1;"><div class="flex items-center"><!> <span class="font-normal">Remove Thumbnail</span></div> <div class="text-[8pt]">(requires shift-click)</div></button></div>'),cp=pe("<pre> </pre>"),fp=pe('<div class="min-h-[75vh] min-w-[50vw] p-3"><div class="grid grid-cols-2 grid-rows-1"><div><!> <!> <!> <!></div> <div class="flex flex-col items-center"><div><!></div> <div><!></div></div></div> <div><!></div></div>'),hp=pe('<div class="absolute right-3 bottom-2 z-10"><!></div> <div class="flex flex-col overflow-hidden text-surface-contrast-50-950"></div> <!>',1);function Ap(e,n){const t=cl();nt(n,!0);let r=He(Yn(Object.values(n.data.characters))),i=He(Yn(new WeakMap(Object.values(A(r)).map(v=>[v,v.name])))),o=He(!1),l=He(!1),a=He(""),u=He(null);const s=Ce(()=>A(u)??!0),f=Pl(),c=zl();bl(()=>{A(u)===!1?window.localStorage.setItem("is-character-view-partial","true"):A(u)===!0&&window.localStorage.removeItem("is-character-view-partial")}),wl(()=>{window.localStorage.getItem("is-character-view-partial")&&he(u,!1);const v=x=>{he(o,x.shiftKey,!0)};return window.addEventListener("keydown",v),window.addEventListener("keyup",v),()=>{window.removeEventListener("keydown",v),window.removeEventListener("keyup",v)}});async function p(){he(l,!0);try{await fetch(_l("/api/characters/save"),{method:"POST",body:JSON.stringify(A(r)),headers:{"Content-Type":"application/json"}}),c.epoch+=1,f.reset(),he(i,new WeakMap(Object.values(A(r)).map(v=>[v,v.name])),!0)}finally{he(l,!1),Tl()}}let h=He(""),g=He(null);const w=Ce(()=>A(h)?Nl.go(A(h),A(r),{keys:["name","short_description","description"]}).map(v=>{const x=A(r).findIndex(I=>I.name===v.obj.name);return[v.obj,x]}):A(r).map((v,x)=>[v,x]));Al("75i7xh",v=>{vl(()=>{Sl.title="Character Editor | Art Site Editor"})}),Ll(e,{title:"Characters",navRight:x=>{var I=Gh(),C=j(I),L=j(C),F=oe(L,2),k=j(F);Fl(k,{get id(){return`${t}-search-box`},autoFocus:!0,class:"input h-8 w-0 grow",noReportValidation:!0,acceptSuggestionOnEnter:!0,get options(){return n.data.characters},onSelect:(y,T)=>{if(T){const _=A(r).findIndex(P=>P.name===T.name);he(g,[T,_],!0)}},get search(){return A(h)},set search(y){he(h,y,!0)}}),M(F),M(C);var $=oe(C,2),W=j($);nr(W,{tooltip:"hide character portraits",placement:"bottom",children:(T,_=Oe)=>{var P=Kr();let R;var D=j(P);lr(D,{}),M(P),Kn(P,_),Ve(()=>R=Nt(P,1,"btn-icon btn",null,R,{"preset-filled":!A(s)})),qe("click",P,()=>{he(u,!1)}),ne(T,P)},$$slots:{default:!0}});var B=oe(W,2);nr(B,{tooltip:"show character portraits",placement:"bottom",children:(T,_=Oe)=>{var P=Kr();let R;var D=j(P);Vl(D,{}),M(P),Kn(P,_),Ve(()=>R=Nt(P,1,"btn-icon btn",null,R,{"preset-filled":A(s)})),qe("click",P,()=>{he(u,!0)}),ne(T,P)},$$slots:{default:!0}}),M($),M(I),Ve(()=>El(L,"for",`${t}-search-box`)),ne(x,I)},children:(x,I)=>{var C=hp(),L=Qe(C),F=j(L);Gn(F,{title:"New Character",class:"preset-filled-primary-50-950",onClose:()=>{he(a,"")},icon:T=>{ql(T,{size:"8pt"})},children:(T,_=Oe)=>{var P=ep(),R=j(P);en(R,{label:"Character name",get value(){return A(a)},set value(m){he(a,m,!0)}});var D=oe(R,2);{var re=m=>{var Z=Xh();ne(m,Z)},Q=m=>{var Z=Zh();ne(m,Z)},ie=Ce(()=>A(r).find(m=>m.name===A(a))),ee=m=>{var Z=Jh(),fe=Qe(Z);{let d=Ce(()=>`Drag a character image here to add ${A(a)}!`);Zn(fe,{get title(){return A(d)},class:"m-2",galleryPath:{character:"",for:"full"},existingIdentifiers:[],onUpload:ae=>{he(r,[...ae.map((me,Y)=>({description:"",index:A(r).length+Y,name:Y===0?A(a):me.file.name,picture:{alt:"",image:me.piece.image},pronouns:"",type:"Character",short_description:void 0,thumbnail:void 0})),...A(r)],!0),p(),_()()}})}Ze(2),ne(m,Z)};Fe(D,m=>{A(a)?A(ie)?m(Q,1):m(ee,-1):m(re)})}M(P),ne(T,P)},$$slots:{icon:!0,default:!0}}),M(L);var k=oe(L,2);Il(k,21,()=>A(w),([B,y])=>`${y}-${A(r).length}`,(B,y)=>{var T=Ce(()=>Cl(A(y),2));let _=()=>A(T)[0],P=()=>A(T)[1];const R=Ce(()=>A(i).get(_())??_().name);var D=lp(),re=j(D);{var Q=V=>{var K=tp(),ze=j(K);{let ve=Ce(()=>({character:A(R),for:"full"}));tr(ze,{get galleryPath(){return A(ve)}})}M(K),ne(V,K)};Fe(re,V=>{A(s)&&V(Q)})}var ie=oe(re,2),ee=j(ie),m=j(ee),Z=j(m);{var fe=V=>{{let K=Ce(()=>({character:A(R),for:A(s)||_().thumbnail?"thumb":"full"}));tr(V,{class:"object-cover object-center",get galleryPath(){return A(K)}})}},d=V=>{lr(V,{})};Fe(Z,V=>{_().thumbnail||!A(s)?V(fe):V(d,-1)})}M(m);var ae=oe(m,2),me=j(ae,!0);M(ae);var Y=oe(ae,4),we=j(Y,!0);M(Y);var le=oe(Y,4),se=j(le);{var Ee=V=>{var K=np(),ze=j(K);$l(ze,{}),M(K),qe("click",K,ve=>{ve.preventDefault(),ve.stopPropagation(),he(r,[...A(r).slice(0,P()-1),_(),A(r)[P()-1],...A(r).slice(P()+1)],!0),p()}),ne(V,K)};Fe(se,V=>{P()>0&&V(Ee)})}var je=oe(se,2);{var xt=V=>{var K=rp(),ze=j(K);Ml(ze,{}),M(K),qe("click",K,ve=>{ve.preventDefault(),ve.stopPropagation(),he(r,[...A(r).slice(0,P()),A(r)[P()+1],_(),...A(r).slice(P()+2)],!0),p()}),ne(V,K)};Fe(je,V=>{P()<A(r).length-1&&V(xt)})}M(le);var Ke=oe(le,2),Ge=j(Ke),te=j(Ge);Ql(te,{}),Ze(),M(Ge),M(Ke),M(ee);var de=oe(ee,2);{var Te=V=>{var K=ip();ir(K,()=>Yr(_().short_description),!0),M(K),ne(V,K)};Fe(de,V=>{_().short_description&&V(Te)})}var Pe=oe(de,2);ir(Pe,()=>Yr(_().description),!0),M(Pe),M(ie),M(D),Ve(()=>{Jt(me,_().name),Jt(we,_().pronouns)}),qe("click",Ge,()=>{he(g,[_(),P()],!0)}),ne(B,D)}),M(k);var $=oe(k,2);{var W=B=>{const y=Ce(()=>{const[R,D]=A(g);return{character:R,i:D}}),T=Ce(()=>A(i).get(A(y).character)??A(y).character.name);var _=()=>!0,P=R=>{R||(he(g,null),he(h,""))};Gn(B,{headless:!0,get title(){return`Edit ${A(y).character.name??""}`},get open(){return _()},set open(D){P(D)},modalRight:(D,re=Oe)=>{var Q=up(),ie=j(Q),ee=j(ie);let m;var Z=j(ee),fe=j(Z);rr(fe,{size:16}),Ze(2),M(Z),Ze(2),M(ee),M(ie);var d=oe(ie,2),ae=j(d);{var me=le=>{var se=op(),Ee=j(se);Ol(Ee,{size:16}),Ze(2),M(se),qe("click",se,()=>{p()}),ne(le,se)},Y=le=>{var se=ap();ne(le,se)};Fe(ae,le=>{A(l)?le(Y,-1):le(me)})}var we=oe(ae,2);Fe(we,le=>{}),M(d),M(Q),Ve(()=>{m=Nt(ee,1,"btn flex flex-col items-center preset-filled-error-50-950 p-3",null,m,{"cursor-pointer":A(o),"cursor-not-allowed":!A(o)}),ee.disabled=!A(o)}),qe("click",ee,le=>{le.shiftKey&&(he(r,[...A(r).slice(0,A(y).i),...A(r).slice(A(y).i+1)],!0),p(),re()())}),ne(D,Q)},children:(D,re)=>{var Q=fp(),ie=j(Q),ee=j(ie),m=j(ee);en(m,{label:"Name",get value(){return A(y).character.name},set value(te){A(y).character.name=te}});var Z=oe(m,2);en(Z,{label:"Pronouns",get value(){return A(y).character.pronouns},set value(te){A(y).character.pronouns=te}});var fe=oe(Z,2),d=()=>A(y).character.short_description??"",ae=te=>A(y).character.short_description=te;Jn(fe,{label:"Tagline / Short Description",get value(){return d()},set value(te){ae(te)}});var me=oe(fe,2);Jn(me,{label:"Description",big:!0,get value(){return A(y).character.description},set value(te){A(y).character.description=te}}),M(ee);var Y=oe(ee,2),we=j(Y),le=j(we);{let te=Ce(()=>({character:A(T),for:"full"}));er(le,{get galleryPath(){return A(te)},alts:null,isComic:null,isDeindexed:null,isNsfw:null,get resource(){return A(y).character.picture},set resource(de){A(y).character.picture=de},get alt(){return A(y).character.picture.alt},set alt(de){A(y).character.picture.alt=de}})}M(we);var se=oe(we,2),Ee=j(se);{var je=te=>{var de=sp(),Te=j(de);{let ve=Ce(()=>({character:A(T),for:"thumb"}));er(Te,{get galleryPath(){return A(ve)},alts:null,isComic:null,isDeindexed:null,isNsfw:null,get resource(){return A(y).character.thumbnail},set resource(kt){A(y).character.thumbnail=kt},get alt(){return A(y).character.thumbnail.alt},set alt(kt){A(y).character.thumbnail.alt=kt}})}var Pe=oe(Te,2);let V;var K=j(Pe),ze=j(K);rr(ze,{size:16}),Ze(2),M(K),Ze(2),M(Pe),M(de),Ve(()=>{V=Nt(Pe,1,"mb-2 btn flex items-center preset-filled-warning-50-950 py-2",null,V,{"cursor-pointer":A(o),"cursor-not-allowed":!A(o)}),Pe.disabled=!A(o)}),qe("click",Pe,ve=>{ve.shiftKey&&(A(y).character.thumbnail=void 0,p())}),ne(te,de)},xt=te=>{{let de=Ce(()=>({character:A(y).character.name,for:"thumb"}));Zn(te,{title:"Drag an image to add a character thumbnail",class:"m-2",get galleryPath(){return A(de)},existingIdentifiers:[],onUpload:Te=>{A(y).character.thumbnail=Te[0].piece,p()}})}};Fe(Ee,te=>{A(y).character.thumbnail?te(je):te(xt,-1)})}M(se),M(Y),M(ie);var Ke=oe(ie,2),Ge=j(Ke);Xn(Ge,{title:"Advanced",class:"my-3",children:(te,de)=>{Xn(te,{title:"JSON",initial:!1,class:"mt-2 no-scrollbar overflow-scroll border-t",children:(Te,Pe)=>{var V=cp(),K=j(V,!0);M(V),Ve(ze=>Jt(K,ze),[()=>JSON.stringify(A(y).character,null,4)]),ne(Te,V)},$$slots:{default:!0}})},$$slots:{default:!0}}),M(Ke),M(Q),ne(D,Q)},$$slots:{modalRight:!0,default:!0}})};Fe($,B=>{A(g)&&B(W)})}ne(x,C)},$$slots:{navRight:!0,default:!0}}),rt()}sl(["click"]);export{Ap as component};
@@ -1 +1 @@
1
- import{a as f,f as y,c as z,s as G}from"../chunks/C-A59nkV.js";import{p as H,b as K,a as Q,e as R,f as m,s as d,t as S,g as l,c as h,d as E,h as V,$ as W,r as _,u as b,i as X}from"../chunks/DPUojd5V.js";import{i as Y}from"../chunks/BIHqivCG.js";import{h as Z,e as $,r as tt,s as et}from"../chunks/CBMGMT01.js";import{i as at}from"../chunks/YzpLcnjN.js";import{A as rt}from"../chunks/BmRN1zm0.js";import{C as k,T as st}from"../chunks/B1GIV-2D.js";import{L as it,T as g}from"../chunks/DGnDs2M4.js";var lt=y('<div class="flex items-center gap-x-2"><!> <div class="h-4 w-4"></div></div>'),ot=y('<i class="fa-solid fa-save"></i> <span> </span>',1),nt=y("<div><!> <!></div> <!>",1);function _t(w,o){H(o,!0);let e=K(o.data.themeConfig),u=V(!1);async function F(){E(u,!0);try{await fetch(tt("/api/config/save"),{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}finally{E(u,!1),at()}}Z("1gp6n77",A=>{R(()=>{W.title="Config Editor | Art Site Editor"})}),it(w,{title:"Configuration",children:(A,ut)=>{var x=nt(),p=m(x),T=h(p);g(T,{label:"Default Artist",get options(){return o.data.artists},get value(){return e.defaultArtist},set value(i){e.defaultArtist=i}});var O=d(T,2);$(O,17,()=>Object.entries(o.data.themeSchema),([i,c])=>i,(i,c)=>{var n=b(()=>X(l(c),2));let t=()=>l(n)[0],s=()=>l(n)[1];var C=z(),j=m(C);{var I=a=>{g(a,{get label(){return t()},get value(){return e[t()]},set value(r){e[t()]=r}})},L=a=>{var r=lt(),v=h(r);{let U=b(()=>/^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e[t()])?"":"Must be a valid color in hex");g(v,{get label(){return t()},get validationError(){return l(U)},get value(){return e[t()]},set value(q){e[t()]=q}})}var N=d(v,2);_(r),S(()=>et(N,`background-color: ${e[t()]??""};`)),f(a,r)},M=a=>{{let r=b(()=>e[t()]&&!s().options.includes(e[t()])?"Must match one of the available options":"");g(a,{get label(){return t()},get validationError(){return l(r)},get options(){return s().options},get value(){return e[t()]},set value(v){e[t()]=v}})}},B=a=>{k(a,{get label(){return t()},get options(){return s().options},get value(){return e[t()]},set value(r){e[t()]=r}})},D=a=>{k(a,{get label(){return t()},onAddUnknown:r=>r,get value(){return e[t()]},set value(r){e[t()]=r}})},J=a=>{st(a,{get label(){return t()},prefix:"#",get possibleTags(){return o.data.allTags},get value(){return e[t()]},set value(r){e[t()]=r}})};Y(j,a=>{s().type==="string"?a(I):s().type==="color"?a(L,1):s().type==="selection"&&!s().multi?a(M,2):s().type==="selection"&&s().multi?a(B,3):s().type==="string-list"?a(D,4):s().type==="tag-list"&&a(J,5)})}f(i,C)}),_(p);var P=d(p,2);rt(P,{action:F,get disabled(){return l(u)},class:"absolute right-3 bottom-3 preset-filled-primary-50-950",children:(i,c)=>{var n=ot(),t=d(m(n),2),s=h(t,!0);_(t),S(()=>G(s,l(u)?"Saving...":"Save")),f(i,n)},$$slots:{default:!0}}),f(A,x)},$$slots:{default:!0}}),Q()}export{_t as component};
1
+ import{a as f,f as y,c as z,s as G}from"../chunks/C-A59nkV.js";import{p as H,b as K,a as Q,e as R,f as m,s as d,t as S,g as l,c as h,d as E,h as V,$ as W,r as _,u as b,i as X}from"../chunks/DPUojd5V.js";import{i as Y}from"../chunks/BIHqivCG.js";import{h as Z,e as $,r as tt,s as et}from"../chunks/36fRYPqv.js";import{i as at}from"../chunks/CGRPYk0Z.js";import{A as rt}from"../chunks/DaWb7mMs.js";import{C as k,T as st}from"../chunks/Y3Jw1gDP.js";import{L as it,T as g}from"../chunks/DAsycyym.js";var lt=y('<div class="flex items-center gap-x-2"><!> <div class="h-4 w-4"></div></div>'),ot=y('<i class="fa-solid fa-save"></i> <span> </span>',1),nt=y("<div><!> <!></div> <!>",1);function _t(w,o){H(o,!0);let e=K(o.data.themeConfig),u=V(!1);async function F(){E(u,!0);try{await fetch(tt("/api/config/save"),{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}finally{E(u,!1),at()}}Z("1gp6n77",A=>{R(()=>{W.title="Config Editor | Art Site Editor"})}),it(w,{title:"Configuration",children:(A,ut)=>{var x=nt(),p=m(x),T=h(p);g(T,{label:"Default Artist",get options(){return o.data.artists},get value(){return e.defaultArtist},set value(i){e.defaultArtist=i}});var O=d(T,2);$(O,17,()=>Object.entries(o.data.themeSchema),([i,c])=>i,(i,c)=>{var n=b(()=>X(l(c),2));let t=()=>l(n)[0],s=()=>l(n)[1];var C=z(),j=m(C);{var I=a=>{g(a,{get label(){return t()},get value(){return e[t()]},set value(r){e[t()]=r}})},L=a=>{var r=lt(),v=h(r);{let U=b(()=>/^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e[t()])?"":"Must be a valid color in hex");g(v,{get label(){return t()},get validationError(){return l(U)},get value(){return e[t()]},set value(q){e[t()]=q}})}var N=d(v,2);_(r),S(()=>et(N,`background-color: ${e[t()]??""};`)),f(a,r)},M=a=>{{let r=b(()=>e[t()]&&!s().options.includes(e[t()])?"Must match one of the available options":"");g(a,{get label(){return t()},get validationError(){return l(r)},get options(){return s().options},get value(){return e[t()]},set value(v){e[t()]=v}})}},B=a=>{k(a,{get label(){return t()},get options(){return s().options},get value(){return e[t()]},set value(r){e[t()]=r}})},D=a=>{k(a,{get label(){return t()},onAddUnknown:r=>r,get value(){return e[t()]},set value(r){e[t()]=r}})},J=a=>{st(a,{get label(){return t()},prefix:"#",get possibleTags(){return o.data.allTags},get value(){return e[t()]},set value(r){e[t()]=r}})};Y(j,a=>{s().type==="string"?a(I):s().type==="color"?a(L,1):s().type==="selection"&&!s().multi?a(M,2):s().type==="selection"&&s().multi?a(B,3):s().type==="string-list"?a(D,4):s().type==="tag-list"&&a(J,5)})}f(i,C)}),_(p);var P=d(p,2);rt(P,{action:F,get disabled(){return l(u)},class:"absolute right-3 bottom-3 preset-filled-primary-50-950",children:(i,c)=>{var n=ot(),t=d(m(n),2),s=h(t,!0);_(t),S(()=>G(s,l(u)?"Saving...":"Save")),f(i,n)},$$slots:{default:!0}}),f(A,x)},$$slots:{default:!0}}),Q()}export{_t as component};
@@ -0,0 +1 @@
1
+ import{_ as m}from"../chunks/Dg3PYjM6.js";export{m as component};
@@ -1 +1 @@
1
- import{s as F,a as c,t as E,f as x,c as ye}from"../chunks/C-A59nkV.js";import{p as qe,f as K,c as l,d as N,g as e,s as n,r as i,t as oe,a as Je,n as Ce,j as O,u as k,h as ae,k as nt,o as ct,l as dt,$ as vt}from"../chunks/DPUojd5V.js";import{i as G}from"../chunks/BIHqivCG.js";import{e as be,r as Z,b as ke,h as ut}from"../chunks/CBMGMT01.js";import{C as ft}from"../chunks/TKefEoMN.js";import{A as R}from"../chunks/BmRN1zm0.js";import{C as Fe}from"../chunks/BFrNG_16.js";import{O as gt,i as ie,u as Ne}from"../chunks/DPqQ6q9T.js";import{S as mt,p as ht,D as _t}from"../chunks/C64_a0rj.js";import{i as we}from"../chunks/YzpLcnjN.js";import{g as Ye,a as pt}from"../chunks/D338WAuH.js";import{L as xt,T as He}from"../chunks/DGnDs2M4.js";function yt(_,a,P){const y=P.image_details.filter(b=>!_.has(b.id));return{...P,image_details:y.map(b=>({...b,matches:b.matches.filter(v=>v.gallery===a)})),original:{...P,image_details:y}}}function bt(_,a){return P=>yt(_,a,P)}function wt(_){return _.image_details.length>0}function kt(_){return _.image_details.flatMap(a=>a.matches).length>0}var Pt=x('<div class="mt-2 text-xs text-surface-800-200 italic">FYI: this image matches in other galleries</div>'),It=x("<!> <!>",1),St=x('<div class="my-2 flex items-stretch"><div class="flex flex-col items-stretch"><!> <div class="no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-surface-600-400 pl-2 text-xs text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div></div> <div class="mx-2 w-2 border border-l-0"></div> <div class="flex flex-col items-stretch justify-center"><div class=" text-center italic underline decoration-gray-400 decoration-1"> </div> <div class="no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-surface-600-400 pl-2 text-xs text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div> <div class="mb-2 no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-primary-600-400 pl-2 text-xs text-primary-900-100 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div> <div class="flex grow flex-col gap-y-2"><!> <!> <!> <!></div></div></div>'),At=x('<div class="relative my-2 flex w-full justify-center"><div class="absolute top-1/2 -z-10 w-full border-t border-surface-600-400"></div> <span class="float-start bg-surface-200-800 px-2">or</span></div> <!>',1),Mt=x('<div class="h-ful flex"><div class="flex items-center"><span style="writing-mode: tb-rl" class=" inline-block rotate-180 text-center underline"> </span></div> <div class="m-4 flex w-full items-center rounded-xl border p-4"><div class="flex flex-col items-start"><img class="max-h-64 max-w-64"/> <div class="no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-surface-600-400 pl-2 text-xs text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div></div> <div class="px-4"><i class="fa-solid fa-chevron-right text-2xl"></i></div> <div class="flex h-full grow flex-col items-center justify-center"><div class="text-xl underline">Matches</div> <div class="flex grow flex-col items-center justify-center"><!> <!> <!></div></div></div> <div class="flex items-stretch"><span style="writing-mode: tb-rl" class="inline-block px-8 text-center"><!></span></div></div>'),$t=x('<span class="ml-6"><!></span> <!>',1),jt=x('<div class="my-4 rounded-2xl border border-surface-600-400 bg-surface-200-800 p-3"><div class="border-l-2 border-l-surface-600-400 pl-2 text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div> <!></div>'),Et=x('<div class="h-screen"></div>'),Ot=x('<div class="mt-4 flex items-center gap-x-4"><!> <!> <!></div> <!> <!> <!>',1);function Rt(_,a){qe(a,!0);const P=(t,s=Ce,o=Ce)=>{const r=k(()=>s().image_details[o()]),$=k(()=>s().original.image_details[o()]);var u=Mt(),d=l(u),S=l(d),se=l(S);i(S),i(d);var le=n(d,2),ge=l(le),me=l(ge),Ie=n(me,2),Se=l(Ie),Qe=l(Se,!0);i(Se),i(Ie),i(ge);var Ae=n(ge,4),Me=n(l(Ae),2),$e=l(Me);{var Ve=f=>{var g=It(),W=K(g);{let j=k(()=>h(e(r).id,e(r).alt_text,s()));R(W,{setLoading:I,get disabled(){return e(v)},class:"p-4 px-4",get action(){return e(j)},children:(U,he)=>{O();var ue=E("No matches; add as new.");c(U,ue)},$$slots:{default:!0}})}var X=n(W,2);{var C=j=>{var U=Pt();c(j,U)};G(X,j=>{e($).matches.length!==0&&j(C)})}c(f,g)};G($e,f=>{e(r).matches.length===0&&f(Ve)})}var je=n($e,2);be(je,16,()=>e(r).matches,f=>f,(f,g,W,X)=>{const C=k(()=>ie(a.gallery)?a.gallery.pieces.find(m=>m.slug===g.piece):null);var j=St(),U=l(j),he=l(U);gt(he,{class:"max-h-64 max-w-64",get galleryPath(){return g}});var ue=n(he,2),Re=l(ue),tt=l(Re,!0);i(Re),i(ue),i(U);var Ge=n(U,4),_e=l(Ge),at=l(_e,!0);i(_e);var pe=n(_e,2),Te=l(pe),rt=l(Te,!0);i(Te),i(pe);var xe=n(pe,2),Be=l(xe),st=l(Be,!0);i(Be),i(xe);var Le=n(xe,2),Ue=l(Le);{let m=k(()=>q(g,w=>({...w,description:s().text})));R(Ue,{setLoading:I,get disabled(){return e(v)},get action(){return e(m)},children:(w,ee)=>{O();var te=E("Import Description from Post");c(w,te)},$$slots:{default:!0}})}var De=n(Ue,2);{let m=k(()=>q(g,w=>({...w,tags:[...new Set([...w.tags,...Y(s())])]})));R(De,{setLoading:I,get disabled(){return e(v)},get action(){return e(m)},children:(w,ee)=>{O();var te=E("Import Tags from Post");c(w,te)},$$slots:{default:!0}})}var ze=n(De,2);{var lt=m=>{{let w=k(()=>q(g,ee=>({...ee,alt:e(r).alt_text})));R(m,{setLoading:I,get disabled(){return e(v)},get action(){return e(w)},children:(ee,te)=>{O();var ot=E("Import Alt Text from Image");c(ee,ot)},$$slots:{default:!0}})}};G(ze,m=>{e(r).alt_text&&m(lt)})}var it=n(ze,2);{let m=k(()=>M(g,e(r).id));R(it,{setLoading:I,get disabled(){return e(v)},class:"border-red-500 text-red-800",get action(){return e(m)},children:(w,ee)=>{O();var te=E("Overwrite Image");c(w,te)},$$slots:{default:!0}})}i(Le),i(Ge),i(j),oe(m=>{F(tt,e(C)?.alt||"(no alt text)"),F(at,e(C)?.name??g.piece),F(rt,e(C)?.description||"(no description)"),F(st,m)},[()=>e(C)?.tags.map(m=>`#${m}`).join(", ")||"(no tags)"]),c(f,j)});var We=n(je,2);{var Xe=f=>{var g=At(),W=n(K(g),2);{let X=k(()=>h(e(r).id,e(r).alt_text,s()));R(W,{setLoading:I,get disabled(){return e(v)},get action(){return e(X)},children:(C,j)=>{O();var U=E("Add as New");c(C,U)},$$slots:{default:!0}})}c(f,g)};G(We,f=>{e(r).matches.length!==0&&f(Xe)})}i(Me),i(Ae),i(le);var Ee=n(le,2),Oe=l(Ee),et=l(Oe);{let f=k(()=>ne(e(r).id));R(et,{class:"h-full",get action(){return e(f)},children:(g,W)=>{O();var X=E("Hide");c(g,X)},$$slots:{default:!0}})}i(Oe),i(Ee),i(u),oe(f=>{F(se,`Image ${o()+1}`),ke(me,"src",f),ke(me,"alt",e(r).alt_text),F(Qe,e(r).alt_text)},[()=>Z("/api/bluesky/image/[hash]",{hash:e(r).id})]),c(t,u)};let y=ae(!0),b=ae(!1),v=ae(!1),H=ae(4);const Q=k(()=>a.ss[a.galleryPath]??new Set),p=Ye(),T=pt();function D(){N(H,e(H)+2)}const A=k(()=>{const t=a.posts.map(bt(e(Q),a.galleryPath)).filter(wt);return e(y)?t:t.filter(s=>{let o=s;return e(b)||(o=s.original),!kt(o)})});function I(t){N(v,t,!0)}async function B(t){N(v,!0);try{await ht(a.galleryPath,t,!1),p.epoch+=1,T.reset(),await we()}finally{N(v,!1)}}function q(t,s){return async()=>{if(!ie(a.gallery))return;const o={pieces:a.gallery.pieces.map(r=>r.slug===t.piece?s(r):r)};await B(o)}}function M(t,s){return async()=>{if(!ie(a.gallery))return;const r=await(await fetch(Z("/api/bluesky/image/[hash]",{hash:s}))).blob(),$=await Ne(t,r,s),u={pieces:a.gallery.pieces.map(d=>d.slug===t.piece?{...d,image:$.filename}:d)};await B(u)}}async function J(t,s,o){const $=await(await fetch(Z("/api/bluesky/image/[hash]",{hash:t}))).blob(),u=await Ne({gallery:a.galleryPath,piece:t},$,t);return{alt:s,name:o.text.split(" ").slice(0,5).join(" "),characters:Y(o).filter(d=>/^oc:/.test(d)).map(d=>d.replace(/^oc:/,"")),tags:Y(o).filter(d=>!/^oc:/.test(d)),date:_t.fromISO(o.date).toJSDate(),image:u.filename,slug:t,id:t,alts:void 0,artist:a.config?.defaultArtist??void 0,description:o.text,position:void 0,video:void 0}}function h(t,s,o){return async()=>{if(!ie(a.gallery))return;const r={pieces:[...a.gallery.pieces,await J(t,s,o)]};await B(r)}}function ne(t){return async()=>{try{await fetch(Z("/api/bluesky/mark/[...gallerypath]/[hash]",{gallerypath:a.galleryPath,hash:t}),{method:"PUT"})}finally{await we()}}}function Y(t){const s=[],o=/#([A-Za-z0-9_:-]+)/gim;let r=null;do r=o.exec(t.text),r?.[1]&&s.push(r[1]);while(r);return console.log(s),s}var L=Ot(),V=K(L),ce=l(V);Fe(ce,{label:"Show Matched",get checked(){return e(y)},set checked(t){N(y,t,!0)}});var de=n(ce,2);{var fe=t=>{var s=$t(),o=K(s),r=l(o);Fe(r,{label:"Include Matched Elsewhere",get checked(){return e(b)},set checked(u){N(b,u,!0)}}),i(o);var $=n(o,2);R($,{setLoading:I,get disabled(){return e(v)},action:async()=>{if(!ie(a.gallery))return;const u=await Promise.all(e(A).flatMap(S=>S.image_details.map(async se=>await J(se.id,se.alt_text,S)))),d={pieces:[...a.gallery.pieces,...u]};await B(d)},children:(u,d)=>{O();var S=E("Add All");c(u,S)},$$slots:{default:!0}}),c(t,s)};G(de,t=>{e(y)||t(fe)})}var z=n(de,2);{var re=t=>{R(t,{action:async()=>{await fetch(Z("/api/bluesky/mark/[...gallerypath]",{gallerypath:a.galleryPath}),{method:"DELETE"}),await we()},children:(s,o)=>{O();var r=E("Re-show hidden posts");c(s,r)},$$slots:{default:!0}})};G(z,t=>{e(Q).size>0&&t(re)})}i(V);var ve=n(V,2);be(ve,17,()=>e(A).slice(0,e(H)),t=>t.uri,(t,s)=>{var o=jt(),r=l(o),$=l(r),u=l($,!0);i($),i(r);var d=n(r,2);be(d,18,()=>e(s).image_details,S=>S,(S,se,le)=>{P(S,()=>e(s),()=>e(le))}),i(o),oe(()=>F(u,e(s).text)),c(t,o)});var Pe=n(ve,2);mt(Pe,{tickMs:150,onObservable:D});var Ze=n(Pe,2);{var Ke=t=>{var s=Et();c(t,s)};G(Ze,t=>{e(H)<e(A).length&&t(Ke)})}c(_,L),Je()}const Gt=_=>{var a=Tt(),P=l(a);ft(P,{color:"#04F"}),i(a),c(_,a)};var Tt=x('<div class="fixed top-0 left-0 z-40 flex w-screen items-center justify-center bg-[#0005]" style="height: calc(100vh - 1.25rem)"><!></div>'),Bt=x('<div class="flex flex-col items-center gap-y-3"><div>Bluesky Login Required</div> <!> <!> <div>(If you use 2FA, this needs to be an app password. Password will be saved in your browser.)</div> <!></div>'),Lt=x('<a class="mr-4 btn preset-tonal">back</a>'),Ut=x("<div> </div>");function Vt(_,a){qe(a,!0);const P=p=>{var T=Bt(),D=n(l(T),2),A=()=>typeof localStorage>"u"?"":localStorage.getItem("bskyUsername")??"",I=h=>{typeof localStorage<"u"&&localStorage.setItem("bskyUsername",h)};He(D,{label:"Bluesky Username",get value(){return A()},set value(h){I(h)}});var B=n(D,2),q=()=>typeof localStorage>"u"?"":localStorage.getItem("bskyPassword")??"",M=h=>{typeof localStorage<"u"&&localStorage.setItem("bskyPassword",h)};He(B,{label:"Password",password:!0,get value(){return q()},set value(h){M(h)}});var J=n(B,4);R(J,{action:Q,children:(h,ne)=>{O();var Y=E("Login");c(h,Y)},$$slots:{default:!0}}),i(T),c(p,T)};let y=ae(null),b=ae(null);const v=Ye();let H=v.epoch;async function Q(){try{N(y,await fetch(Z("/api/bluesky/sync"),{method:"POST",body:JSON.stringify({bskyUsername:localStorage.getItem("bskyUsername"),bskyPassword:localStorage.getItem("bskyPassword")})}).then(p=>p.json()).then(p=>{if(p.message)throw new Error(p.message);return p}),!0)}catch(p){N(b,p,!0)}}nt(()=>{e(y)&&v.epoch&&H!==v.epoch&&(H=v.epoch,Q())}),ct(()=>{Q()}),ut("htvqz1",p=>{dt(()=>{vt.title=`Bluesky Import | ${a.data.galleryPath??""} | Art Site Editor`})}),xt(_,{title:"Bluesky Import",navRight:T=>{var D=Lt();oe(A=>ke(D,"href",A),[()=>Z("/gallery/[...gallerypath]",{gallerypath:a.data.galleryPath})]),c(T,D)},children:(T,D)=>{var A=ye(),I=K(A);{var B=M=>{var J=ye(),h=K(J);{var ne=L=>{var V=ye(),ce=K(V);{var de=z=>{P(z)},fe=z=>{var re=Ut(),ve=l(re);i(re),oe(()=>F(ve,`Unknown error occurred: ${e(b)??""}`)),c(z,re)};G(ce,z=>{a.data.bskyAvailable?z(fe,-1):z(de)})}c(L,V)},Y=L=>{Gt(L)};G(h,L=>{e(b)?L(ne):L(Y,-1)})}c(M,J)},q=M=>{Rt(M,{get config(){return a.data.config},get gallery(){return a.data.gallery},get galleryPath(){return a.data.galleryPath},get posts(){return e(y)},get ss(){return a.data.ss}})};G(I,M=>{e(y)?M(q,-1):M(B)})}c(T,A)},$$slots:{navRight:!0,default:!0}}),Je()}export{Vt as component};
1
+ import{s as F,a as c,t as E,f as x,c as ye}from"../chunks/C-A59nkV.js";import{p as qe,f as K,c as l,d as N,g as e,s as n,r as i,t as oe,a as Je,n as Ce,j as O,u as k,h as ae,k as nt,o as ct,l as dt,$ as vt}from"../chunks/DPUojd5V.js";import{i as G}from"../chunks/BIHqivCG.js";import{e as be,r as Z,b as ke,h as ut}from"../chunks/36fRYPqv.js";import{C as ft}from"../chunks/BiZuc77T.js";import{A as R}from"../chunks/DaWb7mMs.js";import{C as Fe}from"../chunks/C9apqzJz.js";import{O as gt,i as ie,u as Ne}from"../chunks/_QiFnDly.js";import{S as mt,p as ht,D as _t}from"../chunks/Dg3PYjM6.js";import{i as we}from"../chunks/CGRPYk0Z.js";import{g as Ye,a as pt}from"../chunks/CWeHQSrA.js";import{L as xt,T as He}from"../chunks/DAsycyym.js";function yt(_,a,P){const y=P.image_details.filter(b=>!_.has(b.id));return{...P,image_details:y.map(b=>({...b,matches:b.matches.filter(v=>v.gallery===a)})),original:{...P,image_details:y}}}function bt(_,a){return P=>yt(_,a,P)}function wt(_){return _.image_details.length>0}function kt(_){return _.image_details.flatMap(a=>a.matches).length>0}var Pt=x('<div class="mt-2 text-xs text-surface-800-200 italic">FYI: this image matches in other galleries</div>'),It=x("<!> <!>",1),St=x('<div class="my-2 flex items-stretch"><div class="flex flex-col items-stretch"><!> <div class="no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-surface-600-400 pl-2 text-xs text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div></div> <div class="mx-2 w-2 border border-l-0"></div> <div class="flex flex-col items-stretch justify-center"><div class=" text-center italic underline decoration-gray-400 decoration-1"> </div> <div class="no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-surface-600-400 pl-2 text-xs text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div> <div class="mb-2 no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-primary-600-400 pl-2 text-xs text-primary-900-100 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div> <div class="flex grow flex-col gap-y-2"><!> <!> <!> <!></div></div></div>'),At=x('<div class="relative my-2 flex w-full justify-center"><div class="absolute top-1/2 -z-10 w-full border-t border-surface-600-400"></div> <span class="float-start bg-surface-200-800 px-2">or</span></div> <!>',1),Mt=x('<div class="h-ful flex"><div class="flex items-center"><span style="writing-mode: tb-rl" class=" inline-block rotate-180 text-center underline"> </span></div> <div class="m-4 flex w-full items-center rounded-xl border p-4"><div class="flex flex-col items-start"><img class="max-h-64 max-w-64"/> <div class="no-scrollbar max-h-16 max-w-64 overflow-scroll border-l-2 border-surface-600-400 pl-2 text-xs text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div></div> <div class="px-4"><i class="fa-solid fa-chevron-right text-2xl"></i></div> <div class="flex h-full grow flex-col items-center justify-center"><div class="text-xl underline">Matches</div> <div class="flex grow flex-col items-center justify-center"><!> <!> <!></div></div></div> <div class="flex items-stretch"><span style="writing-mode: tb-rl" class="inline-block px-8 text-center"><!></span></div></div>'),$t=x('<span class="ml-6"><!></span> <!>',1),jt=x('<div class="my-4 rounded-2xl border border-surface-600-400 bg-surface-200-800 p-3"><div class="border-l-2 border-l-surface-600-400 pl-2 text-surface-contrast-200-800 italic"><pre class="font-serif whitespace-pre-wrap"> </pre></div> <!></div>'),Et=x('<div class="h-screen"></div>'),Ot=x('<div class="mt-4 flex items-center gap-x-4"><!> <!> <!></div> <!> <!> <!>',1);function Rt(_,a){qe(a,!0);const P=(t,s=Ce,o=Ce)=>{const r=k(()=>s().image_details[o()]),$=k(()=>s().original.image_details[o()]);var u=Mt(),d=l(u),S=l(d),se=l(S);i(S),i(d);var le=n(d,2),ge=l(le),me=l(ge),Ie=n(me,2),Se=l(Ie),Qe=l(Se,!0);i(Se),i(Ie),i(ge);var Ae=n(ge,4),Me=n(l(Ae),2),$e=l(Me);{var Ve=f=>{var g=It(),W=K(g);{let j=k(()=>h(e(r).id,e(r).alt_text,s()));R(W,{setLoading:I,get disabled(){return e(v)},class:"p-4 px-4",get action(){return e(j)},children:(U,he)=>{O();var ue=E("No matches; add as new.");c(U,ue)},$$slots:{default:!0}})}var X=n(W,2);{var C=j=>{var U=Pt();c(j,U)};G(X,j=>{e($).matches.length!==0&&j(C)})}c(f,g)};G($e,f=>{e(r).matches.length===0&&f(Ve)})}var je=n($e,2);be(je,16,()=>e(r).matches,f=>f,(f,g,W,X)=>{const C=k(()=>ie(a.gallery)?a.gallery.pieces.find(m=>m.slug===g.piece):null);var j=St(),U=l(j),he=l(U);gt(he,{class:"max-h-64 max-w-64",get galleryPath(){return g}});var ue=n(he,2),Re=l(ue),tt=l(Re,!0);i(Re),i(ue),i(U);var Ge=n(U,4),_e=l(Ge),at=l(_e,!0);i(_e);var pe=n(_e,2),Te=l(pe),rt=l(Te,!0);i(Te),i(pe);var xe=n(pe,2),Be=l(xe),st=l(Be,!0);i(Be),i(xe);var Le=n(xe,2),Ue=l(Le);{let m=k(()=>q(g,w=>({...w,description:s().text})));R(Ue,{setLoading:I,get disabled(){return e(v)},get action(){return e(m)},children:(w,ee)=>{O();var te=E("Import Description from Post");c(w,te)},$$slots:{default:!0}})}var De=n(Ue,2);{let m=k(()=>q(g,w=>({...w,tags:[...new Set([...w.tags,...Y(s())])]})));R(De,{setLoading:I,get disabled(){return e(v)},get action(){return e(m)},children:(w,ee)=>{O();var te=E("Import Tags from Post");c(w,te)},$$slots:{default:!0}})}var ze=n(De,2);{var lt=m=>{{let w=k(()=>q(g,ee=>({...ee,alt:e(r).alt_text})));R(m,{setLoading:I,get disabled(){return e(v)},get action(){return e(w)},children:(ee,te)=>{O();var ot=E("Import Alt Text from Image");c(ee,ot)},$$slots:{default:!0}})}};G(ze,m=>{e(r).alt_text&&m(lt)})}var it=n(ze,2);{let m=k(()=>M(g,e(r).id));R(it,{setLoading:I,get disabled(){return e(v)},class:"border-red-500 text-red-800",get action(){return e(m)},children:(w,ee)=>{O();var te=E("Overwrite Image");c(w,te)},$$slots:{default:!0}})}i(Le),i(Ge),i(j),oe(m=>{F(tt,e(C)?.alt||"(no alt text)"),F(at,e(C)?.name??g.piece),F(rt,e(C)?.description||"(no description)"),F(st,m)},[()=>e(C)?.tags.map(m=>`#${m}`).join(", ")||"(no tags)"]),c(f,j)});var We=n(je,2);{var Xe=f=>{var g=At(),W=n(K(g),2);{let X=k(()=>h(e(r).id,e(r).alt_text,s()));R(W,{setLoading:I,get disabled(){return e(v)},get action(){return e(X)},children:(C,j)=>{O();var U=E("Add as New");c(C,U)},$$slots:{default:!0}})}c(f,g)};G(We,f=>{e(r).matches.length!==0&&f(Xe)})}i(Me),i(Ae),i(le);var Ee=n(le,2),Oe=l(Ee),et=l(Oe);{let f=k(()=>ne(e(r).id));R(et,{class:"h-full",get action(){return e(f)},children:(g,W)=>{O();var X=E("Hide");c(g,X)},$$slots:{default:!0}})}i(Oe),i(Ee),i(u),oe(f=>{F(se,`Image ${o()+1}`),ke(me,"src",f),ke(me,"alt",e(r).alt_text),F(Qe,e(r).alt_text)},[()=>Z("/api/bluesky/image/[hash]",{hash:e(r).id})]),c(t,u)};let y=ae(!0),b=ae(!1),v=ae(!1),H=ae(4);const Q=k(()=>a.ss[a.galleryPath]??new Set),p=Ye(),T=pt();function D(){N(H,e(H)+2)}const A=k(()=>{const t=a.posts.map(bt(e(Q),a.galleryPath)).filter(wt);return e(y)?t:t.filter(s=>{let o=s;return e(b)||(o=s.original),!kt(o)})});function I(t){N(v,t,!0)}async function B(t){N(v,!0);try{await ht(a.galleryPath,t,!1),p.epoch+=1,T.reset(),await we()}finally{N(v,!1)}}function q(t,s){return async()=>{if(!ie(a.gallery))return;const o={pieces:a.gallery.pieces.map(r=>r.slug===t.piece?s(r):r)};await B(o)}}function M(t,s){return async()=>{if(!ie(a.gallery))return;const r=await(await fetch(Z("/api/bluesky/image/[hash]",{hash:s}))).blob(),$=await Ne(t,r,s),u={pieces:a.gallery.pieces.map(d=>d.slug===t.piece?{...d,image:$.filename}:d)};await B(u)}}async function J(t,s,o){const $=await(await fetch(Z("/api/bluesky/image/[hash]",{hash:t}))).blob(),u=await Ne({gallery:a.galleryPath,piece:t},$,t);return{alt:s,name:o.text.split(" ").slice(0,5).join(" "),characters:Y(o).filter(d=>/^oc:/.test(d)).map(d=>d.replace(/^oc:/,"")),tags:Y(o).filter(d=>!/^oc:/.test(d)),date:_t.fromISO(o.date).toJSDate(),image:u.filename,slug:t,id:t,alts:void 0,artist:a.config?.defaultArtist??void 0,description:o.text,position:void 0,video:void 0}}function h(t,s,o){return async()=>{if(!ie(a.gallery))return;const r={pieces:[...a.gallery.pieces,await J(t,s,o)]};await B(r)}}function ne(t){return async()=>{try{await fetch(Z("/api/bluesky/mark/[...gallerypath]/[hash]",{gallerypath:a.galleryPath,hash:t}),{method:"PUT"})}finally{await we()}}}function Y(t){const s=[],o=/#([A-Za-z0-9_:-]+)/gim;let r=null;do r=o.exec(t.text),r?.[1]&&s.push(r[1]);while(r);return console.log(s),s}var L=Ot(),V=K(L),ce=l(V);Fe(ce,{label:"Show Matched",get checked(){return e(y)},set checked(t){N(y,t,!0)}});var de=n(ce,2);{var fe=t=>{var s=$t(),o=K(s),r=l(o);Fe(r,{label:"Include Matched Elsewhere",get checked(){return e(b)},set checked(u){N(b,u,!0)}}),i(o);var $=n(o,2);R($,{setLoading:I,get disabled(){return e(v)},action:async()=>{if(!ie(a.gallery))return;const u=await Promise.all(e(A).flatMap(S=>S.image_details.map(async se=>await J(se.id,se.alt_text,S)))),d={pieces:[...a.gallery.pieces,...u]};await B(d)},children:(u,d)=>{O();var S=E("Add All");c(u,S)},$$slots:{default:!0}}),c(t,s)};G(de,t=>{e(y)||t(fe)})}var z=n(de,2);{var re=t=>{R(t,{action:async()=>{await fetch(Z("/api/bluesky/mark/[...gallerypath]",{gallerypath:a.galleryPath}),{method:"DELETE"}),await we()},children:(s,o)=>{O();var r=E("Re-show hidden posts");c(s,r)},$$slots:{default:!0}})};G(z,t=>{e(Q).size>0&&t(re)})}i(V);var ve=n(V,2);be(ve,17,()=>e(A).slice(0,e(H)),t=>t.uri,(t,s)=>{var o=jt(),r=l(o),$=l(r),u=l($,!0);i($),i(r);var d=n(r,2);be(d,18,()=>e(s).image_details,S=>S,(S,se,le)=>{P(S,()=>e(s),()=>e(le))}),i(o),oe(()=>F(u,e(s).text)),c(t,o)});var Pe=n(ve,2);mt(Pe,{tickMs:150,onObservable:D});var Ze=n(Pe,2);{var Ke=t=>{var s=Et();c(t,s)};G(Ze,t=>{e(H)<e(A).length&&t(Ke)})}c(_,L),Je()}const Gt=_=>{var a=Tt(),P=l(a);ft(P,{color:"#04F"}),i(a),c(_,a)};var Tt=x('<div class="fixed top-0 left-0 z-40 flex w-screen items-center justify-center bg-[#0005]" style="height: calc(100vh - 1.25rem)"><!></div>'),Bt=x('<div class="flex flex-col items-center gap-y-3"><div>Bluesky Login Required</div> <!> <!> <div>(If you use 2FA, this needs to be an app password. Password will be saved in your browser.)</div> <!></div>'),Lt=x('<a class="mr-4 btn preset-tonal">back</a>'),Ut=x("<div> </div>");function Vt(_,a){qe(a,!0);const P=p=>{var T=Bt(),D=n(l(T),2),A=()=>typeof localStorage>"u"?"":localStorage.getItem("bskyUsername")??"",I=h=>{typeof localStorage<"u"&&localStorage.setItem("bskyUsername",h)};He(D,{label:"Bluesky Username",get value(){return A()},set value(h){I(h)}});var B=n(D,2),q=()=>typeof localStorage>"u"?"":localStorage.getItem("bskyPassword")??"",M=h=>{typeof localStorage<"u"&&localStorage.setItem("bskyPassword",h)};He(B,{label:"Password",password:!0,get value(){return q()},set value(h){M(h)}});var J=n(B,4);R(J,{action:Q,children:(h,ne)=>{O();var Y=E("Login");c(h,Y)},$$slots:{default:!0}}),i(T),c(p,T)};let y=ae(null),b=ae(null);const v=Ye();let H=v.epoch;async function Q(){try{N(y,await fetch(Z("/api/bluesky/sync"),{method:"POST",body:JSON.stringify({bskyUsername:localStorage.getItem("bskyUsername"),bskyPassword:localStorage.getItem("bskyPassword")})}).then(p=>p.json()).then(p=>{if(p.message)throw new Error(p.message);return p}),!0)}catch(p){N(b,p,!0)}}nt(()=>{e(y)&&v.epoch&&H!==v.epoch&&(H=v.epoch,Q())}),ct(()=>{Q()}),ut("htvqz1",p=>{dt(()=>{vt.title=`Bluesky Import | ${a.data.galleryPath??""} | Art Site Editor`})}),xt(_,{title:"Bluesky Import",navRight:T=>{var D=Lt();oe(A=>ke(D,"href",A),[()=>Z("/gallery/[...gallerypath]",{gallerypath:a.data.galleryPath})]),c(T,D)},children:(T,D)=>{var A=ye(),I=K(A);{var B=M=>{var J=ye(),h=K(J);{var ne=L=>{var V=ye(),ce=K(V);{var de=z=>{P(z)},fe=z=>{var re=Ut(),ve=l(re);i(re),oe(()=>F(ve,`Unknown error occurred: ${e(b)??""}`)),c(z,re)};G(ce,z=>{a.data.bskyAvailable?z(fe,-1):z(de)})}c(L,V)},Y=L=>{Gt(L)};G(h,L=>{e(b)?L(ne):L(Y,-1)})}c(M,J)},q=M=>{Rt(M,{get config(){return a.data.config},get gallery(){return a.data.gallery},get galleryPath(){return a.data.galleryPath},get posts(){return e(y)},get ss(){return a.data.ss}})};G(I,M=>{e(y)?M(q,-1):M(B)})}c(T,A)},$$slots:{navRight:!0,default:!0}}),Je()}export{Vt as component};