isorite 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/main.js +1541 -59
  2. package/package.json +4 -1
  3. package/web/_app/immutable/assets/{0.DVQOzs4l.css → 0.BGpjfMlq.css} +1 -1
  4. package/web/_app/immutable/chunks/{2BcU70Iq.js → -_CDfwKC.js} +1 -1
  5. package/web/_app/immutable/chunks/{DrPF-vh8.js → -oRvYXNk.js} +1 -1
  6. package/web/_app/immutable/chunks/0qd6IUbO.js +1 -0
  7. package/web/_app/immutable/chunks/{yy6sD_us.js → 7faei0hL.js} +1 -1
  8. package/web/_app/immutable/chunks/{BNlziJ_1.js → BArcFmbE.js} +3 -3
  9. package/web/_app/immutable/chunks/{NgkOM4d0.js → BF1TezEe.js} +1 -1
  10. package/web/_app/immutable/chunks/{DK9wjWIk.js → BF3mdiSX.js} +1 -1
  11. package/web/_app/immutable/chunks/BFOLKM4z.js +1 -0
  12. package/web/_app/immutable/chunks/{BbvUCVY_.js → BezGs1Zj.js} +1 -1
  13. package/web/_app/immutable/chunks/Bg-39frG.js +1 -0
  14. package/web/_app/immutable/chunks/{CM4EA3Wo.js → BleKqNM1.js} +1 -1
  15. package/web/_app/immutable/chunks/{BjLgp18-.js → BpHE30PI.js} +1 -1
  16. package/web/_app/immutable/chunks/{Ds9L6FPB.js → BtF1frCE.js} +1 -1
  17. package/web/_app/immutable/chunks/{D_xpsaTJ.js → BuNfZSU6.js} +1 -1
  18. package/web/_app/immutable/chunks/{0KrpTYPM.js → BubCsN15.js} +1 -1
  19. package/web/_app/immutable/chunks/{_zY4mrA0.js → BvhVny3O.js} +1 -1
  20. package/web/_app/immutable/chunks/{CcRcjPTM.js → Bvs-JCN-.js} +1 -1
  21. package/web/_app/immutable/chunks/{1W6iRjg5.js → C-F98t31.js} +1 -1
  22. package/web/_app/immutable/chunks/{rv_cF9pp.js → C1OaBy7n.js} +1 -1
  23. package/web/_app/immutable/chunks/{CMN7rSZK.js → C4SqDe8e.js} +1 -1
  24. package/web/_app/immutable/chunks/{BBU5FdEo.js → C74H8jNb.js} +1 -1
  25. package/web/_app/immutable/chunks/{Cn7j5NKi.js → C7bouMY8.js} +1 -1
  26. package/web/_app/immutable/chunks/{vGOSIW7X.js → C8IrXs1w.js} +1 -1
  27. package/web/_app/immutable/chunks/{CwcA6hab.js → CGGjDDVZ.js} +1 -1
  28. package/web/_app/immutable/chunks/{CccIbhmH.js → CL9QeiGC.js} +2 -2
  29. package/web/_app/immutable/chunks/{CabmfniL.js → CMAnq3x6.js} +1 -1
  30. package/web/_app/immutable/chunks/{Bx_Vz2qr.js → CMe14KUo.js} +1 -1
  31. package/web/_app/immutable/chunks/{DQJRaTNz.js → CXc9Iibq.js} +1 -1
  32. package/web/_app/immutable/chunks/Cb-KPahQ.js +1 -0
  33. package/web/_app/immutable/chunks/{CpJ4vfn-.js → Cf13Ew0A.js} +1 -1
  34. package/web/_app/immutable/chunks/{CQhfj5-f.js → CkSjC-iE.js} +3 -3
  35. package/web/_app/immutable/chunks/{sBy91tGs.js → Cn8Mg7_E.js} +1 -1
  36. package/web/_app/immutable/chunks/{1MewxdCy.js → CoeYsgbS.js} +1 -1
  37. package/web/_app/immutable/chunks/{DJHLXLij.js → CrqOdm1D.js} +1 -1
  38. package/web/_app/immutable/chunks/{B-04K_Pl.js → CyJXJYoE.js} +1 -1
  39. package/web/_app/immutable/chunks/{CxEu-Di8.js → Cz6kYWmu.js} +1 -1
  40. package/web/_app/immutable/chunks/{ZDjPMhAb.js → CzbFy3_5.js} +1 -1
  41. package/web/_app/immutable/chunks/{yYKJ4mbq.js → D-9suc4b.js} +1 -1
  42. package/web/_app/immutable/chunks/{qfBACIi9.js → D37hxBaz.js} +1 -1
  43. package/web/_app/immutable/chunks/D7yT4F_8.js +517 -0
  44. package/web/_app/immutable/chunks/{CmFzeyfe.js → DNs5kWvM.js} +1 -1
  45. package/web/_app/immutable/chunks/DQp-M3XN.js +1 -0
  46. package/web/_app/immutable/chunks/{C2EzU0qX.js → DR5d84Z7.js} +1 -1
  47. package/web/_app/immutable/chunks/{C2QvvHIN.js → DaEL1AOW.js} +1 -1
  48. package/web/_app/immutable/chunks/{BCsFs14H.js → Dazeexma.js} +1 -1
  49. package/web/_app/immutable/chunks/{DqZ4UzUH.js → Dc2_04md.js} +1 -1
  50. package/web/_app/immutable/chunks/{DfLI-CvW.js → Dcjgv4h2.js} +1 -1
  51. package/web/_app/immutable/chunks/{CRbUrapz.js → DgI3Vj5v.js} +1 -1
  52. package/web/_app/immutable/chunks/{fpNFwizw.js → Dgko1xMH.js} +1 -1
  53. package/web/_app/immutable/chunks/{DS7XcdHs.js → DlgOmQ_G.js} +1 -1
  54. package/web/_app/immutable/chunks/{DMTkA0aK.js → DmS5Qyvl.js} +1 -1
  55. package/web/_app/immutable/chunks/{DeazQJkV.js → DqnDX3G8.js} +1 -1
  56. package/web/_app/immutable/chunks/{DMpFmiFg.js → DyZdoKBK.js} +1 -1
  57. package/web/_app/immutable/chunks/{DEwfz-Il.js → DzAOHjhV.js} +1 -1
  58. package/web/_app/immutable/chunks/{DRKiKCov.js → Iqegk1SI.js} +1 -1
  59. package/web/_app/immutable/chunks/{Cl-Xmm9N.js → ONqdwA3r.js} +1 -1
  60. package/web/_app/immutable/chunks/{Dns-yz2Q.js → Oikibjm2.js} +1 -1
  61. package/web/_app/immutable/chunks/{CdD6waB-.js → T3u7Skc8.js} +1 -1
  62. package/web/_app/immutable/chunks/{Df3spPXn.js → cWWhqL1F.js} +1 -1
  63. package/web/_app/immutable/chunks/{CfTuc06U.js → fRXyV4Ec.js} +1 -1
  64. package/web/_app/immutable/chunks/{Dzu8v7nB.js → jAC4YCqW.js} +1 -1
  65. package/web/_app/immutable/chunks/{CB6ztdCQ.js → kFEqmLql.js} +1 -1
  66. package/web/_app/immutable/chunks/{BBhr3bLI.js → y0C1JQ1v.js} +1 -1
  67. package/web/_app/immutable/chunks/{CAuYgj5q.js → yvD4_bP8.js} +1 -1
  68. package/web/_app/immutable/entry/app.CyEmP0i2.js +2 -0
  69. package/web/_app/immutable/entry/start.BxCHvKWL.js +1 -0
  70. package/web/_app/immutable/nodes/0.Bkbiw_sA.js +11 -0
  71. package/web/_app/immutable/nodes/1.kdx6h8ts.js +1 -0
  72. package/web/_app/immutable/nodes/2.CtK7BGB8.js +1 -0
  73. package/web/_app/immutable/nodes/3.D5PZa2kH.js +1 -0
  74. package/web/_app/immutable/nodes/4.DzS8oPUH.js +3 -0
  75. package/web/_app/immutable/nodes/5.B-1BDKsL.js +19 -0
  76. package/web/_app/immutable/nodes/6.DDT1DtCg.js +1 -0
  77. package/web/_app/immutable/nodes/7.CCNCaItj.js +1 -0
  78. package/web/_app/version.json +1 -1
  79. package/web/index.html +17 -17
  80. package/web/_app/immutable/chunks/BJOSVfg-.js +0 -1
  81. package/web/_app/immutable/chunks/CHjmZsHD.js +0 -1
  82. package/web/_app/immutable/chunks/DH2bqH7t.js +0 -517
  83. package/web/_app/immutable/chunks/Ddw9FbDu.js +0 -1
  84. package/web/_app/immutable/chunks/IECP4ppk.js +0 -1
  85. package/web/_app/immutable/chunks/ZDkogIhD.js +0 -1
  86. package/web/_app/immutable/entry/app.CX19wIuG.js +0 -2
  87. package/web/_app/immutable/entry/start.DaiosA4i.js +0 -1
  88. package/web/_app/immutable/nodes/0.B6_Ycc14.js +0 -3
  89. package/web/_app/immutable/nodes/1.JA1sPybf.js +0 -1
  90. package/web/_app/immutable/nodes/2.DN2phYmE.js +0 -1
  91. package/web/_app/immutable/nodes/3.CbnLNp2F.js +0 -1
  92. package/web/_app/immutable/nodes/4.CIsG7Kdu.js +0 -3
  93. package/web/_app/immutable/nodes/5.D__u9ji8.js +0 -19
  94. package/web/_app/immutable/nodes/6.DBP0fpLt.js +0 -1
  95. package/web/_app/immutable/nodes/7.DuaH9aUr.js +0 -1
@@ -1 +1 @@
1
- import{c as e,f as t,n,o as r,r as i,t as a}from"./DK9wjWIk.js";function o(e){return e===`BT`||e===`LR`||e===`RL`?e:`TB`}var s=4e4,c=400,l=500,u=1.5,d=4;function f(e,t,n,r){let i=[];for(let t of e)i.push(t.x,t.y,t.w,t.h);let a=[];for(let e of t)a.push(e.labelX,e.labelY);let o=[];for(let e of n){o.push(e.x,e.y);for(let t of e.ports)o.push(t.px,t.py)}return{nodes:i,routes:t.map(e=>e.route),labels:a,levels:o,total:r}}function p(e,t,n,r){t.forEach((t,n)=>{t.x=e.nodes[4*n],t.y=e.nodes[4*n+1],t.w=e.nodes[4*n+2],t.h=e.nodes[4*n+3]}),n.forEach((t,n)=>{t.route=e.routes[n],t.labelX=e.labels[2*n],t.labelY=e.labels[2*n+1]});let i=0;for(let t of r){t.x=e.levels[i++],t.y=e.levels[i++];for(let n of t.ports)n.px=e.levels[i++],n.py=e.levels[i++]}return e.total}var m=24,h=.5,g=3,_=2,v=Math.max(3,g,_+1),y=.62,b=128;function x(e){return e.tracks?1:e.straight?2:0}function S(e,t,n=0){let r=0;for(let e of t)e.src!==e.dst&&e.route.length>3&&(r+=(e.route.length/3-1)*v);let a=new Float64Array(r),o=new Float64Array(r),s=new Float64Array(r),c=new Float64Array(r),l=new Float64Array(r),u=new Float64Array(r),d=new Int32Array(r),f=new Uint8Array(r),p=0,x=1/0,S=-1/0,C=NaN,w=NaN,T=NaN,E=NaN,D=(e,t,n,r,i,m)=>{let h=p-1;n===T&&r===E&&(m===r&&w===r||i===n&&C===n)&&d[h]===e&&f[h]===t&&(n-C)*(i-n)+(r-w)*(m-r)>0&&(p--,n=C,r=w),C=n,w=r,T=i,E=m,f[p]=t,a[p]=Math.min(n,i),s[p]=Math.max(n,i),o[p]=n<=i?r:m,c[p]=n<=i?m:r,l[p]=Math.min(r,m),u[p]=Math.max(r,m),l[p]<x&&(x=l[p]),u[p]>S&&(S=u[p]),d[p++]=e};for(let e=0;e<t.length;e++){let r=t[e];if(r.src===r.dst)continue;let a=r.route,o=e=>Math.abs(a[e]-a[e-3])<.01||Math.abs(a[e+1]-a[e-2])<.01,s=e=>Math.abs(a[e]-a[e-3])+Math.abs(a[e+1]-a[e-2]),c=e=>n===0&&e>0&&e<a.length-3&&o(e)&&o(e+3)&&s(e)>=.01&&s(e+3)>=.01&&Math.abs(a[e]-a[e-3])<.01!=Math.abs(a[e+3]-a[e])<.01,l=a[0],u=a[1];for(let t=3;t<a.length;t+=3){let r=+(t===3)|(t===a.length-3?2:0),d=l,f=u,p=a[t],m=a[t+1];if(l=p,u=m,o(t)||n===2){if(!c(t)){D(e,r,d,f,p,m);continue}let n=c(t-3)?s(t)/2:s(t),i=c(t+3)?s(t+3)/2:s(t+3),o=(p-a[t-3])/s(t),h=(m-a[t-2])/s(t),g=(a[t+3]-p)/s(t+3),v=(a[t+4]-m)/s(t+3),b=p-o*n,x=m-h*n;D(e,r,d,f,b,x);let S=p-o*n*(1-y),C=m-h*n*(1-y),w=p+g*i*(1-y),T=m+v*i*(1-y);l=p+g*i,u=m+v*i;let E=r|(t+3===a.length-3?2:0),O=b,k=x;for(let t=1;t<=_;t++){let n=t/_,r=1-n,i=r*r*r*b+3*r*r*n*S+3*r*n*n*w+n*n*n*l,a=r*r*r*x+3*r*r*n*C+3*r*n*n*T+n*n*n*u;D(e,E,O,k,i,a),O=i,k=a}continue}if(n===1){let n=a[t+2]===0,i=n?d:(d+p)/2,o=n?(f+m)/2:f;D(e,r,d,f,i,o),D(e,r,i,o,n?p:i,n?o:m),D(e,r,n?p:i,n?o:m,p,m);continue}let h=a[t+2]===0,v=h?i(p-d,m-f):i(m-f,p-d),b=d,x=f;for(let t=1;t<=g;t++){let n=t/g,i=1-n,a=n*n*(3-2*n),o=3*v*n*i*i+3*(1-v)*n*n*i+n*n*n,s=d+(p-d)*(h?a:o),c=f+(m-f)*(h?o:a);D(e,r,b,x,s,c),b=s,x=c}}}let O=S>x?Math.round(Math.sqrt(p)):1,k=S>x?O/(S-x):0,A=e=>Math.min(O-1,Math.floor((e-x)*k)),j=new Int32Array(p),M=new Int32Array(O+1);for(let e=0;e<p;e++){j[e]=A(l[e]);for(let t=j[e],n=A(u[e]);t<=n;t++)M[t+1]++}for(let e=0;e<O;e++)M[e+1]+=M[e];let N=M.slice(0,O),P=new Int32Array(M[O]);for(let e=0;e<p;e++)for(let t=j[e],n=A(u[e]);t<=n;t++)P[N[t]++]=e;let F=new Float64Array(t.length*8),I=(e,t,n,r)=>Math.abs(e[t]-e[n])<h&&Math.abs(e[t]-e[r])<h||Math.abs(e[t+1]-e[n+1])<h&&Math.abs(e[t+1]-e[r+1])<h;for(let e=0;e<t.length;e++){let n=t[e].route;if(n.length<6)continue;let r=3;for(;r+3<n.length&&I(n,0,r,r+3);)r+=3;let i=n.length-3,a=i-3;for(;a>=3&&I(n,i,a,a-3);)a-=3;F.set([n[0],n[1],n[r],n[r+1],n[a],n[a+1],n[i],n[i+1]],e*8)}let L=(e,t,n,r)=>{let i=e*8+(t===1?0:4),a=F[i],o=F[i+1],s=F[i+2]-a,c=F[i+3]-o,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((n-a)*s+(r-o)*c)/l)):0;return Math.hypot(n-a-u*s,r-o-u*c)<h},R=0;for(let n=0;n<O;n++){let r=M[n+1];if(r-M[n]>b)P.subarray(M[n],r).sort((e,t)=>a[e]-a[t]||e-t);else for(let e=M[n]+1;e<r;e++){let t=P[e],r=e;for(;r>M[n]&&a[P[r-1]]>a[t];r--)P[r]=P[r-1];P[r]=t}for(let i=M[n];i<r;i++){let p=P[i],h=s[p]-a[p],g=c[p]-o[p],_=j[p]===n;for(let v=i+1;v<r;v++){let r=P[v];if(a[r]>s[p])break;if(u[r]<l[p]||l[r]>u[p]||d[p]===d[r]||!_&&j[r]!==n)continue;let i=h*(o[r]-o[p])-g*(a[r]-a[p]),y=h*(c[r]-o[p])-g*(s[r]-a[p]);if(i>0==y>0)continue;let b=s[r]-a[r],x=c[r]-o[r],S=b*(o[p]-o[r])-x*(a[p]-a[r]),C=b*(c[p]-o[r])-x*(s[p]-a[r]);if(S>0==C>0)continue;let w=t[d[p]],T=t[d[r]],E=S/(S-C),D=a[p]+E*h,O=o[p]+E*g,k=(t,n,i)=>(f[p]&n)!==0&&(f[r]&i)!==0||Math.abs(D-e[t].x)<e[t].w/2+m&&Math.abs(O-e[t].y)<e[t].h/2+m||L(d[p],n,D,O)&&L(d[r],i,D,O);w.src===T.src&&k(w.src,1,1)||w.src===T.dst&&k(w.src,1,2)||w.dst===T.src&&k(w.dst,2,1)||w.dst===T.dst&&k(w.dst,2,2)||R++}}}return R}function C(e,t,n,r){for(let t of e)t.x+=n,t.y+=r;for(let e of t){for(let t=0;t<e.route.length;t+=3)e.route[t]+=n,e.route[t+1]+=r;e.labelX+=n,e.labelY+=r}}function w(e,t,n=-1){return{w:e,h:t,parent:n,isGroup:!1,dir:void 0,padX:0,padTop:0,padBottom:0,minW:0,seq:0,span:0,x:0,y:0}}function T(e){return e===`TB`?0:e===`BT`?2:e===`LR`?3:1}function E(e){return e+2&3}function D(i,o,m,g){let _=i.length,v=new Map,y=[],b=(e,t)=>{let n={id:e,dir:t,items:[],edges:[],ports:[],portOf:new Map,routes:new Map,x:0,y:0};return v.set(e,n),n},C=b(-1,m),w=[];for(let e=0;e<_;e++)w.push([]);let D=[];for(let e=0;e<_;e++){let t=i[e].parent;t>=0&&t<_&&t!==e&&i[t].isGroup?w[t].push(e):(i[e].parent=-1,D.push(e))}C.items=D,y.push(C);let O=new Int32Array(_),k=new Uint8Array(_),A=e=>{for(let t=e;t<y.length;t++){let e=y[t];for(let t of e.items)if(k[t]=1,O[t]=e.id<0?0:O[e.id]+1,i[t].isGroup){let n=b(t,i[t].dir??e.dir);n.items=w[t],y.push(n)}}};A(0);for(let e=0;e<_;e++){if(k[e])continue;let t=i[e].parent;if(w[t]=w[t].filter(t=>t!==e),i[e].parent=-1,C.items.push(e),k[e]=1,O[e]=0,i[e].isGroup){let t=y.length,n=b(e,i[e].dir??m);n.items=w[e],y.push(n),A(t)}}for(let e=y.length-1;e>0;e--){let t=y[e],n=1/0;for(let e of t.items)i[e].seq<n&&(n=i[e].seq);n!==1/0&&(i[t.id].seq=n)}for(let e of y)e.items.sort((e,t)=>i[e].seq-i[t].seq||e-t);let j=0;for(let e of o){let t=e.src,n=e.dst,r=0;for(;O[t]>O[n];r++)t=i[t].parent;for(;O[n]>O[t];r++)n=i[n].parent;for(;t!==n&&i[t].parent!==i[n].parent;r+=2)t=i[t].parent,n=i[n].parent;t!==n&&(j+r>s?(e.src=t,e.dst=n):j+=r)}let M=[],N=[];for(let e=0;e<o.length;e++){let t=o[e];if(t.route=[],t.src===t.dst){M.push(e);continue}let n=t.src,r=t.dst,a=[],s=[];for(;O[n]>O[r];)a.push(n),n=i[n].parent;for(;O[r]>O[n];)s.push(r),r=i[r].parent;if(n===r)N.push(e);else{for(;i[n].parent!==i[r].parent;)a.push(n),s.push(r),n=i[n].parent,r=i[r].parent;v.get(i[n].parent).edges.push({e,a:n,b:r});for(let[t,n]of[[a,!0],[s,!1]])for(let r of t){let t=v.get(i[r].parent),a={e,inner:r,out:n,side:0,hint:NaN,px:0,py:0,route:[]};t.ports.push(a),t.portOf.set(e*2+ +!n,a)}}}let P=new Int32Array(_),F=(e,t,n)=>(n?t.src:t.dst)!==e,I=(e,t)=>{let n=e.dir===`TB`||e.dir===`BT`,s=T(e.dir),c=[],l=[];e.items.forEach((e,a)=>{P[e]=a;let o=i[e],s=t?r(n?o.w:o.h,n?o.h:o.w):r(0,0);s.span=o.isGroup?Math.min(o.span,s.w-2*o.padX):o.span,s.key=z?R[e]:NaN,c.push(s)});let u=(e,t,n)=>i[e].isGroup&&F(e,o[t],n),d=(e,r,a)=>{if(!t||!i[e].isGroup||!F(e,o[r],a))return 0;let s=v.get(e).portOf.get(r*2+ +!a);return n?s.px-i[e].w/2:s.py-i[e].h/2};for(let r of e.edges){let e=o[r.e],i=a(P[r.a],P[r.b],e.minlen);t&&(i.labelW=n?e.labelW:e.labelH,i.labelH=n?e.labelH:e.labelW,i.tailDx=d(r.a,r.e,!0),i.headDx=d(r.b,r.e,!1),i.tailFixed=u(r.a,r.e,!0),i.headFixed=u(r.b,r.e,!1)),l.push(i)}let f=new Int32Array(e.ports.length).fill(-1);return e.ports.forEach((t,n)=>{if(t.side===s||t.side===E(s)){let i=c.length,p=r(0,0,t.side===s?3:4);p.key=z?R[t.out?o[t.e].dst:o[t.e].src]:NaN,p.hint=Number.isNaN(t.hint)&&z&&V?V(e,t):t.hint,c.push(p),f[n]=i;let m=t.out?a(P[t.inner],i):a(i,P[t.inner]);t.out?(m.tailDx=d(t.inner,t.e,!0),m.tailFixed=u(t.inner,t.e,!0)):(m.headDx=d(t.inner,t.e,!1),m.headFixed=u(t.inner,t.e,!1)),l.push(m)}else c[P[t.inner]].pin=t.side===0||t.side===3?-1:1}),{lnodes:c,ledges:l,dummies:f}},L=j>1&&j<=c&&o.length<=l,R=new Float64Array(_).fill(NaN),z=!1,B=0,V,H=y.length>1&&L;for(let e of y)e.dir!==m&&(H=!1);if(H){let t=m===`TB`||m===`BT`,n=new Int32Array(_).fill(-1),s=new Int32Array(_).fill(-1),c=[],l=[],u=[];for(let e=0;e<_;e++)i[e].isGroup&&(s[e]=u.length,u.push(-1));for(let e=0;e<_;e++){let a=i[e].parent;i[e].isGroup?u[s[e]]=a>=0?s[a]:-1:(n[e]=c.length,c.push(r(t?i[e].w:i[e].h,t?i[e].h:i[e].w)),l.push(a>=0?s[a]:-1))}let d=[],f=new Int32Array(o.length).fill(-1);o.forEach((e,r)=>{e.src===e.dst||n[e.src]<0||n[e.dst]<0||(f[r]=d.length,d.push(a(n[e.src],n[e.dst],e.minlen,t?e.labelW:e.labelH,t?e.labelH:e.labelW)))});let p=e(c,d,{...g,groups:{of:Int32Array.from(l),parent:Int32Array.from(u)},orderOnly:!0});B=Math.min(p.crossings??0,p.declared??0);let h=new Float64Array(_),v=new Int32Array(_),y=new Int32Array(_).fill(-1);for(let e=0;e<_;e++)if(!(n[e]<0)){R[e]=c[n[e]].x;for(let t=i[e].parent;t>=0;t=i[t].parent)h[t]+=R[e],v[t]++,y[t]=Math.max(y[t],c[n[e]].rank)}for(let e=0;e<_;e++)v[e]>0&&(R[e]=h[e]/v[e]);V=(e,t)=>{let n=f[t.e];if(n<0||e.id<0||!t.out||t.side!==E(T(e.dir)))return NaN;let r=d[n].points,i=R[o[t.e].src],a=0;for(let t=0;t<r.length;t+=2)r[t]===y[e.id]&&(i=r[t+1]),r[t]===y[e.id]+1&&(a=r[t+1]);return i+a*1e-6}}let U=new Map,W=(t,n,r)=>{if(!L)return{lnodes:n,ledges:r,size:e(n,r,g)};let i=[];for(let e of n)i.push(e.w,e.h,e.kind,e.pin,e.hint,e.key,e.span);for(let e of r)i.push(e.tail,e.head,e.minlen,e.labelW,e.labelH,e.tailDx,e.headDx,+e.tailFixed,+e.headFixed);let a=U.get(t.id);a||U.set(t.id,a=[]);for(let e of a){let t=e.given.length===i.length;for(let n=0;t&&n<i.length;n++)t=Object.is(e.given[n],i[n]);if(t)return e}let o={given:i,lnodes:n,ledges:r,size:e(n,r,g)};return a.push(o),o},G={width:0,height:0},K=()=>{for(let e of y){for(let t of e.ports)i[t.inner].isGroup&&F(t.inner,o[t.e],t.out)&&(v.get(t.inner).portOf.get(t.e*2+ +!t.out).side=t.side);if(e.edges.length===0)continue;let r=!1;for(let t of e.edges){let e=o[t.e];(i[t.a].isGroup&&e.src!==t.a||i[t.b].isGroup&&e.dst!==t.b)&&(r=!0)}if(!r)continue;let{lnodes:a,ledges:s}=I(e,!1);t(a,s),n(a,s,1);let c=T(e.dir);e.edges.forEach((e,t)=>{let n=o[e.e],r=!s[t].reversed;i[e.a].isGroup&&n.src!==e.a&&(v.get(e.a).portOf.get(e.e*2).side=r?E(c):c),i[e.b].isGroup&&n.dst!==e.b&&(v.get(e.b).portOf.get(e.e*2+1).side=r?c:E(c))})}for(let e=y.length-1;e>=0;e--){let t=y[e],n=t.id>=0?i[t.id]:void 0,r=t.dir===`TB`||t.dir===`BT`,a=t.dir===`BT`||t.dir===`RL`,s=I(t,!0),{lnodes:c,ledges:l,size:u}=W(t,s.lnodes,s.ledges),d=s.dummies,f=r?u.width:u.height,p=r?u.height:u.width,m=n?n.padX:0,h=n?n.padTop:0,g=Math.max(f+2*m,n?n.minW:0),_=p+h+(n?n.padBottom:0),b=(g-f)/2,x=h,S=(e,t)=>b+(r?e:a?u.height-t:t),C=(e,t)=>x+(r?a?u.height-t:t:e),w=+!r,T=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(S(e[n],e[n+1]),C(e[n],e[n+1]),w);return t};t.items.forEach((e,t)=>{i[e].x=S(c[t].x,c[t].y),i[e].y=C(c[t].x,c[t].y)}),t.edges.forEach((e,n)=>{let r=l[n];t.routes.set(e.e,T(r.points));let i=o[e.e];i.labelW>0&&(i.labelX=S(r.labelX,r.labelY),i.labelY=C(r.labelX,r.labelY))});let E=t.edges.length;t.ports.forEach((e,t)=>{let n=i[e.inner];if(d[t]>=0){let t=T(l[E++].points),n=e.out?t.length-3:0,r=t[n],i=t[n+1];e.side===0?i=0:e.side===2?i=_:r=e.side===3?0:g,e.out?t.push(r,i,w):t.unshift(r,i,w),e.px=r,e.py=i,e.route=t;return}let r=n.x,a=n.y;if(n.isGroup&&F(e.inner,o[e.e],e.out)){let t=v.get(e.inner).portOf.get(e.e*2+ +!e.out);r+=t.px-n.w/2,a+=t.py-n.h/2}else e.side===0?a-=n.h/2:e.side===2?a+=n.h/2:e.side===3?r-=n.w/2:r+=n.w/2;let s=r,c=a;e.side===0?c=0:e.side===2?c=_:s=e.side===3?0:g;let u=e.side===0||e.side===2?0:1;e.px=s,e.py=c,e.route=e.out?[r,a,u,s,c,u]:[s,c,u,r,a,u]}),n?(n.w=g,n.h=_):G={width:g,height:_}}for(let e of y){let t=e.x,n=e.y;for(let r of e.items){let e=i[r];if(e.x+=t,e.y+=n,e.isGroup){let t=v.get(r);t.x=e.x-e.w/2,t.y=e.y-e.h/2}}}let e=(e,t,n,r)=>{for(let i=0;i<t.length;i+=3){let a=t[i]+n,o=t[i+1]+r,s=e.length;s>=3&&Math.abs(e[s-3]-a)<.01&&Math.abs(e[s-2]-o)<.01||e.push(a,o,t[i+2])}};for(let t of y)for(let n of t.edges){let r=o[n.e],a=[],s=[];for(let e=r.src;i[e].parent!==t.id;e=i[e].parent)s.push(v.get(i[e].parent));for(let t of s)e(a,t.portOf.get(n.e*2).route,t.x,t.y);e(a,t.routes.get(n.e),t.x,t.y);let c=[];for(let e=r.dst;i[e].parent!==t.id;e=i[e].parent)c.push(v.get(i[e].parent));for(let t=c.length-1;t>=0;t--)e(a,c[t].portOf.get(n.e*2+1).route,c[t].x,c[t].y);r.route=a,r.labelW>0&&(r.labelX+=t.x,r.labelY+=t.y)}},q=x(g);z=H,K();let J=-1;if(H&&(J=S(i,o,q),J>B*u+d)){let e=f(i,o,y,G);z=!1,K();let t=S(i,o,q);t>=J?(z=!0,G=p(e,i,o,y)):J=t}if(z===H&&L){let e=!1;for(let t of y){if(t.id<0)continue;let n=i[t.id],r=t.dir===`TB`||t.dir===`BT`,a=E(T(t.dir)),s=[];for(let e of t.ports){if(e.side!==a)continue;let i=o[e.e].route,c=t.x+e.px,l=t.y+e.py,u=-1;for(let t=0;t<i.length&&(u<0||e.out);t+=3)Math.abs(i[t]-c)<.01&&Math.abs(i[t+1]-l)<.01&&(u=t);if(u<0)continue;let d=+!r,f=e.out?u+3:u-3;for(;f>=0&&f<i.length&&Math.abs(i[f+d]-i[u+d])<h;)f+=e.out?3:-3;f<0||f>=i.length||(e.hint=i[f+d]-(r?n.x-n.w/2:n.y-n.h/2),s.push([r?e.px:e.py,e.hint]))}s.sort((e,t)=>e[0]-t[0]);for(let t=1;t<s.length;t++)s[t-1][1]>s[t][1]&&(e=!0)}if(e){let e=J>=0?J:S(i,o,q),t=e>0?f(i,o,y,G):void 0;t&&(K(),S(i,o,q)>=e&&(G=p(t,i,o,y)))}}for(let e of N){let t=o[e],n=i[t.src],r=i[t.dst];t.route=[n.x,n.y,0,r.x,r.y,0],t.labelX=(n.x+r.x)/2,t.labelY=(n.y+r.y)/2}for(let e of M){let t=o[e],n=i[t.src];t.labelX=n.x+n.w/2+28+t.labelW/2,t.labelY=n.y}return G}export{D as i,C as n,o as r,w as t};
1
+ import{c as e,f as t,n,o as r,r as i,t as a}from"./BF3mdiSX.js";function o(e){return e===`BT`||e===`LR`||e===`RL`?e:`TB`}var s=4e4,c=400,l=500,u=1.5,d=4;function f(e,t,n,r){let i=[];for(let t of e)i.push(t.x,t.y,t.w,t.h);let a=[];for(let e of t)a.push(e.labelX,e.labelY);let o=[];for(let e of n){o.push(e.x,e.y);for(let t of e.ports)o.push(t.px,t.py)}return{nodes:i,routes:t.map(e=>e.route),labels:a,levels:o,total:r}}function p(e,t,n,r){t.forEach((t,n)=>{t.x=e.nodes[4*n],t.y=e.nodes[4*n+1],t.w=e.nodes[4*n+2],t.h=e.nodes[4*n+3]}),n.forEach((t,n)=>{t.route=e.routes[n],t.labelX=e.labels[2*n],t.labelY=e.labels[2*n+1]});let i=0;for(let t of r){t.x=e.levels[i++],t.y=e.levels[i++];for(let n of t.ports)n.px=e.levels[i++],n.py=e.levels[i++]}return e.total}var m=24,h=.5,g=3,_=2,v=Math.max(3,g,_+1),y=.62,b=128;function x(e){return e.tracks?1:e.straight?2:0}function S(e,t,n=0){let r=0;for(let e of t)e.src!==e.dst&&e.route.length>3&&(r+=(e.route.length/3-1)*v);let a=new Float64Array(r),o=new Float64Array(r),s=new Float64Array(r),c=new Float64Array(r),l=new Float64Array(r),u=new Float64Array(r),d=new Int32Array(r),f=new Uint8Array(r),p=0,x=1/0,S=-1/0,C=NaN,w=NaN,T=NaN,E=NaN,D=(e,t,n,r,i,m)=>{let h=p-1;n===T&&r===E&&(m===r&&w===r||i===n&&C===n)&&d[h]===e&&f[h]===t&&(n-C)*(i-n)+(r-w)*(m-r)>0&&(p--,n=C,r=w),C=n,w=r,T=i,E=m,f[p]=t,a[p]=Math.min(n,i),s[p]=Math.max(n,i),o[p]=n<=i?r:m,c[p]=n<=i?m:r,l[p]=Math.min(r,m),u[p]=Math.max(r,m),l[p]<x&&(x=l[p]),u[p]>S&&(S=u[p]),d[p++]=e};for(let e=0;e<t.length;e++){let r=t[e];if(r.src===r.dst)continue;let a=r.route,o=e=>Math.abs(a[e]-a[e-3])<.01||Math.abs(a[e+1]-a[e-2])<.01,s=e=>Math.abs(a[e]-a[e-3])+Math.abs(a[e+1]-a[e-2]),c=e=>n===0&&e>0&&e<a.length-3&&o(e)&&o(e+3)&&s(e)>=.01&&s(e+3)>=.01&&Math.abs(a[e]-a[e-3])<.01!=Math.abs(a[e+3]-a[e])<.01,l=a[0],u=a[1];for(let t=3;t<a.length;t+=3){let r=+(t===3)|(t===a.length-3?2:0),d=l,f=u,p=a[t],m=a[t+1];if(l=p,u=m,o(t)||n===2){if(!c(t)){D(e,r,d,f,p,m);continue}let n=c(t-3)?s(t)/2:s(t),i=c(t+3)?s(t+3)/2:s(t+3),o=(p-a[t-3])/s(t),h=(m-a[t-2])/s(t),g=(a[t+3]-p)/s(t+3),v=(a[t+4]-m)/s(t+3),b=p-o*n,x=m-h*n;D(e,r,d,f,b,x);let S=p-o*n*(1-y),C=m-h*n*(1-y),w=p+g*i*(1-y),T=m+v*i*(1-y);l=p+g*i,u=m+v*i;let E=r|(t+3===a.length-3?2:0),O=b,k=x;for(let t=1;t<=_;t++){let n=t/_,r=1-n,i=r*r*r*b+3*r*r*n*S+3*r*n*n*w+n*n*n*l,a=r*r*r*x+3*r*r*n*C+3*r*n*n*T+n*n*n*u;D(e,E,O,k,i,a),O=i,k=a}continue}if(n===1){let n=a[t+2]===0,i=n?d:(d+p)/2,o=n?(f+m)/2:f;D(e,r,d,f,i,o),D(e,r,i,o,n?p:i,n?o:m),D(e,r,n?p:i,n?o:m,p,m);continue}let h=a[t+2]===0,v=h?i(p-d,m-f):i(m-f,p-d),b=d,x=f;for(let t=1;t<=g;t++){let n=t/g,i=1-n,a=n*n*(3-2*n),o=3*v*n*i*i+3*(1-v)*n*n*i+n*n*n,s=d+(p-d)*(h?a:o),c=f+(m-f)*(h?o:a);D(e,r,b,x,s,c),b=s,x=c}}}let O=S>x?Math.round(Math.sqrt(p)):1,k=S>x?O/(S-x):0,A=e=>Math.min(O-1,Math.floor((e-x)*k)),j=new Int32Array(p),M=new Int32Array(O+1);for(let e=0;e<p;e++){j[e]=A(l[e]);for(let t=j[e],n=A(u[e]);t<=n;t++)M[t+1]++}for(let e=0;e<O;e++)M[e+1]+=M[e];let N=M.slice(0,O),P=new Int32Array(M[O]);for(let e=0;e<p;e++)for(let t=j[e],n=A(u[e]);t<=n;t++)P[N[t]++]=e;let F=new Float64Array(t.length*8),I=(e,t,n,r)=>Math.abs(e[t]-e[n])<h&&Math.abs(e[t]-e[r])<h||Math.abs(e[t+1]-e[n+1])<h&&Math.abs(e[t+1]-e[r+1])<h;for(let e=0;e<t.length;e++){let n=t[e].route;if(n.length<6)continue;let r=3;for(;r+3<n.length&&I(n,0,r,r+3);)r+=3;let i=n.length-3,a=i-3;for(;a>=3&&I(n,i,a,a-3);)a-=3;F.set([n[0],n[1],n[r],n[r+1],n[a],n[a+1],n[i],n[i+1]],e*8)}let L=(e,t,n,r)=>{let i=e*8+(t===1?0:4),a=F[i],o=F[i+1],s=F[i+2]-a,c=F[i+3]-o,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((n-a)*s+(r-o)*c)/l)):0;return Math.hypot(n-a-u*s,r-o-u*c)<h},R=0;for(let n=0;n<O;n++){let r=M[n+1];if(r-M[n]>b)P.subarray(M[n],r).sort((e,t)=>a[e]-a[t]||e-t);else for(let e=M[n]+1;e<r;e++){let t=P[e],r=e;for(;r>M[n]&&a[P[r-1]]>a[t];r--)P[r]=P[r-1];P[r]=t}for(let i=M[n];i<r;i++){let p=P[i],h=s[p]-a[p],g=c[p]-o[p],_=j[p]===n;for(let v=i+1;v<r;v++){let r=P[v];if(a[r]>s[p])break;if(u[r]<l[p]||l[r]>u[p]||d[p]===d[r]||!_&&j[r]!==n)continue;let i=h*(o[r]-o[p])-g*(a[r]-a[p]),y=h*(c[r]-o[p])-g*(s[r]-a[p]);if(i>0==y>0)continue;let b=s[r]-a[r],x=c[r]-o[r],S=b*(o[p]-o[r])-x*(a[p]-a[r]),C=b*(c[p]-o[r])-x*(s[p]-a[r]);if(S>0==C>0)continue;let w=t[d[p]],T=t[d[r]],E=S/(S-C),D=a[p]+E*h,O=o[p]+E*g,k=(t,n,i)=>(f[p]&n)!==0&&(f[r]&i)!==0||Math.abs(D-e[t].x)<e[t].w/2+m&&Math.abs(O-e[t].y)<e[t].h/2+m||L(d[p],n,D,O)&&L(d[r],i,D,O);w.src===T.src&&k(w.src,1,1)||w.src===T.dst&&k(w.src,1,2)||w.dst===T.src&&k(w.dst,2,1)||w.dst===T.dst&&k(w.dst,2,2)||R++}}}return R}function C(e,t,n,r){for(let t of e)t.x+=n,t.y+=r;for(let e of t){for(let t=0;t<e.route.length;t+=3)e.route[t]+=n,e.route[t+1]+=r;e.labelX+=n,e.labelY+=r}}function w(e,t,n=-1){return{w:e,h:t,parent:n,isGroup:!1,dir:void 0,padX:0,padTop:0,padBottom:0,minW:0,seq:0,span:0,x:0,y:0}}function T(e){return e===`TB`?0:e===`BT`?2:e===`LR`?3:1}function E(e){return e+2&3}function D(i,o,m,g){let _=i.length,v=new Map,y=[],b=(e,t)=>{let n={id:e,dir:t,items:[],edges:[],ports:[],portOf:new Map,routes:new Map,x:0,y:0};return v.set(e,n),n},C=b(-1,m),w=[];for(let e=0;e<_;e++)w.push([]);let D=[];for(let e=0;e<_;e++){let t=i[e].parent;t>=0&&t<_&&t!==e&&i[t].isGroup?w[t].push(e):(i[e].parent=-1,D.push(e))}C.items=D,y.push(C);let O=new Int32Array(_),k=new Uint8Array(_),A=e=>{for(let t=e;t<y.length;t++){let e=y[t];for(let t of e.items)if(k[t]=1,O[t]=e.id<0?0:O[e.id]+1,i[t].isGroup){let n=b(t,i[t].dir??e.dir);n.items=w[t],y.push(n)}}};A(0);for(let e=0;e<_;e++){if(k[e])continue;let t=i[e].parent;if(w[t]=w[t].filter(t=>t!==e),i[e].parent=-1,C.items.push(e),k[e]=1,O[e]=0,i[e].isGroup){let t=y.length,n=b(e,i[e].dir??m);n.items=w[e],y.push(n),A(t)}}for(let e=y.length-1;e>0;e--){let t=y[e],n=1/0;for(let e of t.items)i[e].seq<n&&(n=i[e].seq);n!==1/0&&(i[t.id].seq=n)}for(let e of y)e.items.sort((e,t)=>i[e].seq-i[t].seq||e-t);let j=0;for(let e of o){let t=e.src,n=e.dst,r=0;for(;O[t]>O[n];r++)t=i[t].parent;for(;O[n]>O[t];r++)n=i[n].parent;for(;t!==n&&i[t].parent!==i[n].parent;r+=2)t=i[t].parent,n=i[n].parent;t!==n&&(j+r>s?(e.src=t,e.dst=n):j+=r)}let M=[],N=[];for(let e=0;e<o.length;e++){let t=o[e];if(t.route=[],t.src===t.dst){M.push(e);continue}let n=t.src,r=t.dst,a=[],s=[];for(;O[n]>O[r];)a.push(n),n=i[n].parent;for(;O[r]>O[n];)s.push(r),r=i[r].parent;if(n===r)N.push(e);else{for(;i[n].parent!==i[r].parent;)a.push(n),s.push(r),n=i[n].parent,r=i[r].parent;v.get(i[n].parent).edges.push({e,a:n,b:r});for(let[t,n]of[[a,!0],[s,!1]])for(let r of t){let t=v.get(i[r].parent),a={e,inner:r,out:n,side:0,hint:NaN,px:0,py:0,route:[]};t.ports.push(a),t.portOf.set(e*2+ +!n,a)}}}let P=new Int32Array(_),F=(e,t,n)=>(n?t.src:t.dst)!==e,I=(e,t)=>{let n=e.dir===`TB`||e.dir===`BT`,s=T(e.dir),c=[],l=[];e.items.forEach((e,a)=>{P[e]=a;let o=i[e],s=t?r(n?o.w:o.h,n?o.h:o.w):r(0,0);s.span=o.isGroup?Math.min(o.span,s.w-2*o.padX):o.span,s.key=z?R[e]:NaN,c.push(s)});let u=(e,t,n)=>i[e].isGroup&&F(e,o[t],n),d=(e,r,a)=>{if(!t||!i[e].isGroup||!F(e,o[r],a))return 0;let s=v.get(e).portOf.get(r*2+ +!a);return n?s.px-i[e].w/2:s.py-i[e].h/2};for(let r of e.edges){let e=o[r.e],i=a(P[r.a],P[r.b],e.minlen);t&&(i.labelW=n?e.labelW:e.labelH,i.labelH=n?e.labelH:e.labelW,i.tailDx=d(r.a,r.e,!0),i.headDx=d(r.b,r.e,!1),i.tailFixed=u(r.a,r.e,!0),i.headFixed=u(r.b,r.e,!1)),l.push(i)}let f=new Int32Array(e.ports.length).fill(-1);return e.ports.forEach((t,n)=>{if(t.side===s||t.side===E(s)){let i=c.length,p=r(0,0,t.side===s?3:4);p.key=z?R[t.out?o[t.e].dst:o[t.e].src]:NaN,p.hint=Number.isNaN(t.hint)&&z&&V?V(e,t):t.hint,c.push(p),f[n]=i;let m=t.out?a(P[t.inner],i):a(i,P[t.inner]);t.out?(m.tailDx=d(t.inner,t.e,!0),m.tailFixed=u(t.inner,t.e,!0)):(m.headDx=d(t.inner,t.e,!1),m.headFixed=u(t.inner,t.e,!1)),l.push(m)}else c[P[t.inner]].pin=t.side===0||t.side===3?-1:1}),{lnodes:c,ledges:l,dummies:f}},L=j>1&&j<=c&&o.length<=l,R=new Float64Array(_).fill(NaN),z=!1,B=0,V,H=y.length>1&&L;for(let e of y)e.dir!==m&&(H=!1);if(H){let t=m===`TB`||m===`BT`,n=new Int32Array(_).fill(-1),s=new Int32Array(_).fill(-1),c=[],l=[],u=[];for(let e=0;e<_;e++)i[e].isGroup&&(s[e]=u.length,u.push(-1));for(let e=0;e<_;e++){let a=i[e].parent;i[e].isGroup?u[s[e]]=a>=0?s[a]:-1:(n[e]=c.length,c.push(r(t?i[e].w:i[e].h,t?i[e].h:i[e].w)),l.push(a>=0?s[a]:-1))}let d=[],f=new Int32Array(o.length).fill(-1);o.forEach((e,r)=>{e.src===e.dst||n[e.src]<0||n[e.dst]<0||(f[r]=d.length,d.push(a(n[e.src],n[e.dst],e.minlen,t?e.labelW:e.labelH,t?e.labelH:e.labelW)))});let p=e(c,d,{...g,groups:{of:Int32Array.from(l),parent:Int32Array.from(u)},orderOnly:!0});B=Math.min(p.crossings??0,p.declared??0);let h=new Float64Array(_),v=new Int32Array(_),y=new Int32Array(_).fill(-1);for(let e=0;e<_;e++)if(!(n[e]<0)){R[e]=c[n[e]].x;for(let t=i[e].parent;t>=0;t=i[t].parent)h[t]+=R[e],v[t]++,y[t]=Math.max(y[t],c[n[e]].rank)}for(let e=0;e<_;e++)v[e]>0&&(R[e]=h[e]/v[e]);V=(e,t)=>{let n=f[t.e];if(n<0||e.id<0||!t.out||t.side!==E(T(e.dir)))return NaN;let r=d[n].points,i=R[o[t.e].src],a=0;for(let t=0;t<r.length;t+=2)r[t]===y[e.id]&&(i=r[t+1]),r[t]===y[e.id]+1&&(a=r[t+1]);return i+a*1e-6}}let U=new Map,W=(t,n,r)=>{if(!L)return{lnodes:n,ledges:r,size:e(n,r,g)};let i=[];for(let e of n)i.push(e.w,e.h,e.kind,e.pin,e.hint,e.key,e.span);for(let e of r)i.push(e.tail,e.head,e.minlen,e.labelW,e.labelH,e.tailDx,e.headDx,+e.tailFixed,+e.headFixed);let a=U.get(t.id);a||U.set(t.id,a=[]);for(let e of a){let t=e.given.length===i.length;for(let n=0;t&&n<i.length;n++)t=Object.is(e.given[n],i[n]);if(t)return e}let o={given:i,lnodes:n,ledges:r,size:e(n,r,g)};return a.push(o),o},G={width:0,height:0},K=()=>{for(let e of y){for(let t of e.ports)i[t.inner].isGroup&&F(t.inner,o[t.e],t.out)&&(v.get(t.inner).portOf.get(t.e*2+ +!t.out).side=t.side);if(e.edges.length===0)continue;let r=!1;for(let t of e.edges){let e=o[t.e];(i[t.a].isGroup&&e.src!==t.a||i[t.b].isGroup&&e.dst!==t.b)&&(r=!0)}if(!r)continue;let{lnodes:a,ledges:s}=I(e,!1);t(a,s),n(a,s,1);let c=T(e.dir);e.edges.forEach((e,t)=>{let n=o[e.e],r=!s[t].reversed;i[e.a].isGroup&&n.src!==e.a&&(v.get(e.a).portOf.get(e.e*2).side=r?E(c):c),i[e.b].isGroup&&n.dst!==e.b&&(v.get(e.b).portOf.get(e.e*2+1).side=r?c:E(c))})}for(let e=y.length-1;e>=0;e--){let t=y[e],n=t.id>=0?i[t.id]:void 0,r=t.dir===`TB`||t.dir===`BT`,a=t.dir===`BT`||t.dir===`RL`,s=I(t,!0),{lnodes:c,ledges:l,size:u}=W(t,s.lnodes,s.ledges),d=s.dummies,f=r?u.width:u.height,p=r?u.height:u.width,m=n?n.padX:0,h=n?n.padTop:0,g=Math.max(f+2*m,n?n.minW:0),_=p+h+(n?n.padBottom:0),b=(g-f)/2,x=h,S=(e,t)=>b+(r?e:a?u.height-t:t),C=(e,t)=>x+(r?a?u.height-t:t:e),w=+!r,T=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(S(e[n],e[n+1]),C(e[n],e[n+1]),w);return t};t.items.forEach((e,t)=>{i[e].x=S(c[t].x,c[t].y),i[e].y=C(c[t].x,c[t].y)}),t.edges.forEach((e,n)=>{let r=l[n];t.routes.set(e.e,T(r.points));let i=o[e.e];i.labelW>0&&(i.labelX=S(r.labelX,r.labelY),i.labelY=C(r.labelX,r.labelY))});let E=t.edges.length;t.ports.forEach((e,t)=>{let n=i[e.inner];if(d[t]>=0){let t=T(l[E++].points),n=e.out?t.length-3:0,r=t[n],i=t[n+1];e.side===0?i=0:e.side===2?i=_:r=e.side===3?0:g,e.out?t.push(r,i,w):t.unshift(r,i,w),e.px=r,e.py=i,e.route=t;return}let r=n.x,a=n.y;if(n.isGroup&&F(e.inner,o[e.e],e.out)){let t=v.get(e.inner).portOf.get(e.e*2+ +!e.out);r+=t.px-n.w/2,a+=t.py-n.h/2}else e.side===0?a-=n.h/2:e.side===2?a+=n.h/2:e.side===3?r-=n.w/2:r+=n.w/2;let s=r,c=a;e.side===0?c=0:e.side===2?c=_:s=e.side===3?0:g;let u=e.side===0||e.side===2?0:1;e.px=s,e.py=c,e.route=e.out?[r,a,u,s,c,u]:[s,c,u,r,a,u]}),n?(n.w=g,n.h=_):G={width:g,height:_}}for(let e of y){let t=e.x,n=e.y;for(let r of e.items){let e=i[r];if(e.x+=t,e.y+=n,e.isGroup){let t=v.get(r);t.x=e.x-e.w/2,t.y=e.y-e.h/2}}}let e=(e,t,n,r)=>{for(let i=0;i<t.length;i+=3){let a=t[i]+n,o=t[i+1]+r,s=e.length;s>=3&&Math.abs(e[s-3]-a)<.01&&Math.abs(e[s-2]-o)<.01||e.push(a,o,t[i+2])}};for(let t of y)for(let n of t.edges){let r=o[n.e],a=[],s=[];for(let e=r.src;i[e].parent!==t.id;e=i[e].parent)s.push(v.get(i[e].parent));for(let t of s)e(a,t.portOf.get(n.e*2).route,t.x,t.y);e(a,t.routes.get(n.e),t.x,t.y);let c=[];for(let e=r.dst;i[e].parent!==t.id;e=i[e].parent)c.push(v.get(i[e].parent));for(let t=c.length-1;t>=0;t--)e(a,c[t].portOf.get(n.e*2+1).route,c[t].x,c[t].y);r.route=a,r.labelW>0&&(r.labelX+=t.x,r.labelY+=t.y)}},q=x(g);z=H,K();let J=-1;if(H&&(J=S(i,o,q),J>B*u+d)){let e=f(i,o,y,G);z=!1,K();let t=S(i,o,q);t>=J?(z=!0,G=p(e,i,o,y)):J=t}if(z===H&&L){let e=!1;for(let t of y){if(t.id<0)continue;let n=i[t.id],r=t.dir===`TB`||t.dir===`BT`,a=E(T(t.dir)),s=[];for(let e of t.ports){if(e.side!==a)continue;let i=o[e.e].route,c=t.x+e.px,l=t.y+e.py,u=-1;for(let t=0;t<i.length&&(u<0||e.out);t+=3)Math.abs(i[t]-c)<.01&&Math.abs(i[t+1]-l)<.01&&(u=t);if(u<0)continue;let d=+!r,f=e.out?u+3:u-3;for(;f>=0&&f<i.length&&Math.abs(i[f+d]-i[u+d])<h;)f+=e.out?3:-3;f<0||f>=i.length||(e.hint=i[f+d]-(r?n.x-n.w/2:n.y-n.h/2),s.push([r?e.px:e.py,e.hint]))}s.sort((e,t)=>e[0]-t[0]);for(let t=1;t<s.length;t++)s[t-1][1]>s[t][1]&&(e=!0)}if(e){let e=J>=0?J:S(i,o,q),t=e>0?f(i,o,y,G):void 0;t&&(K(),S(i,o,q)>=e&&(G=p(t,i,o,y)))}}for(let e of N){let t=o[e],n=i[t.src],r=i[t.dst];t.route=[n.x,n.y,0,r.x,r.y,0],t.labelX=(n.x+r.x)/2,t.labelY=(n.y+r.y)/2}for(let e of M){let t=o[e],n=i[t.src];t.labelX=n.x+n.w/2+28+t.labelW/2,t.labelY=n.y}return G}export{D as i,C as n,o as r,w as t};
@@ -1 +1 @@
1
- import{o as e,x as t}from"./DS7XcdHs.js";function n(e,t){for(let n=0;n<t.length;n+=3){let r=Math.round(t[n+1]),i=e.get(r);i?i.push(t[n]):e.set(r,[t[n]])}}function r(e,t,n,r){if(t===0)return e.x;let i=e.y-e.h/2,a=e.x-e.w/2,o=t/2,s=[a+r-6+o,e.x,a+e.w-r+6-o],c=n.get(Math.round(i));if(c===void 0)return s[0];let l=s[0],u=-1;for(let t of s){let n=1/0;for(let r of c)r>a&&r<a+e.w&&(n=Math.min(n,Math.abs(r-t)-o));if(n>=6)return t;n>u+.5&&(u=n,l=t)}return l}function i(e,t,n,r){let i=t>0?r.get(Math.round(e.y-e.h/2)):void 0;if(i===void 0)return!1;let a=e.x-e.w/2;for(let r of i)if(r>a&&r<a+e.w&&Math.abs(r-n)<t/2+4)return!0;return!1}function a(n,r,i,a,o,s,c,l){let u=1;for(let e=s[c].parent;e>=0&&u<8;e=s[e].parent)u++;let d=`color-mix(in srgb,var(--_a) ${t(100*(1-.5**u))}%,var(--_bg))`;return`<g class="pele-cluster-title" data-id="${o}">`+e(n,r,i,` fill="none" stroke="${d}" stroke-width="5" stroke-linejoin="round"`,l)+e(n,r,i,a,l)+`</g>`}export{i,r as n,n as r,a as t};
1
+ import{o as e,x as t}from"./DlgOmQ_G.js";function n(e,t){for(let n=0;n<t.length;n+=3){let r=Math.round(t[n+1]),i=e.get(r);i?i.push(t[n]):e.set(r,[t[n]])}}function r(e,t,n,r){if(t===0)return e.x;let i=e.y-e.h/2,a=e.x-e.w/2,o=t/2,s=[a+r-6+o,e.x,a+e.w-r+6-o],c=n.get(Math.round(i));if(c===void 0)return s[0];let l=s[0],u=-1;for(let t of s){let n=1/0;for(let r of c)r>a&&r<a+e.w&&(n=Math.min(n,Math.abs(r-t)-o));if(n>=6)return t;n>u+.5&&(u=n,l=t)}return l}function i(e,t,n,r){let i=t>0?r.get(Math.round(e.y-e.h/2)):void 0;if(i===void 0)return!1;let a=e.x-e.w/2;for(let r of i)if(r>a&&r<a+e.w&&Math.abs(r-n)<t/2+4)return!0;return!1}function a(n,r,i,a,o,s,c,l){let u=1;for(let e=s[c].parent;e>=0&&u<8;e=s[e].parent)u++;let d=`color-mix(in srgb,var(--_a) ${t(100*(1-.5**u))}%,var(--_bg))`;return`<g class="pele-cluster-title" data-id="${o}">`+e(n,r,i,` fill="none" stroke="${d}" stroke-width="5" stroke-linejoin="round"`,l)+e(n,r,i,a,l)+`</g>`}export{i,r as n,n as r,a as t};
@@ -0,0 +1 @@
1
+ export{t as flowchart}from"./fRXyV4Ec.js";
@@ -1,2 +1,2 @@
1
- import{_ as e,f as t,i as n,o as r,r as i,u as a,x as o}from"./DS7XcdHs.js";import{a as s,s as c}from"./DK9wjWIk.js";import{a as l,c as u,d,f,g as p,h as m,i as h,l as g,m as ee,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./Dzu8v7nB.js";import{u as te}from"./BNlziJ_1.js";var w=class{domains=new Map;transitions=[];setDomains(e){if(e)for(let t of e){let e=t.domain;this.domains.set(e,{name:e,items:(t.items??[]).map(e=>({label:e.label}))})}}setTransitions(e){e&&(this.transitions=e.filter(e=>e.from!==e.to).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))}};function T(e,t){let n=new w;return n.setDomains(e.domains),n.setTransitions(e.transitions),{type:`cynefin`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
1
+ import{_ as e,f as t,i as n,o as r,r as i,u as a,x as o}from"./DlgOmQ_G.js";import{a as s,s as c}from"./BF3mdiSX.js";import{a as l,c as u,d,f,g as p,h as m,i as h,l as g,m as ee,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./jAC4YCqW.js";import{u as te}from"./BArcFmbE.js";var w=class{domains=new Map;transitions=[];setDomains(e){if(e)for(let t of e){let e=t.domain;this.domains.set(e,{name:e,items:(t.items??[]).map(e=>({label:e.label}))})}}setTransitions(e){e&&(this.transitions=e.filter(e=>e.from!==e.to).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))}};function T(e,t){let n=new w;return n.setDomains(e.domains),n.setTransitions(e.transitions),{type:`cynefin`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0,domains:n.domains,transitions:n.transitions}}var E=[{name:`cynefin-beta:`,pattern:`cynefin-beta:`},h(`cynefin-beta`),{name:`-->`,pattern:`-->`},{name:`:`,pattern:`:`},{name:`DOMAIN_NAME`,pattern:/complex|complicated|clear|chaotic|confusion/y},l,S,y,ee,g,C,b,v,x];function D(e){let t=new m(_(e,E,`cynefin`),E,`cynefin`),n={$type:`Cynefin`,domains:[],transitions:[]},r=()=>{for(;t.kinds[t.i]===9;)t.i++},i=()=>{t.kind!==-1&&(t.kind!==9&&t.fail(`a line break or the end of input`),r())};for(r(),t.kind!==1&&t.kind!==0&&t.fail(`'cynefin-beta'`),t.i++;t.kind!==-1;)switch(t.kind){case 9:t.i++;break;case 5:n.accDescr=u(t.take()),i();break;case 6:n.accTitle=p(t.take()),i();break;case 7:n.title=d(t.take()),i();break;case 4:{let e=t.take();if(t.accept(2)){let r={$type:`Transition`,from:e,to:t.expect(4)};t.accept(3)&&(r.label=f(t.expect(8))),i(),n.transitions.push(r);break}let a={$type:`DomainBlock`,domain:e,items:[]};for(r();t.kinds[t.i]===8;)a.items.push({$type:`DomainItem`,label:f(t.take())}),r();n.domains.push(a);break}default:t.fail(`a domain, a transition, a title, or a line break`)}return n}function O(e){let t=e+1831565813|0;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function k(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function ne(e,t){return typeof e==`number`&&Number.isFinite(e)&&e!==0?e:k(t)}var re={segments:7,vertical:!0,pointStep:17,controlStep:31,controlShift:7},A={segments:7,vertical:!1,pointStep:23,controlStep:37,controlShift:11};function j(e,t,n,r,i,a){let o=(t-e)/a.segments,s=[],c=[];for(let t=0;t<=a.segments;t++){let l=t===0&&a.pinStart||t===a.segments&&a.pinEnd;s.push(e+t*o),c.push(l?n:n+O(r+t*a.pointStep)*i*2-i)}let l=a.vertical?[c[0],s[0]]:[s[0],c[0]];for(let e=0;e<a.segments;e++){let t=(s[e]+s[e+1])/2,n=i*1.5*(e%2==0?1:-1)*O(r+e*a.controlStep+a.controlShift);a.vertical?l.push(c[e]+n,t,c[e+1]-n,t,c[e+1],s[e+1]):l.push(t,c[e]+n,t,c[e+1]-n,s[e+1],c[e+1])}return l}function ie(e,t,n,r){let i=n-t;return[e,t,e+r,t+i*.2,e-r*1.5,t+i*.55,e+r*.5,t+i*.75,e-r,t+i*.85,e+r*.3,t+i*.95,e,n]}function M(e){let t=``;for(let n=2;n<e.length;n+=6)t+=`C${o(e[n])},${o(e[n+1])} ${o(e[n+2])},${o(e[n+3])} ${o(e[n+4])},${o(e[n+5])}`;return t}function N(e){let t=``;for(let n=e.length-6;n>=2;n-=6)t+=`C${o(e[n+2])},${o(e[n+3])} ${o(e[n])},${o(e[n+1])} ${o(e[n-2])},${o(e[n-1])}`;return t}function P(e){return`M${o(e[0])},${o(e[1])}${M(e)}`}function F(e,t,n,r){let i=`${o(n)},${o(r)}`;return`M${o(e-n)},${o(t)}A${i} 0 1,1 ${o(e+n)},${o(t)}A${i} 0 1,1 ${o(e-n)},${o(t)}Z`}var I=[[`complex`,0,0,0],[`complicated`,1,0,1],[`chaotic`,0,1,3],[`clear`,1,1,2]],ae=4,L=new Map([[`complex`,[`Complex`,`Probe → Sense → Respond`,`Emergent Practices`]],[`complicated`,[`Complicated`,`Sense → Analyse → Respond`,`Good Practices`]],[`clear`,[`Clear`,`Sense → Categorise → Respond`,`Best Practices`]],[`chaotic`,[`Chaotic`,`Act → Sense → Respond`,`Novel Practices`]],[`confusion`,[`Confusion`,``,`Disorder`]]]),oe=3,se=200,ce=10,le=4,R=6,ue=10,de=20,z=10;function B(e,t,n,r,i){let a=e.cynefin?.[t];return typeof a==`number`&&a>=r&&a<=i?a:n}function V(l,u,d){let f=d.fontSize??16,p=Math.round(f*.8125),m=Math.round(f*.875),h=d.measurer??te(d.fontFamily,d.fontFamilyMono),g=d.padding??8,ee=d.icons,_=u.cynefin?.showDomainDescriptions!==!1,v=B(u,`boundaryAmplitude`,8,0,50),y=ne(B(u,`seed`,0,-0x38d7ea4c68000,0x38d7ea4c68000),d.idPrefix??`pele`),b=Math.round(m*1.5),x=(e,t)=>{let n=a(e,!1,h,m,se);return{text:e,label:n,w:n.width+2*ce,h:Math.max(n.height,b)+2*le,overflow:t}},S=e=>{let t=L.get(e),n=a(t[0],!1,h,f,4e3,1),r=[];if(_)for(let e of[t[1],t[2]])e&&r.push(a(e,!1,h,p,4e3,2));let i=l.domains.get(e)?.items??[],o=e===`confusion`&&i.length>oe?oe:i.length,s=[];for(let e=0;e<o;e++)s.push(x(i[e].label,!1));o<i.length&&s.push(x(`+${i.length-o} more`,!0));let c=n.width,u=n.height;for(let e of r)c=Math.max(c,e.width),u+=e.height;s.length>0&&(u+=ue-R);for(let e of s)c=Math.max(c,e.w),u+=R+e.h;return{name:e,title:n,subtitles:r,badges:s,w:c,h:u,cx:0,cy:0}},C=I.map(([e])=>S(e)),w=S(`confusion`),T=Math.max(88,w.w*.71+8),E=Math.max(64,w.h*.71+6),D=B(u,`width`,640,100,1e4)/2,O=B(u,`height`,440,100,1e4)/2;for(let e of C)D=Math.max(D,e.w+2*de),O=Math.max(O,e.h+2*de);for(let e of C){let t=(D-e.w)/2,n=(O-e.h)/2;if((t/(T+z))**2+(n/(E+z))**2>=1)continue;let r=e.w+2*(T+z),i=e.h+2*(E+z);r*O<=D*i?D=Math.max(D,r):O=Math.max(O,i)}let k=a(l.title,!1,h,f,4e3,1),V=k.height>0?k.height+12:0,H=2*D,fe=2*O,U=g,W=g+V,G=U+D,K=W+O,q=U+H,pe=W+fe,J=j(W,K,G,y,v,{...re,segments:4,pinEnd:!0}),Y=j(U,G,K,y+100,v,{...A,segments:4,pinEnd:!0}),X=j(G,q,K,y+200,v,{...A,segments:4,pinStart:!0}),Z=ie(G,K,pe,H*.03),Q=(e,t)=>t?`${o(e[e.length-2])},${o(e[e.length-1])}`:`${o(e[0])},${o(e[1])}`,me=new Map([[`complex`,`M${o(U)},${o(W)}L${Q(J,!1)}${M(J)}${N(Y)}Z`],[`complicated`,`M${Q(J,!1)}L${o(q)},${o(W)}L${Q(X,!0)}${N(X)}${N(J)}Z`],[`chaotic`,`M${Q(Y,!1)}${M(Y)}${M(Z)}L${o(U)},${o(pe)}Z`],[`clear`,`M${Q(X,!1)}${M(X)}L${o(q)},${o(pe)}L${Q(Z,!0)}${N(Z)}Z`]]),he=``;for(let[e,,,n]of I)he+=`<path class="pele-cynefin-region" data-id="${e}" d="${me.get(e)}" fill="${t(n)}" fill-opacity="0.14"/>`;let ge=`<g class="pele-cynefin-boundaries" fill="none" stroke="var(--_b)" stroke-dasharray="6 3"><path d="${P(J)}"/><path d="${P(Y)}"/><path d="${P(X)}"/><path class="pele-cynefin-cliff" d="${P(Z)}" stroke="var(--_l)" stroke-width="2" stroke-dasharray="none" stroke-linecap="round"/></g>`,_e=F(G,K,T,E),ve=`<path d="${_e}" fill="var(--_bg)"/><path class="pele-cynefin-region" data-id="confusion" d="${_e}" fill="${t(ae)}" fill-opacity="0.18" stroke="var(--_b)" stroke-dasharray="4 2"/>`,ye=e=>{let t=e.cy-e.h/2,a=r(e.title,e.cx,t+e.title.height/2,` class="pele-label" font-weight="var(--_hw)"`);t+=e.title.height;for(let n of e.subtitles)a+=r(n,e.cx,t+n.height/2,` class="pele-cynefin-subtitle" font-size="${p}" font-style="italic" fill="var(--_m)"`),t+=n.height;t+=ue-R;for(let s of e.badges)t+=R,a+=`<g class="pele-node${s.overflow?` pele-cynefin-overflow`:``}"${s.overflow?``:` data-id="${n(s.text)}"`}><rect x="${o(e.cx-s.w/2)}" y="${o(t)}" width="${o(s.w)}" height="${o(s.h)}" fill="var(--_bg)" stroke="var(--_b)"${s.overflow?` stroke-dasharray="3 2"`:``}${i}/>`+r(s.label,e.cx,t+s.h/2,` class="pele-label" font-size="${m}"${s.overflow?` fill="var(--_m)"`:``}`,ee)+`</g>`,t+=s.h;return`<g class="pele-cynefin-domain" data-id="${e.name}">${a}</g>`},$=new Map,be=``;I.forEach(([e,t,n],r)=>{let i=C[r];i.cx=U+D*(t+.5),i.cy=W+O*(n+.5),$.set(e,i),be+=ye(i)}),w.cx=G,w.cy=K,$.set(`confusion`,w),be+=ye(w);let xe=(e,t,n)=>e===w?((t-G)/(T+4))**2+((n-K)/(E+4))**2<=1:Math.abs(t-e.cx)<=e.w/2+8&&Math.abs(n-e.cy)<=e.h/2+8,Se=``,Ce=new Map;for(let e of l.transitions){let t=$.get(e.from),n=$.get(e.to);if(!t||!n||t===n)continue;let i=e.from<e.to?`${e.from} ${e.to}`:`${e.to} ${e.from}`,l=Ce.get(i)??0;Ce.set(i,l+1);let u=n.cx-t.cx,d=n.cy-t.cy,f=Math.hypot(u,d)||1,m=(t.cx+n.cx)/2,g=(t.cy+n.cy)/2,_=-d*(m-G)+u*(g-K)>=0?1:-1,v=-d/f*_,y=u/f*_,b=(t!==w&&n!==w&&Math.abs(u)>1&&Math.abs(d)>1?2*(Math.hypot(T*v,E*y)+16):f*.15)+l*56,x=m+v*b,S=g+y*b,C=e=>{let r=1-e;return[r*r*t.cx+2*r*e*x+e*e*n.cx,r*r*t.cy+2*r*e*S+e*e*n.cy]},te=(e,t,n,r)=>{for(let i=0;i<16;i++){let i=(t+n)/2;xe(e,...C(i))===r?t=i:n=i}return(t+n)/2},D=1;for(;D<=48&&xe(t,...C(D/48));)D++;if(D>48)continue;let O=te(t,(D-1)/48,D/48,!0);for(;D<=48&&!xe(n,...C(D/48));)D++;let k=D>48?1:te(n,(D-1)/48,D/48,!1),[ne,re]=C(O),[A,j]=C(k),ie=(e,t,n)=>(1-O)*(1-k)*e+((1-O)*k+O*(1-k))*t+O*k*n,M=ie(t.cx,x,n.cx),N=ie(t.cy,S,n.cy),P=Math.hypot(A-M,j-N)||1,F=(A-M)/P,I=(j-N)/P,ae=c(`arrow_point`,A,j,F,I,`var(--_l)`);A-=F*s(`arrow_point`),j-=I*s(`arrow_point`);let L=``;if(e.label){let t=a(e.label,!1,h,p,se),[n,i]=C((O+k)/2),o=Math.abs(v)*t.width/2+Math.abs(y)*t.height/2+6,s=t.width/2+4,c=Math.min(Math.max(n+v*o,U+s),Math.max(q-s,U+s));L=r(t,c,i+y*o,` class="pele-edge-label" font-size="${p}"`,ee)}Se+=`<g class="pele-edge" data-id="${e.from}-${e.to}"><path d="M${o(ne)},${o(re)}Q${o(M)},${o(N)} ${o(A)},${o(j)}" fill="none" stroke="var(--_l)"/>`+ae+L+`</g>`}let we=Math.ceil(Math.max(H,k.width)+2*g),Te=Math.ceil(fe+V+2*g),Ee=r(k,U+H/2,g+k.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g class="pele-cynefin-regions">${he}</g>`+ge+ve+be+(Se?`<g class="pele-edges">${Se}</g>`:``);return{svg:e(`cynefin`,we,Te,f,d,l,Ee),width:we,height:Te,links:[]}}var H={type:`cynefin`,parse:(e,t,n)=>T(D(e),n),render:V};export{H as cynefin};
@@ -1,9 +1,9 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DIGvaVgJ.js","./BxTFtVqu.js","./yxd8jSz3.js","./Cq5C893B.js","./C6Btt2Xs.js","./DtbnBenW.js","./D_aBVMvK.js","./Bbt0DTmZ.js","./K_3X9lyC.js","./BBU5FdEo.js","./CDAjAYjS.js","./_rHYGvON.js","./DeazQJkV.js","./NgkOM4d0.js","./Bffqt7tx.js","./BWonG38x.js","./BEHa2uNW.js","./BPW39P52.js","./Ds8Pkiic.js","./CPF5uNy5.js","./DLa7NjNO.js","./DXiLM1-G.js","./CygcOYNo.js","./GwMd3KmG.js","./Cp5ooBfH.js","./Bu8mWwtz.js","./BBhr3bLI.js","./CMN7rSZK.js"])))=>i.map(i=>d[i]);
2
- import{vt as e}from"./CxEu-Di8.js";import{t}from"./CRzLMJPS.js";import{A as n,B as r,C as i,D as a,F as o,J as s,M as c,O as l,Q as u,S as d,Y as f,_ as p,a as m,b as h,bt as ee,c as te,d as ne,g as re,gt as g,ht as ie,i as ae,j as oe,k as se,lt as _,mt as v,o as y,p as ce,s as le,vt as ue,yt as b}from"./BxTFtVqu.js";import{t as de}from"./yxd8jSz3.js";var fe=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[v.contextHash,r]]}addChild(e,t){e.prop(v.contextHash)!=this.hash&&(e=new b(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new b(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new b(g.none,e,t,n,this.hashProp)})}},x;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(x||={});var pe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},me=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return C(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function he(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==x.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=x.BulletList||be(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var ge={[x.Blockquote](e,t,n){return n.next==62&&(n.markers.push(I(x.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(S(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[x.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[x.OrderedList]:he,[x.BulletList]:he,[x.Document](){return!0}};function S(e){return e==32||e==9||e==10||e==13}function C(e,t=0){for(;t<e.length&&S(e.charCodeAt(t));)t++;return t}function _e(e,t,n){for(;t>n&&S(e.charCodeAt(t-1));)t--;return t}function ve(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function ye(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function be(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!S(n))return-1}return n&&e.next==45&&Ce(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Ae.SetextHeading)>-1||r<3?-1:1}function xe(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||S(e.text.charCodeAt(e.pos+1)))&&(!n||xe(t,x.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!S(e.text.charCodeAt(r+1))||n&&!xe(t,x.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function Se(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function Ce(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&S(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,we=/-->/,Te=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,we],[/^\s*<\?/,Te],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function Ee(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function De(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function O(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==x.CodeText?e[r].to=n:e.push(I(x.CodeText,t,n))}var k={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(O(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){O(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==x.CodeText?O(o,e.from,e.to):o.push(e);s=[]}O(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&O(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=x.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(x.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ve(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=_e(t.text,t.text.length,o),c=[I(x.CodeMark,r,r+a)];o<s&&c.push(I(x.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&O(c,e.lineStart-1,e.lineStart),c.push(I(x.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(O(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(O(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(x.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=ye(t);return n<0?!1:(e.startContext(x.Blockquote,t.pos),e.addNode(x.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(be(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(x.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=x.BulletList&&e.startContext(x.BulletList,t.basePos,t.next);let r=De(t,t.pos+1);return e.startContext(x.ListItem,t.basePos,r-t.baseIndent),e.addNode(x.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=x.OrderedList&&e.startContext(x.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=De(t,t.pos+n);return e.startContext(x.ListItem,t.basePos,r-t.baseIndent),e.addNode(x.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=Se(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=_e(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!S(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(x.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(x.HeaderMark,o-r,a-r);let c=s.finish(x.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Ee(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==we?x.CommentBlock:i==Te?x.ProcessingInstructionBlock:x.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Oe=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DIGvaVgJ.js","./BxTFtVqu.js","./yxd8jSz3.js","./Cq5C893B.js","./C6Btt2Xs.js","./DtbnBenW.js","./D_aBVMvK.js","./Bbt0DTmZ.js","./K_3X9lyC.js","./C74H8jNb.js","./CDAjAYjS.js","./_rHYGvON.js","./DqnDX3G8.js","./BF1TezEe.js","./Bffqt7tx.js","./BWonG38x.js","./BEHa2uNW.js","./BPW39P52.js","./Ds8Pkiic.js","./CPF5uNy5.js","./DLa7NjNO.js","./DXiLM1-G.js","./CygcOYNo.js","./GwMd3KmG.js","./Cp5ooBfH.js","./Bu8mWwtz.js","./y0C1JQ1v.js","./C4SqDe8e.js"])))=>i.map(i=>d[i]);
2
+ import{yt as e}from"./Cz6kYWmu.js";import{t}from"./CRzLMJPS.js";import{A as n,B as r,C as i,D as a,F as o,J as s,M as c,O as l,Q as u,S as d,Y as f,_ as p,a as m,b as h,bt as ee,c as te,d as ne,g as re,gt as g,ht as ie,i as ae,j as oe,k as se,lt as _,mt as v,o as y,p as ce,s as le,vt as ue,yt as b}from"./BxTFtVqu.js";import{t as de}from"./yxd8jSz3.js";var fe=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[v.contextHash,r]]}addChild(e,t){e.prop(v.contextHash)!=this.hash&&(e=new b(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new b(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new b(g.none,e,t,n,this.hashProp)})}},x;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(x||={});var pe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},me=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return C(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function he(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==x.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=x.BulletList||be(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var ge={[x.Blockquote](e,t,n){return n.next==62&&(n.markers.push(I(x.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(S(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[x.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[x.OrderedList]:he,[x.BulletList]:he,[x.Document](){return!0}};function S(e){return e==32||e==9||e==10||e==13}function C(e,t=0){for(;t<e.length&&S(e.charCodeAt(t));)t++;return t}function _e(e,t,n){for(;t>n&&S(e.charCodeAt(t-1));)t--;return t}function ve(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function ye(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function be(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!S(n))return-1}return n&&e.next==45&&Ce(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Ae.SetextHeading)>-1||r<3?-1:1}function xe(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||S(e.text.charCodeAt(e.pos+1)))&&(!n||xe(t,x.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!S(e.text.charCodeAt(r+1))||n&&!xe(t,x.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function Se(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function Ce(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&S(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,we=/-->/,Te=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,we],[/^\s*<\?/,Te],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function Ee(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function De(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function O(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==x.CodeText?e[r].to=n:e.push(I(x.CodeText,t,n))}var k={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(O(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){O(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==x.CodeText?O(o,e.from,e.to):o.push(e);s=[]}O(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&O(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=x.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(x.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ve(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=_e(t.text,t.text.length,o),c=[I(x.CodeMark,r,r+a)];o<s&&c.push(I(x.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&O(c,e.lineStart-1,e.lineStart),c.push(I(x.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(O(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(O(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(x.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=ye(t);return n<0?!1:(e.startContext(x.Blockquote,t.pos),e.addNode(x.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(be(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(x.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=x.BulletList&&e.startContext(x.BulletList,t.basePos,t.next);let r=De(t,t.pos+1);return e.startContext(x.ListItem,t.basePos,r-t.baseIndent),e.addNode(x.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=x.OrderedList&&e.startContext(x.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=De(t,t.pos+n);return e.startContext(x.ListItem,t.basePos,r-t.baseIndent),e.addNode(x.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=Se(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=_e(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!S(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(x.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(x.HeaderMark,o-r,a-r);let c=s.finish(x.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Ee(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==we?x.CommentBlock:i==Te?x.ProcessingInstructionBlock:x.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Oe=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
3
3
  `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&C(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,I(x.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Ue(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(I(x.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Ve(e,C(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=C(e,this.pos),n=0;if(t>this.pos){let r=He(e,t,this.start);if(r){let t=A(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=A(e,this.pos),n>0&&n<e.length?n:-1}else return A(e,this.pos)}};function A(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!S(n))return-1}return t}var ke=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:Ce(t),i=t.next;if(r<0)return!1;let a=I(x.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,I(i==61?x.SetextHeading1:x.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},Ae={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Oe(t):null},SetextHeading(){return new ke}},je=[(e,t)=>Se(t)>=0,(e,t)=>ve(t)>=0,(e,t)=>ye(t)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>T(t,e,!0)>=0,(e,t)=>be(t,e,!0)>=0,(e,t)=>Ee(t,e,!0)>=0],Me={text:``,end:0},Ne=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new me,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=fe.create(x.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Ge(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new pe(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
4
4
  `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Ke(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Me;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+x[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
5
5
  `?``:t;else{let e=t.indexOf(`
6
6
  `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=fe.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new b(this.parser.nodeSet.types[e],P,P,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(G(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Pe(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=G(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(x.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?I(this.parser.getNodeType(e),t,n,r):new Re(e,t)}get buffer(){return new Le(this.parser.nodeSet)}};function Pe(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=Pe(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new b(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var Fe=class e extends ue{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Ne(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let r=M(t);if(!r)return this;let{nodeSet:i,skipContextMarkup:a}=this,o=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),c=this.blockNames.slice(),u=this.inlineParsers.slice(),d=this.inlineNames.slice(),f=this.endLeafBlock.slice(),p=this.wrappers;if(j(r.defineNodes)){a=Object.assign({},a);let e=i.types.slice(),t;for(let n of r.defineNodes){let{name:r,block:i,composite:o,style:s}=typeof n==`string`?{name:n}:n;if(e.some(e=>e.name==r))continue;o&&(a[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,u=o?[`Block`,`BlockContext`]:i?c>=x.ATXHeading1&&c<=x.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(g.define({id:c,name:r,props:u&&[[v.group,u]]})),s&&(t||={},Array.isArray(s)||s instanceof l?t[r]=s:Object.assign(t,s))}i=new ie(e),t&&(i=i.extend(n(t)))}if(j(r.props)&&(i=i.extend(...r.props)),j(r.remove))for(let e of r.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(o[t]=s[t]=void 0),n>-1&&(u[n]=void 0)}if(j(r.parseBlock))for(let e of r.parseBlock){let t=c.indexOf(e.name);if(t>-1)o[t]=e.parse,s[t]=e.leaf;else{let t=e.before?N(c,e.before):e.after?N(c,e.after)+1:c.length-1;o.splice(t,0,e.parse),s.splice(t,0,e.leaf),c.splice(t,0,e.name)}e.endLeaf&&f.push(e.endLeaf)}if(j(r.parseInline))for(let e of r.parseInline){let t=d.indexOf(e.name);if(t>-1)u[t]=e.parse;else{let t=e.before?N(d,e.before):e.after?N(d,e.after)+1:d.length-1;u.splice(t,0,e.parse),d.splice(t,0,e.name)}}return r.wrap&&(p=p.concat(r.wrap)),new e(i,o,s,c,f,a,u,d,p)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new W(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function j(e){return e!=null&&e.length>0}function M(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=M(e[0]);if(e.length==1)return t;let n=M(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||P).concat(t||P),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function N(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Ie=[g.none];for(let e=1,t;t=x[e];e++)Ie[e]=g.define({id:e,name:t,props:e>=x.Escape?[]:[[v.group,e in ge?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var P=[],Le=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return b.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},F=class{constructor(e,t,n,r=P){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new Le(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Re=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return P}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function I(e,t,n,r){return new F(e,t,n,r)}var L={resolve:`Emphasis`,mark:`EmphasisMark`},R={resolve:`Emphasis`,mark:`EmphasisMark`},z={},B={},V=class{constructor(e,t,n,r,i=n-t){this.type=e,this.from=t,this.to=n,this.side=r,this.size=i}},ze=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,H=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{H=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var U={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(ze.charCodeAt(t)==r)return e.append(I(x.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(I(x.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(I(x.InlineCode,n,r+1,[I(x.CodeMark,n,n+i),I(x.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(I(x.Autolink,n,n+1+i[0].length,[I(x.LinkMark,n,n+1),I(x.URL,n+1,n+i[0].length),I(x.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(I(x.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(I(x.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(I(x.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=H.test(i),s=H.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new V(t==95?L:R,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(I(x.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(I(x.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new V(z,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new V(B,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof V&&(r.type==z||r.type==B)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=Be(e,i,r.type==z?x.Link:x.Image,r.from,n+1);if(r.type==z)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof V&&t.type==z&&(t.side=0)}return a.to}}return-1}};function Be(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(I(x.LinkMark,r,r+(n==x.Image?2:1))),t.push(I(x.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=Ve(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=He(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(I(x.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(I(x.LinkMark,n,s)))}else if(o==91){let n=Ue(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return I(n,r,s,t)}function Ve(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return I(x.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(S(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?I(x.URL,t+n,i+n):i==e.length&&null}}function He(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return I(x.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function Ue(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return!r&&I(x.LinkLabel,t+n,a+1+n);else{if(r&&!S(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var W=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new V(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof V&&(t.type==z||t.type==B))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof V&&n.type.resolve&&n.side&2))continue;let r=n.type==L||n.type==R,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof V&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.size+n.size)%3==0&&(e.size%3||n.size%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof F&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new V(a.type,a.from,l,a.side,a.size):null,(this.parts[t]=r&&n.to!=u?new V(n.type,u,n.to,n.side,n.size):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof F&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof V&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof V?t:null}skipSpace(e){return C(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?I(this.parser.getNodeType(e),t,n,r):new Re(e,t)}};W.linkStart=z,W.imageStart=B,W.emphasisAsterisk=R,W.emphasisUnderscore=L;function G(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof F&&(n[r]=new F(t.type,t.from,t.to,G(t.children,[e])))}else n.splice(r++,0,e)}return n}var We=[x.CodeBlock,x.ListItem,x.OrderedList,x.BulletList],Ge=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
7
- `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(v.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r||t.to-n>e.to){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=Ke(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new b(e.parser.nodeSet.types[x.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(We.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function Ke(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var qe=n({"Blockquote/...":c.quote,HorizontalRule:c.contentSeparator,"ATXHeading1/... SetextHeading1/...":c.heading1,"ATXHeading2/... SetextHeading2/...":c.heading2,"ATXHeading3/...":c.heading3,"ATXHeading4/...":c.heading4,"ATXHeading5/...":c.heading5,"ATXHeading6/...":c.heading6,"Comment CommentBlock":c.comment,Escape:c.escape,Entity:c.character,"Emphasis/...":c.emphasis,"StrongEmphasis/...":c.strong,"Link/... Image/...":c.link,"OrderedList/... BulletList/...":c.list,"BlockQuote/...":c.quote,"InlineCode CodeText":c.monospace,"URL Autolink":c.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":c.processingInstruction,"CodeInfo LinkLabel":c.labelName,LinkTitle:c.string,Paragraph:c.content}),Je=new Fe(new ie(Ie).extend(qe),Object.keys(k).map(e=>k[e]),Object.keys(k).map(e=>Ae[e]),Object.keys(k),je,ge,Object.keys(U).map(e=>U[e]),Object.keys(U),[]);function Ye(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function Xe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:ee((e,r)=>{let i=e.type.id;if(t&&(i==x.CodeBlock||i==x.FencedCode)){let n=``;if(i==x.FencedCode){let t=e.node.getChild(x.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==x.CodeText,bracketed:i==x.FencedCode}}else if(n&&(i==x.HTMLBlock||i==x.HTMLTag||i==x.CommentBlock))return{parser:n,overlay:Ye(e.node,e.from,e.to)};return null})}}var Ze={resolve:`Strikethrough`,mark:`StrikethroughMark`},Qe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":c.strikethrough}},{name:`StrikethroughMark`,style:c.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=H.test(r),c=H.test(i);return e.addDelimiter(Ze,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function K(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function $e(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var et=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,tt=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&et.test(r=t.text.slice(t.pos))){let i=[];K(e,n.content,0,i,n.start)==K(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];K(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},nt={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":c.heading}},`TableRow`,{name:`TableCell`,style:c.content},{name:`TableDelimiter`,style:c.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return $e(t.content,0)?new tt:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof tt)||!$e(t.text,t.basePos))return!1;let r=e.peekLine();return et.test(r)&&K(e,t.text,t.basePos)==K(e,r,t.basePos)},before:`SetextHeading`}]},rt=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},it={defineNodes:[{name:`Task`,block:!0,style:c.list},{name:`TaskMarker`,style:c.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new rt:null},after:`SetextHeading`}]},at=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ot=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,st=/[\w-]+\.[\w-]+($|[/:])/,ct=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,lt=/\/[a-zA-Z\d@.]+/gy;function ut(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function dt(e,t){ot.lastIndex=t;let n=ot.exec(e);if(!n||st.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&ut(e,t,r,`)`)>ut(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ft(e,t){ct.lastIndex=t;let n=ct.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var pt=[nt,it,Qe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;at.lastIndex=r;let i=at.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=dt(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ft(e.text,r):(a=ft(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(lt.lastIndex=a,i=lt.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function mt(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),S(s))break}return-1}}var ht={defineNodes:[{name:`Superscript`,style:c.special(c.content)},{name:`SuperscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Superscript`,parse:mt(94,`Superscript`,`SuperscriptMark`)}]},gt={defineNodes:[{name:`Subscript`,style:c.special(c.content)},{name:`SubscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Subscript`,parse:mt(126,`Subscript`,`SubscriptMark`)}]},_t={defineNodes:[{name:`Emoji`,style:c.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},vt=e({html:()=>q,htmlCompletionSource:()=>St}),yt=g.define({id:0,name:`Document`,top:!0}),bt=class extends ue{createParse(e,t,n){let r=n[0]?.from??0,i=n[n.length-1]?.to??e.length;return{parsedPos:i,stoppedAt:null,stopAt(){},advance:()=>new b(yt,[],[],i-r)}}},xt=new ae(ne(),new bt,[],`html`);function q(e){return new y(xt)}function St(){return null}var Ct=e({commonmarkLanguage:()=>At,deleteMarkupBackward:()=>Ut,insertNewlineContinueMarkup:()=>Rt,insertNewlineContinueMarkupCommand:()=>Lt,markdown:()=>Kt,markdownKeymap:()=>Wt,markdownLanguage:()=>X,pasteURLAsLink:()=>Zt}),wt=ne({commentTokens:{block:{open:`<!--`,close:`-->`}}}),Tt=new v,Et=Je.configure({props:[re.add(e=>!e.is(`Block`)||e.is(`Document`)||J(e)!=null||Dt(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Tt.add(J),h.add({Document:()=>null}),i.add({Document:wt})]});function J(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Dt(e){return e.name==`OrderedList`||e.name==`BulletList`}function Ot(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=J(e.type))!=null&&r<=t)break;n=e}return n.to}var kt=p.of((e,t,n)=>{for(let r=a(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(Tt);if(e==null)continue;let t=Ot(r,e);if(t>n)return{from:n,to:t}}return null});function Y(e){return new ae(wt,e,[],`markdown`)}var At=Y(Et),X=Y(Et.configure([pt,gt,ht,_t,{props:[re.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function jt(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):m.matchLanguageName(e,n,!0),t instanceof m)return t.support?t.support.language.parser:le.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var Mt=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+Pt(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Nt(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new Mt(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new Mt(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new Mt(i.parent,s,s+t,a[1],e,n,i))}}return r}function Pt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Ft(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Pt(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function It(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(d)!=` `)return e;let r=_(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var Lt=(e={})=>({state:t,dispatch:n})=>{let r=a(t),{doc:i}=t,o=null,c=t.changeByRange(n=>{if(!n.empty||!X.isActiveAt(t,n.from,-1)&&!X.isActiveAt(t,n.from,1))return o={range:n};let a=n.from,c=i.lineAt(a),l=Nt(r.resolveInner(a,-1),i);for(;l.length&&l[l.length-1].from>a-c.from;)l.pop();if(!l.length)return o={range:n};let u=l[l.length-1];if(u.to-u.spaceAfter.length>a-c.from)return o={range:n};let d=a>=u.to-u.spaceAfter.length&&!/\S/.test(c.text.slice(u.to));if(u.item&&d){if(u.item.from<c.from&&!/^[\s>]*$/.test(c.text.slice(0,u.to)))return o={range:n};let r=u.node.firstChild,d=u.node.getChild(`ListItem`,`ListItem`);if(r.to>=a||d&&d.to<a||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||e.nonTightLists===!1){let e=l.length>1?l[l.length-2]:null,t,n=``;e&&e.item?(t=c.from+e.from,n=e.marker(i,1)):t=c.from+(e?e.to:0);let r=[{from:t,to:a,insert:n}];return u.node.name==`OrderedList`&&Ft(u.item,i,r,-2),e&&e.node.name==`OrderedList`&&Ft(e.item,i,r),{range:s.cursor(t+n.length),changes:r}}{let e=Vt(l,t,c);return{range:s.cursor(a+e.length+1),changes:{from:c.from,insert:e+t.lineBreak}}}}if(u.node.name==`Blockquote`&&d&&c.from){let e=i.lineAt(c.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==u.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:c.from+u.from,to:c.to}]);return{range:n.map(i),changes:i}}}let f=[];u.node.name==`OrderedList`&&Ft(u.item,i,f);let p=u.item&&u.item.from<c.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=u.to)for(let e=0,t=l.length-1;e<=t;e++)m+=e==t&&!p?l[e].marker(i,1):l[e].blank(e<t?_(c.text,4,l[e+1].from)-m.length:null);let h=a;for(;h>c.from&&/\s/.test(c.text.charAt(h-c.from-1));)h--;return m=It(m,t),Bt(u.node,t.doc)&&(m=Vt(l,t,c)+t.lineBreak+m),f.push({from:h,to:a,insert:t.lineBreak+m}),{range:s.cursor(h+m.length+1),changes:f}});return!o&&(n(t.update(c,{scrollIntoView:!0,userEvent:`input`})),!0)},Rt=Lt();function zt(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Bt(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function Vt(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?_(n.text,4,e[t+1].from)-r.length:null,t<i);return It(r,t)}function Ht(e,t){let n=e.resolveInner(t,-1),r=t;zt(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(zt(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var Ut=({state:e,dispatch:t})=>{let n=a(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&X.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Nt(Ht(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:s.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(n.item&&t.from<=n.item.from||/^[\s>]*$/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(_(t.text,4,n.to)-_(t.text,4,n.from));return r==t.from&&(i=It(i,e)),{range:s.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:s.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},Wt=[{key:`Enter`,run:Rt},{key:`Backspace`,run:Ut}],Gt=q({matchClosingTags:!1});function Kt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:i=!0,base:{parser:a}=At,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:c=Gt}=e;if(!(a instanceof Fe))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],d=[c.support,kt],f;s&&d.push(Zt),n instanceof y?(d.push(n.support),f=n.language):n&&(f=n);let p=t||f?jt(t,f):void 0;l.push(Xe({codeParser:p,htmlParser:c.language.parser})),i&&d.push(u.high(r.of(Wt)));let m=Y(a.configure(l));return o&&d.push(m.data.of({autocomplete:qt})),new y(m,d)}function qt(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=a(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:Yt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var Jt=null;function Yt(){if(Jt)return Jt;let e=St(new de(f.create({extensions:Gt}),0,!0));return Jt=e?e.options:[]}var Xt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Zt=o.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!X.isActiveAt(t.state,n.from,1)))return!1;let i=a(t.state),o=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||Xt.test(e.name))&&(o=!0)},leave:e=>{e.to<n.to&&(o=!0)}}),!o&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function Z(e){return new y(te.define(e))}function Q(e){return t(()=>import(`./DIGvaVgJ.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2,3]),import.meta.url)}var Qt=[m.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return t(()=>import(`./C6Btt2Xs.js`).then(e=>e.cpp()),__vite__mapDeps([4,1,3]),import.meta.url)}}),m.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return t(()=>import(`./C6Btt2Xs.js`).then(e=>e.cpp()),__vite__mapDeps([4,1,3]),import.meta.url)}}),m.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return Q(`Cassandra`)}}),m.of({name:`CSS`,extensions:[`css`],load(){return t(()=>import(`./DtbnBenW.js`).then(e=>e.css()),__vite__mapDeps([5,1,3]),import.meta.url)}}),m.of({name:`Go`,extensions:[`go`],load(){return t(()=>import(`./D_aBVMvK.js`).then(e=>e.go()),__vite__mapDeps([6,1,2,3]),import.meta.url)}}),m.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return t(()=>Promise.resolve().then(()=>vt).then(e=>e.html()),void 0,import.meta.url)}}),m.of({name:`Java`,extensions:[`java`],load(){return t(()=>import(`./Bbt0DTmZ.js`).then(e=>e.java()),__vite__mapDeps([7,1,3]),import.meta.url)}}),m.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript()),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return t(()=>import(`./BBU5FdEo.js`).then(e=>e.jinja()),__vite__mapDeps([9,1,3]),import.meta.url)}}),m.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return t(()=>import(`./CDAjAYjS.js`).then(e=>e.json()),__vite__mapDeps([10,1,3]),import.meta.url)}}),m.of({name:`JSX`,extensions:[`jsx`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`LESS`,extensions:[`less`],load(){return t(()=>import(`./_rHYGvON.js`).then(e=>e.less()),__vite__mapDeps([11,1,3,5]),import.meta.url)}}),m.of({name:`Liquid`,extensions:[`liquid`],load(){return t(()=>import(`./DeazQJkV.js`).then(e=>e.liquid()),__vite__mapDeps([12,1,3]),import.meta.url)}}),m.of({name:`MariaDB SQL`,load(){return Q(`MariaSQL`)}}),m.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return t(()=>Promise.resolve().then(()=>Ct).then(e=>e.markdown()),void 0,import.meta.url)}}),m.of({name:`MS SQL`,load(){return Q(`MSSQL`)}}),m.of({name:`MySQL`,load(){return Q(`MySQL`)}}),m.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return t(()=>import(`./NgkOM4d0.js`).then(e=>e.php()),__vite__mapDeps([13,1,3]),import.meta.url)}}),m.of({name:`PLSQL`,extensions:[`pls`],load(){return Q(`PLSQL`)}}),m.of({name:`PostgreSQL`,load(){return Q(`PostgreSQL`)}}),m.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return t(()=>import(`./Bffqt7tx.js`).then(e=>e.python()),__vite__mapDeps([14,1,2,3]),import.meta.url)}}),m.of({name:`Rust`,extensions:[`rs`],load(){return t(()=>import(`./BWonG38x.js`).then(e=>e.rust()),__vite__mapDeps([15,1,3]),import.meta.url)}}),m.of({name:`Sass`,extensions:[`sass`],load(){return t(()=>import(`./BEHa2uNW.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([16,1,3,5]),import.meta.url)}}),m.of({name:`SCSS`,extensions:[`scss`],load(){return t(()=>import(`./BEHa2uNW.js`).then(e=>e.sass()),__vite__mapDeps([16,1,3,5]),import.meta.url)}}),m.of({name:`SQL`,extensions:[`sql`],load(){return Q(`StandardSQL`)}}),m.of({name:`SQLite`,load(){return Q(`SQLite`)}}),m.of({name:`TSX`,extensions:[`tsx`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return t(()=>import(`./BPW39P52.js`).then(e=>e.wast()),__vite__mapDeps([17,1,3]),import.meta.url)}}),m.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return t(()=>import(`./Ds8Pkiic.js`).then(e=>e.xml()),__vite__mapDeps([18,1,3]),import.meta.url)}}),m.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return t(()=>import(`./CPF5uNy5.js`).then(e=>e.yaml()),__vite__mapDeps([19,1,3]),import.meta.url)}}),m.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return t(()=>import(`./gfMMiTNf.js`).then(e=>Z(e.apl)),[],import.meta.url)}}),m.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return t(()=>import(`./C_eisQCp.js`).then(e=>Z(e.asciiArmor)),[],import.meta.url)}}),m.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return t(()=>import(`./DCl_8MCW.js`).then(e=>Z(e.asn1({}))),[],import.meta.url)}}),m.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return t(()=>import(`./BEn0Cwpx.js`).then(e=>Z(e.asterisk)),[],import.meta.url)}}),m.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return t(()=>import(`./D5EjA2JK.js`).then(e=>Z(e.brainfuck)),[],import.meta.url)}}),m.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return t(()=>import(`./DHLQUbN7.js`).then(e=>Z(e.cobol)),[],import.meta.url)}}),m.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.csharp)),[],import.meta.url)}}),m.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`ClojureScript`,extensions:[`cljs`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return t(()=>import(`./CnaYoQib.js`).then(e=>Z(e.gss)),[],import.meta.url)}}),m.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return t(()=>import(`./84nbDH0I.js`).then(e=>Z(e.cmake)),[],import.meta.url)}}),m.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return t(()=>import(`./De_zI4J0.js`).then(e=>Z(e.coffeeScript)),[],import.meta.url)}}),m.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return t(()=>import(`./DgAKBe0r.js`).then(e=>Z(e.commonLisp)),[],import.meta.url)}}),m.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return t(()=>import(`./p9eYesGn.js`).then(e=>Z(e.cypher)),[],import.meta.url)}}),m.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return t(()=>import(`./B_1Jd8HM.js`).then(e=>Z(e.cython)),[],import.meta.url)}}),m.of({name:`Crystal`,extensions:[`cr`],load(){return t(()=>import(`./Bsdphhtm.js`).then(e=>Z(e.crystal)),[],import.meta.url)}}),m.of({name:`D`,extensions:[`d`],load(){return t(()=>import(`./DWkQyNnU.js`).then(e=>Z(e.d)),[],import.meta.url)}}),m.of({name:`Dart`,extensions:[`dart`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.dart)),[],import.meta.url)}}),m.of({name:`diff`,extensions:[`diff`,`patch`],load(){return t(()=>import(`./ChtP43wD.js`).then(e=>Z(e.diff)),[],import.meta.url)}}),m.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return t(()=>import(`./DLa7NjNO.js`).then(e=>Z(e.dockerFile)),__vite__mapDeps([20,21]),import.meta.url)}}),m.of({name:`DTD`,extensions:[`dtd`],load(){return t(()=>import(`./DTF72YNO.js`).then(e=>Z(e.dtd)),[],import.meta.url)}}),m.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return t(()=>import(`./S7ucR4pR.js`).then(e=>Z(e.dylan)),[],import.meta.url)}}),m.of({name:`EBNF`,load(){return t(()=>import(`./D4c0_ac3.js`).then(e=>Z(e.ebnf)),[],import.meta.url)}}),m.of({name:`ECL`,extensions:[`ecl`],load(){return t(()=>import(`./BVIeWmwY.js`).then(e=>Z(e.ecl)),[],import.meta.url)}}),m.of({name:`edn`,extensions:[`edn`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`Eiffel`,extensions:[`e`],load(){return t(()=>import(`./BEjRio4Q.js`).then(e=>Z(e.eiffel)),[],import.meta.url)}}),m.of({name:`Elm`,extensions:[`elm`],load(){return t(()=>import(`./Cshzl8qu.js`).then(e=>Z(e.elm)),[],import.meta.url)}}),m.of({name:`Erlang`,extensions:[`erl`],load(){return t(()=>import(`./BV0c4Hdn.js`).then(e=>Z(e.erlang)),[],import.meta.url)}}),m.of({name:`Esper`,load(){return t(()=>import(`./DuQMFDvy.js`).then(e=>Z(e.esper)),[],import.meta.url)}}),m.of({name:`Factor`,extensions:[`factor`],load(){return t(()=>import(`./CygcOYNo.js`).then(e=>Z(e.factor)),__vite__mapDeps([22,21]),import.meta.url)}}),m.of({name:`FCL`,load(){return t(()=>import(`./ClOhbFR7.js`).then(e=>Z(e.fcl)),[],import.meta.url)}}),m.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return t(()=>import(`./D6RzAl64.js`).then(e=>Z(e.forth)),[],import.meta.url)}}),m.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return t(()=>import(`./Bt6PBEDR.js`).then(e=>Z(e.fortran)),[],import.meta.url)}}),m.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.fSharp)),[],import.meta.url)}}),m.of({name:`Gas`,extensions:[`s`],load(){return t(()=>import(`./BHEdbvp9.js`).then(e=>Z(e.gas)),[],import.meta.url)}}),m.of({name:`Gherkin`,extensions:[`feature`],load(){return t(()=>import(`./oBAE_ms0.js`).then(e=>Z(e.gherkin)),[],import.meta.url)}}),m.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return t(()=>import(`./CUpZ7dEl.js`).then(e=>Z(e.groovy)),[],import.meta.url)}}),m.of({name:`Haskell`,extensions:[`hs`],load(){return t(()=>import(`./BRsoo5mP.js`).then(e=>Z(e.haskell)),[],import.meta.url)}}),m.of({name:`Haxe`,extensions:[`hx`],load(){return t(()=>import(`./DjVOVvNP.js`).then(e=>Z(e.haxe)),[],import.meta.url)}}),m.of({name:`HXML`,extensions:[`hxml`],load(){return t(()=>import(`./DjVOVvNP.js`).then(e=>Z(e.hxml)),[],import.meta.url)}}),m.of({name:`HTTP`,load(){return t(()=>import(`./CLVgA2GD.js`).then(e=>Z(e.http)),[],import.meta.url)}}),m.of({name:`IDL`,extensions:[`pro`],load(){return t(()=>import(`./BUZw3wgd.js`).then(e=>Z(e.idl)),[],import.meta.url)}}),m.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return t(()=>import(`./Bu8mWwtz.js`).then(e=>Z(e.jsonld)),[],import.meta.url)}}),m.of({name:`Julia`,extensions:[`jl`],load(){return t(()=>import(`./CQfgDRfP.js`).then(e=>Z(e.julia)),[],import.meta.url)}}),m.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.kotlin)),[],import.meta.url)}}),m.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return t(()=>import(`./BXxG0Yva.js`).then(e=>Z(e.liveScript)),[],import.meta.url)}}),m.of({name:`Lua`,extensions:[`lua`],load(){return t(()=>import(`./DPCEkfD_.js`).then(e=>Z(e.lua)),[],import.meta.url)}}),m.of({name:`mIRC`,extensions:[`mrc`],load(){return t(()=>import(`./C9zpzAZU.js`).then(e=>Z(e.mirc)),[],import.meta.url)}}),m.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return t(()=>import(`./u8YMmbU0.js`).then(e=>Z(e.mathematica)),[],import.meta.url)}}),m.of({name:`Modelica`,extensions:[`mo`],load(){return t(()=>import(`./CqHI_q-D.js`).then(e=>Z(e.modelica)),[],import.meta.url)}}),m.of({name:`MUMPS`,extensions:[`mps`],load(){return t(()=>import(`./BSzj6Xyz.js`).then(e=>Z(e.mumps)),[],import.meta.url)}}),m.of({name:`Mbox`,extensions:[`mbox`],load(){return t(()=>import(`./BEMVcqjs.js`).then(e=>Z(e.mbox)),[],import.meta.url)}}),m.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return t(()=>import(`./8H7HVH4w.js`).then(e=>Z(e.nginx)),[],import.meta.url)}}),m.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return t(()=>import(`./GwMd3KmG.js`).then(e=>Z(e.nsis)),__vite__mapDeps([23,21]),import.meta.url)}}),m.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return t(()=>import(`./CzMBulkp.js`).then(e=>Z(e.ntriples)),[],import.meta.url)}}),m.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.objectiveC)),[],import.meta.url)}}),m.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.objectiveCpp)),[],import.meta.url)}}),m.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.oCaml)),[],import.meta.url)}}),m.of({name:`Octave`,extensions:[`m`],load(){return t(()=>import(`./D2Q8cUp1.js`).then(e=>Z(e.octave)),[],import.meta.url)}}),m.of({name:`Oz`,extensions:[`oz`],load(){return t(()=>import(`./BwTct_5T.js`).then(e=>Z(e.oz)),[],import.meta.url)}}),m.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return t(()=>import(`./Dp_KdFgX.js`).then(e=>Z(e.pascal)),[],import.meta.url)}}),m.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return t(()=>import(`./BkSkiI9m.js`).then(e=>Z(e.perl)),[],import.meta.url)}}),m.of({name:`Pig`,extensions:[`pig`],load(){return t(()=>import(`./AF4Hwhju.js`).then(e=>Z(e.pig)),[],import.meta.url)}}),m.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return t(()=>import(`./D8WpQPaX.js`).then(e=>Z(e.powerShell)),[],import.meta.url)}}),m.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return t(()=>import(`./C357ku5U.js`).then(e=>Z(e.properties)),[],import.meta.url)}}),m.of({name:`ProtoBuf`,extensions:[`proto`],load(){return t(()=>import(`./D1ij_kNL.js`).then(e=>Z(e.protobuf)),[],import.meta.url)}}),m.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return t(()=>import(`./Cp5ooBfH.js`).then(e=>Z(e.pug)),__vite__mapDeps([24,25]),import.meta.url)}}),m.of({name:`Puppet`,extensions:[`pp`],load(){return t(()=>import(`./BZyAS7I4.js`).then(e=>Z(e.puppet)),[],import.meta.url)}}),m.of({name:`Q`,extensions:[`q`],load(){return t(()=>import(`./B9NhS7L_.js`).then(e=>Z(e.q)),[],import.meta.url)}}),m.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return t(()=>import(`./CxDmU1I4.js`).then(e=>Z(e.r)),[],import.meta.url)}}),m.of({name:`RPM Changes`,load(){return t(()=>import(`./gpDK5sbt.js`).then(e=>Z(e.rpmChanges)),[],import.meta.url)}}),m.of({name:`RPM Spec`,extensions:[`spec`],load(){return t(()=>import(`./gpDK5sbt.js`).then(e=>Z(e.rpmSpec)),[],import.meta.url)}}),m.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return t(()=>import(`./ChfNwlCY.js`).then(e=>Z(e.ruby)),[],import.meta.url)}}),m.of({name:`SAS`,extensions:[`sas`],load(){return t(()=>import(`./C2OyD2Y6.js`).then(e=>Z(e.sas)),[],import.meta.url)}}),m.of({name:`Scala`,extensions:[`scala`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.scala)),[],import.meta.url)}}),m.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return t(()=>import(`./D9qYN0V5.js`).then(e=>Z(e.scheme)),[],import.meta.url)}}),m.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return t(()=>import(`./DwuoZtxw.js`).then(e=>Z(e.shell)),[],import.meta.url)}}),m.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return t(()=>import(`./tLWDfEkZ.js`).then(e=>Z(e.sieve)),[],import.meta.url)}}),m.of({name:`Smalltalk`,extensions:[`st`],load(){return t(()=>import(`./BLp5-jwC.js`).then(e=>Z(e.smalltalk)),[],import.meta.url)}}),m.of({name:`Solr`,load(){return t(()=>import(`./B78wSQJQ.js`).then(e=>Z(e.solr)),[],import.meta.url)}}),m.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.sml)),[],import.meta.url)}}),m.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return t(()=>import(`./Dz-mlCAC.js`).then(e=>Z(e.sparql)),[],import.meta.url)}}),m.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return t(()=>import(`./CTIncYxj.js`).then(e=>Z(e.spreadsheet)),[],import.meta.url)}}),m.of({name:`Squirrel`,extensions:[`nut`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.squirrel)),[],import.meta.url)}}),m.of({name:`Stylus`,extensions:[`styl`],load(){return t(()=>import(`./BOVgKnng.js`).then(e=>Z(e.stylus)),[],import.meta.url)}}),m.of({name:`Swift`,extensions:[`swift`],load(){return t(()=>import(`./DKB6_1j6.js`).then(e=>Z(e.swift)),[],import.meta.url)}}),m.of({name:`sTeX`,load(){return t(()=>import(`./DNzd62Q_.js`).then(e=>Z(e.stex)),[],import.meta.url)}}),m.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return t(()=>import(`./DNzd62Q_.js`).then(e=>Z(e.stex)),[],import.meta.url)}}),m.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return t(()=>import(`./CjI9Y6RI.js`).then(e=>Z(e.verilog)),[],import.meta.url)}}),m.of({name:`Tcl`,extensions:[`tcl`],load(){return t(()=>import(`./BGfruO1u.js`).then(e=>Z(e.tcl)),[],import.meta.url)}}),m.of({name:`Textile`,extensions:[`textile`],load(){return t(()=>import(`./C4jVoHG1.js`).then(e=>Z(e.textile)),[],import.meta.url)}}),m.of({name:`TiddlyWiki`,load(){return t(()=>import(`./VlUiK86J.js`).then(e=>Z(e.tiddlyWiki)),[],import.meta.url)}}),m.of({name:`Tiki wiki`,load(){return t(()=>import(`./DTszW0OQ.js`).then(e=>Z(e.tiki)),[],import.meta.url)}}),m.of({name:`TOML`,extensions:[`toml`],load(){return t(()=>import(`./BPTmHmyx.js`).then(e=>Z(e.toml)),[],import.meta.url)}}),m.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return t(()=>import(`./C2dAgh7P.js`).then(e=>Z(e.troff)),[],import.meta.url)}}),m.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return t(()=>import(`./PPSTk1ow.js`).then(e=>Z(e.ttcn)),[],import.meta.url)}}),m.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return t(()=>import(`./2b4Gb5sE.js`).then(e=>Z(e.ttcnCfg)),[],import.meta.url)}}),m.of({name:`Turtle`,extensions:[`ttl`],load(){return t(()=>import(`./Cx3rYX2g.js`).then(e=>Z(e.turtle)),[],import.meta.url)}}),m.of({name:`Web IDL`,extensions:[`webidl`],load(){return t(()=>import(`./D5jiJvOU.js`).then(e=>Z(e.webIDL)),[],import.meta.url)}}),m.of({name:`VB.NET`,extensions:[`vb`],load(){return t(()=>import(`./BthdM_4N.js`).then(e=>Z(e.vb)),[],import.meta.url)}}),m.of({name:`VBScript`,extensions:[`vbs`],load(){return t(()=>import(`./D9f6rSsU.js`).then(e=>Z(e.vbScript)),[],import.meta.url)}}),m.of({name:`Velocity`,extensions:[`vtl`],load(){return t(()=>import(`./CqftRsjg.js`).then(e=>Z(e.velocity)),[],import.meta.url)}}),m.of({name:`Verilog`,extensions:[`v`],load(){return t(()=>import(`./CjI9Y6RI.js`).then(e=>Z(e.verilog)),[],import.meta.url)}}),m.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return t(()=>import(`./kS471soi.js`).then(e=>Z(e.vhdl)),[],import.meta.url)}}),m.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return t(()=>import(`./BKJx4mf9.js`).then(e=>Z(e.xQuery)),[],import.meta.url)}}),m.of({name:`Yacas`,extensions:[`ys`],load(){return t(()=>import(`./CXXgtw0p.js`).then(e=>Z(e.yacas)),[],import.meta.url)}}),m.of({name:`Z80`,extensions:[`z80`],load(){return t(()=>import(`./Co3PbHdE.js`).then(e=>Z(e.z80)),[],import.meta.url)}}),m.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.mscgen)),[],import.meta.url)}}),m.of({name:`Xù`,extensions:[`xu`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.xu)),[],import.meta.url)}}),m.of({name:`MsGenny`,extensions:[`msgenny`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.msgenny)),[],import.meta.url)}}),m.of({name:`Vue`,extensions:[`vue`],load(){return t(()=>import(`./BBhr3bLI.js`).then(e=>e.vue()),__vite__mapDeps([26,1,3,8,2]),import.meta.url)}}),m.of({name:`Angular Template`,load(){return t(()=>import(`./CMN7rSZK.js`).then(e=>e.angular()),__vite__mapDeps([27,1,3,8,2]),import.meta.url)}})],$t=oe([{tag:c.keyword,class:`tok-k`},{tag:[c.string,c.regexp,c.special(c.string)],class:`tok-s`},{tag:[c.number,c.bool,c.null,c.atom],class:`tok-n`},{tag:[c.typeName,c.className,c.namespace],class:`tok-t`},{tag:c.comment,class:`tok-c`}]),en={style:e=>$t.style(e),scope:e=>e.prop(i)!==X.data};function tn(e){let t=e.trim().split(/\s/)[0]??``;return t?m.matchLanguageName(Qt,t,!1):null}var $=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);function nn(e,t){let n=tn(t)?.support;if(!n)return null;let r=``,i=ce(f.create({doc:e,extensions:[n]}),e.length,500)??n.language.parser.parse(e);return se(e,i,en,(e,t)=>{r+=t?`<span class="${t}">${$(e)}</span>`:$(e)},()=>{r+=`
7
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(v.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r||t.to-n>e.to){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=Ke(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new b(e.parser.nodeSet.types[x.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(We.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function Ke(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var qe=n({"Blockquote/...":c.quote,HorizontalRule:c.contentSeparator,"ATXHeading1/... SetextHeading1/...":c.heading1,"ATXHeading2/... SetextHeading2/...":c.heading2,"ATXHeading3/...":c.heading3,"ATXHeading4/...":c.heading4,"ATXHeading5/...":c.heading5,"ATXHeading6/...":c.heading6,"Comment CommentBlock":c.comment,Escape:c.escape,Entity:c.character,"Emphasis/...":c.emphasis,"StrongEmphasis/...":c.strong,"Link/... Image/...":c.link,"OrderedList/... BulletList/...":c.list,"BlockQuote/...":c.quote,"InlineCode CodeText":c.monospace,"URL Autolink":c.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":c.processingInstruction,"CodeInfo LinkLabel":c.labelName,LinkTitle:c.string,Paragraph:c.content}),Je=new Fe(new ie(Ie).extend(qe),Object.keys(k).map(e=>k[e]),Object.keys(k).map(e=>Ae[e]),Object.keys(k),je,ge,Object.keys(U).map(e=>U[e]),Object.keys(U),[]);function Ye(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function Xe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:ee((e,r)=>{let i=e.type.id;if(t&&(i==x.CodeBlock||i==x.FencedCode)){let n=``;if(i==x.FencedCode){let t=e.node.getChild(x.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==x.CodeText,bracketed:i==x.FencedCode}}else if(n&&(i==x.HTMLBlock||i==x.HTMLTag||i==x.CommentBlock))return{parser:n,overlay:Ye(e.node,e.from,e.to)};return null})}}var Ze={resolve:`Strikethrough`,mark:`StrikethroughMark`},Qe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":c.strikethrough}},{name:`StrikethroughMark`,style:c.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=H.test(r),c=H.test(i);return e.addDelimiter(Ze,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function K(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function $e(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var et=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,tt=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&et.test(r=t.text.slice(t.pos))){let i=[];K(e,n.content,0,i,n.start)==K(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];K(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},nt={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":c.heading}},`TableRow`,{name:`TableCell`,style:c.content},{name:`TableDelimiter`,style:c.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return $e(t.content,0)?new tt:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof tt)||!$e(t.text,t.basePos))return!1;let r=e.peekLine();return et.test(r)&&K(e,t.text,t.basePos)==K(e,r,t.basePos)},before:`SetextHeading`}]},rt=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},it={defineNodes:[{name:`Task`,block:!0,style:c.list},{name:`TaskMarker`,style:c.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new rt:null},after:`SetextHeading`}]},at=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ot=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,st=/[\w-]+\.[\w-]+($|[/:])/,ct=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,lt=/\/[a-zA-Z\d@.]+/gy;function ut(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function dt(e,t){ot.lastIndex=t;let n=ot.exec(e);if(!n||st.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&ut(e,t,r,`)`)>ut(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ft(e,t){ct.lastIndex=t;let n=ct.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var pt=[nt,it,Qe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;at.lastIndex=r;let i=at.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=dt(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ft(e.text,r):(a=ft(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(lt.lastIndex=a,i=lt.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function mt(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),S(s))break}return-1}}var ht={defineNodes:[{name:`Superscript`,style:c.special(c.content)},{name:`SuperscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Superscript`,parse:mt(94,`Superscript`,`SuperscriptMark`)}]},gt={defineNodes:[{name:`Subscript`,style:c.special(c.content)},{name:`SubscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Subscript`,parse:mt(126,`Subscript`,`SubscriptMark`)}]},_t={defineNodes:[{name:`Emoji`,style:c.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},vt=e({html:()=>q,htmlCompletionSource:()=>St}),yt=g.define({id:0,name:`Document`,top:!0}),bt=class extends ue{createParse(e,t,n){let r=n[0]?.from??0,i=n[n.length-1]?.to??e.length;return{parsedPos:i,stoppedAt:null,stopAt(){},advance:()=>new b(yt,[],[],i-r)}}},xt=new ae(ne(),new bt,[],`html`);function q(e){return new y(xt)}function St(){return null}var Ct=e({commonmarkLanguage:()=>At,deleteMarkupBackward:()=>Ut,insertNewlineContinueMarkup:()=>Rt,insertNewlineContinueMarkupCommand:()=>Lt,markdown:()=>Kt,markdownKeymap:()=>Wt,markdownLanguage:()=>X,pasteURLAsLink:()=>Zt}),wt=ne({commentTokens:{block:{open:`<!--`,close:`-->`}}}),Tt=new v,Et=Je.configure({props:[re.add(e=>!e.is(`Block`)||e.is(`Document`)||J(e)!=null||Dt(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Tt.add(J),h.add({Document:()=>null}),i.add({Document:wt})]});function J(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Dt(e){return e.name==`OrderedList`||e.name==`BulletList`}function Ot(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=J(e.type))!=null&&r<=t)break;n=e}return n.to}var kt=p.of((e,t,n)=>{for(let r=a(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(Tt);if(e==null)continue;let t=Ot(r,e);if(t>n)return{from:n,to:t}}return null});function Y(e){return new ae(wt,e,[],`markdown`)}var At=Y(Et),X=Y(Et.configure([pt,gt,ht,_t,{props:[re.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function jt(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):m.matchLanguageName(e,n,!0),t instanceof m)return t.support?t.support.language.parser:le.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var Mt=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+Pt(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Nt(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new Mt(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new Mt(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new Mt(i.parent,s,s+t,a[1],e,n,i))}}return r}function Pt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Ft(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Pt(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function It(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(d)!=` `)return e;let r=_(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var Lt=(e={})=>({state:t,dispatch:n})=>{let r=a(t),{doc:i}=t,o=null,c=t.changeByRange(n=>{if(!n.empty||!X.isActiveAt(t,n.from,-1)&&!X.isActiveAt(t,n.from,1))return o={range:n};let a=n.from,c=i.lineAt(a),l=Nt(r.resolveInner(a,-1),i);for(;l.length&&l[l.length-1].from>a-c.from;)l.pop();if(!l.length)return o={range:n};let u=l[l.length-1];if(u.to-u.spaceAfter.length>a-c.from)return o={range:n};let d=a>=u.to-u.spaceAfter.length&&!/\S/.test(c.text.slice(u.to));if(u.item&&d){if(u.item.from<c.from&&!/^[\s>]*$/.test(c.text.slice(0,u.to)))return o={range:n};let r=u.node.firstChild,d=u.node.getChild(`ListItem`,`ListItem`);if(r.to>=a||d&&d.to<a||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||e.nonTightLists===!1){let e=l.length>1?l[l.length-2]:null,t,n=``;e&&e.item?(t=c.from+e.from,n=e.marker(i,1)):t=c.from+(e?e.to:0);let r=[{from:t,to:a,insert:n}];return u.node.name==`OrderedList`&&Ft(u.item,i,r,-2),e&&e.node.name==`OrderedList`&&Ft(e.item,i,r),{range:s.cursor(t+n.length),changes:r}}{let e=Vt(l,t,c);return{range:s.cursor(a+e.length+1),changes:{from:c.from,insert:e+t.lineBreak}}}}if(u.node.name==`Blockquote`&&d&&c.from){let e=i.lineAt(c.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==u.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:c.from+u.from,to:c.to}]);return{range:n.map(i),changes:i}}}let f=[];u.node.name==`OrderedList`&&Ft(u.item,i,f);let p=u.item&&u.item.from<c.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=u.to)for(let e=0,t=l.length-1;e<=t;e++)m+=e==t&&!p?l[e].marker(i,1):l[e].blank(e<t?_(c.text,4,l[e+1].from)-m.length:null);let h=a;for(;h>c.from&&/\s/.test(c.text.charAt(h-c.from-1));)h--;return m=It(m,t),Bt(u.node,t.doc)&&(m=Vt(l,t,c)+t.lineBreak+m),f.push({from:h,to:a,insert:t.lineBreak+m}),{range:s.cursor(h+m.length+1),changes:f}});return!o&&(n(t.update(c,{scrollIntoView:!0,userEvent:`input`})),!0)},Rt=Lt();function zt(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Bt(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function Vt(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?_(n.text,4,e[t+1].from)-r.length:null,t<i);return It(r,t)}function Ht(e,t){let n=e.resolveInner(t,-1),r=t;zt(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(zt(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var Ut=({state:e,dispatch:t})=>{let n=a(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&X.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Nt(Ht(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:s.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(n.item&&t.from<=n.item.from||/^[\s>]*$/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(_(t.text,4,n.to)-_(t.text,4,n.from));return r==t.from&&(i=It(i,e)),{range:s.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:s.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},Wt=[{key:`Enter`,run:Rt},{key:`Backspace`,run:Ut}],Gt=q({matchClosingTags:!1});function Kt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:i=!0,base:{parser:a}=At,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:c=Gt}=e;if(!(a instanceof Fe))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],d=[c.support,kt],f;s&&d.push(Zt),n instanceof y?(d.push(n.support),f=n.language):n&&(f=n);let p=t||f?jt(t,f):void 0;l.push(Xe({codeParser:p,htmlParser:c.language.parser})),i&&d.push(u.high(r.of(Wt)));let m=Y(a.configure(l));return o&&d.push(m.data.of({autocomplete:qt})),new y(m,d)}function qt(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=a(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:Yt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var Jt=null;function Yt(){if(Jt)return Jt;let e=St(new de(f.create({extensions:Gt}),0,!0));return Jt=e?e.options:[]}var Xt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Zt=o.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!X.isActiveAt(t.state,n.from,1)))return!1;let i=a(t.state),o=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||Xt.test(e.name))&&(o=!0)},leave:e=>{e.to<n.to&&(o=!0)}}),!o&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function Z(e){return new y(te.define(e))}function Q(e){return t(()=>import(`./DIGvaVgJ.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2,3]),import.meta.url)}var Qt=[m.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return t(()=>import(`./C6Btt2Xs.js`).then(e=>e.cpp()),__vite__mapDeps([4,1,3]),import.meta.url)}}),m.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return t(()=>import(`./C6Btt2Xs.js`).then(e=>e.cpp()),__vite__mapDeps([4,1,3]),import.meta.url)}}),m.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return Q(`Cassandra`)}}),m.of({name:`CSS`,extensions:[`css`],load(){return t(()=>import(`./DtbnBenW.js`).then(e=>e.css()),__vite__mapDeps([5,1,3]),import.meta.url)}}),m.of({name:`Go`,extensions:[`go`],load(){return t(()=>import(`./D_aBVMvK.js`).then(e=>e.go()),__vite__mapDeps([6,1,2,3]),import.meta.url)}}),m.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return t(()=>Promise.resolve().then(()=>vt).then(e=>e.html()),void 0,import.meta.url)}}),m.of({name:`Java`,extensions:[`java`],load(){return t(()=>import(`./Bbt0DTmZ.js`).then(e=>e.java()),__vite__mapDeps([7,1,3]),import.meta.url)}}),m.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript()),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return t(()=>import(`./C74H8jNb.js`).then(e=>e.jinja()),__vite__mapDeps([9,1,3]),import.meta.url)}}),m.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return t(()=>import(`./CDAjAYjS.js`).then(e=>e.json()),__vite__mapDeps([10,1,3]),import.meta.url)}}),m.of({name:`JSX`,extensions:[`jsx`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`LESS`,extensions:[`less`],load(){return t(()=>import(`./_rHYGvON.js`).then(e=>e.less()),__vite__mapDeps([11,1,3,5]),import.meta.url)}}),m.of({name:`Liquid`,extensions:[`liquid`],load(){return t(()=>import(`./DqnDX3G8.js`).then(e=>e.liquid()),__vite__mapDeps([12,1,3]),import.meta.url)}}),m.of({name:`MariaDB SQL`,load(){return Q(`MariaSQL`)}}),m.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return t(()=>Promise.resolve().then(()=>Ct).then(e=>e.markdown()),void 0,import.meta.url)}}),m.of({name:`MS SQL`,load(){return Q(`MSSQL`)}}),m.of({name:`MySQL`,load(){return Q(`MySQL`)}}),m.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return t(()=>import(`./BF1TezEe.js`).then(e=>e.php()),__vite__mapDeps([13,1,3]),import.meta.url)}}),m.of({name:`PLSQL`,extensions:[`pls`],load(){return Q(`PLSQL`)}}),m.of({name:`PostgreSQL`,load(){return Q(`PostgreSQL`)}}),m.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return t(()=>import(`./Bffqt7tx.js`).then(e=>e.python()),__vite__mapDeps([14,1,2,3]),import.meta.url)}}),m.of({name:`Rust`,extensions:[`rs`],load(){return t(()=>import(`./BWonG38x.js`).then(e=>e.rust()),__vite__mapDeps([15,1,3]),import.meta.url)}}),m.of({name:`Sass`,extensions:[`sass`],load(){return t(()=>import(`./BEHa2uNW.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([16,1,3,5]),import.meta.url)}}),m.of({name:`SCSS`,extensions:[`scss`],load(){return t(()=>import(`./BEHa2uNW.js`).then(e=>e.sass()),__vite__mapDeps([16,1,3,5]),import.meta.url)}}),m.of({name:`SQL`,extensions:[`sql`],load(){return Q(`StandardSQL`)}}),m.of({name:`SQLite`,load(){return Q(`SQLite`)}}),m.of({name:`TSX`,extensions:[`tsx`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return t(()=>import(`./BPW39P52.js`).then(e=>e.wast()),__vite__mapDeps([17,1,3]),import.meta.url)}}),m.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return t(()=>import(`./Ds8Pkiic.js`).then(e=>e.xml()),__vite__mapDeps([18,1,3]),import.meta.url)}}),m.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return t(()=>import(`./CPF5uNy5.js`).then(e=>e.yaml()),__vite__mapDeps([19,1,3]),import.meta.url)}}),m.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return t(()=>import(`./gfMMiTNf.js`).then(e=>Z(e.apl)),[],import.meta.url)}}),m.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return t(()=>import(`./C_eisQCp.js`).then(e=>Z(e.asciiArmor)),[],import.meta.url)}}),m.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return t(()=>import(`./DCl_8MCW.js`).then(e=>Z(e.asn1({}))),[],import.meta.url)}}),m.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return t(()=>import(`./BEn0Cwpx.js`).then(e=>Z(e.asterisk)),[],import.meta.url)}}),m.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return t(()=>import(`./D5EjA2JK.js`).then(e=>Z(e.brainfuck)),[],import.meta.url)}}),m.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return t(()=>import(`./DHLQUbN7.js`).then(e=>Z(e.cobol)),[],import.meta.url)}}),m.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.csharp)),[],import.meta.url)}}),m.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`ClojureScript`,extensions:[`cljs`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return t(()=>import(`./CnaYoQib.js`).then(e=>Z(e.gss)),[],import.meta.url)}}),m.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return t(()=>import(`./84nbDH0I.js`).then(e=>Z(e.cmake)),[],import.meta.url)}}),m.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return t(()=>import(`./De_zI4J0.js`).then(e=>Z(e.coffeeScript)),[],import.meta.url)}}),m.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return t(()=>import(`./DgAKBe0r.js`).then(e=>Z(e.commonLisp)),[],import.meta.url)}}),m.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return t(()=>import(`./p9eYesGn.js`).then(e=>Z(e.cypher)),[],import.meta.url)}}),m.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return t(()=>import(`./B_1Jd8HM.js`).then(e=>Z(e.cython)),[],import.meta.url)}}),m.of({name:`Crystal`,extensions:[`cr`],load(){return t(()=>import(`./Bsdphhtm.js`).then(e=>Z(e.crystal)),[],import.meta.url)}}),m.of({name:`D`,extensions:[`d`],load(){return t(()=>import(`./DWkQyNnU.js`).then(e=>Z(e.d)),[],import.meta.url)}}),m.of({name:`Dart`,extensions:[`dart`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.dart)),[],import.meta.url)}}),m.of({name:`diff`,extensions:[`diff`,`patch`],load(){return t(()=>import(`./ChtP43wD.js`).then(e=>Z(e.diff)),[],import.meta.url)}}),m.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return t(()=>import(`./DLa7NjNO.js`).then(e=>Z(e.dockerFile)),__vite__mapDeps([20,21]),import.meta.url)}}),m.of({name:`DTD`,extensions:[`dtd`],load(){return t(()=>import(`./DTF72YNO.js`).then(e=>Z(e.dtd)),[],import.meta.url)}}),m.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return t(()=>import(`./S7ucR4pR.js`).then(e=>Z(e.dylan)),[],import.meta.url)}}),m.of({name:`EBNF`,load(){return t(()=>import(`./D4c0_ac3.js`).then(e=>Z(e.ebnf)),[],import.meta.url)}}),m.of({name:`ECL`,extensions:[`ecl`],load(){return t(()=>import(`./BVIeWmwY.js`).then(e=>Z(e.ecl)),[],import.meta.url)}}),m.of({name:`edn`,extensions:[`edn`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`Eiffel`,extensions:[`e`],load(){return t(()=>import(`./BEjRio4Q.js`).then(e=>Z(e.eiffel)),[],import.meta.url)}}),m.of({name:`Elm`,extensions:[`elm`],load(){return t(()=>import(`./Cshzl8qu.js`).then(e=>Z(e.elm)),[],import.meta.url)}}),m.of({name:`Erlang`,extensions:[`erl`],load(){return t(()=>import(`./BV0c4Hdn.js`).then(e=>Z(e.erlang)),[],import.meta.url)}}),m.of({name:`Esper`,load(){return t(()=>import(`./DuQMFDvy.js`).then(e=>Z(e.esper)),[],import.meta.url)}}),m.of({name:`Factor`,extensions:[`factor`],load(){return t(()=>import(`./CygcOYNo.js`).then(e=>Z(e.factor)),__vite__mapDeps([22,21]),import.meta.url)}}),m.of({name:`FCL`,load(){return t(()=>import(`./ClOhbFR7.js`).then(e=>Z(e.fcl)),[],import.meta.url)}}),m.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return t(()=>import(`./D6RzAl64.js`).then(e=>Z(e.forth)),[],import.meta.url)}}),m.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return t(()=>import(`./Bt6PBEDR.js`).then(e=>Z(e.fortran)),[],import.meta.url)}}),m.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.fSharp)),[],import.meta.url)}}),m.of({name:`Gas`,extensions:[`s`],load(){return t(()=>import(`./BHEdbvp9.js`).then(e=>Z(e.gas)),[],import.meta.url)}}),m.of({name:`Gherkin`,extensions:[`feature`],load(){return t(()=>import(`./oBAE_ms0.js`).then(e=>Z(e.gherkin)),[],import.meta.url)}}),m.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return t(()=>import(`./CUpZ7dEl.js`).then(e=>Z(e.groovy)),[],import.meta.url)}}),m.of({name:`Haskell`,extensions:[`hs`],load(){return t(()=>import(`./BRsoo5mP.js`).then(e=>Z(e.haskell)),[],import.meta.url)}}),m.of({name:`Haxe`,extensions:[`hx`],load(){return t(()=>import(`./DjVOVvNP.js`).then(e=>Z(e.haxe)),[],import.meta.url)}}),m.of({name:`HXML`,extensions:[`hxml`],load(){return t(()=>import(`./DjVOVvNP.js`).then(e=>Z(e.hxml)),[],import.meta.url)}}),m.of({name:`HTTP`,load(){return t(()=>import(`./CLVgA2GD.js`).then(e=>Z(e.http)),[],import.meta.url)}}),m.of({name:`IDL`,extensions:[`pro`],load(){return t(()=>import(`./BUZw3wgd.js`).then(e=>Z(e.idl)),[],import.meta.url)}}),m.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return t(()=>import(`./Bu8mWwtz.js`).then(e=>Z(e.jsonld)),[],import.meta.url)}}),m.of({name:`Julia`,extensions:[`jl`],load(){return t(()=>import(`./CQfgDRfP.js`).then(e=>Z(e.julia)),[],import.meta.url)}}),m.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.kotlin)),[],import.meta.url)}}),m.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return t(()=>import(`./BXxG0Yva.js`).then(e=>Z(e.liveScript)),[],import.meta.url)}}),m.of({name:`Lua`,extensions:[`lua`],load(){return t(()=>import(`./DPCEkfD_.js`).then(e=>Z(e.lua)),[],import.meta.url)}}),m.of({name:`mIRC`,extensions:[`mrc`],load(){return t(()=>import(`./C9zpzAZU.js`).then(e=>Z(e.mirc)),[],import.meta.url)}}),m.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return t(()=>import(`./u8YMmbU0.js`).then(e=>Z(e.mathematica)),[],import.meta.url)}}),m.of({name:`Modelica`,extensions:[`mo`],load(){return t(()=>import(`./CqHI_q-D.js`).then(e=>Z(e.modelica)),[],import.meta.url)}}),m.of({name:`MUMPS`,extensions:[`mps`],load(){return t(()=>import(`./BSzj6Xyz.js`).then(e=>Z(e.mumps)),[],import.meta.url)}}),m.of({name:`Mbox`,extensions:[`mbox`],load(){return t(()=>import(`./BEMVcqjs.js`).then(e=>Z(e.mbox)),[],import.meta.url)}}),m.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return t(()=>import(`./8H7HVH4w.js`).then(e=>Z(e.nginx)),[],import.meta.url)}}),m.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return t(()=>import(`./GwMd3KmG.js`).then(e=>Z(e.nsis)),__vite__mapDeps([23,21]),import.meta.url)}}),m.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return t(()=>import(`./CzMBulkp.js`).then(e=>Z(e.ntriples)),[],import.meta.url)}}),m.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.objectiveC)),[],import.meta.url)}}),m.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.objectiveCpp)),[],import.meta.url)}}),m.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.oCaml)),[],import.meta.url)}}),m.of({name:`Octave`,extensions:[`m`],load(){return t(()=>import(`./D2Q8cUp1.js`).then(e=>Z(e.octave)),[],import.meta.url)}}),m.of({name:`Oz`,extensions:[`oz`],load(){return t(()=>import(`./BwTct_5T.js`).then(e=>Z(e.oz)),[],import.meta.url)}}),m.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return t(()=>import(`./Dp_KdFgX.js`).then(e=>Z(e.pascal)),[],import.meta.url)}}),m.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return t(()=>import(`./BkSkiI9m.js`).then(e=>Z(e.perl)),[],import.meta.url)}}),m.of({name:`Pig`,extensions:[`pig`],load(){return t(()=>import(`./AF4Hwhju.js`).then(e=>Z(e.pig)),[],import.meta.url)}}),m.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return t(()=>import(`./D8WpQPaX.js`).then(e=>Z(e.powerShell)),[],import.meta.url)}}),m.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return t(()=>import(`./C357ku5U.js`).then(e=>Z(e.properties)),[],import.meta.url)}}),m.of({name:`ProtoBuf`,extensions:[`proto`],load(){return t(()=>import(`./D1ij_kNL.js`).then(e=>Z(e.protobuf)),[],import.meta.url)}}),m.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return t(()=>import(`./Cp5ooBfH.js`).then(e=>Z(e.pug)),__vite__mapDeps([24,25]),import.meta.url)}}),m.of({name:`Puppet`,extensions:[`pp`],load(){return t(()=>import(`./BZyAS7I4.js`).then(e=>Z(e.puppet)),[],import.meta.url)}}),m.of({name:`Q`,extensions:[`q`],load(){return t(()=>import(`./B9NhS7L_.js`).then(e=>Z(e.q)),[],import.meta.url)}}),m.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return t(()=>import(`./CxDmU1I4.js`).then(e=>Z(e.r)),[],import.meta.url)}}),m.of({name:`RPM Changes`,load(){return t(()=>import(`./gpDK5sbt.js`).then(e=>Z(e.rpmChanges)),[],import.meta.url)}}),m.of({name:`RPM Spec`,extensions:[`spec`],load(){return t(()=>import(`./gpDK5sbt.js`).then(e=>Z(e.rpmSpec)),[],import.meta.url)}}),m.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return t(()=>import(`./ChfNwlCY.js`).then(e=>Z(e.ruby)),[],import.meta.url)}}),m.of({name:`SAS`,extensions:[`sas`],load(){return t(()=>import(`./C2OyD2Y6.js`).then(e=>Z(e.sas)),[],import.meta.url)}}),m.of({name:`Scala`,extensions:[`scala`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.scala)),[],import.meta.url)}}),m.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return t(()=>import(`./D9qYN0V5.js`).then(e=>Z(e.scheme)),[],import.meta.url)}}),m.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return t(()=>import(`./DwuoZtxw.js`).then(e=>Z(e.shell)),[],import.meta.url)}}),m.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return t(()=>import(`./tLWDfEkZ.js`).then(e=>Z(e.sieve)),[],import.meta.url)}}),m.of({name:`Smalltalk`,extensions:[`st`],load(){return t(()=>import(`./BLp5-jwC.js`).then(e=>Z(e.smalltalk)),[],import.meta.url)}}),m.of({name:`Solr`,load(){return t(()=>import(`./B78wSQJQ.js`).then(e=>Z(e.solr)),[],import.meta.url)}}),m.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.sml)),[],import.meta.url)}}),m.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return t(()=>import(`./Dz-mlCAC.js`).then(e=>Z(e.sparql)),[],import.meta.url)}}),m.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return t(()=>import(`./CTIncYxj.js`).then(e=>Z(e.spreadsheet)),[],import.meta.url)}}),m.of({name:`Squirrel`,extensions:[`nut`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.squirrel)),[],import.meta.url)}}),m.of({name:`Stylus`,extensions:[`styl`],load(){return t(()=>import(`./BOVgKnng.js`).then(e=>Z(e.stylus)),[],import.meta.url)}}),m.of({name:`Swift`,extensions:[`swift`],load(){return t(()=>import(`./DKB6_1j6.js`).then(e=>Z(e.swift)),[],import.meta.url)}}),m.of({name:`sTeX`,load(){return t(()=>import(`./DNzd62Q_.js`).then(e=>Z(e.stex)),[],import.meta.url)}}),m.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return t(()=>import(`./DNzd62Q_.js`).then(e=>Z(e.stex)),[],import.meta.url)}}),m.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return t(()=>import(`./CjI9Y6RI.js`).then(e=>Z(e.verilog)),[],import.meta.url)}}),m.of({name:`Tcl`,extensions:[`tcl`],load(){return t(()=>import(`./BGfruO1u.js`).then(e=>Z(e.tcl)),[],import.meta.url)}}),m.of({name:`Textile`,extensions:[`textile`],load(){return t(()=>import(`./C4jVoHG1.js`).then(e=>Z(e.textile)),[],import.meta.url)}}),m.of({name:`TiddlyWiki`,load(){return t(()=>import(`./VlUiK86J.js`).then(e=>Z(e.tiddlyWiki)),[],import.meta.url)}}),m.of({name:`Tiki wiki`,load(){return t(()=>import(`./DTszW0OQ.js`).then(e=>Z(e.tiki)),[],import.meta.url)}}),m.of({name:`TOML`,extensions:[`toml`],load(){return t(()=>import(`./BPTmHmyx.js`).then(e=>Z(e.toml)),[],import.meta.url)}}),m.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return t(()=>import(`./C2dAgh7P.js`).then(e=>Z(e.troff)),[],import.meta.url)}}),m.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return t(()=>import(`./PPSTk1ow.js`).then(e=>Z(e.ttcn)),[],import.meta.url)}}),m.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return t(()=>import(`./2b4Gb5sE.js`).then(e=>Z(e.ttcnCfg)),[],import.meta.url)}}),m.of({name:`Turtle`,extensions:[`ttl`],load(){return t(()=>import(`./Cx3rYX2g.js`).then(e=>Z(e.turtle)),[],import.meta.url)}}),m.of({name:`Web IDL`,extensions:[`webidl`],load(){return t(()=>import(`./D5jiJvOU.js`).then(e=>Z(e.webIDL)),[],import.meta.url)}}),m.of({name:`VB.NET`,extensions:[`vb`],load(){return t(()=>import(`./BthdM_4N.js`).then(e=>Z(e.vb)),[],import.meta.url)}}),m.of({name:`VBScript`,extensions:[`vbs`],load(){return t(()=>import(`./D9f6rSsU.js`).then(e=>Z(e.vbScript)),[],import.meta.url)}}),m.of({name:`Velocity`,extensions:[`vtl`],load(){return t(()=>import(`./CqftRsjg.js`).then(e=>Z(e.velocity)),[],import.meta.url)}}),m.of({name:`Verilog`,extensions:[`v`],load(){return t(()=>import(`./CjI9Y6RI.js`).then(e=>Z(e.verilog)),[],import.meta.url)}}),m.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return t(()=>import(`./kS471soi.js`).then(e=>Z(e.vhdl)),[],import.meta.url)}}),m.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return t(()=>import(`./BKJx4mf9.js`).then(e=>Z(e.xQuery)),[],import.meta.url)}}),m.of({name:`Yacas`,extensions:[`ys`],load(){return t(()=>import(`./CXXgtw0p.js`).then(e=>Z(e.yacas)),[],import.meta.url)}}),m.of({name:`Z80`,extensions:[`z80`],load(){return t(()=>import(`./Co3PbHdE.js`).then(e=>Z(e.z80)),[],import.meta.url)}}),m.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.mscgen)),[],import.meta.url)}}),m.of({name:`Xù`,extensions:[`xu`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.xu)),[],import.meta.url)}}),m.of({name:`MsGenny`,extensions:[`msgenny`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.msgenny)),[],import.meta.url)}}),m.of({name:`Vue`,extensions:[`vue`],load(){return t(()=>import(`./y0C1JQ1v.js`).then(e=>e.vue()),__vite__mapDeps([26,1,3,8,2]),import.meta.url)}}),m.of({name:`Angular Template`,load(){return t(()=>import(`./C4SqDe8e.js`).then(e=>e.angular()),__vite__mapDeps([27,1,3,8,2]),import.meta.url)}})],$t=oe([{tag:c.keyword,class:`tok-k`},{tag:[c.string,c.regexp,c.special(c.string)],class:`tok-s`},{tag:[c.number,c.bool,c.null,c.atom],class:`tok-n`},{tag:[c.typeName,c.className,c.namespace],class:`tok-t`},{tag:c.comment,class:`tok-c`}]),en={style:e=>$t.style(e),scope:e=>e.prop(i)!==X.data};function tn(e){let t=e.trim().split(/\s/)[0]??``;return t?m.matchLanguageName(Qt,t,!1):null}var $=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);function nn(e,t){let n=tn(t)?.support;if(!n)return null;let r=``,i=ce(f.create({doc:e,extensions:[n]}),e.length,500)??n.language.parser.parse(e);return se(e,i,en,(e,t)=>{r+=t?`<span class="${t}">${$(e)}</span>`:$(e)},()=>{r+=`
8
8
  `}),r}async function rn(e,t){let n=tn(t);if(!n)return null;try{await n.load()}catch{return null}return nn(e,t)}async function an(e,t){let n=m.matchFilename(Qt,t);if(!n)return null;try{await n.load()}catch{return null}let r=n.support;if(!r)return null;let i=``,a=ce(f.create({doc:e,extensions:[r]}),e.length,500)??r.language.parser.parse(e);return se(e,a,en,(e,t)=>{i+=t?`<span class="${t}">${$(e)}</span>`:$(e)},()=>{i+=`
9
9
  `}),i}function on(e,t){let n=()=>{for(let t of e.querySelectorAll(`pre > code[class*='language-']:not([data-coloured])`)){let e=/language-(\S+)/.exec(t.className)?.[1]??``,n=t.textContent??``;t.dataset.coloured=``,rn(n,e).then(e=>{e!==null&&t.textContent===n&&(t.innerHTML=e)})}};return n(),{update:n}}export{Qt as a,q as c,nn as i,on as n,Kt as o,an as r,X as s,en as t};
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t,b as n,d as r,f as i,i as a,o,s,u as c,x as l}from"./DS7XcdHs.js";import{a as u,t as d}from"./DciMwFJ1.js";import{a as f,i as p,l as m,s as h,u as g}from"./DK9wjWIk.js";import{a as _,i as v,t as y}from"./_zY4mrA0.js";import{a as ee,i as b,r as x,t as S}from"./DrPF-vh8.js";import{t as C}from"./D6QVYUu9.js";import{n as w,r as T}from"./DQJRaTNz.js";import{i as E,n as te,r as D,t as O}from"./Bx_Vz2qr.js";import{n as k,t as A}from"./CggtIYAM.js";import{PeleError as j,c as M,d as ne,g as N,h as P,i as F,n as I,o as L,s as R,u as z}from"./BNlziJ_1.js";var B=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),V=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),re=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),H=`roundedRect`;function U(e){return e&&(B.get(e)??e)}function W(e){return A(e)||e===`constructor`}function ie(e,t){for(let n of e)n.isGroup||((!n.shape||n.shape===`squareRect`||n.shape===`rect`)&&(n.shape=H),V.has(n.shape)?(t.emitError(`SHAPE_REMOVED`,`shape "${n.shape}" was removed in v0.8.1, using "${H}"`,{nodeId:n.id}),n.shape=H):re.has(n.shape)||(t.emitWarning(`SHAPE_UNSUPPORTED`,`shape "${n.shape}" is not supported, using "${H}"`,{nodeId:n.id}),n.shape=H))}var G=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),ae=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]);function oe(e){return ae.has(e.type)}function K(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}function q(e){return e.startsWith(`"`)&&e.endsWith(`"`)?e.substring(1,e.length-1):e}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function se(e){let t=e=>Array.isArray(e)?[]:J(e)?{}:e,n=t(e),r=[[e,n]];for(;r.length>0;){let[e,n]=r.pop();if(Array.isArray(e))for(let i of e){let e=t(i);n.push(e),typeof i==`object`&&i&&r.push([i,e])}else if(J(e))for(let i of Object.keys(e)){if(i===`__proto__`||i===`constructor`||i===`prototype`)continue;let a=e[i],o=t(a);n[i]=o,typeof a==`object`&&a&&r.push([a,o])}}return n}function Y(e,t){return Object.assign(e??{},t)}var ce=/:\s*[>|][\d+-]*\s*$/,le=/,([\t ]*)$/;function X(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(`
1
+ import{_ as e,a as t,b as n,d as r,f as i,i as a,o,s,u as c,x as l}from"./DlgOmQ_G.js";import{a as u,t as d}from"./DciMwFJ1.js";import{a as f,i as p,l as m,s as h,u as g}from"./BF3mdiSX.js";import{a as _,i as v,t as y}from"./BvhVny3O.js";import{a as ee,i as b,r as x,t as S}from"./-oRvYXNk.js";import{t as C}from"./D6QVYUu9.js";import{n as w,r as T}from"./CXc9Iibq.js";import{i as E,n as te,r as D,t as O}from"./CMe14KUo.js";import{n as k,t as A}from"./CggtIYAM.js";import{PeleError as j,c as M,d as ne,g as N,h as P,i as F,n as I,o as L,s as R,u as z}from"./BArcFmbE.js";var B=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),V=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),re=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),H=`roundedRect`;function U(e){return e&&(B.get(e)??e)}function W(e){return A(e)||e===`constructor`}function ie(e,t){for(let n of e)n.isGroup||((!n.shape||n.shape===`squareRect`||n.shape===`rect`)&&(n.shape=H),V.has(n.shape)?(t.emitError(`SHAPE_REMOVED`,`shape "${n.shape}" was removed in v0.8.1, using "${H}"`,{nodeId:n.id}),n.shape=H):re.has(n.shape)||(t.emitWarning(`SHAPE_UNSUPPORTED`,`shape "${n.shape}" is not supported, using "${H}"`,{nodeId:n.id}),n.shape=H))}var G=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),ae=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]);function oe(e){return ae.has(e.type)}function K(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}function q(e){return e.startsWith(`"`)&&e.endsWith(`"`)?e.substring(1,e.length-1):e}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function se(e){let t=e=>Array.isArray(e)?[]:J(e)?{}:e,n=t(e),r=[[e,n]];for(;r.length>0;){let[e,n]=r.pop();if(Array.isArray(e))for(let i of e){let e=t(i);n.push(e),typeof i==`object`&&i&&r.push([i,e])}else if(J(e))for(let i of Object.keys(e)){if(i===`__proto__`||i===`constructor`||i===`prototype`)continue;let a=e[i],o=t(a);n[i]=o,typeof a==`object`&&a&&r.push([a,o])}}return n}function Y(e,t){return Object.assign(e??{},t)}var ce=/:\s*[>|][\d+-]*\s*$/,le=/,([\t ]*)$/;function X(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(`
2
2
  `)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i<o.length;i++){let a=o[i];if(n)a===`\\`?i++:a===`"`&&(n=!1);else if(t)a===`'`&&(t=!1);else if(a===`"`)n=!0;else if(a===`'`)t=!0;else if(a===`#`&&(i===0||o[i-1]===` `||o[i-1]===` `)){e=i;break}else a===`[`||a===`{`?r++:(a===`]`||a===`}`)&&(r=Math.max(0,r-1))}if(t||n||r>0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;ce.test(s)?(i=o.length-o.trimStart().length,a.push(o)):a.push(s.replace(le,`$1`)+c)}return a.join(`
3
3
  `)}function ue(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}function de(e){let t=e.trim(),n=t.slice(0,-1),r=`arrow_open`;switch(t.slice(-1)){case`x`:r=`arrow_cross`;break;case`>`:r=`arrow_point`;break;case`-`:case`.`:n=t}let i=`normal`,a=n.length-1,o=0;for(let e=0;e<n.length;e++)n[e]===`.`&&o++;return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}function fe(e){if(!e)return;let t={},n=!1;for(let r of Object.keys(e))G.has(r)||(t[r]=e[r],n=!0);return n?t:void 0}var pe=class{type=`agentflow`;direction;nodes=new Map;edges=[];subgraphs=[];connectors=new Map;classes=new Map;tooltips=new Map;defaultEdgeStyle;defaultInterpolate;mappings=[];diagnostics=[];title;accTitle;accDescr;lineOffset;subgraphLookup=new Map;globalNodes=new Set;members=new Set;edgeById=new Map;pairCount=new Map;subCount=0;bareMappings=new Set;firstMapping=new Map;reported=new Map;options;constructor(e={}){this.options=e,this.lineOffset=e.lineOffset??0}metadata(e,t,n){let r=t.includes(`
4
4
  `),i;try{i=I(r?t+`
@@ -1,2 +1,2 @@
1
- import{_ as e,o as t,u as n}from"./DS7XcdHs.js";import{a as r,c as i,d as a,g as o,h as s,i as c,l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./Dzu8v7nB.js";import{u as _}from"./BNlziJ_1.js";function v(e,t){return{type:`info`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
1
+ import{_ as e,o as t,u as n}from"./DlgOmQ_G.js";import{a as r,c as i,d as a,g as o,h as s,i as c,l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./jAC4YCqW.js";import{u as _}from"./BArcFmbE.js";function v(e,t){return{type:`info`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0}}var y=[c(`showInfo`),c(`info`),r,h,f,l,g,p,d,m];function b(e){let t=new s(u(e,y,`info`),y,`info`),n={$type:`Info`};for(;t.kind===5;)t.i++;for(t.expect(1);t.kind===5;)t.i++;if(t.accept(0))for(;t.kind===5;)t.i++;for(;t.kind!==-1;){let e=t.kind;if(e===2?n.accDescr=i(t.take()):e===3?n.accTitle=o(t.take()):e===4?n.title=a(t.take()):t.fail(`a title or the end of input`),t.kind===-1)break;for(t.kind!==5&&t.fail(`a line break or the end of input`);t.kind===5;)t.i++}return n}var x=`1.10.0`;function S(r,i,a){let o=a.fontSize??16,s=a.measurer??_(a.fontFamily,a.fontFamilyMono),c=a.padding??8,l=n(r.title,!1,s,o,4e3,1),u=l.height>0?l.height+8:0,d=n(`Pele v${x}`,!1,s,o,4e3),f=Math.ceil(Math.max(l.width,d.width)+2*c),p=Math.ceil(u+d.height+2*c),m=t(l,f/2,c+l.height/2,` class="pele-title" font-weight="var(--_tw)"`)+t(d,f/2,c+u+d.height/2,` class="pele-version" fill="var(--_m)"`);return{svg:e(`info`,f,p,o,a,r,m),width:f,height:p,links:[]}}var C={type:`info`,parse:(e,t,n)=>v(b(e),n),render:S};export{C as info};
@@ -1,2 +1,2 @@
1
- import{_ as e,a as t,o as n,u as r,x as i}from"./DS7XcdHs.js";import{r as a,t as o}from"./DciMwFJ1.js";import{a as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./Dzu8v7nB.js";import{t as C}from"./Ce_hS451.js";import{t as w}from"./CabmfniL.js";import{PeleError as T,d as E,u as D}from"./BNlziJ_1.js";var O=1e4;function k(e,t,n,r,i){let a=e.packet?.[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function A(e){return new T(e,`semantic`,{type:`packet`})}function j(e,t,n){let r=Math.floor(k(t,`bitsPerRow`,32,1,4096)),i=[],a=-1,o=[],s=1;for(let t of e.blocks){let{start:e,end:n,bits:c}=t;if(e!==void 0&&n!==void 0&&n<e)throw A(`Packet block ${e} - ${n} is invalid. End must be greater than start.`);if(e??=a+1,e!==a+1)throw A(`Packet block ${e} - ${n??e} is not contiguous. It should start from ${a+1}.`);if(c===0)throw A(`Packet block ${e} is invalid. Cannot have a zero bit field.`);for(n??=e+(c??1)-1,c??=n-e+1,a=n;o.length<=r+1&&i.length<O;){let a=s*r-1;if(n<=a){o.push({start:e,end:n,bits:c,label:t.label}),n===a&&(i.push(o),o=[],s++);break}o.push({start:e,end:a,bits:a-e,label:t.label}),i.push(o),o=[],s++,e=a+1,c=n-e}}return o.length>0&&i.push(o),{type:`packet`,title:e.title||n,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
1
+ import{_ as e,a as t,o as n,u as r,x as i}from"./DlgOmQ_G.js";import{r as a,t as o}from"./DciMwFJ1.js";import{a as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./jAC4YCqW.js";import{t as C}from"./Ce_hS451.js";import{t as w}from"./CMAnq3x6.js";import{PeleError as T,d as E,u as D}from"./BArcFmbE.js";var O=1e4;function k(e,t,n,r,i){let a=e.packet?.[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function A(e){return new T(e,`semantic`,{type:`packet`})}function j(e,t,n){let r=Math.floor(k(t,`bitsPerRow`,32,1,4096)),i=[],a=-1,o=[],s=1;for(let t of e.blocks){let{start:e,end:n,bits:c}=t;if(e!==void 0&&n!==void 0&&n<e)throw A(`Packet block ${e} - ${n} is invalid. End must be greater than start.`);if(e??=a+1,e!==a+1)throw A(`Packet block ${e} - ${n??e} is not contiguous. It should start from ${a+1}.`);if(c===0)throw A(`Packet block ${e} is invalid. Cannot have a zero bit field.`);for(n??=e+(c??1)-1,c??=n-e+1,a=n;o.length<=r+1&&i.length<O;){let a=s*r-1;if(n<=a){o.push({start:e,end:n,bits:c,label:t.label}),n===a&&(i.push(o),o=[],s++);break}o.push({start:e,end:a,bits:a-e,label:t.label}),i.push(o),o=[],s++,e=a+1,c=n-e}}return o.length>0&&i.push(o),{type:`packet`,title:e.title||n,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0,bitsPerRow:r,rows:i}}var M=[{name:`packet-beta`,pattern:`packet-beta`},p(`packet`),{name:`-`,pattern:`-`,longer:[y]},{name:`+`,pattern:`+`},{name:`:`,pattern:`:`},s,x,v,{name:`INT`,pattern:/0|[1-9][0-9]*(?!\.)/y},h,m,S,y,_,b];function N(e){let t=new f(g(e,M,`packet`),M,`packet`),n={$type:`Packet`,blocks:[]},r=()=>{if(t.kind!==-1)for(t.kind!==10&&t.fail(`a line break or the end of input`);t.kind===10;)t.i++};for(;t.kind===10;)t.i++;for(t.accept(0)||t.expect(1);t.kind!==-1;)switch(t.kind){case 10:t.i++;break;case 5:n.accDescr=c(t.take()),r();break;case 6:n.accTitle=d(t.take()),r();break;case 7:n.title=l(t.take()),r();break;case 8:case 3:{let e={$type:`PacketBlock`,label:``};t.accept(3)?e.bits=Number(t.expect(8)):(e.start=Number(t.take()),t.accept(2)&&(e.end=Number(t.expect(8)))),t.expect(4),e.label=u(t.expect(9)),n.blocks.push(e),r();break}default:t.fail(`a field, a title, or a line break`)}return n}function P(e,t,n){return o(n,r=>F(e,t,n,r))}function F(o,s,c,l){let u=c.fontSize??16,d=Math.round(u*.875),f=Math.round(u*.625),p=c.measurer??D(c.fontFamily,c.fontFamilyMono),m=c.padding??8,h=s.packet??{},g=k(s,`rowHeight`,32,1,400),_=k(s,`bitWidth`,32,1,400),v=k(s,`paddingX`,5,0,400),y=k(s,`paddingY`,5,0,400),b=h.showBits!==!1,x=h.bitOrder===`descending`,S=o.bitsPerRow,T=o.rows;if(l){let e=Math.max(1,Math.floor(((c.maxWidth??320)-2*m)/Math.min(_,18)));S=Math.min(S,Math.max(8,2**Math.floor(Math.log2(e))));let t=o.rows[o.rows.length-1],n=t?.[t.length-1]?.end??0;Math.ceil((n+1)/S)>1e4&&(S=o.bitsPerRow),_=Math.min(_,Math.max(18,((c.maxWidth??320)-2*m)/S));let r=e=>e.bits===e.end-e.start,i=[];for(let e of o.rows)for(let t of e){let e=i[i.length-1];e&&r(e)&&r(t)&&e.label===t.label&&t.start===e.end+1&&t.start%o.bitsPerRow===0?(e.end=t.end,e.bits=e.end-e.start):i.push({...t})}T=[];for(let e of i)for(let t=e.start;t<=e.end;){let n=Math.min(e.end,(Math.floor(t/S)+1)*S-1),r=Math.floor(t/S);(T[r]??(T[r]=[])).push({...e,start:t,end:n}),t=n+1}}let O=new Map;if(l)for(let e of T)for(let t of e){let e=Math.max(1,(t.end-t.start+1)*_-Math.min(v,_-1)-6),n=w(E(t.label).trim(),p,d,e);O.set(t,n)}let A=b?f+4:0,j=T.map(e=>{let t=g;if(l)for(let n of e)t=Math.max(t,O.get(n).height+10);return t}),M=[],N=0;for(let e of j)M.push(N),N+=A+e+y;T.length&&(N-=y);let P=Math.min(v,_-1),F=T.length>0?S*_-P:0,I=r(o.title,!1,p,u,l?a(c):4e3,1),L=I.height>0?I.height+(N>0?12:0):0,R=new Map,z=(e,t)=>{let n=R.get(e);return n||R.set(e,n=new Map),n.has(t)||n.set(t,C(E(e).trim(),t,d,Math.round(u*.5),p)),n.get(t)},B=m+Math.max(0,(I.width-F)/2),V=``,H=``;T.forEach((e,r)=>{let a=m+M[r]+A,o=j[r];for(let r of e){let e=r.end-r.start+1,s=r.start%S,c=B+(x?S-s-e:s)*_,u=e*_-P,f=l?void 0:z(r.label,u-6);if(V+=`<g class="pele-node" data-id="${r.start}-${r.end}"><rect x="${i(c)}" y="${i(a)}" width="${i(u)}" height="${i(o)}" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/>`+(l?n(O.get(r),c+u/2,a+o/2,``):f&&f.size<=o?`<text x="${i(c+u/2)}" y="${i(a+o/2+f.size*.35)}"${f.size===d?``:` font-size="${i(f.size)}"`}>${t(f.text)}</text>`:``)+`</g>`,!b)continue;let p=x?r.end:r.start,m=x?r.start:r.end;H+=e===1?`<text x="${i(c+u/2)}" y="${i(a-4)}" text-anchor="middle">${p}</text>`:`<text x="${i(c)}" y="${i(a-4)}">${p}</text><text x="${i(c+u)}" y="${i(a-4)}" text-anchor="end">${m}</text>`}});let U=Math.ceil(Math.max(F,I.width)+2*m),W=Math.ceil(N+L+2*m),G=(V?`<g class="pele-packet-fields" font-size="${d}" text-anchor="middle">${V}</g>`:``)+(H?`<g class="pele-packet-bits" font-size="${f}" fill="var(--_m)">${H}</g>`:``)+n(I,U/2,W-m-I.height/2,` class="pele-title" font-weight="var(--_tw)"`);return{svg:e(`packet`,U,W,u,c,o,G),width:U,height:W,links:[]}}var I={type:`packet`,parse:(e,t,n)=>j(N(e),t,n),render:P};export{I as packet};
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t,i as n,l as r,o as i,r as a,u as o,x as s}from"./DS7XcdHs.js";import{o as c,r as l}from"./DciMwFJ1.js";import{c as u,d,g as f,h as p,i as m,n as h,o as g,r as _,s as ee}from"./Dzu8v7nB.js";import{PeleError as v,d as y,u as te}from"./BNlziJ_1.js";function b(e){return e===32||e>=9&&e<=13||e>127&&/\s/.test(String.fromCharCode(e))}function x(){let e=1/0;return(t,n)=>{if(!t.startsWith(`accDescr`,n))return-1;let r=t.length,i=n+8;for(;i<r&&(t.charCodeAt(i)===32||t.charCodeAt(i)===9);)i++;if(t.charCodeAt(i)===58){for(i++;i<r;i++){let e=t.charCodeAt(i);if(e===10||e===13||e===37&&t.charCodeAt(i+1)===37)break}return i}for(;i<r&&b(t.charCodeAt(i));)i++;if(t.charCodeAt(i)!==123||i>=e)return-1;let a=t.indexOf(`}`,i+1);return a===-1&&(e=i),a+1||-1}}var S=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,C={name:`TITLE`,pattern:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:`t`},w={name:`ACC_TITLE`,pattern:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:`a`},T={name:`ACC_DESCR`,pattern:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:`a`,scanner:x};function E(e,t){return{name:e,pattern:e,longer:t}}function D(e,t){return{...m(e),longer:[t]}}function O(e){return{name:e,pattern:/[A-Z_a-z][\w-]*/y,first:S+`_`}}function k(e){return{name:e,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`}}function A(e){return[{name:e+`_WHITESPACE`,pattern:/[\t \r\n]+/y,hidden:!0,first:` \r
1
+ import{_ as e,a as t,i as n,l as r,o as i,r as a,u as o,x as s}from"./DlgOmQ_G.js";import{o as c,r as l}from"./DciMwFJ1.js";import{c as u,d,g as f,h as p,i as m,n as h,o as g,r as _,s as ee}from"./jAC4YCqW.js";import{PeleError as v,d as y,u as te}from"./BArcFmbE.js";function b(e){return e===32||e>=9&&e<=13||e>127&&/\s/.test(String.fromCharCode(e))}function x(){let e=1/0;return(t,n)=>{if(!t.startsWith(`accDescr`,n))return-1;let r=t.length,i=n+8;for(;i<r&&(t.charCodeAt(i)===32||t.charCodeAt(i)===9);)i++;if(t.charCodeAt(i)===58){for(i++;i<r;i++){let e=t.charCodeAt(i);if(e===10||e===13||e===37&&t.charCodeAt(i+1)===37)break}return i}for(;i<r&&b(t.charCodeAt(i));)i++;if(t.charCodeAt(i)!==123||i>=e)return-1;let a=t.indexOf(`}`,i+1);return a===-1&&(e=i),a+1||-1}}var S=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,C={name:`TITLE`,pattern:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:`t`},w={name:`ACC_TITLE`,pattern:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:`a`},T={name:`ACC_DESCR`,pattern:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:`a`,scanner:x};function E(e,t){return{name:e,pattern:e,longer:t}}function D(e,t){return{...m(e),longer:[t]}}function O(e){return{name:e,pattern:/[A-Z_a-z][\w-]*/y,first:S+`_`}}function k(e){return{name:e,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`}}function A(e){return[{name:e+`_WHITESPACE`,pattern:/[\t \r\n]+/y,hidden:!0,first:` \r
2
2
  `},{..._,name:e+`_YAML`,first:`-`},{...g,name:e+`_DIRECTIVE`,first:` %`},{...ee,name:e+`_SINGLE_LINE_COMMENT`,first:` %`}]}function j(e){if(!e.includes(`\\`))return e.slice(1,-1);let t=e.length-1,n=``;for(let r=1;r<t;r++){let i=e[r];i===`\\`&&r+1<t?(i=e[++r],n+=i===`n`?`
3
3
  `:i===`r`?`\r`:i===`t`?` `:i):n+=i}return n}function M(e,t,n,r,i,a){let o=new p(h(e,t,`railroad`),t,`railroad`),s={$type:n,rules:[]};for(o.expect(0);;){let e=o.kind;if(e===r){let e=d(o.take()),t=e[0];s.title=(t===`"`||t===`'`)&&e.endsWith(t)?i(e):e}else if(e===r+1)s.accTitle=f(o.take());else if(e===r+2)s.accDescr=u(o.take());else break}for(;o.kind!==-1;)s.rules.push(a(o));return s}var ne=[];function N(e){let t=e,n=t.element??t.primary??t.suffix,r=t.alternatives??t.elements??(n?[n]:ne);if(t.base){r=[t.base];for(let e of t.postfixes)e.except&&r.push(e.except)}return r}var P=e=>({type:`terminal`,value:e}),F=e=>({type:`nonterminal`,name:e}),I=e=>({type:`special`,text:e}),L=e=>({type:`optional`,element:e}),R=(e,t,n=1/0)=>({type:`repetition`,element:e,min:t,max:n});function z(e){return e.length===1?e[0]:{type:`sequence`,elements:e}}function B(e){return e.length===1?e[0]:{type:`choice`,alternatives:e}}function V(e,t){return e.rules.map(e=>({name:e.name,definition:H(e.definition,N,t)}))}function H(e,t,n){let r=[e],i=[t(e)],a=[[]];for(;;){let e=r.length-1,o=a[e];if(o.length<i[e].length){let n=i[e][o.length];r.push(n),i.push(t(n)),a.push([])}else{let t=n(r[e],o);if(e===0)return t;r.pop(),i.pop(),a.pop(),a[e-1].push(t)}}}var U=`0123456789`,W={name:`ABNF_RULENAME`,pattern:/[A-Za-z][A-Za-z0-9-]*/y,first:S},G={name:`ABNF_COMMENT`,pattern:/;[^\n\r]*/y,hidden:!0,first:`;`},K=[D(`railroad-abnf-beta`,W),E(`=`),E(`;`,[G]),E(`/`),E(`(`),E(`)`),E(`[`),E(`]`),C,w,T,W,{name:`ABNF_STRING`,pattern:/"[^"]*"/y,first:`"`},{name:`ABNF_NUMVAL`,pattern:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/y,first:`%`},{name:`ABNF_REPEAT`,pattern:/[0-9]*\*[0-9]*/y,first:U+`*`},{name:`ABNF_EXACT_REPEAT`,pattern:/[0-9]+/y,first:U},...A(`ABNF`),G];function q(e,t,n,r){let i={$type:`AbnfConcatenation`,elements:[]};return t.alternatives.push(i),{alternation:t,concatenation:i,node:e,close:n,repeat:r}}function re(e){let t=[],n=q(void 0,{$type:`AbnfAlternation`,alternatives:[]},-2,void 0);for(;;){let r=e.kind===14||e.kind===15?e.take():void 0,i,a=e.kind;switch(a){case 12:i={$type:`AbnfStringLiteral`,value:e.take().slice(1,-1)};break;case 13:i={$type:`AbnfNumVal`,value:e.take()};break;case 11:i={$type:`AbnfRuleName`,name:e.take()};break;case 4:case 6:{e.i++;let i={$type:`AbnfAlternation`,alternatives:[]};t.push(n),n=q({$type:a===4?`AbnfGroup`:`AbnfOptionalGroup`,element:i},i,a+1,r);continue}default:e.fail(`a string, a number, a name, or an opening bracket`)}for(;;){n.concatenation.elements.push(r===void 0?{$type:`AbnfElement`,primary:i}:{$type:`AbnfElement`,repeat:r,primary:i});let a=e.kind;if(a===n.close)e.i++,i=n.node,r=n.repeat,n=t.pop();else{if(a===3)e.i++,n.concatenation={$type:`AbnfConcatenation`,elements:[]},n.alternation.alternatives.push(n.concatenation);else if(a!==12&&a!==13&&a!==11&&a!==4&&a!==6&&a!==14&&a!==15){if(t.length===0)return n.alternation;e.fail(`token of type '${K[n.close].name}'`)}break}}}}function ie(e){return M(e,K,`RailroadAbnf`,8,e=>e.slice(1,-1),e=>{let t=e.expect(11);e.expect(1);let n=re(e);return e.expect(2),{$type:`AbnfRule`,name:t,definition:n}})}function ae(e,t){switch(e.$type){case`AbnfAlternation`:return B(t);case`AbnfConcatenation`:return z(t);case`AbnfElement`:{let n=e.repeat;if(!n)return t[0];let r=n.indexOf(`*`),i=r===-1,a=r>0||i?parseInt(n,10):0,o=i?a:r<n.length-1?parseInt(n.slice(r+1),10):1/0;return a===0&&o===1?L(t[0]):R(t[0],a,o)}case`AbnfStringLiteral`:case`AbnfNumVal`:return P(e.value);case`AbnfRuleName`:return F(e.name);case`AbnfGroup`:return t[0];case`AbnfOptionalGroup`:return L(t[0])}}var oe=e=>V(e,ae);function se(e,t){if(e.charCodeAt(t)!==63)return-1;let n=!1;for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===63)return n?r+1:-1;if(t===59)return-1;n||=!b(t)}return-1}var ce=O(`EBNF_ID`),le={name:`EBNF_SPECIAL_SEQUENCE`,pattern:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/y,first:`?`,scanner:()=>se},ue=A(`EBNF`),de={name:`EBNF_ISO_COMMENT`,pattern:/\(\*[\s\S]*?\*\)/y,hidden:!0,first:`(`,opener:/\(\*/y},fe=[D(`railroad-ebnf-beta`,ce),E(`::=`),E(`=`),E(`;`),E(`|`),E(`,`),E(`(`,[de]),E(`)`),E(`[`),E(`]`),E(`{`),E(`}`),E(`?`,[le]),E(`*`),E(`+`),E(`-`,[ue[1]]),C,w,T,ce,k(`EBNF_STRING`),le,...ue,{name:`EBNF_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y},de];function pe(e,t,n,r){let i={$type:`EbnfSequence`,elements:[]};return t.alternatives.push(i),{choice:t,sequence:i,term:void 0,node:e,close:n,except:r}}var me=[`EbnfGroup`,`EbnfOptional`,`EbnfRepetition`];function he(e){let t=[],n=pe(void 0,{$type:`EbnfChoice`,alternatives:[]},-2,!1),r=!1;for(;;){let i,a=e.kind;switch(a){case 20:i={$type:`EbnfTerminal`,value:j(e.take())};break;case 19:i={$type:`EbnfNonTerminal`,name:e.take()};break;case 21:i={$type:`EbnfSpecial`,text:e.take().slice(1,-1).trim()};break;case 6:case 8:case 10:{e.i++;let i={$type:`EbnfChoice`,alternatives:[]};t.push(n),n=pe({$type:me[a-6>>1],element:i},i,a+1,r),r=!1;continue}default:e.fail(`a terminal, a name, or an opening bracket`)}for(;;){r?(n.term.postfixes.push({$type:`EbnfExceptionPostfix`,except:i}),r=!1):(n.term={$type:`EbnfTerm`,base:i,postfixes:[]},n.sequence.elements.push(n.term));let a=n.term.postfixes;for(;;){let t=e.kind;if(t===12)a.push({$type:`EbnfOptionalPostfix`,operator:e.take()});else if(t===13)a.push({$type:`EbnfZeroOrMorePostfix`,operator:e.take()});else if(t===14)a.push({$type:`EbnfOneOrMorePostfix`,operator:e.take()});else break}let o=e.kind;if(o===n.close)e.i++,i=n.node,r=n.except,n=t.pop();else{if(o===15)e.i++,r=!0;else if(o===5)e.i++;else if(o===4)e.i++,n.sequence={$type:`EbnfSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==20&&o!==19&&o!==21&&o!==6&&o!==8&&o!==10){if(t.length===0)return n.choice;e.fail(`token of type '${fe[n.close].name}'`)}break}}}}function ge(e){return M(e,fe,`RailroadEbnf`,16,j,e=>{let t=e.expect(19);e.accept(2)||e.expect(1);let n={$type:`EbnfRule`,name:t,definition:he(e)};return e.expect(3),n})}function _e(e,t){switch(e.$type){case`EbnfChoice`:return B(t);case`EbnfSequence`:return z(t);case`EbnfTerm`:{let n=t[0],r=1;for(let i of e.postfixes)n=i.$type===`EbnfOptionalPostfix`?L(n):i.$type===`EbnfExceptionPostfix`?{type:`sequence`,elements:[n,P(`-`),t[r++]]}:R(n,+(i.$type===`EbnfOneOrMorePostfix`));return n}case`EbnfTerminal`:return P(e.value);case`EbnfNonTerminal`:return F(e.name);case`EbnfSpecial`:return I(e.text);case`EbnfGroup`:return t[0];case`EbnfOptional`:return L(t[0]);case`EbnfRepetition`:return R(t[0],0)}}var ve=e=>V(e,_e),ye=O(`RR_ID`),J=e=>E(e,[ye]),be=[D(`railroad-beta`,ye),J(`nonterminal`),J(`zeroOrMore`),J(`oneOrMore`),J(`sequence`),J(`optional`),J(`terminal`),J(`special`),J(`choice`),E(`=`),E(`;`),E(`(`),E(`,`),E(`)`),C,w,T,ye,k(`RR_STRING`),...A(`RR`),{name:`RR_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y}];function xe(e){e.i++,e.expect(11);let t=j(e.expect(18));return e.expect(13),t}function Se(e){return{$type:e,element:void 0}}function Ce(e){let t=[];for(;;){let n;switch(e.kind){case 6:n={$type:`RailroadTerminalExpr`,value:xe(e)};break;case 1:n={$type:`RailroadNonTerminalExpr`,name:xe(e)};break;case 7:n={$type:`RailroadSpecialExpr`,text:xe(e)};break;case 4:n={$type:`RailroadSequenceExpr`,elements:[]};break;case 8:n={$type:`RailroadChoiceExpr`,alternatives:[]};break;case 5:n=Se(`RailroadOptionalExpr`);break;case 3:n=Se(`RailroadOneOrMoreExpr`);break;case 2:n=Se(`RailroadZeroOrMoreExpr`);break;default:e.fail(`an expression`)}if(`elements`in n||`alternatives`in n||`element`in n)e.i++,e.expect(11),t.push(n);else for(;;){let r=t[t.length-1];if(r===void 0)return n;if(`element`in r)r.element=n;else if((`elements`in r?r.elements:r.alternatives).push(n),e.accept(12))break;e.expect(13),t.pop(),n=r}}}function we(e){return M(e,be,`Railroad`,14,j,e=>{let t=e.expect(17);e.expect(9);let n=Ce(e);return e.expect(10),{$type:`RailroadRule`,name:t,definition:n}})}function Te(e,t){switch(e.$type){case`RailroadTerminalExpr`:return P(e.value);case`RailroadNonTerminalExpr`:return F(e.name);case`RailroadSpecialExpr`:return I(e.text);case`RailroadSequenceExpr`:return z(t);case`RailroadChoiceExpr`:return B(t);case`RailroadOptionalExpr`:return L(t[0]);default:return R(t[0],+(e.$type===`RailroadOneOrMoreExpr`))}}var Ee=e=>V(e,Te),De=O(`PEG_ID`),Oe=[D(`railroad-peg-beta`,De),E(`<-`),E(`;`),E(`/`),E(`&`),E(`!`),E(`?`),E(`*`),E(`+`),E(`(`),E(`)`),E(`.`),C,w,T,De,k(`PEG_STRING`),...A(`PEG`),{name:`PEG_LINE_COMMENT`,pattern:/#[^\n\r]*/y,hidden:!0,first:`#`}];function ke(e,t,n){let r={$type:`PegSequence`,elements:[]};return t.alternatives.push(r),{choice:t,sequence:r,node:e,operator:n}}function Ae(e){let t=[],n=ke(void 0,{$type:`PegOrderedChoice`,alternatives:[]},void 0);for(;;){let r=e.kind===4||e.kind===5?e.take():void 0,i;switch(e.kind){case 16:i={$type:`PegLiteral`,value:j(e.take())};break;case 15:i={$type:`PegIdentifier`,name:e.take()};break;case 11:i={$type:`PegAny`,dot:e.take()};break;case 9:{e.i++;let i={$type:`PegOrderedChoice`,alternatives:[]};t.push(n),n=ke({$type:`PegGroup`,element:i},i,r);continue}default:e.fail(`a literal, a name, a dot, or an opening parenthesis`)}for(;;){let a={$type:`PegSuffix`,primary:i};(e.kind===6||e.kind===7||e.kind===8)&&(a.operator=e.take()),n.sequence.elements.push(r===void 0?{$type:`PegPrefix`,suffix:a}:{$type:`PegPrefix`,operator:r,suffix:a});let o=e.kind;if(o===10&&t.length>0)e.i++,i=n.node,r=n.operator,n=t.pop();else{if(o===3)e.i++,n.sequence={$type:`PegSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==4&&o!==5&&o!==16&&o!==15&&o!==11&&o!==9){if(t.length===0)return n.choice;e.fail(`token of type ')'`)}break}}}}function je(e){return M(e,Oe,`RailroadPeg`,12,j,e=>{let t=e.expect(15);e.expect(1);let n={$type:`PegRule`,name:t,definition:Ae(e)};return e.expect(2),n})}function Me(e){switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}}function Ne(e,t){let n=t[0];switch(e.$type){case`PegOrderedChoice`:return B(t);case`PegSequence`:return z(t);case`PegPrefix`:return e.operator?I(e.operator+Me(n)):n;case`PegSuffix`:return e.operator?e.operator===`?`?L(n):R(n,+(e.operator===`+`)):n;case`PegLiteral`:return P(e.value);case`PegIdentifier`:return F(e.name);case`PegAny`:return I(e.dot);case`PegGroup`:return n}}var Pe=e=>V(e,Ne),Fe=class{type=`railroad`;notation=`railroad`;title;accTitle;accDescr;rules=[];byName=new Map;setTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
4
4
  `)}addRule(e){this.rules.push(e),this.byName.set(e.name,e)}getRule(e){return this.byName.get(e)}},Ie=/^\s*railroad-(ebnf-|abnf-|peg-)?beta/i;function Le(e){let t=Ie.exec(e);if(t===null)return;let n=t[1]?.toLowerCase();return n===`ebnf-`?`ebnf`:n===`abnf-`?`abnf`:n===`peg-`?`peg`:`railroad`}function Re(e,t){switch(t){case`ebnf`:{let t=ge(e);return[t,ve(t)]}case`abnf`:{let t=ie(e);return[t,oe(t)]}case`peg`:{let t=je(e);return[t,Pe(t)]}default:{let t=we(e);return[t,Ee(t)]}}}function ze(e,t,n){let[r,i]=Re(t,n);e.notation=n,r.accDescr&&e.setAccDescription(r.accDescr),r.accTitle&&e.setAccTitle(r.accTitle),r.title&&e.setTitle(r.title);for(let t of i)e.addRule(t)}function Be(e,t){let n=Le(e);if(n===void 0)throw new v(`No railroad diagram keyword found.`,`syntax`,{type:`railroad`});let r=new Fe;return t&&(r.title=t),ze(r,e,n),r}var Ve=12,He=6,Ue=18,Y=12,X=7;function Z(e,t,n,r){let i=e.railroad?.[t];return typeof i==`number`&&i>=0?Math.min(i,r):n}var We=/[\n\r\t]/g;function Q(e){return(e.includes(`¶ß`)?y(e.replace(/&/g,`&amp;`)):e).replace(We,e=>e===`