md-runbook 0.24.0 → 0.24.1

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 (3) hide show
  1. package/README.md +1 -1
  2. package/cli.js +73 -73
  3. package/package.json +1 -1
package/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var nd=Object.create;var Ps=Object.defineProperty;var rd=Object.getOwnPropertyDescriptor;var sd=Object.getOwnPropertyNames;var id=Object.getPrototypeOf,od=Object.prototype.hasOwnProperty;var Bd=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},ad=(r,e)=>{for(var t in e)Ps(r,t,{get:e[t],enumerable:!0})},Ta=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of sd(e))!od.call(r,s)&&s!==t&&Ps(r,s,{get:()=>e[s],enumerable:!(n=rd(e,s))||n.enumerable});return r};var ue=(r,e,t)=>(t=r!=null?nd(id(r)):{},Ta(e||!r||!r.__esModule?Ps(t,"default",{value:r,enumerable:!0}):t,r)),ud=r=>Ta(Ps({},"__esModule",{value:!0}),r);var Ef=Bd((gf,mf)=>{var Cf=(function(){var r=function(m,b){var w=236,R=17,y=m,T=t[b],v=null,E=0,S=null,O=[],P={},X=function(F,M){E=y*4+17,v=(function(A){for(var G=new Array(A),H=0;H<A;H+=1){G[H]=new Array(A);for(var J=0;J<A;J+=1)G[H][J]=null}return G})(E),Y(0,0),Y(E-7,0),Y(0,E-7),q(),ee(),te(F,M),y>=7&&se(F),S==null&&(S=Je(y,T,O)),ye(S,M)},Y=function(F,M){for(var A=-1;A<=7;A+=1)if(!(F+A<=-1||E<=F+A))for(var G=-1;G<=7;G+=1)M+G<=-1||E<=M+G||(0<=A&&A<=6&&(G==0||G==6)||0<=G&&G<=6&&(A==0||A==6)||2<=A&&A<=4&&2<=G&&G<=4?v[F+A][M+G]=!0:v[F+A][M+G]=!1)},W=function(){for(var F=0,M=0,A=0;A<8;A+=1){X(!0,A);var G=s.getLostPoint(P);(A==0||F>G)&&(F=G,M=A)}return M},ee=function(){for(var F=8;F<E-8;F+=1)v[F][6]==null&&(v[F][6]=F%2==0);for(var M=8;M<E-8;M+=1)v[6][M]==null&&(v[6][M]=M%2==0)},q=function(){for(var F=s.getPatternPosition(y),M=0;M<F.length;M+=1)for(var A=0;A<F.length;A+=1){var G=F[M],H=F[A];if(v[G][H]==null)for(var J=-2;J<=2;J+=1)for(var Q=-2;Q<=2;Q+=1)J==-2||J==2||Q==-2||Q==2||J==0&&Q==0?v[G+J][H+Q]=!0:v[G+J][H+Q]=!1}},se=function(F){for(var M=s.getBCHTypeNumber(y),A=0;A<18;A+=1){var G=!F&&(M>>A&1)==1;v[Math.floor(A/3)][A%3+E-8-3]=G}for(var A=0;A<18;A+=1){var G=!F&&(M>>A&1)==1;v[A%3+E-8-3][Math.floor(A/3)]=G}},te=function(F,M){for(var A=T<<3|M,G=s.getBCHTypeInfo(A),H=0;H<15;H+=1){var J=!F&&(G>>H&1)==1;H<6?v[H][8]=J:H<8?v[H+1][8]=J:v[E-15+H][8]=J}for(var H=0;H<15;H+=1){var J=!F&&(G>>H&1)==1;H<8?v[8][E-H-1]=J:H<9?v[8][15-H-1+1]=J:v[8][15-H-1]=J}v[E-8][8]=!F},ye=function(F,M){for(var A=-1,G=E-1,H=7,J=0,Q=s.getMaskFunction(M),z=E-1;z>0;z-=2)for(z==6&&(z-=1);;){for(var le=0;le<2;le+=1)if(v[G][z-le]==null){var ke=!1;J<F.length&&(ke=(F[J]>>>H&1)==1);var V=Q(G,z-le);V&&(ke=!ke),v[G][z-le]=ke,H-=1,H==-1&&(J+=1,H=7)}if(G+=A,G<0||E<=G){G-=A,A=-A;break}}},ge=function(F,M){for(var A=0,G=0,H=0,J=new Array(M.length),Q=new Array(M.length),z=0;z<M.length;z+=1){var le=M[z].dataCount,ke=M[z].totalCount-le;G=Math.max(G,le),H=Math.max(H,ke),J[z]=new Array(le);for(var V=0;V<J[z].length;V+=1)J[z][V]=255&F.getBuffer()[V+A];A+=le;var Me=s.getErrorCorrectPolynomial(ke),tt=o(J[z],Me.getLength()-1),Wn=tt.mod(Me);Q[z]=new Array(Me.getLength()-1);for(var V=0;V<Q[z].length;V+=1){var en=V+Wn.getLength()-Q[z].length;Q[z][V]=en>=0?Wn.getAt(en):0}}for(var mn=0,V=0;V<M.length;V+=1)mn+=M[V].totalCount;for(var tn=new Array(mn),nn=0,V=0;V<G;V+=1)for(var z=0;z<M.length;z+=1)V<J[z].length&&(tn[nn]=J[z][V],nn+=1);for(var V=0;V<H;V+=1)for(var z=0;z<M.length;z+=1)V<Q[z].length&&(tn[nn]=Q[z][V],nn+=1);return tn},Je=function(F,M,A){for(var G=B.getRSBlocks(F,M),H=a(),J=0;J<A.length;J+=1){var Q=A[J];H.put(Q.getMode(),4),H.put(Q.getLength(),s.getLengthInBits(Q.getMode(),F)),Q.write(H)}for(var z=0,J=0;J<G.length;J+=1)z+=G[J].dataCount;if(H.getLengthInBits()>z*8)throw"code length overflow. ("+H.getLengthInBits()+">"+z*8+")";for(H.getLengthInBits()+4<=z*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=z*8||(H.put(w,8),H.getLengthInBits()>=z*8));)H.put(R,8);return ge(H,G)};P.addData=function(F,M){M=M||"Byte";var A=null;switch(M){case"Numeric":A=l(F);break;case"Alphanumeric":A=c(F);break;case"Byte":A=u(F);break;case"Kanji":A=f(F);break;default:throw"mode:"+M}O.push(A),S=null},P.isDark=function(F,M){if(F<0||E<=F||M<0||E<=M)throw F+","+M;return v[F][M]},P.getModuleCount=function(){return E},P.make=function(){if(y<1){for(var F=1;F<40;F++){for(var M=B.getRSBlocks(F,T),A=a(),G=0;G<O.length;G++){var H=O[G];A.put(H.getMode(),4),A.put(H.getLength(),s.getLengthInBits(H.getMode(),F)),H.write(A)}for(var J=0,G=0;G<M.length;G++)J+=M[G].dataCount;if(A.getLengthInBits()<=J*8)break}y=F}X(!1,W())},P.createTableTag=function(F,M){F=F||2,M=typeof M>"u"?F*4:M;var A="";A+='<table style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: "+M+"px;",A+='">',A+="<tbody>";for(var G=0;G<P.getModuleCount();G+=1){A+="<tr>";for(var H=0;H<P.getModuleCount();H+=1)A+='<td style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: 0px;",A+=" width: "+F+"px;",A+=" height: "+F+"px;",A+=" background-color: ",A+=P.isDark(G,H)?"#000000":"#ffffff",A+=";",A+='"/>';A+="</tr>"}return A+="</tbody>",A+="</table>",A},P.createSvgTag=function(F,M,A,G){var H={};typeof arguments[0]=="object"&&(H=arguments[0],F=H.cellSize,M=H.margin,A=H.alt,G=H.title),F=F||2,M=typeof M>"u"?F*4:M,A=typeof A=="string"?{text:A}:A||{},A.text=A.text||null,A.id=A.text?A.id||"qrcode-description":null,G=typeof G=="string"?{text:G}:G||{},G.text=G.text||null,G.id=G.text?G.id||"qrcode-title":null;var J=P.getModuleCount()*F+M*2,Q,z,le,ke,V="",Me;for(Me="l"+F+",0 0,"+F+" -"+F+",0 0,-"+F+"z ",V+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',V+=H.scalable?"":' width="'+J+'px" height="'+J+'px"',V+=' viewBox="0 0 '+J+" "+J+'" ',V+=' preserveAspectRatio="xMinYMin meet"',V+=G.text||A.text?' role="img" aria-labelledby="'+De([G.id,A.id].join(" ").trim())+'"':"",V+=">",V+=G.text?'<title id="'+De(G.id)+'">'+De(G.text)+"</title>":"",V+=A.text?'<description id="'+De(A.id)+'">'+De(A.text)+"</description>":"",V+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',V+='<path d="',le=0;le<P.getModuleCount();le+=1)for(ke=le*F+M,Q=0;Q<P.getModuleCount();Q+=1)P.isDark(le,Q)&&(z=Q*F+M,V+="M"+z+","+ke+Me);return V+='" stroke="transparent" fill="black"/>',V+="</svg>",V},P.createDataURL=function(F,M){F=F||2,M=typeof M>"u"?F*4:M;var A=P.getModuleCount()*F+M*2,G=M,H=A-M;return D(A,A,function(J,Q){if(G<=J&&J<H&&G<=Q&&Q<H){var z=Math.floor((J-G)/F),le=Math.floor((Q-G)/F);return P.isDark(le,z)?0:1}else return 1})},P.createImgTag=function(F,M,A){F=F||2,M=typeof M>"u"?F*4:M;var G=P.getModuleCount()*F+M*2,H="";return H+="<img",H+=' src="',H+=P.createDataURL(F,M),H+='"',H+=' width="',H+=G,H+='"',H+=' height="',H+=G,H+='"',A&&(H+=' alt="',H+=De(A),H+='"'),H+="/>",H};var De=function(F){for(var M="",A=0;A<F.length;A+=1){var G=F.charAt(A);switch(G){case"<":M+="&lt;";break;case">":M+="&gt;";break;case"&":M+="&amp;";break;case'"':M+="&quot;";break;default:M+=G;break}}return M},be=function(F){var M=1;F=typeof F>"u"?M*2:F;var A=P.getModuleCount()*M+F*2,G=F,H=A-F,J,Q,z,le,ke,V={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},Me={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},tt="";for(J=0;J<A;J+=2){for(z=Math.floor((J-G)/M),le=Math.floor((J+1-G)/M),Q=0;Q<A;Q+=1)ke="\u2588",G<=Q&&Q<H&&G<=J&&J<H&&P.isDark(z,Math.floor((Q-G)/M))&&(ke=" "),G<=Q&&Q<H&&G<=J+1&&J+1<H&&P.isDark(le,Math.floor((Q-G)/M))?ke+=" ":ke+="\u2588",tt+=F<1&&J+1>=H?Me[ke]:V[ke];tt+=`
3
- `}return A%2&&F>0?tt.substring(0,tt.length-A-1)+Array(A+1).join("\u2580"):tt.substring(0,tt.length-1)};return P.createASCII=function(F,M){if(F=F||1,F<2)return be(M);F-=1,M=typeof M>"u"?F*2:M;var A=P.getModuleCount()*F+M*2,G=M,H=A-M,J,Q,z,le,ke=Array(F+1).join("\u2588\u2588"),V=Array(F+1).join(" "),Me="",tt="";for(J=0;J<A;J+=1){for(z=Math.floor((J-G)/F),tt="",Q=0;Q<A;Q+=1)le=1,G<=Q&&Q<H&&G<=J&&J<H&&P.isDark(z,Math.floor((Q-G)/F))&&(le=0),tt+=le?ke:V;for(z=0;z<F;z+=1)Me+=tt+`
4
- `}return Me.substring(0,Me.length-1)},P.renderTo2dContext=function(F,M){M=M||2;for(var A=P.getModuleCount(),G=0;G<A;G++)for(var H=0;H<A;H++)F.fillStyle=P.isDark(G,H)?"black":"white",F.fillRect(H*M,G*M,M,M)},P};r.stringToBytesFuncs={default:function(m){for(var b=[],w=0;w<m.length;w+=1){var R=m.charCodeAt(w);b.push(R&255)}return b}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(m,b){var w=(function(){for(var y=p(m),T=function(){var ee=y.read();if(ee==-1)throw"eof";return ee},v=0,E={};;){var S=y.read();if(S==-1)break;var O=T(),P=T(),X=T(),Y=String.fromCharCode(S<<8|O),W=P<<8|X;E[Y]=W,v+=1}if(v!=b)throw v+" != "+b;return E})(),R=63;return function(y){for(var T=[],v=0;v<y.length;v+=1){var E=y.charCodeAt(v);if(E<128)T.push(E);else{var S=w[y.charAt(v)];typeof S=="number"?(S&255)==S?T.push(S):(T.push(S>>>8),T.push(S&255)):T.push(R)}}return T}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=(function(){var m=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],b=1335,w=7973,R=21522,y={},T=function(v){for(var E=0;v!=0;)E+=1,v>>>=1;return E};return y.getBCHTypeInfo=function(v){for(var E=v<<10;T(E)-T(b)>=0;)E^=b<<T(E)-T(b);return(v<<10|E)^R},y.getBCHTypeNumber=function(v){for(var E=v<<12;T(E)-T(w)>=0;)E^=w<<T(E)-T(w);return v<<12|E},y.getPatternPosition=function(v){return m[v-1]},y.getMaskFunction=function(v){switch(v){case n.PATTERN000:return function(E,S){return(E+S)%2==0};case n.PATTERN001:return function(E,S){return E%2==0};case n.PATTERN010:return function(E,S){return S%3==0};case n.PATTERN011:return function(E,S){return(E+S)%3==0};case n.PATTERN100:return function(E,S){return(Math.floor(E/2)+Math.floor(S/3))%2==0};case n.PATTERN101:return function(E,S){return E*S%2+E*S%3==0};case n.PATTERN110:return function(E,S){return(E*S%2+E*S%3)%2==0};case n.PATTERN111:return function(E,S){return(E*S%3+(E+S)%2)%2==0};default:throw"bad maskPattern:"+v}},y.getErrorCorrectPolynomial=function(v){for(var E=o([1],0),S=0;S<v;S+=1)E=E.multiply(o([1,i.gexp(S)],0));return E},y.getLengthInBits=function(v,E){if(1<=E&&E<10)switch(v){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+v}else if(E<27)switch(v){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+v}else if(E<41)switch(v){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+v}else throw"type:"+E},y.getLostPoint=function(v){for(var E=v.getModuleCount(),S=0,O=0;O<E;O+=1)for(var P=0;P<E;P+=1){for(var X=0,Y=v.isDark(O,P),W=-1;W<=1;W+=1)if(!(O+W<0||E<=O+W))for(var ee=-1;ee<=1;ee+=1)P+ee<0||E<=P+ee||W==0&&ee==0||Y==v.isDark(O+W,P+ee)&&(X+=1);X>5&&(S+=3+X-5)}for(var O=0;O<E-1;O+=1)for(var P=0;P<E-1;P+=1){var q=0;v.isDark(O,P)&&(q+=1),v.isDark(O+1,P)&&(q+=1),v.isDark(O,P+1)&&(q+=1),v.isDark(O+1,P+1)&&(q+=1),(q==0||q==4)&&(S+=3)}for(var O=0;O<E;O+=1)for(var P=0;P<E-6;P+=1)v.isDark(O,P)&&!v.isDark(O,P+1)&&v.isDark(O,P+2)&&v.isDark(O,P+3)&&v.isDark(O,P+4)&&!v.isDark(O,P+5)&&v.isDark(O,P+6)&&(S+=40);for(var P=0;P<E;P+=1)for(var O=0;O<E-6;O+=1)v.isDark(O,P)&&!v.isDark(O+1,P)&&v.isDark(O+2,P)&&v.isDark(O+3,P)&&v.isDark(O+4,P)&&!v.isDark(O+5,P)&&v.isDark(O+6,P)&&(S+=40);for(var se=0,P=0;P<E;P+=1)for(var O=0;O<E;O+=1)v.isDark(O,P)&&(se+=1);var te=Math.abs(100*se/E/E-50)/5;return S+=te*10,S},y})(),i=(function(){for(var m=new Array(256),b=new Array(256),w=0;w<8;w+=1)m[w]=1<<w;for(var w=8;w<256;w+=1)m[w]=m[w-4]^m[w-5]^m[w-6]^m[w-8];for(var w=0;w<255;w+=1)b[m[w]]=w;var R={};return R.glog=function(y){if(y<1)throw"glog("+y+")";return b[y]},R.gexp=function(y){for(;y<0;)y+=255;for(;y>=256;)y-=255;return m[y]},R})();function o(m,b){if(typeof m.length>"u")throw m.length+"/"+b;var w=(function(){for(var y=0;y<m.length&&m[y]==0;)y+=1;for(var T=new Array(m.length-y+b),v=0;v<m.length-y;v+=1)T[v]=m[v+y];return T})(),R={};return R.getAt=function(y){return w[y]},R.getLength=function(){return w.length},R.multiply=function(y){for(var T=new Array(R.getLength()+y.getLength()-1),v=0;v<R.getLength();v+=1)for(var E=0;E<y.getLength();E+=1)T[v+E]^=i.gexp(i.glog(R.getAt(v))+i.glog(y.getAt(E)));return o(T,0)},R.mod=function(y){if(R.getLength()-y.getLength()<0)return R;for(var T=i.glog(R.getAt(0))-i.glog(y.getAt(0)),v=new Array(R.getLength()),E=0;E<R.getLength();E+=1)v[E]=R.getAt(E);for(var E=0;E<y.getLength();E+=1)v[E]^=i.gexp(i.glog(y.getAt(E))+T);return o(v,0).mod(y)},R}var B=(function(){var m=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],b=function(y,T){var v={};return v.totalCount=y,v.dataCount=T,v},w={},R=function(y,T){switch(T){case t.L:return m[(y-1)*4+0];case t.M:return m[(y-1)*4+1];case t.Q:return m[(y-1)*4+2];case t.H:return m[(y-1)*4+3];default:return}};return w.getRSBlocks=function(y,T){var v=R(y,T);if(typeof v>"u")throw"bad rs block @ typeNumber:"+y+"/errorCorrectionLevel:"+T;for(var E=v.length/3,S=[],O=0;O<E;O+=1)for(var P=v[O*3+0],X=v[O*3+1],Y=v[O*3+2],W=0;W<P;W+=1)S.push(b(X,Y));return S},w})(),a=function(){var m=[],b=0,w={};return w.getBuffer=function(){return m},w.getAt=function(R){var y=Math.floor(R/8);return(m[y]>>>7-R%8&1)==1},w.put=function(R,y){for(var T=0;T<y;T+=1)w.putBit((R>>>y-T-1&1)==1)},w.getLengthInBits=function(){return b},w.putBit=function(R){var y=Math.floor(b/8);m.length<=y&&m.push(0),R&&(m[y]|=128>>>b%8),b+=1},w},l=function(m){var b=e.MODE_NUMBER,w=m,R={};R.getMode=function(){return b},R.getLength=function(v){return w.length},R.write=function(v){for(var E=w,S=0;S+2<E.length;)v.put(y(E.substring(S,S+3)),10),S+=3;S<E.length&&(E.length-S==1?v.put(y(E.substring(S,S+1)),4):E.length-S==2&&v.put(y(E.substring(S,S+2)),7))};var y=function(v){for(var E=0,S=0;S<v.length;S+=1)E=E*10+T(v.charAt(S));return E},T=function(v){if("0"<=v&&v<="9")return v.charCodeAt(0)-48;throw"illegal char :"+v};return R},c=function(m){var b=e.MODE_ALPHA_NUM,w=m,R={};R.getMode=function(){return b},R.getLength=function(T){return w.length},R.write=function(T){for(var v=w,E=0;E+1<v.length;)T.put(y(v.charAt(E))*45+y(v.charAt(E+1)),11),E+=2;E<v.length&&T.put(y(v.charAt(E)),6)};var y=function(T){if("0"<=T&&T<="9")return T.charCodeAt(0)-48;if("A"<=T&&T<="Z")return T.charCodeAt(0)-65+10;switch(T){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+T}};return R},u=function(m){var b=e.MODE_8BIT_BYTE,w=m,R=r.stringToBytes(m),y={};return y.getMode=function(){return b},y.getLength=function(T){return R.length},y.write=function(T){for(var v=0;v<R.length;v+=1)T.put(R[v],8)},y},f=function(m){var b=e.MODE_KANJI,w=m,R=r.stringToBytesFuncs.SJIS;if(!R)throw"sjis not supported.";(function(v,E){var S=R(v);if(S.length!=2||(S[0]<<8|S[1])!=E)throw"sjis not supported."})("\u53CB",38726);var y=R(m),T={};return T.getMode=function(){return b},T.getLength=function(v){return~~(y.length/2)},T.write=function(v){for(var E=y,S=0;S+1<E.length;){var O=(255&E[S])<<8|255&E[S+1];if(33088<=O&&O<=40956)O-=33088;else if(57408<=O&&O<=60351)O-=49472;else throw"illegal char at "+(S+1)+"/"+O;O=(O>>>8&255)*192+(O&255),v.put(O,13),S+=2}if(S<E.length)throw"illegal char at "+(S+1)},T},d=function(){var m=[],b={};return b.writeByte=function(w){m.push(w&255)},b.writeShort=function(w){b.writeByte(w),b.writeByte(w>>>8)},b.writeBytes=function(w,R,y){R=R||0,y=y||w.length;for(var T=0;T<y;T+=1)b.writeByte(w[T+R])},b.writeString=function(w){for(var R=0;R<w.length;R+=1)b.writeByte(w.charCodeAt(R))},b.toByteArray=function(){return m},b.toString=function(){var w="";w+="[";for(var R=0;R<m.length;R+=1)R>0&&(w+=","),w+=m[R];return w+="]",w},b},h=function(){var m=0,b=0,w=0,R="",y={},T=function(E){R+=String.fromCharCode(v(E&63))},v=function(E){if(!(E<0)){if(E<26)return 65+E;if(E<52)return 97+(E-26);if(E<62)return 48+(E-52);if(E==62)return 43;if(E==63)return 47}throw"n:"+E};return y.writeByte=function(E){for(m=m<<8|E&255,b+=8,w+=1;b>=6;)T(m>>>b-6),b-=6},y.flush=function(){if(b>0&&(T(m<<6-b),m=0,b=0),w%3!=0)for(var E=3-w%3,S=0;S<E;S+=1)R+="="},y.toString=function(){return R},y},p=function(m){var b=m,w=0,R=0,y=0,T={};T.read=function(){for(;y<8;){if(w>=b.length){if(y==0)return-1;throw"unexpected end of file./"+y}var E=b.charAt(w);if(w+=1,E=="=")return y=0,-1;if(E.match(/^\s$/))continue;R=R<<6|v(E.charCodeAt(0)),y+=6}var S=R>>>y-8&255;return y-=8,S};var v=function(E){if(65<=E&&E<=90)return E-65;if(97<=E&&E<=122)return E-97+26;if(48<=E&&E<=57)return E-48+52;if(E==43)return 62;if(E==47)return 63;throw"c:"+E};return T},k=function(m,b){var w=m,R=b,y=new Array(m*b),T={};T.setPixel=function(O,P,X){y[P*w+O]=X},T.write=function(O){O.writeString("GIF87a"),O.writeShort(w),O.writeShort(R),O.writeByte(128),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(255),O.writeByte(255),O.writeByte(255),O.writeString(","),O.writeShort(0),O.writeShort(0),O.writeShort(w),O.writeShort(R),O.writeByte(0);var P=2,X=E(P);O.writeByte(P);for(var Y=0;X.length-Y>255;)O.writeByte(255),O.writeBytes(X,Y,255),Y+=255;O.writeByte(X.length-Y),O.writeBytes(X,Y,X.length-Y),O.writeByte(0),O.writeString(";")};var v=function(O){var P=O,X=0,Y=0,W={};return W.write=function(ee,q){if(ee>>>q)throw"length over";for(;X+q>=8;)P.writeByte(255&(ee<<X|Y)),q-=8-X,ee>>>=8-X,Y=0,X=0;Y=ee<<X|Y,X=X+q},W.flush=function(){X>0&&P.writeByte(Y)},W},E=function(O){for(var P=1<<O,X=(1<<O)+1,Y=O+1,W=S(),ee=0;ee<P;ee+=1)W.add(String.fromCharCode(ee));W.add(String.fromCharCode(P)),W.add(String.fromCharCode(X));var q=d(),se=v(q);se.write(P,Y);var te=0,ye=String.fromCharCode(y[te]);for(te+=1;te<y.length;){var ge=String.fromCharCode(y[te]);te+=1,W.contains(ye+ge)?ye=ye+ge:(se.write(W.indexOf(ye),Y),W.size()<4095&&(W.size()==1<<Y&&(Y+=1),W.add(ye+ge)),ye=ge)}return se.write(W.indexOf(ye),Y),se.write(X,Y),se.flush(),q.toByteArray()},S=function(){var O={},P=0,X={};return X.add=function(Y){if(X.contains(Y))throw"dup key:"+Y;O[Y]=P,P+=1},X.size=function(){return P},X.indexOf=function(Y){return O[Y]},X.contains=function(Y){return typeof O[Y]<"u"},X};return T},D=function(m,b,w){for(var R=k(m,b),y=0;y<b;y+=1)for(var T=0;T<m;T+=1)R.setPixel(T,y,w(T,y));var v=d();R.write(v);for(var E=h(),S=v.toByteArray(),O=0;O<S.length;O+=1)E.writeByte(S[O]);return E.flush(),"data:image/gif;base64,"+E};return r})();(function(){Cf.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var i=t.charCodeAt(s);i<128?n.push(i):i<2048?n.push(192|i>>6,128|i&63):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|i&63):(s++,i=65536+((i&1023)<<10|t.charCodeAt(s)&1023),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof gf=="object"&&(mf.exports=r())})(function(){return Cf})});var GC={};ad(GC,{estimate:()=>zf,lint:()=>Kf,main:()=>Yf,parseArgs:()=>jf});module.exports=ud(GC);var Ve=ue(require("node:fs")),yt=ue(require("node:path"));var Ia={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function $e(r){return typeof r=="string"}function La(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&$e(e.lead)&&$e(e.content)&&$e(e.trail)&&(e.eol===`
2
+ "use strict";var nd=Object.create;var Ps=Object.defineProperty;var rd=Object.getOwnPropertyDescriptor;var sd=Object.getOwnPropertyNames;var id=Object.getPrototypeOf,od=Object.prototype.hasOwnProperty;var Bd=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},ad=(r,e)=>{for(var t in e)Ps(r,t,{get:e[t],enumerable:!0})},Ta=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of sd(e))!od.call(r,s)&&s!==t&&Ps(r,s,{get:()=>e[s],enumerable:!(n=rd(e,s))||n.enumerable});return r};var ue=(r,e,t)=>(t=r!=null?nd(id(r)):{},Ta(e||!r||!r.__esModule?Ps(t,"default",{value:r,enumerable:!0}):t,r)),ud=r=>Ta(Ps({},"__esModule",{value:!0}),r);var Ef=Bd((gf,mf)=>{var Cf=(function(){var r=function(m,b){var w=236,R=17,y=m,T=t[b],v=null,E=0,S=null,O=[],P={},X=function($,M){E=y*4+17,v=(function(A){for(var G=new Array(A),H=0;H<A;H+=1){G[H]=new Array(A);for(var J=0;J<A;J+=1)G[H][J]=null}return G})(E),q(0,0),q(E-7,0),q(0,E-7),Y(),ee(),te($,M),y>=7&&se($),S==null&&(S=Je(y,T,O)),ye(S,M)},q=function($,M){for(var A=-1;A<=7;A+=1)if(!($+A<=-1||E<=$+A))for(var G=-1;G<=7;G+=1)M+G<=-1||E<=M+G||(0<=A&&A<=6&&(G==0||G==6)||0<=G&&G<=6&&(A==0||A==6)||2<=A&&A<=4&&2<=G&&G<=4?v[$+A][M+G]=!0:v[$+A][M+G]=!1)},W=function(){for(var $=0,M=0,A=0;A<8;A+=1){X(!0,A);var G=s.getLostPoint(P);(A==0||$>G)&&($=G,M=A)}return M},ee=function(){for(var $=8;$<E-8;$+=1)v[$][6]==null&&(v[$][6]=$%2==0);for(var M=8;M<E-8;M+=1)v[6][M]==null&&(v[6][M]=M%2==0)},Y=function(){for(var $=s.getPatternPosition(y),M=0;M<$.length;M+=1)for(var A=0;A<$.length;A+=1){var G=$[M],H=$[A];if(v[G][H]==null)for(var J=-2;J<=2;J+=1)for(var Q=-2;Q<=2;Q+=1)J==-2||J==2||Q==-2||Q==2||J==0&&Q==0?v[G+J][H+Q]=!0:v[G+J][H+Q]=!1}},se=function($){for(var M=s.getBCHTypeNumber(y),A=0;A<18;A+=1){var G=!$&&(M>>A&1)==1;v[Math.floor(A/3)][A%3+E-8-3]=G}for(var A=0;A<18;A+=1){var G=!$&&(M>>A&1)==1;v[A%3+E-8-3][Math.floor(A/3)]=G}},te=function($,M){for(var A=T<<3|M,G=s.getBCHTypeInfo(A),H=0;H<15;H+=1){var J=!$&&(G>>H&1)==1;H<6?v[H][8]=J:H<8?v[H+1][8]=J:v[E-15+H][8]=J}for(var H=0;H<15;H+=1){var J=!$&&(G>>H&1)==1;H<8?v[8][E-H-1]=J:H<9?v[8][15-H-1+1]=J:v[8][15-H-1]=J}v[E-8][8]=!$},ye=function($,M){for(var A=-1,G=E-1,H=7,J=0,Q=s.getMaskFunction(M),z=E-1;z>0;z-=2)for(z==6&&(z-=1);;){for(var le=0;le<2;le+=1)if(v[G][z-le]==null){var ke=!1;J<$.length&&(ke=($[J]>>>H&1)==1);var V=Q(G,z-le);V&&(ke=!ke),v[G][z-le]=ke,H-=1,H==-1&&(J+=1,H=7)}if(G+=A,G<0||E<=G){G-=A,A=-A;break}}},ge=function($,M){for(var A=0,G=0,H=0,J=new Array(M.length),Q=new Array(M.length),z=0;z<M.length;z+=1){var le=M[z].dataCount,ke=M[z].totalCount-le;G=Math.max(G,le),H=Math.max(H,ke),J[z]=new Array(le);for(var V=0;V<J[z].length;V+=1)J[z][V]=255&$.getBuffer()[V+A];A+=le;var Me=s.getErrorCorrectPolynomial(ke),tt=o(J[z],Me.getLength()-1),Wn=tt.mod(Me);Q[z]=new Array(Me.getLength()-1);for(var V=0;V<Q[z].length;V+=1){var en=V+Wn.getLength()-Q[z].length;Q[z][V]=en>=0?Wn.getAt(en):0}}for(var mn=0,V=0;V<M.length;V+=1)mn+=M[V].totalCount;for(var tn=new Array(mn),nn=0,V=0;V<G;V+=1)for(var z=0;z<M.length;z+=1)V<J[z].length&&(tn[nn]=J[z][V],nn+=1);for(var V=0;V<H;V+=1)for(var z=0;z<M.length;z+=1)V<Q[z].length&&(tn[nn]=Q[z][V],nn+=1);return tn},Je=function($,M,A){for(var G=B.getRSBlocks($,M),H=a(),J=0;J<A.length;J+=1){var Q=A[J];H.put(Q.getMode(),4),H.put(Q.getLength(),s.getLengthInBits(Q.getMode(),$)),Q.write(H)}for(var z=0,J=0;J<G.length;J+=1)z+=G[J].dataCount;if(H.getLengthInBits()>z*8)throw"code length overflow. ("+H.getLengthInBits()+">"+z*8+")";for(H.getLengthInBits()+4<=z*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=z*8||(H.put(w,8),H.getLengthInBits()>=z*8));)H.put(R,8);return ge(H,G)};P.addData=function($,M){M=M||"Byte";var A=null;switch(M){case"Numeric":A=l($);break;case"Alphanumeric":A=c($);break;case"Byte":A=u($);break;case"Kanji":A=f($);break;default:throw"mode:"+M}O.push(A),S=null},P.isDark=function($,M){if($<0||E<=$||M<0||E<=M)throw $+","+M;return v[$][M]},P.getModuleCount=function(){return E},P.make=function(){if(y<1){for(var $=1;$<40;$++){for(var M=B.getRSBlocks($,T),A=a(),G=0;G<O.length;G++){var H=O[G];A.put(H.getMode(),4),A.put(H.getLength(),s.getLengthInBits(H.getMode(),$)),H.write(A)}for(var J=0,G=0;G<M.length;G++)J+=M[G].dataCount;if(A.getLengthInBits()<=J*8)break}y=$}X(!1,W())},P.createTableTag=function($,M){$=$||2,M=typeof M>"u"?$*4:M;var A="";A+='<table style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: "+M+"px;",A+='">',A+="<tbody>";for(var G=0;G<P.getModuleCount();G+=1){A+="<tr>";for(var H=0;H<P.getModuleCount();H+=1)A+='<td style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: 0px;",A+=" width: "+$+"px;",A+=" height: "+$+"px;",A+=" background-color: ",A+=P.isDark(G,H)?"#000000":"#ffffff",A+=";",A+='"/>';A+="</tr>"}return A+="</tbody>",A+="</table>",A},P.createSvgTag=function($,M,A,G){var H={};typeof arguments[0]=="object"&&(H=arguments[0],$=H.cellSize,M=H.margin,A=H.alt,G=H.title),$=$||2,M=typeof M>"u"?$*4:M,A=typeof A=="string"?{text:A}:A||{},A.text=A.text||null,A.id=A.text?A.id||"qrcode-description":null,G=typeof G=="string"?{text:G}:G||{},G.text=G.text||null,G.id=G.text?G.id||"qrcode-title":null;var J=P.getModuleCount()*$+M*2,Q,z,le,ke,V="",Me;for(Me="l"+$+",0 0,"+$+" -"+$+",0 0,-"+$+"z ",V+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',V+=H.scalable?"":' width="'+J+'px" height="'+J+'px"',V+=' viewBox="0 0 '+J+" "+J+'" ',V+=' preserveAspectRatio="xMinYMin meet"',V+=G.text||A.text?' role="img" aria-labelledby="'+De([G.id,A.id].join(" ").trim())+'"':"",V+=">",V+=G.text?'<title id="'+De(G.id)+'">'+De(G.text)+"</title>":"",V+=A.text?'<description id="'+De(A.id)+'">'+De(A.text)+"</description>":"",V+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',V+='<path d="',le=0;le<P.getModuleCount();le+=1)for(ke=le*$+M,Q=0;Q<P.getModuleCount();Q+=1)P.isDark(le,Q)&&(z=Q*$+M,V+="M"+z+","+ke+Me);return V+='" stroke="transparent" fill="black"/>',V+="</svg>",V},P.createDataURL=function($,M){$=$||2,M=typeof M>"u"?$*4:M;var A=P.getModuleCount()*$+M*2,G=M,H=A-M;return D(A,A,function(J,Q){if(G<=J&&J<H&&G<=Q&&Q<H){var z=Math.floor((J-G)/$),le=Math.floor((Q-G)/$);return P.isDark(le,z)?0:1}else return 1})},P.createImgTag=function($,M,A){$=$||2,M=typeof M>"u"?$*4:M;var G=P.getModuleCount()*$+M*2,H="";return H+="<img",H+=' src="',H+=P.createDataURL($,M),H+='"',H+=' width="',H+=G,H+='"',H+=' height="',H+=G,H+='"',A&&(H+=' alt="',H+=De(A),H+='"'),H+="/>",H};var De=function($){for(var M="",A=0;A<$.length;A+=1){var G=$.charAt(A);switch(G){case"<":M+="&lt;";break;case">":M+="&gt;";break;case"&":M+="&amp;";break;case'"':M+="&quot;";break;default:M+=G;break}}return M},be=function($){var M=1;$=typeof $>"u"?M*2:$;var A=P.getModuleCount()*M+$*2,G=$,H=A-$,J,Q,z,le,ke,V={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},Me={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},tt="";for(J=0;J<A;J+=2){for(z=Math.floor((J-G)/M),le=Math.floor((J+1-G)/M),Q=0;Q<A;Q+=1)ke="\u2588",G<=Q&&Q<H&&G<=J&&J<H&&P.isDark(z,Math.floor((Q-G)/M))&&(ke=" "),G<=Q&&Q<H&&G<=J+1&&J+1<H&&P.isDark(le,Math.floor((Q-G)/M))?ke+=" ":ke+="\u2588",tt+=$<1&&J+1>=H?Me[ke]:V[ke];tt+=`
3
+ `}return A%2&&$>0?tt.substring(0,tt.length-A-1)+Array(A+1).join("\u2580"):tt.substring(0,tt.length-1)};return P.createASCII=function($,M){if($=$||1,$<2)return be(M);$-=1,M=typeof M>"u"?$*2:M;var A=P.getModuleCount()*$+M*2,G=M,H=A-M,J,Q,z,le,ke=Array($+1).join("\u2588\u2588"),V=Array($+1).join(" "),Me="",tt="";for(J=0;J<A;J+=1){for(z=Math.floor((J-G)/$),tt="",Q=0;Q<A;Q+=1)le=1,G<=Q&&Q<H&&G<=J&&J<H&&P.isDark(z,Math.floor((Q-G)/$))&&(le=0),tt+=le?ke:V;for(z=0;z<$;z+=1)Me+=tt+`
4
+ `}return Me.substring(0,Me.length-1)},P.renderTo2dContext=function($,M){M=M||2;for(var A=P.getModuleCount(),G=0;G<A;G++)for(var H=0;H<A;H++)$.fillStyle=P.isDark(G,H)?"black":"white",$.fillRect(H*M,G*M,M,M)},P};r.stringToBytesFuncs={default:function(m){for(var b=[],w=0;w<m.length;w+=1){var R=m.charCodeAt(w);b.push(R&255)}return b}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(m,b){var w=(function(){for(var y=p(m),T=function(){var ee=y.read();if(ee==-1)throw"eof";return ee},v=0,E={};;){var S=y.read();if(S==-1)break;var O=T(),P=T(),X=T(),q=String.fromCharCode(S<<8|O),W=P<<8|X;E[q]=W,v+=1}if(v!=b)throw v+" != "+b;return E})(),R=63;return function(y){for(var T=[],v=0;v<y.length;v+=1){var E=y.charCodeAt(v);if(E<128)T.push(E);else{var S=w[y.charAt(v)];typeof S=="number"?(S&255)==S?T.push(S):(T.push(S>>>8),T.push(S&255)):T.push(R)}}return T}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=(function(){var m=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],b=1335,w=7973,R=21522,y={},T=function(v){for(var E=0;v!=0;)E+=1,v>>>=1;return E};return y.getBCHTypeInfo=function(v){for(var E=v<<10;T(E)-T(b)>=0;)E^=b<<T(E)-T(b);return(v<<10|E)^R},y.getBCHTypeNumber=function(v){for(var E=v<<12;T(E)-T(w)>=0;)E^=w<<T(E)-T(w);return v<<12|E},y.getPatternPosition=function(v){return m[v-1]},y.getMaskFunction=function(v){switch(v){case n.PATTERN000:return function(E,S){return(E+S)%2==0};case n.PATTERN001:return function(E,S){return E%2==0};case n.PATTERN010:return function(E,S){return S%3==0};case n.PATTERN011:return function(E,S){return(E+S)%3==0};case n.PATTERN100:return function(E,S){return(Math.floor(E/2)+Math.floor(S/3))%2==0};case n.PATTERN101:return function(E,S){return E*S%2+E*S%3==0};case n.PATTERN110:return function(E,S){return(E*S%2+E*S%3)%2==0};case n.PATTERN111:return function(E,S){return(E*S%3+(E+S)%2)%2==0};default:throw"bad maskPattern:"+v}},y.getErrorCorrectPolynomial=function(v){for(var E=o([1],0),S=0;S<v;S+=1)E=E.multiply(o([1,i.gexp(S)],0));return E},y.getLengthInBits=function(v,E){if(1<=E&&E<10)switch(v){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+v}else if(E<27)switch(v){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+v}else if(E<41)switch(v){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+v}else throw"type:"+E},y.getLostPoint=function(v){for(var E=v.getModuleCount(),S=0,O=0;O<E;O+=1)for(var P=0;P<E;P+=1){for(var X=0,q=v.isDark(O,P),W=-1;W<=1;W+=1)if(!(O+W<0||E<=O+W))for(var ee=-1;ee<=1;ee+=1)P+ee<0||E<=P+ee||W==0&&ee==0||q==v.isDark(O+W,P+ee)&&(X+=1);X>5&&(S+=3+X-5)}for(var O=0;O<E-1;O+=1)for(var P=0;P<E-1;P+=1){var Y=0;v.isDark(O,P)&&(Y+=1),v.isDark(O+1,P)&&(Y+=1),v.isDark(O,P+1)&&(Y+=1),v.isDark(O+1,P+1)&&(Y+=1),(Y==0||Y==4)&&(S+=3)}for(var O=0;O<E;O+=1)for(var P=0;P<E-6;P+=1)v.isDark(O,P)&&!v.isDark(O,P+1)&&v.isDark(O,P+2)&&v.isDark(O,P+3)&&v.isDark(O,P+4)&&!v.isDark(O,P+5)&&v.isDark(O,P+6)&&(S+=40);for(var P=0;P<E;P+=1)for(var O=0;O<E-6;O+=1)v.isDark(O,P)&&!v.isDark(O+1,P)&&v.isDark(O+2,P)&&v.isDark(O+3,P)&&v.isDark(O+4,P)&&!v.isDark(O+5,P)&&v.isDark(O+6,P)&&(S+=40);for(var se=0,P=0;P<E;P+=1)for(var O=0;O<E;O+=1)v.isDark(O,P)&&(se+=1);var te=Math.abs(100*se/E/E-50)/5;return S+=te*10,S},y})(),i=(function(){for(var m=new Array(256),b=new Array(256),w=0;w<8;w+=1)m[w]=1<<w;for(var w=8;w<256;w+=1)m[w]=m[w-4]^m[w-5]^m[w-6]^m[w-8];for(var w=0;w<255;w+=1)b[m[w]]=w;var R={};return R.glog=function(y){if(y<1)throw"glog("+y+")";return b[y]},R.gexp=function(y){for(;y<0;)y+=255;for(;y>=256;)y-=255;return m[y]},R})();function o(m,b){if(typeof m.length>"u")throw m.length+"/"+b;var w=(function(){for(var y=0;y<m.length&&m[y]==0;)y+=1;for(var T=new Array(m.length-y+b),v=0;v<m.length-y;v+=1)T[v]=m[v+y];return T})(),R={};return R.getAt=function(y){return w[y]},R.getLength=function(){return w.length},R.multiply=function(y){for(var T=new Array(R.getLength()+y.getLength()-1),v=0;v<R.getLength();v+=1)for(var E=0;E<y.getLength();E+=1)T[v+E]^=i.gexp(i.glog(R.getAt(v))+i.glog(y.getAt(E)));return o(T,0)},R.mod=function(y){if(R.getLength()-y.getLength()<0)return R;for(var T=i.glog(R.getAt(0))-i.glog(y.getAt(0)),v=new Array(R.getLength()),E=0;E<R.getLength();E+=1)v[E]=R.getAt(E);for(var E=0;E<y.getLength();E+=1)v[E]^=i.gexp(i.glog(y.getAt(E))+T);return o(v,0).mod(y)},R}var B=(function(){var m=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],b=function(y,T){var v={};return v.totalCount=y,v.dataCount=T,v},w={},R=function(y,T){switch(T){case t.L:return m[(y-1)*4+0];case t.M:return m[(y-1)*4+1];case t.Q:return m[(y-1)*4+2];case t.H:return m[(y-1)*4+3];default:return}};return w.getRSBlocks=function(y,T){var v=R(y,T);if(typeof v>"u")throw"bad rs block @ typeNumber:"+y+"/errorCorrectionLevel:"+T;for(var E=v.length/3,S=[],O=0;O<E;O+=1)for(var P=v[O*3+0],X=v[O*3+1],q=v[O*3+2],W=0;W<P;W+=1)S.push(b(X,q));return S},w})(),a=function(){var m=[],b=0,w={};return w.getBuffer=function(){return m},w.getAt=function(R){var y=Math.floor(R/8);return(m[y]>>>7-R%8&1)==1},w.put=function(R,y){for(var T=0;T<y;T+=1)w.putBit((R>>>y-T-1&1)==1)},w.getLengthInBits=function(){return b},w.putBit=function(R){var y=Math.floor(b/8);m.length<=y&&m.push(0),R&&(m[y]|=128>>>b%8),b+=1},w},l=function(m){var b=e.MODE_NUMBER,w=m,R={};R.getMode=function(){return b},R.getLength=function(v){return w.length},R.write=function(v){for(var E=w,S=0;S+2<E.length;)v.put(y(E.substring(S,S+3)),10),S+=3;S<E.length&&(E.length-S==1?v.put(y(E.substring(S,S+1)),4):E.length-S==2&&v.put(y(E.substring(S,S+2)),7))};var y=function(v){for(var E=0,S=0;S<v.length;S+=1)E=E*10+T(v.charAt(S));return E},T=function(v){if("0"<=v&&v<="9")return v.charCodeAt(0)-48;throw"illegal char :"+v};return R},c=function(m){var b=e.MODE_ALPHA_NUM,w=m,R={};R.getMode=function(){return b},R.getLength=function(T){return w.length},R.write=function(T){for(var v=w,E=0;E+1<v.length;)T.put(y(v.charAt(E))*45+y(v.charAt(E+1)),11),E+=2;E<v.length&&T.put(y(v.charAt(E)),6)};var y=function(T){if("0"<=T&&T<="9")return T.charCodeAt(0)-48;if("A"<=T&&T<="Z")return T.charCodeAt(0)-65+10;switch(T){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+T}};return R},u=function(m){var b=e.MODE_8BIT_BYTE,w=m,R=r.stringToBytes(m),y={};return y.getMode=function(){return b},y.getLength=function(T){return R.length},y.write=function(T){for(var v=0;v<R.length;v+=1)T.put(R[v],8)},y},f=function(m){var b=e.MODE_KANJI,w=m,R=r.stringToBytesFuncs.SJIS;if(!R)throw"sjis not supported.";(function(v,E){var S=R(v);if(S.length!=2||(S[0]<<8|S[1])!=E)throw"sjis not supported."})("\u53CB",38726);var y=R(m),T={};return T.getMode=function(){return b},T.getLength=function(v){return~~(y.length/2)},T.write=function(v){for(var E=y,S=0;S+1<E.length;){var O=(255&E[S])<<8|255&E[S+1];if(33088<=O&&O<=40956)O-=33088;else if(57408<=O&&O<=60351)O-=49472;else throw"illegal char at "+(S+1)+"/"+O;O=(O>>>8&255)*192+(O&255),v.put(O,13),S+=2}if(S<E.length)throw"illegal char at "+(S+1)},T},d=function(){var m=[],b={};return b.writeByte=function(w){m.push(w&255)},b.writeShort=function(w){b.writeByte(w),b.writeByte(w>>>8)},b.writeBytes=function(w,R,y){R=R||0,y=y||w.length;for(var T=0;T<y;T+=1)b.writeByte(w[T+R])},b.writeString=function(w){for(var R=0;R<w.length;R+=1)b.writeByte(w.charCodeAt(R))},b.toByteArray=function(){return m},b.toString=function(){var w="";w+="[";for(var R=0;R<m.length;R+=1)R>0&&(w+=","),w+=m[R];return w+="]",w},b},h=function(){var m=0,b=0,w=0,R="",y={},T=function(E){R+=String.fromCharCode(v(E&63))},v=function(E){if(!(E<0)){if(E<26)return 65+E;if(E<52)return 97+(E-26);if(E<62)return 48+(E-52);if(E==62)return 43;if(E==63)return 47}throw"n:"+E};return y.writeByte=function(E){for(m=m<<8|E&255,b+=8,w+=1;b>=6;)T(m>>>b-6),b-=6},y.flush=function(){if(b>0&&(T(m<<6-b),m=0,b=0),w%3!=0)for(var E=3-w%3,S=0;S<E;S+=1)R+="="},y.toString=function(){return R},y},p=function(m){var b=m,w=0,R=0,y=0,T={};T.read=function(){for(;y<8;){if(w>=b.length){if(y==0)return-1;throw"unexpected end of file./"+y}var E=b.charAt(w);if(w+=1,E=="=")return y=0,-1;if(E.match(/^\s$/))continue;R=R<<6|v(E.charCodeAt(0)),y+=6}var S=R>>>y-8&255;return y-=8,S};var v=function(E){if(65<=E&&E<=90)return E-65;if(97<=E&&E<=122)return E-97+26;if(48<=E&&E<=57)return E-48+52;if(E==43)return 62;if(E==47)return 63;throw"c:"+E};return T},k=function(m,b){var w=m,R=b,y=new Array(m*b),T={};T.setPixel=function(O,P,X){y[P*w+O]=X},T.write=function(O){O.writeString("GIF87a"),O.writeShort(w),O.writeShort(R),O.writeByte(128),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(255),O.writeByte(255),O.writeByte(255),O.writeString(","),O.writeShort(0),O.writeShort(0),O.writeShort(w),O.writeShort(R),O.writeByte(0);var P=2,X=E(P);O.writeByte(P);for(var q=0;X.length-q>255;)O.writeByte(255),O.writeBytes(X,q,255),q+=255;O.writeByte(X.length-q),O.writeBytes(X,q,X.length-q),O.writeByte(0),O.writeString(";")};var v=function(O){var P=O,X=0,q=0,W={};return W.write=function(ee,Y){if(ee>>>Y)throw"length over";for(;X+Y>=8;)P.writeByte(255&(ee<<X|q)),Y-=8-X,ee>>>=8-X,q=0,X=0;q=ee<<X|q,X=X+Y},W.flush=function(){X>0&&P.writeByte(q)},W},E=function(O){for(var P=1<<O,X=(1<<O)+1,q=O+1,W=S(),ee=0;ee<P;ee+=1)W.add(String.fromCharCode(ee));W.add(String.fromCharCode(P)),W.add(String.fromCharCode(X));var Y=d(),se=v(Y);se.write(P,q);var te=0,ye=String.fromCharCode(y[te]);for(te+=1;te<y.length;){var ge=String.fromCharCode(y[te]);te+=1,W.contains(ye+ge)?ye=ye+ge:(se.write(W.indexOf(ye),q),W.size()<4095&&(W.size()==1<<q&&(q+=1),W.add(ye+ge)),ye=ge)}return se.write(W.indexOf(ye),q),se.write(X,q),se.flush(),Y.toByteArray()},S=function(){var O={},P=0,X={};return X.add=function(q){if(X.contains(q))throw"dup key:"+q;O[q]=P,P+=1},X.size=function(){return P},X.indexOf=function(q){return O[q]},X.contains=function(q){return typeof O[q]<"u"},X};return T},D=function(m,b,w){for(var R=k(m,b),y=0;y<b;y+=1)for(var T=0;T<m;T+=1)R.setPixel(T,y,w(T,y));var v=d();R.write(v);for(var E=h(),S=v.toByteArray(),O=0;O<S.length;O+=1)E.writeByte(S[O]);return E.flush(),"data:image/gif;base64,"+E};return r})();(function(){Cf.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var i=t.charCodeAt(s);i<128?n.push(i):i<2048?n.push(192|i>>6,128|i&63):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|i&63):(s++,i=65536+((i&1023)<<10|t.charCodeAt(s)&1023),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof gf=="object"&&(mf.exports=r())})(function(){return Cf})});var PC={};ad(PC,{estimate:()=>zf,lint:()=>Kf,main:()=>qf,parseArgs:()=>jf});module.exports=ud(PC);var Ve=ue(require("node:fs")),yt=ue(require("node:path"));var Ia={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function Fe(r){return typeof r=="string"}function La(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&Fe(e.lead)&&Fe(e.content)&&Fe(e.trail)&&(e.eol===`
5
5
  `||e.eol===`\r
6
- `)&&$e(e.finalEol)&&$e(e.value)}function Na(r){if(typeof r!="object"||r===null)return!1;let e=r;return(e.raw===void 0||$e(e.raw))&&$e(e.text)&&typeof e.attrs=="object"&&e.attrs!==null&&Object.values(e.attrs).every($e)}function ld(r){if(typeof r!="object"||r===null)return!1;let e=r;return $e(e.raw)&&$e(e.gap)&&Array.isArray(e.entries)&&e.entries.every(Na)}function cd(r){if(typeof r!="object"||r===null)return!1;let e=r;return $e(e.raw)&&$e(e.gap)}function ce(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="code"&&$e(e.lead)&&$e(e.open)&&$e(e.body)&&$e(e.close)&&$e(e.trail)&&$e(e.indent)&&(e.fenceChar==="`"||e.fenceChar==="~")&&typeof e.fenceLen=="number"&&$e(e.info)&&$e(e.lang)&&(e.eol===`
6
+ `)&&Fe(e.finalEol)&&Fe(e.value)}function Na(r){if(typeof r!="object"||r===null)return!1;let e=r;return(e.raw===void 0||Fe(e.raw))&&Fe(e.text)&&typeof e.attrs=="object"&&e.attrs!==null&&Object.values(e.attrs).every(Fe)}function ld(r){if(typeof r!="object"||r===null)return!1;let e=r;return Fe(e.raw)&&Fe(e.gap)&&Array.isArray(e.entries)&&e.entries.every(Na)}function cd(r){if(typeof r!="object"||r===null)return!1;let e=r;return Fe(e.raw)&&Fe(e.gap)}function ce(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="code"&&Fe(e.lead)&&Fe(e.open)&&Fe(e.body)&&Fe(e.close)&&Fe(e.trail)&&Fe(e.indent)&&(e.fenceChar==="`"||e.fenceChar==="~")&&typeof e.fenceLen=="number"&&Fe(e.info)&&Fe(e.lang)&&(e.eol===`
7
7
  `||e.eol===`\r
8
- `)&&$e(e.value)&&(e.output===void 0||cd(e.output))&&(e.history===void 0||ld(e.history))}function Ma(r){if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.bom=="boolean"&&(e.eol===`
8
+ `)&&Fe(e.value)&&(e.output===void 0||cd(e.output))&&(e.history===void 0||ld(e.history))}function Ma(r){if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.bom=="boolean"&&(e.eol===`
9
9
  `||e.eol===`\r
10
10
  `)}function yn(r){let e=[],t=/\r\n|\n|\r/g,n=0,s;for(;(s=t.exec(r))!==null;)e.push({text:r.slice(n,s.index),eol:s[0]}),n=t.lastIndex;return n<r.length&&e.push({text:r.slice(n),eol:""}),e}function Mt(r){let e="";for(let t of r)e+=t.text+t.eol;return e}function Hs(r,e){let t=0,n=0;for(let s of r)s.eol===`\r
11
11
  `?t++:s.eol===`
@@ -16,26 +16,26 @@
16
16
  `:r.endsWith(`
17
17
  `)?`
18
18
  `:r.endsWith("\r")?"\r":""}function Lr(r){return _s(r)!==""}function sr(r){return r.replace(/\r\n?/g,`
19
- `)}var ir=/^[ \t]*$/;var fd=new Set(["sh","bash","pwsh","powershell","cmd","runbook"]),dd={sh:"shellscript",bash:"shellscript",pwsh:"powershell",powershell:"powershell",cmd:"bat"},Ga={shellscript:"bash",powershell:"pwsh",bat:"cmd",runbook:"runbook"},jC=Object.keys(Ga);function co(r){return fd.has(r)}function Us(r){return dd[r]??r}function Pa(r){return Ga[r]??r}var pd=/^([ \t]*)(`{3,}|~{3,})(.*)$/,Ha=/^[ \t]*(`{3,}|~{3,})[ \t]*$/;function _e(r){let e=pd.exec(r);if(!e)return null;let t=e[1]??"",n=e[2]??"",s=e[3]??"",i=n[0];return i==="`"&&s.includes("`")?null:{indent:t,char:i,len:n.length,info:s}}function Ke(r,e){let t=Ha.exec(r);if(!t)return!1;let n=t[1]??"";return n[0]===e.char&&n.length>=e.len}var _a=/^(\s*)([^\s{]+)/;function sn(r){let e=_a.exec(r);return e?(e[2]??"").toLowerCase():""}function Ua(r,e){let t=_a.exec(r);return t?(t[1]??"")+e+r.slice(t[0].length):e+r}function Ja(r,e){let t=0;for(let n of r){let i=Ha.exec(n)?.[1];i&&i[0]===e&&(t=Math.max(t,i.length))}return t}function fo(r,e){if(e==="")return r;if(r.startsWith(e))return r.slice(e.length);let t=0;for(;t<e.length&&t<r.length&&(r[t]===" "||r[t]===" ");)t++;return r.slice(t)}function Sn(r,e){return r===""?r:e+r}var hd=new RegExp(["(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C)","[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"),"g");function Ot(r){return r.replace(hd,"")}var Cd=/^\u001b\[([0-9;?]*)([ -/]*)([@-~])/,gd=/^\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/,md=/[\r\b\u0000-\u0008\u000b-\u001a\u001c-\u001f\u007f]|\u001b\[[0-9;?]*[ -/]*[A-GJKsu]|\u001b[78]/;function Nr(r,e=""){if(!md.test(r))return r;let t=[[]],n=[!1],s=[""],i="",o=0,B=0,a=[0,0],l=f=>{for(;t.length<=f;)t.push([]),n.push(!1),s.push("")},c=f=>{let d=t[o];for(;d.length<B;)d.push(" ");d[B]=i+f,i="",B++},u=(f,d)=>{let h=parseInt(f.split(";")[0]??"",10);return Number.isFinite(h)&&h>0?h:d};for(let f=0;f<r.length;){let d=r[f];if(d==="\x1B"){let h=r.slice(f,f+256),p=Cd.exec(h);if(p){let[m,b,w,R]=p;if(f+=m.length,w!==""||b.startsWith("?")){R==="m"&&(i+=m);continue}let y=u(b,1);switch(R){case"A":o=Math.max(0,o-y);break;case"B":o+=y,l(o);break;case"C":B+=y;break;case"D":B=Math.max(0,B-y);break;case"E":o+=y,l(o),B=0;break;case"F":o=Math.max(0,o-y),B=0;break;case"G":B=y-1;break;case"K":{let T=u(b,0),v=t[o];if(T===0)v.length=Math.min(v.length,B);else if(T===1)for(let E=0;E<=B&&E<v.length;E++)v[E]=" ";else v.length=0;break}case"J":{let T=u(b,0);if(T===0)t[o].length=Math.min(t[o].length,B),t.length=o+1,n.length=o+1,s.length=o+1;else if(T===1){for(let v=0;v<o;v++)t[v]=[];for(let v=0;v<=B&&v<t[o].length;v++)t[o][v]=" "}break}case"s":a=[o,B];break;case"u":[o,B]=a,l(o);break;default:i+=m}continue}let k=gd.exec(h);if(k&&k[0].length>2){i+=k[0],f+=k[0].length;continue}let D=r[f+1];D==="7"?a=[o,B]:D==="8"&&([o,B]=a,l(o)),f+=D===void 0?1:2;continue}if(f++,d===`
19
+ `)}var ir=/^[ \t]*$/;var fd=new Set(["sh","bash","pwsh","powershell","cmd","runbook"]),dd={sh:"shellscript",bash:"shellscript",pwsh:"powershell",powershell:"powershell",cmd:"bat"},Ga={shellscript:"bash",powershell:"pwsh",bat:"cmd",runbook:"runbook"},KC=Object.keys(Ga);function co(r){return fd.has(r)}function Us(r){return dd[r]??r}function Pa(r){return Ga[r]??r}var pd=/^([ \t]*)(`{3,}|~{3,})(.*)$/,Ha=/^[ \t]*(`{3,}|~{3,})[ \t]*$/;function _e(r){let e=pd.exec(r);if(!e)return null;let t=e[1]??"",n=e[2]??"",s=e[3]??"",i=n[0];return i==="`"&&s.includes("`")?null:{indent:t,char:i,len:n.length,info:s}}function Ke(r,e){let t=Ha.exec(r);if(!t)return!1;let n=t[1]??"";return n[0]===e.char&&n.length>=e.len}var _a=/^(\s*)([^\s{]+)/;function sn(r){let e=_a.exec(r);return e?(e[2]??"").toLowerCase():""}function Ua(r,e){let t=_a.exec(r);return t?(t[1]??"")+e+r.slice(t[0].length):e+r}function Ja(r,e){let t=0;for(let n of r){let i=Ha.exec(n)?.[1];i&&i[0]===e&&(t=Math.max(t,i.length))}return t}function fo(r,e){if(e==="")return r;if(r.startsWith(e))return r.slice(e.length);let t=0;for(;t<e.length&&t<r.length&&(r[t]===" "||r[t]===" ");)t++;return r.slice(t)}function Sn(r,e){return r===""?r:e+r}var hd=new RegExp(["(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C)","[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"),"g");function Ot(r){return r.replace(hd,"")}var Cd=/^\u001b\[([0-9;?]*)([ -/]*)([@-~])/,gd=/^\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/,md=/[\r\b\u0000-\u0008\u000b-\u001a\u001c-\u001f\u007f]|\u001b\[[0-9;?]*[ -/]*[A-GJKsu]|\u001b[78]/;function Nr(r,e=""){if(!md.test(r))return r;let t=[[]],n=[!1],s=[""],i="",o=0,B=0,a=[0,0],l=f=>{for(;t.length<=f;)t.push([]),n.push(!1),s.push("")},c=f=>{let d=t[o];for(;d.length<B;)d.push(" ");d[B]=i+f,i="",B++},u=(f,d)=>{let h=parseInt(f.split(";")[0]??"",10);return Number.isFinite(h)&&h>0?h:d};for(let f=0;f<r.length;){let d=r[f];if(d==="\x1B"){let h=r.slice(f,f+256),p=Cd.exec(h);if(p){let[m,b,w,R]=p;if(f+=m.length,w!==""||b.startsWith("?")){R==="m"&&(i+=m);continue}let y=u(b,1);switch(R){case"A":o=Math.max(0,o-y);break;case"B":o+=y,l(o);break;case"C":B+=y;break;case"D":B=Math.max(0,B-y);break;case"E":o+=y,l(o),B=0;break;case"F":o=Math.max(0,o-y),B=0;break;case"G":B=y-1;break;case"K":{let T=u(b,0),v=t[o];if(T===0)v.length=Math.min(v.length,B);else if(T===1)for(let E=0;E<=B&&E<v.length;E++)v[E]=" ";else v.length=0;break}case"J":{let T=u(b,0);if(T===0)t[o].length=Math.min(t[o].length,B),t.length=o+1,n.length=o+1,s.length=o+1;else if(T===1){for(let v=0;v<o;v++)t[v]=[];for(let v=0;v<=B&&v<t[o].length;v++)t[o][v]=" "}break}case"s":a=[o,B];break;case"u":[o,B]=a,l(o);break;default:i+=m}continue}let k=gd.exec(h);if(k&&k[0].length>2){i+=k[0],f+=k[0].length;continue}let D=r[f+1];D==="7"?a=[o,B]:D==="8"&&([o,B]=a,l(o)),f+=D===void 0?1:2;continue}if(f++,d===`
20
20
  `)s[o]+=i,i="",o++,l(o),B=0;else if(d==="\r")B=0;else if(d==="\b")B=Math.max(0,B-1);else if(e!==""&&d===e)n[o]=!0;else if(d===" ")c(d);else{if(d<" "||d==="\x7F")continue;d>="\uD800"&&d<="\uDBFF"&&f<r.length?c(d+r[f++]):c(d)}}return s[o]+=i,t.map((f,d)=>(n[d]?e:"")+f.join("")+s[d]).join(`
21
- `)}var Ka=[{level:"critical",words:["EMERGENCY","EMERG","ALERT","CRITICAL","CRIT","FATAL","PANIC"],capitalized:!0,colon:["fatal","panic","critical"],brackets:["fatal","fatl","ftl","crit","critical","emerg","alert"],klog:"F"},{level:"error",words:["ERROR","ERR","EROR","FAIL","FAILED","FAILURE","EE"],capitalized:!0,colon:["error","err"],brackets:["error","eror","err","er","e","fail","failed"],klog:"E",extra:["\\b[A-Za-z.]*Exception\\b","[\u2717\u2718]"]},{level:"warning",words:["WARNING","WARN","WRN","WW"],capitalized:!0,colon:["warning","warn"],brackets:["warning","warn","wrn","wn","w"],klog:"W"},{level:"info",words:["INFORMATIONAL","INFORMATION","INFO","NOTICE","HINT","II"],capitalized:!0,colon:["info","notice","hint"],brackets:["information","info","inf","in","i","notice"],klog:"I"},{level:"debug",words:["DEBUG_LOW","DEBUG_MED","DEBUG_HIGH","DEBUG_MAX","DBG_LOW","DBG_MED","DBG_HIGH","DBG_MAX","DEBUG","DBUG","DBG"],capitalized:!0,colon:["debug"],brackets:["debug","dbug","dbg","de","d"]},{level:"trace",words:["TRACE","VERBOSE","VRB"],capitalized:!0,colon:["trace","verbose"],brackets:["trace","verbose","verb","vrb","vb","v"]},{level:"success",words:["SUCCESSFUL","SUCCEEDED","SUCCESS","COMPLETED","PASSED","PASS","DONE","OK"],capitalized:!0,colon:["success","ok","done"],brackets:["success","ok","pass","passed","done"],extra:["[\u2713\u2714]"]}],Ed=new Set(["ALERT","NOTICE","HINT","PASS","DONE","OK","EE","WW","II","ERR","EROR","CRIT","EMERG","WRN","DBUG","DBG","VRB"]),ja=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),bd=r=>r[0]+r.slice(1).toLowerCase(),VC=new RegExp(Ka.map(r=>{let e=[],t=[...r.words,...r.capitalized?r.words.filter(n=>!Ed.has(n)&&!n.includes("_")).map(bd):[]];return e.push(`\\b(?:${t.map(ja).join("|")})\\b`),r.colon?.length&&e.push(`\\b(?:${r.colon.map(ja).join("|")})(?=:)`),r.brackets?.length&&e.push(`\\[(?:${r.brackets.map(n=>n.split("").map(s=>`[${s.toLowerCase()}${s.toUpperCase()}]`).join("")).join("|")})\\]`),r.klog&&e.push(`^${r.klog}\\d{4} \\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?`),r.extra&&e.push(...r.extra),`(${e.join("|")})`}).join("|"),"gu");var or="\uE000";function po(r){if(!r.includes(or))return{text:r,stderr:[]};let e=[];return{text:r.split(`
21
+ `)}var Ka=[{level:"critical",words:["EMERGENCY","EMERG","ALERT","CRITICAL","CRIT","FATAL","PANIC"],capitalized:!0,colon:["fatal","panic","critical"],brackets:["fatal","fatl","ftl","crit","critical","emerg","alert"],klog:"F"},{level:"error",words:["ERROR","ERR","EROR","FAIL","FAILED","FAILURE","EE"],capitalized:!0,colon:["error","err"],brackets:["error","eror","err","er","e","fail","failed"],klog:"E",extra:["\\b[A-Za-z.]*Exception\\b","[\u2717\u2718]"]},{level:"warning",words:["WARNING","WARN","WRN","WW"],capitalized:!0,colon:["warning","warn"],brackets:["warning","warn","wrn","wn","w"],klog:"W"},{level:"info",words:["INFORMATIONAL","INFORMATION","INFO","NOTICE","HINT","II"],capitalized:!0,colon:["info","notice","hint"],brackets:["information","info","inf","in","i","notice"],klog:"I"},{level:"debug",words:["DEBUG_LOW","DEBUG_MED","DEBUG_HIGH","DEBUG_MAX","DBG_LOW","DBG_MED","DBG_HIGH","DBG_MAX","DEBUG","DBUG","DBG"],capitalized:!0,colon:["debug"],brackets:["debug","dbug","dbg","de","d"]},{level:"trace",words:["TRACE","VERBOSE","VRB"],capitalized:!0,colon:["trace","verbose"],brackets:["trace","verbose","verb","vrb","vb","v"]},{level:"success",words:["SUCCESSFUL","SUCCEEDED","SUCCESS","COMPLETED","PASSED","PASS","DONE","OK"],capitalized:!0,colon:["success","ok","done"],brackets:["success","ok","pass","passed","done"],extra:["[\u2713\u2714]"]}],Ed=new Set(["ALERT","NOTICE","HINT","PASS","DONE","OK","EE","WW","II","ERR","EROR","CRIT","EMERG","WRN","DBUG","DBG","VRB"]),ja=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),bd=r=>r[0]+r.slice(1).toLowerCase(),ZC=new RegExp(Ka.map(r=>{let e=[],t=[...r.words,...r.capitalized?r.words.filter(n=>!Ed.has(n)&&!n.includes("_")).map(bd):[]];return e.push(`\\b(?:${t.map(ja).join("|")})\\b`),r.colon?.length&&e.push(`\\b(?:${r.colon.map(ja).join("|")})(?=:)`),r.brackets?.length&&e.push(`\\[(?:${r.brackets.map(n=>n.split("").map(s=>`[${s.toLowerCase()}${s.toUpperCase()}]`).join("")).join("|")})\\]`),r.klog&&e.push(`^${r.klog}\\d{4} \\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?`),r.extra&&e.push(...r.extra),`(${e.join("|")})`}).join("|"),"gu");var or="\uE000";function po(r){if(!r.includes(or))return{text:r,stderr:[]};let e=[];return{text:r.split(`
22
22
  `).map((n,s)=>n.includes(or)?(e.push(s),n.split(or).join("")):n).join(`
23
- `),stderr:e}}function ho(r){let e=[...new Set(r)].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(n===s?`${e[n]+1}`:`${e[n]+1}-${e[s]+1}`),n=s+1}return t.join(",")}var Js=/^[ \t]*<!--[ \t]*md-runbook:output start\b(.*?)-->[ \t]*$/,Co=/^[ \t]*<!--[ \t]*md-runbook:output end[ \t]*-->[ \t]*$/,za=/^[ \t]*<details>[ \t]*<summary>[ \t]*md-runbook:[^<]*<\/summary>[ \t]*$/,Ya=/^[ \t]*<\/details>[ \t]*$/,Dd=/([\w-]+)=(?:"([^"]*)"|(\S+))/g;function Mr(r){let e={};for(let t of r.matchAll(Dd)){let n=t[1];n&&(e[n]=t[2]??t[3]??"")}return e}function qa(r){let e="";for(let[t,n]of Object.entries(r)){if(!/^[\w-]+$/.test(t))continue;let s=n.replace(/["\r\n]/g,"").replace(/-->/g,"--");e+=" "+t+"="+(s===""||/\s/.test(s)?`"${s}"`:s)}return e}function wd(r){return`\u2026 [md-runbook: ${r} line${r===1?"":"s"} truncated] \u2026`}function Qa(r,e){if(e<=0)return r;let t=r.split(`
23
+ `),stderr:e}}function ho(r){let e=[...new Set(r)].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(n===s?`${e[n]+1}`:`${e[n]+1}-${e[s]+1}`),n=s+1}return t.join(",")}var Js=/^[ \t]*<!--[ \t]*md-runbook:output start\b(.*?)-->[ \t]*$/,Co=/^[ \t]*<!--[ \t]*md-runbook:output end[ \t]*-->[ \t]*$/,za=/^[ \t]*<details>[ \t]*<summary>[ \t]*md-runbook:[^<]*<\/summary>[ \t]*$/,qa=/^[ \t]*<\/details>[ \t]*$/,Dd=/([\w-]+)=(?:"([^"]*)"|(\S+))/g;function Mr(r){let e={};for(let t of r.matchAll(Dd)){let n=t[1];n&&(e[n]=t[2]??t[3]??"")}return e}function Ya(r){let e="";for(let[t,n]of Object.entries(r)){if(!/^[\w-]+$/.test(t))continue;let s=n.replace(/["\r\n]/g,"").replace(/-->/g,"--");e+=" "+t+"="+(s===""||/\s/.test(s)?`"${s}"`:s)}return e}function wd(r){return`\u2026 [md-runbook: ${r} line${r===1?"":"s"} truncated] \u2026`}function Qa(r,e){if(e<=0)return r;let t=r.split(`
24
24
  `);if(t.length<=e)return r;let n=Math.ceil(e/2),s=e-n,i=t.length-e;return[...t.slice(0,n),wd(i),...t.slice(t.length-s)].join(`
25
25
  `)}function Wa(r,e){let t=Nr(r.replace(/\r\n/g,`
26
26
  `),or);e.stripAnsi&&(t=Ot(t)),e.redact&&(t=e.redact(t)),t=t.replace(/\n+$/,"");let n=po(Qa(t,e.maxOutputLines));return{text:n.text,stderr:ho(n.stderr)}}function Gr(r,e,t,n){let s=r===""?[]:sr(r).split(`
27
- `),i="`".repeat(Math.max(3,kd(s)+1));return[`<!-- md-runbook:output start${qa(e)} -->`,i+"text",...s,i,"<!-- md-runbook:output end -->"].map(B=>Sn(B,t)).join(n)+n}function kd(r){let e=0;for(let t of r){let n=/^[ \t]*(`+)/.exec(t);n?.[1]&&(e=Math.max(e,n[1].length))}return e}function js(r){return`${(Math.max(0,r)/1e3).toFixed(3)}s`}function Te(r){let e=s=>String(Math.abs(s)).padStart(2,"0"),t=-r.getTimezoneOffset(),n=t>=0?"+":"-";return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}${n}${e(Math.trunc(t/60))}:${e(t%60)}`}function he(r){let e=r,t=!1;e.charCodeAt(0)===65279&&(t=!0,e=e.slice(1));let n=yn(e),s=Hs(n,`
27
+ `),i="`".repeat(Math.max(3,kd(s)+1));return[`<!-- md-runbook:output start${Ya(e)} -->`,i+"text",...s,i,"<!-- md-runbook:output end -->"].map(B=>Sn(B,t)).join(n)+n}function kd(r){let e=0;for(let t of r){let n=/^[ \t]*(`+)/.exec(t);n?.[1]&&(e=Math.max(e,n[1].length))}return e}function js(r){return`${(Math.max(0,r)/1e3).toFixed(3)}s`}function Te(r){let e=s=>String(Math.abs(s)).padStart(2,"0"),t=-r.getTimezoneOffset(),n=t>=0?"+":"-";return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}${n}${e(Math.trunc(t/60))}:${e(t%60)}`}function he(r){let e=r,t=!1;e.charCodeAt(0)===65279&&(t=!0,e=e.slice(1));let n=yn(e),s=Hs(n,`
28
28
  `),i=[],o="",B=c=>{if(c.length===0)return;let u=0,f=c.length;for(;u<f&&ir.test(c[u].text);)u++;for(;f>u&&ir.test(c[f-1].text);)f--;if(u===f){let k=Mt(c),D=i[i.length-1];D?D.meta.trail+=k:o+=k;return}let d=c.slice(u,f),h=d.map(k=>k.text).join(`
29
29
  `),p={kind:"markup",lead:o+Mt(c.slice(0,u)),content:Mt(d),trail:Mt(c.slice(f)),eol:Hs(d,s),finalEol:d[d.length-1].eol,value:h};o="",i.push({kind:"markup",value:h,languageId:"markdown",meta:p})},a=0,l=0;for(;l<n.length;){let c=_e(n[l].text);if(!c){l++;continue}let u=l+1;for(;u<n.length&&!Ke(n[u].text,c);)u++;if(u>=n.length)break;let f=sn(c.info);if(!co(f)){l=u+1;continue}B(n.slice(a,l));let d=n[l],h=n.slice(l+1,u),p=h.map(w=>fo(w.text,c.indent)).join(`
30
30
  `),k={kind:"code",lead:o,open:d.text+d.eol,body:Mt(h),close:n[u].text+n[u].eol,trail:"",indent:c.indent,fenceChar:c.char,fenceLen:c.len,info:c.info,lang:f,eol:Hs([d,...h],s),value:p};o="";let D={kind:"code",value:p,languageId:Us(f),meta:k},m=u+1,b=go(n,m);if(b){k.output=b.meta,D.output=b.output,m=b.end;let w=xd(n,m);w&&(k.history=w.meta,m=w.end)}i.push(D),l=m,a=m}return B(n.slice(a)),o!==""&&i.push({kind:"markup",value:"",languageId:"markdown",meta:{kind:"markup",lead:o,content:"",trail:"",eol:s,finalEol:"",value:""}}),{meta:{bom:t,eol:s},cells:i}}function go(r,e){let t=e;for(;t<r.length&&ir.test(r[t].text);)t++;let n=r[t]?Js.exec(r[t].text):null;if(!n)return null;let s=t+1,i=r[s]?_e(r[s].text):null;if(!i)return null;let o=s+1;for(;o<r.length&&!Ke(r[o].text,i);)o++;let B=o+1;if(B>=r.length||!Co.test(r[B].text))return null;let a=r.slice(s+1,o).map(l=>fo(l.text,i.indent)).join(`
31
- `);return{meta:{raw:Mt(r.slice(e,B+1)),gap:Mt(r.slice(e,t))},output:{text:a,attrs:Mr(n[1]??"")},end:B+1}}function xd(r,e){let t=e;for(;t<r.length&&ir.test(r[t].text);)t++;if(!r[t]||!za.test(r[t].text))return null;let n=[],s=t+1;for(;;){let i=go(r,s);if(!i)break;n.push({raw:i.meta.raw.slice(i.meta.gap.length),...i.output}),s=i.end}for(;s<r.length&&ir.test(r[s].text);)s++;return n.length===0||!r[s]||!Ya.test(r[s].text)?null:{meta:{raw:Mt(r.slice(e,s+1)),gap:Mt(r.slice(e,t)),entries:n},end:s+1}}function mo(r){let e=yn(r),t=go(e,0);return t&&t.end===e.length?t.output:null}function Ks(r){if(!r.output)return;let e=r.output.raw.slice(r.output.gap.length),t=mo(e);return t?{raw:e,...t}:void 0}function zs(r,e,t){return!r||t<=0?[]:[r,...e].slice(0,t)}function vd(r){return`md-runbook: ${r} previous run${r===1?"":"s"}`}function Eo(r,e,t){let n=Sn(`<details><summary>${vd(r.length)}</summary>`,e)+t;for(let s of r)n+=t,s.raw!==void 0?n+=Lr(s.raw)?s.raw:s.raw+t:n+=Gr(s.text,s.attrs,e,t);return n+t+Sn("</details>",e)+t}var Pr=r=>String(r).padStart(2,"0");function bo(r,e){let t=r.replace(/\.md$/i,""),n=`${e.getFullYear()}${Pr(e.getMonth()+1)}${Pr(e.getDate())}-${Pr(e.getHours())}${Pr(e.getMinutes())}${Pr(e.getSeconds())}`;return`${t}.${n}.md`}function Ys(r,e,t){let n=Ma(r)?r:{bom:!1,eol:`
31
+ `);return{meta:{raw:Mt(r.slice(e,B+1)),gap:Mt(r.slice(e,t))},output:{text:a,attrs:Mr(n[1]??"")},end:B+1}}function xd(r,e){let t=e;for(;t<r.length&&ir.test(r[t].text);)t++;if(!r[t]||!za.test(r[t].text))return null;let n=[],s=t+1;for(;;){let i=go(r,s);if(!i)break;n.push({raw:i.meta.raw.slice(i.meta.gap.length),...i.output}),s=i.end}for(;s<r.length&&ir.test(r[s].text);)s++;return n.length===0||!r[s]||!qa.test(r[s].text)?null:{meta:{raw:Mt(r.slice(e,s+1)),gap:Mt(r.slice(e,t)),entries:n},end:s+1}}function mo(r){let e=yn(r),t=go(e,0);return t&&t.end===e.length?t.output:null}function Ks(r){if(!r.output)return;let e=r.output.raw.slice(r.output.gap.length),t=mo(e);return t?{raw:e,...t}:void 0}function zs(r,e,t){return!r||t<=0?[]:[r,...e].slice(0,t)}function vd(r){return`md-runbook: ${r} previous run${r===1?"":"s"}`}function Eo(r,e,t){let n=Sn(`<details><summary>${vd(r.length)}</summary>`,e)+t;for(let s of r)n+=t,s.raw!==void 0?n+=Lr(s.raw)?s.raw:s.raw+t:n+=Gr(s.text,s.attrs,e,t);return n+t+Sn("</details>",e)+t}var Pr=r=>String(r).padStart(2,"0");function bo(r,e){let t=r.replace(/\.md$/i,""),n=`${e.getFullYear()}${Pr(e.getMonth()+1)}${Pr(e.getDate())}-${Pr(e.getHours())}${Pr(e.getMinutes())}${Pr(e.getSeconds())}`;return`${t}.${n}.md`}function qs(r,e,t){let n=Ma(r)?r:{bom:!1,eol:`
32
32
  `},s=n.eol,i="",o=!1,B=!1;for(let a of e){let l=sr(a.value),c=a.kind==="markup"?La(a.meta)?a.meta:void 0:ce(a.meta)?a.meta:void 0,u=c===void 0;i!==""&&!Lr(i)&&(i+=s);let f=B&&i!=="",d=a.kind==="markup"?Od(l,c,s,f):Ad(l,a.languageId,c,a.output,s,t,f);i!==""&&(u||o)&&!Sd(i)&&!yd(d)&&(i+=s),i+=d,o=u,B=c!==void 0&&c.trail!==""}return(n.bom?"\uFEFF":"")+i}function yd(r){return/^[ \t]*(?:\r\n|\n|\r)/.test(r)}function Sd(r){return/(?:\r\n|\n|\r)[ \t]*(?:\r\n|\n|\r)$/.test(r)||/^[ \t]*(?:\r\n|\n|\r)$/.test(r)}function Za(r,e,t=""){return r===""?"":r.split(`
33
33
  `).map(n=>Sn(n,t)).join(e)}function Rd(r){let e=null;for(let t of r.split(`
34
34
  `))e?Ke(t,e)&&(e=null):e=_e(t);return e?e.indent+e.char.repeat(e.len):""}function Va(r,e,t){let n=Rd(r);return Za(r,e)+(n===""?"":e+n)+t}function Od(r,e,t,n){if(!e)return r===""?"":Va(r,t,t);let s=n?"":e.lead;if(r===e.value)return s+e.content+e.trail;let i=r===""?"":Va(r,e.eol,e.finalEol);return s+i+e.trail}function Ad(r,e,t,n,s,i,o){let B=t!==void 0&&e!==void 0&&Us(t.lang)!==e,a=o?"":t?.lead??"";if(t&&!B&&r===t.value)a+=t.open+t.body+t.close;else{let c=t?.eol??s,u=t?.indent??"",f=t?.fenceChar??"`",d=t?.fenceLen??3,h=Math.max(d,Ja(r.split(`
35
- `),f)+1),p=Pa(e??"shellscript"),k=u+f.repeat(h),D,m;if(t){let w=B?Ua(t.info,p):t.info,R=_s(t.open);D=h===d&&!B&&R!=="\r"?t.open:k+w+(R==="\r"?c:R||c),m=h===d?t.close:k+_s(t.close)}else D=k+p+c,m=k+c;let b=r===""?"":Za(r,c,u)+c;a+=D+b+m}let l=$d(n,t,s,i);return l!==""&&(Lr(a)||(a+=t?.eol??s),a+=l),a+(t?.trail??"")}function $d(r,e,t,n){if(!r)return"";if(r.kind==="preserved")return e?.output?e.output.raw+(e.history?.raw??""):"";if(!n.persistOutputs)return"";let{text:s,stderr:i}=Wa(r.text,n),o=e?.eol??t,B=e?.indent??"",{stderr:a,...l}=r.attrs,c=i?{...l,stderr:i}:l,u=r.previous?{...c,changed:r.previous.text===s?"no":"yes"}:c,f=(e?.output?.gap??"")+Gr(s,u,B,o);return r.history?.length&&(f+=(e?.history?.gap??"")+Eo(r.history,B,o)),f}function qs(r,e=!0){return r.cells.map(t=>({kind:t.kind,value:t.value,languageId:t.languageId,meta:t.meta,output:e&&t.output?{kind:"preserved"}:void 0}))}function Kt(r){let e=he(r);return Ys(e.meta,qs(e,!1),Ia)}var Br="[REDACTED]",Do="password|passwd|pwd|secret|token|api[_-]?key|access[_-]?key|private[_-]?key|privatekey|client[_-]?key|credentials?|\\.key",Fd=`(?:\\$\\{[^}\\s]*\\}|\\$\\([^)\\r\\n]*\\)|\\$env:\\w+|%[A-Za-z_]\\w*%)(?![^\\s"',;&])`,Qs=`(?<!\\$\\{(?:secret|secretFile|input|param):)(?!(?:Bearer|Basic|Negotiate|true|false|null|none)\\b)(?!${Fd})`,Xa="k8s-secret-data",wo=[{name:"pem-private-key",pattern:"(?<=-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----)[\\s\\S]+?(?=-----END [A-Z0-9 ]*PRIVATE KEY-----|$)"},{name:Xa,pattern:"(?!)"},{name:"authorization-header",pattern:`(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*:[ \\t]*)[^\\s"'][^\\r\\n"']*|(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*=[ \\t]*)[^\\s"'][^\\r\\n"',;}&]*`,flags:"i"},{name:"cookie-header",pattern:`(?<=\\b(?:Set-)?Cookie["']?[ \\t]*[:=][ \\t]*)[^\\s"'][^\\r\\n"']*`,flags:"i"},{name:"bearer-token",pattern:"(?<=\\bBearer[ \\t]+)(?=[A-Za-z0-9\\-._~+/]*[0-9._~+/-])[A-Za-z0-9\\-._~+/]{8,}=*",flags:"i"},{name:"jwt",pattern:"\\beyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]{5,}(?:\\.[A-Za-z0-9_-]*)*"},{name:"secret-key-value-quoted",pattern:`(?<=\\b[\\w.-]*(?:${Do})[\\w.-]*["']?[ \\t]*[:=][ \\t]*")${Qs}[^"\\r\\n]+(?=")|(?<=\\b[\\w.-]*(?:${Do})[\\w.-]*["']?[ \\t]*[:=][ \\t]*')${Qs}[^'\\r\\n]+(?=')`,flags:"i"},{name:"secret-key-value",pattern:`(?<=\\b[\\w.-]*(?:${Do})[\\w.-]*["']?[ \\t]*[:=][ \\t]*["']?)${Qs}[^\\s"',;&}]+`,flags:"i"},{name:"pass-key-value",pattern:`(?<=(?:^|[^A-Za-z0-9])(?:[\\w.-]*[_.-])?pass["']?[ \\t]*[:=][ \\t]*["']?)${Qs}[^\\s"',;&}]+`,flags:"i"},{name:"secret-flag-value",pattern:`(?<=(?:^|\\s)--?(?:password|passwd|pass|secret|client-secret|token|api-key|apikey|access-key|secret-key)[ \\t]+)(?:"(?![$%])[^"\\r\\n]*"|'(?![$%])[^'\\r\\n]*'|(?![-$%])[^\\s"']+)|(?<=\\blogin\\b[^\\r\\n]*?\\s-p[ \\t]*)(?!-)[^\\s"']+|(?<=\\bmysql\\b[^\\r\\n]*?\\s-p)[^\\s"']+|(?<=(?:^|\\s)(?:-u|--user)[ \\t]+[^\\s:"']+:)[^\\s"']+`,flags:"i"},{name:"keycloak-client-secret",pattern:'(?<="type"[ \\t]*:[ \\t]*"secret"[ \\t]*,[ \\t]*"value"[ \\t]*:[ \\t]*")[^"]+|(?<=\\bsecret\\b[^\\r\\n]{0,40}?)\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b',flags:"i"},{name:"url-credentials",pattern:"(?<=\\b[a-z][a-z0-9+.-]*://[^/\\s:@]+:)[^/\\s@]+(?=@)",flags:"i"},{name:"base64-pem",pattern:"\\bLS0tLS1CRUdJTi[A-Za-z0-9+/=]+"},{name:"base64-dockerconfig",pattern:"\\beyJhdXRocyI6[A-Za-z0-9+/=]+"},{name:"openshift-token",pattern:"\\bsha256~[A-Za-z0-9_-]{20,}"},{name:"github-token",pattern:"\\bgh[pousr]_[A-Za-z0-9]{30,}"},{name:"gitlab-token",pattern:"\\bglpat-[A-Za-z0-9_-]{20,}"},{name:"npm-token",pattern:"\\bnpm_[A-Za-z0-9]{36}\\b"},{name:"anthropic-openai-key",pattern:"\\bsk-(?:ant-)?[A-Za-z0-9_-]{20,}"},{name:"slack-token",pattern:"\\bxox[abposr]-[A-Za-z0-9-]{10,}"},{name:"gcp-api-key",pattern:"\\bAIza[0-9A-Za-z_-]{35}\\b"},{name:"gcp-oauth-token",pattern:"\\bya29\\.[0-9A-Za-z_-]{20,}"},{name:"azure-storage-key",pattern:"(?<=\\b(?:AccountKey|SharedAccessKey)=)[A-Za-z0-9+/=]{20,}",flags:"i"},{name:"azure-sas-signature",pattern:"(?<=[?&]sig=)[A-Za-z0-9%+/=]{20,}"},{name:"aws-access-key-id",pattern:"\\b(?:AKIA|ASIA)[0-9A-Z]{16}\\b"}];function Td(r){if(!/["']?kind["']?[ \t]*:[ \t]*["']?Secret\b/.test(r))return r;let e=r.replace(/^([ \t]*)(data|stringData):[ \t]*(\r?\n)((?:\1[ \t]+[^\r\n]*(?:\r?\n|$))+)/gm,(t,n,s,i,o)=>{let B=o.replace(/^([ \t]+[^\s:#][^:\r\n]*:[ \t]*)(?:\|[-+]?|>[-+]?)?[ \t]*(\S[^\r\n]*)?$/gm,(a,l,c)=>c===void 0||c.startsWith("[REDACTED]")?a:`${l}${Br}`);return`${n}${s}:${i}${B}`});return e=e.replace(/("(?:data|stringData)"[ \t]*:[ \t]*\{)([^{}]*)(\})/g,(t,n,s,i)=>n+s.replace(/("[^"\r\n]+"[ \t]*:[ \t]*)"[^"]*"/g,`$1"${Br}"`)+i),e}function Id(r){let e=new Set((r??"").replace(/[gy]/g,"").split(""));return e.add("g"),[...e].join("")}function Ld(r){let e=typeof r=="string"?{pattern:r}:r;return new RegExp(e.pattern,Id(e.flags))}function ko(r){let e=[],t=[],n=!1;for(let s of r){if(typeof s!="string"&&s.name===Xa){n=!0;continue}try{e.push(Ld(s))}catch(i){let o=typeof s=="string"?s:s.name??s.pattern;t.push(`${o}: ${i instanceof Error?i.message:String(i)}`)}}return{errors:t,redact(s){let i=n?Td(s):s;for(let o of e)o.lastIndex=0,i=i.replace(o,B=>B===""?B:Br);return i}}}var Nd=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----(?![\s\S]*-----END [A-Z0-9 ]*PRIVATE KEY-----)/,Rn=class{constructor(e,t=i=>i,n=64*1024,s=256*1024){this.emit=e;this.transform=t;this.maxPending=n;this.maxHeld=s}emit;transform;maxPending;maxHeld;pending="";held="";write(e){this.pending+=e;let t=this.pending.lastIndexOf(`
36
- `);if(t>=0&&(this.held+=this.pending.slice(0,t+1),this.pending=this.pending.slice(t+1),(!Nd.test(this.held)||this.held.length>this.maxHeld)&&this.release(this.held)),this.pending.length>this.maxPending){let n=Math.max(this.pending.lastIndexOf(" "),this.pending.lastIndexOf(" ")),s=n>0?n+1:this.pending.length,i=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.release(this.held+i)}}flush(){this.release(this.held+this.pending),this.pending=""}release(e){this.held="",e!==""&&this.emit(this.transform(e))}};function Fe(r){switch(r.toLowerCase()){case"sh":case"bash":case"shellscript":return"bash";case"pwsh":case"powershell":return"pwsh";case"cmd":case"bat":return"cmd";default:return}}var Hr=["bash","zsh","sh"],_r=["pwsh","windows-powershell"];function Ur(r){let e={},t=[],n=[],s=r.replace(/^\s*\[|\]\s*$/g,"").split(/[\s,]+/).map(i=>i.replace(/^["']|["']$/g,"")).filter(Boolean);for(let i of s){let o=i.toLowerCase();Hr.includes(o)?e.unix?n.push(i):e.unix=o:_r.includes(o)?e.powershell?n.push(i):e.powershell=o:t.push(i)}return{shells:e,unknown:t,twice:n}}function Jr(r){return r.timedOut?"timeout":r.cancelled?"cancelled":r.error!==void 0?"error":r.exitCode!==null?String(r.exitCode):r.signal??"unknown"}function ar(r){return!r.timedOut&&!r.cancelled&&r.error===void 0&&r.exitCode===0}var On=class{constructor(e,t){this.emit=t;this.needle=""+e+" "}emit;pending="";needle;code;get done(){return this.code!==void 0}write(e){if(this.done)return;let t=this.pending+e,n=t.indexOf(this.needle);if(n>=0){this.send(t.slice(0,n)),t=t.slice(n);let o=t.indexOf(`
35
+ `),f)+1),p=Pa(e??"shellscript"),k=u+f.repeat(h),D,m;if(t){let w=B?Ua(t.info,p):t.info,R=_s(t.open);D=h===d&&!B&&R!=="\r"?t.open:k+w+(R==="\r"?c:R||c),m=h===d?t.close:k+_s(t.close)}else D=k+p+c,m=k+c;let b=r===""?"":Za(r,c,u)+c;a+=D+b+m}let l=Fd(n,t,s,i);return l!==""&&(Lr(a)||(a+=t?.eol??s),a+=l),a+(t?.trail??"")}function Fd(r,e,t,n){if(!r)return"";if(r.kind==="preserved")return e?.output?e.output.raw+(e.history?.raw??""):"";if(!n.persistOutputs)return"";let{text:s,stderr:i}=Wa(r.text,n),o=e?.eol??t,B=e?.indent??"",{stderr:a,...l}=r.attrs,c=i?{...l,stderr:i}:l,u=r.previous?{...c,changed:r.previous.text===s?"no":"yes"}:c,f=(e?.output?.gap??"")+Gr(s,u,B,o);return r.history?.length&&(f+=(e?.history?.gap??"")+Eo(r.history,B,o)),f}function Ys(r,e=!0){return r.cells.map(t=>({kind:t.kind,value:t.value,languageId:t.languageId,meta:t.meta,output:e&&t.output?{kind:"preserved"}:void 0}))}function Kt(r){let e=he(r);return qs(e.meta,Ys(e,!1),Ia)}var Br="[REDACTED]",Do="password|passwd|pwd|secret|token|api[_-]?key|access[_-]?key|private[_-]?key|privatekey|client[_-]?key|credentials?|\\.key",$d=`(?:\\$\\{[^}\\s]*\\}|\\$\\([^)\\r\\n]*\\)|\\$env:\\w+|%[A-Za-z_]\\w*%)(?![^\\s"',;&])`,Qs=`(?<!\\$\\{(?:secret|secretFile|input|param):)(?!(?:Bearer|Basic|Negotiate|true|false|null|none)\\b)(?!${$d})`,Xa="k8s-secret-data",wo=[{name:"pem-private-key",pattern:"(?<=-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----)[\\s\\S]+?(?=-----END [A-Z0-9 ]*PRIVATE KEY-----|$)"},{name:Xa,pattern:"(?!)"},{name:"authorization-header",pattern:`(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*:[ \\t]*)[^\\s"'][^\\r\\n"']*|(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*=[ \\t]*)[^\\s"'][^\\r\\n"',;}&]*`,flags:"i"},{name:"cookie-header",pattern:`(?<=\\b(?:Set-)?Cookie["']?[ \\t]*[:=][ \\t]*)[^\\s"'][^\\r\\n"']*`,flags:"i"},{name:"bearer-token",pattern:"(?<=\\bBearer[ \\t]+)(?=[A-Za-z0-9\\-._~+/]*[0-9._~+/-])[A-Za-z0-9\\-._~+/]{8,}=*",flags:"i"},{name:"jwt",pattern:"\\beyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]{5,}(?:\\.[A-Za-z0-9_-]*)*"},{name:"secret-key-value-quoted",pattern:`(?<=\\b[\\w.-]*(?:${Do})[\\w.-]*["']?[ \\t]*[:=][ \\t]*")${Qs}[^"\\r\\n]+(?=")|(?<=\\b[\\w.-]*(?:${Do})[\\w.-]*["']?[ \\t]*[:=][ \\t]*')${Qs}[^'\\r\\n]+(?=')`,flags:"i"},{name:"secret-key-value",pattern:`(?<=\\b[\\w.-]*(?:${Do})[\\w.-]*["']?[ \\t]*[:=][ \\t]*["']?)${Qs}[^\\s"',;&}]+`,flags:"i"},{name:"pass-key-value",pattern:`(?<=(?:^|[^A-Za-z0-9])(?:[\\w.-]*[_.-])?pass["']?[ \\t]*[:=][ \\t]*["']?)${Qs}[^\\s"',;&}]+`,flags:"i"},{name:"secret-flag-value",pattern:`(?<=(?:^|\\s)--?(?:password|passwd|pass|secret|client-secret|token|api-key|apikey|access-key|secret-key)[ \\t]+)(?:"(?![$%])[^"\\r\\n]*"|'(?![$%])[^'\\r\\n]*'|(?![-$%])[^\\s"']+)|(?<=\\blogin\\b[^\\r\\n]*?\\s-p[ \\t]*)(?!-)[^\\s"']+|(?<=\\bmysql\\b[^\\r\\n]*?\\s-p)[^\\s"']+|(?<=(?:^|\\s)(?:-u|--user)[ \\t]+[^\\s:"']+:)[^\\s"']+`,flags:"i"},{name:"keycloak-client-secret",pattern:'(?<="type"[ \\t]*:[ \\t]*"secret"[ \\t]*,[ \\t]*"value"[ \\t]*:[ \\t]*")[^"]+|(?<=\\bsecret\\b[^\\r\\n]{0,40}?)\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b',flags:"i"},{name:"url-credentials",pattern:"(?<=\\b[a-z][a-z0-9+.-]*://[^/\\s:@]+:)[^/\\s@]+(?=@)",flags:"i"},{name:"base64-pem",pattern:"\\bLS0tLS1CRUdJTi[A-Za-z0-9+/=]+"},{name:"base64-dockerconfig",pattern:"\\beyJhdXRocyI6[A-Za-z0-9+/=]+"},{name:"openshift-token",pattern:"\\bsha256~[A-Za-z0-9_-]{20,}"},{name:"github-token",pattern:"\\bgh[pousr]_[A-Za-z0-9]{30,}"},{name:"gitlab-token",pattern:"\\bglpat-[A-Za-z0-9_-]{20,}"},{name:"npm-token",pattern:"\\bnpm_[A-Za-z0-9]{36}\\b"},{name:"anthropic-openai-key",pattern:"\\bsk-(?:ant-)?[A-Za-z0-9_-]{20,}"},{name:"slack-token",pattern:"\\bxox[abposr]-[A-Za-z0-9-]{10,}"},{name:"gcp-api-key",pattern:"\\bAIza[0-9A-Za-z_-]{35}\\b"},{name:"gcp-oauth-token",pattern:"\\bya29\\.[0-9A-Za-z_-]{20,}"},{name:"azure-storage-key",pattern:"(?<=\\b(?:AccountKey|SharedAccessKey)=)[A-Za-z0-9+/=]{20,}",flags:"i"},{name:"azure-sas-signature",pattern:"(?<=[?&]sig=)[A-Za-z0-9%+/=]{20,}"},{name:"aws-access-key-id",pattern:"\\b(?:AKIA|ASIA)[0-9A-Z]{16}\\b"}];function Td(r){if(!/["']?kind["']?[ \t]*:[ \t]*["']?Secret\b/.test(r))return r;let e=r.replace(/^([ \t]*)(data|stringData):[ \t]*(\r?\n)((?:\1[ \t]+[^\r\n]*(?:\r?\n|$))+)/gm,(t,n,s,i,o)=>{let B=o.replace(/^([ \t]+[^\s:#][^:\r\n]*:[ \t]*)(?:\|[-+]?|>[-+]?)?[ \t]*(\S[^\r\n]*)?$/gm,(a,l,c)=>c===void 0||c.startsWith("[REDACTED]")?a:`${l}${Br}`);return`${n}${s}:${i}${B}`});return e=e.replace(/("(?:data|stringData)"[ \t]*:[ \t]*\{)([^{}]*)(\})/g,(t,n,s,i)=>n+s.replace(/("[^"\r\n]+"[ \t]*:[ \t]*)"[^"]*"/g,`$1"${Br}"`)+i),e}function Id(r){let e=new Set((r??"").replace(/[gy]/g,"").split(""));return e.add("g"),[...e].join("")}function Ld(r){let e=typeof r=="string"?{pattern:r}:r;return new RegExp(e.pattern,Id(e.flags))}function ko(r){let e=[],t=[],n=!1;for(let s of r){if(typeof s!="string"&&s.name===Xa){n=!0;continue}try{e.push(Ld(s))}catch(i){let o=typeof s=="string"?s:s.name??s.pattern;t.push(`${o}: ${i instanceof Error?i.message:String(i)}`)}}return{errors:t,redact(s){let i=n?Td(s):s;for(let o of e)o.lastIndex=0,i=i.replace(o,B=>B===""?B:Br);return i}}}var Nd=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----(?![\s\S]*-----END [A-Z0-9 ]*PRIVATE KEY-----)/,Rn=class{constructor(e,t=i=>i,n=64*1024,s=256*1024){this.emit=e;this.transform=t;this.maxPending=n;this.maxHeld=s}emit;transform;maxPending;maxHeld;pending="";held="";write(e){this.pending+=e;let t=this.pending.lastIndexOf(`
36
+ `);if(t>=0&&(this.held+=this.pending.slice(0,t+1),this.pending=this.pending.slice(t+1),(!Nd.test(this.held)||this.held.length>this.maxHeld)&&this.release(this.held)),this.pending.length>this.maxPending){let n=Math.max(this.pending.lastIndexOf(" "),this.pending.lastIndexOf(" ")),s=n>0?n+1:this.pending.length,i=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.release(this.held+i)}}flush(){this.release(this.held+this.pending),this.pending=""}release(e){this.held="",e!==""&&this.emit(this.transform(e))}};function $e(r){switch(r.toLowerCase()){case"sh":case"bash":case"shellscript":return"bash";case"pwsh":case"powershell":return"pwsh";case"cmd":case"bat":return"cmd";default:return}}var Hr=["bash","zsh","sh"],_r=["pwsh","windows-powershell"];function Ur(r){let e={},t=[],n=[],s=r.replace(/^\s*\[|\]\s*$/g,"").split(/[\s,]+/).map(i=>i.replace(/^["']|["']$/g,"")).filter(Boolean);for(let i of s){let o=i.toLowerCase();Hr.includes(o)?e.unix?n.push(i):e.unix=o:_r.includes(o)?e.powershell?n.push(i):e.powershell=o:t.push(i)}return{shells:e,unknown:t,twice:n}}function Jr(r){return r.timedOut?"timeout":r.cancelled?"cancelled":r.error!==void 0?"error":r.exitCode!==null?String(r.exitCode):r.signal??"unknown"}function ar(r){return!r.timedOut&&!r.cancelled&&r.error===void 0&&r.exitCode===0}var On=class{constructor(e,t){this.emit=t;this.needle=""+e+" "}emit;pending="";needle;code;get done(){return this.code!==void 0}write(e){if(this.done)return;let t=this.pending+e,n=t.indexOf(this.needle);if(n>=0){this.send(t.slice(0,n)),t=t.slice(n);let o=t.indexOf(`
37
37
  `);if(o>=0){let B=Number.parseInt(t.slice(this.needle.length,o),10);this.code=Number.isNaN(B)?1:B,t=""}this.pending=t;return}let s=t.lastIndexOf(""),i=s>=0&&this.needle.startsWith(t.slice(s))?s:t.length;this.send(t.slice(0,i)),this.pending=t.slice(i)}flush(){this.send(this.pending),this.pending=""}send(e){e!==""&&this.emit(e)}};function Ws(r,e=!1,t){return r===void 0||r==="running"||r==="declined"||r==="unanswered"||r==="proposed"?"pending":t==="failed"?"failed":t==="ok"||r==="0"||r==="done"?e?"pending":"done":r==="skipped"?"skipped":"failed"}var Md=/^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+\[([ xX])\](?=[ \t]|$)/;function jr(r){let e=[],t=null,n=0;return r.split(`
38
- `).forEach((s,i)=>{let o=s.endsWith("\r")?s.slice(0,-1):s;if(t)Ke(o,t)&&(t=null);else if((t=_e(o))===null){let B=Md.exec(o);B&&e.push({line:i,offset:n+B[0].length-2,checked:B[1]!==" "})}n+=s.length+1}),e}function Vs(r){return r.match(/\r\n|\n|\r/g)?.length??0}function ft(r){let e=[],t=0;return r.cells.forEach((n,s)=>{let i=n.meta;if(ce(i)){let o=t+Vs(i.lead);e.push({cellIndex:s,line:o,closeLine:o+1+Vs(i.body),language:i.lang,info:i.info,source:n.value,outputAttrs:n.output?.attrs}),t+=Vs(i.lead+i.open+i.body+i.close+(i.output?.raw??"")+(i.history?.raw??"")+i.trail)}else t+=Vs(i.lead+i.content+i.trail)}),e}function An(r,e,t,n){let s=he(r);if(s.cells[e]?.kind!=="code")return;let i=qs(s);return i[e].output=t,Ys(s.meta,i,n)}function eu(r){let e=r.exit??"?";return r.check==="failed"?"failed":e==="0"||e==="done"||r.check==="ok"&&/^-?\d+$/.test(e)?"ok":["skipped","declined","proposed","running"].includes(e)?"neutral":"failed"}function xo(r,e=new Date){let t=r.exit??"?",s=[`${{ok:"\u2713",failed:"\u2717",neutral:"\u2013"}[eu(r)]} ${/^-?\d+$/.test(t)?`exit ${t}`:t}`];r.ready!==void 0&&s.push(r.ready==="up"?"ready: already up":"ready: not up"),r.check==="failed"&&s.push("check failed"),r.attempts&&s.push(`${r.attempts} attempts`),r.lines&&s.push(`lines ${r.lines}`);let i=r.duration?parseFloat(r.duration):NaN;isNaN(i)||s.push(i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m${Math.round(i%60)}s`);let o=Date.parse(r.ended??r.ran??"");return isNaN(o)||s.push(Gd(e.getTime()-o)),s.join(" \xB7 ")}function Gd(r){let e=Math.max(0,Math.round(r/1e3));return e<60?"just now":e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}function re(r){return r.replace(/[&<>"']/g,e=>`&${{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#39"}[e]};`)}function nu(r){if(/[\x00-\x20\x7f]/.test(r)||/^[\\/]{2}/.test(r))return;let e=/^([^/?#]*?):/.exec(r);if(!(e&&!/^(https?|mailto)$/i.test(e[1])))return r}var ru=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,su=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,zr=/^([ \t]*)([-*+]|(\d{1,9})[.)])([ \t]+|$)(.*)$/,vo=/^ {0,3}> ?(.*)$/,Pd=/^[ \t]*\|?[ \t]*:?-+:?[ \t]*(\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/,ur=/^[ \t]*$/;function Kr(r){let e=0;for(let t of r)e+=t===" "?4-e%4:1;return e}function Xs(r,e){return`<div class="code">${e?`<span class="lang">${re(e)}</span>`:""}<pre><code>${re(r)}</code></pre></div>
38
+ `).forEach((s,i)=>{let o=s.endsWith("\r")?s.slice(0,-1):s;if(t)Ke(o,t)&&(t=null);else if((t=_e(o))===null){let B=Md.exec(o);B&&e.push({line:i,offset:n+B[0].length-2,checked:B[1]!==" "})}n+=s.length+1}),e}function Vs(r){return r.match(/\r\n|\n|\r/g)?.length??0}function ft(r){let e=[],t=0;return r.cells.forEach((n,s)=>{let i=n.meta;if(ce(i)){let o=t+Vs(i.lead);e.push({cellIndex:s,line:o,closeLine:o+1+Vs(i.body),language:i.lang,info:i.info,source:n.value,outputAttrs:n.output?.attrs}),t+=Vs(i.lead+i.open+i.body+i.close+(i.output?.raw??"")+(i.history?.raw??"")+i.trail)}else t+=Vs(i.lead+i.content+i.trail)}),e}function An(r,e,t,n){let s=he(r);if(s.cells[e]?.kind!=="code")return;let i=Ys(s);return i[e].output=t,qs(s.meta,i,n)}function eu(r){let e=r.exit??"?";return r.check==="failed"?"failed":e==="0"||e==="done"||r.check==="ok"&&/^-?\d+$/.test(e)?"ok":["skipped","declined","proposed","running"].includes(e)?"neutral":"failed"}function xo(r,e=new Date){let t=r.exit??"?",s=[`${{ok:"\u2713",failed:"\u2717",neutral:"\u2013"}[eu(r)]} ${/^-?\d+$/.test(t)?`exit ${t}`:t}`];r.ready!==void 0&&s.push(r.ready==="up"?"ready: already up":"ready: not up"),r.check==="failed"&&s.push("check failed"),r.attempts&&s.push(`${r.attempts} attempts`),r.lines&&s.push(`lines ${r.lines}`);let i=r.duration?parseFloat(r.duration):NaN;isNaN(i)||s.push(i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m${Math.round(i%60)}s`);let o=Date.parse(r.ended??r.ran??"");return isNaN(o)||s.push(Gd(e.getTime()-o)),s.join(" \xB7 ")}function Gd(r){let e=Math.max(0,Math.round(r/1e3));return e<60?"just now":e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}function re(r){return r.replace(/[&<>"']/g,e=>`&${{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#39"}[e]};`)}function nu(r){if(/[\x00-\x20\x7f]/.test(r)||/^[\\/]{2}/.test(r))return;let e=/^([^/?#]*?):/.exec(r);if(!(e&&!/^(https?|mailto)$/i.test(e[1])))return r}var ru=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,su=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,zr=/^([ \t]*)([-*+]|(\d{1,9})[.)])([ \t]+|$)(.*)$/,vo=/^ {0,3}> ?(.*)$/,Pd=/^[ \t]*\|?[ \t]*:?-+:?[ \t]*(\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/,ur=/^[ \t]*$/;function Kr(r){let e=0;for(let t of r)e+=t===" "?4-e%4:1;return e}function Xs(r,e){return`<div class="code">${e?`<span class="lang">${re(e)}</span>`:""}<pre><code>${re(r)}</code></pre></div>
39
39
  `}var Zs=r=>r;function yo(r,e){let t=Zs;Zs=e??(n=>n);try{return So(sr(r).split(`
40
40
  `))}finally{Zs=t}}function iu(r){return ru.test(r)||su.test(r)||vo.test(r)||_e(r)!==null||/^[ \t]*<!--/.test(r)}function So(r){let e="",t=0;for(;t<r.length;){let n=r[t];if(ur.test(n)){t++;continue}if(/^[ \t]*<!--/.test(n)){for(;t<r.length&&!r[t].includes("-->");)t++;t++;continue}let s=_e(n);if(s){let l=t+1;for(;l<r.length&&!Ke(r[l],s);)l++;let c=u=>u.replace(new RegExp(`^[ \\t]{0,${s.indent.length}}`),"");e+=Xs(Zs(r.slice(t+1,l).map(c).join(`
41
41
  `)),sn(s.info)),t=l+1;continue}let i=ru.exec(n);if(i){let l=i[1].length;e+=`<h${l}>${on(i[2]??"")}</h${l}>
@@ -55,23 +55,23 @@ ${So(l)}</blockquote>
55
55
  `;for(let i of n)s+="<tr>"+e(i).map(o=>`<td>${on(o)}</td>`).join("")+`</tr>
56
56
  `;return s+`</tbody>
57
57
  </table>
58
- `}function on(r){let e=[],t=s=>`\0${e.push(s)-1}\0`,n=r.replace(/\u0000/g,"");for(n=n.replace(/(`+)([\s\S]*?[^`])\1(?!`)/g,(s,i,o)=>t(`<code>${re(o.replace(/^ (.*) $/,"$1"))}</code>`)),n=n.replace(/\\([!-/:-@[-`{-~])/g,(s,i)=>t(re(i))),n=re(n),n=n.replace(/!?\[([^\]]*)\]\(([^)\s]*)(?:\s+&quot;[^)]*?&quot;)?\)/g,(s,i,o)=>{let B=nu(o.replace(/&amp;/g,"&")),a=tu(i)||o;return t(B===void 0?a:`<a href="${re(B)}">${a}</a>`)}),n=n.replace(/&lt;((?:https?:\/\/|mailto:)[^\s&]+(?:&amp;[^\s&]+)*)&gt;/g,(s,i)=>t(`<a href="${i}">${i}</a>`)),n=tu(n);/\u0000\d+\u0000/.test(n);)n=n.replace(/\u0000(\d+)\u0000/g,(s,i)=>e[Number(i)]);return n}function tu(r){return r.replace(/\*\*(?=\S)([\s\S]*?\S)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w])__(?=\S)([\s\S]*?\S)__(?!\w)/g,"$1<strong>$2</strong>").replace(/\*(?=[^\s*])([\s\S]*?[^\s*])\*/g,"<em>$1</em>").replace(/(^|[^\w])_(?=[^\s_])([\s\S]*?[^\s_])_(?!\w)/g,"$1<em>$2</em>").replace(/~~(?=\S)([\s\S]*?\S)~~/g,"<del>$1</del>")}var N=class Fn{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=Fn.CLASS_NL|Fn.DOT_NL;static PERL=Fn.CLASS_NL|Fn.ONE_LINE|Fn.PERL_X|Fn.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2},At={CASE_INSENSITIVE:1,DOTALL:2,MULTILINE:4,DISABLE_UNICODE_GROUPS:8,LONGEST_MATCH:16,LOOKBEHINDS:512},Vr=128,Fo=new Int32Array(Vr),To=new Int32Array(Vr),ei=65535;for(let r=0;r<Vr;r++)r>=97&&r<=122?Fo[r]=r-32:Fo[r]=r,r>=65&&r<=90?To[r]=r+32:To[r]=r;var L=class{static CODES=new Map([["\x07",7],["\b",8],[" ",9],[`
59
- `,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(r){if(r<Vr)return Fo[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>ei?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>ei?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<Vr)return To[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>ei?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>ei?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},C=class{constructor(r,e=!1){this.data=r,this.isStride1=e,this.SIZE=e?2:3}getLo(r){return this.data[r*this.SIZE]}getHi(r){return this.data[r*this.SIZE+1]}getStride(r){return this.isStride1?1:this.data[r*this.SIZE+2]}get length(){return this.data.length/this.SIZE}},Tu=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)Tu[e.charCodeAt(r)]=r;var Iu=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let i=Tu[r.charCodeAt(s)];t|=(i&31)<<n,(i&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Iu(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),i=0,o=0;for(let B=0;B<n;B++)i+=t[o++],s[B*3]=i,i+=t[o++],s[B*3+1]=i,s[B*3+2]=e?1:t[o++];return s},Jd=r=>{let e=Iu(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let i=e[s+1],o=i>>>1^-(i&1);t.set(n,n+o)}return t},ti=class{constructor(r){this.initializer=r,this.cache=new Map}has(r){return r in this.initializer}get(r){if(this.cache.has(r))return this.cache.get(r);let e=this.initializer[r],t=e?e():null;return this.cache.set(r,t),t}},st=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Jd("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCB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C8HBB4CBBFBB-MCBuBmUmUBrCrCBspBspBBDB6vRBBmEiCiCBBBLqRqRBoJoJBnwTnwTovHDB",!1)),Uppercase:()=>new C(g("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new C(g("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static get Upper(){return this.CATEGORIES.get("Lu")}static SCRIPTS=new ti({Adlam:()=>new C(g("go6DrCFJFB",!0)),Ahom:()=>new C(g("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new C(g("ggxCmS",!0)),Arabic:()=>new C(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new C(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new C(g("g4iC1BEG",!0)),Balinese:()=>new C(g("g4GsCCxB",!0)),Bamum:()=>new C(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new C(g("w26CdDF",!0)),Batak:()=>new C(g("g+GzBJD",!0)),Bengali:()=>new C(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new C(g("g17CYDY",!0)),Bhaiksuki:()=>new C(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new C(g("qXB6wLqBxDf",!0)),Brahmi:()=>new C(g("ggkCtCFjBKA",!0)),Braille:()=>new C(g("ggK-H",!0)),Buginese:()=>new C(g("gwGbDB",!0)),Buhid:()=>new C(g("g6FT",!0)),Canadian_Aboriginal:()=>new C(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new C(g("g1gCwB",!0)),Caucasian_Albanian:()=>new C(g("wphCzBMA",!0)),Chakma:()=>new C(g("gokC0BCR",!0)),Cham:()=>new C(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new C(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new C(g("w9jCb",!0)),Common:()=>new C(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new C(g("ifNxkKzDGG",!0)),Cuneiform:()=>new C(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new C(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new C(g("w8rCiD",!0)),Cyrillic:()=>new C(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new C(g("gghCvC",!0)),Devanagari:()=>new C(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new C(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new C(g("ggmC7B",!0)),Duployan:()=>new C(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new C(g("ggsC1iBL68D",!0)),Elbasan:()=>new C(g("gohCnB",!0)),Elymaic:()=>new C(g("g-jCW",!0)),Ethiopic:()=>new C(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new C(g("gqjClBEcJB",!0)),Georgian:()=>new C(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new C(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new C(g("w5gCa",!0)),Grantha:()=>new C(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new C(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new C(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new C(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new C(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new C(g("go4C5B",!0)),Han:()=>new C(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new C(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new C(g("gojCnBJJ",!0)),Hanunoo:()=>new C(g("g5FU",!0)),Hatran:()=>new C(g("gniCSCBGE",!0)),Hebrew:()=>new C(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new C(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new C(g("giiCVCI",!0)),Inherited:()=>new C(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new C(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new C(g("g6iCVDH",!0)),Javanese:()=>new C(g("gsqBtCDJFB",!0)),Kaithi:()=>new C(g("gkkCiCLA",!0)),Kannada:()=>new C(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new C(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new C(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new C(g("goqBtBCA",!0)),Kharoshthi:()=>new C(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new C(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new C(g("g8F9CDJHJnPf",!0)),Khojki:()=>new C(g("gwkCRCuB",!0)),Khudawadi:()=>new C(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new C(g("gq7C5B",!0)),Lao:()=>new C(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new C(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new C(g("ggH3BEOEC",!0)),Limbu:()=>new C(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new C(g("gwhC2JKVLH",!0)),Linear_B:()=>new C(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new C(g("wmpBvBx1eA",!0)),Lycian:()=>new C(g("g0gCc",!0)),Lydian:()=>new C(g("gpiCZGA",!0)),Mahajani:()=>new C(g("wqkCmB",!0)),Makasar:()=>new C(g("g3nCY",!0)),Malayalam:()=>new C(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new C(g("giCbDA",!0)),Manichaean:()=>new C(g("g2iCmBFL",!0)),Marchen:()=>new C(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new C(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new C(g("gy7C6C",!0)),Meetei_Mayek:()=>new C(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new C(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new C(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new C(g("gsiCf",!0)),Miao:()=>new C(g("g47CqCF4BIQ",!0)),Modi:()=>new C(g("gwlCkCMJ",!0)),Mongolian:()=>new C(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new C(g("gy6CeCJFB",!0)),Multani:()=>new C(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new C(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new C(g("gkiCeJI",!0)),Nag_Mundari:()=>new C(g("wm5DpB",!0)),Nandinagari:()=>new C(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new C(g("gsGrBFZHKEB",!0)),Newa:()=>new C(g("gglC7CCE",!0)),Nko:()=>new C(g("g+B6BDC",!0)),Nushu:()=>new C(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new C(g("go4DsBENDJFB",!0)),Ogham:()=>new C(g("g0Fc",!0)),Ol_Chiki:()=>new C(g("wiHvB",!0)),Ol_Onal:()=>new C(g("wu5DqBFA",!0)),Old_Hungarian:()=>new C(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new C(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new C(g("g0iCf",!0)),Old_Permic:()=>new C(g("w6gCqB",!0)),Old_Persian:()=>new C(g("g9gCjBFN",!0)),Old_Sogdian:()=>new C(g("g4jCnB",!0)),Old_South_Arabian:()=>new C(g("gziCf",!0)),Old_Turkic:()=>new C(g("ggjCoC",!0)),Old_Uyghur:()=>new C(g("w7jCZ",!0)),Oriya:()=>new C(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new C(g("wlhCjBFjB",!0)),Osmanya:()=>new C(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new C(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new C(g("gjiCf",!0)),Pau_Cin_Hau:()=>new C(g("g2mC4B",!0)),Phags_Pa:()=>new C(g("giqB3B",!0)),Phoenician:()=>new C(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new C(g("g8iCRIDNG",!0)),Rejang:()=>new C(g("wpqBjBMA",!0)),Runic:()=>new C(g("g1FqCEK",!0)),Samaritan:()=>new C(g("ggCtBDO",!0)),Saurashtra:()=>new C(g("gkqBlCJL",!0)),Sharada:()=>new C(g("gskC-ChsCH",!0)),Shavian:()=>new C(g("wihCvB",!0)),Siddham:()=>new C(g("gslC1BDlB",!0)),Sidetic:()=>new C(g("gqiCZ",!0)),SignWriting:()=>new C(g("gg2DrUQECO",!0)),Sinhala:()=>new C(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new C(g("w5jCpB",!0)),Sora_Sompeng:()=>new C(g("wmkCYIJ",!0)),Soyombo:()=>new C(g("wymCyC",!0)),Sundanese:()=>new C(g("g8G-BhIH",!0)),Sunuwar:()=>new C(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new C(g("ggqBsB",!0)),Syriac:()=>new C(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new C(g("g4FVKA",!0)),Tagbanwa:()=>new C(g("g7FMCCCB",!0)),Tai_Le:()=>new C(g("wqGdDE",!0)),Tai_Tham:()=>new C(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new C(g("g0qBiCZE",!0)),Tai_Yo:()=>new C(g("g25DeCVJB",!0)),Takri:()=>new C(g("g0lC5BHJ",!0)),Tamil:()=>new C(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new C(g("wz6CuCCJ",!0)),Tangut:()=>new C(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new C(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new C(g("g8BxB",!0)),Thai:()=>new C(g("hwD5BGb",!0)),Tibetan:()=>new C(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tif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lJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new C(g("gopBrJ",!0)),Vithkuqi:()=>new C(g("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new C(g("g24D5BGA",!0)),Warang_Citi:()=>new C(g("glmCyCNA",!0)),Yezidi:()=>new C(g("g0jCpBCCDB",!0)),Yi:()=>new C(g("ggoBskBE2B",!0)),Zanabazar_Square:()=>new C(g("gwmCnC",!0))});static FOLD_CATEGORIES=new ti({L:()=>new C(g("laA",!0)),LC:()=>new C(g("laA",!0)),Ll:()=>new C(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB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9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new C(g("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new C(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new ti({Common:()=>new C(g("8cgBgB",!1)),Greek:()=>new C(g("1FwUwU",!1)),Inherited:()=>new C(g("5cgBgBlgHAB",!1))})},j=class Ye{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===Ye.RUNE_ERROR||e>=Ye.MIN_HIGH_SURROGATE&&e<=Ye.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){let i=n+Math.floor((s-n)/2),o=e.getLo(i),B=e.getHi(i);if(o<=t&&t<=B){let a=e.getStride(i);return(t-o)%a===0}t<o?s=i:n=i+1}return!1}static is(e,t){if(t<=Ye.MAX_LATIN1){for(let n=0;n<e.length;n++){if(t>e.getHi(n))continue;let s=e.getLo(n);if(t<s)return!1;let i=e.getStride(n);return(t-s)%i===0}return!1}return e.length>0&&t>=e.getLo(0)&&Ye.is32(e,t)}static isUpper(e){if(e<=Ye.MAX_LATIN1){let t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return Ye.is(st.Upper,e)}static isPrint(e){return e<=Ye.MAX_LATIN1?e>=32&&e<Ye.MAX_ASCII||e>=161&&e!==173:Ye.is(st.Print,e)}static simpleFold(e){if(st.CASE_ORBIT.has(e))return st.CASE_ORBIT.get(e);if(e<=Ye.MAX_ASCII){let t=L.toLowerCase(e);return t!==e?t:L.toUpperCase(e)}return e}static equalsIgnoreCase(e,t){if(e===t)return!0;if(e<0||t<0)return!1;if(e<=Ye.MAX_ASCII&&t<=Ye.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let n=Ye.simpleFold(e);n!==e;n=Ye.simpleFold(n))if(n===t)return!0;return!1}},No=256,Lu=new Uint8Array(No);for(let r=0;r<No;r++)Lu[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var Ro=null,Oo=null,U=class dt{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||Object.prototype.toString.call(e)==="[object Uint8Array]"}static isalnum(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")||L.CODES.get("a")<=e&&e<=L.CODES.get("z")||L.CODES.get("A")<=e&&e<=L.CODES.get("Z")}static unhex(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")?e-L.CODES.get("0"):L.CODES.get("a")<=e&&e<=L.CODES.get("f")?e-L.CODES.get("a")+10:L.CODES.get("A")<=e&&e<=L.CODES.get("F")?e-L.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(j.isPrint(e))dt.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case L.CODES.get('"'):t+='\\"';break;case L.CODES.get("\\"):t+="\\\\";break;case L.CODES.get(" "):t+="\\t";break;case L.CODES.get(`
60
- `):t+="\\n";break;case L.CODES.get("\r"):t+="\\r";break;case L.CODES.get("\b"):t+="\\b";break;case L.CODES.get("\f"):t+="\\f";break;default:{let n=e.toString(16);e<256?(t+="\\x",n.length===1&&(t+="0"),t+=n):t+=`\\x{${n}}`;break}}return t}static stringToRunes(e){let t=String(e),n=[],s=0;for(;s<t.length;){let i=t.codePointAt(s);n.push(i),s+=i>j.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<No?Lu[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=dt.EMPTY_BEGIN_TEXT|dt.EMPTY_BEGIN_LINE),e===10&&(n|=dt.EMPTY_BEGIN_LINE),t<0&&(n|=dt.EMPTY_END_TEXT|dt.EMPTY_END_LINE),t===10&&(n|=dt.EMPTY_END_LINE),dt.isWordRune(e)!==dt.isWordRune(t)?n|=dt.EMPTY_WORD_BOUNDARY:n|=dt.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>dt.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>j.MAX_BMP?2:1}static toArray(e){let t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return Ro||(Ro=new TextEncoder),Ro.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===j.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===j.MIN_LOW_SURROGATE?(i=j.MIN_SUPPLEMENTARY_CODE_POINT+((i&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){Oo||(Oo=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return Oo.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let i=e[n++];if(i<128)t[s++]=String.fromCharCode(i);else if(i>191&&i<224){let o=e[n++];t[s++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=e[n++],B=e[n++],a=e[n++],l=((i&7)<<18|(o&63)<<12|(B&63)<<6|a&63)-j.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(j.MIN_HIGH_SURROGATE+(l>>10)),t[s++]=String.fromCharCode(j.MIN_LOW_SURROGATE+(l&1023))}else{let o=e[n++],B=e[n++];t[s++]=String.fromCharCode((i&15)<<12|(o&63)<<6|B&63)}}return t.join("")}}},Nu=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],i=e+n;t[s]=i,t[i]=s}return Object.freeze(t)},Ln=class Io{static Encoding=Nu(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===Io.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===Io.Encoding.UTF_16}},ou=class extends Ln{constructor(r=null){super(),this.bytes=r}getEncoding(){return Ln.Encoding.UTF_8}asCharSequence(){return U.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},jd=class extends Ln{constructor(r=null){super(),this.charSequence=r}getEncoding(){return Ln.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return U.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},In=class{static utf16(r){return new jd(r)}static utf8(r){return U.isByteArray(r)?new ou(r):new ou(U.stringToUtf8ByteArray(r))}},Ze=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},Kd=class lr extends Ze{static RUNE_ERROR_STEP=j.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){let n=e.bytes;if(n.length===0)return!0;let s=this.indexOf(this.bytes,n,this.start+t);return s!==-1&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(e){if(e+=this.start,e>=this.end)return Ze.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,i=128,o=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?i=160:t===237&&(o=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?i=144:t===244&&(o=143);else return lr.RUNE_ERROR_STEP;if(e+n>this.end)return lr.RUNE_ERROR_STEP;let B=this.bytes[e+1]&255;if(B<i||B>o)return lr.RUNE_ERROR_STEP;if(s=s<<6|B&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return lr.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let l=this.bytes[e+3]&255;if((l&192)!==128)return lr.RUNE_ERROR_STEP;s=s<<6|l&63}}return s<<3|n}index(e,t){t+=this.start;let n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){e+=this.start;let t=-1;if(e>this.start&&e<=this.end){let s=e-1;if(t=this.bytes[s--],t>=128){let i=e-4;for(i<this.start&&(i=this.start);s>=i&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let o=this.step(s-this.start);t=s+(o&7)===e?o>>3:j.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return U.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let i=t[0],o=this.end-s,B=typeof e.indexOf=="function",a=n;for(;a<=o;){if(B){if(a=e.indexOf(i,a),a===-1||a>o)return-1}else{for(;a<=o&&e[a]!==i;)a++;if(a>o)return-1}let l=!0;for(let c=1;c<s;c++)if(e[a+c]!==t[c]){l=!1;break}if(l)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},zd=class extends Ze{constructor(r,e=0,t=r.length){super(),this.charSequence=r,this.start=e,this.end=t}hasString(r,e){let t=this.charSequence.indexOf(r.str,this.start+e);return t!==-1&&t<=this.end-r.str.length}hasAnyString(r,e){return r.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(r){if(r+=this.start,r>=this.end)return Ze.EOF();let e=this.charSequence.charCodeAt(r);if(e<j.MIN_HIGH_SURROGATE||e>j.MAX_HIGH_SURROGATE||r+1>=this.end)return e<<3|1;let t=this.charSequence.charCodeAt(r+1);return t>=j.MIN_LOW_SURROGATE&&t<=j.MAX_LOW_SURROGATE?(e-j.MIN_HIGH_SURROGATE)*1024+(t-j.MIN_LOW_SURROGATE)+j.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(r,e){e+=this.start;let t=this.charSequence.indexOf(r.prefix,e);return t<0||t>this.end-r.prefix.length?-1:t-e}context(r){r+=this.start;let e=r>this.start&&r<=this.end?this.charSequence.charCodeAt(r-1):-1,t=r<this.end?this.charSequence.charCodeAt(r):-1;return U.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},we=class{static fromUTF8(r,e=0,t=r.length){return new Kd(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new zd(r,e,t)}},Zr=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},xe=class extends Zr{constructor(r,e=null){let t=`error parsing regexp: ${r}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=r,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},Qr=class extends Zr{constructor(r){super(r),this.name="RE2JSCompileException"}},rt=class extends Zr{constructor(r){super(r),this.name="RE2JSGroupException"}},Yd=class extends Zr{constructor(r){super(r),this.name="RE2JSFlagsException"}},Wr=class extends Zr{constructor(r){super(r),this.name="RE2JSInternalException"}},Bu=class Mu{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(n=>{let s=n.codePointAt(0);return s===L.CODES.get("\\")||s===L.CODES.get("$")?`\\${n}`:n}).join(""):e.indexOf("$")<0?e:e.split("").map(n=>n.codePointAt(0)===L.CODES.get("$")?"$$":n).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;let n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof Ln?this.resetMatcherInput(t):U.isByteArray(t)?this.resetMatcherInput(In.utf8(t)):this.resetMatcherInput(In.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof Ln||(U.isByteArray(e)?e=In.utf8(e):e=In.utf16(e)),this.matcherInput=e,this.lookbehindState!==null?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new rt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new rt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){let s=this.namedGroups[e];if(!Number.isFinite(s))throw new rt(`group '${e}' not found`);e=s}let t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new rt("perhaps no match attempted");let e=Object.create(null);for(let t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new rt(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new rt("perhaps no match attempted");if(e===0||this.hasGroups)return;let t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new rt("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,N.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,N.ANCHOR_START)}find(e=null){if(e!==null){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new rt(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){let t=(this.matcherInput.isUTF16Encoding()?we.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):we.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,N.UNANCHORED)}genMatch(e,t){let n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?U.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="",s=this.start(),i=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=i,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,i=0;for(;i<s;){let o=e.codePointAt(i);if(o===L.CODES.get("\\")){if(n<i&&(t+=e.substring(n,i)),i++,i>=s)throw new rt("character to be escaped is missing");n=i,i++;continue}if(o===L.CODES.get("$")){if(n<i&&(t+=e.substring(n,i)),i+1>=s)throw new rt("Illegal group reference: group index is missing");let B=e.codePointAt(i+1);if(L.CODES.get("0")<=B&&B<=L.CODES.get("9")){let a=B-L.CODES.get("0"),l=i+2;for(;l<s;l++){let u=e.codePointAt(l);if(u<L.CODES.get("0")||u>L.CODES.get("9")||a*10+u-L.CODES.get("0")>this.patternGroupCount)break;a=a*10+u-L.CODES.get("0")}if(a>this.patternGroupCount)throw new rt(`n > number of groups: ${a}`);let c=this.group(a);c!==null&&(t+=c),i=l,n=i}else if(B===L.CODES.get("{")){let a=i+2;for(;a<s&&e.codePointAt(a)!==L.CODES.get("}");)a++;if(a>=s)throw new rt("named capture group is missing trailing '}'");let l=e.substring(i+2,a),c=this.group(l);c!==null&&(t+=c),i=a+1,n=i}else throw new rt("Illegal group reference");continue}i++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let i=0;i<s-1;i++)if(e.codePointAt(i)===L.CODES.get("$")){let o=e.codePointAt(i+1);if(L.CODES.get("$")===o){n<i&&(t+=e.substring(n,i)),t+="$",i++,n=i+1;continue}else if(L.CODES.get("&")===o){n<i&&(t+=e.substring(n,i));let B=this.group(0);B!==null?t+=B:t+="$&",i++,n=i+1;continue}else if(L.CODES.get("`")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(0,this.start(0)),i++,n=i+1;continue}else if(L.CODES.get("'")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(this.end(0),this.matcherInputLength),i++,n=i+1;continue}else if(L.CODES.get("1")<=o&&o<=L.CODES.get("9")){let B=o-L.CODES.get("0");for(n<i&&(t+=e.substring(n,i)),i+=2;i<s&&(o=e.codePointAt(i),!(o<L.CODES.get("0")||o>L.CODES.get("9")||B*10+o-L.CODES.get("0")>this.patternGroupCount));i++)B=B*10+o-L.CODES.get("0");if(B>this.patternGroupCount){t+=`$${B}`,n=i,i--;continue}let a=this.group(B);a!==null&&(t+=a),n=i,i--;continue}else if(o===L.CODES.get("<")){n<i&&(t+=e.substring(n,i)),i++;let B=i+1;for(;B<e.length&&e.codePointAt(B)!==L.CODES.get(">")&&e.codePointAt(B)!==L.CODES.get(" ");)B++;if(B===e.length||e.codePointAt(B)!==L.CODES.get(">")){t+=e.substring(i-1,B+1),n=B+1,i=B;continue}let a=e.substring(i+1,B);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let l=this.group(a);l!==null&&(t+=l)}else t+=`$<${a}>`;n=B+1,i=B;continue}}return n<s&&(t+=e.substring(n,s)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,n=!1){let s="";this.reset();let i=typeof e=="function",o=Object.keys(this.namedGroups).length>0,B=null;if(i){if(this.groupCount()>=Mu.MAX_REPLACER_ARGS)throw new rt("Too many capture groups to safely invoke replacer function");B=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=i?this.appendReplacementFunc(e,o,B):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",i=this.start(),o=this.end();this.appendPos<i&&(s+=this.substring(this.appendPos,i)),this.appendPos=o;let B=this.buildReplacerArgs(i,t,n);return s+=String(e(...B)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],i=this.groupCount();for(let o=1;o<=i;o++){let B=this.start(o);B<0?s.push(void 0):s.push(this.substring(B,this.end(o)))}if(s.push(e),s.push(n),t){let o=this.getNamedGroups();for(let B in o)o[B]===null&&(o[B]=void 0);s.push(o)}return s}},$=class Ue{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return Ue.RUNE<=e&&e<=Ue.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=U.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e):e===o}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return!1;if(e<=this.runes[o+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]}matchRunePos(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e)?0:-1:e===o?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return-1;if(e<=this.runes[o+1])return Math.floor(o/2)}return-1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]?i:-1}toString(){switch(this.op){case Ue.ALT:return`alt -> ${this.out}, ${this.arg}`;case Ue.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case Ue.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case Ue.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case Ue.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case Ue.FAIL:return"fail";case Ue.NOP:return`nop -> ${this.out}`;case Ue.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case Ue.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case Ue.RUNE:return this.runes===null?"rune <null>":["rune ",Ue.escapeRunes(this.runes),(this.arg&N.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case Ue.RUNE1:return`rune1 ${Ue.escapeRunes(this.runes)} -> ${this.out}`;case Ue.RUNE_ANY:return`any -> ${this.out}`;case Ue.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},au=class Gu{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;let t=Math.min(this.densePcs.length,Gu.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<t)&&(this.denseCaps=new Int32Array(t))}growCaps(e){let t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){let t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return this.size===0}add(e){let t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)t!==0&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},qd=class{constructor(r){this.pos=-1,this.pcs=new Int32Array(r.numInst()),this.size=0,this.lbTable=new Int32Array(r.numLb+1)}reset(){this.pos=-1,this.size=0}},Pu=class Hu{static fromRE2(e){let t=new Hu;return t.prog=e.prog,t.re2=e,t.q0=new au(t.prog.numInst()),t.q1=new au(t.prog.numInst()),t.addStack=new Int32Array(2*(t.prog.numInst()+1)),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?U.emptyInts():U.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let i=this.re2.cond;if(i===U.EMPTY_ALL||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let o=this.prog.numLb>0,B=t,a=t,l=!1;o&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,l=!0):a=0);let c=o&&s!==null,u=this.q0,f=this.q1,d=e.step(a),h=d>>3,p=d&7,k=-1,D=0;d!==Ze.EOF()&&(d=e.step(a+p),k=d>>3,D=d&7);let m;for(a===0?m=U.emptyOpContext(-1,h):m=e.context(a),o&&(l?this.restoreLookbehinds(s,u,m):this.spawnLookbehinds(u,a,m));;){if(u.mainThreads===0){if((i&U.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&u.isEmpty()&&this.re2.prefix.length!==0&&k!==this.re2.prefixRune&&e.canCheckPrefix()){let R=e.index(this.re2,a);if(R<0)break;a+=R,d=e.step(a),h=d>>3,p=d&7,d=e.step(a+p),k=d>>3,D=d&7,m=e.context(a)}}a>=B&&(c&&(this.saveLookbehinds(s,u,a),c=!1),!this.matched&&(a===0||n===N.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(u,this.prog.start,a,this.matchcap,0,m)));let b=a+p;if(m=e.context(b),this.step(u,f,a,b,h,m,n,a===e.endPos()),p===0||this.ncap===0&&this.matched)break;a+=p,h=k,p=D,h!==-1&&(d=e.step(a+p),k=d>>3,D=d&7);let w=u;u=f,f=w}return u.clear(),f.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===U.EMPTY_ALL)return[];if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let i=this.prog.numLb>0?0:t,o=t,B=this.q0,a=this.q1,l=e.step(i),c=l>>3,u=l&7,f=-1,d=0;l!==Ze.EOF()&&(l=e.step(i+u),f=l>>3,d=l&7);let h=i===0?U.emptyOpContext(-1,c):e.context(i),p=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(B,i,h);!(B.mainThreads===0&&((s&U.EMPTY_BEGIN_TEXT)!==0&&i!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&i!==0));){(i===0||n===N.UNANCHORED)&&i>=o&&this.add(B,this.prog.start,i,this.matchcap,0,h);let k=i+u;h=e.context(k);for(let m=0;m<B.size;m++){let b=B.densePcs[m],w=this.prog.inst[b],R=m*this.ncap,y=!1;switch(w.op){case $.MATCH:if(n===N.ANCHOR_BOTH&&i!==e.endPos())break;p.add(w.arg);break;case $.RUNE:y=w.matchRune(c);break;case $.RUNE1:y=c===w.runes[0];break;case $.RUNE_ANY:y=!0;break;case $.RUNE_ANY_NOT_NL:y=c!==10;break;default:continue}y&&this.add(a,w.out,k,B.denseCaps,R,h)}if(B.clear(),u===0)break;i+=u,c=f,u=d,c!==-1&&(l=e.step(i+u),f=l>>3,d=l&7);let D=B;B=a,a=D}return a.clear(),Array.from(p).sort((k,D)=>k-D)}step(e,t,n,s,i,o,B,a){let l=this.re2.longest;for(let c=0;c<e.size;c++){let u=e.densePcs[c],f=c*this.ncap;if(l&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[f])continue;let d=this.prog.inst[u],h=!1;switch(d.op){case $.MATCH:if(B===N.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!l||!this.matched||this.matchcap[1]<n)){e.denseCaps[f+1]=n;for(let p=0;p<this.ncap;p++)this.matchcap[p]=e.denseCaps[f+p]}l||(e.size=0),this.matched=!0;break;case $.RUNE:h=d.matchRune(i);break;case $.RUNE1:h=i===d.runes[0];break;case $.RUNE_ANY:h=!0;break;case $.RUNE_ANY_NOT_NL:h=i!==10;break;default:continue}h&&this.add(t,d.out,s,e.denseCaps,f,o)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let i=0;i<t.size;i++){let o=t.densePcs[i];this.prog.lbInst[o]===1&&$.isRuneOp(this.prog.inst[o].op)&&(e.pcs[s++]=o)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,i,o){let B=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let c=e.add(t),u=this.prog.inst[t];switch(u.op){case $.FAIL:t=0;break;case $.ALT:case $.ALT_MATCH:B[a++]=u.arg,B[a++]=0,t=u.out;break;case $.EMPTY_WIDTH:t=(u.arg&~o)===0?u.out:0;break;case $.NOP:t=u.out;break;case $.CAPTURE:u.arg<this.ncap&&(B[a++]=-u.arg-1,B[a++]=s[i+u.arg],s[i+u.arg]=n),t=u.out;break;case $.LB_WRITE:this.lbTable[Math.abs(u.arg)]=n,t=u.out;break;case $.LB_CHECK:u.arg>0?t=this.lbTable[u.arg]===n?u.out:0:t=this.lbTable[-u.arg]!==n?u.out:0;break;case $.MATCH:case $.RUNE:case $.RUNE1:case $.RUNE_ANY:case $.RUNE_ANY_NOT_NL:if(this.prog.lbInst[t]===0&&e.mainThreads++,this.ncap>0){let f=c*this.ncap;f+this.ncap>e.denseCaps.length&&e.growCaps(f+this.ncap);for(let d=0;d<this.ncap;d++)e.denseCaps[f+d]=s[i+d]}t=0;break;default:throw new Wr("unhandled")}}if(a===0)return;a-=2;let l=B[a];l<0?(s[i-l-1]=B[a+1],t=0):t=l}}},Qd=(r,e,t)=>{let n=-2128831035;for(let s=0;s<r.length;s++)n^=r[s],n=Math.imul(n,16777619);n^=e,n=Math.imul(n,16777619);for(let s=0;s<t.length;s++)n^=t[s],n=Math.imul(n,16777619);return n},uu=(r,e)=>{if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0},Ao=[],Yr=-1,Wd=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&Mo.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},Mo=class pt{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=160;static TABLE_OVERHEAD=16;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let n=0;n<e.numInst();n++){let s=e.getInst(n).op;if(s===$.LB_WRITE||s===$.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){let e=new Set,t=(s,i)=>{e.add(s),e.add(i+1)};for(let s=0;s<this.prog.numInst();s++){let i=this.prog.getInst(s);switch(i.op){case $.RUNE:case $.RUNE1:if(i.runes.length===1){if(t(i.runes[0],i.runes[0]),(i.arg&N.FOLD_CASE)!==0)for(let o=j.simpleFold(i.runes[0]);o!==i.runes[0];o=j.simpleFold(o))t(o,o)}else for(let o=0;o<i.runes.length;o+=2)t(i.runes[o],i.runes[o+1]);break;case $.RUNE_ANY_NOT_NL:t(10,10);break;case $.EMPTY_WIDTH:(i.arg&(U.EMPTY_BEGIN_LINE|U.EMPTY_END_LINE))!==0&&t(10,10),(i.arg&(U.EMPTY_WORD_BOUNDARY|U.EMPTY_NO_WORD_BOUNDARY))!==0&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;let n=new Int32Array(j.MAX_LATIN1+1);for(let s=0;s<=j.MAX_LATIN1;s++)n[s]=this.searchClass(s);this.latin1Class=n}runeClass(e){return e<=j.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){let t=this.classBounds,n=0,s=t.length;for(;n<s;){let i=n+s>>1;t[i]<=e?n=i+1:s=i}return n}closure(e,t){let n=new Set,s=Array.from(e),i=0;for(;s.length>0;){let o=s.pop();if(o===0||n.has(o))continue;n.add(o);let B=this.prog.getInst(o);switch(B.op){case $.ALT:case $.ALT_MATCH:s.push(B.out),s.push(B.arg);break;case $.NOP:case $.CAPTURE:s.push(B.out);break;case $.EMPTY_WIDTH:i|=B.arg,(B.arg&~t)===0&&s.push(B.out)}}return{pcs:Int32Array.from(n).sort(),needflags:i}}getState(e,t,n){let s=Qd(e,t,n),i=this.stateCache.get(s);if(i)for(let a=0;a<i.length;a++){let l=i[a];if(l.flag===t&&uu(l.nfaStates,e)&&uu(l.matchIDs,n))return l}let o=pt.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<o)return null;this.memBudget-=o,i||(i=[],this.stateCache.set(s,i));let B=new Wd(e,t,n);return i.push(B),this.stateCount++,B}makeState(e,t,n){let s=this.closure(e,t&pt.FLAG_EMPTY_MASK),i=t;return s.needflags===0&&(i&=pt.FLAG_MATCH),i|=s.needflags<<pt.FLAG_NEED_SHIFT,this.getState(s.pcs,i,n)}allocTable(e,t){let n=this.numClasses+1,s=pt.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let i=new Array(n).fill(null);return t===N.UNANCHORED?e.next=i:e.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(e,t,n,s){let i=s===N.UNANCHORED?e.next:e.nextAnchored;if(i!==null){let m=i[t];if(m!==null)return m}else if(i=this.allocTable(e,s),i===null)return null;let o=e.flag>>>pt.FLAG_NEED_SHIFT,B=e.flag&pt.FLAG_EMPTY_MASK,a=B,l=0;n===10&&(a|=U.EMPTY_END_LINE,l|=U.EMPTY_BEGIN_LINE),n===Yr&&(a|=U.EMPTY_END_LINE|U.EMPTY_END_TEXT);let c=(e.flag&pt.FLAG_LAST_WORD)!==0,u=n!==Yr&&U.isWordRune(n);a|=u===c?U.EMPTY_NO_WORD_BOUNDARY:U.EMPTY_WORD_BOUNDARY;let f=e.nfaStates;(a&~B&o)!==0&&(f=this.closure(f,a).pcs);let d=[],h=!1,p=Ao;for(let m=0;m<f.length;m++){let b=this.prog.getInst(f[m]);b.op===$.MATCH?(h||(h=!0,p=[]),p.push(b.arg)):n!==Yr&&$.isRuneOp(b.op)&&b.matchRune(n)&&d.push(b.out)}p.length>1&&p.sort((m,b)=>m-b),s===N.UNANCHORED&&n!==Yr&&d.push(this.prog.start);let k=l;h&&(k|=pt.FLAG_MATCH),u&&(k|=pt.FLAG_LAST_WORD);let D=this.makeState(d,k,p);return D===null?null:(i[t]=D,D)}start(e,t){let n=e.context(t),s;if((n&U.EMPTY_BEGIN_TEXT)!==0)s=U.EMPTY_BEGIN_TEXT|U.EMPTY_BEGIN_LINE;else if((n&U.EMPTY_BEGIN_LINE)!==0)s=U.EMPTY_BEGIN_LINE;else{let o=e.step(t),B=o>=0&&U.isWordRune(o>>3);s=(n&U.EMPTY_WORD_BOUNDARY)!==0!==B?pt.FLAG_LAST_WORD:0}let i=this.startStates.get(s);if(i===void 0){if(i=this.makeState([this.prog.start],s,Ao),i===null&&(this.clearCache(),i=this.makeState([this.prog.start],s,Ao),i===null))return null;this.startStates.set(s,i)}return i}stepOrReset(e,t,n,s,i,o){let B=this.step(e,t,n,s);if(B!==null)return B;if(o.resetPos>=0&&i-o.resetPos<pt.PROGRESS_PER_STATE*this.stateCount)return null;o.resetPos=i;let a=this.resetCache(e);return a===null?null:(B=this.step(a,t,n,s),B)}run(e,t,n,s,i){let o=e.endPos(),B=this.latin1Class,a=n===N.UNANCHORED,l={resetPos:-1},c=t;for(;c<o;){let u=e.step(c),f=u>>3,d=u&7;if(d===0)break;let h=f<=j.MAX_LATIN1?B[f]:this.runeClass(f),p=a&&s.next!==null?s.next[h]:null;if(p===null&&(p=this.stepOrReset(s,h,f,n,c,l),p===null))return null;if(s=p,s.isMatch&&i(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;c+=d}return s=this.stepOrReset(s,this.numClasses,Yr,n,c,l),s===null?null:s.isMatch&&i(s,!0)}match(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;let s=this.start(e,t);return s===null?null:this.run(e,t,n,s,(i,o)=>n!==N.ANCHOR_BOTH||o)}matchSet(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let s=this.start(e,t);if(s===null)return null;let i=new Set,o=(B,a)=>{if(n!==N.ANCHOR_BOTH||a)for(let l=0;l<B.matchIDs.length;l++)i.add(B.matchIDs[l]);return!1};return this.run(e,t,n,s,o)===null?null:Array.from(i).sort((B,a)=>B-a)}},Vd=32,Zd=500,$o=256,Xd=262144,ep=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array($o),this.jobArg=new Uint8Array($o),this.jobPos=new Int32Array($o),this.jobLen=0,this.visited=new Uint32Array(0)}reset(r,e,t){this.end=e,this.jobLen=0,this.ncap=t;let n=r.numInst()*(e+1)+Vd-1>>>5;this.visited.length<n?this.visited=new Uint32Array(n):this.visited.fill(0,0,n),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(r,e){let t=r*(this.end+1)+e,n=t>>>5,s=1<<(t&31);return(this.visited[n]&s)!==0?!1:(this.visited[n]|=s,!0)}push(r,e,t,n){if(r.prog.getInst(e).op!==$.FAIL&&(n||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){let s=this.jobPc.length*2,i=new Int32Array(s);i.set(this.jobPc),this.jobPc=i;let o=new Uint8Array(s);o.set(this.jobArg),this.jobArg=o;let B=new Int32Array(s);B.set(this.jobPos),this.jobPos=B}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=n?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(r,e,t,n,s){let i=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let o=this.jobPc[this.jobLen],B=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],l=!0;for(;!(!l&&!this.shouldVisit(o,a));){l=!1;let c=r.prog.getInst(o);switch(c.op){case $.FAIL:throw new Wr("unexpected InstFail");case $.ALT:if(B){B=!1,o=c.arg;continue}else{this.push(r,o,a,!0),o=c.out;continue}case $.ALT_MATCH:{let u=r.prog.getInst(c.out);if($.isRuneOp(u.op)){this.push(r,c.arg,a,!1),o=c.arg,a=this.end;continue}this.push(r,c.out,this.end,!1),o=c.out;continue}case $.RUNE:{let u=e.step(a);if(u===Ze.EOF()||!c.matchRune(u>>3))break;a+=u&7,o=c.out;continue}case $.RUNE1:{let u=e.step(a);if(u===Ze.EOF()||u>>3!==c.runes[0])break;a+=u&7,o=c.out;continue}case $.RUNE_ANY_NOT_NL:{let u=e.step(a);if(u===Ze.EOF()||u>>3===10)break;a+=u&7,o=c.out;continue}case $.RUNE_ANY:{let u=e.step(a);if(u===Ze.EOF())break;a+=u&7,o=c.out;continue}case $.CAPTURE:if(B){this.cap[c.arg]=a;break}else{c.arg<this.ncap&&(this.push(r,o,this.cap[c.arg],!0),this.cap[c.arg]=a),o=c.out;continue}case $.EMPTY_WIDTH:{let u=e.context(a);if((c.arg&~u)!==0)break;o=c.out;continue}case $.NOP:o=c.out;continue;case $.MATCH:{if(s===N.ANCHOR_BOTH&&a!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=a);let u=this.matchcap[1];if((u===-1||i&&a>0&&a>u)&&this.matchcap.set(this.cap),!i||a===this.end)return!0;break}case $.LB_WRITE:case $.LB_CHECK:throw new Wr("Backtracker cannot evaluate Lookbehind instructions");default:throw new Wr("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}},ni=[],ri=class _u{static shouldBacktrack(e){return e.numInst()<=Zd}static maxBitStateLen(e){return _u.shouldBacktrack(e)?Math.floor(Xd/e.numInst()):0}static execute(e,t,n,s,i){let o=e.cond;if(o===U.EMPTY_ALL||(s===N.ANCHOR_START||s===N.ANCHOR_BOTH)&&n!==0||(o&U.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let B=ni.length>0?ni.pop():new ep,a=t.endPos();B.reset(e.prog,a,i);let l=!1;if((o&U.EMPTY_BEGIN_TEXT)!==0||s===N.ANCHOR_START||s===N.ANCHOR_BOTH)B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)&&(l=!0);else{let u=-1;for(;n<=a&&u!==0;n+=u){if(e.prefix.length>0){let d=t.index(e,n);if(d<0)break;n+=d}if(B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)){l=!0;break}let f=t.step(n);u=f===Ze.EOF()?0:f&7}}if(!l)return ni.push(B),null;let c=i===0?[]:U.toArray(B.matchcap.subarray(0,i));return ni.push(B),c}},lu=class{constructor(r){this.sparse=new Uint32Array(r),this.dense=new Uint32Array(r),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(r){return r<this.sparse.length&&this.sparse[r]<this.size&&this.dense[this.sparse[r]]===r}insert(r){this.contains(r)||this.insertNew(r)}insertNew(r){r>=this.sparse.length||(this.sparse[r]=this.size,this.dense[this.size]=r,this.size++)}},tp=(r,e,t,n)=>{let s=r.length,i=e.length,o=0,B=0,a=[],l=[],c=!0,u=-1,f=d=>{let h=d?r:e,p=d?o:B,k=d?t:n;return u>0&&h[p]<=a[u]?!1:(a.push(h[p],h[p+1]),d?o+=2:B+=2,u+=2,l.push(k),!0)};for(;o<s||B<i;)if(B>=i?c=f(!0):o>=s||e[B]<r[o]?c=f(!1):c=f(!0),!c)return null;return{merged:a,next:l}},np=class{constructor(r){this.start=r.start,this.numCap=r.numCap,this.inst=new Array(r.inst.length);for(let e=0;e<r.inst.length;e++){let t=r.inst[e],n=new $(t.op);n.out=t.out,n.arg=t.arg,n.runes=t.runes?new Int32Array(t.runes):new Int32Array(0),n.next=null,this.inst[e]=n}}},rp=r=>{let e=new np(r);for(let t=0;t<e.inst.length;t++){let n=e.inst[t];if(n.op!==$.ALT&&n.op!==$.ALT_MATCH)continue;let s="out",i="arg",o=e.inst[n[i]];if(o.op!==$.ALT&&o.op!==$.ALT_MATCH&&(s="arg",i="out",o=e.inst[n[i]],o.op!==$.ALT&&o.op!==$.ALT_MATCH))continue;let B=e.inst[n[s]];if(B.op===$.ALT||B.op===$.ALT_MATCH)continue;let a="out",l="arg",c=!1;o.out===t?c=!0:o.arg===t&&(c=!0,a="arg",l="out"),c&&(o[a]=n[s]),n[s]===o[a]&&(n[i]=o[l])}return e},sp=r=>{if(r.inst.length>=1e3)return null;let e=new lu(r.inst.length),t=new lu(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),i=o=>{let B=!0,a=r.inst[o];if(t.contains(o))return!0;switch(t.insert(o),a.op){case $.ALT:case $.ALT_MATCH:{B=i(a.out)&&i(a.arg);let l=s[a.out],c=s[a.arg];if(l&&c)return!1;if(c){let h=a.out;a.out=a.arg,a.arg=h;let p=l;l=c,c=p}l&&(s[o]=!0,a.op=$.ALT_MATCH);let u=n[a.out]||[],f=n[a.arg]||[],d=tp(u,f,a.out,a.arg);if(!d)return!1;n[o]=new Int32Array(d.merged),a.next=new Uint32Array(d.next);break}case $.CAPTURE:case $.EMPTY_WIDTH:case $.NOP:B=i(a.out),s[o]=s[a.out],n[o]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out);break;case $.MATCH:case $.FAIL:s[o]=a.op===$.MATCH;break;case $.RUNE:{if(s[o]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[o]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let l=[];if(a.runes.length===1&&(a.arg&N.FOLD_CASE)!==0){let c=a.runes[0];l.push(c,c);for(let u=j.simpleFold(c);u!==c;u=j.simpleFold(u))l.push(u,u);l.sort((u,f)=>u-f)}else for(let c=0;c<a.runes.length;c++)l.push(a.runes[c]);n[o]=new Int32Array(l),a.next=new Uint32Array(Math.floor(l.length/2)+1).fill(a.out),a.op=$.RUNE;break}case $.RUNE1:{if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let l=[];if((a.arg&N.FOLD_CASE)!==0){let c=a.runes[0];l.push(c,c);for(let u=j.simpleFold(c);u!==c;u=j.simpleFold(u))l.push(u,u);l.sort((u,f)=>u-f)}else l.push(a.runes[0],a.runes[0]);n[o]=new Int32Array(l),a.next=new Uint32Array(Math.floor(l.length/2)+1).fill(a.out),a.op=$.RUNE;break}case $.RUNE_ANY:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,j.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case $.RUNE_ANY_NOT_NL:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,9,11,j.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out)}return B};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!i(e.next()))return null;for(let o=0;o<r.inst.length;o++)n[o]&&(r.inst[o].runes=n[o]);return r},ip=(r,e)=>{for(let t=0;t<e.inst.length;t++){let n=e.inst[t];switch(n.op){case $.ALT:case $.ALT_MATCH:case $.RUNE:break;case $.CAPTURE:case $.EMPTY_WIDTH:case $.NOP:case $.MATCH:case $.FAIL:r.inst[t].next=null;break;case $.RUNE1:case $.RUNE_ANY:case $.RUNE_ANY_NOT_NL:r.inst[t].next=null,r.inst[t].op=n.op,r.inst[t].runes=n.runes?new Int32Array(n.runes):new Int32Array(0)}}},cu=class Uu{static compile(e){if(e.start===0||e.numLb>0)return null;let t=e.inst[e.start];if(t.op!==$.EMPTY_WIDTH||(t.arg&U.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let i=0;i<e.inst.length;i++)if(e.inst[i].op===$.ALT||e.inst[i].op===$.ALT_MATCH){n=!0;break}for(let i=0;i<e.inst.length;i++){let o=e.inst[i],B=e.inst[o.out].op;switch(o.op){case $.ALT:case $.ALT_MATCH:if(B===$.MATCH||e.inst[o.arg].op===$.MATCH)return null;break;case $.EMPTY_WIDTH:if(B===$.MATCH){if((o.arg&U.EMPTY_END_TEXT)===U.EMPTY_END_TEXT)continue;return null}break;default:if(B===$.MATCH&&n)return null}}let s=rp(e);return s=sp(s),s!==null&&ip(s,e),s}static next(e,t){let n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===$.ALT_MATCH?e.out:0}static execute(e,t,n,s,i){let o=e.onepass;if(!o)return null;let B=new Int32Array(i).fill(-1),a=!1,l=t.step(n),c=l>>3,u=l&7,f=Ze.EOF(),d=-1,h=0;l!==Ze.EOF()&&(f=t.step(n+u),f!==Ze.EOF()&&(d=f>>3,h=f&7));let p=n===0?U.emptyOpContext(-1,c):t.context(n),k=o.start,D;for(;;){switch(D=o.inst[k],k=D.out,D.op){case $.MATCH:return s===N.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,B.length>0&&(B[0]=0,B[1]=n),i===0?[]:U.toArray(B));case $.RUNE:if(!D.matchRune(c))return null;break;case $.RUNE1:if(c!==D.runes[0])return null;break;case $.RUNE_ANY:break;case $.RUNE_ANY_NOT_NL:if(c===10)return null;break;case $.ALT:case $.ALT_MATCH:k=Uu.next(D,c);continue;case $.FAIL:return null;case $.NOP:continue;case $.EMPTY_WIDTH:if((D.arg&~p)!==0)return null;continue;case $.CAPTURE:D.arg<B.length&&(B[D.arg]=n);continue;default:throw new Wr("bad inst")}if(u===0)break;p=U.emptyOpContext(c,d),n+=u,c=d,u=h,c!==-1&&(f=t.step(n+u),f!==Ze.EOF()?(d=f>>3,h=f&7):(d=-1,h=0))}return a?i===0?[]:U.toArray(B):null}},x=class ie{static Op=Nu(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=ie.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===L.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new ie(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=ie.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=ie.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case ie.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case ie.Op.EMPTY_MATCH:e+="(?:)";break;case ie.Op.STAR:case ie.Op.PLUS:case ie.Op.QUEST:case ie.Op.REPEAT:{let t=this.subs[0];switch(t.op>ie.Op.CAPTURE||t.op===ie.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case ie.Op.STAR:e+="*";break;case ie.Op.PLUS:e+="+";break;case ie.Op.QUEST:e+="?";break;case ie.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}(this.flags&N.NON_GREEDY)!==0&&(e+="?");break}case ie.Op.CONCAT:for(let t of this.subs)t.op===ie.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case ie.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case ie.Op.LITERAL:(this.flags&N.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=U.escapeRune(t);(this.flags&N.FOLD_CASE)!==0&&(e+=")");break;case ie.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case ie.Op.ANY_CHAR:e+="(?s:.)";break;case ie.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case ie.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case ie.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==ie.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case ie.Op.BEGIN_TEXT:e+="\\A";break;case ie.Op.END_TEXT:(this.flags&N.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case ie.Op.BEGIN_LINE:e+="^";break;case ie.Op.END_LINE:e+="$";break;case ie.Op.WORD_BOUNDARY:e+="\\b";break;case ie.Op.NO_WORD_BOUNDARY:e+="\\B";break;case ie.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===j.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){let n=this.runes[t]+1,s=this.runes[t+1]-1;e+=ie.quoteIfHyphen(n),e+=U.escapeRune(n),n!==s&&(e+="-",e+=ie.quoteIfHyphen(s),e+=U.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=ie.quoteIfHyphen(n),e+=U.escapeRune(n),n!==s&&(e+="-",e+=ie.quoteIfHyphen(s),e+=U.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===ie.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){let n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(e!==null&&e instanceof ie)||this.op!==e.op)return!1;switch(this.op){case ie.Op.END_TEXT:if((this.flags&N.WAS_DOLLAR)!==(e.flags&N.WAS_DOLLAR))return!1;break;case ie.Op.LITERAL:case ie.Op.CHAR_CLASS:if((this.flags&N.FOLD_CASE)!==(e.flags&N.FOLD_CASE))return!1;if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case ie.Op.ALTERNATE:case ie.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case ie.Op.STAR:case ie.Op.PLUS:case ie.Op.QUEST:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.REPEAT:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.PLB:case ie.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},Go=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let i=e.enter(n);if(i.result===void 0){t.push({re:n,state:i,i:0}),n=n.subs[0];continue}s=i.result}for(;;){if(t.length===0)return s;let i=t[t.length-1];if(e.child(i.re,i.state,s,i.i),i.i++,i.state.result===void 0&&i.i<i.re.subs.length){n=i.re.subs[i.i];break}t.pop(),s=i.state.result!==void 0?i.state.result:e.leave(i.re,i.state)}}}},fu=class{constructor(r,e){let t=new Map,n=[0],s=[0],i=[0],o=[0];for(let h of r){let p=0;for(let k=0;k<h.length;k++){let D=p*e+h[k],m=t.get(D);m===void 0&&(m=n.length,t.set(D,m),n.push(p),s.push(h[k]),i.push(i[p]+1),o.push(0)),p=m}o[p]=1}let B=n.length,a=new Int32Array(B-1);for(let h=1;h<B;h++)a[h-1]=h;a.sort((h,p)=>n[h]-n[p]||s[h]-s[p]);let l=new Int32Array(B+1);for(let h=1;h<B;h++)l[n[h]+1]++;for(let h=0;h<B;h++)l[h+1]+=l[h];let c=new Int32Array(B-1);for(let h=0;h<a.length;h++)c[h]=s[a[h]];this.childStart=l,this.childUnit=c,this.childNode=a;let u=new Int32Array(B);for(let h=0;h<B;h++)u[h]=h;u.sort((h,p)=>i[h]-i[p]);let f=new Int32Array(B),d=Uint8Array.from(o);for(let h=1;h<B;h++){let p=u[h],k=n[p];if(k!==0){let D=f[k],m=this.next(D,s[p]);for(;m<0&&D!==0;)D=f[D],m=this.next(D,s[p]);f[p]=m>=0?m:0}d[p]|=d[f[p]]}this.fail=f,this.match=d}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let i=t+n>>1,o=s[i];if(o===e)return this.childNode[i];o<e?t=i+1:n=i}return-1}advance(r,e){for(;;){let t=this.next(r,e);if(t>=0)return t;if(r===0)return 0;r=this.fail[r]}}searchUTF16(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r.charCodeAt(s)),this.match[n]===1)return!0;return!1}searchUTF8(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r[s]),this.match[n]===1)return!0;return!1}},ae=class cr{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===cr.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(this.ac16===null){let e=this.subs.map(t=>{let n=new Array(t.str.length);for(let s=0;s<t.str.length;s++)n[s]=t.str.charCodeAt(s);return n});this.ac16=new fu(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new fu(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case cr.Type.NONE:return!0;case cr.Type.EXACT:return e.hasString(this,t);case cr.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case cr.Type.OR:if(this.allExact)return e.hasAnyString(this,t);for(let n=0;n<this.subs.length;n++)if(this.subs[n].eval(e,t))return!0;return!1;default:return!0}}},op=class fr{static build(e){return e?Go.walk(e,fr.WALKER):new ae(ae.Type.NONE)}static WALKER={leaf:e=>fr.leaf(e),enter:e=>fr.enter(e),child:(e,t,n)=>fr.child(e,t,n),leave:(e,t)=>fr.leave(e,t)};static leaf(e){if(e.op!==x.Op.LITERAL)return new ae(ae.Type.NONE);if(e.runes.length===0||(e.flags&N.FOLD_CASE)!==0)return new ae(ae.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(j.isUnsearchable(e.runes[s]))return new ae(ae.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new ae(ae.Type.EXACT);return n.str=t,n.bytes=U.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case x.Op.CAPTURE:case x.Op.PLUS:return{sub:null};case x.Op.REPEAT:return e.min>=1?{sub:null}:{result:new ae(ae.Type.NONE)};case x.Op.CONCAT:return{pf:new ae(ae.Type.AND),subs:[]};case x.Op.ALTERNATE:return{pf:new ae(ae.Type.OR),subs:[]};default:return{result:new ae(ae.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===ae.Type.AND){if(n.type===ae.Type.NONE)return;if(n.type===ae.Type.AND){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n);return}if(n.type===ae.Type.NONE){t.result=new ae(ae.Type.NONE);return}if(n.type===ae.Type.OR){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n)}static leave(e,t){if(t.subs===void 0)return t.sub;let n=t.pf,s=new Set,i=[];for(let l of t.subs){if(l.type===ae.Type.EXACT){if(s.has(l.str))continue;s.add(l.str)}i.push(l)}if(n.type===ae.Type.AND){let l=[],c=0;for(let u of i)c+u.cost>ae.MAX_SCANS||(l.push(u),c+=u.cost);return l.length===0?new ae(ae.Type.NONE):l.length===1?l[0]:(n.subs=l,n.cost=c,n)}if(i.length===0)return new ae(ae.Type.NONE);if(i.length===1)return i[0];n.subs=i;let o=!0,B=0,a=0;for(let l of i)l.type!==ae.Type.EXACT?o=!1:a+=l.bytes.length,B+=l.cost;return o?a>ae.MAX_AC_UNITS?new ae(ae.Type.NONE):(n.allExact=!0,n.cost=1,n):B>ae.MAX_SCANS?new ae(ae.Type.NONE):(n.cost=B,n)}},bt=class{constructor(r=0,e=0){this.head=r,this.tail=e}},Bp=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(r){return this.inst[r]}numInst(){return this.inst.length}addInst(r){this.inst.push(new $(r))}markLookbehindInsts(){let r=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){let t=e.pop();if(t===0||r[t]===1)continue;r[t]=1;let n=this.inst[t];switch(n.op){case $.ALT:case $.ALT_MATCH:e.push(n.out,n.arg);break;case $.MATCH:case $.FAIL:break;default:e.push(n.out)}}this.lbInst=r}skipNop(r){let e=this.inst[r];for(;e.op===$.NOP||e.op===$.CAPTURE;)e=this.inst[r],r=e.out;return e}prefix(){let r="",e=this.skipNop(this.start);if(!$.isRuneOp(e.op)||e.runes.length!==1)return[e.op===$.MATCH,r];for(;$.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&N.FOLD_CASE)===0&&!j.isUnsearchable(e.runes[0]);)r+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===$.MATCH,r]}startCond(){let r=0,e=this.start;e:for(;;){let t=this.inst[e];switch(t.op){case $.EMPTY_WIDTH:r|=t.arg;break;case $.FAIL:return-1;case $.CAPTURE:case $.NOP:break;default:break e}e=t.out}return r}patch(r,e){let t=r.head;for(;t!==0;){let n=this.inst[t>>1];(t&1)===0?(t=n.out,n.out=e):(t=n.arg,n.arg=e)}}append(r,e){if(r.head===0)return e;if(e.head===0)return r;let t=this.inst[r.tail>>1];return(r.tail&1)===0?t.out=e.head:t.arg=e.head,new bt(r.head,e.tail)}toString(){let r="";for(let e=0;e<this.inst.length;e++){let t=r.length;r+=e,e===this.start&&(r+="*"),r+=" ".substring(r.length-t),r+=this.inst[e],r+=`
58
+ `}function on(r){let e=[],t=s=>`\0${e.push(s)-1}\0`,n=r.replace(/\u0000/g,"");for(n=n.replace(/(`+)([\s\S]*?[^`])\1(?!`)/g,(s,i,o)=>t(`<code>${re(o.replace(/^ (.*) $/,"$1"))}</code>`)),n=n.replace(/\\([!-/:-@[-`{-~])/g,(s,i)=>t(re(i))),n=re(n),n=n.replace(/!?\[([^\]]*)\]\(([^)\s]*)(?:\s+&quot;[^)]*?&quot;)?\)/g,(s,i,o)=>{let B=nu(o.replace(/&amp;/g,"&")),a=tu(i)||o;return t(B===void 0?a:`<a href="${re(B)}">${a}</a>`)}),n=n.replace(/&lt;((?:https?:\/\/|mailto:)[^\s&]+(?:&amp;[^\s&]+)*)&gt;/g,(s,i)=>t(`<a href="${i}">${i}</a>`)),n=tu(n);/\u0000\d+\u0000/.test(n);)n=n.replace(/\u0000(\d+)\u0000/g,(s,i)=>e[Number(i)]);return n}function tu(r){return r.replace(/\*\*(?=\S)([\s\S]*?\S)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w])__(?=\S)([\s\S]*?\S)__(?!\w)/g,"$1<strong>$2</strong>").replace(/\*(?=[^\s*])([\s\S]*?[^\s*])\*/g,"<em>$1</em>").replace(/(^|[^\w])_(?=[^\s_])([\s\S]*?[^\s_])_(?!\w)/g,"$1<em>$2</em>").replace(/~~(?=\S)([\s\S]*?\S)~~/g,"<del>$1</del>")}var N=class $n{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=$n.CLASS_NL|$n.DOT_NL;static PERL=$n.CLASS_NL|$n.ONE_LINE|$n.PERL_X|$n.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2},At={CASE_INSENSITIVE:1,DOTALL:2,MULTILINE:4,DISABLE_UNICODE_GROUPS:8,LONGEST_MATCH:16,LOOKBEHINDS:512},Vr=128,$o=new Int32Array(Vr),To=new Int32Array(Vr),ei=65535;for(let r=0;r<Vr;r++)r>=97&&r<=122?$o[r]=r-32:$o[r]=r,r>=65&&r<=90?To[r]=r+32:To[r]=r;var L=class{static CODES=new Map([["\x07",7],["\b",8],[" ",9],[`
59
+ `,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(r){if(r<Vr)return $o[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>ei?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>ei?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<Vr)return To[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>ei?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>ei?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},C=class{constructor(r,e=!1){this.data=r,this.isStride1=e,this.SIZE=e?2:3}getLo(r){return this.data[r*this.SIZE]}getHi(r){return this.data[r*this.SIZE+1]}getStride(r){return this.isStride1?1:this.data[r*this.SIZE+2]}get length(){return this.data.length/this.SIZE}},Tu=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)Tu[e.charCodeAt(r)]=r;var Iu=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let i=Tu[r.charCodeAt(s)];t|=(i&31)<<n,(i&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Iu(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),i=0,o=0;for(let B=0;B<n;B++)i+=t[o++],s[B*3]=i,i+=t[o++],s[B*3+1]=i,s[B*3+2]=e?1:t[o++];return s},Jd=r=>{let e=Iu(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let i=e[s+1],o=i>>>1^-(i&1);t.set(n,n+o)}return t},ti=class{constructor(r){this.initializer=r,this.cache=new Map}has(r){return r in this.initializer}get(r){if(this.cache.has(r))return this.cache.get(r);let e=this.initializer[r],t=e?e():null;return this.cache.set(r,t),t}},st=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Jd("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB8MBCBBB6MB6MBCBBC+EB0MB2MBCBBB6MB+MBiGBmNBiNBCBBBmKBikzCBmNBqNBkIBsNBCBBBCBBBCBBB0NBCBBB0NDCBBB0NBCBBByNByNBCBBBCBBB2NBCBBDCBBCwDFCBCBDBCBCBDBCBCBDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB9EBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBCBDBCBBBhGBvDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBjICCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBH2iVBCBBBlKBwiVB+jVB+jVBCBBBlMBqEBuEBCBBBCBBBCBBBCBBBCBBB+hVB4hVB8hVBjNB7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_Hieroglyphs:()=>new C(g("ggxCmS",!0)),Arabic:()=>new C(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new C(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new C(g("g4iC1BEG",!0)),Balinese:()=>new C(g("g4GsCCxB",!0)),Bamum:()=>new C(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new C(g("w26CdDF",!0)),Batak:()=>new C(g("g+GzBJD",!0)),Bengali:()=>new C(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new C(g("g17CYDY",!0)),Bhaiksuki:()=>new C(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new C(g("qXB6wLqBxDf",!0)),Brahmi:()=>new C(g("ggkCtCFjBKA",!0)),Braille:()=>new C(g("ggK-H",!0)),Buginese:()=>new C(g("gwGbDB",!0)),Buhid:()=>new C(g("g6FT",!0)),Canadian_Aboriginal:()=>new C(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new C(g("g1gCwB",!0)),Caucasian_Albanian:()=>new C(g("wphCzBMA",!0)),Chakma:()=>new C(g("gokC0BCR",!0)),Cham:()=>new C(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new C(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new C(g("w9jCb",!0)),Common:()=>new C(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new C(g("ifNxkKzDGG",!0)),Cuneiform:()=>new C(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new C(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new C(g("w8rCiD",!0)),Cyrillic:()=>new C(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new C(g("gghCvC",!0)),Devanagari:()=>new C(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new C(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new C(g("ggmC7B",!0)),Duployan:()=>new C(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new C(g("ggsC1iBL68D",!0)),Elbasan:()=>new C(g("gohCnB",!0)),Elymaic:()=>new C(g("g-jCW",!0)),Ethiopic:()=>new C(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new C(g("gqjClBEcJB",!0)),Georgian:()=>new C(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new C(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new C(g("w5gCa",!0)),Grantha:()=>new C(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new C(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new C(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new C(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new C(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new C(g("go4C5B",!0)),Han:()=>new C(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new C(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new C(g("gojCnBJJ",!0)),Hanunoo:()=>new C(g("g5FU",!0)),Hatran:()=>new C(g("gniCSCBGE",!0)),Hebrew:()=>new C(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new C(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new C(g("giiCVCI",!0)),Inherited:()=>new C(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new C(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new C(g("g6iCVDH",!0)),Javanese:()=>new C(g("gsqBtCDJFB",!0)),Kaithi:()=>new C(g("gkkCiCLA",!0)),Kannada:()=>new C(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new C(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new C(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new C(g("goqBtBCA",!0)),Kharoshthi:()=>new C(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new C(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new C(g("g8F9CDJHJnPf",!0)),Khojki:()=>new C(g("gwkCRCuB",!0)),Khudawadi:()=>new C(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new C(g("gq7C5B",!0)),Lao:()=>new C(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new C(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new C(g("ggH3BEOEC",!0)),Limbu:()=>new C(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new C(g("gwhC2JKVLH",!0)),Linear_B:()=>new C(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new C(g("wmpBvBx1eA",!0)),Lycian:()=>new C(g("g0gCc",!0)),Lydian:()=>new C(g("gpiCZGA",!0)),Mahajani:()=>new C(g("wqkCmB",!0)),Makasar:()=>new C(g("g3nCY",!0)),Malayalam:()=>new C(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new C(g("giCbDA",!0)),Manichaean:()=>new C(g("g2iCmBFL",!0)),Marchen:()=>new C(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new C(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new C(g("gy7C6C",!0)),Meetei_Mayek:()=>new C(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new C(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new C(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new C(g("gsiCf",!0)),Miao:()=>new C(g("g47CqCF4BIQ",!0)),Modi:()=>new C(g("gwlCkCMJ",!0)),Mongolian:()=>new C(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new C(g("gy6CeCJFB",!0)),Multani:()=>new C(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new C(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new C(g("gkiCeJI",!0)),Nag_Mundari:()=>new C(g("wm5DpB",!0)),Nandinagari:()=>new C(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new C(g("gsGrBFZHKEB",!0)),Newa:()=>new C(g("gglC7CCE",!0)),Nko:()=>new C(g("g+B6BDC",!0)),Nushu:()=>new C(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new C(g("go4DsBENDJFB",!0)),Ogham:()=>new C(g("g0Fc",!0)),Ol_Chiki:()=>new C(g("wiHvB",!0)),Ol_Onal:()=>new C(g("wu5DqBFA",!0)),Old_Hungarian:()=>new C(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new C(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new C(g("g0iCf",!0)),Old_Permic:()=>new C(g("w6gCqB",!0)),Old_Persian:()=>new C(g("g9gCjBFN",!0)),Old_Sogdian:()=>new C(g("g4jCnB",!0)),Old_South_Arabian:()=>new C(g("gziCf",!0)),Old_Turkic:()=>new C(g("ggjCoC",!0)),Old_Uyghur:()=>new C(g("w7jCZ",!0)),Oriya:()=>new C(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new C(g("wlhCjBFjB",!0)),Osmanya:()=>new C(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new C(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new C(g("gjiCf",!0)),Pau_Cin_Hau:()=>new C(g("g2mC4B",!0)),Phags_Pa:()=>new C(g("giqB3B",!0)),Phoenician:()=>new C(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new C(g("g8iCRIDNG",!0)),Rejang:()=>new C(g("wpqBjBMA",!0)),Runic:()=>new C(g("g1FqCEK",!0)),Samaritan:()=>new C(g("ggCtBDO",!0)),Saurashtra:()=>new C(g("gkqBlCJL",!0)),Sharada:()=>new C(g("gskC-ChsCH",!0)),Shavian:()=>new C(g("wihCvB",!0)),Siddham:()=>new C(g("gslC1BDlB",!0)),Sidetic:()=>new C(g("gqiCZ",!0)),SignWriting:()=>new C(g("gg2DrUQECO",!0)),Sinhala:()=>new C(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new C(g("w5jCpB",!0)),Sora_Sompeng:()=>new C(g("wmkCYIJ",!0)),Soyombo:()=>new C(g("wymCyC",!0)),Sundanese:()=>new C(g("g8G-BhIH",!0)),Sunuwar:()=>new C(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new C(g("ggqBsB",!0)),Syriac:()=>new C(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new C(g("g4FVKA",!0)),Tagbanwa:()=>new C(g("g7FMCCCB",!0)),Tai_Le:()=>new C(g("wqGdDE",!0)),Tai_Tham:()=>new C(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new C(g("g0qBiCZE",!0)),Tai_Yo:()=>new C(g("g25DeCVJB",!0)),Takri:()=>new C(g("g0lC5BHJ",!0)),Tamil:()=>new C(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new C(g("wz6CuCCJ",!0)),Tangut:()=>new C(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new C(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new C(g("g8BxB",!0)),Thai:()=>new C(g("hwD5BGb",!0)),Tibetan:()=>new C(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new C(g("wpL3BIBPA",!0)),Tirhuta:()=>new C(g("gklCnCJJ",!0)),Todhri:()=>new C(g("guhCzB",!0)),Tolong_Siki:()=>new C(g("wtnCrBFJ",!0)),Toto:()=>new C(g("w04De",!0)),Tulu_Tigalari:()=>new C(g("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new C(g("g8gCdCA",!0)),Unknown:()=>new C(g("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBB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bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new C(g("gopBrJ",!0)),Vithkuqi:()=>new C(g("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new C(g("g24D5BGA",!0)),Warang_Citi:()=>new C(g("glmCyCNA",!0)),Yezidi:()=>new C(g("g0jCpBCCDB",!0)),Yi:()=>new C(g("ggoBskBE2B",!0)),Zanabazar_Square:()=>new C(g("gwmCnC",!0))});static FOLD_CATEGORIES=new ti({L:()=>new C(g("laA",!0)),LC:()=>new C(g("laA",!0)),Ll:()=>new C(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBC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CUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHuBPBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new C(g("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new C(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new ti({Common:()=>new C(g("8cgBgB",!1)),Greek:()=>new C(g("1FwUwU",!1)),Inherited:()=>new C(g("5cgBgBlgHAB",!1))})},j=class qe{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===qe.RUNE_ERROR||e>=qe.MIN_HIGH_SURROGATE&&e<=qe.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){let i=n+Math.floor((s-n)/2),o=e.getLo(i),B=e.getHi(i);if(o<=t&&t<=B){let a=e.getStride(i);return(t-o)%a===0}t<o?s=i:n=i+1}return!1}static is(e,t){if(t<=qe.MAX_LATIN1){for(let n=0;n<e.length;n++){if(t>e.getHi(n))continue;let s=e.getLo(n);if(t<s)return!1;let i=e.getStride(n);return(t-s)%i===0}return!1}return e.length>0&&t>=e.getLo(0)&&qe.is32(e,t)}static isUpper(e){if(e<=qe.MAX_LATIN1){let t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return qe.is(st.Upper,e)}static isPrint(e){return e<=qe.MAX_LATIN1?e>=32&&e<qe.MAX_ASCII||e>=161&&e!==173:qe.is(st.Print,e)}static simpleFold(e){if(st.CASE_ORBIT.has(e))return st.CASE_ORBIT.get(e);if(e<=qe.MAX_ASCII){let t=L.toLowerCase(e);return t!==e?t:L.toUpperCase(e)}return e}static equalsIgnoreCase(e,t){if(e===t)return!0;if(e<0||t<0)return!1;if(e<=qe.MAX_ASCII&&t<=qe.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let n=qe.simpleFold(e);n!==e;n=qe.simpleFold(n))if(n===t)return!0;return!1}},No=256,Lu=new Uint8Array(No);for(let r=0;r<No;r++)Lu[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var Ro=null,Oo=null,U=class dt{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||Object.prototype.toString.call(e)==="[object Uint8Array]"}static isalnum(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")||L.CODES.get("a")<=e&&e<=L.CODES.get("z")||L.CODES.get("A")<=e&&e<=L.CODES.get("Z")}static unhex(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")?e-L.CODES.get("0"):L.CODES.get("a")<=e&&e<=L.CODES.get("f")?e-L.CODES.get("a")+10:L.CODES.get("A")<=e&&e<=L.CODES.get("F")?e-L.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(j.isPrint(e))dt.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case L.CODES.get('"'):t+='\\"';break;case L.CODES.get("\\"):t+="\\\\";break;case L.CODES.get(" "):t+="\\t";break;case L.CODES.get(`
60
+ `):t+="\\n";break;case L.CODES.get("\r"):t+="\\r";break;case L.CODES.get("\b"):t+="\\b";break;case L.CODES.get("\f"):t+="\\f";break;default:{let n=e.toString(16);e<256?(t+="\\x",n.length===1&&(t+="0"),t+=n):t+=`\\x{${n}}`;break}}return t}static stringToRunes(e){let t=String(e),n=[],s=0;for(;s<t.length;){let i=t.codePointAt(s);n.push(i),s+=i>j.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<No?Lu[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=dt.EMPTY_BEGIN_TEXT|dt.EMPTY_BEGIN_LINE),e===10&&(n|=dt.EMPTY_BEGIN_LINE),t<0&&(n|=dt.EMPTY_END_TEXT|dt.EMPTY_END_LINE),t===10&&(n|=dt.EMPTY_END_LINE),dt.isWordRune(e)!==dt.isWordRune(t)?n|=dt.EMPTY_WORD_BOUNDARY:n|=dt.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>dt.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>j.MAX_BMP?2:1}static toArray(e){let t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return Ro||(Ro=new TextEncoder),Ro.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===j.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===j.MIN_LOW_SURROGATE?(i=j.MIN_SUPPLEMENTARY_CODE_POINT+((i&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){Oo||(Oo=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return Oo.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let i=e[n++];if(i<128)t[s++]=String.fromCharCode(i);else if(i>191&&i<224){let o=e[n++];t[s++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=e[n++],B=e[n++],a=e[n++],l=((i&7)<<18|(o&63)<<12|(B&63)<<6|a&63)-j.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(j.MIN_HIGH_SURROGATE+(l>>10)),t[s++]=String.fromCharCode(j.MIN_LOW_SURROGATE+(l&1023))}else{let o=e[n++],B=e[n++];t[s++]=String.fromCharCode((i&15)<<12|(o&63)<<6|B&63)}}return t.join("")}}},Nu=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],i=e+n;t[s]=i,t[i]=s}return Object.freeze(t)},Ln=class Io{static Encoding=Nu(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===Io.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===Io.Encoding.UTF_16}},ou=class extends Ln{constructor(r=null){super(),this.bytes=r}getEncoding(){return Ln.Encoding.UTF_8}asCharSequence(){return U.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},jd=class extends Ln{constructor(r=null){super(),this.charSequence=r}getEncoding(){return Ln.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return U.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},In=class{static utf16(r){return new jd(r)}static utf8(r){return U.isByteArray(r)?new ou(r):new ou(U.stringToUtf8ByteArray(r))}},Ze=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},Kd=class lr extends Ze{static RUNE_ERROR_STEP=j.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){let n=e.bytes;if(n.length===0)return!0;let s=this.indexOf(this.bytes,n,this.start+t);return s!==-1&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(e){if(e+=this.start,e>=this.end)return Ze.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,i=128,o=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?i=160:t===237&&(o=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?i=144:t===244&&(o=143);else return lr.RUNE_ERROR_STEP;if(e+n>this.end)return lr.RUNE_ERROR_STEP;let B=this.bytes[e+1]&255;if(B<i||B>o)return lr.RUNE_ERROR_STEP;if(s=s<<6|B&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return lr.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let l=this.bytes[e+3]&255;if((l&192)!==128)return lr.RUNE_ERROR_STEP;s=s<<6|l&63}}return s<<3|n}index(e,t){t+=this.start;let n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){e+=this.start;let t=-1;if(e>this.start&&e<=this.end){let s=e-1;if(t=this.bytes[s--],t>=128){let i=e-4;for(i<this.start&&(i=this.start);s>=i&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let o=this.step(s-this.start);t=s+(o&7)===e?o>>3:j.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return U.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let i=t[0],o=this.end-s,B=typeof e.indexOf=="function",a=n;for(;a<=o;){if(B){if(a=e.indexOf(i,a),a===-1||a>o)return-1}else{for(;a<=o&&e[a]!==i;)a++;if(a>o)return-1}let l=!0;for(let c=1;c<s;c++)if(e[a+c]!==t[c]){l=!1;break}if(l)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},zd=class extends Ze{constructor(r,e=0,t=r.length){super(),this.charSequence=r,this.start=e,this.end=t}hasString(r,e){let t=this.charSequence.indexOf(r.str,this.start+e);return t!==-1&&t<=this.end-r.str.length}hasAnyString(r,e){return r.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(r){if(r+=this.start,r>=this.end)return Ze.EOF();let e=this.charSequence.charCodeAt(r);if(e<j.MIN_HIGH_SURROGATE||e>j.MAX_HIGH_SURROGATE||r+1>=this.end)return e<<3|1;let t=this.charSequence.charCodeAt(r+1);return t>=j.MIN_LOW_SURROGATE&&t<=j.MAX_LOW_SURROGATE?(e-j.MIN_HIGH_SURROGATE)*1024+(t-j.MIN_LOW_SURROGATE)+j.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(r,e){e+=this.start;let t=this.charSequence.indexOf(r.prefix,e);return t<0||t>this.end-r.prefix.length?-1:t-e}context(r){r+=this.start;let e=r>this.start&&r<=this.end?this.charSequence.charCodeAt(r-1):-1,t=r<this.end?this.charSequence.charCodeAt(r):-1;return U.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},we=class{static fromUTF8(r,e=0,t=r.length){return new Kd(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new zd(r,e,t)}},Zr=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},xe=class extends Zr{constructor(r,e=null){let t=`error parsing regexp: ${r}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=r,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},Qr=class extends Zr{constructor(r){super(r),this.name="RE2JSCompileException"}},rt=class extends Zr{constructor(r){super(r),this.name="RE2JSGroupException"}},qd=class extends Zr{constructor(r){super(r),this.name="RE2JSFlagsException"}},Wr=class extends Zr{constructor(r){super(r),this.name="RE2JSInternalException"}},Bu=class Mu{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(n=>{let s=n.codePointAt(0);return s===L.CODES.get("\\")||s===L.CODES.get("$")?`\\${n}`:n}).join(""):e.indexOf("$")<0?e:e.split("").map(n=>n.codePointAt(0)===L.CODES.get("$")?"$$":n).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;let n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof Ln?this.resetMatcherInput(t):U.isByteArray(t)?this.resetMatcherInput(In.utf8(t)):this.resetMatcherInput(In.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof Ln||(U.isByteArray(e)?e=In.utf8(e):e=In.utf16(e)),this.matcherInput=e,this.lookbehindState!==null?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new rt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new rt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){let s=this.namedGroups[e];if(!Number.isFinite(s))throw new rt(`group '${e}' not found`);e=s}let t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new rt("perhaps no match attempted");let e=Object.create(null);for(let t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new rt(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new rt("perhaps no match attempted");if(e===0||this.hasGroups)return;let t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new rt("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,N.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,N.ANCHOR_START)}find(e=null){if(e!==null){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new rt(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){let t=(this.matcherInput.isUTF16Encoding()?we.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):we.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,N.UNANCHORED)}genMatch(e,t){let n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?U.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="",s=this.start(),i=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=i,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,i=0;for(;i<s;){let o=e.codePointAt(i);if(o===L.CODES.get("\\")){if(n<i&&(t+=e.substring(n,i)),i++,i>=s)throw new rt("character to be escaped is missing");n=i,i++;continue}if(o===L.CODES.get("$")){if(n<i&&(t+=e.substring(n,i)),i+1>=s)throw new rt("Illegal group reference: group index is missing");let B=e.codePointAt(i+1);if(L.CODES.get("0")<=B&&B<=L.CODES.get("9")){let a=B-L.CODES.get("0"),l=i+2;for(;l<s;l++){let u=e.codePointAt(l);if(u<L.CODES.get("0")||u>L.CODES.get("9")||a*10+u-L.CODES.get("0")>this.patternGroupCount)break;a=a*10+u-L.CODES.get("0")}if(a>this.patternGroupCount)throw new rt(`n > number of groups: ${a}`);let c=this.group(a);c!==null&&(t+=c),i=l,n=i}else if(B===L.CODES.get("{")){let a=i+2;for(;a<s&&e.codePointAt(a)!==L.CODES.get("}");)a++;if(a>=s)throw new rt("named capture group is missing trailing '}'");let l=e.substring(i+2,a),c=this.group(l);c!==null&&(t+=c),i=a+1,n=i}else throw new rt("Illegal group reference");continue}i++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let i=0;i<s-1;i++)if(e.codePointAt(i)===L.CODES.get("$")){let o=e.codePointAt(i+1);if(L.CODES.get("$")===o){n<i&&(t+=e.substring(n,i)),t+="$",i++,n=i+1;continue}else if(L.CODES.get("&")===o){n<i&&(t+=e.substring(n,i));let B=this.group(0);B!==null?t+=B:t+="$&",i++,n=i+1;continue}else if(L.CODES.get("`")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(0,this.start(0)),i++,n=i+1;continue}else if(L.CODES.get("'")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(this.end(0),this.matcherInputLength),i++,n=i+1;continue}else if(L.CODES.get("1")<=o&&o<=L.CODES.get("9")){let B=o-L.CODES.get("0");for(n<i&&(t+=e.substring(n,i)),i+=2;i<s&&(o=e.codePointAt(i),!(o<L.CODES.get("0")||o>L.CODES.get("9")||B*10+o-L.CODES.get("0")>this.patternGroupCount));i++)B=B*10+o-L.CODES.get("0");if(B>this.patternGroupCount){t+=`$${B}`,n=i,i--;continue}let a=this.group(B);a!==null&&(t+=a),n=i,i--;continue}else if(o===L.CODES.get("<")){n<i&&(t+=e.substring(n,i)),i++;let B=i+1;for(;B<e.length&&e.codePointAt(B)!==L.CODES.get(">")&&e.codePointAt(B)!==L.CODES.get(" ");)B++;if(B===e.length||e.codePointAt(B)!==L.CODES.get(">")){t+=e.substring(i-1,B+1),n=B+1,i=B;continue}let a=e.substring(i+1,B);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let l=this.group(a);l!==null&&(t+=l)}else t+=`$<${a}>`;n=B+1,i=B;continue}}return n<s&&(t+=e.substring(n,s)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,n=!1){let s="";this.reset();let i=typeof e=="function",o=Object.keys(this.namedGroups).length>0,B=null;if(i){if(this.groupCount()>=Mu.MAX_REPLACER_ARGS)throw new rt("Too many capture groups to safely invoke replacer function");B=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=i?this.appendReplacementFunc(e,o,B):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",i=this.start(),o=this.end();this.appendPos<i&&(s+=this.substring(this.appendPos,i)),this.appendPos=o;let B=this.buildReplacerArgs(i,t,n);return s+=String(e(...B)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],i=this.groupCount();for(let o=1;o<=i;o++){let B=this.start(o);B<0?s.push(void 0):s.push(this.substring(B,this.end(o)))}if(s.push(e),s.push(n),t){let o=this.getNamedGroups();for(let B in o)o[B]===null&&(o[B]=void 0);s.push(o)}return s}},F=class Ue{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return Ue.RUNE<=e&&e<=Ue.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=U.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e):e===o}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return!1;if(e<=this.runes[o+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]}matchRunePos(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e)?0:-1:e===o?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return-1;if(e<=this.runes[o+1])return Math.floor(o/2)}return-1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]?i:-1}toString(){switch(this.op){case Ue.ALT:return`alt -> ${this.out}, ${this.arg}`;case Ue.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case Ue.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case Ue.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case Ue.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case Ue.FAIL:return"fail";case Ue.NOP:return`nop -> ${this.out}`;case Ue.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case Ue.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case Ue.RUNE:return this.runes===null?"rune <null>":["rune ",Ue.escapeRunes(this.runes),(this.arg&N.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case Ue.RUNE1:return`rune1 ${Ue.escapeRunes(this.runes)} -> ${this.out}`;case Ue.RUNE_ANY:return`any -> ${this.out}`;case Ue.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},au=class Gu{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;let t=Math.min(this.densePcs.length,Gu.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<t)&&(this.denseCaps=new Int32Array(t))}growCaps(e){let t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){let t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return this.size===0}add(e){let t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)t!==0&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},Yd=class{constructor(r){this.pos=-1,this.pcs=new Int32Array(r.numInst()),this.size=0,this.lbTable=new Int32Array(r.numLb+1)}reset(){this.pos=-1,this.size=0}},Pu=class Hu{static fromRE2(e){let t=new Hu;return t.prog=e.prog,t.re2=e,t.q0=new au(t.prog.numInst()),t.q1=new au(t.prog.numInst()),t.addStack=new Int32Array(2*(t.prog.numInst()+1)),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?U.emptyInts():U.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let i=this.re2.cond;if(i===U.EMPTY_ALL||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let o=this.prog.numLb>0,B=t,a=t,l=!1;o&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,l=!0):a=0);let c=o&&s!==null,u=this.q0,f=this.q1,d=e.step(a),h=d>>3,p=d&7,k=-1,D=0;d!==Ze.EOF()&&(d=e.step(a+p),k=d>>3,D=d&7);let m;for(a===0?m=U.emptyOpContext(-1,h):m=e.context(a),o&&(l?this.restoreLookbehinds(s,u,m):this.spawnLookbehinds(u,a,m));;){if(u.mainThreads===0){if((i&U.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&u.isEmpty()&&this.re2.prefix.length!==0&&k!==this.re2.prefixRune&&e.canCheckPrefix()){let R=e.index(this.re2,a);if(R<0)break;a+=R,d=e.step(a),h=d>>3,p=d&7,d=e.step(a+p),k=d>>3,D=d&7,m=e.context(a)}}a>=B&&(c&&(this.saveLookbehinds(s,u,a),c=!1),!this.matched&&(a===0||n===N.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(u,this.prog.start,a,this.matchcap,0,m)));let b=a+p;if(m=e.context(b),this.step(u,f,a,b,h,m,n,a===e.endPos()),p===0||this.ncap===0&&this.matched)break;a+=p,h=k,p=D,h!==-1&&(d=e.step(a+p),k=d>>3,D=d&7);let w=u;u=f,f=w}return u.clear(),f.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===U.EMPTY_ALL)return[];if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let i=this.prog.numLb>0?0:t,o=t,B=this.q0,a=this.q1,l=e.step(i),c=l>>3,u=l&7,f=-1,d=0;l!==Ze.EOF()&&(l=e.step(i+u),f=l>>3,d=l&7);let h=i===0?U.emptyOpContext(-1,c):e.context(i),p=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(B,i,h);!(B.mainThreads===0&&((s&U.EMPTY_BEGIN_TEXT)!==0&&i!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&i!==0));){(i===0||n===N.UNANCHORED)&&i>=o&&this.add(B,this.prog.start,i,this.matchcap,0,h);let k=i+u;h=e.context(k);for(let m=0;m<B.size;m++){let b=B.densePcs[m],w=this.prog.inst[b],R=m*this.ncap,y=!1;switch(w.op){case F.MATCH:if(n===N.ANCHOR_BOTH&&i!==e.endPos())break;p.add(w.arg);break;case F.RUNE:y=w.matchRune(c);break;case F.RUNE1:y=c===w.runes[0];break;case F.RUNE_ANY:y=!0;break;case F.RUNE_ANY_NOT_NL:y=c!==10;break;default:continue}y&&this.add(a,w.out,k,B.denseCaps,R,h)}if(B.clear(),u===0)break;i+=u,c=f,u=d,c!==-1&&(l=e.step(i+u),f=l>>3,d=l&7);let D=B;B=a,a=D}return a.clear(),Array.from(p).sort((k,D)=>k-D)}step(e,t,n,s,i,o,B,a){let l=this.re2.longest;for(let c=0;c<e.size;c++){let u=e.densePcs[c],f=c*this.ncap;if(l&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[f])continue;let d=this.prog.inst[u],h=!1;switch(d.op){case F.MATCH:if(B===N.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!l||!this.matched||this.matchcap[1]<n)){e.denseCaps[f+1]=n;for(let p=0;p<this.ncap;p++)this.matchcap[p]=e.denseCaps[f+p]}l||(e.size=0),this.matched=!0;break;case F.RUNE:h=d.matchRune(i);break;case F.RUNE1:h=i===d.runes[0];break;case F.RUNE_ANY:h=!0;break;case F.RUNE_ANY_NOT_NL:h=i!==10;break;default:continue}h&&this.add(t,d.out,s,e.denseCaps,f,o)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let i=0;i<t.size;i++){let o=t.densePcs[i];this.prog.lbInst[o]===1&&F.isRuneOp(this.prog.inst[o].op)&&(e.pcs[s++]=o)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,i,o){let B=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let c=e.add(t),u=this.prog.inst[t];switch(u.op){case F.FAIL:t=0;break;case F.ALT:case F.ALT_MATCH:B[a++]=u.arg,B[a++]=0,t=u.out;break;case F.EMPTY_WIDTH:t=(u.arg&~o)===0?u.out:0;break;case F.NOP:t=u.out;break;case F.CAPTURE:u.arg<this.ncap&&(B[a++]=-u.arg-1,B[a++]=s[i+u.arg],s[i+u.arg]=n),t=u.out;break;case F.LB_WRITE:this.lbTable[Math.abs(u.arg)]=n,t=u.out;break;case F.LB_CHECK:u.arg>0?t=this.lbTable[u.arg]===n?u.out:0:t=this.lbTable[-u.arg]!==n?u.out:0;break;case F.MATCH:case F.RUNE:case F.RUNE1:case F.RUNE_ANY:case F.RUNE_ANY_NOT_NL:if(this.prog.lbInst[t]===0&&e.mainThreads++,this.ncap>0){let f=c*this.ncap;f+this.ncap>e.denseCaps.length&&e.growCaps(f+this.ncap);for(let d=0;d<this.ncap;d++)e.denseCaps[f+d]=s[i+d]}t=0;break;default:throw new Wr("unhandled")}}if(a===0)return;a-=2;let l=B[a];l<0?(s[i-l-1]=B[a+1],t=0):t=l}}},Qd=(r,e,t)=>{let n=-2128831035;for(let s=0;s<r.length;s++)n^=r[s],n=Math.imul(n,16777619);n^=e,n=Math.imul(n,16777619);for(let s=0;s<t.length;s++)n^=t[s],n=Math.imul(n,16777619);return n},uu=(r,e)=>{if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0},Ao=[],qr=-1,Wd=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&Mo.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},Mo=class pt{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=160;static TABLE_OVERHEAD=16;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let n=0;n<e.numInst();n++){let s=e.getInst(n).op;if(s===F.LB_WRITE||s===F.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){let e=new Set,t=(s,i)=>{e.add(s),e.add(i+1)};for(let s=0;s<this.prog.numInst();s++){let i=this.prog.getInst(s);switch(i.op){case F.RUNE:case F.RUNE1:if(i.runes.length===1){if(t(i.runes[0],i.runes[0]),(i.arg&N.FOLD_CASE)!==0)for(let o=j.simpleFold(i.runes[0]);o!==i.runes[0];o=j.simpleFold(o))t(o,o)}else for(let o=0;o<i.runes.length;o+=2)t(i.runes[o],i.runes[o+1]);break;case F.RUNE_ANY_NOT_NL:t(10,10);break;case F.EMPTY_WIDTH:(i.arg&(U.EMPTY_BEGIN_LINE|U.EMPTY_END_LINE))!==0&&t(10,10),(i.arg&(U.EMPTY_WORD_BOUNDARY|U.EMPTY_NO_WORD_BOUNDARY))!==0&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;let n=new Int32Array(j.MAX_LATIN1+1);for(let s=0;s<=j.MAX_LATIN1;s++)n[s]=this.searchClass(s);this.latin1Class=n}runeClass(e){return e<=j.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){let t=this.classBounds,n=0,s=t.length;for(;n<s;){let i=n+s>>1;t[i]<=e?n=i+1:s=i}return n}closure(e,t){let n=new Set,s=Array.from(e),i=0;for(;s.length>0;){let o=s.pop();if(o===0||n.has(o))continue;n.add(o);let B=this.prog.getInst(o);switch(B.op){case F.ALT:case F.ALT_MATCH:s.push(B.out),s.push(B.arg);break;case F.NOP:case F.CAPTURE:s.push(B.out);break;case F.EMPTY_WIDTH:i|=B.arg,(B.arg&~t)===0&&s.push(B.out)}}return{pcs:Int32Array.from(n).sort(),needflags:i}}getState(e,t,n){let s=Qd(e,t,n),i=this.stateCache.get(s);if(i)for(let a=0;a<i.length;a++){let l=i[a];if(l.flag===t&&uu(l.nfaStates,e)&&uu(l.matchIDs,n))return l}let o=pt.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<o)return null;this.memBudget-=o,i||(i=[],this.stateCache.set(s,i));let B=new Wd(e,t,n);return i.push(B),this.stateCount++,B}makeState(e,t,n){let s=this.closure(e,t&pt.FLAG_EMPTY_MASK),i=t;return s.needflags===0&&(i&=pt.FLAG_MATCH),i|=s.needflags<<pt.FLAG_NEED_SHIFT,this.getState(s.pcs,i,n)}allocTable(e,t){let n=this.numClasses+1,s=pt.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let i=new Array(n).fill(null);return t===N.UNANCHORED?e.next=i:e.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(e,t,n,s){let i=s===N.UNANCHORED?e.next:e.nextAnchored;if(i!==null){let m=i[t];if(m!==null)return m}else if(i=this.allocTable(e,s),i===null)return null;let o=e.flag>>>pt.FLAG_NEED_SHIFT,B=e.flag&pt.FLAG_EMPTY_MASK,a=B,l=0;n===10&&(a|=U.EMPTY_END_LINE,l|=U.EMPTY_BEGIN_LINE),n===qr&&(a|=U.EMPTY_END_LINE|U.EMPTY_END_TEXT);let c=(e.flag&pt.FLAG_LAST_WORD)!==0,u=n!==qr&&U.isWordRune(n);a|=u===c?U.EMPTY_NO_WORD_BOUNDARY:U.EMPTY_WORD_BOUNDARY;let f=e.nfaStates;(a&~B&o)!==0&&(f=this.closure(f,a).pcs);let d=[],h=!1,p=Ao;for(let m=0;m<f.length;m++){let b=this.prog.getInst(f[m]);b.op===F.MATCH?(h||(h=!0,p=[]),p.push(b.arg)):n!==qr&&F.isRuneOp(b.op)&&b.matchRune(n)&&d.push(b.out)}p.length>1&&p.sort((m,b)=>m-b),s===N.UNANCHORED&&n!==qr&&d.push(this.prog.start);let k=l;h&&(k|=pt.FLAG_MATCH),u&&(k|=pt.FLAG_LAST_WORD);let D=this.makeState(d,k,p);return D===null?null:(i[t]=D,D)}start(e,t){let n=e.context(t),s;if((n&U.EMPTY_BEGIN_TEXT)!==0)s=U.EMPTY_BEGIN_TEXT|U.EMPTY_BEGIN_LINE;else if((n&U.EMPTY_BEGIN_LINE)!==0)s=U.EMPTY_BEGIN_LINE;else{let o=e.step(t),B=o>=0&&U.isWordRune(o>>3);s=(n&U.EMPTY_WORD_BOUNDARY)!==0!==B?pt.FLAG_LAST_WORD:0}let i=this.startStates.get(s);if(i===void 0){if(i=this.makeState([this.prog.start],s,Ao),i===null&&(this.clearCache(),i=this.makeState([this.prog.start],s,Ao),i===null))return null;this.startStates.set(s,i)}return i}stepOrReset(e,t,n,s,i,o){let B=this.step(e,t,n,s);if(B!==null)return B;if(o.resetPos>=0&&i-o.resetPos<pt.PROGRESS_PER_STATE*this.stateCount)return null;o.resetPos=i;let a=this.resetCache(e);return a===null?null:(B=this.step(a,t,n,s),B)}run(e,t,n,s,i){let o=e.endPos(),B=this.latin1Class,a=n===N.UNANCHORED,l={resetPos:-1},c=t;for(;c<o;){let u=e.step(c),f=u>>3,d=u&7;if(d===0)break;let h=f<=j.MAX_LATIN1?B[f]:this.runeClass(f),p=a&&s.next!==null?s.next[h]:null;if(p===null&&(p=this.stepOrReset(s,h,f,n,c,l),p===null))return null;if(s=p,s.isMatch&&i(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;c+=d}return s=this.stepOrReset(s,this.numClasses,qr,n,c,l),s===null?null:s.isMatch&&i(s,!0)}match(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;let s=this.start(e,t);return s===null?null:this.run(e,t,n,s,(i,o)=>n!==N.ANCHOR_BOTH||o)}matchSet(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let s=this.start(e,t);if(s===null)return null;let i=new Set,o=(B,a)=>{if(n!==N.ANCHOR_BOTH||a)for(let l=0;l<B.matchIDs.length;l++)i.add(B.matchIDs[l]);return!1};return this.run(e,t,n,s,o)===null?null:Array.from(i).sort((B,a)=>B-a)}},Vd=32,Zd=500,Fo=256,Xd=262144,ep=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(Fo),this.jobArg=new Uint8Array(Fo),this.jobPos=new Int32Array(Fo),this.jobLen=0,this.visited=new Uint32Array(0)}reset(r,e,t){this.end=e,this.jobLen=0,this.ncap=t;let n=r.numInst()*(e+1)+Vd-1>>>5;this.visited.length<n?this.visited=new Uint32Array(n):this.visited.fill(0,0,n),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(r,e){let t=r*(this.end+1)+e,n=t>>>5,s=1<<(t&31);return(this.visited[n]&s)!==0?!1:(this.visited[n]|=s,!0)}push(r,e,t,n){if(r.prog.getInst(e).op!==F.FAIL&&(n||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){let s=this.jobPc.length*2,i=new Int32Array(s);i.set(this.jobPc),this.jobPc=i;let o=new Uint8Array(s);o.set(this.jobArg),this.jobArg=o;let B=new Int32Array(s);B.set(this.jobPos),this.jobPos=B}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=n?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(r,e,t,n,s){let i=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let o=this.jobPc[this.jobLen],B=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],l=!0;for(;!(!l&&!this.shouldVisit(o,a));){l=!1;let c=r.prog.getInst(o);switch(c.op){case F.FAIL:throw new Wr("unexpected InstFail");case F.ALT:if(B){B=!1,o=c.arg;continue}else{this.push(r,o,a,!0),o=c.out;continue}case F.ALT_MATCH:{let u=r.prog.getInst(c.out);if(F.isRuneOp(u.op)){this.push(r,c.arg,a,!1),o=c.arg,a=this.end;continue}this.push(r,c.out,this.end,!1),o=c.out;continue}case F.RUNE:{let u=e.step(a);if(u===Ze.EOF()||!c.matchRune(u>>3))break;a+=u&7,o=c.out;continue}case F.RUNE1:{let u=e.step(a);if(u===Ze.EOF()||u>>3!==c.runes[0])break;a+=u&7,o=c.out;continue}case F.RUNE_ANY_NOT_NL:{let u=e.step(a);if(u===Ze.EOF()||u>>3===10)break;a+=u&7,o=c.out;continue}case F.RUNE_ANY:{let u=e.step(a);if(u===Ze.EOF())break;a+=u&7,o=c.out;continue}case F.CAPTURE:if(B){this.cap[c.arg]=a;break}else{c.arg<this.ncap&&(this.push(r,o,this.cap[c.arg],!0),this.cap[c.arg]=a),o=c.out;continue}case F.EMPTY_WIDTH:{let u=e.context(a);if((c.arg&~u)!==0)break;o=c.out;continue}case F.NOP:o=c.out;continue;case F.MATCH:{if(s===N.ANCHOR_BOTH&&a!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=a);let u=this.matchcap[1];if((u===-1||i&&a>0&&a>u)&&this.matchcap.set(this.cap),!i||a===this.end)return!0;break}case F.LB_WRITE:case F.LB_CHECK:throw new Wr("Backtracker cannot evaluate Lookbehind instructions");default:throw new Wr("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}},ni=[],ri=class _u{static shouldBacktrack(e){return e.numInst()<=Zd}static maxBitStateLen(e){return _u.shouldBacktrack(e)?Math.floor(Xd/e.numInst()):0}static execute(e,t,n,s,i){let o=e.cond;if(o===U.EMPTY_ALL||(s===N.ANCHOR_START||s===N.ANCHOR_BOTH)&&n!==0||(o&U.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let B=ni.length>0?ni.pop():new ep,a=t.endPos();B.reset(e.prog,a,i);let l=!1;if((o&U.EMPTY_BEGIN_TEXT)!==0||s===N.ANCHOR_START||s===N.ANCHOR_BOTH)B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)&&(l=!0);else{let u=-1;for(;n<=a&&u!==0;n+=u){if(e.prefix.length>0){let d=t.index(e,n);if(d<0)break;n+=d}if(B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)){l=!0;break}let f=t.step(n);u=f===Ze.EOF()?0:f&7}}if(!l)return ni.push(B),null;let c=i===0?[]:U.toArray(B.matchcap.subarray(0,i));return ni.push(B),c}},lu=class{constructor(r){this.sparse=new Uint32Array(r),this.dense=new Uint32Array(r),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(r){return r<this.sparse.length&&this.sparse[r]<this.size&&this.dense[this.sparse[r]]===r}insert(r){this.contains(r)||this.insertNew(r)}insertNew(r){r>=this.sparse.length||(this.sparse[r]=this.size,this.dense[this.size]=r,this.size++)}},tp=(r,e,t,n)=>{let s=r.length,i=e.length,o=0,B=0,a=[],l=[],c=!0,u=-1,f=d=>{let h=d?r:e,p=d?o:B,k=d?t:n;return u>0&&h[p]<=a[u]?!1:(a.push(h[p],h[p+1]),d?o+=2:B+=2,u+=2,l.push(k),!0)};for(;o<s||B<i;)if(B>=i?c=f(!0):o>=s||e[B]<r[o]?c=f(!1):c=f(!0),!c)return null;return{merged:a,next:l}},np=class{constructor(r){this.start=r.start,this.numCap=r.numCap,this.inst=new Array(r.inst.length);for(let e=0;e<r.inst.length;e++){let t=r.inst[e],n=new F(t.op);n.out=t.out,n.arg=t.arg,n.runes=t.runes?new Int32Array(t.runes):new Int32Array(0),n.next=null,this.inst[e]=n}}},rp=r=>{let e=new np(r);for(let t=0;t<e.inst.length;t++){let n=e.inst[t];if(n.op!==F.ALT&&n.op!==F.ALT_MATCH)continue;let s="out",i="arg",o=e.inst[n[i]];if(o.op!==F.ALT&&o.op!==F.ALT_MATCH&&(s="arg",i="out",o=e.inst[n[i]],o.op!==F.ALT&&o.op!==F.ALT_MATCH))continue;let B=e.inst[n[s]];if(B.op===F.ALT||B.op===F.ALT_MATCH)continue;let a="out",l="arg",c=!1;o.out===t?c=!0:o.arg===t&&(c=!0,a="arg",l="out"),c&&(o[a]=n[s]),n[s]===o[a]&&(n[i]=o[l])}return e},sp=r=>{if(r.inst.length>=1e3)return null;let e=new lu(r.inst.length),t=new lu(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),i=o=>{let B=!0,a=r.inst[o];if(t.contains(o))return!0;switch(t.insert(o),a.op){case F.ALT:case F.ALT_MATCH:{B=i(a.out)&&i(a.arg);let l=s[a.out],c=s[a.arg];if(l&&c)return!1;if(c){let h=a.out;a.out=a.arg,a.arg=h;let p=l;l=c,c=p}l&&(s[o]=!0,a.op=F.ALT_MATCH);let u=n[a.out]||[],f=n[a.arg]||[],d=tp(u,f,a.out,a.arg);if(!d)return!1;n[o]=new Int32Array(d.merged),a.next=new Uint32Array(d.next);break}case F.CAPTURE:case F.EMPTY_WIDTH:case F.NOP:B=i(a.out),s[o]=s[a.out],n[o]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out);break;case F.MATCH:case F.FAIL:s[o]=a.op===F.MATCH;break;case F.RUNE:{if(s[o]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[o]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let l=[];if(a.runes.length===1&&(a.arg&N.FOLD_CASE)!==0){let c=a.runes[0];l.push(c,c);for(let u=j.simpleFold(c);u!==c;u=j.simpleFold(u))l.push(u,u);l.sort((u,f)=>u-f)}else for(let c=0;c<a.runes.length;c++)l.push(a.runes[c]);n[o]=new Int32Array(l),a.next=new Uint32Array(Math.floor(l.length/2)+1).fill(a.out),a.op=F.RUNE;break}case F.RUNE1:{if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let l=[];if((a.arg&N.FOLD_CASE)!==0){let c=a.runes[0];l.push(c,c);for(let u=j.simpleFold(c);u!==c;u=j.simpleFold(u))l.push(u,u);l.sort((u,f)=>u-f)}else l.push(a.runes[0],a.runes[0]);n[o]=new Int32Array(l),a.next=new Uint32Array(Math.floor(l.length/2)+1).fill(a.out),a.op=F.RUNE;break}case F.RUNE_ANY:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,j.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case F.RUNE_ANY_NOT_NL:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,9,11,j.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out)}return B};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!i(e.next()))return null;for(let o=0;o<r.inst.length;o++)n[o]&&(r.inst[o].runes=n[o]);return r},ip=(r,e)=>{for(let t=0;t<e.inst.length;t++){let n=e.inst[t];switch(n.op){case F.ALT:case F.ALT_MATCH:case F.RUNE:break;case F.CAPTURE:case F.EMPTY_WIDTH:case F.NOP:case F.MATCH:case F.FAIL:r.inst[t].next=null;break;case F.RUNE1:case F.RUNE_ANY:case F.RUNE_ANY_NOT_NL:r.inst[t].next=null,r.inst[t].op=n.op,r.inst[t].runes=n.runes?new Int32Array(n.runes):new Int32Array(0)}}},cu=class Uu{static compile(e){if(e.start===0||e.numLb>0)return null;let t=e.inst[e.start];if(t.op!==F.EMPTY_WIDTH||(t.arg&U.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let i=0;i<e.inst.length;i++)if(e.inst[i].op===F.ALT||e.inst[i].op===F.ALT_MATCH){n=!0;break}for(let i=0;i<e.inst.length;i++){let o=e.inst[i],B=e.inst[o.out].op;switch(o.op){case F.ALT:case F.ALT_MATCH:if(B===F.MATCH||e.inst[o.arg].op===F.MATCH)return null;break;case F.EMPTY_WIDTH:if(B===F.MATCH){if((o.arg&U.EMPTY_END_TEXT)===U.EMPTY_END_TEXT)continue;return null}break;default:if(B===F.MATCH&&n)return null}}let s=rp(e);return s=sp(s),s!==null&&ip(s,e),s}static next(e,t){let n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===F.ALT_MATCH?e.out:0}static execute(e,t,n,s,i){let o=e.onepass;if(!o)return null;let B=new Int32Array(i).fill(-1),a=!1,l=t.step(n),c=l>>3,u=l&7,f=Ze.EOF(),d=-1,h=0;l!==Ze.EOF()&&(f=t.step(n+u),f!==Ze.EOF()&&(d=f>>3,h=f&7));let p=n===0?U.emptyOpContext(-1,c):t.context(n),k=o.start,D;for(;;){switch(D=o.inst[k],k=D.out,D.op){case F.MATCH:return s===N.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,B.length>0&&(B[0]=0,B[1]=n),i===0?[]:U.toArray(B));case F.RUNE:if(!D.matchRune(c))return null;break;case F.RUNE1:if(c!==D.runes[0])return null;break;case F.RUNE_ANY:break;case F.RUNE_ANY_NOT_NL:if(c===10)return null;break;case F.ALT:case F.ALT_MATCH:k=Uu.next(D,c);continue;case F.FAIL:return null;case F.NOP:continue;case F.EMPTY_WIDTH:if((D.arg&~p)!==0)return null;continue;case F.CAPTURE:D.arg<B.length&&(B[D.arg]=n);continue;default:throw new Wr("bad inst")}if(u===0)break;p=U.emptyOpContext(c,d),n+=u,c=d,u=h,c!==-1&&(f=t.step(n+u),f!==Ze.EOF()?(d=f>>3,h=f&7):(d=-1,h=0))}return a?i===0?[]:U.toArray(B):null}},x=class ie{static Op=Nu(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=ie.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===L.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new ie(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=ie.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=ie.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case ie.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case ie.Op.EMPTY_MATCH:e+="(?:)";break;case ie.Op.STAR:case ie.Op.PLUS:case ie.Op.QUEST:case ie.Op.REPEAT:{let t=this.subs[0];switch(t.op>ie.Op.CAPTURE||t.op===ie.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case ie.Op.STAR:e+="*";break;case ie.Op.PLUS:e+="+";break;case ie.Op.QUEST:e+="?";break;case ie.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}(this.flags&N.NON_GREEDY)!==0&&(e+="?");break}case ie.Op.CONCAT:for(let t of this.subs)t.op===ie.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case ie.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case ie.Op.LITERAL:(this.flags&N.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=U.escapeRune(t);(this.flags&N.FOLD_CASE)!==0&&(e+=")");break;case ie.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case ie.Op.ANY_CHAR:e+="(?s:.)";break;case ie.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case ie.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case ie.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==ie.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case ie.Op.BEGIN_TEXT:e+="\\A";break;case ie.Op.END_TEXT:(this.flags&N.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case ie.Op.BEGIN_LINE:e+="^";break;case ie.Op.END_LINE:e+="$";break;case ie.Op.WORD_BOUNDARY:e+="\\b";break;case ie.Op.NO_WORD_BOUNDARY:e+="\\B";break;case ie.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===j.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){let n=this.runes[t]+1,s=this.runes[t+1]-1;e+=ie.quoteIfHyphen(n),e+=U.escapeRune(n),n!==s&&(e+="-",e+=ie.quoteIfHyphen(s),e+=U.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=ie.quoteIfHyphen(n),e+=U.escapeRune(n),n!==s&&(e+="-",e+=ie.quoteIfHyphen(s),e+=U.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===ie.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){let n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(e!==null&&e instanceof ie)||this.op!==e.op)return!1;switch(this.op){case ie.Op.END_TEXT:if((this.flags&N.WAS_DOLLAR)!==(e.flags&N.WAS_DOLLAR))return!1;break;case ie.Op.LITERAL:case ie.Op.CHAR_CLASS:if((this.flags&N.FOLD_CASE)!==(e.flags&N.FOLD_CASE))return!1;if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case ie.Op.ALTERNATE:case ie.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case ie.Op.STAR:case ie.Op.PLUS:case ie.Op.QUEST:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.REPEAT:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.PLB:case ie.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},Go=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let i=e.enter(n);if(i.result===void 0){t.push({re:n,state:i,i:0}),n=n.subs[0];continue}s=i.result}for(;;){if(t.length===0)return s;let i=t[t.length-1];if(e.child(i.re,i.state,s,i.i),i.i++,i.state.result===void 0&&i.i<i.re.subs.length){n=i.re.subs[i.i];break}t.pop(),s=i.state.result!==void 0?i.state.result:e.leave(i.re,i.state)}}}},fu=class{constructor(r,e){let t=new Map,n=[0],s=[0],i=[0],o=[0];for(let h of r){let p=0;for(let k=0;k<h.length;k++){let D=p*e+h[k],m=t.get(D);m===void 0&&(m=n.length,t.set(D,m),n.push(p),s.push(h[k]),i.push(i[p]+1),o.push(0)),p=m}o[p]=1}let B=n.length,a=new Int32Array(B-1);for(let h=1;h<B;h++)a[h-1]=h;a.sort((h,p)=>n[h]-n[p]||s[h]-s[p]);let l=new Int32Array(B+1);for(let h=1;h<B;h++)l[n[h]+1]++;for(let h=0;h<B;h++)l[h+1]+=l[h];let c=new Int32Array(B-1);for(let h=0;h<a.length;h++)c[h]=s[a[h]];this.childStart=l,this.childUnit=c,this.childNode=a;let u=new Int32Array(B);for(let h=0;h<B;h++)u[h]=h;u.sort((h,p)=>i[h]-i[p]);let f=new Int32Array(B),d=Uint8Array.from(o);for(let h=1;h<B;h++){let p=u[h],k=n[p];if(k!==0){let D=f[k],m=this.next(D,s[p]);for(;m<0&&D!==0;)D=f[D],m=this.next(D,s[p]);f[p]=m>=0?m:0}d[p]|=d[f[p]]}this.fail=f,this.match=d}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let i=t+n>>1,o=s[i];if(o===e)return this.childNode[i];o<e?t=i+1:n=i}return-1}advance(r,e){for(;;){let t=this.next(r,e);if(t>=0)return t;if(r===0)return 0;r=this.fail[r]}}searchUTF16(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r.charCodeAt(s)),this.match[n]===1)return!0;return!1}searchUTF8(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r[s]),this.match[n]===1)return!0;return!1}},ae=class cr{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===cr.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(this.ac16===null){let e=this.subs.map(t=>{let n=new Array(t.str.length);for(let s=0;s<t.str.length;s++)n[s]=t.str.charCodeAt(s);return n});this.ac16=new fu(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new fu(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case cr.Type.NONE:return!0;case cr.Type.EXACT:return e.hasString(this,t);case cr.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case cr.Type.OR:if(this.allExact)return e.hasAnyString(this,t);for(let n=0;n<this.subs.length;n++)if(this.subs[n].eval(e,t))return!0;return!1;default:return!0}}},op=class fr{static build(e){return e?Go.walk(e,fr.WALKER):new ae(ae.Type.NONE)}static WALKER={leaf:e=>fr.leaf(e),enter:e=>fr.enter(e),child:(e,t,n)=>fr.child(e,t,n),leave:(e,t)=>fr.leave(e,t)};static leaf(e){if(e.op!==x.Op.LITERAL)return new ae(ae.Type.NONE);if(e.runes.length===0||(e.flags&N.FOLD_CASE)!==0)return new ae(ae.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(j.isUnsearchable(e.runes[s]))return new ae(ae.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new ae(ae.Type.EXACT);return n.str=t,n.bytes=U.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case x.Op.CAPTURE:case x.Op.PLUS:return{sub:null};case x.Op.REPEAT:return e.min>=1?{sub:null}:{result:new ae(ae.Type.NONE)};case x.Op.CONCAT:return{pf:new ae(ae.Type.AND),subs:[]};case x.Op.ALTERNATE:return{pf:new ae(ae.Type.OR),subs:[]};default:return{result:new ae(ae.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===ae.Type.AND){if(n.type===ae.Type.NONE)return;if(n.type===ae.Type.AND){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n);return}if(n.type===ae.Type.NONE){t.result=new ae(ae.Type.NONE);return}if(n.type===ae.Type.OR){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n)}static leave(e,t){if(t.subs===void 0)return t.sub;let n=t.pf,s=new Set,i=[];for(let l of t.subs){if(l.type===ae.Type.EXACT){if(s.has(l.str))continue;s.add(l.str)}i.push(l)}if(n.type===ae.Type.AND){let l=[],c=0;for(let u of i)c+u.cost>ae.MAX_SCANS||(l.push(u),c+=u.cost);return l.length===0?new ae(ae.Type.NONE):l.length===1?l[0]:(n.subs=l,n.cost=c,n)}if(i.length===0)return new ae(ae.Type.NONE);if(i.length===1)return i[0];n.subs=i;let o=!0,B=0,a=0;for(let l of i)l.type!==ae.Type.EXACT?o=!1:a+=l.bytes.length,B+=l.cost;return o?a>ae.MAX_AC_UNITS?new ae(ae.Type.NONE):(n.allExact=!0,n.cost=1,n):B>ae.MAX_SCANS?new ae(ae.Type.NONE):(n.cost=B,n)}},bt=class{constructor(r=0,e=0){this.head=r,this.tail=e}},Bp=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(r){return this.inst[r]}numInst(){return this.inst.length}addInst(r){this.inst.push(new F(r))}markLookbehindInsts(){let r=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){let t=e.pop();if(t===0||r[t]===1)continue;r[t]=1;let n=this.inst[t];switch(n.op){case F.ALT:case F.ALT_MATCH:e.push(n.out,n.arg);break;case F.MATCH:case F.FAIL:break;default:e.push(n.out)}}this.lbInst=r}skipNop(r){let e=this.inst[r];for(;e.op===F.NOP||e.op===F.CAPTURE;)e=this.inst[r],r=e.out;return e}prefix(){let r="",e=this.skipNop(this.start);if(!F.isRuneOp(e.op)||e.runes.length!==1)return[e.op===F.MATCH,r];for(;F.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&N.FOLD_CASE)===0&&!j.isUnsearchable(e.runes[0]);)r+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===F.MATCH,r]}startCond(){let r=0,e=this.start;e:for(;;){let t=this.inst[e];switch(t.op){case F.EMPTY_WIDTH:r|=t.arg;break;case F.FAIL:return-1;case F.CAPTURE:case F.NOP:break;default:break e}e=t.out}return r}patch(r,e){let t=r.head;for(;t!==0;){let n=this.inst[t>>1];(t&1)===0?(t=n.out,n.out=e):(t=n.arg,n.arg=e)}}append(r,e){if(r.head===0)return e;if(e.head===0)return r;let t=this.inst[r.tail>>1];return(r.tail&1)===0?t.out=e.head:t.arg=e.head,new bt(r.head,e.tail)}toString(){let r="";for(let e=0;e<this.inst.length;e++){let t=r.length;r+=e,e===this.start&&(r+="*"),r+=" ".substring(r.length-t),r+=this.inst[e],r+=`
61
61
  `}return r}},ap=new Int32Array([0,L.CODES.get(`
62
62
  `)-1,L.CODES.get(`
63
- `)+1,j.MAX_RUNE]),du=new Int32Array([0,j.MAX_RUNE]),si=class{constructor(r=0,e=new bt,t=!1){this.i=r,this.out=e,this.nullable=t}},Ju=class Lo{static compileRegexp(e){let t=new Lo,n=t.compile(e);return t.prog.patch(n.out,t.newInst($.MATCH).i),t.prog.start=n.i,t.prog.markLookbehindInsts(),t.prog}static compileSet(e){let t=new Lo;if(e.length===0)return t.prog.start=t.newInst($.FAIL).i,t.prog.markLookbehindInsts(),t.prog;let n=[];for(let i=0;i<e.length;i++){let o=t.compile(e[i]),B=t.newInst($.MATCH);t.prog.getInst(B.i).arg=i,t.prog.patch(o.out,B.i),n.push(o.i)}let s=n[0];for(let i=1;i<n.length;i++){let o=t.newInst($.ALT),B=t.prog.getInst(o.i);B.out=s,B.arg=n[i],s=o.i}return t.prog.start=s,t.prog.markLookbehindInsts(),t.prog}constructor(){this.prog=new Bp,this.newInst($.FAIL),this.runeCache=new Map,this.walker={leaf:e=>this.leaf(e),enter:e=>this.enter(e),child:(e,t,n)=>this.child(e,t,n),leave:(e,t)=>this.leave(e,t)}}newInst(e){return this.prog.addInst(e),new si(this.prog.numInst()-1,new bt,!0)}nop(){let e=this.newInst($.NOP);return e.out=new bt(e.i<<1,e.i<<1),e}fail(){return new si}cap(e){let t=this.newInst($.CAPTURE);return t.out=new bt(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return e.i===0||t.i===0?this.fail():(this.prog.patch(e.out,t.i),new si(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(e.i===0)return t;if(t.i===0)return e;let n=this.newInst($.ALT),s=this.prog.getInst(n.i);return s.out=e.i,s.arg=t.i,n.out=this.prog.append(e.out,t.out),n.nullable=e.nullable||t.nullable,n}loop(e,t){let n=this.newInst($.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new bt(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new bt(n.i<<1|1,n.i<<1|1)),this.prog.patch(e.out,n.i),n}quest(e,t){let n=this.newInst($.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new bt(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new bt(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,e.out),n}star(e,t){return e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return new si(e.i,this.loop(e,t).out,e.nullable)}empty(e){let t=this.newInst($.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new bt(t.i<<1,t.i<<1),t}rune(e,t){let n=this.newInst($.RUNE);n.nullable=!1;let s=this.prog.getInst(n.i);return s.runes=e,t&=N.FOLD_CASE,(e.length!==1||j.simpleFold(e[0])===e[0])&&(t&=~N.FOLD_CASE),s.arg=t,n.out=new bt(n.i<<1,n.i<<1),(t&N.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?s.op=$.RUNE1:e.length===2&&e[0]===0&&e[1]===j.MAX_RUNE?s.op=$.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===L.CODES.get(`
63
+ `)+1,j.MAX_RUNE]),du=new Int32Array([0,j.MAX_RUNE]),si=class{constructor(r=0,e=new bt,t=!1){this.i=r,this.out=e,this.nullable=t}},Ju=class Lo{static compileRegexp(e){let t=new Lo,n=t.compile(e);return t.prog.patch(n.out,t.newInst(F.MATCH).i),t.prog.start=n.i,t.prog.markLookbehindInsts(),t.prog}static compileSet(e){let t=new Lo;if(e.length===0)return t.prog.start=t.newInst(F.FAIL).i,t.prog.markLookbehindInsts(),t.prog;let n=[];for(let i=0;i<e.length;i++){let o=t.compile(e[i]),B=t.newInst(F.MATCH);t.prog.getInst(B.i).arg=i,t.prog.patch(o.out,B.i),n.push(o.i)}let s=n[0];for(let i=1;i<n.length;i++){let o=t.newInst(F.ALT),B=t.prog.getInst(o.i);B.out=s,B.arg=n[i],s=o.i}return t.prog.start=s,t.prog.markLookbehindInsts(),t.prog}constructor(){this.prog=new Bp,this.newInst(F.FAIL),this.runeCache=new Map,this.walker={leaf:e=>this.leaf(e),enter:e=>this.enter(e),child:(e,t,n)=>this.child(e,t,n),leave:(e,t)=>this.leave(e,t)}}newInst(e){return this.prog.addInst(e),new si(this.prog.numInst()-1,new bt,!0)}nop(){let e=this.newInst(F.NOP);return e.out=new bt(e.i<<1,e.i<<1),e}fail(){return new si}cap(e){let t=this.newInst(F.CAPTURE);return t.out=new bt(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return e.i===0||t.i===0?this.fail():(this.prog.patch(e.out,t.i),new si(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(e.i===0)return t;if(t.i===0)return e;let n=this.newInst(F.ALT),s=this.prog.getInst(n.i);return s.out=e.i,s.arg=t.i,n.out=this.prog.append(e.out,t.out),n.nullable=e.nullable||t.nullable,n}loop(e,t){let n=this.newInst(F.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new bt(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new bt(n.i<<1|1,n.i<<1|1)),this.prog.patch(e.out,n.i),n}quest(e,t){let n=this.newInst(F.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new bt(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new bt(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,e.out),n}star(e,t){return e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return new si(e.i,this.loop(e,t).out,e.nullable)}empty(e){let t=this.newInst(F.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new bt(t.i<<1,t.i<<1),t}rune(e,t){let n=this.newInst(F.RUNE);n.nullable=!1;let s=this.prog.getInst(n.i);return s.runes=e,t&=N.FOLD_CASE,(e.length!==1||j.simpleFold(e[0])===e[0])&&(t&=~N.FOLD_CASE),s.arg=t,n.out=new bt(n.i<<1,n.i<<1),(t&N.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?s.op=F.RUNE1:e.length===2&&e[0]===0&&e[1]===j.MAX_RUNE?s.op=F.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===L.CODES.get(`
64
64
  `)-1&&e[2]===L.CODES.get(`
65
- `)+1&&e[3]===j.MAX_RUNE&&(s.op=$.RUNE_ANY_NOT_NL),n}lookBehind(e,t){let n=this.newInst($.LB_WRITE);this.prog.getInst(n.i).arg=t;let s=this.rune(du,0),i=this.star(s,!0),o=this.cat(i,e);this.prog.patch(o.out,n.i);let B=this.newInst($.LB_CHECK);return this.prog.getInst(B.i).arg=t,this.prog.lbStarts.push(o.i),Math.abs(t)>this.prog.numLb&&(this.prog.numLb=Math.abs(t)),B.out=new bt(B.i<<1,B.i<<1),B}compile(e){return Go.walk(e,this.walker)}leaf(e){switch(e.op){case x.Op.NO_MATCH:return this.fail();case x.Op.EMPTY_MATCH:return this.nop();case x.Op.LITERAL:{if(e.runes.length===0)return this.nop();let t=null;for(let n of e.runes){let s=this.runeCache.get(n);s===void 0&&(s=new Int32Array([n]),this.runeCache.set(n,s));let i=this.rune(s,e.flags);t=t===null?i:this.cat(t,i)}return t}case x.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case x.Op.ANY_CHAR_NOT_NL:return this.rune(ap,0);case x.Op.ANY_CHAR:return this.rune(du,0);case x.Op.BEGIN_LINE:return this.empty(U.EMPTY_BEGIN_LINE);case x.Op.END_LINE:return this.empty(U.EMPTY_END_LINE);case x.Op.BEGIN_TEXT:return this.empty(U.EMPTY_BEGIN_TEXT);case x.Op.END_TEXT:return this.empty(U.EMPTY_END_TEXT);case x.Op.WORD_BOUNDARY:return this.empty(U.EMPTY_WORD_BOUNDARY);case x.Op.NO_WORD_BOUNDARY:return this.empty(U.EMPTY_NO_WORD_BOUNDARY);case x.Op.CONCAT:case x.Op.ALTERNATE:return this.nop();default:throw new Qr("regexp: unhandled case in compile")}}enter(e){switch(e.op){case x.Op.PLB:case x.Op.NLB:case x.Op.STAR:case x.Op.PLUS:case x.Op.QUEST:return{sub:null};case x.Op.CAPTURE:return{bra:this.cap(e.cap<<1),sub:null};case x.Op.CONCAT:case x.Op.ALTERNATE:return{f:null};default:throw new Qr("regexp: unhandled case in compile")}}child(e,t,n){e.op===x.Op.CONCAT?t.f=t.f===null?n:this.cat(t.f,n):e.op===x.Op.ALTERNATE?t.f=t.f===null?n:this.alt(t.f,n):t.sub=n}leave(e,t){switch(e.op){case x.Op.PLB:case x.Op.NLB:return this.lookBehind(t.sub,e.lb);case x.Op.CAPTURE:{let n=this.cap(e.cap<<1|1);return this.cat(this.cat(t.bra,t.sub),n)}case x.Op.STAR:return this.star(t.sub,(e.flags&N.NON_GREEDY)!==0);case x.Op.PLUS:return this.plus(t.sub,(e.flags&N.NON_GREEDY)!==0);case x.Op.QUEST:return this.quest(t.sub,(e.flags&N.NON_GREEDY)!==0);case x.Op.CONCAT:case x.Op.ALTERNATE:return t.f;default:throw new Qr("regexp: unhandled case in compile")}}},ju=class qe{static simplify(e){return e===null?null:Go.walk(e,qe.WALKER)}static WALKER={leaf:e=>qe.leaf(e),enter:e=>qe.enter(e),child:(e,t,n,s)=>qe.child(e,t,n,s),leave:(e,t)=>qe.leave(e,t)};static leaf(e){if(e.op===x.Op.CHAR_CLASS){if(e.runes===null)return e;if(e.runes.length===0)return new x(x.Op.NO_MATCH);if(e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE)return new x(x.Op.ANY_CHAR);if(e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
65
+ `)+1&&e[3]===j.MAX_RUNE&&(s.op=F.RUNE_ANY_NOT_NL),n}lookBehind(e,t){let n=this.newInst(F.LB_WRITE);this.prog.getInst(n.i).arg=t;let s=this.rune(du,0),i=this.star(s,!0),o=this.cat(i,e);this.prog.patch(o.out,n.i);let B=this.newInst(F.LB_CHECK);return this.prog.getInst(B.i).arg=t,this.prog.lbStarts.push(o.i),Math.abs(t)>this.prog.numLb&&(this.prog.numLb=Math.abs(t)),B.out=new bt(B.i<<1,B.i<<1),B}compile(e){return Go.walk(e,this.walker)}leaf(e){switch(e.op){case x.Op.NO_MATCH:return this.fail();case x.Op.EMPTY_MATCH:return this.nop();case x.Op.LITERAL:{if(e.runes.length===0)return this.nop();let t=null;for(let n of e.runes){let s=this.runeCache.get(n);s===void 0&&(s=new Int32Array([n]),this.runeCache.set(n,s));let i=this.rune(s,e.flags);t=t===null?i:this.cat(t,i)}return t}case x.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case x.Op.ANY_CHAR_NOT_NL:return this.rune(ap,0);case x.Op.ANY_CHAR:return this.rune(du,0);case x.Op.BEGIN_LINE:return this.empty(U.EMPTY_BEGIN_LINE);case x.Op.END_LINE:return this.empty(U.EMPTY_END_LINE);case x.Op.BEGIN_TEXT:return this.empty(U.EMPTY_BEGIN_TEXT);case x.Op.END_TEXT:return this.empty(U.EMPTY_END_TEXT);case x.Op.WORD_BOUNDARY:return this.empty(U.EMPTY_WORD_BOUNDARY);case x.Op.NO_WORD_BOUNDARY:return this.empty(U.EMPTY_NO_WORD_BOUNDARY);case x.Op.CONCAT:case x.Op.ALTERNATE:return this.nop();default:throw new Qr("regexp: unhandled case in compile")}}enter(e){switch(e.op){case x.Op.PLB:case x.Op.NLB:case x.Op.STAR:case x.Op.PLUS:case x.Op.QUEST:return{sub:null};case x.Op.CAPTURE:return{bra:this.cap(e.cap<<1),sub:null};case x.Op.CONCAT:case x.Op.ALTERNATE:return{f:null};default:throw new Qr("regexp: unhandled case in compile")}}child(e,t,n){e.op===x.Op.CONCAT?t.f=t.f===null?n:this.cat(t.f,n):e.op===x.Op.ALTERNATE?t.f=t.f===null?n:this.alt(t.f,n):t.sub=n}leave(e,t){switch(e.op){case x.Op.PLB:case x.Op.NLB:return this.lookBehind(t.sub,e.lb);case x.Op.CAPTURE:{let n=this.cap(e.cap<<1|1);return this.cat(this.cat(t.bra,t.sub),n)}case x.Op.STAR:return this.star(t.sub,(e.flags&N.NON_GREEDY)!==0);case x.Op.PLUS:return this.plus(t.sub,(e.flags&N.NON_GREEDY)!==0);case x.Op.QUEST:return this.quest(t.sub,(e.flags&N.NON_GREEDY)!==0);case x.Op.CONCAT:case x.Op.ALTERNATE:return t.f;default:throw new Qr("regexp: unhandled case in compile")}}},ju=class Ye{static simplify(e){return e===null?null:Go.walk(e,Ye.WALKER)}static WALKER={leaf:e=>Ye.leaf(e),enter:e=>Ye.enter(e),child:(e,t,n,s)=>Ye.child(e,t,n,s),leave:(e,t)=>Ye.leave(e,t)};static leaf(e){if(e.op===x.Op.CHAR_CLASS){if(e.runes===null)return e;if(e.runes.length===0)return new x(x.Op.NO_MATCH);if(e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE)return new x(x.Op.ANY_CHAR);if(e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
66
66
  `)-1&&e.runes[2]===L.CODES.get(`
67
- `)+1&&e.runes[3]===j.MAX_RUNE)return new x(x.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case x.Op.PLB:case x.Op.NLB:case x.Op.CAPTURE:case x.Op.STAR:case x.Op.PLUS:case x.Op.QUEST:return{sub:null};case x.Op.CONCAT:case x.Op.ALTERNATE:return{subs:[],changed:!1};case x.Op.REPEAT:return e.min===0&&e.max===0?{result:new x(x.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(t.subs===void 0){t.sub=n;return}if(n!==e.subs[s]&&(t.changed=!0),e.op===x.Op.CONCAT){if(n.op===x.Op.NO_MATCH){t.result=new x(x.Op.NO_MATCH);return}if(n.op===x.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===x.Op.CONCAT){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}else{if(n.op===x.Op.NO_MATCH){t.changed=!0;return}if(n.op===x.Op.ALTERNATE){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case x.Op.PLB:case x.Op.NLB:case x.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=x.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case x.Op.CONCAT:case x.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new x(e.op===x.Op.CONCAT?x.Op.EMPTY_MATCH:x.Op.NO_MATCH);if(n.length===1)return n[0];let s=x.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case x.Op.STAR:case x.Op.PLUS:case x.Op.QUEST:return qe.simplify1(e.op,e.flags,t.sub,e);case x.Op.REPEAT:return qe.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return qe.simplify1(x.Op.STAR,e.flags,t,null);if(e.min===1)return qe.simplify1(x.Op.PLUS,e.flags,t,null);let s=[];for(let i=0;i<e.min-1;i++)s.push(t);return s.push(qe.simplify1(x.Op.PLUS,e.flags,t,null)),qe.concat(s)}if(e.min===1&&e.max===1)return t;let n=null;if(e.min>0){n=[];for(let s=0;s<e.min;s++)n.push(t)}if(e.max>e.min){let s=qe.simplify1(x.Op.QUEST,e.flags,t,null);for(let i=e.min+1;i<e.max;i++)s=qe.simplify1(x.Op.QUEST,e.flags,qe.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?qe.concat(n):new x(x.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let i=e[s];if(i.op===x.Op.NO_MATCH)return new x(x.Op.NO_MATCH);if(i.op!==x.Op.EMPTY_MATCH){if(i.op===x.Op.CONCAT){for(let o=0;o<i.subs.length;o++)t.push(i.subs[o]);continue}t.push(i)}}if(t.length===0)return new x(x.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new x(x.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===x.Op.EMPTY_MATCH)return n;if(n.op===x.Op.NO_MATCH)return e===x.Op.PLUS?n:new x(x.Op.EMPTY_MATCH);if(e===n.op&&(t&N.NON_GREEDY)===(n.flags&N.NON_GREEDY))return n;if(s!==null&&s.op===e&&(s.flags&N.NON_GREEDY)===(t&N.NON_GREEDY)&&n===s.subs[0])return s;let i=new x(e);return i.flags=t,i.subs=[n],i}},pe=class{constructor(r,e){this.sign=r,this.cls=e}},pu=[48,57],hu=[9,10,12,13,32,32],Cu=[48,57,65,90,95,95,97,122],gu=new Map([["\\d",new pe(1,pu)],["\\D",new pe(-1,pu)],["\\s",new pe(1,hu)],["\\S",new pe(-1,hu)],["\\w",new pe(1,Cu)],["\\W",new pe(-1,Cu)]]),mu=[48,57,65,90,97,122],Eu=[65,90,97,122],bu=[0,127],Du=[9,9,32,32],wu=[0,31,127,127],ku=[48,57],xu=[33,126],vu=[97,122],yu=[32,126],Su=[33,47,58,64,91,96,123,126],Ru=[9,13,32,32],Ou=[65,90],Au=[48,57,65,90,95,95,97,122],$u=[48,57,65,70,97,102],Fu=new Map([["[:alnum:]",new pe(1,mu)],["[:^alnum:]",new pe(-1,mu)],["[:alpha:]",new pe(1,Eu)],["[:^alpha:]",new pe(-1,Eu)],["[:ascii:]",new pe(1,bu)],["[:^ascii:]",new pe(-1,bu)],["[:blank:]",new pe(1,Du)],["[:^blank:]",new pe(-1,Du)],["[:cntrl:]",new pe(1,wu)],["[:^cntrl:]",new pe(-1,wu)],["[:digit:]",new pe(1,ku)],["[:^digit:]",new pe(-1,ku)],["[:graph:]",new pe(1,xu)],["[:^graph:]",new pe(-1,xu)],["[:lower:]",new pe(1,vu)],["[:^lower:]",new pe(-1,vu)],["[:print:]",new pe(1,yu)],["[:^print:]",new pe(-1,yu)],["[:punct:]",new pe(1,Su)],["[:^punct:]",new pe(-1,Su)],["[:space:]",new pe(1,Ru)],["[:^space:]",new pe(-1,Ru)],["[:upper:]",new pe(1,Ou)],["[:^upper:]",new pe(-1,Ou)],["[:word:]",new pe(1,Au)],["[:^word:]",new pe(-1,Au)],["[:xdigit:]",new pe(1,$u)],["[:^xdigit:]",new pe(-1,$u)]]),$n=class ii{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let i=e[s],o=e[s+1];i===o?n+=`0x${i.toString(16)}`:n+=`0x${i.toString(16)}-0x${o.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let o=0;o<n;o++)s[o]=o;s.sort((o,B)=>e[2*o]-e[2*B]||e[2*B+1]-e[2*o+1]);let i=e.slice(0,t);for(let o=0;o<n;o++)e[2*o]=i[2*s[o]],e[2*o+1]=i[2*s[o]+1]}constructor(e=U.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;ii.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){let n=this.r[t],s=this.r[t+1];if(n<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=n,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&N.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let n=2;n<=4;n+=2)if(this.len>=n){let s=this.r[this.len-n],i=this.r[this.len-n+1];if(e<=i+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>i&&(this.r[this.len-n+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=j.MIN_FOLD&&t>=j.MAX_FOLD)return this.appendRange(e,t);if(t<j.MIN_FOLD||e>j.MAX_FOLD)return this.appendRange(e,t);e<j.MIN_FOLD&&(this.appendRange(e,j.MIN_FOLD-1),e=j.MIN_FOLD),t>j.MAX_FOLD&&(this.appendRange(j.MAX_FOLD+1,t),t=j.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let s=j.simpleFold(n);s!==n;s=j.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){let s=e[n],i=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=i+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){let n=e.getLo(t),s=e.getHi(t),i=e.getStride(t);if(i===1){this.appendRange(n,s);continue}for(let o=n;o<=s;o+=i)this.appendRange(o,o)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),i=e.getHi(n),o=e.getStride(n);if(o===1){t<=s-1&&this.appendRange(t,s-1),t=i+1;continue}for(let B=s;B<=i;B+=o)t<=B-1&&this.appendRange(t,B-1),t=B+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){let s=this.r[n],i=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=i+1}return this.len=t,e<=j.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=j.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let n=e.cls;return t&&(n=new ii().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return ii.charClassToString(this.r,this.len)}},up=class{constructor(r){this.str=r,this.position=0}pos(){return this.position}rewindTo(r){this.position=r}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(r){this.position+=r}skipString(r){this.position+=r.length}pop(){let r=this.str.codePointAt(this.position);return this.position+=U.charCount(r),r}lookingAt(r){return this.str.startsWith(r,this.position)}rest(){return this.str.substring(this.position)}from(r){return this.str.substring(r,this.position)}toString(){return this.rest()}},qr=class Z{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new C(new Uint32Array([0,j.MAX_RUNE,1]));static ASCII_TABLE=new C(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new C(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:Z.ANY_TABLE,fold:Z.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Z.ASCII_TABLE,fold:Z.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:st.CATEGORIES.get("Cn"),fold:st.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:st.CATEGORIES.get("LC"),fold:st.FOLD_CATEGORIES.get("LC"),sign:1}:st.CATEGORIES.has(e)?{tab:st.CATEGORIES.get(e),fold:st.FOLD_CATEGORIES.get(e),sign:1}:st.SCRIPTS.has(e)?{tab:st.SCRIPTS.get(e),fold:st.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<j.MIN_FOLD||e>j.MAX_FOLD)return e;let t=e,n=e;for(e=j.simpleFold(e);e!==n;e=j.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===x.Op.EMPTY_MATCH)return null;if(e.op===x.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===x.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new x(x.Op.LITERAL);return n.flags=t,n.runes=U.stringToRunes(e),n}static parse(e,t){return new Z(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=Z.parseInt(e);if(n===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=n;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=Z.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),n<0||n>1e3||s===-2||s>1e3||s>=0&&n>s)throw new xe(Z.ERR_INVALID_REPEAT_SIZE,e.from(t));return n<<16|s&j.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n!==L.CODES.get("_")&&!U.isalnum(n))return!1}return!0}static parseInt(e){let t=e.pos();for(;e.more()&&e.peek()>=L.CODES.get("0")&&e.peek()<=L.CODES.get("9");)e.skip(1);let n=e.from(t);return n.length===0||n.length>1&&n.codePointAt(0)===L.CODES.get("0")?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===x.Op.LITERAL&&e.runes.length===1||e.op===x.Op.CHAR_CLASS||e.op===x.Op.ANY_CHAR_NOT_NL||e.op===x.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case x.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case x.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case x.Op.ANY_CHAR_NOT_NL:return t!==L.CODES.get(`
67
+ `)+1&&e.runes[3]===j.MAX_RUNE)return new x(x.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case x.Op.PLB:case x.Op.NLB:case x.Op.CAPTURE:case x.Op.STAR:case x.Op.PLUS:case x.Op.QUEST:return{sub:null};case x.Op.CONCAT:case x.Op.ALTERNATE:return{subs:[],changed:!1};case x.Op.REPEAT:return e.min===0&&e.max===0?{result:new x(x.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(t.subs===void 0){t.sub=n;return}if(n!==e.subs[s]&&(t.changed=!0),e.op===x.Op.CONCAT){if(n.op===x.Op.NO_MATCH){t.result=new x(x.Op.NO_MATCH);return}if(n.op===x.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===x.Op.CONCAT){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}else{if(n.op===x.Op.NO_MATCH){t.changed=!0;return}if(n.op===x.Op.ALTERNATE){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case x.Op.PLB:case x.Op.NLB:case x.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=x.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case x.Op.CONCAT:case x.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new x(e.op===x.Op.CONCAT?x.Op.EMPTY_MATCH:x.Op.NO_MATCH);if(n.length===1)return n[0];let s=x.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case x.Op.STAR:case x.Op.PLUS:case x.Op.QUEST:return Ye.simplify1(e.op,e.flags,t.sub,e);case x.Op.REPEAT:return Ye.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return Ye.simplify1(x.Op.STAR,e.flags,t,null);if(e.min===1)return Ye.simplify1(x.Op.PLUS,e.flags,t,null);let s=[];for(let i=0;i<e.min-1;i++)s.push(t);return s.push(Ye.simplify1(x.Op.PLUS,e.flags,t,null)),Ye.concat(s)}if(e.min===1&&e.max===1)return t;let n=null;if(e.min>0){n=[];for(let s=0;s<e.min;s++)n.push(t)}if(e.max>e.min){let s=Ye.simplify1(x.Op.QUEST,e.flags,t,null);for(let i=e.min+1;i<e.max;i++)s=Ye.simplify1(x.Op.QUEST,e.flags,Ye.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?Ye.concat(n):new x(x.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let i=e[s];if(i.op===x.Op.NO_MATCH)return new x(x.Op.NO_MATCH);if(i.op!==x.Op.EMPTY_MATCH){if(i.op===x.Op.CONCAT){for(let o=0;o<i.subs.length;o++)t.push(i.subs[o]);continue}t.push(i)}}if(t.length===0)return new x(x.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new x(x.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===x.Op.EMPTY_MATCH)return n;if(n.op===x.Op.NO_MATCH)return e===x.Op.PLUS?n:new x(x.Op.EMPTY_MATCH);if(e===n.op&&(t&N.NON_GREEDY)===(n.flags&N.NON_GREEDY))return n;if(s!==null&&s.op===e&&(s.flags&N.NON_GREEDY)===(t&N.NON_GREEDY)&&n===s.subs[0])return s;let i=new x(e);return i.flags=t,i.subs=[n],i}},pe=class{constructor(r,e){this.sign=r,this.cls=e}},pu=[48,57],hu=[9,10,12,13,32,32],Cu=[48,57,65,90,95,95,97,122],gu=new Map([["\\d",new pe(1,pu)],["\\D",new pe(-1,pu)],["\\s",new pe(1,hu)],["\\S",new pe(-1,hu)],["\\w",new pe(1,Cu)],["\\W",new pe(-1,Cu)]]),mu=[48,57,65,90,97,122],Eu=[65,90,97,122],bu=[0,127],Du=[9,9,32,32],wu=[0,31,127,127],ku=[48,57],xu=[33,126],vu=[97,122],yu=[32,126],Su=[33,47,58,64,91,96,123,126],Ru=[9,13,32,32],Ou=[65,90],Au=[48,57,65,90,95,95,97,122],Fu=[48,57,65,70,97,102],$u=new Map([["[:alnum:]",new pe(1,mu)],["[:^alnum:]",new pe(-1,mu)],["[:alpha:]",new pe(1,Eu)],["[:^alpha:]",new pe(-1,Eu)],["[:ascii:]",new pe(1,bu)],["[:^ascii:]",new pe(-1,bu)],["[:blank:]",new pe(1,Du)],["[:^blank:]",new pe(-1,Du)],["[:cntrl:]",new pe(1,wu)],["[:^cntrl:]",new pe(-1,wu)],["[:digit:]",new pe(1,ku)],["[:^digit:]",new pe(-1,ku)],["[:graph:]",new pe(1,xu)],["[:^graph:]",new pe(-1,xu)],["[:lower:]",new pe(1,vu)],["[:^lower:]",new pe(-1,vu)],["[:print:]",new pe(1,yu)],["[:^print:]",new pe(-1,yu)],["[:punct:]",new pe(1,Su)],["[:^punct:]",new pe(-1,Su)],["[:space:]",new pe(1,Ru)],["[:^space:]",new pe(-1,Ru)],["[:upper:]",new pe(1,Ou)],["[:^upper:]",new pe(-1,Ou)],["[:word:]",new pe(1,Au)],["[:^word:]",new pe(-1,Au)],["[:xdigit:]",new pe(1,Fu)],["[:^xdigit:]",new pe(-1,Fu)]]),Fn=class ii{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let i=e[s],o=e[s+1];i===o?n+=`0x${i.toString(16)}`:n+=`0x${i.toString(16)}-0x${o.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let o=0;o<n;o++)s[o]=o;s.sort((o,B)=>e[2*o]-e[2*B]||e[2*B+1]-e[2*o+1]);let i=e.slice(0,t);for(let o=0;o<n;o++)e[2*o]=i[2*s[o]],e[2*o+1]=i[2*s[o]+1]}constructor(e=U.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;ii.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){let n=this.r[t],s=this.r[t+1];if(n<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=n,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&N.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let n=2;n<=4;n+=2)if(this.len>=n){let s=this.r[this.len-n],i=this.r[this.len-n+1];if(e<=i+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>i&&(this.r[this.len-n+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=j.MIN_FOLD&&t>=j.MAX_FOLD)return this.appendRange(e,t);if(t<j.MIN_FOLD||e>j.MAX_FOLD)return this.appendRange(e,t);e<j.MIN_FOLD&&(this.appendRange(e,j.MIN_FOLD-1),e=j.MIN_FOLD),t>j.MAX_FOLD&&(this.appendRange(j.MAX_FOLD+1,t),t=j.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let s=j.simpleFold(n);s!==n;s=j.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){let s=e[n],i=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=i+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){let n=e.getLo(t),s=e.getHi(t),i=e.getStride(t);if(i===1){this.appendRange(n,s);continue}for(let o=n;o<=s;o+=i)this.appendRange(o,o)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),i=e.getHi(n),o=e.getStride(n);if(o===1){t<=s-1&&this.appendRange(t,s-1),t=i+1;continue}for(let B=s;B<=i;B+=o)t<=B-1&&this.appendRange(t,B-1),t=B+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){let s=this.r[n],i=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=i+1}return this.len=t,e<=j.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=j.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let n=e.cls;return t&&(n=new ii().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return ii.charClassToString(this.r,this.len)}},up=class{constructor(r){this.str=r,this.position=0}pos(){return this.position}rewindTo(r){this.position=r}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(r){this.position+=r}skipString(r){this.position+=r.length}pop(){let r=this.str.codePointAt(this.position);return this.position+=U.charCount(r),r}lookingAt(r){return this.str.startsWith(r,this.position)}rest(){return this.str.substring(this.position)}from(r){return this.str.substring(r,this.position)}toString(){return this.rest()}},Yr=class Z{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new C(new Uint32Array([0,j.MAX_RUNE,1]));static ASCII_TABLE=new C(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new C(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:Z.ANY_TABLE,fold:Z.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Z.ASCII_TABLE,fold:Z.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:st.CATEGORIES.get("Cn"),fold:st.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:st.CATEGORIES.get("LC"),fold:st.FOLD_CATEGORIES.get("LC"),sign:1}:st.CATEGORIES.has(e)?{tab:st.CATEGORIES.get(e),fold:st.FOLD_CATEGORIES.get(e),sign:1}:st.SCRIPTS.has(e)?{tab:st.SCRIPTS.get(e),fold:st.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<j.MIN_FOLD||e>j.MAX_FOLD)return e;let t=e,n=e;for(e=j.simpleFold(e);e!==n;e=j.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===x.Op.EMPTY_MATCH)return null;if(e.op===x.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===x.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new x(x.Op.LITERAL);return n.flags=t,n.runes=U.stringToRunes(e),n}static parse(e,t){return new Z(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=Z.parseInt(e);if(n===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=n;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=Z.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),n<0||n>1e3||s===-2||s>1e3||s>=0&&n>s)throw new xe(Z.ERR_INVALID_REPEAT_SIZE,e.from(t));return n<<16|s&j.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n!==L.CODES.get("_")&&!U.isalnum(n))return!1}return!0}static parseInt(e){let t=e.pos();for(;e.more()&&e.peek()>=L.CODES.get("0")&&e.peek()<=L.CODES.get("9");)e.skip(1);let n=e.from(t);return n.length===0||n.length>1&&n.codePointAt(0)===L.CODES.get("0")?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===x.Op.LITERAL&&e.runes.length===1||e.op===x.Op.CHAR_CLASS||e.op===x.Op.ANY_CHAR_NOT_NL||e.op===x.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case x.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case x.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case x.Op.ANY_CHAR_NOT_NL:return t!==L.CODES.get(`
68
68
  `);case x.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case x.Op.ANY_CHAR:break;case x.Op.ANY_CHAR_NOT_NL:Z.matchRune(t,L.CODES.get(`
69
- `))&&(e.op=x.Op.ANY_CHAR);break;case x.Op.CHAR_CLASS:{let n=new $n(Array.isArray(e.runes)?e.runes:Array.from(e.runes));t.op===x.Op.LITERAL?n.appendLiteral(t.runes[0],t.flags):n.appendClass(t.runes),e.runes=n.toGrowableArray();break}case x.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=x.Op.CHAR_CLASS,e.runes=new $n().appendLiteral(e.runes[0],e.flags).appendLiteral(t.runes[0],t.flags).toGrowableArray()}}static parseEscape(e){let t=e.pos();if(e.skip(1),!e.more())throw new xe(Z.ERR_TRAILING_BACKSLASH);let n=e.pop();e:switch(n){case L.CODES.get("1"):case L.CODES.get("2"):case L.CODES.get("3"):case L.CODES.get("4"):case L.CODES.get("5"):case L.CODES.get("6"):case L.CODES.get("7"):if(!e.more()||e.peek()<L.CODES.get("0")||e.peek()>L.CODES.get("7"))break;case L.CODES.get("0"):{let s=n-L.CODES.get("0");for(let i=1;i<3&&!(!e.more()||e.peek()<L.CODES.get("0")||e.peek()>L.CODES.get("7"));i++)s=s*8+e.peek()-L.CODES.get("0"),e.skip(1);return s}case L.CODES.get("x"):{if(!e.more())break;if(n=e.pop(),n===L.CODES.get("{")){let o=0,B=0;for(;;){if(!e.more())break e;if(n=e.pop(),n===L.CODES.get("}"))break;let a=U.unhex(n);if(a<0||(B=B*16+a,B>j.MAX_RUNE))break e;o++}if(o===0)break e;return B}let s=U.unhex(n);if(!e.more())break;n=e.pop();let i=U.unhex(n);if(s<0||i<0)break;return s*16+i}case L.CODES.get("a"):return L.CODES.get("\x07");case L.CODES.get("f"):return L.CODES.get("\f");case L.CODES.get("n"):return L.CODES.get(`
70
- `);case L.CODES.get("r"):return L.CODES.get("\r");case L.CODES.get("t"):return L.CODES.get(" ");case L.CODES.get("v"):return L.CODES.get("\v");default:if(n<=j.MAX_ASCII&&!U.isalnum(n))return n}throw new xe(Z.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new xe(Z.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?Z.parseEscape(e):e.pop()}static hasCapture(e){if(e===null)return!1;if(e.op===x.Op.CAPTURE)return!0;if(e.subs){for(let t of e.subs)if(Z.hasCapture(t))return!0}return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return t!==null&&t.subs!==null&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new x(e),this.numRegexp+=1),t}reuse(e){this.height!==null&&this.height.has(e)&&this.height.delete(e),e.subs!==null&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(e){if(this.numRunes>Z.MAX_RUNES)throw new xe(Z.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===x.Op.REPEAT){let t=e.max;t===-1&&(t=e.min),t<=0&&(t=1),t>Math.floor(Z.MAX_SIZE/this.repeats)?this.repeats=Z.MAX_SIZE:this.repeats*=t}if(this.numRegexp<Math.floor(Z.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>Z.MAX_SIZE)throw new xe(Z.ERR_LARGE)}calcSize(e,t=!1){if(!t&&this.size!==null&&this.size.has(e))return this.size.get(e);let n=0;switch(e.op){case x.Op.LITERAL:n=e.runes.length;break;case x.Op.PLB:case x.Op.NLB:case x.Op.CAPTURE:case x.Op.STAR:n=2+this.calcSize(e.subs[0]);break;case x.Op.PLUS:case x.Op.QUEST:n=1+this.calcSize(e.subs[0]);break;case x.Op.CONCAT:for(let s of e.subs)n=n+this.calcSize(s);break;case x.Op.ALTERNATE:for(let s of e.subs)n=n+this.calcSize(s);e.subs.length>1&&(n=n+e.subs.length-1);break;case x.Op.REPEAT:{let s=this.calcSize(e.subs[0]);if(e.max===-1){e.min===0?n=2+s:n=1+e.min*s;break}n=e.max*s+(e.max-e.min);break}}return n=Math.max(1,n),this.size===null&&(this.size=new Map),this.size.set(e,n),n}checkHeight(e){if(!(this.numRegexp<Z.MAX_HEIGHT)){if(this.height===null){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>Z.MAX_HEIGHT)throw new xe(Z.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&this.height!==null&&this.height.has(e))return this.height.get(e);let n=1;for(let s of e.subs){let i=this.calcHeight(s);n<1+i&&(n=1+i)}return this.height===null&&(this.height=new Map),this.height.set(e,n),n}pop(){return this.stack.pop()}popToPseudo(){let e=this.stack.length,t=e;for(;t>0&&!x.isPseudoOp(this.stack[t-1].op);)t--;return this.stack.splice(t,e-t)}push(e){if(this.numRunes+=e.runes.length,e.op===x.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&~N.FOLD_CASE))return null;e.op=x.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&~N.FOLD_CASE}else if(e.op===x.Op.CHAR_CLASS&&e.runes.length===4&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&j.simpleFold(e.runes[0])===e.runes[2]&&j.simpleFold(e.runes[2])===e.runes[0]||e.op===x.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]+1===e.runes[1]&&j.simpleFold(e.runes[0])===e.runes[1]&&j.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|N.FOLD_CASE))return null;e.op=x.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|N.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){let n=this.stack.length;if(n<2)return!1;let s=this.stack[n-1],i=this.stack[n-2];if(s.op!==x.Op.LITERAL||i.op!==x.Op.LITERAL||(s.flags&N.FOLD_CASE)!==(i.flags&N.FOLD_CASE))return!1;Array.isArray(i.runes)||(i.runes=Array.from(i.runes));for(let o=0;o<s.runes.length;o++)i.runes.push(s.runes[o]);return e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1)}newLiteral(e,t){let n=this.newRegexp(x.Op.LITERAL);return n.flags=t,(t&N.FOLD_CASE)!==0&&(e=Z.minFoldRune(e)),n.runes=[e],n}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){let t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(e,t,n,s,i,o){let B=this.flags;if((B&N.PERL_X)!==0&&(i.more()&&i.lookingAt("?")&&(i.skip(1),B^=N.NON_GREEDY),o!==-1))throw new xe(Z.ERR_INVALID_REPEAT_OP,i.from(o));let a=this.stack.length;if(a===0)throw new xe(Z.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let l=this.stack[a-1];if(x.isPseudoOp(l.op))throw new xe(Z.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let c=this.newRegexp(e);if(c.min=t,c.max=n,c.flags=B,c.subs=[l],this.stack[a-1]=c,this.checkLimits(c),e===x.Op.REPEAT&&(t>=2||n>=2)&&!this.repeatIsValid(c,1e3))throw new xe(Z.ERR_INVALID_REPEAT_SIZE,i.from(s))}repeatIsValid(e,t){if(e.op===x.Op.REPEAT){let n=e.max;if(n===0)return!0;if(n<0&&(n=e.min),n>t)return!1;n>0&&(t=Math.trunc(t/n))}for(let n of e.subs)if(!this.repeatIsValid(n,t))return!1;return!0}concat(){this.maybeConcat(-1,0);let e=this.popToPseudo();return e.length===0?this.push(this.newRegexp(x.Op.EMPTY_MATCH)):this.push(this.collapse(e,x.Op.CONCAT))}alternate(){let e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(x.Op.NO_MATCH)):this.push(this.collapse(e,x.Op.ALTERNATE))}cleanAlt(e){e.op===x.Op.CHAR_CLASS&&(e.runes=new $n(Array.from(e.runes)).cleanClass().toArray(),e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE?(e.runes=new Int32Array(0),e.op=x.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
69
+ `))&&(e.op=x.Op.ANY_CHAR);break;case x.Op.CHAR_CLASS:{let n=new Fn(Array.isArray(e.runes)?e.runes:Array.from(e.runes));t.op===x.Op.LITERAL?n.appendLiteral(t.runes[0],t.flags):n.appendClass(t.runes),e.runes=n.toGrowableArray();break}case x.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=x.Op.CHAR_CLASS,e.runes=new Fn().appendLiteral(e.runes[0],e.flags).appendLiteral(t.runes[0],t.flags).toGrowableArray()}}static parseEscape(e){let t=e.pos();if(e.skip(1),!e.more())throw new xe(Z.ERR_TRAILING_BACKSLASH);let n=e.pop();e:switch(n){case L.CODES.get("1"):case L.CODES.get("2"):case L.CODES.get("3"):case L.CODES.get("4"):case L.CODES.get("5"):case L.CODES.get("6"):case L.CODES.get("7"):if(!e.more()||e.peek()<L.CODES.get("0")||e.peek()>L.CODES.get("7"))break;case L.CODES.get("0"):{let s=n-L.CODES.get("0");for(let i=1;i<3&&!(!e.more()||e.peek()<L.CODES.get("0")||e.peek()>L.CODES.get("7"));i++)s=s*8+e.peek()-L.CODES.get("0"),e.skip(1);return s}case L.CODES.get("x"):{if(!e.more())break;if(n=e.pop(),n===L.CODES.get("{")){let o=0,B=0;for(;;){if(!e.more())break e;if(n=e.pop(),n===L.CODES.get("}"))break;let a=U.unhex(n);if(a<0||(B=B*16+a,B>j.MAX_RUNE))break e;o++}if(o===0)break e;return B}let s=U.unhex(n);if(!e.more())break;n=e.pop();let i=U.unhex(n);if(s<0||i<0)break;return s*16+i}case L.CODES.get("a"):return L.CODES.get("\x07");case L.CODES.get("f"):return L.CODES.get("\f");case L.CODES.get("n"):return L.CODES.get(`
70
+ `);case L.CODES.get("r"):return L.CODES.get("\r");case L.CODES.get("t"):return L.CODES.get(" ");case L.CODES.get("v"):return L.CODES.get("\v");default:if(n<=j.MAX_ASCII&&!U.isalnum(n))return n}throw new xe(Z.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new xe(Z.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?Z.parseEscape(e):e.pop()}static hasCapture(e){if(e===null)return!1;if(e.op===x.Op.CAPTURE)return!0;if(e.subs){for(let t of e.subs)if(Z.hasCapture(t))return!0}return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return t!==null&&t.subs!==null&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new x(e),this.numRegexp+=1),t}reuse(e){this.height!==null&&this.height.has(e)&&this.height.delete(e),e.subs!==null&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(e){if(this.numRunes>Z.MAX_RUNES)throw new xe(Z.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===x.Op.REPEAT){let t=e.max;t===-1&&(t=e.min),t<=0&&(t=1),t>Math.floor(Z.MAX_SIZE/this.repeats)?this.repeats=Z.MAX_SIZE:this.repeats*=t}if(this.numRegexp<Math.floor(Z.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>Z.MAX_SIZE)throw new xe(Z.ERR_LARGE)}calcSize(e,t=!1){if(!t&&this.size!==null&&this.size.has(e))return this.size.get(e);let n=0;switch(e.op){case x.Op.LITERAL:n=e.runes.length;break;case x.Op.PLB:case x.Op.NLB:case x.Op.CAPTURE:case x.Op.STAR:n=2+this.calcSize(e.subs[0]);break;case x.Op.PLUS:case x.Op.QUEST:n=1+this.calcSize(e.subs[0]);break;case x.Op.CONCAT:for(let s of e.subs)n=n+this.calcSize(s);break;case x.Op.ALTERNATE:for(let s of e.subs)n=n+this.calcSize(s);e.subs.length>1&&(n=n+e.subs.length-1);break;case x.Op.REPEAT:{let s=this.calcSize(e.subs[0]);if(e.max===-1){e.min===0?n=2+s:n=1+e.min*s;break}n=e.max*s+(e.max-e.min);break}}return n=Math.max(1,n),this.size===null&&(this.size=new Map),this.size.set(e,n),n}checkHeight(e){if(!(this.numRegexp<Z.MAX_HEIGHT)){if(this.height===null){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>Z.MAX_HEIGHT)throw new xe(Z.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&this.height!==null&&this.height.has(e))return this.height.get(e);let n=1;for(let s of e.subs){let i=this.calcHeight(s);n<1+i&&(n=1+i)}return this.height===null&&(this.height=new Map),this.height.set(e,n),n}pop(){return this.stack.pop()}popToPseudo(){let e=this.stack.length,t=e;for(;t>0&&!x.isPseudoOp(this.stack[t-1].op);)t--;return this.stack.splice(t,e-t)}push(e){if(this.numRunes+=e.runes.length,e.op===x.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&~N.FOLD_CASE))return null;e.op=x.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&~N.FOLD_CASE}else if(e.op===x.Op.CHAR_CLASS&&e.runes.length===4&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&j.simpleFold(e.runes[0])===e.runes[2]&&j.simpleFold(e.runes[2])===e.runes[0]||e.op===x.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]+1===e.runes[1]&&j.simpleFold(e.runes[0])===e.runes[1]&&j.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|N.FOLD_CASE))return null;e.op=x.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|N.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){let n=this.stack.length;if(n<2)return!1;let s=this.stack[n-1],i=this.stack[n-2];if(s.op!==x.Op.LITERAL||i.op!==x.Op.LITERAL||(s.flags&N.FOLD_CASE)!==(i.flags&N.FOLD_CASE))return!1;Array.isArray(i.runes)||(i.runes=Array.from(i.runes));for(let o=0;o<s.runes.length;o++)i.runes.push(s.runes[o]);return e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1)}newLiteral(e,t){let n=this.newRegexp(x.Op.LITERAL);return n.flags=t,(t&N.FOLD_CASE)!==0&&(e=Z.minFoldRune(e)),n.runes=[e],n}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){let t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(e,t,n,s,i,o){let B=this.flags;if((B&N.PERL_X)!==0&&(i.more()&&i.lookingAt("?")&&(i.skip(1),B^=N.NON_GREEDY),o!==-1))throw new xe(Z.ERR_INVALID_REPEAT_OP,i.from(o));let a=this.stack.length;if(a===0)throw new xe(Z.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let l=this.stack[a-1];if(x.isPseudoOp(l.op))throw new xe(Z.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let c=this.newRegexp(e);if(c.min=t,c.max=n,c.flags=B,c.subs=[l],this.stack[a-1]=c,this.checkLimits(c),e===x.Op.REPEAT&&(t>=2||n>=2)&&!this.repeatIsValid(c,1e3))throw new xe(Z.ERR_INVALID_REPEAT_SIZE,i.from(s))}repeatIsValid(e,t){if(e.op===x.Op.REPEAT){let n=e.max;if(n===0)return!0;if(n<0&&(n=e.min),n>t)return!1;n>0&&(t=Math.trunc(t/n))}for(let n of e.subs)if(!this.repeatIsValid(n,t))return!1;return!0}concat(){this.maybeConcat(-1,0);let e=this.popToPseudo();return e.length===0?this.push(this.newRegexp(x.Op.EMPTY_MATCH)):this.push(this.collapse(e,x.Op.CONCAT))}alternate(){let e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(x.Op.NO_MATCH)):this.push(this.collapse(e,x.Op.ALTERNATE))}cleanAlt(e){e.op===x.Op.CHAR_CLASS&&(e.runes=new Fn(Array.from(e.runes)).cleanClass().toArray(),e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE?(e.runes=new Int32Array(0),e.op=x.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
71
71
  `)-1&&e.runes[2]===L.CODES.get(`
72
- `)+1&&e.runes[3]===j.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=x.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let n=0;for(let B of e)n+=B.op===t?B.subs.length:1;let s=new Array(n).fill(null),i=0;for(let B of e)if(B.op===t){for(let a=0;a<B.subs.length;a++)s[i++]=B.subs[a];this.reuse(B)}else s[i++]=B;let o=this.newRegexp(t);if(o.subs=s,t===x.Op.ALTERNATE&&(o.subs=this.factor(o.subs),o.subs.length===1)){let B=o;o=o.subs[0],this.reuse(B)}return o}factor(e){if(e.length<2)return e;let t=0,n=e.length,s=0,i=null,o=0,B=0,a=0;for(let c=0;c<=n;c++){let u=null,f=0,d=0;if(c<n){let h=e[t+c];if(h.op===x.Op.CONCAT&&h.subs.length>0&&(h=h.subs[0]),h.op===x.Op.LITERAL&&(u=h.runes,f=h.runes.length,d=h.flags&N.FOLD_CASE),d===B){let p=0;for(;p<o&&p<f&&i[p]===u[p];)p++;if(p>0){o=p;continue}}}if(c!==a)if(c===a+1)e[s++]=e[t+a];else{let h=this.newRegexp(x.Op.LITERAL);h.flags=B,h.runes=i.slice(0,o);for(let D=a;D<c;D++)e[t+D]=this.removeLeadingString(e[t+D],o),this.checkLimits(e[t+D]);let p=this.collapse(e.slice(t+a,t+c),x.Op.ALTERNATE),k=this.newRegexp(x.Op.CONCAT);k.subs=[h,p],e[s++]=k}a=c,i=u,o=f,B=d}n=s,t=0,a=0,s=0;let l=null;for(let c=0;c<=n;c++){let u=null;if(!(c<n&&(u=Z.leadingRegexp(e[t+c]),l!==null&&l.equals(u)&&(Z.isCharClass(l)||l.op===x.Op.REPEAT&&l.min===l.max&&Z.isCharClass(l.subs[0]))))){if(c!==a)if(c===a+1)e[s++]=e[t+a];else{let f=l;for(let p=a;p<c;p++){let k=p!==a;e[t+p]=this.removeLeadingRegexp(e[t+p],k),this.checkLimits(e[t+p])}let d=this.collapse(e.slice(t+a,t+c),x.Op.ALTERNATE),h=this.newRegexp(x.Op.CONCAT);h.subs=[f,d],e[s++]=h}a=c,l=u}}n=s,t=0,a=0,s=0;for(let c=0;c<=n;c++)if(!(c<n&&Z.isCharClass(e[t+c]))){if(c!==a)if(c===a+1)e[s++]=e[t+a];else{let u=a;for(let d=a+1;d<c;d++){let h=e[t+u],p=e[t+d];(h.op<p.op||h.op===p.op&&(h.runes!==null?h.runes.length:0)<(p.runes!==null?p.runes.length:0))&&(u=d)}let f=e[t+a];e[t+a]=e[t+u],e[t+u]=f;for(let d=a+1;d<c;d++)Z.mergeCharClass(e[t+a],e[t+d]),this.reuse(e[t+d]);this.cleanAlt(e[t+a]),e[s++]=e[t+a]}c<n&&(e[s++]=e[t+c]),a=c+1}n=s,t=0,a=0,s=0;for(let c=0;c<n;++c)c+1<n&&e[t+c].op===x.Op.EMPTY_MATCH&&e[t+c+1].op===x.Op.EMPTY_MATCH||(e[s++]=e[t+c]);return n=s,t=0,e.slice(t,n)}removeLeadingString(e,t){if(e.op===x.Op.CONCAT&&e.subs.length>0){let n=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=n,n.op===x.Op.EMPTY_MATCH)switch(this.reuse(n),e.subs.length){case 0:case 1:e.op=x.Op.EMPTY_MATCH,e.subs=x.emptySubs();break;case 2:{let s=e;e=e.subs[1],this.reuse(s);break}default:e.subs=e.subs.slice(1,e.subs.length)}return e}return e.op===x.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),e.runes.length===0&&(e.op=x.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===x.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=x.Op.EMPTY_MATCH,e.subs=x.emptySubs();break;case 1:{let n=e;e=e.subs[0],this.reuse(n);break}}return e}return t&&this.reuse(e),this.newRegexp(x.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&N.LITERAL)!==0)return Z.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,n=-1,s=new up(this.wholeRegexp);for(;s.more();){let i=-1;e:switch(s.peek()){case L.CODES.get("("):if((this.flags&N.LOOKBEHIND)!==0){if(s.lookingAt("(?<=")){this.parsePosLookBehind(),s.skip(4);break}if(s.lookingAt("(?<!")){this.parseNegLookBehind(),s.skip(4);break}}if((this.flags&N.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(x.Op.LEFT_PAREN).cap=++this.numCap,s.skip(1);break;case L.CODES.get("|"):this.parseVerticalBar(),s.skip(1);break;case L.CODES.get(")"):this.parseRightParen(),s.skip(1);break;case L.CODES.get("^"):(this.flags&N.ONE_LINE)!==0?this.op(x.Op.BEGIN_TEXT):this.op(x.Op.BEGIN_LINE),s.skip(1);break;case L.CODES.get("$"):(this.flags&N.ONE_LINE)!==0?this.op(x.Op.END_TEXT).flags|=N.WAS_DOLLAR:this.op(x.Op.END_LINE),s.skip(1);break;case L.CODES.get("."):(this.flags&N.DOT_NL)!==0?this.op(x.Op.ANY_CHAR):this.op(x.Op.ANY_CHAR_NOT_NL),s.skip(1);break;case L.CODES.get("["):this.parseClass(s);break;case L.CODES.get("*"):case L.CODES.get("+"):case L.CODES.get("?"):{i=s.pos();let o=null;switch(s.pop()){case L.CODES.get("*"):o=x.Op.STAR;break;case L.CODES.get("+"):o=x.Op.PLUS;break;case L.CODES.get("?"):o=x.Op.QUEST}this.repeat(o,t,n,i,s,e);break}case L.CODES.get("{"):{let o=s.pos(),B=Z.parseRepeat(s);if(B<0){s.rewindTo(o),this.literal(s.pop());break}i=o,t=B>>16,n=(B&j.MAX_BMP)<<16>>16,this.repeat(x.Op.REPEAT,t,n,i,s,e);break}case L.CODES.get("\\"):{let o=s.pos();if(s.skip(1),(this.flags&N.PERL_X)!==0&&s.more())switch(s.pop()){case L.CODES.get("A"):this.op(x.Op.BEGIN_TEXT);break e;case L.CODES.get("b"):this.op(x.Op.WORD_BOUNDARY);break e;case L.CODES.get("B"):this.op(x.Op.NO_WORD_BOUNDARY);break e;case L.CODES.get("C"):throw new xe(Z.ERR_INVALID_ESCAPE,"\\C");case L.CODES.get("Q"):{let l=s.rest(),c=l.indexOf("\\E");c>=0?(l=l.substring(0,c),s.skipString(l),s.skipString("\\E")):s.skipString(l);let u=0;for(;u<l.length;){let f=l.codePointAt(u);this.literal(f),u+=U.charCount(f)}break e}case L.CODES.get("z"):this.op(x.Op.END_TEXT);break e;default:s.rewindTo(o)}else s.rewindTo(o);let B=this.newRegexp(x.Op.CHAR_CLASS);if(B.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){let l=new $n;if(this.parseUnicodeClass(s,l)){B.runes=l.toArray(),this.push(B);break e}}let a=new $n;if(this.parsePerlClassEscape(s,a)){B.runes=a.toArray(),this.push(B);break e}s.rewindTo(o),this.reuse(B),this.literal(Z.parseEscape(s));break}default:this.literal(s.pop())}e=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new xe(Z.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){let t=e.pos(),n=e.rest();if(n.startsWith("(?P<")||n.startsWith("(?<")){let B=n.charAt(2)==="P"?4:3,a=n.indexOf(">");if(a<0)throw new xe(Z.ERR_INVALID_NAMED_CAPTURE,n);let l=n.substring(B,a);if(e.skipString(l),e.skip(B+1),!Z.isValidCaptureName(l))throw new xe(Z.ERR_INVALID_NAMED_CAPTURE,n.substring(0,a+1));let c=this.op(x.Op.LEFT_PAREN);if(c.cap=++this.numCap,this.namedGroups[l])throw new xe(Z.ERR_DUPLICATE_NAMED_CAPTURE,l);this.namedGroups[l]=this.numCap,c.name=l;return}e.skip(2);let s=this.flags,i=1,o=!1;e:for(;e.more();){let B=e.pop();switch(B){case L.CODES.get("i"):s|=N.FOLD_CASE,o=!0;break;case L.CODES.get("m"):s&=~N.ONE_LINE,o=!0;break;case L.CODES.get("s"):s|=N.DOT_NL,o=!0;break;case L.CODES.get("U"):s|=N.NON_GREEDY,o=!0;break;case L.CODES.get("-"):if(i<0)break e;i=-1,s=~s,o=!1;break;case L.CODES.get(":"):case L.CODES.get(")"):if(i<0){if(!o)break e;s=~s}B===L.CODES.get(":")&&this.op(x.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new xe(Z.ERR_INVALID_PERL_OP,e.from(t))}parsePosLookBehind(){let e=this.newRegexp(x.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){let e=this.newRegexp(x.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(x.Op.VERTICAL_BAR)}swapVerticalBar(){let e=this.stack.length;if(e>=3&&this.stack[e-2].op===x.Op.VERTICAL_BAR&&Z.isCharClass(this.stack[e-1])&&Z.isCharClass(this.stack[e-3])){let t=this.stack[e-1],n=this.stack[e-3];if(t.op>n.op){let s=n;n=t,t=s,this.stack[e-3]=n}return Z.mergeCharClass(n,t),this.reuse(t),this.pop(),!0}if(e>=2){let t=this.stack[e-1],n=this.stack[e-2];if(n.op===x.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new xe(Z.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let e=this.pop(),t=this.pop();if(t.op!==x.Op.LEFT_PAREN)throw new xe(Z.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=t.flags,t.lb!==0){if(Z.hasCapture(e))throw new xe(Z.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);t.lb>0?t.op=x.Op.PLB:t.op=x.Op.NLB,t.subs=[e],this.push(t);return}t.cap===0?this.push(e):(t.op=x.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){let n=e.pos();if((this.flags&N.PERL_X)===0||!e.more()||e.pop()!==L.CODES.get("\\")||!e.more())return!1;e.pop();let s=e.from(n),i=gu.has(s)?gu.get(s):null;return i===null?!1:(t.appendGroup(i,(this.flags&N.FOLD_CASE)!==0),!0)}parseNamedClass(e,t){let n=e.rest(),s=n.indexOf(":]");if(s<0)return!1;let i=n.substring(0,s+2);e.skipString(i);let o=Fu.has(i)?Fu.get(i):null;if(o===null)throw new xe(Z.ERR_INVALID_CHAR_RANGE,i);return t.appendGroup(o,(this.flags&N.FOLD_CASE)!==0),!0}parseUnicodeClass(e,t){let n=e.pos();if((this.flags&N.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let s=1,i=e.pop();if(i===L.CODES.get("P")&&(s=-1),!e.more())throw e.rewindTo(n),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest());i=e.pop();let o;if(i!==L.CODES.get("{"))o=U.runeToString(i);else{let c=e.rest(),u=c.indexOf("}");if(u<0)throw e.rewindTo(n),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest());o=c.substring(0,u),e.skipString(o),e.skip(1)}o.length!==0&&o.codePointAt(0)===L.CODES.get("^")&&(s=0-s,o=o.substring(1));let B=Z.unicodeTable(o);if(B===null)throw new xe(Z.ERR_INVALID_CHAR_RANGE,e.from(n));B.sign<0&&(s=0-s);let a=B.tab,l=B.fold;if((this.flags&N.FOLD_CASE)===0||l===null)t.appendTableWithSign(a,s);else{let c=new $n().appendTable(a).appendTable(l).cleanClass().toArray();t.appendClassWithSign(Array.from(c),s)}return!0}parseClass(e){let t=e.pos();e.skip(1);let n=this.newRegexp(x.Op.CHAR_CLASS);n.flags=this.flags;let s=new $n,i=1;e.more()&&e.lookingAt("^")&&(i=-1,e.skip(1),(this.flags&N.CLASS_NL)===0&&s.appendRange(L.CODES.get(`
72
+ `)+1&&e.runes[3]===j.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=x.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let n=0;for(let B of e)n+=B.op===t?B.subs.length:1;let s=new Array(n).fill(null),i=0;for(let B of e)if(B.op===t){for(let a=0;a<B.subs.length;a++)s[i++]=B.subs[a];this.reuse(B)}else s[i++]=B;let o=this.newRegexp(t);if(o.subs=s,t===x.Op.ALTERNATE&&(o.subs=this.factor(o.subs),o.subs.length===1)){let B=o;o=o.subs[0],this.reuse(B)}return o}factor(e){if(e.length<2)return e;let t=0,n=e.length,s=0,i=null,o=0,B=0,a=0;for(let c=0;c<=n;c++){let u=null,f=0,d=0;if(c<n){let h=e[t+c];if(h.op===x.Op.CONCAT&&h.subs.length>0&&(h=h.subs[0]),h.op===x.Op.LITERAL&&(u=h.runes,f=h.runes.length,d=h.flags&N.FOLD_CASE),d===B){let p=0;for(;p<o&&p<f&&i[p]===u[p];)p++;if(p>0){o=p;continue}}}if(c!==a)if(c===a+1)e[s++]=e[t+a];else{let h=this.newRegexp(x.Op.LITERAL);h.flags=B,h.runes=i.slice(0,o);for(let D=a;D<c;D++)e[t+D]=this.removeLeadingString(e[t+D],o),this.checkLimits(e[t+D]);let p=this.collapse(e.slice(t+a,t+c),x.Op.ALTERNATE),k=this.newRegexp(x.Op.CONCAT);k.subs=[h,p],e[s++]=k}a=c,i=u,o=f,B=d}n=s,t=0,a=0,s=0;let l=null;for(let c=0;c<=n;c++){let u=null;if(!(c<n&&(u=Z.leadingRegexp(e[t+c]),l!==null&&l.equals(u)&&(Z.isCharClass(l)||l.op===x.Op.REPEAT&&l.min===l.max&&Z.isCharClass(l.subs[0]))))){if(c!==a)if(c===a+1)e[s++]=e[t+a];else{let f=l;for(let p=a;p<c;p++){let k=p!==a;e[t+p]=this.removeLeadingRegexp(e[t+p],k),this.checkLimits(e[t+p])}let d=this.collapse(e.slice(t+a,t+c),x.Op.ALTERNATE),h=this.newRegexp(x.Op.CONCAT);h.subs=[f,d],e[s++]=h}a=c,l=u}}n=s,t=0,a=0,s=0;for(let c=0;c<=n;c++)if(!(c<n&&Z.isCharClass(e[t+c]))){if(c!==a)if(c===a+1)e[s++]=e[t+a];else{let u=a;for(let d=a+1;d<c;d++){let h=e[t+u],p=e[t+d];(h.op<p.op||h.op===p.op&&(h.runes!==null?h.runes.length:0)<(p.runes!==null?p.runes.length:0))&&(u=d)}let f=e[t+a];e[t+a]=e[t+u],e[t+u]=f;for(let d=a+1;d<c;d++)Z.mergeCharClass(e[t+a],e[t+d]),this.reuse(e[t+d]);this.cleanAlt(e[t+a]),e[s++]=e[t+a]}c<n&&(e[s++]=e[t+c]),a=c+1}n=s,t=0,a=0,s=0;for(let c=0;c<n;++c)c+1<n&&e[t+c].op===x.Op.EMPTY_MATCH&&e[t+c+1].op===x.Op.EMPTY_MATCH||(e[s++]=e[t+c]);return n=s,t=0,e.slice(t,n)}removeLeadingString(e,t){if(e.op===x.Op.CONCAT&&e.subs.length>0){let n=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=n,n.op===x.Op.EMPTY_MATCH)switch(this.reuse(n),e.subs.length){case 0:case 1:e.op=x.Op.EMPTY_MATCH,e.subs=x.emptySubs();break;case 2:{let s=e;e=e.subs[1],this.reuse(s);break}default:e.subs=e.subs.slice(1,e.subs.length)}return e}return e.op===x.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),e.runes.length===0&&(e.op=x.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===x.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=x.Op.EMPTY_MATCH,e.subs=x.emptySubs();break;case 1:{let n=e;e=e.subs[0],this.reuse(n);break}}return e}return t&&this.reuse(e),this.newRegexp(x.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&N.LITERAL)!==0)return Z.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,n=-1,s=new up(this.wholeRegexp);for(;s.more();){let i=-1;e:switch(s.peek()){case L.CODES.get("("):if((this.flags&N.LOOKBEHIND)!==0){if(s.lookingAt("(?<=")){this.parsePosLookBehind(),s.skip(4);break}if(s.lookingAt("(?<!")){this.parseNegLookBehind(),s.skip(4);break}}if((this.flags&N.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(x.Op.LEFT_PAREN).cap=++this.numCap,s.skip(1);break;case L.CODES.get("|"):this.parseVerticalBar(),s.skip(1);break;case L.CODES.get(")"):this.parseRightParen(),s.skip(1);break;case L.CODES.get("^"):(this.flags&N.ONE_LINE)!==0?this.op(x.Op.BEGIN_TEXT):this.op(x.Op.BEGIN_LINE),s.skip(1);break;case L.CODES.get("$"):(this.flags&N.ONE_LINE)!==0?this.op(x.Op.END_TEXT).flags|=N.WAS_DOLLAR:this.op(x.Op.END_LINE),s.skip(1);break;case L.CODES.get("."):(this.flags&N.DOT_NL)!==0?this.op(x.Op.ANY_CHAR):this.op(x.Op.ANY_CHAR_NOT_NL),s.skip(1);break;case L.CODES.get("["):this.parseClass(s);break;case L.CODES.get("*"):case L.CODES.get("+"):case L.CODES.get("?"):{i=s.pos();let o=null;switch(s.pop()){case L.CODES.get("*"):o=x.Op.STAR;break;case L.CODES.get("+"):o=x.Op.PLUS;break;case L.CODES.get("?"):o=x.Op.QUEST}this.repeat(o,t,n,i,s,e);break}case L.CODES.get("{"):{let o=s.pos(),B=Z.parseRepeat(s);if(B<0){s.rewindTo(o),this.literal(s.pop());break}i=o,t=B>>16,n=(B&j.MAX_BMP)<<16>>16,this.repeat(x.Op.REPEAT,t,n,i,s,e);break}case L.CODES.get("\\"):{let o=s.pos();if(s.skip(1),(this.flags&N.PERL_X)!==0&&s.more())switch(s.pop()){case L.CODES.get("A"):this.op(x.Op.BEGIN_TEXT);break e;case L.CODES.get("b"):this.op(x.Op.WORD_BOUNDARY);break e;case L.CODES.get("B"):this.op(x.Op.NO_WORD_BOUNDARY);break e;case L.CODES.get("C"):throw new xe(Z.ERR_INVALID_ESCAPE,"\\C");case L.CODES.get("Q"):{let l=s.rest(),c=l.indexOf("\\E");c>=0?(l=l.substring(0,c),s.skipString(l),s.skipString("\\E")):s.skipString(l);let u=0;for(;u<l.length;){let f=l.codePointAt(u);this.literal(f),u+=U.charCount(f)}break e}case L.CODES.get("z"):this.op(x.Op.END_TEXT);break e;default:s.rewindTo(o)}else s.rewindTo(o);let B=this.newRegexp(x.Op.CHAR_CLASS);if(B.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){let l=new Fn;if(this.parseUnicodeClass(s,l)){B.runes=l.toArray(),this.push(B);break e}}let a=new Fn;if(this.parsePerlClassEscape(s,a)){B.runes=a.toArray(),this.push(B);break e}s.rewindTo(o),this.reuse(B),this.literal(Z.parseEscape(s));break}default:this.literal(s.pop())}e=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new xe(Z.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){let t=e.pos(),n=e.rest();if(n.startsWith("(?P<")||n.startsWith("(?<")){let B=n.charAt(2)==="P"?4:3,a=n.indexOf(">");if(a<0)throw new xe(Z.ERR_INVALID_NAMED_CAPTURE,n);let l=n.substring(B,a);if(e.skipString(l),e.skip(B+1),!Z.isValidCaptureName(l))throw new xe(Z.ERR_INVALID_NAMED_CAPTURE,n.substring(0,a+1));let c=this.op(x.Op.LEFT_PAREN);if(c.cap=++this.numCap,this.namedGroups[l])throw new xe(Z.ERR_DUPLICATE_NAMED_CAPTURE,l);this.namedGroups[l]=this.numCap,c.name=l;return}e.skip(2);let s=this.flags,i=1,o=!1;e:for(;e.more();){let B=e.pop();switch(B){case L.CODES.get("i"):s|=N.FOLD_CASE,o=!0;break;case L.CODES.get("m"):s&=~N.ONE_LINE,o=!0;break;case L.CODES.get("s"):s|=N.DOT_NL,o=!0;break;case L.CODES.get("U"):s|=N.NON_GREEDY,o=!0;break;case L.CODES.get("-"):if(i<0)break e;i=-1,s=~s,o=!1;break;case L.CODES.get(":"):case L.CODES.get(")"):if(i<0){if(!o)break e;s=~s}B===L.CODES.get(":")&&this.op(x.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new xe(Z.ERR_INVALID_PERL_OP,e.from(t))}parsePosLookBehind(){let e=this.newRegexp(x.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){let e=this.newRegexp(x.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(x.Op.VERTICAL_BAR)}swapVerticalBar(){let e=this.stack.length;if(e>=3&&this.stack[e-2].op===x.Op.VERTICAL_BAR&&Z.isCharClass(this.stack[e-1])&&Z.isCharClass(this.stack[e-3])){let t=this.stack[e-1],n=this.stack[e-3];if(t.op>n.op){let s=n;n=t,t=s,this.stack[e-3]=n}return Z.mergeCharClass(n,t),this.reuse(t),this.pop(),!0}if(e>=2){let t=this.stack[e-1],n=this.stack[e-2];if(n.op===x.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new xe(Z.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let e=this.pop(),t=this.pop();if(t.op!==x.Op.LEFT_PAREN)throw new xe(Z.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=t.flags,t.lb!==0){if(Z.hasCapture(e))throw new xe(Z.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);t.lb>0?t.op=x.Op.PLB:t.op=x.Op.NLB,t.subs=[e],this.push(t);return}t.cap===0?this.push(e):(t.op=x.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){let n=e.pos();if((this.flags&N.PERL_X)===0||!e.more()||e.pop()!==L.CODES.get("\\")||!e.more())return!1;e.pop();let s=e.from(n),i=gu.has(s)?gu.get(s):null;return i===null?!1:(t.appendGroup(i,(this.flags&N.FOLD_CASE)!==0),!0)}parseNamedClass(e,t){let n=e.rest(),s=n.indexOf(":]");if(s<0)return!1;let i=n.substring(0,s+2);e.skipString(i);let o=$u.has(i)?$u.get(i):null;if(o===null)throw new xe(Z.ERR_INVALID_CHAR_RANGE,i);return t.appendGroup(o,(this.flags&N.FOLD_CASE)!==0),!0}parseUnicodeClass(e,t){let n=e.pos();if((this.flags&N.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let s=1,i=e.pop();if(i===L.CODES.get("P")&&(s=-1),!e.more())throw e.rewindTo(n),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest());i=e.pop();let o;if(i!==L.CODES.get("{"))o=U.runeToString(i);else{let c=e.rest(),u=c.indexOf("}");if(u<0)throw e.rewindTo(n),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest());o=c.substring(0,u),e.skipString(o),e.skip(1)}o.length!==0&&o.codePointAt(0)===L.CODES.get("^")&&(s=0-s,o=o.substring(1));let B=Z.unicodeTable(o);if(B===null)throw new xe(Z.ERR_INVALID_CHAR_RANGE,e.from(n));B.sign<0&&(s=0-s);let a=B.tab,l=B.fold;if((this.flags&N.FOLD_CASE)===0||l===null)t.appendTableWithSign(a,s);else{let c=new Fn().appendTable(a).appendTable(l).cleanClass().toArray();t.appendClassWithSign(Array.from(c),s)}return!0}parseClass(e){let t=e.pos();e.skip(1);let n=this.newRegexp(x.Op.CHAR_CLASS);n.flags=this.flags;let s=new Fn,i=1;e.more()&&e.lookingAt("^")&&(i=-1,e.skip(1),(this.flags&N.CLASS_NL)===0&&s.appendRange(L.CODES.get(`
73
73
  `),L.CODES.get(`
74
- `)));let o=!0;for(;!e.more()||e.peek()!==L.CODES.get("]")||o;){if(e.more()&&e.lookingAt("-")&&(this.flags&N.PERL_X)===0&&!o){let c=e.rest();if(c==="-"||!c.startsWith("-]"))throw e.rewindTo(t),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;let B=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(B)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(B);let a=Z.parseClassChar(e,t),l=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(l=Z.parseClassChar(e,t),l<a)throw new xe(Z.ERR_INVALID_CHAR_RANGE,e.from(B))}(this.flags&N.FOLD_CASE)===0?s.appendRange(a,l):s.appendFoldedRange(a,l)}e.skip(1),s.cleanClass(),i<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},lp=class Tn{static initTest(e){let t=Tn.compile(e),n=new Tn(t.expr,t.prog,t.numSubexp,t.longest);return n.cond=t.cond,n.prefix=t.prefix,n.prefixUTF8=t.prefixUTF8,n.prefixComplete=t.prefixComplete,n.prefixRune=t.prefixRune,n.prefilter=t.prefilter,n}static compile(e){return Tn.compileImpl(e,N.PERL,!1)}static compilePOSIX(e){return Tn.compileImpl(e,N.POSIX,!0)}static compileImpl(e,t,n){let s=qr.parse(e,t),i=s.maxCap(),o=s.namedGroups;s=ju.simplify(s);let B=op.build(s),a=Ju.compileRegexp(s),l=new Tn(e,a,i,n);l.prefilter=B.type===ae.Type.NONE?null:B;let[c,u]=a.prefix();return l.prefixComplete=c,l.prefix=u,l.prefixUTF8=U.stringToUtf8ByteArray(l.prefix),l.prefix.length>0&&(l.prefixRune=l.prefix.codePointAt(0)),l.namedGroups=o,l}static match(e,t){return Tn.compile(e).match(t)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new Mo(this.prog),this.onepass=cu.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,n,s){if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return null;let i=-1,o=-1,B=e.prefixLength(this);if(n===N.UNANCHORED){let a=e.index(this,t);if(a<0)return null;i=t+a,o=i+B}else if(n===N.ANCHOR_BOTH){if(e.endPos()!==B||e.index(this,0)!==0)return null;i=0,o=B}else if(n===N.ANCHOR_START){if(e.index(this,0)!==0)return null;i=0,o=B}if(i<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=i,a[1]=o,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new qd(this.prog):null}executeEngine(e,t,n,s,i=null){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,n,s);if(this.prefilter!==null&&n===N.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return cu.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=ri.maxBitStateLen(this.prog)?ri.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,i);if(this.prog.numLb===0){let o=this.dfa.match(e,t,n);if(o!==null)return o?[]:null;if(e.endPos()<=ri.maxBitStateLen(this.prog))return ri.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,i)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,i=null){let o=this.get();o||(o=Pu.fromRE2(this)),o.init(s);let B=o.match(e,t,n,i)?o.submatches():null;return this.put(o),B}match(e){return this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,i,o=null){return e instanceof Ln||(U.isByteArray(e)?e=In.utf8(e):e=In.utf16(e)),this.matchMachineInput(e,t,n,s,i,o)}matchMachineInput(e,t,n,s,i,o=null){if(t>n)return[!1,null];let B=e.isUTF16Encoding()?we.fromUTF16(e.asCharSequence(),0,n):we.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(B,t,s,2*i,o);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,i=0,o="",B=we.fromUTF16(e),a=this.createLookbehindState(),l=0;for(;i<=e.length;){let c=this.executeEngine(B,i,N.UNANCHORED,2,a);if(c===null||c.length===0)break;o+=e.substring(s,c[0]),(c[1]>s||c[0]===0)&&(o+=t(e.substring(c[0],c[1])),l++),s=c[1];let u=B.step(i)&7;if(i+u>c[1]?i+=u:i+1>c[1]?i++:i=c[1],l>=n)break}return o+=e.substring(s),o}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let n=new Array(t).fill(-1);for(let s=0;s<e.length;s++)n[s]=e[s];e=n}return e}allMatches(e,t,n=s=>s){let s=[],i=e.endPos();t<0&&(t=i+1);let o=0,B=0,a=-1,l=this.createLookbehindState();for(;B<t&&o<=i;){let c=this.executeEngine(e,o,N.UNANCHORED,this.prog.numCap,l);if(c===null||c.length===0)break;let u=!0;if(c[1]===o){c[0]===a&&(u=!1);let f=e.step(o);f<0?o=i+1:o+=f&7}else o=c[1];a=c[1],u&&(s.push(n(this.pad(c))),B++)}return s}findUTF8(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.slice(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(we.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.substring(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(we.fromUTF16(e),t);return n.length===0?null:n}},em=class oi{static UNANCHORED=N.UNANCHORED;static ANCHOR_START=N.ANCHOR_START;static ANCHOR_BOTH=N.ANCHOR_BOTH;constructor(e=oi.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=N.PERL;(t&At.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&At.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND),this.re2Flags=s,this.regexps=[],this.prog=null,this.dfa=null,this.dummyRe2=null}add(e){if(this.prog)throw new Qr("Cannot add patterns after compile");let t=e;(this.jsFlags&At.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&At.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&At.MULTILINE)!==0&&(t=`(?m)${t}`);let n=qr.parse(t,this.re2Flags);return this.regexps.push(ju.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=Ju.compileSet(this.regexps);if(e.numInst()>qr.MAX_SIZE)throw new Qr(`${qr.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${qr.MAX_SIZE}`);this.prog=e,this.dfa=new Mo(this.prog,this.maxMem),this.dummyRe2={prog:this.prog,cond:this.prog.startCond(),prefix:"",prefixRune:0,longest:!1}}match(e){this.prog||this.compile();let t=U.isByteArray(e)?we.fromUTF8(e):we.fromUTF16(e),n=N.UNANCHORED;this.anchor===oi.ANCHOR_START?n=N.ANCHOR_START:this.anchor===oi.ANCHOR_BOTH&&(n=N.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let i=Pu.fromRE2(this.dummyRe2);return i.init(0),i.matchSet(t,0,n)}},cp=class dr{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let n="",s=!1,i=e.length;i===0&&(n="(?:)",s=!0);let o=!1,B=0;for(;B<i;){let l=e[B];if(l==="\\"){if(B+1<i)switch(l=e[B+1],l){case"\\":n+="\\\\",B+=2;continue;case"c":if(B+2<i){let f=e[B+2].charCodeAt(0);if(f>=65&&f<=90||f>=97&&f<=122){let d=f%32;n+="\\x",n+=(d>>4).toString(16).toUpperCase(),n+=(d&15).toString(16).toUpperCase(),B+=3,s=!0;continue}}n+="c",B+=2,s=!0;continue;case"u":if(B+2<i){if(e[B+2]==="{"){let f=B+3,d=!1,h=!1;for(;f<i;){let p=e[f];if(p==="}"){h=!0;break}if(!dr.isHexadecimal(p))break;d=!0,f++}if(h&&d){n+="\\x",B+=2,s=!0;continue}}else if(B+5<i){let f=!0;for(let d=0;d<4;d++)if(!dr.isHexadecimal(e[B+2+d])){f=!1;break}if(f){n+="\\x{"+e.substring(B+2,B+6)+"}",B+=6,s=!0;continue}}}n+="u",B+=2,s=!0;continue;case"x":{let f=!1;if(B+2<i&&e[B+2]==="{"){let d=B+3,h=!1,p=!1;for(;d<i;){let k=e[d];if(k==="}"){p=!0;break}if(!dr.isHexadecimal(k))break;h=!0,d++}p&&h&&(f=!0)}else B+3<i&&dr.isHexadecimal(e[B+2])&&dr.isHexadecimal(e[B+3])&&(f=!0);f?(n+="\\x",B+=2):(n+="x",B+=2,s=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":n+="\\"+l,B+=2;continue;default:{let f=e.codePointAt(B+1);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122){let d=U.charCount(f);n+=e.substring(B+1,B+1+d),B+=d+1,s=!0}else{n+="\\";let d=U.charCount(f);n+=e.substring(B+1,B+1+d),B+=d+1}continue}}}else if(l==="/"){n+="\\/",B+=1,s=!0;continue}else if(l==="[")o=!0;else if(l==="]")o=!1;else if(!o&&l==="("&&B+2<i&&e[B+1]==="?"&&e[B+2]==="<"&&B+3<i&&!"=!>)".includes(e[B+3])){n+="(?P<",B+=3,s=!0;continue}let c=e.codePointAt(B),u=U.charCount(c);n+=e.substring(B,B+u),B+=u}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},pr=class Qe{static CASE_INSENSITIVE=At.CASE_INSENSITIVE;static DOTALL=At.DOTALL;static MULTILINE=At.MULTILINE;static DISABLE_UNICODE_GROUPS=At.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=At.LONGEST_MATCH;static LOOKBEHINDS=At.LOOKBEHINDS;static quote(e){return U.quoteMeta(e)}static quoteReplacement(e,t=!1){return Bu.quoteReplacement(e,t)}static translateRegExp(e){return cp.translate(e)}static compile(e,t=0){let n=e;if((t&Qe.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&Qe.DOTALL)!==0&&(n=`(?s)${n}`),(t&Qe.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(Qe.MULTILINE|Qe.DOTALL|Qe.CASE_INSENSITIVE|Qe.DISABLE_UNICODE_GROUPS|Qe.LONGEST_MATCH|Qe.LOOKBEHINDS))!==0)throw new Yd("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=N.PERL;(t&Qe.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&Qe.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND);let i=new Qe(e,t);return i.re2Input=lp.compileImpl(n,s,(t&Qe.LONGEST_MATCH)!==0),i}static matches(e,t){return Qe.compile(e).testExact(t)}static initTest(e,t,n){if(e==null)throw new Error("pattern is null");if(n==null)throw new Error("re2 is null");let s=new Qe(e,t);return s.re2Input=n,s}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return U.isByteArray(e)&&(e=In.utf8(e)),new Bu(this,e)}test(e){return U.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=U.isByteArray(e)?we.fromUTF8(e):we.fromUTF16(e);return this.re2Input.executeEngine(t,0,N.ANCHOR_BOTH,0)!==null}exec(e){let t=this.matcher(e);if(!t.find())return null;let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],i=0,o=0;for(;n.find();){if(o===0&&n.end()===0){o=n.end();continue}if(t>0&&s.length===t-1)break;if(o===n.start()){if(t===0){i+=1,o=n.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.start())),o=n.end()}if(t===0&&o!==n.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.inputLength()))}return(t!==0||s.length===0&&!(o===n.inputLength()&&o>0))&&s.push(n.substring(o,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;yield n}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}};var Ku="kubectl config current-context",fp=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function zu(r){return r.length<=253&&fp.test(r)}var dp=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function Nn(r){return r===void 0?void 0:dp.exec(r)?.[1]}function Bi(r){return zu(r)||Nn(r)!==void 0}function Xr(r,e){return r.kubeContext??e?.kubeContext}function ai(r,e){let t=Nn(r);if(t===void 0)return r;let n=e(t);if(n===void 0)throw new Error(`md-runbook: kube-context \${param:${t}} has no value: nothing ran`);if(!zu(n))throw new Error(`md-runbook: kube-context \${param:${t}} is ${JSON.stringify(n)}, which is not a Kubernetes context name: nothing ran`);return n}function Yu(r){let e=Nn(r);return e===void 0?"":`\${param:${e}}`}function pp(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");if(e.exitCode===0&&t===r)return;let n=`md-runbook: this runbook is for the Kubernetes context ${r}`;if(e.exitCode===0&&t!==void 0)return`${n}, and kubectl's current context is ${t}: nothing ran. Switch with \`kubectl config use-context ${r}\`, or open the runbook meant for ${t}.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return`${n}, and \`${Ku}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function qu(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?Zu(r):Ku)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?hp(r,n):pp(r,n)}var Qu=["check","pin"];function Wu(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
74
+ `)));let o=!0;for(;!e.more()||e.peek()!==L.CODES.get("]")||o;){if(e.more()&&e.lookingAt("-")&&(this.flags&N.PERL_X)===0&&!o){let c=e.rest();if(c==="-"||!c.startsWith("-]"))throw e.rewindTo(t),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;let B=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(B)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(B);let a=Z.parseClassChar(e,t),l=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(l=Z.parseClassChar(e,t),l<a)throw new xe(Z.ERR_INVALID_CHAR_RANGE,e.from(B))}(this.flags&N.FOLD_CASE)===0?s.appendRange(a,l):s.appendFoldedRange(a,l)}e.skip(1),s.cleanClass(),i<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},lp=class Tn{static initTest(e){let t=Tn.compile(e),n=new Tn(t.expr,t.prog,t.numSubexp,t.longest);return n.cond=t.cond,n.prefix=t.prefix,n.prefixUTF8=t.prefixUTF8,n.prefixComplete=t.prefixComplete,n.prefixRune=t.prefixRune,n.prefilter=t.prefilter,n}static compile(e){return Tn.compileImpl(e,N.PERL,!1)}static compilePOSIX(e){return Tn.compileImpl(e,N.POSIX,!0)}static compileImpl(e,t,n){let s=Yr.parse(e,t),i=s.maxCap(),o=s.namedGroups;s=ju.simplify(s);let B=op.build(s),a=Ju.compileRegexp(s),l=new Tn(e,a,i,n);l.prefilter=B.type===ae.Type.NONE?null:B;let[c,u]=a.prefix();return l.prefixComplete=c,l.prefix=u,l.prefixUTF8=U.stringToUtf8ByteArray(l.prefix),l.prefix.length>0&&(l.prefixRune=l.prefix.codePointAt(0)),l.namedGroups=o,l}static match(e,t){return Tn.compile(e).match(t)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new Mo(this.prog),this.onepass=cu.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,n,s){if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return null;let i=-1,o=-1,B=e.prefixLength(this);if(n===N.UNANCHORED){let a=e.index(this,t);if(a<0)return null;i=t+a,o=i+B}else if(n===N.ANCHOR_BOTH){if(e.endPos()!==B||e.index(this,0)!==0)return null;i=0,o=B}else if(n===N.ANCHOR_START){if(e.index(this,0)!==0)return null;i=0,o=B}if(i<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=i,a[1]=o,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new Yd(this.prog):null}executeEngine(e,t,n,s,i=null){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,n,s);if(this.prefilter!==null&&n===N.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return cu.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=ri.maxBitStateLen(this.prog)?ri.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,i);if(this.prog.numLb===0){let o=this.dfa.match(e,t,n);if(o!==null)return o?[]:null;if(e.endPos()<=ri.maxBitStateLen(this.prog))return ri.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,i)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,i=null){let o=this.get();o||(o=Pu.fromRE2(this)),o.init(s);let B=o.match(e,t,n,i)?o.submatches():null;return this.put(o),B}match(e){return this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,i,o=null){return e instanceof Ln||(U.isByteArray(e)?e=In.utf8(e):e=In.utf16(e)),this.matchMachineInput(e,t,n,s,i,o)}matchMachineInput(e,t,n,s,i,o=null){if(t>n)return[!1,null];let B=e.isUTF16Encoding()?we.fromUTF16(e.asCharSequence(),0,n):we.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(B,t,s,2*i,o);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,i=0,o="",B=we.fromUTF16(e),a=this.createLookbehindState(),l=0;for(;i<=e.length;){let c=this.executeEngine(B,i,N.UNANCHORED,2,a);if(c===null||c.length===0)break;o+=e.substring(s,c[0]),(c[1]>s||c[0]===0)&&(o+=t(e.substring(c[0],c[1])),l++),s=c[1];let u=B.step(i)&7;if(i+u>c[1]?i+=u:i+1>c[1]?i++:i=c[1],l>=n)break}return o+=e.substring(s),o}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let n=new Array(t).fill(-1);for(let s=0;s<e.length;s++)n[s]=e[s];e=n}return e}allMatches(e,t,n=s=>s){let s=[],i=e.endPos();t<0&&(t=i+1);let o=0,B=0,a=-1,l=this.createLookbehindState();for(;B<t&&o<=i;){let c=this.executeEngine(e,o,N.UNANCHORED,this.prog.numCap,l);if(c===null||c.length===0)break;let u=!0;if(c[1]===o){c[0]===a&&(u=!1);let f=e.step(o);f<0?o=i+1:o+=f&7}else o=c[1];a=c[1],u&&(s.push(n(this.pad(c))),B++)}return s}findUTF8(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.slice(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(we.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.substring(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(we.fromUTF16(e),t);return n.length===0?null:n}},tm=class oi{static UNANCHORED=N.UNANCHORED;static ANCHOR_START=N.ANCHOR_START;static ANCHOR_BOTH=N.ANCHOR_BOTH;constructor(e=oi.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=N.PERL;(t&At.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&At.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND),this.re2Flags=s,this.regexps=[],this.prog=null,this.dfa=null,this.dummyRe2=null}add(e){if(this.prog)throw new Qr("Cannot add patterns after compile");let t=e;(this.jsFlags&At.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&At.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&At.MULTILINE)!==0&&(t=`(?m)${t}`);let n=Yr.parse(t,this.re2Flags);return this.regexps.push(ju.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=Ju.compileSet(this.regexps);if(e.numInst()>Yr.MAX_SIZE)throw new Qr(`${Yr.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${Yr.MAX_SIZE}`);this.prog=e,this.dfa=new Mo(this.prog,this.maxMem),this.dummyRe2={prog:this.prog,cond:this.prog.startCond(),prefix:"",prefixRune:0,longest:!1}}match(e){this.prog||this.compile();let t=U.isByteArray(e)?we.fromUTF8(e):we.fromUTF16(e),n=N.UNANCHORED;this.anchor===oi.ANCHOR_START?n=N.ANCHOR_START:this.anchor===oi.ANCHOR_BOTH&&(n=N.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let i=Pu.fromRE2(this.dummyRe2);return i.init(0),i.matchSet(t,0,n)}},cp=class dr{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let n="",s=!1,i=e.length;i===0&&(n="(?:)",s=!0);let o=!1,B=0;for(;B<i;){let l=e[B];if(l==="\\"){if(B+1<i)switch(l=e[B+1],l){case"\\":n+="\\\\",B+=2;continue;case"c":if(B+2<i){let f=e[B+2].charCodeAt(0);if(f>=65&&f<=90||f>=97&&f<=122){let d=f%32;n+="\\x",n+=(d>>4).toString(16).toUpperCase(),n+=(d&15).toString(16).toUpperCase(),B+=3,s=!0;continue}}n+="c",B+=2,s=!0;continue;case"u":if(B+2<i){if(e[B+2]==="{"){let f=B+3,d=!1,h=!1;for(;f<i;){let p=e[f];if(p==="}"){h=!0;break}if(!dr.isHexadecimal(p))break;d=!0,f++}if(h&&d){n+="\\x",B+=2,s=!0;continue}}else if(B+5<i){let f=!0;for(let d=0;d<4;d++)if(!dr.isHexadecimal(e[B+2+d])){f=!1;break}if(f){n+="\\x{"+e.substring(B+2,B+6)+"}",B+=6,s=!0;continue}}}n+="u",B+=2,s=!0;continue;case"x":{let f=!1;if(B+2<i&&e[B+2]==="{"){let d=B+3,h=!1,p=!1;for(;d<i;){let k=e[d];if(k==="}"){p=!0;break}if(!dr.isHexadecimal(k))break;h=!0,d++}p&&h&&(f=!0)}else B+3<i&&dr.isHexadecimal(e[B+2])&&dr.isHexadecimal(e[B+3])&&(f=!0);f?(n+="\\x",B+=2):(n+="x",B+=2,s=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":n+="\\"+l,B+=2;continue;default:{let f=e.codePointAt(B+1);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122){let d=U.charCount(f);n+=e.substring(B+1,B+1+d),B+=d+1,s=!0}else{n+="\\";let d=U.charCount(f);n+=e.substring(B+1,B+1+d),B+=d+1}continue}}}else if(l==="/"){n+="\\/",B+=1,s=!0;continue}else if(l==="[")o=!0;else if(l==="]")o=!1;else if(!o&&l==="("&&B+2<i&&e[B+1]==="?"&&e[B+2]==="<"&&B+3<i&&!"=!>)".includes(e[B+3])){n+="(?P<",B+=3,s=!0;continue}let c=e.codePointAt(B),u=U.charCount(c);n+=e.substring(B,B+u),B+=u}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},pr=class Qe{static CASE_INSENSITIVE=At.CASE_INSENSITIVE;static DOTALL=At.DOTALL;static MULTILINE=At.MULTILINE;static DISABLE_UNICODE_GROUPS=At.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=At.LONGEST_MATCH;static LOOKBEHINDS=At.LOOKBEHINDS;static quote(e){return U.quoteMeta(e)}static quoteReplacement(e,t=!1){return Bu.quoteReplacement(e,t)}static translateRegExp(e){return cp.translate(e)}static compile(e,t=0){let n=e;if((t&Qe.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&Qe.DOTALL)!==0&&(n=`(?s)${n}`),(t&Qe.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(Qe.MULTILINE|Qe.DOTALL|Qe.CASE_INSENSITIVE|Qe.DISABLE_UNICODE_GROUPS|Qe.LONGEST_MATCH|Qe.LOOKBEHINDS))!==0)throw new qd("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=N.PERL;(t&Qe.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&Qe.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND);let i=new Qe(e,t);return i.re2Input=lp.compileImpl(n,s,(t&Qe.LONGEST_MATCH)!==0),i}static matches(e,t){return Qe.compile(e).testExact(t)}static initTest(e,t,n){if(e==null)throw new Error("pattern is null");if(n==null)throw new Error("re2 is null");let s=new Qe(e,t);return s.re2Input=n,s}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return U.isByteArray(e)&&(e=In.utf8(e)),new Bu(this,e)}test(e){return U.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=U.isByteArray(e)?we.fromUTF8(e):we.fromUTF16(e);return this.re2Input.executeEngine(t,0,N.ANCHOR_BOTH,0)!==null}exec(e){let t=this.matcher(e);if(!t.find())return null;let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],i=0,o=0;for(;n.find();){if(o===0&&n.end()===0){o=n.end();continue}if(t>0&&s.length===t-1)break;if(o===n.start()){if(t===0){i+=1,o=n.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.start())),o=n.end()}if(t===0&&o!==n.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.inputLength()))}return(t!==0||s.length===0&&!(o===n.inputLength()&&o>0))&&s.push(n.substring(o,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;yield n}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}};var Ku="kubectl config current-context",fp=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function zu(r){return r.length<=253&&fp.test(r)}var dp=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function Nn(r){return r===void 0?void 0:dp.exec(r)?.[1]}function Bi(r){return zu(r)||Nn(r)!==void 0}function Xr(r,e){return r.kubeContext??e?.kubeContext}function ai(r,e){let t=Nn(r);if(t===void 0)return r;let n=e(t);if(n===void 0)throw new Error(`md-runbook: kube-context \${param:${t}} has no value: nothing ran`);if(!zu(n))throw new Error(`md-runbook: kube-context \${param:${t}} is ${JSON.stringify(n)}, which is not a Kubernetes context name: nothing ran`);return n}function qu(r){let e=Nn(r);return e===void 0?"":`\${param:${e}}`}function pp(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");if(e.exitCode===0&&t===r)return;let n=`md-runbook: this runbook is for the Kubernetes context ${r}`;if(e.exitCode===0&&t!==void 0)return`${n}, and kubectl's current context is ${t}: nothing ran. Switch with \`kubectl config use-context ${r}\`, or open the runbook meant for ${t}.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return`${n}, and \`${Ku}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function Yu(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?Zu(r):Ku)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?hp(r,n):pp(r,n)}var Qu=["check","pin"];function Wu(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
75
75
  # Only the current context is here; clusters, users and credentials come from your own kubeconfig.
76
76
  apiVersion: v1
77
77
  kind: Config
@@ -80,23 +80,23 @@ clusters: []
80
80
  contexts: []
81
81
  users: []
82
82
  current-context: ${JSON.stringify(r)}
83
- `}function Vu(r,e,t){return r+(t==="win32"?";":":")+e}function Zu(r){return`kubectl config get-contexts ${r}`}function hp(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim().split(/\s+/));if(e.exitCode===0&&t.some(i=>i[0]==="*"&&i[1]===r))return;let n=`md-runbook: this runbook pins the Kubernetes context ${r}`;if(e.exitCode===0&&t.some(i=>i[0]===r))return`${n}, and kubectl's current context in the cell is another one (does KUBECONFIG change before kubectl runs?): nothing ran.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return s!==void 0&&/\bcontext\b.*\bnot found\b/i.test(s)?`${n}, and your kubeconfig has no context ${r} (${s}): nothing ran. \`kubectl config get-contexts\` lists the ones you have.`:`${n}, and \`${Zu(r)}\` ${s?`failed (${s})`:"did not list it"}: nothing ran.`}var $t=/^[A-Za-z_][A-Za-z0-9_]*$/,Po=/\$\{(secret|input|param|out):([A-Za-z_][A-Za-z0-9_]*)(:secret)?\}/g;function Cp(r){return/_(PASSWORD|TOKEN|SECRET)$/i.test(r)}function Xe(r){let e=new Map;for(let t of r.matchAll(Po)){let n=t[1],s=t[2];if(t[3]&&n!=="input")continue;let i=n==="secret"||n==="input"&&(!!t[3]||Cp(s)),o=e.get(s);if(o&&o.kind!==n)throw new Error(`${s} is referenced as both ${o.kind} and ${n}`);o?o.secret||=i:e.set(s,{kind:n,name:s,secret:i})}return[...e.values()]}function Mn(r,e){return r.replace(Po,(t,n,s,i)=>i&&n!=="input"?t:e(n,s))}function gp(r,e){switch(e){case"bash":return"${"+r+"}";case"pwsh":return"${env:"+r+"}";case"cmd":return"!"+r+"!"}}var mp="@setlocal EnableDelayedExpansion";function hr(r,e){let t=!1,n=r.replace(Po,(i,o,B,a)=>a&&o!=="input"?i:(t=!0,gp(B,e)));if(e!=="cmd"||!t)return n;let s=/\r\n/.test(r)?`\r
83
+ `}function Vu(r,e,t){return r+(t==="win32"?";":":")+e}function Zu(r){return`kubectl config get-contexts ${r}`}function hp(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim().split(/\s+/));if(e.exitCode===0&&t.some(i=>i[0]==="*"&&i[1]===r))return;let n=`md-runbook: this runbook pins the Kubernetes context ${r}`;if(e.exitCode===0&&t.some(i=>i[0]===r))return`${n}, and kubectl's current context in the cell is another one (does KUBECONFIG change before kubectl runs?): nothing ran.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return s!==void 0&&/\bcontext\b.*\bnot found\b/i.test(s)?`${n}, and your kubeconfig has no context ${r} (${s}): nothing ran. \`kubectl config get-contexts\` lists the ones you have.`:`${n}, and \`${Zu(r)}\` ${s?`failed (${s})`:"did not list it"}: nothing ran.`}var Ft=/^[A-Za-z_][A-Za-z0-9_]*$/,Po=/\$\{(secret|input|param|out):([A-Za-z_][A-Za-z0-9_]*)(:secret)?\}/g;function Cp(r){return/_(PASSWORD|TOKEN|SECRET)$/i.test(r)}function Xe(r){let e=new Map;for(let t of r.matchAll(Po)){let n=t[1],s=t[2];if(t[3]&&n!=="input")continue;let i=n==="secret"||n==="input"&&(!!t[3]||Cp(s)),o=e.get(s);if(o&&o.kind!==n)throw new Error(`${s} is referenced as both ${o.kind} and ${n}`);o?o.secret||=i:e.set(s,{kind:n,name:s,secret:i})}return[...e.values()]}function Mn(r,e){return r.replace(Po,(t,n,s,i)=>i&&n!=="input"?t:e(n,s))}function gp(r,e){switch(e){case"bash":return"${"+r+"}";case"pwsh":return"${env:"+r+"}";case"cmd":return"!"+r+"!"}}var mp="@setlocal EnableDelayedExpansion";function hr(r,e){let t=!1,n=r.replace(Po,(i,o,B,a)=>a&&o!=="input"?i:(t=!0,gp(B,e)));if(e!=="cmd"||!t)return n;let s=/\r\n/.test(r)?`\r
84
84
  `:`
85
- `;return mp+s+n}function Ep(r){let e=r.trim(),t=/(?:^|\s|\()one of:\s*((?:[^.()]|\.(?=\S))*?)\s*\)?\s*\.?\s*$/i.exec(e),n=t?[...new Set(t[1].split(/\s*,\s*(?:or\s+)?|\s+or\s+/i).map(i=>ui(i.trim())).filter(i=>i!==""))]:[];if(!t||n.length===0)return e!==""?{description:e}:{};let s=e.slice(0,t.index).replace(/[\s,;:(-]+$/,"");return{...s!==""?{description:s}:{},choices:n}}function ui(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.startsWith('"')?r.slice(1,-1).replace(/\\(["\\])/g,"$1"):r.slice(1,-1).replace(/''/g,"'"):r}function zt(r){let e=/^([a-z]+):\/\/([^/?#\s]*)([/?#][^\s]*)?$/i.exec(r);if(!e)return"not an address (expected https://host/path)";let t=e[1].toLowerCase(),n=e[2];if(n.includes("@"))return"no user name or password in the address (use report-runs-token: ${secret:NAME})";let s=/^(\[[0-9A-Fa-f:.]+\]|[A-Za-z0-9.-]+)(?::(\d{1,5}))?$/.exec(n);if(!s||s[1]===""||s[1].startsWith(".")||s[1].endsWith("-"))return`"${n}" is not a host name`;if(t!=="https")return t==="http"?bp(s[1])?void 0:"http is only for localhost: use https":`${t}: is not https`}var bp=r=>/^(localhost|127(\.\d{1,3}){3}|\[::1\])$/i.test(r);function Xu(r){let e=r.trim(),t=/^("(?:[^"\\]|\\.)*"|'(?:[^']|'')*')\s*(?:#(.*))?$/.exec(e);if(t)return{value:ui(t[1]),...t[2]!==void 0?{comment:t[2].trim()}:{}};if(e.startsWith("#"))return{value:"",comment:e.slice(1).trim()};let n=/\s+#(.*)$/.exec(e);return n?{value:e.slice(0,n.index),comment:n[1].trim()}:{value:e}}function Dp(r){return Xu(r).value}var Ho=/^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:(?:\s+(.*?))?\s*$/;function wp(r){let e=r.trim().toLowerCase();if(/^\d+(?:\.\d+)?$/.test(e))return Number(e);let t=/^(?:(\d+)h)?\s*(?:(\d+)m)?\s*(?:(\d+)s)?$/.exec(e);if(!(!t||!t[1]&&!t[2]&&!t[3]))return Number(t[1]??0)*3600+Number(t[2]??0)*60+Number(t[3]??0)}function ve(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return;let t=[],n,s,i,o,B,a,l,c,u,f,d,h,p,k,D,m,b,w,R=Object.create(null),y=!1,T=!1;for(let v=1;v<e.length;v++){let E=e[v];if(/^(---|\.\.\.)\s*$/.test(E))return{params:t,...n?{mode:n}:{},...s!==void 0?{timeoutSeconds:s}:{},...i!==void 0?{cwd:i}:{},...o?{shell:o}:{},...B?{incident:B}:{},...a?{severity:a}:{},...l||B?{evidence:!0}:{},...c!==void 0?{rtoSeconds:c}:{},...u?{practice:u}:{},...f?{drill:f}:{},...d?{kubeContext:d}:{},...h?{kubeContextMode:h}:{},...p?{gitBashPathConversion:p}:{},...k?{manualSteps:k}:{},...Object.keys(R).length>0?{env:R}:{},...D?{reportRuns:D}:{},...m?{reportRunsRequired:m}:{},...b?{reportRunsSigned:b}:{},...w?{reportRunsToken:w}:{}};if(E.trim()===""||E.trim().startsWith("#"))continue;if(!/^\s/.test(E)&&!E.startsWith("-")){y=/^params\s*:\s*$/.test(E),T=/^env\s*:\s*(#.*)?$/i.test(E);let W=/^mode\s*:\s*["']?(session|isolated)["']?\s*(#.*)?$/i.exec(E);W&&(n=W[1].toLowerCase());let ee=/^timeout\s*:\s*["']?(\d+(?:\.\d+)?)s?["']?\s*(#.*)?$/i.exec(E);ee&&(s=Number(ee[1]));let q=/^cwd\s*:\s*(.*?)\s*$/i.exec(E);q&&q[1]!==""&&(i=ui(q[1].replace(/\s+#.*$/,"")));let se=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(E);if(se){let{shells:Q}=Ur(se[1]);(Q.unix||Q.powershell)&&(o={...Q,...o})}let te=Q=>{let z=new RegExp(`^${Q}\\s*:\\s*(.*?)\\s*$`,"i").exec(E)?.[1];return z===void 0||z===""?void 0:ui(z.replace(/\s+#.*$/,""))};B=te("incident")??B,a=te("severity")??a,u=te("practice")??u;let ye=te("drill");ye!==void 0&&(f=/^(true|yes|on)$/i.test(ye));let ge=te("evidence");ge!==void 0&&(l=/^(true|yes|on)$/i.test(ge));let Je=te("rto");Je!==void 0&&(c=wp(Je)??c);let De=te("kube-context");De!==void 0&&Bi(De)&&(d=De);let be=te("kube-context-mode")?.toLowerCase();be!==void 0&&Qu.includes(be)&&(h=be);let F=te("git-bash-path-conversion")?.toLowerCase();(F==="on"||F==="off")&&(p=F);let M=te("manual-steps")?.toLowerCase();(M==="pause"||M==="continue")&&(k=M);let A=te("report-runs");A!==void 0&&D===void 0&&zt(A)===void 0&&(D=A);let G=te("report-runs-required");G!==void 0&&(m=/^(true|yes|on)$/i.test(G));let H=te("report-runs-signed");H!==void 0&&(b=/^(true|yes|on)$/i.test(H));let J=/^report-runs-token\s*:\s*["']?\$\{secret:([A-Za-z_][A-Za-z0-9_]*)\}["']?\s*(#.*)?$/i.exec(E);J&&(w=J[1]);continue}if(T){let W=Ho.exec(E);W&&!(W[1]in R)&&(R[W[1]]=Dp(W[2]??""));continue}if(!y)continue;let S=/^\s*-\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*:(?:\s+(.*?)|\s*)|\s+(#.*)|)\s*$/.exec(E);if(!S)continue;let O=S[1];if(t.some(W=>W.name===O))continue;let{value:P,comment:X}=Xu(S[2]??S[3]??""),Y=/^["']/.test(S[2]?.trim()??"");t.push({name:O,...P!==""||Y?{default:P}:{},...X!==void 0?Ep(X):{}})}}var _o=100,nl=36e5,es=class{constructor(e,t){this.source=e;this.flags=t;let n=0;t.includes("i")&&(n|=pr.CASE_INSENSITIVE),t.includes("m")&&(n|=pr.MULTILINE),t.includes("s")&&(n|=pr.DOTALL);try{this.re=pr.compile(e,n)}catch(s){let i=s instanceof Error?s.message:String(s);throw new Error(`invalid regular expression /${e}/${t}: ${i} (look-around and back-references are not supported)`)}}source;flags;re;exec(e){let t=this.re.matcher(e);if(!t.find())return null;let n=[];for(let s=0;s<=t.groupCount();s++)n.push(t.group(s)??void 0);return n}toString(){return`/${this.source}/${this.flags}`}},kp=/^\/([\s\S]*)\/([imsu]*)$/;function Uo(r){let e=Xe(r).find(n=>n.secret);if(e)throw new Error(`a check can't use the secret ${e.kind==="secret"?`\${secret:${e.name}}`:`\${input:${e.name}}`}: its text is shown when it fails`);let t=kp.exec(r);return t?(Xe(t[1]).length>0&&new es(Mn(t[1],()=>"(?:x)"),t[2]),{kind:"regex",re:new es(t[1],t[2])}):{kind:"text",text:r}}function Jo(r){return[r?.expect,r?.expectNot].filter(e=>e!==void 0).map(e=>e.kind==="text"?e.text:e.re.source).join(`
86
- `)}function xp(r){return Xe(Jo(r))}function rl(r,e,t=()=>!1){let n=(B,a,l)=>{let c=e[a];if(c===void 0)throw new Error(`\${${B}:${a}} in a check has no value`);if(t(a))throw new Error(`a check can't use \${${B}:${a}}: it is a secret value, and a check's text is shown when it fails`);return l(c)},s=B=>{if(B===void 0)return;if(B.kind==="text")return{kind:"text",text:Mn(B.text,(l,c)=>n(l,c,u=>u))};let a=Mn(B.re.source,(l,c)=>n(l,c,u=>`(?:${pr.quote(u)})`));return a===B.re.source?B:{kind:"regex",re:new es(a,B.re.flags)}};if(xp(r).length===0)return r;let i=s(r.expect),o=s(r.expectNot);return{...r,...i?{expect:i}:{},...o?{expectNot:o}:{}}}function li(r){return r.kind==="text"?JSON.stringify(r.text):String(r.re)}function sl(r,e){let t=r.indexOf(":"),n=t<0?r:r.slice(0,t);if(!$t.test(n))throw new Error("expected a variable name (letters, digits, _)");if(t<0)return{name:n,secret:e};let s=Uo(r.slice(t+1));if(s.kind!=="regex")throw new Error("expected NAME or NAME:/regex/");return{name:n,pattern:s.re,secret:e}}function il(r){return!!r&&(r.expect!==void 0||r.expectNot!==void 0||r.expectExit!==void 0||r.captures.length>0)}var el=r=>Ot(r).replace(/\r\n?/g,`
87
- `);function tl(r,e){return r.kind==="text"?e.includes(r.text):r.re.exec(e)!==null}function ol(r,e,t,n){let s=[],i=r.expectExit??0,o=e===i;!o&&r.expectExit!==void 0&&s.push(`exit code ${e}, expected ${i}`);let B=el(t);r.expect&&!tl(r.expect,B)&&(o=!1,s.push(r.expect.kind==="text"?`the output does not contain ${li(r.expect)}`:`the output does not match ${li(r.expect)}`)),r.expectNot&&tl(r.expectNot,B)&&(o=!1,s.push(r.expectNot.kind==="text"?`the output contains ${li(r.expectNot)}`:`the output matches ${li(r.expectNot)}`));let a=[],l=[];if(o){let c=el(n);for(let u of r.captures){let f;if(u.pattern){let d=u.pattern.exec(c);f=d?d[1]??d[0]:void 0,f===void 0&&s.push(`capture ${u.name}: nothing in the output matches ${String(u.pattern)}`)}else f=c.trim(),f===""&&(s.push(`capture ${u.name}: the cell printed nothing`),f=void 0);f!==void 0&&a.push({name:u.name,value:f,secret:u.secret}),f!==void 0&&u.secret&&l.push(f)}a.length<r.captures.length&&(o=!1,a.length=0)}return{ok:o,failures:s,captured:a,secretValues:l}}var vp={h:36e5,m:6e4,s:1e3,ms:1};function jo(r){let e=r.trim();if(/^\d+(?:\.\d+)?$/.test(e))return Math.round(Number(e)*1e3);if(!/^(?:\d+(?:\.\d+)?(?:ms|h|m|s))+$/i.test(e))return;let t=0,n=1/0;for(let[,s,i]of e.matchAll(/(\d+(?:\.\d+)?)(ms|h|m|s)/gi)){let o=vp[i.toLowerCase()];if(o>=n)return;n=o,t+=Number(s)*o}return Math.round(t)}var yp={windows:"windows",win:"windows",win32:"windows",linux:"linux",macos:"macos",mac:"macos",osx:"macos",darwin:"macos"},Sp={windows:"Windows",linux:"Linux",macos:"macOS"};function Bl(r){let e=[];for(let t of r.split(",").map(n=>n.trim().toLowerCase())){let n=yp[t];if(!n)return`unknown OS "${t}" (expected windows, linux or macos)`;e.includes(n)||e.push(n)}return e.length>0?e:"expected windows, linux or macos"}function Gn(r=process.platform){return r==="win32"?"windows":r==="darwin"?"macos":"linux"}function Cr(r){return r.map(e=>Sp[e]).join(", ")}function Pn(r,e=Gn()){let t=-1,n=new Set,s=!1;return r.map((i,o)=>{if(i.kind!=="markup"){if(!i.os){s=!1;return}(!s||i.os.some(B=>n.has(B)))&&(t=o,n=new Set),s=!0;for(let B of i.os)n.add(B);return{group:t,active:i.os.includes(e)}}})}function Bn(r){let e=Pn(r),t=new Map,n=0;return r.map((s,i)=>{if(s.kind!=="code")return;let o=e[i];return o&&t.has(o.group)?t.get(o.group):(n++,o&&t.set(o.group,n),n)})}var Ko=r=>r===" "||r===" ";function an(r){let e=[],t=r.length,n=0;for(;n<t;){for(;n<t&&Ko(r[n]);)n++;if(n>=t)break;if(r[n]==="{"){let a=r.indexOf("}",n);n=a<0?t:a+1;continue}let s=n;for(;n<t&&!Ko(r[n])&&r[n]!=="=";)n++;let i=r.slice(s,n);if(r[n]!=="="){e.push({key:i,start:s,end:n});continue}n++;let o=r[n],B;if(o==='"'||o==="'"){let a=r.indexOf(o,n+1);B=r.slice(n+1,a<0?t:a),n=a<0?t:a+1}else{let a=n;for(;n<t&&!Ko(r[n]);)n++;B=r.slice(a,n)}i!==""&&e.push({key:i,value:B,start:s,end:n})}return e}var Rp=/^\s*[^\s{]*/;function gr(r,e,t){let n=me(e),s=[Jo(n.checks),Yu(Xr(n,t))].filter(i=>i!=="");return Xe([r,...s].join(`
88
- `))}function me(r){let e={env:{},errors:[]},t=()=>e.checks??={captures:[]},n;for(let{key:s,value:i}of an(r.replace(Rp,""))){let o=s.toLowerCase();if(i===void 0)o==="continue-on-error"?e.continueOnError=!0:o==="skip"?e.skip=!0:o==="confirm"?e.confirm=!0:o==="no-confirm"?e.confirm=!1:o==="terminal"?e.terminal=!0:(o==="setup"||o==="teardown"||o==="ready")&&(e.part!==void 0&&e.part!==o?e.errors.push(`${o}: a block is only one of setup, teardown and ready (it is already ${e.part})`):e.part=o);else if(o==="timeout"){let B=Number(i.replace(/s$/i,""));i.trim()===""||!Number.isFinite(B)||B<0?e.errors.push(`timeout=${i}: expected seconds (0 = none)`):e.timeoutSeconds=B}else if(o==="estimate"){let B=jo(i);B===void 0?e.errors.push(`estimate=${i}: expected a duration such as 2m30s, 45s or 90 (seconds)`):e.estimateSeconds=B/1e3}else if(o==="cwd")i===""?e.errors.push("cwd: empty path"):e.cwd=i;else if(o==="name")e.name=i;else if(o==="on-failure")i.trim()===""?e.errors.push("on-failure: empty step name"):e.onFailure=i.trim();else if(o==="expect"||o==="expect-not")try{t()[o==="expect"?"expect":"expectNot"]=Uo(i)}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="expect-exit")/^-?\d+$/.test(i.trim())?t().expectExit=Number(i):e.errors.push(`expect-exit=${i}: expected an exit code`);else if(o==="capture"||o==="capture-secret")try{t().captures.push(sl(i,o==="capture-secret"))}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="os"){let B=Bl(i);typeof B=="string"?e.errors.push(`os=${i}: ${B}`):e.os=B}else if(o==="host")i.trim()===""?e.errors.push("host: empty name"):e.host=i.trim();else if(o==="kube-context")Bi(i.trim())?e.kubeContext=i.trim():e.errors.push(`kube-context=${i}: expected a Kubernetes context name or \${param:NAME}`);else if(o==="lines")i.toLowerCase()!=="any"?e.errors.push(`lines=${i}: expected lines=any`):e.lines="any";else if(o==="retry"){let B=Number(i);!Number.isInteger(B)||B<1||B>_o?e.errors.push(`retry=${i}: expected the number of attempts (1 to ${_o})`):e.retry={attempts:B,everyMs:5e3}}else o==="every"?(n=jo(i),n===void 0?e.errors.push(`every=${i}: expected a duration such as 15s, 500ms or 2m`):n>nl&&e.errors.push(`every=${i}: at most 1h`)):o.startsWith("env.")&&s.length>4&&(e.env[s.slice(4)]=i)}return e.retry&&n!==void 0&&(e.retry.everyMs=n),e}var Op=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/;function Hn(r){let e=yn(r.replace(/^/,"")).map(s=>s.text),t=[],n=0;if(e[0]?.trimEnd()==="---"){let s=e.findIndex((i,o)=>o>0&&/^(---|\.\.\.)\s*$/.test(i));s>0&&(n=s+1)}for(;n<e.length;n++){let s=_e(e[n]);if(s){for(;n+1<e.length&&!Ke(e[n+1],s);)n++;n++;continue}let i=Op.exec(e[n]);if(!i)continue;let o=(i[2]??"").replace(/(^|[ \t]+)#+$/,"").trim();t.push({line:n,level:i[1].length,text:o})}return t}function ci(r,e){return e.filter(t=>!r.some(n=>n.text.startsWith(t)))}function fi(r,e){if(r.length<2)return;let t=Math.min(...r.map(B=>B.level)),n=r.filter(B=>B.level===t);if(n.length!==1)return;let s=n[0],i=e.find(B=>s.text.startsWith(B));if(i===void 0)return;let o=r.find(B=>B!==s&&B.text.startsWith(i))?.text;return{section:i,title:s.text,...o!==void 0?{other:o}:{}}}function _n(r,e){return t=>{let n=[];for(let s of r){if(s.line>=t)break;for(;n.length>0&&n[n.length-1].level>=s.level;)n.pop();n.push(s)}return n.some(s=>e.some(i=>s.text.startsWith(i)))}}var Ap="runbook",mr=3,al=new Set(["src","section"]),ul=new Set(["cwd","expect","expect-not","expect-exit","capture","capture-secret","retry","every","terminal","host","lines","os"]);function Ge(r){return r===Ap}function $p(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.slice(1,-1):r}function et(r,e){let t={sections:[],args:[],problems:[]};for(let n of an(r.replace(/^\s*[^\s{]*/,""))){let s=n.key.toLowerCase();s==="src"?n.value===void 0||n.value.trim()===""?t.problems.push({message:"src= is empty: give the runbook to run, relative to this file"}):t.src=n.value.trim():s==="section"&&(n.value===void 0||n.value.trim()===""?t.problems.push({message:"section= is empty: give the start of a heading of the runbook called"}):t.sections.push(n.value.trim()))}if(t.src===void 0&&!t.problems.some(n=>n.message.startsWith("src="))&&t.problems.push({message:"a runbook call needs src=, the runbook to run (relative to this file)"}),t.src!==void 0)try{for(let n of Xe(t.src))(n.kind==="input"||n.kind==="secret")&&t.problems.push({message:`src= can't use \${${n.kind}:${n.name}}: use \${param:NAME} or \${out:NAME}`})}catch(n){t.problems.push({message:`src=: ${n instanceof Error?n.message:String(n)}`})}return e.split(/\r?\n/).forEach((n,s)=>{let i=n.trim();if(i===""||i.startsWith("#"))return;let o=i.indexOf("="),B=o<0?i:i.slice(0,o).trim();if(o<0||!$t.test(B)){t.problems.push({line:s,message:`"${i}": expected NAME=value, a parameter of the runbook called (NAME letters, digits and _)`});return}if(t.args.some(a=>a.name===B)){t.problems.push({line:s,message:`${B} is passed twice: the first one counts`});return}t.args.push({name:B,value:$p(i.slice(o+1).trim()),line:s})}),t}function Gt(r){return Xe([r.src??"",...r.args.map(e=>e.value)].join(`
89
- `))}function di(r,e){let t,n=Mn(r,(s,i)=>{let o=e(s,i);return o===void 0&&(t??={kind:s,name:i}),o??""});return t?{missing:t}:{text:n}}function Er(r){return/\$\{(param|out|input|secret):/.test(r)}function ll(r){return Mn(r,()=>"*")}function Fp(r){let e=ve(r)?.params??[],t=new Set;for(let n of r.matchAll(/\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}/g))t.add(n[1]);return{declared:e,used:t}}function pi(r,e){let{declared:t,used:n}=Fp(e),s=new Set([...t.map(d=>d.name),...n]),i=new Set(r.args.map(d=>d.name)),o=new Set(t.filter(d=>d.default!==void 0).map(d=>d.name)),B=Hn(e),a=ci(B,r.sections),l=fi(B,r.sections),c=ft(he(e)).map(d=>d.line),u=jr(e);return{manualOnly:r.sections.filter(d=>{if(a.includes(d))return!1;let h=_n(B,[d]);return!c.some(h)&&u.some(p=>h(p.line))}),unknown:r.args.filter(d=>!s.has(d.name)),notPassed:[...s].filter(d=>!i.has(d)&&!o.has(d)),sections:[...a.map(d=>`section="${d}": no heading of the runbook called starts with it`),...l?[`section="${l.section}" matches the title "${l.title}", which holds every step${l.other?`; for "${l.other}", give more of it`:""}`]:[]]}}function zo(r){let e=ve(r);return e?{...e.incident?{incident:e.incident}:{},...e.severity?{severity:e.severity}:{},...e.evidence?{evidence:"true"}:{},...e.drill?{drill:"true"}:{},...e.rtoSeconds!==void 0?{rto:`${e.rtoSeconds}s`}:{}}:{}}function ts(r){let e=[`${r.done} done`];return r.skipped&&e.push(`${r.skipped} skipped`),r.failed&&e.push(`${r.failed} failed`),r.notRun&&e.push(`${r.notRun} not run`),r.manual&&e.push(`${r.manual} manual not ticked`),e.join(", ")}function cl(r){return{runbook:r.runbook,copy:r.copy,sha256:r.sha256,steps:ts(r)}}function fl(r,e){let t=e.length?` (section${e.length===1?"":"s"} ${e.map(n=>`"${n}"`).join(", ")})`:"";return`[md-runbook] ran ${r.runbook}${t} as ${r.copy}
85
+ `;return mp+s+n}function Ep(r){let e=r.trim(),t=/(?:^|\s|\()one of:\s*((?:[^.()]|\.(?=\S))*?)\s*\)?\s*\.?\s*$/i.exec(e),n=t?[...new Set(t[1].split(/\s*,\s*(?:or\s+)?|\s+or\s+/i).map(i=>ui(i.trim())).filter(i=>i!==""))]:[];if(!t||n.length===0)return e!==""?{description:e}:{};let s=e.slice(0,t.index).replace(/[\s,;:(-]+$/,"");return{...s!==""?{description:s}:{},choices:n}}function ui(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.startsWith('"')?r.slice(1,-1).replace(/\\(["\\])/g,"$1"):r.slice(1,-1).replace(/''/g,"'"):r}function zt(r){let e=/^([a-z]+):\/\/([^/?#\s]*)([/?#][^\s]*)?$/i.exec(r);if(!e)return"not an address (expected https://host/path)";let t=e[1].toLowerCase(),n=e[2];if(n.includes("@"))return"no user name or password in the address (use report-runs-token: ${secret:NAME})";let s=/^(\[[0-9A-Fa-f:.]+\]|[A-Za-z0-9.-]+)(?::(\d{1,5}))?$/.exec(n);if(!s||s[1]===""||s[1].startsWith(".")||s[1].endsWith("-"))return`"${n}" is not a host name`;if(t!=="https")return t==="http"?bp(s[1])?void 0:"http is only for localhost: use https":`${t}: is not https`}var bp=r=>/^(localhost|127(\.\d{1,3}){3}|\[::1\])$/i.test(r);function Xu(r){let e=r.trim(),t=/^("(?:[^"\\]|\\.)*"|'(?:[^']|'')*')\s*(?:#(.*))?$/.exec(e);if(t)return{value:ui(t[1]),...t[2]!==void 0?{comment:t[2].trim()}:{}};if(e.startsWith("#"))return{value:"",comment:e.slice(1).trim()};let n=/\s+#(.*)$/.exec(e);return n?{value:e.slice(0,n.index),comment:n[1].trim()}:{value:e}}function Dp(r){return Xu(r).value}var Ho=/^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:(?:\s+(.*?))?\s*$/;function wp(r){let e=r.trim().toLowerCase();if(/^\d+(?:\.\d+)?$/.test(e))return Number(e);let t=/^(?:(\d+)h)?\s*(?:(\d+)m)?\s*(?:(\d+)s)?$/.exec(e);if(!(!t||!t[1]&&!t[2]&&!t[3]))return Number(t[1]??0)*3600+Number(t[2]??0)*60+Number(t[3]??0)}function ve(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return;let t=[],n,s,i,o,B,a,l,c,u,f,d,h,p,k,D,m,b,w,R=Object.create(null),y=!1,T=!1;for(let v=1;v<e.length;v++){let E=e[v];if(/^(---|\.\.\.)\s*$/.test(E))return{params:t,...n?{mode:n}:{},...s!==void 0?{timeoutSeconds:s}:{},...i!==void 0?{cwd:i}:{},...o?{shell:o}:{},...B?{incident:B}:{},...a?{severity:a}:{},...l||B?{evidence:!0}:{},...c!==void 0?{rtoSeconds:c}:{},...u?{practice:u}:{},...f?{drill:f}:{},...d?{kubeContext:d}:{},...h?{kubeContextMode:h}:{},...p?{gitBashPathConversion:p}:{},...k?{manualSteps:k}:{},...Object.keys(R).length>0?{env:R}:{},...D?{reportRuns:D}:{},...m?{reportRunsRequired:m}:{},...b?{reportRunsSigned:b}:{},...w?{reportRunsToken:w}:{}};if(E.trim()===""||E.trim().startsWith("#"))continue;if(!/^\s/.test(E)&&!E.startsWith("-")){y=/^params\s*:\s*$/.test(E),T=/^env\s*:\s*(#.*)?$/i.test(E);let W=/^mode\s*:\s*["']?(session|isolated)["']?\s*(#.*)?$/i.exec(E);W&&(n=W[1].toLowerCase());let ee=/^timeout\s*:\s*["']?(\d+(?:\.\d+)?)s?["']?\s*(#.*)?$/i.exec(E);ee&&(s=Number(ee[1]));let Y=/^cwd\s*:\s*(.*?)\s*$/i.exec(E);Y&&Y[1]!==""&&(i=ui(Y[1].replace(/\s+#.*$/,"")));let se=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(E);if(se){let{shells:Q}=Ur(se[1]);(Q.unix||Q.powershell)&&(o={...Q,...o})}let te=Q=>{let z=new RegExp(`^${Q}\\s*:\\s*(.*?)\\s*$`,"i").exec(E)?.[1];return z===void 0||z===""?void 0:ui(z.replace(/\s+#.*$/,""))};B=te("incident")??B,a=te("severity")??a,u=te("practice")??u;let ye=te("drill");ye!==void 0&&(f=/^(true|yes|on)$/i.test(ye));let ge=te("evidence");ge!==void 0&&(l=/^(true|yes|on)$/i.test(ge));let Je=te("rto");Je!==void 0&&(c=wp(Je)??c);let De=te("kube-context");De!==void 0&&Bi(De)&&(d=De);let be=te("kube-context-mode")?.toLowerCase();be!==void 0&&Qu.includes(be)&&(h=be);let $=te("git-bash-path-conversion")?.toLowerCase();($==="on"||$==="off")&&(p=$);let M=te("manual-steps")?.toLowerCase();(M==="pause"||M==="continue")&&(k=M);let A=te("report-runs");A!==void 0&&D===void 0&&zt(A)===void 0&&(D=A);let G=te("report-runs-required");G!==void 0&&(m=/^(true|yes|on)$/i.test(G));let H=te("report-runs-signed");H!==void 0&&(b=/^(true|yes|on)$/i.test(H));let J=/^report-runs-token\s*:\s*["']?\$\{secret:([A-Za-z_][A-Za-z0-9_]*)\}["']?\s*(#.*)?$/i.exec(E);J&&(w=J[1]);continue}if(T){let W=Ho.exec(E);W&&!(W[1]in R)&&(R[W[1]]=Dp(W[2]??""));continue}if(!y)continue;let S=/^\s*-\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*:(?:\s+(.*?)|\s*)|\s+(#.*)|)\s*$/.exec(E);if(!S)continue;let O=S[1];if(t.some(W=>W.name===O))continue;let{value:P,comment:X}=Xu(S[2]??S[3]??""),q=/^["']/.test(S[2]?.trim()??"");t.push({name:O,...P!==""||q?{default:P}:{},...X!==void 0?Ep(X):{}})}}var _o=100,nl=36e5,es=class{constructor(e,t){this.source=e;this.flags=t;let n=0;t.includes("i")&&(n|=pr.CASE_INSENSITIVE),t.includes("m")&&(n|=pr.MULTILINE),t.includes("s")&&(n|=pr.DOTALL);try{this.re=pr.compile(e,n)}catch(s){let i=s instanceof Error?s.message:String(s);throw new Error(`invalid regular expression /${e}/${t}: ${i} (look-around and back-references are not supported)`)}}source;flags;re;exec(e){let t=this.re.matcher(e);if(!t.find())return null;let n=[];for(let s=0;s<=t.groupCount();s++)n.push(t.group(s)??void 0);return n}toString(){return`/${this.source}/${this.flags}`}},kp=/^\/([\s\S]*)\/([imsu]*)$/;function Uo(r){let e=Xe(r).find(n=>n.secret);if(e)throw new Error(`a check can't use the secret ${e.kind==="secret"?`\${secret:${e.name}}`:`\${input:${e.name}}`}: its text is shown when it fails`);let t=kp.exec(r);return t?(Xe(t[1]).length>0&&new es(Mn(t[1],()=>"(?:x)"),t[2]),{kind:"regex",re:new es(t[1],t[2])}):{kind:"text",text:r}}function Jo(r){return[r?.expect,r?.expectNot].filter(e=>e!==void 0).map(e=>e.kind==="text"?e.text:e.re.source).join(`
86
+ `)}function xp(r){return Xe(Jo(r))}function rl(r,e,t=()=>!1){let n=(B,a,l)=>{let c=e[a];if(c===void 0)throw new Error(`\${${B}:${a}} in a check has no value`);if(t(a))throw new Error(`a check can't use \${${B}:${a}}: it is a secret value, and a check's text is shown when it fails`);return l(c)},s=B=>{if(B===void 0)return;if(B.kind==="text")return{kind:"text",text:Mn(B.text,(l,c)=>n(l,c,u=>u))};let a=Mn(B.re.source,(l,c)=>n(l,c,u=>`(?:${pr.quote(u)})`));return a===B.re.source?B:{kind:"regex",re:new es(a,B.re.flags)}};if(xp(r).length===0)return r;let i=s(r.expect),o=s(r.expectNot);return{...r,...i?{expect:i}:{},...o?{expectNot:o}:{}}}function li(r){return r.kind==="text"?JSON.stringify(r.text):String(r.re)}function sl(r,e){let t=r.indexOf(":"),n=t<0?r:r.slice(0,t);if(!Ft.test(n))throw new Error("expected a variable name (letters, digits, _)");if(t<0)return{name:n,secret:e};let s=Uo(r.slice(t+1));if(s.kind!=="regex")throw new Error("expected NAME or NAME:/regex/");return{name:n,pattern:s.re,secret:e}}function il(r){return!!r&&(r.expect!==void 0||r.expectNot!==void 0||r.expectExit!==void 0||r.captures.length>0)}var el=r=>Ot(r).replace(/\r\n?/g,`
87
+ `);function tl(r,e){return r.kind==="text"?e.includes(r.text):r.re.exec(e)!==null}function ol(r,e,t,n){let s=[],i=r.expectExit??0,o=e===i;!o&&r.expectExit!==void 0&&s.push(`exit code ${e}, expected ${i}`);let B=el(t);r.expect&&!tl(r.expect,B)&&(o=!1,s.push(r.expect.kind==="text"?`the output does not contain ${li(r.expect)}`:`the output does not match ${li(r.expect)}`)),r.expectNot&&tl(r.expectNot,B)&&(o=!1,s.push(r.expectNot.kind==="text"?`the output contains ${li(r.expectNot)}`:`the output matches ${li(r.expectNot)}`));let a=[],l=[];if(o){let c=el(n);for(let u of r.captures){let f;if(u.pattern){let d=u.pattern.exec(c);f=d?d[1]??d[0]:void 0,f===void 0&&s.push(`capture ${u.name}: nothing in the output matches ${String(u.pattern)}`)}else f=c.trim(),f===""&&(s.push(`capture ${u.name}: the cell printed nothing`),f=void 0);f!==void 0&&a.push({name:u.name,value:f,secret:u.secret}),f!==void 0&&u.secret&&l.push(f)}a.length<r.captures.length&&(o=!1,a.length=0)}return{ok:o,failures:s,captured:a,secretValues:l}}var vp={h:36e5,m:6e4,s:1e3,ms:1};function jo(r){let e=r.trim();if(/^\d+(?:\.\d+)?$/.test(e))return Math.round(Number(e)*1e3);if(!/^(?:\d+(?:\.\d+)?(?:ms|h|m|s))+$/i.test(e))return;let t=0,n=1/0;for(let[,s,i]of e.matchAll(/(\d+(?:\.\d+)?)(ms|h|m|s)/gi)){let o=vp[i.toLowerCase()];if(o>=n)return;n=o,t+=Number(s)*o}return Math.round(t)}var yp={windows:"windows",win:"windows",win32:"windows",linux:"linux",macos:"macos",mac:"macos",osx:"macos",darwin:"macos"},Sp={windows:"Windows",linux:"Linux",macos:"macOS"};function Bl(r){let e=[];for(let t of r.split(",").map(n=>n.trim().toLowerCase())){let n=yp[t];if(!n)return`unknown OS "${t}" (expected windows, linux or macos)`;e.includes(n)||e.push(n)}return e.length>0?e:"expected windows, linux or macos"}function Gn(r=process.platform){return r==="win32"?"windows":r==="darwin"?"macos":"linux"}function Cr(r){return r.map(e=>Sp[e]).join(", ")}function Pn(r,e=Gn()){let t=-1,n=new Set,s=!1;return r.map((i,o)=>{if(i.kind!=="markup"){if(!i.os){s=!1;return}(!s||i.os.some(B=>n.has(B)))&&(t=o,n=new Set),s=!0;for(let B of i.os)n.add(B);return{group:t,active:i.os.includes(e)}}})}function Bn(r){let e=Pn(r),t=new Map,n=0;return r.map((s,i)=>{if(s.kind!=="code")return;let o=e[i];return o&&t.has(o.group)?t.get(o.group):(n++,o&&t.set(o.group,n),n)})}var Ko=r=>r===" "||r===" ";function an(r){let e=[],t=r.length,n=0;for(;n<t;){for(;n<t&&Ko(r[n]);)n++;if(n>=t)break;if(r[n]==="{"){let a=r.indexOf("}",n);n=a<0?t:a+1;continue}let s=n;for(;n<t&&!Ko(r[n])&&r[n]!=="=";)n++;let i=r.slice(s,n);if(r[n]!=="="){e.push({key:i,start:s,end:n});continue}n++;let o=r[n],B;if(o==='"'||o==="'"){let a=r.indexOf(o,n+1);B=r.slice(n+1,a<0?t:a),n=a<0?t:a+1}else{let a=n;for(;n<t&&!Ko(r[n]);)n++;B=r.slice(a,n)}i!==""&&e.push({key:i,value:B,start:s,end:n})}return e}var Rp=/^\s*[^\s{]*/;function gr(r,e,t){let n=me(e),s=[Jo(n.checks),qu(Xr(n,t))].filter(i=>i!=="");return Xe([r,...s].join(`
88
+ `))}function me(r){let e={env:{},errors:[]},t=()=>e.checks??={captures:[]},n;for(let{key:s,value:i}of an(r.replace(Rp,""))){let o=s.toLowerCase();if(i===void 0)o==="continue-on-error"?e.continueOnError=!0:o==="skip"?e.skip=!0:o==="confirm"?e.confirm=!0:o==="no-confirm"?e.confirm=!1:o==="terminal"?e.terminal=!0:(o==="setup"||o==="teardown"||o==="ready")&&(e.part!==void 0&&e.part!==o?e.errors.push(`${o}: a block is only one of setup, teardown and ready (it is already ${e.part})`):e.part=o);else if(o==="timeout"){let B=Number(i.replace(/s$/i,""));i.trim()===""||!Number.isFinite(B)||B<0?e.errors.push(`timeout=${i}: expected seconds (0 = none)`):e.timeoutSeconds=B}else if(o==="estimate"){let B=jo(i);B===void 0?e.errors.push(`estimate=${i}: expected a duration such as 2m30s, 45s or 90 (seconds)`):e.estimateSeconds=B/1e3}else if(o==="cwd")i===""?e.errors.push("cwd: empty path"):e.cwd=i;else if(o==="name")e.name=i;else if(o==="on-failure")i.trim()===""?e.errors.push("on-failure: empty step name"):e.onFailure=i.trim();else if(o==="expect"||o==="expect-not")try{t()[o==="expect"?"expect":"expectNot"]=Uo(i)}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="expect-exit")/^-?\d+$/.test(i.trim())?t().expectExit=Number(i):e.errors.push(`expect-exit=${i}: expected an exit code`);else if(o==="capture"||o==="capture-secret")try{t().captures.push(sl(i,o==="capture-secret"))}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="os"){let B=Bl(i);typeof B=="string"?e.errors.push(`os=${i}: ${B}`):e.os=B}else if(o==="host")i.trim()===""?e.errors.push("host: empty name"):e.host=i.trim();else if(o==="kube-context")Bi(i.trim())?e.kubeContext=i.trim():e.errors.push(`kube-context=${i}: expected a Kubernetes context name or \${param:NAME}`);else if(o==="lines")i.toLowerCase()!=="any"?e.errors.push(`lines=${i}: expected lines=any`):e.lines="any";else if(o==="retry"){let B=Number(i);!Number.isInteger(B)||B<1||B>_o?e.errors.push(`retry=${i}: expected the number of attempts (1 to ${_o})`):e.retry={attempts:B,everyMs:5e3}}else o==="every"?(n=jo(i),n===void 0?e.errors.push(`every=${i}: expected a duration such as 15s, 500ms or 2m`):n>nl&&e.errors.push(`every=${i}: at most 1h`)):o.startsWith("env.")&&s.length>4&&(e.env[s.slice(4)]=i)}return e.retry&&n!==void 0&&(e.retry.everyMs=n),e}var Op=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/;function Hn(r){let e=yn(r.replace(/^/,"")).map(s=>s.text),t=[],n=0;if(e[0]?.trimEnd()==="---"){let s=e.findIndex((i,o)=>o>0&&/^(---|\.\.\.)\s*$/.test(i));s>0&&(n=s+1)}for(;n<e.length;n++){let s=_e(e[n]);if(s){for(;n+1<e.length&&!Ke(e[n+1],s);)n++;n++;continue}let i=Op.exec(e[n]);if(!i)continue;let o=(i[2]??"").replace(/(^|[ \t]+)#+$/,"").trim();t.push({line:n,level:i[1].length,text:o})}return t}function ci(r,e){return e.filter(t=>!r.some(n=>n.text.startsWith(t)))}function fi(r,e){if(r.length<2)return;let t=Math.min(...r.map(B=>B.level)),n=r.filter(B=>B.level===t);if(n.length!==1)return;let s=n[0],i=e.find(B=>s.text.startsWith(B));if(i===void 0)return;let o=r.find(B=>B!==s&&B.text.startsWith(i))?.text;return{section:i,title:s.text,...o!==void 0?{other:o}:{}}}function _n(r,e){return t=>{let n=[];for(let s of r){if(s.line>=t)break;for(;n.length>0&&n[n.length-1].level>=s.level;)n.pop();n.push(s)}return n.some(s=>e.some(i=>s.text.startsWith(i)))}}var Ap="runbook",mr=3,al=new Set(["src","section"]),ul=new Set(["cwd","expect","expect-not","expect-exit","capture","capture-secret","retry","every","terminal","host","lines","os"]);function Ge(r){return r===Ap}function Fp(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.slice(1,-1):r}function et(r,e){let t={sections:[],args:[],problems:[]};for(let n of an(r.replace(/^\s*[^\s{]*/,""))){let s=n.key.toLowerCase();s==="src"?n.value===void 0||n.value.trim()===""?t.problems.push({message:"src= is empty: give the runbook to run, relative to this file"}):t.src=n.value.trim():s==="section"&&(n.value===void 0||n.value.trim()===""?t.problems.push({message:"section= is empty: give the start of a heading of the runbook called"}):t.sections.push(n.value.trim()))}if(t.src===void 0&&!t.problems.some(n=>n.message.startsWith("src="))&&t.problems.push({message:"a runbook call needs src=, the runbook to run (relative to this file)"}),t.src!==void 0)try{for(let n of Xe(t.src))(n.kind==="input"||n.kind==="secret")&&t.problems.push({message:`src= can't use \${${n.kind}:${n.name}}: use \${param:NAME} or \${out:NAME}`})}catch(n){t.problems.push({message:`src=: ${n instanceof Error?n.message:String(n)}`})}return e.split(/\r?\n/).forEach((n,s)=>{let i=n.trim();if(i===""||i.startsWith("#"))return;let o=i.indexOf("="),B=o<0?i:i.slice(0,o).trim();if(o<0||!Ft.test(B)){t.problems.push({line:s,message:`"${i}": expected NAME=value, a parameter of the runbook called (NAME letters, digits and _)`});return}if(t.args.some(a=>a.name===B)){t.problems.push({line:s,message:`${B} is passed twice: the first one counts`});return}t.args.push({name:B,value:Fp(i.slice(o+1).trim()),line:s})}),t}function Gt(r){return Xe([r.src??"",...r.args.map(e=>e.value)].join(`
89
+ `))}function di(r,e){let t,n=Mn(r,(s,i)=>{let o=e(s,i);return o===void 0&&(t??={kind:s,name:i}),o??""});return t?{missing:t}:{text:n}}function Er(r){return/\$\{(param|out|input|secret):/.test(r)}function ll(r){return Mn(r,()=>"*")}function $p(r){let e=ve(r)?.params??[],t=new Set;for(let n of r.matchAll(/\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}/g))t.add(n[1]);return{declared:e,used:t}}function pi(r,e){let{declared:t,used:n}=$p(e),s=new Set([...t.map(d=>d.name),...n]),i=new Set(r.args.map(d=>d.name)),o=new Set(t.filter(d=>d.default!==void 0).map(d=>d.name)),B=Hn(e),a=ci(B,r.sections),l=fi(B,r.sections),c=ft(he(e)).map(d=>d.line),u=jr(e);return{manualOnly:r.sections.filter(d=>{if(a.includes(d))return!1;let h=_n(B,[d]);return!c.some(h)&&u.some(p=>h(p.line))}),unknown:r.args.filter(d=>!s.has(d.name)),notPassed:[...s].filter(d=>!i.has(d)&&!o.has(d)),sections:[...a.map(d=>`section="${d}": no heading of the runbook called starts with it`),...l?[`section="${l.section}" matches the title "${l.title}", which holds every step${l.other?`; for "${l.other}", give more of it`:""}`]:[]]}}function zo(r){let e=ve(r);return e?{...e.incident?{incident:e.incident}:{},...e.severity?{severity:e.severity}:{},...e.evidence?{evidence:"true"}:{},...e.drill?{drill:"true"}:{},...e.rtoSeconds!==void 0?{rto:`${e.rtoSeconds}s`}:{}}:{}}function ts(r){let e=[`${r.done} done`];return r.skipped&&e.push(`${r.skipped} skipped`),r.failed&&e.push(`${r.failed} failed`),r.notRun&&e.push(`${r.notRun} not run`),r.manual&&e.push(`${r.manual} manual not ticked`),e.join(", ")}function cl(r){return{runbook:r.runbook,copy:r.copy,sha256:r.sha256,steps:ts(r)}}function fl(r,e){let t=e.length?` (section${e.length===1?"":"s"} ${e.map(n=>`"${n}"`).join(", ")})`:"";return`[md-runbook] ran ${r.runbook}${t} as ${r.copy}
90
90
  [md-runbook] ${ts(r)} \xB7 sha256 ${r.sha256}
91
- `}function hi(r){if(!(!r?.copy||!r.runbook))return{runbook:r.runbook,copy:r.copy,...r.sha256?{sha256:r.sha256}:{},...r.exit?{exit:r.exit}:{}}}function dl(r,e,t=(n,s)=>n===s){let n=r.findIndex(s=>t(s,e));if(n>=0)return`a runbook call cycle: ${[...r.slice(n),e].join(" \u2192 ")}`;if(r.length>mr)return`runbook calls nest more than ${mr} deep: ${[...r,e].join(" \u2192 ")}`}function Ci(r){let e=/^?---[ \t]*\r?\n(?:[\s\S]*?\r?\n)?(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/.exec(r);return e?r.slice(e[0].length):r}function gi(r){let e=[],t;return r.split(/\r?\n/).forEach((n,s)=>{let i=/^ {0,3}(`{3,}|~{3,})/.exec(n)?.[1];if(t!==void 0){i&&i[0]===t[0]&&i.length>=t.length&&n.trim()===i&&(t=void 0);return}if(i){t=i;return}let o=/^ {0,3}(#{1,6})[ \t]+(.+?)(?:[ \t]+#+)?[ \t]*$/.exec(n),B=o?.[2]?.trim();o&&B&&e.push({level:o[1].length,text:B,line:s})}),e}function un(r){return gi(Ci(r)).find(e=>e.level===1)?.text}function it(r){let e=Math.max(0,r);if(e<1)return`${Math.round(e*1e3)/1e3}s`;let t=Math.round(e),n=Math.floor(t/3600),s=Math.floor(t%3600/60),i=t%60;return[n?`${n}h`:"",s?`${s}m`:"",i||!n&&!s?`${i}s`:""].join("")}function Yo(r){let e=Math.round(Math.max(0,r)/60);return e<1?"under a minute":e<60?`about ${e} min`:`about ${Math.floor(e/60)} h${e%60?` ${e%60} min`:""}`}function hl(r){let e=Math.max(0,Math.round(r));if(e<60)return`${e}s`;if(e<120)return e===60?"1m":`1m ${e-60}s`;let t=Math.round(e/60);return t<60?`${t} min`:`${Math.floor(t/60)} h${t%60?` ${t%60} min`:""}`}function qo(r,e){return r>2*e&&r-e>60}function Cl(r,e=10){let t=Math.min(1,Math.max(0,Number.isFinite(r)?r:0)),n=Math.round(t*e);return`[${"#".repeat(n)}${".".repeat(e-n)}]`}function Qo(r,e){return r?Math.max(10,Math.min(30,r-e-4)):20}function pl(r,e){return e.estimateSeconds===void 0?(r.unestimated++,e.state!=="done"):(r.totalSeconds+=e.estimateSeconds,e.state==="done"?r.doneSeconds+=e.estimateSeconds:e.state==="running"?r.leftSeconds+=Math.max(0,e.estimateSeconds-(e.elapsedSeconds??0)):r.leftSeconds+=e.estimateSeconds,!1)}function Wo(r,e={}){let t={setup:e.setup??"run",teardown:e.teardown??"offered"},n=r.some(a=>a.part!==void 0),s=a=>a.part===void 0||(a.part==="setup"?t.setup==="run":t.teardown==="chosen"),i={totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0,unestimatedLeft:0},o=()=>({totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0}),B={setup:o(),body:o(),teardown:o()};for(let a of r){let l=B[a.part??"body"];l.blocks++,pl(l,a),!(n&&!s(a))&&(i.blocks++,pl(i,a)&&i.unestimatedLeft++)}return i.totalSeconds>0&&(i.fraction=(i.totalSeconds-i.leftSeconds)/i.totalSeconds),n&&(i.parts={...B,states:t}),i}function Tp(r){let e=r.parts;if(!e)return;let t=[],n=s=>s.unestimated===s.blocks?"":` ${it(s.totalSeconds)}`;return e.setup.blocks>0&&(e.states.setup==="up"?t.push("setup \u2713 already up"):e.states.setup==="unchecked"?t.push(e.setup.unestimated===e.setup.blocks?"setup unless already up":`+${it(e.setup.totalSeconds)} if the setup runs`):e.setup.leftSeconds===0&&e.setup.doneSeconds>0&&t.push("setup \u2713")),e.teardown.blocks>0&&t.push(e.states.teardown==="chosen"?`teardown${n(e.teardown)}`:`teardown${n(e.teardown)}, offered`),t.length?t.join(" \xB7 "):void 0}function mi(r,e=10){if(r.fraction===void 0)return;let t=[`${Cl(r.fraction,e)} ${Math.floor(r.fraction*100)}%`,r.leftSeconds>0?`${hl(r.leftSeconds)} left`:"nothing left"];r.unestimatedLeft>0&&t.push(Ei(r.unestimatedLeft));let n=Tp(r);return n&&t.push(n),t.join(" \xB7 ")}function Ei(r){return`${r} block${r===1?"":"s"} without an estimate`}function bi(r,e,t){let n=he(r).cells,s=n.map(h=>h.kind==="code"&&ce(h.meta)?me(h.meta.info):void 0);n.forEach((h,p)=>{let k=s[p];if(!t||!k||k.estimateSeconds!==void 0||!ce(h.meta)||!Ge(h.languageId))return;let D=t(h.meta.info,h.value);D!==void 0&&(s[p]={...k,estimateSeconds:D})});let i=Pn(n.map((h,p)=>({kind:h.kind,...s[p]?.os?{os:s[p].os}:{}})),e),o=new Map,B=new Map;i.forEach((h,p)=>{h&&B.set(h.group,[...B.get(h.group)??[],{active:h.active,e:s[p]?.estimateSeconds}])});for(let[h,p]of B){let k=e!==void 0?p.find(m=>m.active):void 0,D=p.flatMap(m=>m.e===void 0?[]:[m.e]);o.set(h,k?k.e:D.length?Math.max(...D):void 0)}let a=new Set,l=[],c=[],u=[],f={setup:{seconds:0,blocks:0,unestimated:0},teardown:{seconds:0,blocks:0,unestimated:0}},d;return n.forEach((h,p)=>{if(h.kind!=="code"){l.push(void 0),c.push(!1);for(let w of gi(p===0?Ci(h.value):h.value))w.level>2||(d={heading:w.text,level:w.level,cell:p,seconds:0,blocks:0,unestimated:0},u.push(d));return}let k=s[p],D=i[p],m=k!==void 0&&!k.skip&&k.part!=="ready",b=k?.estimateSeconds;if(m&&D&&(a.has(D.group)?m=!1:(a.add(D.group),b=o.get(D.group))),l.push(k?.estimateSeconds),c.push(m),!!m&&(d||(d={level:0,cell:-1,seconds:0,blocks:0,unestimated:0},u.unshift(d)),d.blocks++,b===void 0?d.unestimated++:d.seconds+=b,k?.part==="setup"||k?.part==="teardown")){let w=f[k.part];w.blocks++,b===void 0?w.unestimated++:w.seconds+=b}}),{sections:u,totalSeconds:u.reduce((h,p)=>h+p.seconds,0),blocks:u.reduce((h,p)=>h+p.blocks,0),unestimated:u.reduce((h,p)=>h+p.unestimated,0),perCell:l,counts:c,parts:f,guarded:s.some((h,p)=>h?.part==="ready"||h?.part==="setup"&&Ge(n[p].languageId))}}function Vo(r,e,t,n,s=0,i){let o=me(r).estimateSeconds;if(o!==void 0)return o;let B=et(r,e);if(B.src===void 0||Er(B.src)||s>=mr)return;let a=t(B.src,i);if(!a)return;let l=bi(a.text,n,(f,d)=>a.at===void 0?void 0:Vo(f,d,t,n,s+1,a.at));if(B.sections.length===0)return l.blocks>l.unestimated?l.totalSeconds:void 0;let c=_n(Hn(a.text),B.sections),u;for(let f of ft(he(a.text))){let d=l.perCell[f.cellIndex];l.counts[f.cellIndex]&&d!==void 0&&c(f.line)&&(u=(u??0)+d)}return u}function gl(r){return/(^|[\s;|&(])md-runbook-probe(\s|$)/m.test(r)}var Ip=/^(OK|FAIL) {2,}(\S+) {2,}(.+)$/;function ml(r){let e=[];for(let t of r.split(/\r?\n/)){let n=Ip.exec(t.trimEnd());if(!n)continue;let s=n[3],i={target:n[2],ok:n[1]==="OK",detail:s},o=/(\d+) days left \((\d{4}-\d\d-\d\d)\)/.exec(s),B=/expires in (-?\d+) days \((\d{4}-\d\d-\d\d)\)/.exec(s),a=/expires (\d{4}-\d\d-\d\d) \((-?\d+) days\)/.exec(s),l=/EXPIRED on (\d{4}-\d\d-\d\d) \((\d+) days ago\)/.exec(s);if(o||B){let c=o??B;i.daysLeft=Number(c[1]),i.expires=c[2]}else a?(i.daysLeft=Number(a[2]),i.expires=a[1]):l&&(i.daysLeft=-Number(l[2]),i.expires=l[1]);e.push(i)}return e}var Zo=["detected","mitigated","resolved"],Lp=/^[ \t]*<!--[ \t]*md-runbook:note\b(.*?)-->[ \t]*\r?\n((?:[ \t]*>.*(?:\r?\n|$))*)/gm;function Np(r){let e=[];for(let t of r.matchAll(Lp)){let n=Mr(t[1]??"");if(!n.at||Number.isNaN(Date.parse(n.at)))continue;let s=(t[2]??"").split(/\r?\n/).map(o=>o.replace(/^[ \t]*>[ \t]?/,"")).join(`
91
+ `}function hi(r){if(!(!r?.copy||!r.runbook))return{runbook:r.runbook,copy:r.copy,...r.sha256?{sha256:r.sha256}:{},...r.exit?{exit:r.exit}:{}}}function dl(r,e,t=(n,s)=>n===s){let n=r.findIndex(s=>t(s,e));if(n>=0)return`a runbook call cycle: ${[...r.slice(n),e].join(" \u2192 ")}`;if(r.length>mr)return`runbook calls nest more than ${mr} deep: ${[...r,e].join(" \u2192 ")}`}function Ci(r){let e=/^?---[ \t]*\r?\n(?:[\s\S]*?\r?\n)?(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/.exec(r);return e?r.slice(e[0].length):r}function gi(r){let e=[],t;return r.split(/\r?\n/).forEach((n,s)=>{let i=/^ {0,3}(`{3,}|~{3,})/.exec(n)?.[1];if(t!==void 0){i&&i[0]===t[0]&&i.length>=t.length&&n.trim()===i&&(t=void 0);return}if(i){t=i;return}let o=/^ {0,3}(#{1,6})[ \t]+(.+?)(?:[ \t]+#+)?[ \t]*$/.exec(n),B=o?.[2]?.trim();o&&B&&e.push({level:o[1].length,text:B,line:s})}),e}function un(r){return gi(Ci(r)).find(e=>e.level===1)?.text}function it(r){let e=Math.max(0,r);if(e<1)return`${Math.round(e*1e3)/1e3}s`;let t=Math.round(e),n=Math.floor(t/3600),s=Math.floor(t%3600/60),i=t%60;return[n?`${n}h`:"",s?`${s}m`:"",i||!n&&!s?`${i}s`:""].join("")}function qo(r){let e=Math.round(Math.max(0,r)/60);return e<1?"under a minute":e<60?`about ${e} min`:`about ${Math.floor(e/60)} h${e%60?` ${e%60} min`:""}`}function hl(r){let e=Math.max(0,Math.round(r));if(e<60)return`${e}s`;if(e<120)return e===60?"1m":`1m ${e-60}s`;let t=Math.round(e/60);return t<60?`${t} min`:`${Math.floor(t/60)} h${t%60?` ${t%60} min`:""}`}function Yo(r,e){return r>2*e&&r-e>60}function Cl(r,e=10){let t=Math.min(1,Math.max(0,Number.isFinite(r)?r:0)),n=Math.round(t*e);return`[${"#".repeat(n)}${".".repeat(e-n)}]`}function Qo(r,e){return r?Math.max(10,Math.min(30,r-e-4)):20}function pl(r,e){return e.estimateSeconds===void 0?(r.unestimated++,e.state!=="done"):(r.totalSeconds+=e.estimateSeconds,e.state==="done"?r.doneSeconds+=e.estimateSeconds:e.state==="running"?r.leftSeconds+=Math.max(0,e.estimateSeconds-(e.elapsedSeconds??0)):r.leftSeconds+=e.estimateSeconds,!1)}function Wo(r,e={}){let t={setup:e.setup??"run",teardown:e.teardown??"offered"},n=r.some(a=>a.part!==void 0),s=a=>a.part===void 0||(a.part==="setup"?t.setup==="run":t.teardown==="chosen"),i={totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0,unestimatedLeft:0},o=()=>({totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0}),B={setup:o(),body:o(),teardown:o()};for(let a of r){let l=B[a.part??"body"];l.blocks++,pl(l,a),!(n&&!s(a))&&(i.blocks++,pl(i,a)&&i.unestimatedLeft++)}return i.totalSeconds>0&&(i.fraction=(i.totalSeconds-i.leftSeconds)/i.totalSeconds),n&&(i.parts={...B,states:t}),i}function Tp(r){let e=r.parts;if(!e)return;let t=[],n=s=>s.unestimated===s.blocks?"":` ${it(s.totalSeconds)}`;return e.setup.blocks>0&&(e.states.setup==="up"?t.push("setup \u2713 already up"):e.states.setup==="unchecked"?t.push(e.setup.unestimated===e.setup.blocks?"setup unless already up":`+${it(e.setup.totalSeconds)} if the setup runs`):e.setup.leftSeconds===0&&e.setup.doneSeconds>0&&t.push("setup \u2713")),e.teardown.blocks>0&&t.push(e.states.teardown==="chosen"?`teardown${n(e.teardown)}`:`teardown${n(e.teardown)}, offered`),t.length?t.join(" \xB7 "):void 0}function mi(r,e=10){if(r.fraction===void 0)return;let t=[`${Cl(r.fraction,e)} ${Math.floor(r.fraction*100)}%`,r.leftSeconds>0?`${hl(r.leftSeconds)} left`:"nothing left"];r.unestimatedLeft>0&&t.push(Ei(r.unestimatedLeft));let n=Tp(r);return n&&t.push(n),t.join(" \xB7 ")}function Ei(r){return`${r} block${r===1?"":"s"} without an estimate`}function bi(r,e,t){let n=he(r).cells,s=n.map(h=>h.kind==="code"&&ce(h.meta)?me(h.meta.info):void 0);n.forEach((h,p)=>{let k=s[p];if(!t||!k||k.estimateSeconds!==void 0||!ce(h.meta)||!Ge(h.languageId))return;let D=t(h.meta.info,h.value);D!==void 0&&(s[p]={...k,estimateSeconds:D})});let i=Pn(n.map((h,p)=>({kind:h.kind,...s[p]?.os?{os:s[p].os}:{}})),e),o=new Map,B=new Map;i.forEach((h,p)=>{h&&B.set(h.group,[...B.get(h.group)??[],{active:h.active,e:s[p]?.estimateSeconds}])});for(let[h,p]of B){let k=e!==void 0?p.find(m=>m.active):void 0,D=p.flatMap(m=>m.e===void 0?[]:[m.e]);o.set(h,k?k.e:D.length?Math.max(...D):void 0)}let a=new Set,l=[],c=[],u=[],f={setup:{seconds:0,blocks:0,unestimated:0},teardown:{seconds:0,blocks:0,unestimated:0}},d;return n.forEach((h,p)=>{if(h.kind!=="code"){l.push(void 0),c.push(!1);for(let w of gi(p===0?Ci(h.value):h.value))w.level>2||(d={heading:w.text,level:w.level,cell:p,seconds:0,blocks:0,unestimated:0},u.push(d));return}let k=s[p],D=i[p],m=k!==void 0&&!k.skip&&k.part!=="ready",b=k?.estimateSeconds;if(m&&D&&(a.has(D.group)?m=!1:(a.add(D.group),b=o.get(D.group))),l.push(k?.estimateSeconds),c.push(m),!!m&&(d||(d={level:0,cell:-1,seconds:0,blocks:0,unestimated:0},u.unshift(d)),d.blocks++,b===void 0?d.unestimated++:d.seconds+=b,k?.part==="setup"||k?.part==="teardown")){let w=f[k.part];w.blocks++,b===void 0?w.unestimated++:w.seconds+=b}}),{sections:u,totalSeconds:u.reduce((h,p)=>h+p.seconds,0),blocks:u.reduce((h,p)=>h+p.blocks,0),unestimated:u.reduce((h,p)=>h+p.unestimated,0),perCell:l,counts:c,parts:f,guarded:s.some((h,p)=>h?.part==="ready"||h?.part==="setup"&&Ge(n[p].languageId))}}function Vo(r,e,t,n,s=0,i){let o=me(r).estimateSeconds;if(o!==void 0)return o;let B=et(r,e);if(B.src===void 0||Er(B.src)||s>=mr)return;let a=t(B.src,i);if(!a)return;let l=bi(a.text,n,(f,d)=>a.at===void 0?void 0:Vo(f,d,t,n,s+1,a.at));if(B.sections.length===0)return l.blocks>l.unestimated?l.totalSeconds:void 0;let c=_n(Hn(a.text),B.sections),u;for(let f of ft(he(a.text))){let d=l.perCell[f.cellIndex];l.counts[f.cellIndex]&&d!==void 0&&c(f.line)&&(u=(u??0)+d)}return u}function gl(r){return/(^|[\s;|&(])md-runbook-probe(\s|$)/m.test(r)}var Ip=/^(OK|FAIL) {2,}(\S+) {2,}(.+)$/;function ml(r){let e=[];for(let t of r.split(/\r?\n/)){let n=Ip.exec(t.trimEnd());if(!n)continue;let s=n[3],i={target:n[2],ok:n[1]==="OK",detail:s},o=/(\d+) days left \((\d{4}-\d\d-\d\d)\)/.exec(s),B=/expires in (-?\d+) days \((\d{4}-\d\d-\d\d)\)/.exec(s),a=/expires (\d{4}-\d\d-\d\d) \((-?\d+) days\)/.exec(s),l=/EXPIRED on (\d{4}-\d\d-\d\d) \((\d+) days ago\)/.exec(s);if(o||B){let c=o??B;i.daysLeft=Number(c[1]),i.expires=c[2]}else a?(i.daysLeft=Number(a[2]),i.expires=a[1]):l&&(i.daysLeft=-Number(l[2]),i.expires=l[1]);e.push(i)}return e}var Zo=["detected","mitigated","resolved"],Lp=/^[ \t]*<!--[ \t]*md-runbook:note\b(.*?)-->[ \t]*\r?\n((?:[ \t]*>.*(?:\r?\n|$))*)/gm;function Np(r){let e=[];for(let t of r.matchAll(Lp)){let n=Mr(t[1]??"");if(!n.at||Number.isNaN(Date.parse(n.at)))continue;let s=(t[2]??"").split(/\r?\n/).map(o=>o.replace(/^[ \t]*>[ \t]?/,"")).join(`
92
92
  `).trim().replace(/^\*\*[^*]*:\*\*\s*/,""),i=Zo.includes(n.milestone??"")?n.milestone:void 0;e.push({at:n.at,kind:"note",text:s,...n.by?{by:n.by}:{},...i?{milestone:i}:{}})}return e}var Mp=(r,e)=>e==="failed"||r!==void 0&&!["0","done","skipped","running","proposed","declined"].includes(r)&&e!=="ok";function El(r,e,t,n,s){if(!r.ran||Number.isNaN(Date.parse(r.ran)))return;let i=r.exit==="done"||r.exit==="skipped",o=s===void 0?[]:ml(s);return{at:r.ran,kind:i&&r.duration===void 0?"mark":"run",step:e,label:t,...r.by?{by:r.by}:{},...r.on?{on:r.on}:{},...r.exit!==void 0?{exit:r.exit}:{},...r.check?{check:r.check}:{},ok:!Mp(r.exit,r.check),...r.duration?{duration:r.duration}:{},...n?{earlier:!0}:{},...o.length?{checks:o}:{}}}var Di=(r,e)=>Math.max(0,Math.round((Date.parse(e)-Date.parse(r))/1e3));function wi(r){let e=ve(r),t=[],n=he(r),s=n.cells.map(d=>ce(d.meta)?me(d.meta.info):void 0),i=Bn(n.cells.map((d,h)=>ce(d.meta)?{kind:"code",os:s[h]?.os}:{kind:"markup"}));for(let[d,h]of n.cells.entries()){let p=i[d];if(p===void 0||!ce(h.meta))continue;let k=s[d]?.name??h.value.split(/\r?\n/).find(m=>m.trim()!=="")?.trim()??`step ${p}`,D=gl(h.value);if(h.output){let m=El(h.output.attrs,p,k,!1,D?h.output.text:void 0);m&&t.push(m)}for(let m of h.meta.history?.entries??[]){let b=El(m.attrs,p,k,!0,D?m.text:void 0);b&&t.push(b)}}t.push(...Np(r)),t.sort((d,h)=>Date.parse(d.at)-Date.parse(h.at)||(d.step??0)-(h.step??0));let o={};for(let d of t)d.milestone&&!o[d.milestone]&&(o[d.milestone]=d.at);let B=t.filter(d=>d.kind==="run"),a=t[0]?.at,l=t[t.length-1]?.at,c=o.detected??a,u={...e?.incident?{incident:e.incident}:{},...e?.severity?{severity:e.severity}:{},...e?.drill?{drill:!0}:{},...a?{start:a}:{},...l?{end:l}:{},...a&&l?{durationSeconds:Di(a,l)}:{},runs:B.length,failedAttempts:B.filter(d=>!d.ok).length,milestones:o,...c&&o.mitigated?{timeToMitigateSeconds:Di(c,o.mitigated)}:{},...c&&o.resolved?{timeToResolveSeconds:Di(c,o.resolved)}:{},people:[...new Set(t.flatMap(d=>d.by?[d.by]:[]))],places:[...new Set(t.flatMap(d=>d.on?[d.on]:[]))]},f=t.flatMap(d=>d.earlier?[]:d.checks??[]);if(f.length&&(u.endpointChecks={total:f.length,failed:f.filter(d=>!d.ok).length}),e?.rtoSeconds!==void 0){u.rtoSeconds=e.rtoSeconds;let d=o.resolved??l;a&&d&&(u.rtoMet=Di(a,d)<=e.rtoSeconds)}return{events:t,summary:u}}function ns(r){let e=Math.floor(r/3600),t=Math.floor(r%3600/60),n=r%60;return[e?`${e} h`:"",t?`${t} min`:"",n||!e&&!t?`${n} s`:""].filter(Boolean).join(" ")}var Gp=100;function Xo(r,e,t=!1){return!t&&!ve(r)?.evidence?{}:{...e.by?{by:e.by}:{},...e.on?{on:e.on}:{}}}function eB(r,e){return ve(r)?.evidence?Math.max(e,Gp):e}function bl(r,e){let t=/\r\n/.test(r)?`\r
93
93
  `:`
94
- `,n=r.startsWith("\uFEFF")?"\uFEFF":"",s=n?r.slice(1):r,i=l=>/^[\w.@:/+ -]*$/.test(l)&&!/^\s|\s$|: /.test(l)?l:JSON.stringify(l),o=s.split(/\r?\n/),B=o[0]?.trimEnd()==="---"?o.findIndex((l,c)=>c>0&&/^(---|\.\.\.)\s*$/.test(l)):-1;if(B<0){let l=["---",...Object.entries(e).map(([c,u])=>`${c}: ${i(u)}`),"---",""];return n+l.join(t)+t+s}let a=o.slice(1,B);for(let[l,c]of Object.entries(e)){let u=a.findIndex(f=>new RegExp(`^${l}\\s*:`).test(f));u>=0?a[u]=`${l}: ${i(c)}`:a.push(`${l}: ${i(c)}`)}return n+["---",...a,...o.slice(B)].join(t)}var xl=require("module"),Pp=(0,xl.createRequire)("/"),br,Hp,_p;try{br=Pp("worker_threads"),Hp=br.Worker,_p=br.isMarkedAsUntransferable}catch{}var Pe=Uint8Array,ht=Uint16Array,aB=Int32Array,ki=new Pe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xi=new Pe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sB=new Pe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vl=function(r,e){for(var t=new ht(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new aB(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)s[i]=i-t[n]<<5|n;return{b:t,r:s}},br=vl(ki,2),yl=br.b,iB=br.r;yl[28]=258,iB[258]=28;var Sl=vl(xi,0),Up=Sl.b,Dl=Sl.r,oB=new ht(32768);for(Ce=0;Ce<32768;++Ce)Yt=(Ce&43690)>>1|(Ce&21845)<<1,Yt=(Yt&52428)>>2|(Yt&13107)<<2,Yt=(Yt&61680)>>4|(Yt&3855)<<4,oB[Ce]=((Yt&65280)>>8|(Yt&255)<<8)>>1;var Yt,Ce,Pt=(function(r,e,t){for(var n=r.length,s=0,i=new ht(e);s<n;++s)r[s]&&++i[r[s]-1];var o=new ht(e);for(s=1;s<e;++s)o[s]=o[s-1]+i[s-1]<<1;var B;if(t){B=new ht(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var l=s<<4|r[s],c=e-r[s],u=o[r[s]-1]++<<c,f=u|(1<<c)-1;u<=f;++u)B[oB[u]>>a]=l}else for(B=new ht(n),s=0;s<n;++s)r[s]&&(B[s]=oB[o[r[s]-1]++]>>15-r[s]);return B}),ln=new Pe(288);for(Ce=0;Ce<144;++Ce)ln[Ce]=8;var Ce;for(Ce=144;Ce<256;++Ce)ln[Ce]=9;var Ce;for(Ce=256;Ce<280;++Ce)ln[Ce]=7;var Ce;for(Ce=280;Ce<288;++Ce)ln[Ce]=8;var Ce,os=new Pe(32);for(Ce=0;Ce<32;++Ce)os[Ce]=5;var Ce,Jp=Pt(ln,9,0),jp=Pt(ln,9,1),Kp=Pt(os,5,0),zp=Pt(os,5,1),tB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},Ft=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},nB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},uB=function(r){return(r+7)/8|0},is=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new Pe(r.subarray(e,t))};var Yp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Tt=function(r,e,t){var n=new Error(e||Yp[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,Tt),!t)throw n;return n},qp=function(r,e,t,n){var s=r.length,i=n?n.length:0;if(!s||e.f&&!e.l)return t||new Pe(0);var o=!t,B=o||e.i!=2,a=e.i;o&&(t=new Pe(s*3));var l=function(Q){var z=t.length;if(Q>z){var le=new Pe(Math.max(z*2,Q));le.set(t),t=le}},c=e.f||0,u=e.p||0,f=e.b||0,d=e.l,h=e.d,p=e.m,k=e.n,D=s*8;do{if(!d){c=Ft(r,u,1);var m=Ft(r,u+1,3);if(u+=3,m)if(m==1)d=jp,h=zp,p=9,k=5;else if(m==2){var y=Ft(r,u,31)+257,T=Ft(r,u+10,15)+4,v=y+Ft(r,u+5,31)+1;u+=14;for(var E=new Pe(v),S=new Pe(19),O=0;O<T;++O)S[sB[O]]=Ft(r,u+O*3,7);u+=T*3;for(var P=tB(S),X=(1<<P)-1,Y=Pt(S,P,1),O=0;O<v;){var W=Y[Ft(r,u,X)];u+=W&15;var b=W>>4;if(b<16)E[O++]=b;else{var ee=0,q=0;for(b==16?(q=3+Ft(r,u,3),u+=2,ee=E[O-1]):b==17?(q=3+Ft(r,u,7),u+=3):b==18&&(q=11+Ft(r,u,127),u+=7);q--;)E[O++]=ee}}var se=E.subarray(0,y),te=E.subarray(y);p=tB(se),k=tB(te),d=Pt(se,p,1),h=Pt(te,k,1)}else Tt(1);else{var b=uB(u)+4,w=r[b-4]|r[b-3]<<8,R=b+w;if(R>s){a&&Tt(0);break}B&&l(f+w),t.set(r.subarray(b,R),f),e.b=f+=w,e.p=u=R*8,e.f=c;continue}if(u>D){a&&Tt(0);break}}B&&l(f+131072);for(var ye=(1<<p)-1,ge=(1<<k)-1,Je=u;;Je=u){var ee=d[nB(r,u)&ye],De=ee>>4;if(u+=ee&15,u>D){a&&Tt(0);break}if(ee||Tt(2),De<256)t[f++]=De;else if(De==256){Je=u,d=null;break}else{var be=De-254;if(De>264){var O=De-257,F=ki[O];be=Ft(r,u,(1<<F)-1)+yl[O],u+=F}var M=h[nB(r,u)&ge],A=M>>4;M||Tt(3),u+=M&15;var te=Up[A];if(A>3){var F=xi[A];te+=nB(r,u)&(1<<F)-1,u+=F}if(u>D){a&&Tt(0);break}B&&l(f+131072);var G=f+be;if(f<te){var H=i-te,J=Math.min(te,G);for(H+f<0&&Tt(3);f<J;++f)t[f]=n[H+f]}for(;f<G;++f)t[f]=t[f-te]}}e.l=d,e.p=Je,e.b=f,e.f=c,d&&(c=1,e.m=p,e.d=h,e.n=k)}while(!c);return f!=t.length&&o?is(t,0,f):t.subarray(0,f)},qt=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},rs=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8,r[n+2]|=t>>16},rB=function(r,e){for(var t=[],n=0;n<r.length;++n)r[n]&&t.push({s:n,f:r[n]});var s=t.length,i=t.slice();if(!s)return{t:Ol,l:0};if(s==1){var o=new Pe(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(R,y){return R.f-y.f}),t.push({s:-1,f:25001});var B=t[0],a=t[1],l=0,c=1,u=2;for(t[0]={s:-1,f:B.f+a.f,l:B,r:a};c!=s-1;)B=t[t[l].f<t[u].f?l++:u++],a=t[l!=c&&t[l].f<t[u].f?l++:u++],t[c++]={s:-1,f:B.f+a.f,l:B,r:a};for(var f=i[0].s,n=1;n<s;++n)i[n].s>f&&(f=i[n].s);var d=new ht(f+1),h=BB(t[c-1],d,0);if(h>e){var n=0,p=0,k=h-e,D=1<<k;for(i.sort(function(y,T){return d[T.s]-d[y.s]||y.f-T.f});n<s;++n){var m=i[n].s;if(d[m]>e)p+=D-(1<<h-d[m]),d[m]=e;else break}for(p>>=k;p>0;){var b=i[n].s;d[b]<e?p-=1<<e-d[b]++-1:++n}for(;n>=0&&p;--n){var w=i[n].s;d[w]==e&&(--d[w],++p)}h=e}return{t:new Pe(d),l:h}},BB=function(r,e,t){return r.s==-1?Math.max(BB(r.l,e,t+1),BB(r.r,e,t+1)):e[r.s]=t},wl=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new ht(++e),n=0,s=r[0],i=1,o=function(a){t[n++]=a},B=1;B<=e;++B)if(r[B]==s&&B!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=r[B]}return{c:t.subarray(0,n),n:e}},ss=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},Rl=function(r,e,t){var n=t.length,s=uB(e+2);r[s]=n&255,r[s+1]=n>>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var i=0;i<n;++i)r[s+i+4]=t[i];return(s+4+n)*8},kl=function(r,e,t,n,s,i,o,B,a,l,c){qt(e,c++,t),++s[256];for(var u=rB(s,15),f=u.t,d=u.l,h=rB(i,15),p=h.t,k=h.l,D=wl(f),m=D.c,b=D.n,w=wl(p),R=w.c,y=w.n,T=new ht(19),v=0;v<m.length;++v)++T[m[v]&31];for(var v=0;v<R.length;++v)++T[R[v]&31];for(var E=rB(T,7),S=E.t,O=E.l,P=19;P>4&&!S[sB[P-1]];--P);var X=l+5<<3,Y=ss(s,ln)+ss(i,os)+o,W=ss(s,f)+ss(i,p)+o+14+3*P+ss(T,S)+2*T[16]+3*T[17]+7*T[18];if(a>=0&&X<=Y&&X<=W)return Rl(e,c,r.subarray(a,a+l));var ee,q,se,te;if(qt(e,c,1+(W<Y)),c+=2,W<Y){ee=Pt(f,d,0),q=f,se=Pt(p,k,0),te=p;var ye=Pt(S,O,0);qt(e,c,b-257),qt(e,c+5,y-1),qt(e,c+10,P-4),c+=14;for(var v=0;v<P;++v)qt(e,c+3*v,S[sB[v]]);c+=3*P;for(var ge=[m,R],Je=0;Je<2;++Je)for(var De=ge[Je],v=0;v<De.length;++v){var be=De[v]&31;qt(e,c,ye[be]),c+=S[be],be>15&&(qt(e,c,De[v]>>5&127),c+=De[v]>>12)}}else ee=Jp,q=ln,se=Kp,te=os;for(var v=0;v<B;++v){var F=n[v];if(F>255){var be=F>>18&31;rs(e,c,ee[be+257]),c+=q[be+257],be>7&&(qt(e,c,F>>23&31),c+=ki[be]);var M=F&31;rs(e,c,se[M]),c+=te[M],M>3&&(rs(e,c,F>>5&8191),c+=xi[M])}else rs(e,c,ee[F]),c+=q[F]}return rs(e,c,ee[256]),c+q[256]},Qp=new aB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ol=new Pe(0),Wp=function(r,e,t,n,s,i){var o=i.z||r.length,B=new Pe(n+o+5*(1+Math.ceil(o/7e3))+s),a=B.subarray(n,B.length-s),l=i.l,c=(i.r||0)&7;if(e){c&&(a[0]=i.r>>3);for(var u=Qp[e-1],f=u>>13,d=u&8191,h=(1<<t)-1,p=i.p||new ht(32768),k=i.h||new ht(h+1),D=Math.ceil(t/3),m=2*D,b=function(ke){return(r[ke]^r[ke+1]<<D^r[ke+2]<<m)&h},w=new aB(25e3),R=new ht(288),y=new ht(32),T=0,v=0,E=i.i||0,S=0,O=i.w||0,P=0;E+2<o;++E){var X=b(E),Y=E&32767,W=k[X];if(p[Y]=W,k[X]=Y,O<=E){var ee=o-E;if((T>7e3||S>24576)&&(ee>423||!l)){c=kl(r,a,0,w,R,y,v,S,P,E-P,c),S=T=v=0,P=E;for(var q=0;q<286;++q)R[q]=0;for(var q=0;q<30;++q)y[q]=0}var se=2,te=0,ye=d,ge=Y-W&32767;if(ee>2&&X==b(E-ge))for(var Je=Math.min(f,ee)-1,De=Math.min(32767,E),be=Math.min(258,ee);ge<=De&&--ye&&Y!=W;){if(r[E+se]==r[E+se-ge]){for(var F=0;F<be&&r[E+F]==r[E+F-ge];++F);if(F>se){if(se=F,te=ge,F>Je)break;for(var M=Math.min(ge,F-2),A=0,q=0;q<M;++q){var G=E-ge+q&32767,H=p[G],J=G-H&32767;J>A&&(A=J,W=G)}}}Y=W,W=p[Y],ge+=Y-W&32767}if(te){w[S++]=268435456|iB[se]<<18|Dl[te];var Q=iB[se]&31,z=Dl[te]&31;v+=ki[Q]+xi[z],++R[257+Q],++y[z],O=E+se,++T}else w[S++]=r[E],++R[r[E]]}}for(E=Math.max(E,O);E<o;++E)w[S++]=r[E],++R[r[E]];c=kl(r,a,l,w,R,y,v,S,P,E-P,c),l||(i.r=c&7|a[c/8|0]<<3,c-=7,i.h=k,i.p=p,i.i=E,i.w=O)}else{for(var E=i.w||0;E<o+l;E+=65535){var le=E+65535;le>=o&&(a[c/8|0]=l,le=o),c=Rl(a,c+1,r.subarray(E,le))}i.i=o}return is(B,0,n+uB(c)+s)};var Vp=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new Pe(i.length+r.length);o.set(i),o.set(r,i.length),r=o,s.w=i.length}return Wp(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,n,s)};function Al(r,e){return Vp(r,e||{},0,0)}var $l=(function(){function r(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Pe(32768),this.p=new Pe(0),n&&this.o.set(n)}return r.prototype.e=function(e){if(this.ondata||Tt(5),this.d&&Tt(4),!this.p.length)this.p=e;else if(e.length){var t=new Pe(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},r.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=qp(this.p,this.s,this.o);this.ondata(is(n,t,this.s.b),this.d),this.o=is(n,this.s.b-32768),this.s.b=this.o.length,this.p=is(this.p,this.s.p/8|0),this.s.p&=7},r.prototype.push=function(e,t){this.e(e),this.c(t)},r})();var Zp=typeof TextDecoder<"u"&&new TextDecoder,Xp=0;try{Zp.decode(Ol,{stream:!0}),Xp=1}catch{}var eh=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ht=(r,e)=>r>>>e|r<<32-e;function Qt(r){return Array.from(th(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function th(r){let e=r.length*8,t=new Uint8Array(r.length+9+63>>6<<6);t.set(r),t[r.length]=128;let n=new DataView(t.buffer);n.setUint32(t.length-8,Math.floor(e/4294967296)),n.setUint32(t.length-4,e>>>0);let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);for(let o=0;o<t.length;o+=64){for(let p=0;p<16;p++)i[p]=n.getUint32(o+p*4);for(let p=16;p<64;p++){let k=Ht(i[p-15],7)^Ht(i[p-15],18)^i[p-15]>>>3,D=Ht(i[p-2],17)^Ht(i[p-2],19)^i[p-2]>>>10;i[p]=i[p-16]+k+i[p-7]+D>>>0}let[B,a,l,c,u,f,d,h]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let p=0;p<64;p++){let k=Ht(u,6)^Ht(u,11)^Ht(u,25),D=u&f^~u&d,m=h+k+D+eh[p]+i[p]>>>0,b=Ht(B,2)^Ht(B,13)^Ht(B,22),w=B&a^B&l^a&l,R=b+w>>>0;h=d,d=f,f=u,u=c+m>>>0,c=l,l=a,a=B,B=m+R>>>0}s[0]=s[0]+B>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+l>>>0,s[3]=s[3]+c>>>0,s[4]=s[4]+u>>>0,s[5]=s[5]+f>>>0,s[6]=s[6]+d>>>0,s[7]=s[7]+h>>>0}return s}var vi=/[ \t]/,Fl=/[A-Za-z0-9_]/,nh=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function rh(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&vi.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let i=r[t];if(i==="'"||i==='"'){let o=r.indexOf(i,t+1);if(o<0)return;let B=r.slice(t+1,o);s+=i==='"'?B.replace(/\\([\\"$`])/g,"$1"):B,t=o+1}else i==="\\"?(s+=r[t+1]??"",t+=2):(s+=i,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var lB=class{quote="";stack=[];heredocs=[];inHeredoc=!1;cont=!1;open(){return this.quote!==""||this.stack.length>0||this.heredocs.length>0||this.cont}line(e){if(this.inHeredoc){let B=this.heredocs[0];return(B.strip?e.replace(/^\t+/,""):e)===B.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",i=e.length,o=0;for(;o<i;){let B=e[o];if(this.quote==="'"||this.quote==="$'"){B==="\\"&&this.quote==="$'"?o++:B==="'"&&(this.quote=""),o++;continue}if(this.quote==='"'||this.quote==="`"){B==="\\"?(o===i-1&&(this.cont=!0),o++):B===this.quote&&(this.quote=""),o++;continue}if(vi.test(B)){o++;continue}if(B==="#"&&(o===0||/[\s;&|()]/.test(e[o-1])))break;if(t=!0,B==="\\"){o===i-1&&(this.cont=!0),s="",n=!1,o+=2;continue}if(B==="'"||B==='"'||B==="`")this.quote=B;else if(B==="$"&&e[o+1]==="'")this.quote="$'",o++;else if(B==="<"&&e.startsWith("<<",o)&&e[o+2]!=="<"){let a=rh(e,o+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),o=a.end,s="x",n=!1;continue}}else if(B==="("||B===")")this.top()!=="case"&&(B==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(B==="{")this.stack.push("{");else if(B==="}")this.top()==="{"&&this.stack.pop();else if(n&&Fl.test(B)){let a=o;for(;a<i&&Fl.test(e[a]);)a++;let l=e.slice(o,a);if((a===i||/[\s;&|()<>]/.test(e[a]))&&this.keyword(l)){o=a,s=l;continue}o=a,s=l,n=!1;continue}n=B===";"||B==="&"||B==="|"||B==="("||B==="{"||B==="}"||B==="!",s=(s+B).slice(-2),o++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&nh.test(e.replace(/[ \t]+#.*$/,""))&&(this.cont=!0),this.inHeredoc=this.heredocs.length>0,t}top(){return this.stack[this.stack.length-1]}keyword(e){switch(e){case"if":case"case":return this.stack.push(e),!0;case"for":case"while":case"until":case"select":return this.stack.push("loop"),!0;case"fi":case"esac":case"done":{let t=e==="fi"?"if":e==="esac"?"case":"loop";return this.top()===t&&this.stack.pop(),!0}case"then":case"do":case"else":case"elif":case"in":case"function":case"time":return!0;default:return!1}}},cB=class{quote="";blockComment=!1;depth=0;cont=!1;open(){return this.quote!==""||this.blockComment||this.depth>0||this.cont}line(e){if(this.cont=!1,this.quote==="@'"||this.quote==='@"')return e.startsWith(this.quote[1]+"@")&&(this.quote=""),!0;let t=this.quote!=="",n="",s=e.length,i=0;for(;i<s;){let o=e[i];if(this.blockComment){e.startsWith("#>",i)?(this.blockComment=!1,i+=2):i++;continue}if(this.quote==="'"){(o==="'"||o==="\u2018"||o==="\u2019")&&(e[i+1]===o?i++:this.quote=""),i++;continue}if(this.quote==='"'){o==="`"?i++:o==='"'&&(e[i+1]==='"'?i++:this.quote=""),i++;continue}if(vi.test(o)){i++;continue}if(e.startsWith("<#",i)){this.blockComment=!0,i+=2;continue}if(o==="#")break;if(t=!0,o==="`"){i===s-1&&(this.cont=!0),n="`",i+=2;continue}if(o==="@"&&(e[i+1]==="'"||e[i+1]==='"')&&e.slice(i+2).trim()==="")return this.quote=e[i+1]==="'"?"@'":'@"',!0;o==="'"||o==='"'||o==="\u2018"||o==="\u2019"?this.quote=o==='"'?'"':"'":o==="("||o==="{"||o==="["?this.depth++:(o===")"||o==="}"||o==="]")&&this.depth>0&&this.depth--,n=(n+o).slice(-4),i++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},fB=class{depth=0;cont=!1;open(){return this.depth>0||this.cont}line(e){if(this.cont=!1,this.depth===0&&/^[ \t]*(@?rem([ \t].*)?$|:)/i.test(e))return!1;let t=!1,n=!1;for(let s=0;s<e.length;s++){let i=e[s];if(vi.test(i)||(n=!0),i==='"')t=!t;else{if(t)continue;i==="^"?(s===e.length-1&&(this.cont=!0),s++):i==="("?this.depth++:i===")"&&this.depth>0&&this.depth--}}return n}};function sh(r){return r==="pwsh"?new cB:r==="cmd"?new fB:new lB}function ih(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function Tl(r,e){let t=yn(r),n=sh(e),s=[],i,o=a=>{s.push({start:i,end:a,text:t.slice(i,a+1).map((l,c,u)=>l.text+(c<u.length-1?l.eol:"")).join("")}),i=void 0},B=a=>t.slice(a+1).find(l=>l.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let l=n.line(t[a].text);if(i===void 0){if(!l)continue;i=a}if(n.open())continue;let c=B(a);c!==void 0&&ih(e,c)||o(a)}if(i!==void 0){let a=t.length-1;for(;a>i&&t[a].text.trim()==="";)a--;o(a)}return s}var pB="md-runbook",Nl="md-runbook-manifest 1",Ml=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,oh=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Bh=/^\d{4}-\d{2}-\d{2}$/,ah=r=>Bh.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function Il(r){return/^(PATH|IFS|ENV|BASH_ENV|CDPATH|GLOBIGNORE|HOME|SHELL|SHELLOPTS|BASHOPTS|PS[1-4]|PROMPT_COMMAND|PWD|OLDPWD|TMPDIR|LANG|LANGUAGE)$/.test(r)||/^(LC_|LD_|DYLD_|BASH_FUNC_|__mdrb_|MD_RUNBOOK_GATE_)/.test(r)}var uh=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,Gl=r=>r.text!==void 0?2:1,lh=/^<!-- md-runbook:record-signature v1 [^\n]*\n(?:[^\n]*\n)*?-->[ \t]*(?:\n|$)/gm,ch=/^[ \t]*<!--[ \t]*md-runbook:note\b.*?-->[ \t]*\n(?:[ \t]*>.*(?:\n|$))*/gm,fh=/^([ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+\[)[xX](\](?=[ \t]|$))/;function dh(r){let e=mB(r.replace(/^\uFEFF/,"")).replace(/\r\n?/g,`
94
+ `,n=r.startsWith("\uFEFF")?"\uFEFF":"",s=n?r.slice(1):r,i=l=>/^[\w.@:/+ -]*$/.test(l)&&!/^\s|\s$|: /.test(l)?l:JSON.stringify(l),o=s.split(/\r?\n/),B=o[0]?.trimEnd()==="---"?o.findIndex((l,c)=>c>0&&/^(---|\.\.\.)\s*$/.test(l)):-1;if(B<0){let l=["---",...Object.entries(e).map(([c,u])=>`${c}: ${i(u)}`),"---",""];return n+l.join(t)+t+s}let a=o.slice(1,B);for(let[l,c]of Object.entries(e)){let u=a.findIndex(f=>new RegExp(`^${l}\\s*:`).test(f));u>=0?a[u]=`${l}: ${i(c)}`:a.push(`${l}: ${i(c)}`)}return n+["---",...a,...o.slice(B)].join(t)}var xl=require("module"),Pp=(0,xl.createRequire)("/"),br,Hp,_p;try{br=Pp("worker_threads"),Hp=br.Worker,_p=br.isMarkedAsUntransferable}catch{}var Pe=Uint8Array,ht=Uint16Array,aB=Int32Array,ki=new Pe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xi=new Pe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sB=new Pe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vl=function(r,e){for(var t=new ht(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new aB(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)s[i]=i-t[n]<<5|n;return{b:t,r:s}},br=vl(ki,2),yl=br.b,iB=br.r;yl[28]=258,iB[258]=28;var Sl=vl(xi,0),Up=Sl.b,Dl=Sl.r,oB=new ht(32768);for(Ce=0;Ce<32768;++Ce)qt=(Ce&43690)>>1|(Ce&21845)<<1,qt=(qt&52428)>>2|(qt&13107)<<2,qt=(qt&61680)>>4|(qt&3855)<<4,oB[Ce]=((qt&65280)>>8|(qt&255)<<8)>>1;var qt,Ce,Pt=(function(r,e,t){for(var n=r.length,s=0,i=new ht(e);s<n;++s)r[s]&&++i[r[s]-1];var o=new ht(e);for(s=1;s<e;++s)o[s]=o[s-1]+i[s-1]<<1;var B;if(t){B=new ht(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var l=s<<4|r[s],c=e-r[s],u=o[r[s]-1]++<<c,f=u|(1<<c)-1;u<=f;++u)B[oB[u]>>a]=l}else for(B=new ht(n),s=0;s<n;++s)r[s]&&(B[s]=oB[o[r[s]-1]++]>>15-r[s]);return B}),ln=new Pe(288);for(Ce=0;Ce<144;++Ce)ln[Ce]=8;var Ce;for(Ce=144;Ce<256;++Ce)ln[Ce]=9;var Ce;for(Ce=256;Ce<280;++Ce)ln[Ce]=7;var Ce;for(Ce=280;Ce<288;++Ce)ln[Ce]=8;var Ce,os=new Pe(32);for(Ce=0;Ce<32;++Ce)os[Ce]=5;var Ce,Jp=Pt(ln,9,0),jp=Pt(ln,9,1),Kp=Pt(os,5,0),zp=Pt(os,5,1),tB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},$t=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},nB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},uB=function(r){return(r+7)/8|0},is=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new Pe(r.subarray(e,t))};var qp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Tt=function(r,e,t){var n=new Error(e||qp[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,Tt),!t)throw n;return n},Yp=function(r,e,t,n){var s=r.length,i=n?n.length:0;if(!s||e.f&&!e.l)return t||new Pe(0);var o=!t,B=o||e.i!=2,a=e.i;o&&(t=new Pe(s*3));var l=function(Q){var z=t.length;if(Q>z){var le=new Pe(Math.max(z*2,Q));le.set(t),t=le}},c=e.f||0,u=e.p||0,f=e.b||0,d=e.l,h=e.d,p=e.m,k=e.n,D=s*8;do{if(!d){c=$t(r,u,1);var m=$t(r,u+1,3);if(u+=3,m)if(m==1)d=jp,h=zp,p=9,k=5;else if(m==2){var y=$t(r,u,31)+257,T=$t(r,u+10,15)+4,v=y+$t(r,u+5,31)+1;u+=14;for(var E=new Pe(v),S=new Pe(19),O=0;O<T;++O)S[sB[O]]=$t(r,u+O*3,7);u+=T*3;for(var P=tB(S),X=(1<<P)-1,q=Pt(S,P,1),O=0;O<v;){var W=q[$t(r,u,X)];u+=W&15;var b=W>>4;if(b<16)E[O++]=b;else{var ee=0,Y=0;for(b==16?(Y=3+$t(r,u,3),u+=2,ee=E[O-1]):b==17?(Y=3+$t(r,u,7),u+=3):b==18&&(Y=11+$t(r,u,127),u+=7);Y--;)E[O++]=ee}}var se=E.subarray(0,y),te=E.subarray(y);p=tB(se),k=tB(te),d=Pt(se,p,1),h=Pt(te,k,1)}else Tt(1);else{var b=uB(u)+4,w=r[b-4]|r[b-3]<<8,R=b+w;if(R>s){a&&Tt(0);break}B&&l(f+w),t.set(r.subarray(b,R),f),e.b=f+=w,e.p=u=R*8,e.f=c;continue}if(u>D){a&&Tt(0);break}}B&&l(f+131072);for(var ye=(1<<p)-1,ge=(1<<k)-1,Je=u;;Je=u){var ee=d[nB(r,u)&ye],De=ee>>4;if(u+=ee&15,u>D){a&&Tt(0);break}if(ee||Tt(2),De<256)t[f++]=De;else if(De==256){Je=u,d=null;break}else{var be=De-254;if(De>264){var O=De-257,$=ki[O];be=$t(r,u,(1<<$)-1)+yl[O],u+=$}var M=h[nB(r,u)&ge],A=M>>4;M||Tt(3),u+=M&15;var te=Up[A];if(A>3){var $=xi[A];te+=nB(r,u)&(1<<$)-1,u+=$}if(u>D){a&&Tt(0);break}B&&l(f+131072);var G=f+be;if(f<te){var H=i-te,J=Math.min(te,G);for(H+f<0&&Tt(3);f<J;++f)t[f]=n[H+f]}for(;f<G;++f)t[f]=t[f-te]}}e.l=d,e.p=Je,e.b=f,e.f=c,d&&(c=1,e.m=p,e.d=h,e.n=k)}while(!c);return f!=t.length&&o?is(t,0,f):t.subarray(0,f)},Yt=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},rs=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8,r[n+2]|=t>>16},rB=function(r,e){for(var t=[],n=0;n<r.length;++n)r[n]&&t.push({s:n,f:r[n]});var s=t.length,i=t.slice();if(!s)return{t:Ol,l:0};if(s==1){var o=new Pe(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(R,y){return R.f-y.f}),t.push({s:-1,f:25001});var B=t[0],a=t[1],l=0,c=1,u=2;for(t[0]={s:-1,f:B.f+a.f,l:B,r:a};c!=s-1;)B=t[t[l].f<t[u].f?l++:u++],a=t[l!=c&&t[l].f<t[u].f?l++:u++],t[c++]={s:-1,f:B.f+a.f,l:B,r:a};for(var f=i[0].s,n=1;n<s;++n)i[n].s>f&&(f=i[n].s);var d=new ht(f+1),h=BB(t[c-1],d,0);if(h>e){var n=0,p=0,k=h-e,D=1<<k;for(i.sort(function(y,T){return d[T.s]-d[y.s]||y.f-T.f});n<s;++n){var m=i[n].s;if(d[m]>e)p+=D-(1<<h-d[m]),d[m]=e;else break}for(p>>=k;p>0;){var b=i[n].s;d[b]<e?p-=1<<e-d[b]++-1:++n}for(;n>=0&&p;--n){var w=i[n].s;d[w]==e&&(--d[w],++p)}h=e}return{t:new Pe(d),l:h}},BB=function(r,e,t){return r.s==-1?Math.max(BB(r.l,e,t+1),BB(r.r,e,t+1)):e[r.s]=t},wl=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new ht(++e),n=0,s=r[0],i=1,o=function(a){t[n++]=a},B=1;B<=e;++B)if(r[B]==s&&B!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=r[B]}return{c:t.subarray(0,n),n:e}},ss=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},Rl=function(r,e,t){var n=t.length,s=uB(e+2);r[s]=n&255,r[s+1]=n>>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var i=0;i<n;++i)r[s+i+4]=t[i];return(s+4+n)*8},kl=function(r,e,t,n,s,i,o,B,a,l,c){Yt(e,c++,t),++s[256];for(var u=rB(s,15),f=u.t,d=u.l,h=rB(i,15),p=h.t,k=h.l,D=wl(f),m=D.c,b=D.n,w=wl(p),R=w.c,y=w.n,T=new ht(19),v=0;v<m.length;++v)++T[m[v]&31];for(var v=0;v<R.length;++v)++T[R[v]&31];for(var E=rB(T,7),S=E.t,O=E.l,P=19;P>4&&!S[sB[P-1]];--P);var X=l+5<<3,q=ss(s,ln)+ss(i,os)+o,W=ss(s,f)+ss(i,p)+o+14+3*P+ss(T,S)+2*T[16]+3*T[17]+7*T[18];if(a>=0&&X<=q&&X<=W)return Rl(e,c,r.subarray(a,a+l));var ee,Y,se,te;if(Yt(e,c,1+(W<q)),c+=2,W<q){ee=Pt(f,d,0),Y=f,se=Pt(p,k,0),te=p;var ye=Pt(S,O,0);Yt(e,c,b-257),Yt(e,c+5,y-1),Yt(e,c+10,P-4),c+=14;for(var v=0;v<P;++v)Yt(e,c+3*v,S[sB[v]]);c+=3*P;for(var ge=[m,R],Je=0;Je<2;++Je)for(var De=ge[Je],v=0;v<De.length;++v){var be=De[v]&31;Yt(e,c,ye[be]),c+=S[be],be>15&&(Yt(e,c,De[v]>>5&127),c+=De[v]>>12)}}else ee=Jp,Y=ln,se=Kp,te=os;for(var v=0;v<B;++v){var $=n[v];if($>255){var be=$>>18&31;rs(e,c,ee[be+257]),c+=Y[be+257],be>7&&(Yt(e,c,$>>23&31),c+=ki[be]);var M=$&31;rs(e,c,se[M]),c+=te[M],M>3&&(rs(e,c,$>>5&8191),c+=xi[M])}else rs(e,c,ee[$]),c+=Y[$]}return rs(e,c,ee[256]),c+Y[256]},Qp=new aB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ol=new Pe(0),Wp=function(r,e,t,n,s,i){var o=i.z||r.length,B=new Pe(n+o+5*(1+Math.ceil(o/7e3))+s),a=B.subarray(n,B.length-s),l=i.l,c=(i.r||0)&7;if(e){c&&(a[0]=i.r>>3);for(var u=Qp[e-1],f=u>>13,d=u&8191,h=(1<<t)-1,p=i.p||new ht(32768),k=i.h||new ht(h+1),D=Math.ceil(t/3),m=2*D,b=function(ke){return(r[ke]^r[ke+1]<<D^r[ke+2]<<m)&h},w=new aB(25e3),R=new ht(288),y=new ht(32),T=0,v=0,E=i.i||0,S=0,O=i.w||0,P=0;E+2<o;++E){var X=b(E),q=E&32767,W=k[X];if(p[q]=W,k[X]=q,O<=E){var ee=o-E;if((T>7e3||S>24576)&&(ee>423||!l)){c=kl(r,a,0,w,R,y,v,S,P,E-P,c),S=T=v=0,P=E;for(var Y=0;Y<286;++Y)R[Y]=0;for(var Y=0;Y<30;++Y)y[Y]=0}var se=2,te=0,ye=d,ge=q-W&32767;if(ee>2&&X==b(E-ge))for(var Je=Math.min(f,ee)-1,De=Math.min(32767,E),be=Math.min(258,ee);ge<=De&&--ye&&q!=W;){if(r[E+se]==r[E+se-ge]){for(var $=0;$<be&&r[E+$]==r[E+$-ge];++$);if($>se){if(se=$,te=ge,$>Je)break;for(var M=Math.min(ge,$-2),A=0,Y=0;Y<M;++Y){var G=E-ge+Y&32767,H=p[G],J=G-H&32767;J>A&&(A=J,W=G)}}}q=W,W=p[q],ge+=q-W&32767}if(te){w[S++]=268435456|iB[se]<<18|Dl[te];var Q=iB[se]&31,z=Dl[te]&31;v+=ki[Q]+xi[z],++R[257+Q],++y[z],O=E+se,++T}else w[S++]=r[E],++R[r[E]]}}for(E=Math.max(E,O);E<o;++E)w[S++]=r[E],++R[r[E]];c=kl(r,a,l,w,R,y,v,S,P,E-P,c),l||(i.r=c&7|a[c/8|0]<<3,c-=7,i.h=k,i.p=p,i.i=E,i.w=O)}else{for(var E=i.w||0;E<o+l;E+=65535){var le=E+65535;le>=o&&(a[c/8|0]=l,le=o),c=Rl(a,c+1,r.subarray(E,le))}i.i=o}return is(B,0,n+uB(c)+s)};var Vp=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new Pe(i.length+r.length);o.set(i),o.set(r,i.length),r=o,s.w=i.length}return Wp(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,n,s)};function Al(r,e){return Vp(r,e||{},0,0)}var Fl=(function(){function r(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Pe(32768),this.p=new Pe(0),n&&this.o.set(n)}return r.prototype.e=function(e){if(this.ondata||Tt(5),this.d&&Tt(4),!this.p.length)this.p=e;else if(e.length){var t=new Pe(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},r.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=Yp(this.p,this.s,this.o);this.ondata(is(n,t,this.s.b),this.d),this.o=is(n,this.s.b-32768),this.s.b=this.o.length,this.p=is(this.p,this.s.p/8|0),this.s.p&=7},r.prototype.push=function(e,t){this.e(e),this.c(t)},r})();var Zp=typeof TextDecoder<"u"&&new TextDecoder,Xp=0;try{Zp.decode(Ol,{stream:!0}),Xp=1}catch{}var eh=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ht=(r,e)=>r>>>e|r<<32-e;function Qt(r){return Array.from(th(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function th(r){let e=r.length*8,t=new Uint8Array(r.length+9+63>>6<<6);t.set(r),t[r.length]=128;let n=new DataView(t.buffer);n.setUint32(t.length-8,Math.floor(e/4294967296)),n.setUint32(t.length-4,e>>>0);let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);for(let o=0;o<t.length;o+=64){for(let p=0;p<16;p++)i[p]=n.getUint32(o+p*4);for(let p=16;p<64;p++){let k=Ht(i[p-15],7)^Ht(i[p-15],18)^i[p-15]>>>3,D=Ht(i[p-2],17)^Ht(i[p-2],19)^i[p-2]>>>10;i[p]=i[p-16]+k+i[p-7]+D>>>0}let[B,a,l,c,u,f,d,h]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let p=0;p<64;p++){let k=Ht(u,6)^Ht(u,11)^Ht(u,25),D=u&f^~u&d,m=h+k+D+eh[p]+i[p]>>>0,b=Ht(B,2)^Ht(B,13)^Ht(B,22),w=B&a^B&l^a&l,R=b+w>>>0;h=d,d=f,f=u,u=c+m>>>0,c=l,l=a,a=B,B=m+R>>>0}s[0]=s[0]+B>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+l>>>0,s[3]=s[3]+c>>>0,s[4]=s[4]+u>>>0,s[5]=s[5]+f>>>0,s[6]=s[6]+d>>>0,s[7]=s[7]+h>>>0}return s}var vi=/[ \t]/,$l=/[A-Za-z0-9_]/,nh=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function rh(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&vi.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let i=r[t];if(i==="'"||i==='"'){let o=r.indexOf(i,t+1);if(o<0)return;let B=r.slice(t+1,o);s+=i==='"'?B.replace(/\\([\\"$`])/g,"$1"):B,t=o+1}else i==="\\"?(s+=r[t+1]??"",t+=2):(s+=i,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var lB=class{quote="";stack=[];heredocs=[];inHeredoc=!1;cont=!1;open(){return this.quote!==""||this.stack.length>0||this.heredocs.length>0||this.cont}line(e){if(this.inHeredoc){let B=this.heredocs[0];return(B.strip?e.replace(/^\t+/,""):e)===B.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",i=e.length,o=0;for(;o<i;){let B=e[o];if(this.quote==="'"||this.quote==="$'"){B==="\\"&&this.quote==="$'"?o++:B==="'"&&(this.quote=""),o++;continue}if(this.quote==='"'||this.quote==="`"){B==="\\"?(o===i-1&&(this.cont=!0),o++):B===this.quote&&(this.quote=""),o++;continue}if(vi.test(B)){o++;continue}if(B==="#"&&(o===0||/[\s;&|()]/.test(e[o-1])))break;if(t=!0,B==="\\"){o===i-1&&(this.cont=!0),s="",n=!1,o+=2;continue}if(B==="'"||B==='"'||B==="`")this.quote=B;else if(B==="$"&&e[o+1]==="'")this.quote="$'",o++;else if(B==="<"&&e.startsWith("<<",o)&&e[o+2]!=="<"){let a=rh(e,o+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),o=a.end,s="x",n=!1;continue}}else if(B==="("||B===")")this.top()!=="case"&&(B==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(B==="{")this.stack.push("{");else if(B==="}")this.top()==="{"&&this.stack.pop();else if(n&&$l.test(B)){let a=o;for(;a<i&&$l.test(e[a]);)a++;let l=e.slice(o,a);if((a===i||/[\s;&|()<>]/.test(e[a]))&&this.keyword(l)){o=a,s=l;continue}o=a,s=l,n=!1;continue}n=B===";"||B==="&"||B==="|"||B==="("||B==="{"||B==="}"||B==="!",s=(s+B).slice(-2),o++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&nh.test(e.replace(/[ \t]+#.*$/,""))&&(this.cont=!0),this.inHeredoc=this.heredocs.length>0,t}top(){return this.stack[this.stack.length-1]}keyword(e){switch(e){case"if":case"case":return this.stack.push(e),!0;case"for":case"while":case"until":case"select":return this.stack.push("loop"),!0;case"fi":case"esac":case"done":{let t=e==="fi"?"if":e==="esac"?"case":"loop";return this.top()===t&&this.stack.pop(),!0}case"then":case"do":case"else":case"elif":case"in":case"function":case"time":return!0;default:return!1}}},cB=class{quote="";blockComment=!1;depth=0;cont=!1;open(){return this.quote!==""||this.blockComment||this.depth>0||this.cont}line(e){if(this.cont=!1,this.quote==="@'"||this.quote==='@"')return e.startsWith(this.quote[1]+"@")&&(this.quote=""),!0;let t=this.quote!=="",n="",s=e.length,i=0;for(;i<s;){let o=e[i];if(this.blockComment){e.startsWith("#>",i)?(this.blockComment=!1,i+=2):i++;continue}if(this.quote==="'"){(o==="'"||o==="\u2018"||o==="\u2019")&&(e[i+1]===o?i++:this.quote=""),i++;continue}if(this.quote==='"'){o==="`"?i++:o==='"'&&(e[i+1]==='"'?i++:this.quote=""),i++;continue}if(vi.test(o)){i++;continue}if(e.startsWith("<#",i)){this.blockComment=!0,i+=2;continue}if(o==="#")break;if(t=!0,o==="`"){i===s-1&&(this.cont=!0),n="`",i+=2;continue}if(o==="@"&&(e[i+1]==="'"||e[i+1]==='"')&&e.slice(i+2).trim()==="")return this.quote=e[i+1]==="'"?"@'":'@"',!0;o==="'"||o==='"'||o==="\u2018"||o==="\u2019"?this.quote=o==='"'?'"':"'":o==="("||o==="{"||o==="["?this.depth++:(o===")"||o==="}"||o==="]")&&this.depth>0&&this.depth--,n=(n+o).slice(-4),i++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},fB=class{depth=0;cont=!1;open(){return this.depth>0||this.cont}line(e){if(this.cont=!1,this.depth===0&&/^[ \t]*(@?rem([ \t].*)?$|:)/i.test(e))return!1;let t=!1,n=!1;for(let s=0;s<e.length;s++){let i=e[s];if(vi.test(i)||(n=!0),i==='"')t=!t;else{if(t)continue;i==="^"?(s===e.length-1&&(this.cont=!0),s++):i==="("?this.depth++:i===")"&&this.depth>0&&this.depth--}}return n}};function sh(r){return r==="pwsh"?new cB:r==="cmd"?new fB:new lB}function ih(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function Tl(r,e){let t=yn(r),n=sh(e),s=[],i,o=a=>{s.push({start:i,end:a,text:t.slice(i,a+1).map((l,c,u)=>l.text+(c<u.length-1?l.eol:"")).join("")}),i=void 0},B=a=>t.slice(a+1).find(l=>l.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let l=n.line(t[a].text);if(i===void 0){if(!l)continue;i=a}if(n.open())continue;let c=B(a);c!==void 0&&ih(e,c)||o(a)}if(i!==void 0){let a=t.length-1;for(;a>i&&t[a].text.trim()==="";)a--;o(a)}return s}var pB="md-runbook",Nl="md-runbook-manifest 1",Ml=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,oh=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Bh=/^\d{4}-\d{2}-\d{2}$/,ah=r=>Bh.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function Il(r){return/^(PATH|IFS|ENV|BASH_ENV|CDPATH|GLOBIGNORE|HOME|SHELL|SHELLOPTS|BASHOPTS|PS[1-4]|PROMPT_COMMAND|PWD|OLDPWD|TMPDIR|LANG|LANGUAGE)$/.test(r)||/^(LC_|LD_|DYLD_|BASH_FUNC_|__mdrb_|MD_RUNBOOK_GATE_)/.test(r)}var uh=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,Gl=r=>r.text!==void 0?2:1,lh=/^<!-- md-runbook:record-signature v1 [^\n]*\n(?:[^\n]*\n)*?-->[ \t]*(?:\n|$)/gm,ch=/^[ \t]*<!--[ \t]*md-runbook:note\b.*?-->[ \t]*\n(?:[ \t]*>.*(?:\n|$))*/gm,fh=/^([ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+\[)[xX](\](?=[ \t]|$))/;function dh(r){let e=mB(r.replace(/^\uFEFF/,"")).replace(/\r\n?/g,`
95
95
  `);e=e.replace(lh,""),e=Kt(e),e=e.replace(ch,"");let t=null;return e=e.split(`
96
96
  `).map(n=>{if(t)return Ke(n,t)&&(t=null),n;let s=_e(n);return s?(t=s,n):n.replace(fh,"$1 $2")}).join(`
97
97
  `),e.replace(/\s+$/,"")+`
98
- `}var Pl=r=>Qt(dh(r)),Bs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function _t(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],i=e[n+1],o=e[n+2];t+=Bs[s>>2]+Bs[(s&3)<<4|(i??0)>>4],t+=i===void 0?"=":Bs[(i&15)<<2|(o??0)>>6],t+=o===void 0?"=":Bs[o&63]}return t}function Hl(r){if(r.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return;let e=r.endsWith("==")?2:r.endsWith("=")?1:0,t=new Uint8Array(r.length/4*3-e),n=0;for(let i=0;i<r.length;i+=4){let o=[0,1,2,3].map(a=>r[i+a]==="="?0:Bs.indexOf(r[i+a])),B=o[0]<<18|o[1]<<12|o[2]<<6|o[3];for(let a of[B>>16,B>>8&255,B&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return _t(s)===r?s:void 0}function _l(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind==="code"&&ce(t.meta)&&Ge(t.languageId)&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function dB(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind!=="code"||!ce(t.meta)||Fe(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function ph(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,i)=>{if(t){Ke(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${i+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let o=_e(s);if(o){/^( {4}|\t| {0,3}\t)/.test(o.indent)&&e.push(`line ${i+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&Fe(sn(o.info))==="bash"&&e.push(`line ${i+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=o;return}for(let B of s.matchAll(/<!--|-->/g))n=B[0]==="<!--"}),e}function hB(r,e,t={}){let n=[];Ml.test(e.name)||n.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&n.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!ah(e.expires)&&n.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let u of e.scopes)oh.test(u)||n.push(`scope "${u}": use letters, digits and . _ - (at most 64)`);for(let[u,f]of Object.entries(e.patterns))$t.test(u)?Il(u)&&n.push(`\${param:${u}}: ${u} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):n.push(`pattern for "${u}": not a parameter name`),f===""||/[\r\n]/.test(f)?n.push(`pattern for ${u}: empty or more than one line`):uh.test(f)&&n.push(`pattern for ${u}: ${f} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);n.push(...ph(mB(r)));let s=ve(r)?.shell?.unix;s&&s!=="bash"&&n.push(`front matter shell: ${s}: servers run signed runbooks in bash; remove it, or write shell: bash`),n.push(...hh(r));let i=new Set;for(let u of dB(r))for(let f of me(u.info).checks?.captures??[])f.secret&&i.add(f.name);let o=[];for(let u of dB(r)){let f=o.length+1,d=`cell ${f} (${u.value.split(`
99
- `)[0]?.slice(0,40)??""})`,h=me(u.info);for(let D of h.errors)n.push(`${d}: invalid option ${D}`);let p=[];try{for(let D of Xe(u.value)){let m=`\${${D.kind}:${D.name}${D.kind==="input"&&D.secret?":secret":""}}`;D.kind==="secret"?n.push(`${d}: ${m} can't be signed (servers log the values signed cells get)`):D.secret?n.push(`${d}: ${m} can't be signed: a secret input would be in the servers' logs`):D.kind==="out"&&i.has(D.name)?n.push(`${d}: ${m} comes from capture-secret= and can't be signed (servers log the values)`):e.patterns[D.name]===void 0?n.push(`${d}: ${m} needs a pattern (--pattern ${D.name}=REGEX)`):p.includes(D.name)||p.push(D.name)}}catch(D){n.push(`${d}: ${D instanceof Error?D.message:String(D)}`)}for(let D of u.value.matchAll(/\$\{(secret|input|param|out):[^}\s]*/g))/^\$\{((secret|param|out):[A-Za-z_][A-Za-z0-9_]*|input:[A-Za-z_][A-Za-z0-9_]*(:secret)?)$/.test(D[0])||n.push(`${d}: ${D[0]}} is not a plain \${${D[1]}:NAME} and can't be signed`);let k=Nn(h.kubeContext);k!==void 0&&e.patterns[k]===void 0&&n.push(`${d}: kube-context=\${param:${k}} needs a pattern (--pattern ${k}=REGEX)`);for(let[D,m]of Object.entries(h.env))$t.test(D)?Il(D)&&n.push(`${d}: env.${D} can't be set by a signed runbook (it changes how the shell runs the code)`):n.push(`${d}: env.${D} is not a variable name`),/\$\{(secret|input|param|out):/.test(m)&&n.push(`${d}: env.${D} can't use placeholders in a signed runbook`);o.push({n:f,lines:h.lines==="any"?"any":"all",info:u.info,code:hr(u.value,"bash"),needs:p,...h.cwd!==void 0?{cwd:h.cwd}:{},env:h.env,steps:Tl(u.value,"bash").map(D=>hr(D.text,"bash"))})}let B=[];for(let u of _l(r)){let f=B.length+1,d=`runbook call ${f} (src=${et(u.info,u.value).src??"?"})`,h=et(u.info,u.value);for(let k of h.problems)n.push(`${d}: ${k.message}`);for(let k of me(u.info).errors)n.push(`${d}: invalid option ${k}`);h.src!==void 0&&/^([A-Za-z]:)?[\\/]/.test(h.src)&&n.push(`${d}: src= must be relative: a signed runbook calls runbooks in its own repository`);let p=[];try{for(let k of Gt(h)){let D=`\${${k.kind}:${k.name}}`;k.kind==="secret"||k.secret?n.push(`${d}: ${D} can't be signed: pass secrets to the runbook called another way`):e.patterns[k.name]===void 0?n.push(`${d}: ${D} needs a pattern (--pattern ${k.name}=REGEX)`):p.includes(k.name)||p.push(k.name)}}catch(k){n.push(`${d}: ${k instanceof Error?k.message:String(k)}`)}B.push({n:f,info:u.info,body:u.value,needs:p})}if(o.length===0&&B.length===0&&n.push("no bash or sh cells to sign"),n.length>0)return{errors:n};let a=new Set([...o.flatMap(u=>u.needs),...B.flatMap(u=>u.needs)]),l=Object.fromEntries(Object.entries(e.patterns).filter(([u])=>a.has(u))),c=t.version===1?{}:{text:Pl(r)};return{manifest:{...e,scopes:[...new Set(e.scopes)],patterns:l,cells:o,calls:B,...c}}}function hh(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return[];let t=e.findIndex((o,B)=>B>0&&/^(---|\.\.\.)\s*$/.test(o));if(t<0)return[];let n=[],s=new Set,i=!1;for(let o of e.slice(1,t)){let B=/^(report-runs(?:-required|-signed|-token)?)\s*:\s*(.*?)\s*$/i.exec(o);if(!B)continue;let a=B[1].toLowerCase(),l=B[2].replace(/\s+#.*$/,"").replace(/^(["'])(.*)\1$/,"$2");if(s.has(a)&&n.push(`front matter ${a}: written twice (keep one)`),s.add(a),a==="report-runs"){let c=zt(l);c&&n.push(`front matter report-runs: ${c}`)}else a==="report-runs-token"?/^\$\{secret:[A-Za-z_][A-Za-z0-9_]*\}$/.test(l)||n.push("front matter report-runs-token: only ${secret:NAME}, never a token in the file"):(/^(true|false|yes|no|on|off)$/i.test(l)||n.push(`front matter ${a}: expected true or false`),/^(true|yes|on)$/i.test(l)&&(i=!0))}return!s.has("report-runs")&&(i||s.has("report-runs-token"))&&n.push("front matter report-runs-required, -signed or -token without report-runs: (the address)"),n}function CB(r){let e=[Nl,`name ${r.name}`,`version ${r.version}`];r.expires&&e.push(`expires ${r.expires}`),r.scopes.length>0&&e.push(`scope ${r.scopes.join(" ")}`),r.text!==void 0&&e.push(`text ${r.text}`);for(let[t,n]of Object.entries(r.patterns))e.push(`param ${t} ${_t(n)}`);for(let t of r.cells){e.push(`cell ${t.n} ${t.lines}`,`info ${_t(t.info)}`,`code ${_t(t.code)}`);for(let n of t.needs)e.push(`needs ${n}`);t.cwd!==void 0&&e.push(`cwd ${_t(t.cwd)}`);for(let[n,s]of Object.entries(t.env))e.push(`env ${n} ${_t(s)}`);for(let n of t.steps)e.push(`step ${_t(n)}`)}for(let t of r.calls){e.push(`call ${t.n}`,`callinfo ${_t(t.info)}`,`callbody ${_t(t.body)}`);for(let n of t.needs)e.push(`callneeds ${n}`)}return e.push("end"),e.join(`
98
+ `}var Pl=r=>Qt(dh(r)),Bs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function _t(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],i=e[n+1],o=e[n+2];t+=Bs[s>>2]+Bs[(s&3)<<4|(i??0)>>4],t+=i===void 0?"=":Bs[(i&15)<<2|(o??0)>>6],t+=o===void 0?"=":Bs[o&63]}return t}function Hl(r){if(r.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return;let e=r.endsWith("==")?2:r.endsWith("=")?1:0,t=new Uint8Array(r.length/4*3-e),n=0;for(let i=0;i<r.length;i+=4){let o=[0,1,2,3].map(a=>r[i+a]==="="?0:Bs.indexOf(r[i+a])),B=o[0]<<18|o[1]<<12|o[2]<<6|o[3];for(let a of[B>>16,B>>8&255,B&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return _t(s)===r?s:void 0}function _l(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind==="code"&&ce(t.meta)&&Ge(t.languageId)&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function dB(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind!=="code"||!ce(t.meta)||$e(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function ph(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,i)=>{if(t){Ke(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${i+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let o=_e(s);if(o){/^( {4}|\t| {0,3}\t)/.test(o.indent)&&e.push(`line ${i+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&$e(sn(o.info))==="bash"&&e.push(`line ${i+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=o;return}for(let B of s.matchAll(/<!--|-->/g))n=B[0]==="<!--"}),e}function hB(r,e,t={}){let n=[];Ml.test(e.name)||n.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&n.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!ah(e.expires)&&n.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let u of e.scopes)oh.test(u)||n.push(`scope "${u}": use letters, digits and . _ - (at most 64)`);for(let[u,f]of Object.entries(e.patterns))Ft.test(u)?Il(u)&&n.push(`\${param:${u}}: ${u} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):n.push(`pattern for "${u}": not a parameter name`),f===""||/[\r\n]/.test(f)?n.push(`pattern for ${u}: empty or more than one line`):uh.test(f)&&n.push(`pattern for ${u}: ${f} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);n.push(...ph(mB(r)));let s=ve(r)?.shell?.unix;s&&s!=="bash"&&n.push(`front matter shell: ${s}: servers run signed runbooks in bash; remove it, or write shell: bash`),n.push(...hh(r));let i=new Set;for(let u of dB(r))for(let f of me(u.info).checks?.captures??[])f.secret&&i.add(f.name);let o=[];for(let u of dB(r)){let f=o.length+1,d=`cell ${f} (${u.value.split(`
99
+ `)[0]?.slice(0,40)??""})`,h=me(u.info);for(let D of h.errors)n.push(`${d}: invalid option ${D}`);let p=[];try{for(let D of Xe(u.value)){let m=`\${${D.kind}:${D.name}${D.kind==="input"&&D.secret?":secret":""}}`;D.kind==="secret"?n.push(`${d}: ${m} can't be signed (servers log the values signed cells get)`):D.secret?n.push(`${d}: ${m} can't be signed: a secret input would be in the servers' logs`):D.kind==="out"&&i.has(D.name)?n.push(`${d}: ${m} comes from capture-secret= and can't be signed (servers log the values)`):e.patterns[D.name]===void 0?n.push(`${d}: ${m} needs a pattern (--pattern ${D.name}=REGEX)`):p.includes(D.name)||p.push(D.name)}}catch(D){n.push(`${d}: ${D instanceof Error?D.message:String(D)}`)}for(let D of u.value.matchAll(/\$\{(secret|input|param|out):[^}\s]*/g))/^\$\{((secret|param|out):[A-Za-z_][A-Za-z0-9_]*|input:[A-Za-z_][A-Za-z0-9_]*(:secret)?)$/.test(D[0])||n.push(`${d}: ${D[0]}} is not a plain \${${D[1]}:NAME} and can't be signed`);let k=Nn(h.kubeContext);k!==void 0&&e.patterns[k]===void 0&&n.push(`${d}: kube-context=\${param:${k}} needs a pattern (--pattern ${k}=REGEX)`);for(let[D,m]of Object.entries(h.env))Ft.test(D)?Il(D)&&n.push(`${d}: env.${D} can't be set by a signed runbook (it changes how the shell runs the code)`):n.push(`${d}: env.${D} is not a variable name`),/\$\{(secret|input|param|out):/.test(m)&&n.push(`${d}: env.${D} can't use placeholders in a signed runbook`);o.push({n:f,lines:h.lines==="any"?"any":"all",info:u.info,code:hr(u.value,"bash"),needs:p,...h.cwd!==void 0?{cwd:h.cwd}:{},env:h.env,steps:Tl(u.value,"bash").map(D=>hr(D.text,"bash"))})}let B=[];for(let u of _l(r)){let f=B.length+1,d=`runbook call ${f} (src=${et(u.info,u.value).src??"?"})`,h=et(u.info,u.value);for(let k of h.problems)n.push(`${d}: ${k.message}`);for(let k of me(u.info).errors)n.push(`${d}: invalid option ${k}`);h.src!==void 0&&/^([A-Za-z]:)?[\\/]/.test(h.src)&&n.push(`${d}: src= must be relative: a signed runbook calls runbooks in its own repository`);let p=[];try{for(let k of Gt(h)){let D=`\${${k.kind}:${k.name}}`;k.kind==="secret"||k.secret?n.push(`${d}: ${D} can't be signed: pass secrets to the runbook called another way`):e.patterns[k.name]===void 0?n.push(`${d}: ${D} needs a pattern (--pattern ${k.name}=REGEX)`):p.includes(k.name)||p.push(k.name)}}catch(k){n.push(`${d}: ${k instanceof Error?k.message:String(k)}`)}B.push({n:f,info:u.info,body:u.value,needs:p})}if(o.length===0&&B.length===0&&n.push("no bash or sh cells to sign"),n.length>0)return{errors:n};let a=new Set([...o.flatMap(u=>u.needs),...B.flatMap(u=>u.needs)]),l=Object.fromEntries(Object.entries(e.patterns).filter(([u])=>a.has(u))),c=t.version===1?{}:{text:Pl(r)};return{manifest:{...e,scopes:[...new Set(e.scopes)],patterns:l,cells:o,calls:B,...c}}}function hh(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return[];let t=e.findIndex((o,B)=>B>0&&/^(---|\.\.\.)\s*$/.test(o));if(t<0)return[];let n=[],s=new Set,i=!1;for(let o of e.slice(1,t)){let B=/^(report-runs(?:-required|-signed|-token)?)\s*:\s*(.*?)\s*$/i.exec(o);if(!B)continue;let a=B[1].toLowerCase(),l=B[2].replace(/\s+#.*$/,"").replace(/^(["'])(.*)\1$/,"$2");if(s.has(a)&&n.push(`front matter ${a}: written twice (keep one)`),s.add(a),a==="report-runs"){let c=zt(l);c&&n.push(`front matter report-runs: ${c}`)}else a==="report-runs-token"?/^\$\{secret:[A-Za-z_][A-Za-z0-9_]*\}$/.test(l)||n.push("front matter report-runs-token: only ${secret:NAME}, never a token in the file"):(/^(true|false|yes|no|on|off)$/i.test(l)||n.push(`front matter ${a}: expected true or false`),/^(true|yes|on)$/i.test(l)&&(i=!0))}return!s.has("report-runs")&&(i||s.has("report-runs-token"))&&n.push("front matter report-runs-required, -signed or -token without report-runs: (the address)"),n}function CB(r){let e=[Nl,`name ${r.name}`,`version ${r.version}`];r.expires&&e.push(`expires ${r.expires}`),r.scopes.length>0&&e.push(`scope ${r.scopes.join(" ")}`),r.text!==void 0&&e.push(`text ${r.text}`);for(let[t,n]of Object.entries(r.patterns))e.push(`param ${t} ${_t(n)}`);for(let t of r.cells){e.push(`cell ${t.n} ${t.lines}`,`info ${_t(t.info)}`,`code ${_t(t.code)}`);for(let n of t.needs)e.push(`needs ${n}`);t.cwd!==void 0&&e.push(`cwd ${_t(t.cwd)}`);for(let[n,s]of Object.entries(t.env))e.push(`env ${n} ${_t(s)}`);for(let n of t.steps)e.push(`step ${_t(n)}`)}for(let t of r.calls){e.push(`call ${t.n}`,`callinfo ${_t(t.info)}`,`callbody ${_t(t.body)}`);for(let n of t.needs)e.push(`callneeds ${n}`)}return e.push("end"),e.join(`
100
100
  `)+`
101
101
  `}function Un(r){let e=r.split(`
102
102
  `);if(e[0]!==Nl)throw new Error("not an md-runbook manifest (or a newer version)");let t={name:"",version:0,scopes:[],patterns:{},cells:[],calls:[]},n,s,i=l=>{if(!s)throw new Error(`manifest: ${l} outside a call`);return s},o=(l,c)=>{let u=l===void 0?void 0:Hl(l);if(u===void 0)throw new Error(`manifest: bad ${c}`);return u},B=l=>{if(!n)throw new Error(`manifest: ${l} outside a cell`);return n},a=!1;for(let l of e.slice(1)){if(a){if(l!=="")throw new Error("manifest: text after end");continue}if(l==="")continue;let[c,u,f,...d]=l.split(" ");if(d.length>0&&c!=="scope")throw new Error(`manifest: bad line "${l.slice(0,40)}"`);switch(c){case"name":t.name=u??"";break;case"version":t.version=Number(u);break;case"expires":t.expires=u;break;case"scope":t.scopes=l.split(" ").slice(1);break;case"text":if(!u||!/^[0-9a-f]{64}$/.test(u)||f!==void 0||t.text!==void 0)throw new Error("manifest: bad text");t.text=u;break;case"param":t.patterns[u??""]=o(f,"pattern");break;case"cell":n={n:Number(u),lines:f==="any"?"any":"all",info:"",code:"",needs:[],env:{},steps:[]},t.cells.push(n);break;case"info":B("info").info=o(u,"info");break;case"code":B("code").code=o(u,"code");break;case"needs":B("needs").needs.push(u??"");break;case"cwd":B("cwd").cwd=o(u,"cwd");break;case"env":B("env").env[u??""]=o(f,"env");break;case"step":B("step").steps.push(o(u,"step"));break;case"call":s={n:Number(u),info:"",body:"",needs:[]},t.calls.push(s);break;case"callinfo":i("callinfo").info=o(u,"callinfo");break;case"callbody":i("callbody").body=o(u,"callbody");break;case"callneeds":i("callneeds").needs.push(u??"");break;case"end":a=!0;break;default:throw new Error(`manifest: unknown item "${c}"`)}}if(!a)throw new Error("manifest: no end");if(!Ml.test(t.name)||!Number.isInteger(t.version)||t.version<1)throw new Error("manifest: bad name or version");return t}var Ch=/^<!-- md-runbook:signature v1 signer=(\S+) signed=(\d{4}-\d{2}-\d{2})\r?\nmanifest\r?\n([A-Za-z0-9+/=\r\n]+?)\r?\nsignature\r?\n([A-Za-z0-9+/=\r\n]+?)((?:\r?\ncosign signer=\S+ signed=\d{4}-\d{2}-\d{2}\r?\n[A-Za-z0-9+/=\r\n]+?)*)\r?\n-->[ \t]*$/m,gh=/cosign signer=(\S+) signed=(\d{4}-\d{2}-\d{2})\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,yi=r=>r.replace(/.{1,76}/g,`$&
@@ -113,7 +113,7 @@ ${yi(e.signature)}
113
113
  `,s=mh(e).replace(/\n/g,n),i=t.replace(/(\r?\n)*$/,"");return(i===""?"":i+n+n)+s+n}function Si(r){return`-----BEGIN SSH SIGNATURE-----
114
114
  ${yi(r)}
115
115
  -----END SSH SIGNATURE-----
116
- `}function jl(r){let e=/-----BEGIN SSH SIGNATURE-----([\s\S]*?)-----END SSH SIGNATURE-----/.exec(r);if(!e)throw new Error("not an SSH signature");return e[1].replace(/\s+/g,"")}function ot(r){let e=Dt(r);if(!e)return;let t;try{t=Un(e.manifest)}catch{return}let n=[...t.cells],s=new Map,i=[],o=[],B=0;for(let d of dB(r)){let h=hr(d.value,"bash"),p;try{p=Xe(d.value).map(b=>b.name)}catch{p=void 0}let k=b=>!!p&&p.length===b.needs.length&&p.every(w=>b.needs.includes(w)),D=n.findIndex(b=>b.info===d.info&&b.code===h&&k(b));if(D<0){i.push(d.index);continue}let m=n.splice(D,1)[0];s.set(d.index,{n:m.n,lines:m.lines,steps:m.steps,needs:m.needs}),m.n<B&&o.push(d.index),B=Math.max(B,m.n)}let a=[...t.calls],l=new Map;for(let d of _l(r)){let h=a.findIndex(p=>p.info===d.info&&p.body===d.value);h<0?i.push(d.index):l.set(d.index,a.splice(h,1)[0])}let c=Gl(t),u=c===2&&Pl(r)!==t.text,f=[];return he(r).cells.forEach((d,h)=>{if(d.kind!=="code"||!ce(d.meta)||Ge(d.languageId))return;let p=Fe(d.languageId);p&&p!=="bash"&&f.push(h)}),{block:e,manifest:t,cells:s,changed:i.sort((d,h)=>d-h),missing:n.map(d=>d.n),moved:o,calls:l,missingCalls:a.map(d=>d.n),version:c,textChanged:u,unsigned:c===2&&!u?[]:f}}var Oi="mdrunbook://open",Eh=256*1024,bh=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Dh=/^[0-9a-f]{64}$/;function Ri(r){let e;try{e=new URL(r.trim())}catch{return{ok:!1,problem:"not-a-link"}}let t=e.searchParams;if(!(e.protocol==="mdrunbook:"||e.protocol==="https:"&&/\/open\/?$/.test(e.pathname)&&(t.has("url")||t.has("rb"))))return e.protocol==="https:"?{ok:!0,link:{url:e.toString(),params:{}}}:{ok:!1,problem:"not-a-link"};let s={params:{}},i=t.get("url"),o=t.get("rb");if(i!==null&&o!==null)return{ok:!1,problem:"both"};if(i!==null){try{if(new URL(i).protocol!=="https:")return{ok:!1,problem:"not-https"}}catch{return{ok:!1,problem:"not-https"}}s.url=i}else if(o!==null){let l=kh(o);if(typeof l!="string")return{ok:!1,problem:l.problem};s.text=l}else return{ok:!1,problem:"no-runbook"};let B=t.get("sha256");if(B!==null){if(!Dh.test(B.toLowerCase()))return{ok:!1,problem:"bad-sha256"};s.sha256=B.toLowerCase()}let a=t.get("host");if(a!==null){if(!bh.test(a))return{ok:!1,problem:"bad-host"};s.host=a}for(let[l,c]of t){if(!l.startsWith("p."))continue;let u=l.slice(2);if(!$t.test(u)||/[\r\n]/.test(c))return{ok:!1,problem:"bad-param"};s.params[u]=c}return t.get("action")==="cosign"&&(s.action="cosign"),{ok:!0,link:s}}function us(r,e=Oi){let t=[],n=(s,i)=>t.push(`${encodeURIComponent(s)}=${encodeURIComponent(i)}`);r.url!==void 0?n("url",r.url):r.text!==void 0&&n("rb",ql(r.text)),r.sha256&&n("sha256",r.sha256),r.host&&n("host",r.host);for(let[s,i]of Object.entries(r.params))n(`p.${s}`,i);return r.action&&n("action",r.action),`${e}?${t.join("&")}`}var Kl="vscode://smojon.md-runbook/open",wh=/[&=#+%]/;function zl(r){return[r.url,r.text!==void 0?ql(r.text):void 0,r.sha256,r.host,...Object.entries(r.params).flat()].some(t=>t!==void 0&&wh.test(t))?`${Kl}?link=${encodeURIComponent(us(r))}`:us(r,Kl)}function Yl(r){if(r.startsWith("link="))return Ri(r.slice(5));let e=r.split("&").map(t=>{let n=t.indexOf("=");return n<0?encodeURIComponent(t):`${encodeURIComponent(t.slice(0,n))}=${encodeURIComponent(t.slice(n+1))}`});return Ri(`${Oi}?${e.join("&")}`)}function ls(r){return Qt(r.replace(/^/,""))}function ql(r){return xh(Al(new TextEncoder().encode(r),{level:9}))}function kh(r){let e;try{e=vh(r)}catch{return{problem:"bad-text"}}let t=[],n=0,s=!1,i=new $l(a=>{n+=a.length,n>Eh?s=!0:t.push(a)});try{for(let a=0;a<e.length&&!s;a+=4096)i.push(e.subarray(a,a+4096),a+4096>=e.length)}catch{return{problem:"bad-text"}}if(s)return{problem:"too-large"};let o=new Uint8Array(n),B=0;for(let a of t)o.set(a,B),B+=a.length;try{return new TextDecoder().decode(o)}catch{return{problem:"bad-text"}}}var as="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function xh(r){let e="";for(let t=0;t<r.length;t+=3){let n=r[t]<<16|(r[t+1]??0)<<8|(r[t+2]??0);e+=as[n>>18&63]+as[n>>12&63],t+1<r.length&&(e+=as[n>>6&63]),t+2<r.length&&(e+=as[n&63])}return e}function vh(r){let e=r.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_");if(/[^A-Za-z0-9_-]/.test(e)||e.length%4===1)throw new Error("not base64url");let t=new Uint8Array(Math.floor(e.length*3/4)),n=0,s=0,i=0;for(let o of e)s=s<<6|as.indexOf(o),n+=6,n>=8&&(n-=8,t[i++]=s>>n&255);return t}var Ql="[A-Za-z0-9+/=\\r\\n]+?",Vl=new RegExp(`^<!-- md-runbook:record-signature v1 signer=(\\S+) signed=(\\S+) sha256=([0-9a-f]{64})\\r?\\nsignature\\r?\\n(${Ql})((?:\\r?\\ncosign signer=\\S+ signed=\\S+\\r?\\n${Ql})*)\\r?\\n-->[ \\t]*$`,"m"),yh=/cosign signer=(\S+) signed=(\S+)\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,Wl=r=>r.replace(/.{1,76}/g,`$&
116
+ `}function jl(r){let e=/-----BEGIN SSH SIGNATURE-----([\s\S]*?)-----END SSH SIGNATURE-----/.exec(r);if(!e)throw new Error("not an SSH signature");return e[1].replace(/\s+/g,"")}function ot(r){let e=Dt(r);if(!e)return;let t;try{t=Un(e.manifest)}catch{return}let n=[...t.cells],s=new Map,i=[],o=[],B=0;for(let d of dB(r)){let h=hr(d.value,"bash"),p;try{p=Xe(d.value).map(b=>b.name)}catch{p=void 0}let k=b=>!!p&&p.length===b.needs.length&&p.every(w=>b.needs.includes(w)),D=n.findIndex(b=>b.info===d.info&&b.code===h&&k(b));if(D<0){i.push(d.index);continue}let m=n.splice(D,1)[0];s.set(d.index,{n:m.n,lines:m.lines,steps:m.steps,needs:m.needs}),m.n<B&&o.push(d.index),B=Math.max(B,m.n)}let a=[...t.calls],l=new Map;for(let d of _l(r)){let h=a.findIndex(p=>p.info===d.info&&p.body===d.value);h<0?i.push(d.index):l.set(d.index,a.splice(h,1)[0])}let c=Gl(t),u=c===2&&Pl(r)!==t.text,f=[];return he(r).cells.forEach((d,h)=>{if(d.kind!=="code"||!ce(d.meta)||Ge(d.languageId))return;let p=$e(d.languageId);p&&p!=="bash"&&f.push(h)}),{block:e,manifest:t,cells:s,changed:i.sort((d,h)=>d-h),missing:n.map(d=>d.n),moved:o,calls:l,missingCalls:a.map(d=>d.n),version:c,textChanged:u,unsigned:c===2&&!u?[]:f}}var Oi="mdrunbook://open",Eh=256*1024,bh=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Dh=/^[0-9a-f]{64}$/;function Ri(r){let e;try{e=new URL(r.trim())}catch{return{ok:!1,problem:"not-a-link"}}let t=e.searchParams;if(!(e.protocol==="mdrunbook:"||e.protocol==="https:"&&/\/open\/?$/.test(e.pathname)&&(t.has("url")||t.has("rb"))))return e.protocol==="https:"?{ok:!0,link:{url:e.toString(),params:{}}}:{ok:!1,problem:"not-a-link"};let s={params:{}},i=t.get("url"),o=t.get("rb");if(i!==null&&o!==null)return{ok:!1,problem:"both"};if(i!==null){try{if(new URL(i).protocol!=="https:")return{ok:!1,problem:"not-https"}}catch{return{ok:!1,problem:"not-https"}}s.url=i}else if(o!==null){let l=kh(o);if(typeof l!="string")return{ok:!1,problem:l.problem};s.text=l}else return{ok:!1,problem:"no-runbook"};let B=t.get("sha256");if(B!==null){if(!Dh.test(B.toLowerCase()))return{ok:!1,problem:"bad-sha256"};s.sha256=B.toLowerCase()}let a=t.get("host");if(a!==null){if(!bh.test(a))return{ok:!1,problem:"bad-host"};s.host=a}for(let[l,c]of t){if(!l.startsWith("p."))continue;let u=l.slice(2);if(!Ft.test(u)||/[\r\n]/.test(c))return{ok:!1,problem:"bad-param"};s.params[u]=c}return t.get("action")==="cosign"&&(s.action="cosign"),{ok:!0,link:s}}function us(r,e=Oi){let t=[],n=(s,i)=>t.push(`${encodeURIComponent(s)}=${encodeURIComponent(i)}`);r.url!==void 0?n("url",r.url):r.text!==void 0&&n("rb",Yl(r.text)),r.sha256&&n("sha256",r.sha256),r.host&&n("host",r.host);for(let[s,i]of Object.entries(r.params))n(`p.${s}`,i);return r.action&&n("action",r.action),`${e}?${t.join("&")}`}var Kl="vscode://smojon.md-runbook/open",wh=/[&=#+%]/;function zl(r){return[r.url,r.text!==void 0?Yl(r.text):void 0,r.sha256,r.host,...Object.entries(r.params).flat()].some(t=>t!==void 0&&wh.test(t))?`${Kl}?link=${encodeURIComponent(us(r))}`:us(r,Kl)}function ql(r){if(r.startsWith("link="))return Ri(r.slice(5));let e=r.split("&").map(t=>{let n=t.indexOf("=");return n<0?encodeURIComponent(t):`${encodeURIComponent(t.slice(0,n))}=${encodeURIComponent(t.slice(n+1))}`});return Ri(`${Oi}?${e.join("&")}`)}function ls(r){return Qt(r.replace(/^/,""))}function Yl(r){return xh(Al(new TextEncoder().encode(r),{level:9}))}function kh(r){let e;try{e=vh(r)}catch{return{problem:"bad-text"}}let t=[],n=0,s=!1,i=new Fl(a=>{n+=a.length,n>Eh?s=!0:t.push(a)});try{for(let a=0;a<e.length&&!s;a+=4096)i.push(e.subarray(a,a+4096),a+4096>=e.length)}catch{return{problem:"bad-text"}}if(s)return{problem:"too-large"};let o=new Uint8Array(n),B=0;for(let a of t)o.set(a,B),B+=a.length;try{return new TextDecoder().decode(o)}catch{return{problem:"bad-text"}}}var as="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function xh(r){let e="";for(let t=0;t<r.length;t+=3){let n=r[t]<<16|(r[t+1]??0)<<8|(r[t+2]??0);e+=as[n>>18&63]+as[n>>12&63],t+1<r.length&&(e+=as[n>>6&63]),t+2<r.length&&(e+=as[n&63])}return e}function vh(r){let e=r.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_");if(/[^A-Za-z0-9_-]/.test(e)||e.length%4===1)throw new Error("not base64url");let t=new Uint8Array(Math.floor(e.length*3/4)),n=0,s=0,i=0;for(let o of e)s=s<<6|as.indexOf(o),n+=6,n>=8&&(n-=8,t[i++]=s>>n&255);return t}var Ql="[A-Za-z0-9+/=\\r\\n]+?",Vl=new RegExp(`^<!-- md-runbook:record-signature v1 signer=(\\S+) signed=(\\S+) sha256=([0-9a-f]{64})\\r?\\nsignature\\r?\\n(${Ql})((?:\\r?\\ncosign signer=\\S+ signed=\\S+\\r?\\n${Ql})*)\\r?\\n-->[ \\t]*$`,"m"),yh=/cosign signer=(\S+) signed=(\S+)\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,Wl=r=>r.replace(/.{1,76}/g,`$&
117
117
  `).trimEnd();function bB(r){return`md-runbook run record v1
118
118
  sha256 ${r}
119
119
  `}function Sh(r){let e=Vl.exec(r);if(!e)return;let t=[...(e[5]??"").trim().matchAll(yh)].map(n=>({signer:n[1],signed:n[2],signature:n[3].replace(/\s+/g,"")}));return{signer:e[1],signed:e[2],sha256:e[3],signature:e[4].replace(/\s+/g,""),...t.length?{cosigners:t}:{}}}function Zl(r){let e=Vl.exec(r);return e?r.slice(0,e.index).replace(/(\r?\n)[ \t]*(\r?\n)+$/,"$1")+r.slice(e.index+e[0].length).replace(/^\r?\n/,""):r}function Ai(r){return ls(Zl(r))}function Rh(r){return`<!-- md-runbook:record-signature v1 signer=${cn(r.signer)} signed=${r.signed} sha256=${r.sha256}
@@ -124,17 +124,17 @@ ${Wl(e.signature)}
124
124
  `).join("")+"-->"}function Xl(r,e){let t=Zl(r),n=/\r\n/.test(t)?`\r
125
125
  `:`
126
126
  `;return`${t.replace(/(\r?\n)*$/,"")}${n}${n}${Rh(e).replace(/\n/g,n)}${n}`}function cs(r){let e=Sh(r);return e?{block:e,unchanged:Ai(r)===e.sha256}:void 0}var wr=r=>[r.signer,...(r.cosigners??[]).map(e=>e.signer)];function ec(r,e){return{...r,cosigners:[...(r.cosigners??[]).filter(t=>t.signer!==cn(e.signer)),e]}}function DB(r,e,t){return r===void 0?"none":t==="failed"?"fail":t==="ok"||r==="0"||r==="done"?e===void 0?"ok":"none":r==="running"||r==="declined"||r==="proposed"?"none":r==="skipped"?"skip":"fail"}function Oh(r,e,t){if(e!==void 0&&DB(r,e,t)==="none")return`<span class="badge none">${re(`\u2013 lines ${e} ran`)}</span>`;if(t==="failed")return`<span class="badge fail">${re("\u2717 check failed")}</span>`;if(t==="ok")return`<span class="badge ok">${re(`\u2713 ${/^-?\d+$/.test(r??"")?`exit ${r}`:r??""}`)}</span>`;let n=DB(r),s=r!==void 0&&!/^-?\d+$/.test(r),i=n==="none"?s?`\u2013 ${r}`:"not run":n==="ok"?s?`\u2713 ${r}`:"\u2713 exit 0":n==="skip"?"\u2013 skipped":`\u2717 ${/^-?\d+$/.test(r)?`exit ${r}`:r}`;return`<span class="badge ${n}">${re(i)}</span>`}function Ah(r){let e;for(let t of r.split(`
127
- `)){let n=/^ {0,3}(`{3,}|~{3,})/.exec(t)?.[1];if(e!==void 0){n&&n[0]===e[0]&&n.length>=e.length&&t.trim()===n&&(e=void 0);continue}if(n){e=n;continue}let s=/^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(t);if(s?.[1])return s[1].replace(/[*_`]/g,"")}}function $h(r){let e=r.split(`
127
+ `)){let n=/^ {0,3}(`{3,}|~{3,})/.exec(t)?.[1];if(e!==void 0){n&&n[0]===e[0]&&n.length>=e.length&&t.trim()===n&&(e=void 0);continue}if(n){e=n;continue}let s=/^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(t);if(s?.[1])return s[1].replace(/[*_`]/g,"")}}function Fh(r){let e=r.split(`
128
128
  `);if(e[0]?.replace(/^\uFEFF/,"").trimEnd()!=="---")return;let t=e.findIndex((n,s)=>s>0&&/^(---|\.\.\.)[ \t]*$/.test(n));if(!(t<0))return{yaml:e.slice(1,t).join(`
129
129
  `),rest:e.slice(t+1).join(`
130
- `)}}function Fh(r,e){let t=[];for(let n of[...r.split("/"),...e.split(/[\\/]+/)])n===""||n==="."||(n===".."&&t.length>0&&t[t.length-1]!==".."?t.pop():t.push(n));return t.join("/")}function tc(r,e,t,n,s,i,o=""){let B=he(r),a,l="",c="",u=0,f=0,d=m=>{let b=B.cells[m].meta;return ce(b)?me(b.info).os:void 0},h=Pn(B.cells.map((m,b)=>ce(m.meta)?{kind:"code",os:d(b)}:{kind:"markup"})),p=new Map;h.forEach((m,b)=>{if(!m)return;let w=p.get(m.group);(w===void 0||!B.cells[w].output&&B.cells[b].output)&&p.set(m.group,b)});let k=Bn(B.cells.map((m,b)=>ce(m.meta)?{kind:"code",os:d(b)}:{kind:"markup"})),D=new Map;k.forEach((m,b)=>m!==void 0&&D.set(b,m)),u=Math.max(0,...k.filter(m=>m!==void 0));for(let[m,b]of B.cells.entries()){if(!ce(b.meta)){let se=b.value;if(m===0){let te=$h(se);te&&(c+=`<div class="front-matter">${Xs(n(te.yaml),"front matter")}</div>
131
- `,se=te.rest)}a??=Ah(se),c+=yo(se,n);continue}let w=h[m],R=w!==void 0&&p.get(w.group)!==m,y=D.get(m),T=b.output?.attrs??{},v=R?"skip":DB(T.exit,T.lines,T.check);R||s[v]++;let E=R?`<span class="badge skip">${re(`\u2013 for ${Cr(d(m)??[])}`)}</span>`:Oh(T.exit,T.lines,T.check),S=`${e}${y}`,O=R?`step-${S.replace(/\./g,"-")}-${m}`:`step-${S.replace(/\./g,"-")}`,P=b.meta.lang,X=n(b.value),Y=X.split(`
132
- `).find(se=>se.trim()!=="")?.trim()??"",W=me(b.meta.info).estimateSeconds,ee=W!==void 0?`est. ${it(W)}`:void 0;if(l+=`<tr class="${v}${e?" nested":""}"><td><a href="#${O}">${S}</a></td><td><code>${re(Y)}</code></td><td>${re(P)}</td><td>${E}</td><td>${re(T.ran??"")}</td><td>${re([T.duration,ee].filter(Boolean).join(" \xB7 "))}</td></tr>
130
+ `)}}function $h(r,e){let t=[];for(let n of[...r.split("/"),...e.split(/[\\/]+/)])n===""||n==="."||(n===".."&&t.length>0&&t[t.length-1]!==".."?t.pop():t.push(n));return t.join("/")}function tc(r,e,t,n,s,i,o=""){let B=he(r),a,l="",c="",u=0,f=0,d=m=>{let b=B.cells[m].meta;return ce(b)?me(b.info).os:void 0},h=Pn(B.cells.map((m,b)=>ce(m.meta)?{kind:"code",os:d(b)}:{kind:"markup"})),p=new Map;h.forEach((m,b)=>{if(!m)return;let w=p.get(m.group);(w===void 0||!B.cells[w].output&&B.cells[b].output)&&p.set(m.group,b)});let k=Bn(B.cells.map((m,b)=>ce(m.meta)?{kind:"code",os:d(b)}:{kind:"markup"})),D=new Map;k.forEach((m,b)=>m!==void 0&&D.set(b,m)),u=Math.max(0,...k.filter(m=>m!==void 0));for(let[m,b]of B.cells.entries()){if(!ce(b.meta)){let se=b.value;if(m===0){let te=Fh(se);te&&(c+=`<div class="front-matter">${Xs(n(te.yaml),"front matter")}</div>
131
+ `,se=te.rest)}a??=Ah(se),c+=yo(se,n);continue}let w=h[m],R=w!==void 0&&p.get(w.group)!==m,y=D.get(m),T=b.output?.attrs??{},v=R?"skip":DB(T.exit,T.lines,T.check);R||s[v]++;let E=R?`<span class="badge skip">${re(`\u2013 for ${Cr(d(m)??[])}`)}</span>`:Oh(T.exit,T.lines,T.check),S=`${e}${y}`,O=R?`step-${S.replace(/\./g,"-")}-${m}`:`step-${S.replace(/\./g,"-")}`,P=b.meta.lang,X=n(b.value),q=X.split(`
132
+ `).find(se=>se.trim()!=="")?.trim()??"",W=me(b.meta.info).estimateSeconds,ee=W!==void 0?`est. ${it(W)}`:void 0;if(l+=`<tr class="${v}${e?" nested":""}"><td><a href="#${O}">${S}</a></td><td><code>${re(q)}</code></td><td>${re(P)}</td><td>${E}</td><td>${re(T.ran??"")}</td><td>${re([T.duration,ee].filter(Boolean).join(" \xB7 "))}</td></tr>
133
133
  `,c+=`<section class="step ${v}" id="${O}">
134
134
  <div class="step-head">Step ${S}${R?" (alternative)":""}</div>
135
135
  `,c+=Xs(X,P),b.output){let se=[T.ran&&`ran ${T.ran}`,T.duration,ee].filter(Boolean).map(te=>re(te));c+=`<div class="output"><div class="output-head">${E} ${se.join(" \xB7 ")}</div><pre>${re(n(Ot(b.output.text)))}</pre></div>
136
- `}let q=Ge(b.meta.lang)?hi(T):void 0;if(q&&t.readCall&&i<mr){let se=Fh(o,q.copy),te=t.readCall(se);if(te===void 0)c+=`<p class="call-note">${re(`The copy ${se} is not there: its steps can't be shown.`)}</p>
137
- `;else{let ye=q.sha256===void 0||Qt(te)===q.sha256;c+=`<div class="call"><p class="call-note">Ran <code>${re(q.runbook)}</code> as <a href="${re(encodeURI(se))}"><code>${re(se)}</code></a>`+(ye?"":` \xB7 <span class="badge fail">${re("\u2717 the copy changed after the run (its SHA-256 differs)")}</span>`)+`</p>
136
+ `}let Y=Ge(b.meta.lang)?hi(T):void 0;if(Y&&t.readCall&&i<mr){let se=$h(o,Y.copy),te=t.readCall(se);if(te===void 0)c+=`<p class="call-note">${re(`The copy ${se} is not there: its steps can't be shown.`)}</p>
137
+ `;else{let ye=Y.sha256===void 0||Qt(te)===Y.sha256;c+=`<div class="call"><p class="call-note">Ran <code>${re(Y.runbook)}</code> as <a href="${re(encodeURI(se))}"><code>${re(se)}</code></a>`+(ye?"":` \xB7 <span class="badge fail">${re("\u2717 the copy changed after the run (its SHA-256 differs)")}</span>`)+`</p>
138
138
  `;let ge=tc(te,`${S}.`,t,n,s,i+1,se.includes("/")?se.slice(0,se.lastIndexOf("/")):"");l+=ge.rows,f+=ge.total,c+=ge.body+`</div>
139
139
  `}}c+=`</section>
140
140
  `}return{rows:l,body:c,...a!==void 0?{title:a}:{},step:u,total:u+f}}function wB(r,e){let t=u=>e.redact?e.redact(u):u,n={ok:0,fail:0,skip:0,none:0},{rows:s,body:i,title:o,total:B}=tc(r,"",e,t,n,0),a=o??e.fallbackTitle??"Runbook report",l=[`${B} step${B===1?"":"s"}`,`${n.ok} passed`,`${n.fail} failed`];n.skip&&l.push(`${n.skip} skipped`),n.none&&l.push(`${n.none} not run`);let c=Th(wi(r),cs(r),t);return`<!DOCTYPE html>
@@ -217,7 +217,7 @@ ${o}</tbody>
217
217
  ${B}</tbody>
218
218
  </table>
219
219
  `:"")+`</section>
220
- `,l=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",c=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${l?`@top-right{content:${JSON.stringify(l)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:c}}function Lh(r){return me(r).part??"body"}function Nh(r){return Ge(r.language)||Fe(r.language)!==void 0}function xB(r){let e=r.map(n=>Nh(n)?Lh(n.info):void 0),t=e.indexOf("ready");return{parts:e,...t>=0?{ready:t}:{},any:e.some(n=>n!==void 0&&n!=="body")}}function nc(r){let e=[],{parts:t}=xB(r),n=a=>r[a].line+1,s,i,o,B;return t.forEach((a,l)=>{if(a!==void 0){if(a==="ready"){Ge(r[l].language)?e.push({at:l,message:"ready: the ready check is a shell block (exit 0 = up), not a runbook call"}):s!==void 0?e.push({at:l,message:`ready: a runbook has one ready check (the first one is on line ${n(s)})`}):B!==void 0&&e.push({at:l,message:`ready: the ready check comes before the setup steps it guards (a setup step is on line ${n(B)})`}),s??=l;return}if(a==="setup"){B??=l;let c=i??o;c!==void 0&&e.push({at:l,message:`setup: setup steps come before the runbook's own steps (one is on line ${n(c)})`});return}if(a==="body"){i??=l,o!==void 0&&e.push({at:l,message:`a step after the teardown (line ${n(o)}): teardown steps come last; mark this one teardown, or move it up`});return}o??=l}}),e}var vB=new Set(["timeout","estimate","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","on-failure","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","setup","teardown","ready","proposed","by","reason","approved","approved-by","approved-at"]),sc=/^\s*[^\s{]*/;function rc(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(i,o)=>s===0?o:o===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let i=r[n-1]===e[s-1]?0:1,o=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+i);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(o=Math.min(o,t[n-2][s-2]+1)),t[n][s]=o}return t[r.length][e.length]}function ic(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,i=!1;for(let o of vB){let B=o.endsWith("y")?`${o.slice(0,-1)}ies`:`${o}s`,a=Math.min(rc(e,o),rc(e,B));a<s?(n=o,s=a,i=!1):a===s&&(i=!0)}return n!==void 0&&s<=t&&!i?n:void 0}var Mh=/^(PATH|BASH_ENV|ENV|IFS|PROMPT_COMMAND|PS4|SHELLOPTS|BASHOPTS|CDPATH|LD_\w+|DYLD_\w+|NODE_OPTIONS|PYTHONPATH|PYTHONSTARTUP|PERL5OPT|PERL5LIB|RUBYOPT|GIT_SSH_COMMAND|GIT_EXEC_PATH)$/i;function Gh(r,e,t){let n=[],s=r.findIndex((o,B)=>B>0&&B<e&&/^env\s*:/i.test(o));if(s<0)return n;if(!/^env\s*:\s*(#.*)?$/i.test(r[s]))return n.push({severity:"warning",line:s,message:"front matter env: is ignored: write each variable on its own indented line below it ( NAME: value)"}),n;let i=new Set;for(let o=s+1;o<e;o++){let B=r[o];if(B.trim()===""||B.trim().startsWith("#"))continue;if(!/^\s/.test(B))break;let a=Ho.exec(B);if(!a){n.push({severity:"warning",line:o,message:`front matter env: "${B.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let l=a[1];if(i.has(l)){n.push({severity:"warning",line:o,message:`front matter env: ${l} is set twice: the first one counts`});continue}i.add(l),Mh.test(l)&&n.push({severity:"warning",line:o,message:`front matter env: ${l} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${l}=)`})}return t&&i.size>0&&n.push({severity:"warning",line:s,message:"front matter env: is used in VS Code and the command line only: the md-runbook app doesn't use it for a signed runbook's cells (the front matter isn't signed); put what a host needs on the cells (env.NAME=)"}),n}function Ph(r,e,t){let n=[],s={};for(let l=1;l<t;l++){let c=/^(report-runs(?:-required|-signed|-token)?)\s*:\s*(.*?)\s*$/i.exec(e[l]);if(!c)continue;let u=c[1].toLowerCase(),f=c[2].replace(/\s+#.*$/,"").replace(/^(["'])(.*)\1$/,"$2");if(s[u]!==void 0){n.push({severity:"warning",line:l,message:`front matter ${u}: written twice: the first one counts`});continue}if(s[u]=l,u==="report-runs"){let d=zt(f);d&&n.push({severity:"warning",line:l,message:`front matter report-runs: "${f}" is ignored: ${d}`})}else if(u==="report-runs-token"){if(/^\$\{secret:[A-Za-z_][A-Za-z0-9_]*\}$/.test(f))continue;n.push({severity:"error",line:l,message:"front matter report-runs-token: never write a token in the file (anyone who reads it can send reports): use ${secret:NAME}, kept in your secret store"})}else/^(true|false|yes|no|on|off)$/i.test(f)||n.push({severity:"warning",line:l,message:`front matter ${u}: "${f}" is ignored (expected true or false)`})}let i=ve(r),o=[i?.reportRunsRequired?"report-runs-required":void 0,i?.reportRunsSigned?"report-runs-signed":void 0].filter(l=>!!l);if(!i?.reportRuns){for(let l of[...o,...i?.reportRunsToken?["report-runs-token"]:[]])n.push({severity:"warning",line:s[l]??0,message:`front matter ${l}: has no effect without report-runs: (the address)`});return n}if(o.length===0)return n;let B=ot(r),a;return Dt(r)?B?B.version!==2?a="the signature covers only its blocks, not the front matter: sign the runbook again":B.textChanged&&(a="the runbook changed since signing: sign it again"):a="the signature block is damaged":a="the runbook is not signed",a&&n.push({severity:"warning",line:s[o[0]]??0,message:`front matter ${o.join(" and ")}: ignored, ${a}. Until then clients ask before reporting (they honour these only in a runbook signed by a signer they trust)`}),n}function oc(r,e={}){let t=[],n=he(r),s=ft(n),i=ve(r);if(i){let u=r.replace(/^/,"").split(/\r?\n/),f=u.findIndex((h,p)=>p>0&&/^(---|\.\.\.)\s*$/.test(h));for(let h=1;h<f;h++){let p=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion|manual-steps)\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;let k=p[1].toLowerCase();if(k==="mode"&&i.mode===void 0||k==="timeout"&&i.timeoutSeconds===void 0||k==="cwd"&&i.cwd===void 0||k==="kube-context"&&i.kubeContext===void 0||k==="kube-context-mode"&&i.kubeContextMode===void 0||k==="git-bash-path-conversion"&&i.gitBashPathConversion===void 0||k==="manual-steps"&&i.manualSteps===void 0){let m={mode:"session or isolated",timeout:"seconds, e.g. 300",cwd:"a folder","kube-context":"a Kubernetes context name, e.g. prod-eu, or ${param:NAME}","kube-context-mode":"check or pin","git-bash-path-conversion":"on or off","manual-steps":"pause or continue"};t.push({severity:"warning",line:h,message:`front matter ${k}: "${p[2]}" is ignored (expected ${m[k]})`})}}let d={};for(let h=1;h<f;h++){let p=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;if(p[1]===""){t.push({severity:"warning",line:h,message:"front matter shell: is empty: write the names on the same line (shell: zsh, pwsh), not as a list below it"});continue}let{shells:k,unknown:D,twice:m}=Ur(p[1]);for(let b of["unix","powershell"]){let w=k[b];w&&(d[b]?m.push(w):d[b]=w)}for(let b of D){let w=/[\\/]/.test(b)?`front matter shell: "${b}" is ignored: name a shell (${[...Hr,..._r].join(", ")}), never a path`:`front matter shell: "${b}" is ignored (expected ${Hr.join(", ")} for sh/bash cells, ${_r.join(" or ")} for PowerShell cells)`;t.push({severity:"warning",line:h,message:w})}for(let b of m)t.push({severity:"warning",line:h,message:`front matter shell: "${b}" is ignored: one shell per kind of cell, the first one counts`})}t.push(...Gh(u,f,ot(r)!==void 0)),t.push(...Ph(r,u,f));for(let h of i.params){if(!h.choices||h.default===void 0||h.choices.includes(h.default))continue;let p=u.findIndex((k,D)=>D>0&&D<f&&new RegExp(`^\\s*-\\s+${h.name}\\b`).test(k));t.push({severity:"warning",line:Math.max(0,p),message:`front matter params: the default of ${h.name}, "${h.default}", is not one of its choices (${h.choices.join(", ")})`})}}let o=i?.kubeContextMode==="pin",B=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(u=>/^kube-context-mode\s*:/i.test(u)));o&&!i?.kubeContext&&!s.some(u=>me(u.info).kubeContext!==void 0)&&t.push({severity:"warning",line:B(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),o&&i?.practice&&t.push({severity:"warning",line:B(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${i.practice}: there the Kubernetes context is only checked`});let a=new Set((i?.params??[]).map(u=>u.name)),l=new Set;for(let u of s){let f=n.cells[u.cellIndex];if(ce(f.meta)&&Ge(u.language)){t.push(...Hh(u,a,l,e));for(let w of me(u.info).checks?.captures??[])l.add(w.name);continue}if(!ce(f.meta)||!Fe(u.language))continue;let d=(w,R,y,T)=>{t.push({severity:w,message:R,line:y===void 0?u.line:u.line+1+y,cell:{index:u.cellIndex,...y!==void 0?{sourceLine:y}:{}},...T?{fix:T}:{}})},h=me(u.info);for(let w of h.errors)d("error",`invalid cell option ${w}`);let p=u.info.replace(sc,"");for(let w of an(p)){let R=w.key.toLowerCase();if(vB.has(R)||R.startsWith("env.")&&R.length>4)continue;let y=ic(R);y?d("warning",`unknown cell option "${w.key}" (ignored): did you mean "${y}"?`,void 0,{option:w.key,to:y}):d("warning",`unknown cell option "${w.key}" (ignored)`)}/(^|\s)every=/i.test(p)&&!h.retry&&d("warning","every= has no effect without retry="),h.host&&i?.env&&d("warning",`front matter env: doesn't apply on the host ${h.host}: there the cell gets only its own env.NAME= variables`);let k=h.kubeContext??i?.kubeContext;o&&h.host&&k&&d("warning",`kube-context-mode: pin doesn't apply on the host ${h.host}: there kubectl's current context must already be ${k} (only checked)`);let D=[];try{D=gr(u.source,u.info,i)}catch(w){d("error",w instanceof Error?w.message:String(w))}let m=u.source.split(/\r?\n/),b=w=>{let R=m.findIndex(y=>y.includes(w));return R<0?void 0:R};for(let w of D){let R="${"+w.kind+":"+w.name;w.kind==="out"&&!l.has(w.name)&&d("error",`\${out:${w.name}} is not captured by an earlier block (add capture=${w.name} to the block that prints it)`,b(R)),w.kind==="param"&&!a.has(w.name)&&d("warning",`\${param:${w.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${w.name}=\u2026)`,b(R))}for(let w of h.checks?.captures??[])l.add(w.name)}for(let u of nc(s)){let f=s[u.at];t.push({severity:"error",message:u.message,line:f.line,cell:{index:f.cellIndex}})}let c=ot(r);if(c){let u=i?.shell?.unix;if(u&&u!=="bash"){let f=r.replace(/^/,"").split(/\r?\n/).findIndex(d=>/^shell\s*:/i.test(d));t.push({severity:"warning",line:Math.max(0,f),message:`front matter shell: ${u} in a signed runbook: servers run its signed blocks in bash, and without the gate they would run in ${u}`})}for(let f of s.filter(d=>c.changed.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let f of s.filter(d=>c.moved.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${c.cells.get(f.cellIndex).n}, after blocks that now come later`});c.textChanged&&t.push({severity:"warning",line:Math.max(0,$i(r)),message:"the runbook changed since signing (its prose, front matter, checklists or other blocks): clients no longer show it as signed as a whole (sign it again)"});for(let f of s.filter(d=>c.unsigned.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:c.version===1?"block not covered by the signature: it was signed before manifest version 2, which signs only bash/sh blocks (sign the runbook again to cover the whole runbook)":"block not covered by the signature any more: the runbook changed since signing (sign it again)"});c.missingCalls.length>0&&t.push({severity:"warning",line:Math.max(0,$i(r)),message:`signed runbook call${c.missingCalls.length===1?"":"s"} ${c.missingCalls.join(", ")} of ${c.manifest.calls.length} not in the file as signed (deleted or changed since signing)`}),c.missing.length>0&&t.push({severity:"warning",line:Math.max(0,$i(r)),message:`signed block${c.missing.length===1?"":"s"} ${c.missing.join(", ")} of ${c.manifest.cells.length} not in the file as signed (deleted or changed since signing)`})}else{let u=$i(r);u>=0&&t.push({severity:"error",line:u,message:"the signature block is damaged (sign the runbook again)"})}return t.sort((u,f)=>u.line-f.line)}function Hh(r,e,t,n){let s=[],i=(f,d,h,p)=>{s.push({severity:f,message:d,line:h===void 0?r.line:r.line+1+h,cell:{index:r.cellIndex,...h!==void 0?{sourceLine:h}:{}},...p?{fix:p}:{}})},o=me(r.info);for(let f of o.errors)i("error",`invalid cell option ${f}`);for(let f of an(r.info.replace(sc,""))){let d=f.key.toLowerCase();if(ul.has(d)||d.startsWith("env.")){i("warning",`${f.key}= has no effect on a runbook call (ignored): it runs no shell of its own; put it on the blocks of the runbook called`);continue}if(vB.has(d)||al.has(d))continue;let h=ic(d)??(["source","file","path","srcs"].includes(d)?"src":["sections","part"].includes(d)?"section":void 0);h?i("warning",`unknown cell option "${f.key}" (ignored): did you mean "${h}"?`,void 0,{option:f.key,to:h}):i("warning",`unknown cell option "${f.key}" (ignored)`)}let B=et(r.info,r.source);for(let f of B.problems)i("error",f.message,f.line);let a=[];try{a=Gt(B)}catch(f){i("error",f instanceof Error?f.message:String(f))}let l=f=>B.args.find(d=>d.value.includes(f))?.line;for(let f of a){let d="${"+f.kind+":"+f.name;f.kind==="out"&&!t.has(f.name)&&i("error",`\${out:${f.name}} is not captured by an earlier block (add capture=${f.name} to the block that prints it)`,l(d)),f.kind==="param"&&!e.has(f.name)&&i("warning",`\${param:${f.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${f.name}=\u2026)`,l(d))}if(B.src===void 0)return s;if(Er(B.src)){let f=ll(B.src),d=n.matchRunbooks?.(f);return d&&d.length===0&&i("warning",`src="${B.src}": no runbook matches ${f} yet`),s}if(!n.readRunbook)return s;let c=n.readRunbook(B.src);if(c===null)return s;if(c===void 0)return i("error",`src="${B.src}": no such runbook (relative to this file)`),s;let u=pi(B,c);for(let f of u.unknown)i("error",`${f.name}: the runbook called (${B.src}) has no parameter ${f.name}`,f.line);for(let f of u.notPassed)i("warning",`${B.src} needs \${param:${f}}, which this call doesn't pass and which has no default: it will be asked (on the command line: an error)`);for(let f of u.sections)i("error",f);for(let f of u.manualOnly)i("warning",`section="${f}" holds manual steps only (task-list items): the command line runs none of it, and a runbook that keeps evidence fails until they are ticked`);return s}function $i(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Ke(n,e)&&(e=null):(e=_e(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function Bc(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var SB=require("node:child_process"),yB=require("node:string_decoder");function Fi(r,e=process.platform){if(e==="win32"){(0,SB.spawn)("taskkill",["/PID",String(r),"/T","/F"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>{});return}let t=n=>{try{process.kill(-r,n)}catch{try{process.kill(r,n)}catch{}}};t("SIGTERM"),setTimeout(()=>t("SIGKILL"),2e3).unref()}var _h=1e3;function RB(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,i=!1,o,B=h=>{i||(i=!0,clearTimeout(o),r.signal?.removeEventListener("abort",a),t({...h,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,c()};if(r.signal?.aborted){s=!0,B({exitCode:null,signal:null});return}let l=(0,SB.spawn)(r.command,r.args,{cwd:r.cwd,env:r.env??process.env,stdio:["ignore","pipe","pipe"],windowsHide:!0,detached:process.platform!=="win32",windowsVerbatimArguments:r.windowsVerbatimArguments}),c=()=>{l.pid!==void 0&&l.exitCode===null&&Fi(l.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(o=setTimeout(()=>{n=!0,c()},r.timeoutMs));let u=new yB.StringDecoder("utf8"),f=new yB.StringDecoder("utf8");l.stdout?.on("data",h=>r.onStdout(u.write(h))),l.stderr?.on("data",h=>r.onStderr(f.write(h)));let d=(h,p)=>{if(i)return;let k=u.end(),D=f.end();k&&r.onStdout(k),D&&r.onStderr(D),B({exitCode:h,signal:p})};l.on("error",h=>B({exitCode:null,signal:null,error:h.message})),l.on("close",d),l.on("exit",(h,p)=>{setTimeout(()=>{i||(l.stdout?.destroy(),l.stderr?.destroy(),d(h,p))},_h)})})}var Wt=ue(require("node:fs")),$B=ue(require("node:os")),xr=ue(require("node:path"));var uc=require("node:child_process"),Uh=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function lc(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function cc(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(o=>o.toUpperCase()===n.toUpperCase()),i=s===void 0?void 0:e[s];return i===void 0?t:i})}function ac(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function fc(r,e){let t=new Set(r.split(";").map(ac).filter(Boolean)),n=[];for(let s of e){let i=ac(s);!i||t.has(i)||(t.add(i),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var Jh=r=>new Promise(e=>{(0,uc.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),Ti,jh=3e3;async function dc(r,e=Date.now(),t=Jh){if(!Ti||e-Ti.at>=jh){let n=await Promise.all(Uh.map(async s=>lc(await t(s))));Ti={at:e,values:n}}return Ti.values.flatMap(n=>cc(n,r).split(";").filter(s=>s.trim()))}async function OB(r,e=process.platform,t=dc){if(e!=="win32")return r;let n=Object.keys(r).find(o=>o.toUpperCase()==="PATH")??"Path",s=r[n]??"",i=fc(s,await t(r));return i!==s&&(r[n]=i),r}var kr=ue(require("node:path"));function Jn(r,e,t){switch(r){case"pwsh":return Kh(e,t);case"cmd":return zh(t);case"bash":return qh(e,t)}}function pc(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=kr.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function Kh(r,e){let t=e.platform==="win32",n=r.runbook?.powershell,s;if(n==="windows-powershell"){if(!t)return{ok:!1,error:"Windows PowerShell 5.1 runs only on Windows (the runbook's shell: windows-powershell)."};if(s=pc(e),!s)return{ok:!1,error:"Windows PowerShell 5.1 not found (the runbook's shell: windows-powershell)."}}else{if(s=r.pwshPath?.trim()||e.which("pwsh"),!s&&n==="pwsh")return{ok:!1,error:"PowerShell 7 (pwsh) not found (the runbook's shell: pwsh): install it or set mdRunbook.shell.pwshPath."};!s&&t&&(s=pc(e)),s||(s=e.which("powershell"))}if(!s)return{ok:!1,error:"PowerShell not found: install PowerShell 7 (pwsh) or set mdRunbook.shell.pwshPath."};let i=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:i,extension:".ps1",args:o=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Cc(o)],script:o=>"\uFEFF"+o.replace(/\r?\n/g,t?`\r
220
+ `,l=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",c=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${l?`@top-right{content:${JSON.stringify(l)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:c}}function Lh(r){return me(r).part??"body"}function Nh(r){return Ge(r.language)||$e(r.language)!==void 0}function xB(r){let e=r.map(n=>Nh(n)?Lh(n.info):void 0),t=e.indexOf("ready");return{parts:e,...t>=0?{ready:t}:{},any:e.some(n=>n!==void 0&&n!=="body")}}function nc(r){let e=[],{parts:t}=xB(r),n=a=>r[a].line+1,s,i,o,B;return t.forEach((a,l)=>{if(a!==void 0){if(a==="ready"){Ge(r[l].language)?e.push({at:l,message:"ready: the ready check is a shell block (exit 0 = up), not a runbook call"}):s!==void 0?e.push({at:l,message:`ready: a runbook has one ready check (the first one is on line ${n(s)})`}):B!==void 0&&e.push({at:l,message:`ready: the ready check comes before the setup steps it guards (a setup step is on line ${n(B)})`}),s??=l;return}if(a==="setup"){B??=l;let c=i??o;c!==void 0&&e.push({at:l,message:`setup: setup steps come before the runbook's own steps (one is on line ${n(c)})`});return}if(a==="body"){i??=l,o!==void 0&&e.push({at:l,message:`a step after the teardown (line ${n(o)}): teardown steps come last; mark this one teardown, or move it up`});return}o??=l}}),e}var vB=new Set(["timeout","estimate","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","on-failure","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","setup","teardown","ready","proposed","by","reason","approved","approved-by","approved-at"]),sc=/^\s*[^\s{]*/;function rc(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(i,o)=>s===0?o:o===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let i=r[n-1]===e[s-1]?0:1,o=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+i);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(o=Math.min(o,t[n-2][s-2]+1)),t[n][s]=o}return t[r.length][e.length]}function ic(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,i=!1;for(let o of vB){let B=o.endsWith("y")?`${o.slice(0,-1)}ies`:`${o}s`,a=Math.min(rc(e,o),rc(e,B));a<s?(n=o,s=a,i=!1):a===s&&(i=!0)}return n!==void 0&&s<=t&&!i?n:void 0}var Mh=/^(PATH|BASH_ENV|ENV|IFS|PROMPT_COMMAND|PS4|SHELLOPTS|BASHOPTS|CDPATH|LD_\w+|DYLD_\w+|NODE_OPTIONS|PYTHONPATH|PYTHONSTARTUP|PERL5OPT|PERL5LIB|RUBYOPT|GIT_SSH_COMMAND|GIT_EXEC_PATH)$/i;function Gh(r,e,t){let n=[],s=r.findIndex((o,B)=>B>0&&B<e&&/^env\s*:/i.test(o));if(s<0)return n;if(!/^env\s*:\s*(#.*)?$/i.test(r[s]))return n.push({severity:"warning",line:s,message:"front matter env: is ignored: write each variable on its own indented line below it ( NAME: value)"}),n;let i=new Set;for(let o=s+1;o<e;o++){let B=r[o];if(B.trim()===""||B.trim().startsWith("#"))continue;if(!/^\s/.test(B))break;let a=Ho.exec(B);if(!a){n.push({severity:"warning",line:o,message:`front matter env: "${B.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let l=a[1];if(i.has(l)){n.push({severity:"warning",line:o,message:`front matter env: ${l} is set twice: the first one counts`});continue}i.add(l),Mh.test(l)&&n.push({severity:"warning",line:o,message:`front matter env: ${l} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${l}=)`})}return t&&i.size>0&&n.push({severity:"warning",line:s,message:"front matter env: is used in VS Code and the command line only: the md-runbook app doesn't use it for a signed runbook's cells (the front matter isn't signed); put what a host needs on the cells (env.NAME=)"}),n}function Ph(r,e,t){let n=[],s={};for(let l=1;l<t;l++){let c=/^(report-runs(?:-required|-signed|-token)?)\s*:\s*(.*?)\s*$/i.exec(e[l]);if(!c)continue;let u=c[1].toLowerCase(),f=c[2].replace(/\s+#.*$/,"").replace(/^(["'])(.*)\1$/,"$2");if(s[u]!==void 0){n.push({severity:"warning",line:l,message:`front matter ${u}: written twice: the first one counts`});continue}if(s[u]=l,u==="report-runs"){let d=zt(f);d&&n.push({severity:"warning",line:l,message:`front matter report-runs: "${f}" is ignored: ${d}`})}else if(u==="report-runs-token"){if(/^\$\{secret:[A-Za-z_][A-Za-z0-9_]*\}$/.test(f))continue;n.push({severity:"error",line:l,message:"front matter report-runs-token: never write a token in the file (anyone who reads it can send reports): use ${secret:NAME}, kept in your secret store"})}else/^(true|false|yes|no|on|off)$/i.test(f)||n.push({severity:"warning",line:l,message:`front matter ${u}: "${f}" is ignored (expected true or false)`})}let i=ve(r),o=[i?.reportRunsRequired?"report-runs-required":void 0,i?.reportRunsSigned?"report-runs-signed":void 0].filter(l=>!!l);if(!i?.reportRuns){for(let l of[...o,...i?.reportRunsToken?["report-runs-token"]:[]])n.push({severity:"warning",line:s[l]??0,message:`front matter ${l}: has no effect without report-runs: (the address)`});return n}if(o.length===0)return n;let B=ot(r),a;return Dt(r)?B?B.version!==2?a="the signature covers only its blocks, not the front matter: sign the runbook again":B.textChanged&&(a="the runbook changed since signing: sign it again"):a="the signature block is damaged":a="the runbook is not signed",a&&n.push({severity:"warning",line:s[o[0]]??0,message:`front matter ${o.join(" and ")}: ignored, ${a}. Until then clients ask before reporting (they honour these only in a runbook signed by a signer they trust)`}),n}function oc(r,e={}){let t=[],n=he(r),s=ft(n),i=ve(r);if(i){let u=r.replace(/^/,"").split(/\r?\n/),f=u.findIndex((h,p)=>p>0&&/^(---|\.\.\.)\s*$/.test(h));for(let h=1;h<f;h++){let p=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion|manual-steps)\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;let k=p[1].toLowerCase();if(k==="mode"&&i.mode===void 0||k==="timeout"&&i.timeoutSeconds===void 0||k==="cwd"&&i.cwd===void 0||k==="kube-context"&&i.kubeContext===void 0||k==="kube-context-mode"&&i.kubeContextMode===void 0||k==="git-bash-path-conversion"&&i.gitBashPathConversion===void 0||k==="manual-steps"&&i.manualSteps===void 0){let m={mode:"session or isolated",timeout:"seconds, e.g. 300",cwd:"a folder","kube-context":"a Kubernetes context name, e.g. prod-eu, or ${param:NAME}","kube-context-mode":"check or pin","git-bash-path-conversion":"on or off","manual-steps":"pause or continue"};t.push({severity:"warning",line:h,message:`front matter ${k}: "${p[2]}" is ignored (expected ${m[k]})`})}}let d={};for(let h=1;h<f;h++){let p=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;if(p[1]===""){t.push({severity:"warning",line:h,message:"front matter shell: is empty: write the names on the same line (shell: zsh, pwsh), not as a list below it"});continue}let{shells:k,unknown:D,twice:m}=Ur(p[1]);for(let b of["unix","powershell"]){let w=k[b];w&&(d[b]?m.push(w):d[b]=w)}for(let b of D){let w=/[\\/]/.test(b)?`front matter shell: "${b}" is ignored: name a shell (${[...Hr,..._r].join(", ")}), never a path`:`front matter shell: "${b}" is ignored (expected ${Hr.join(", ")} for sh/bash cells, ${_r.join(" or ")} for PowerShell cells)`;t.push({severity:"warning",line:h,message:w})}for(let b of m)t.push({severity:"warning",line:h,message:`front matter shell: "${b}" is ignored: one shell per kind of cell, the first one counts`})}t.push(...Gh(u,f,ot(r)!==void 0)),t.push(...Ph(r,u,f));for(let h of i.params){if(!h.choices||h.default===void 0||h.choices.includes(h.default))continue;let p=u.findIndex((k,D)=>D>0&&D<f&&new RegExp(`^\\s*-\\s+${h.name}\\b`).test(k));t.push({severity:"warning",line:Math.max(0,p),message:`front matter params: the default of ${h.name}, "${h.default}", is not one of its choices (${h.choices.join(", ")})`})}}let o=i?.kubeContextMode==="pin",B=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(u=>/^kube-context-mode\s*:/i.test(u)));o&&!i?.kubeContext&&!s.some(u=>me(u.info).kubeContext!==void 0)&&t.push({severity:"warning",line:B(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),o&&i?.practice&&t.push({severity:"warning",line:B(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${i.practice}: there the Kubernetes context is only checked`});let a=new Set((i?.params??[]).map(u=>u.name)),l=new Set;for(let u of s){let f=n.cells[u.cellIndex];if(ce(f.meta)&&Ge(u.language)){t.push(...Hh(u,a,l,e));for(let w of me(u.info).checks?.captures??[])l.add(w.name);continue}if(!ce(f.meta)||!$e(u.language))continue;let d=(w,R,y,T)=>{t.push({severity:w,message:R,line:y===void 0?u.line:u.line+1+y,cell:{index:u.cellIndex,...y!==void 0?{sourceLine:y}:{}},...T?{fix:T}:{}})},h=me(u.info);for(let w of h.errors)d("error",`invalid cell option ${w}`);let p=u.info.replace(sc,"");for(let w of an(p)){let R=w.key.toLowerCase();if(vB.has(R)||R.startsWith("env.")&&R.length>4)continue;let y=ic(R);y?d("warning",`unknown cell option "${w.key}" (ignored): did you mean "${y}"?`,void 0,{option:w.key,to:y}):d("warning",`unknown cell option "${w.key}" (ignored)`)}/(^|\s)every=/i.test(p)&&!h.retry&&d("warning","every= has no effect without retry="),h.host&&i?.env&&d("warning",`front matter env: doesn't apply on the host ${h.host}: there the cell gets only its own env.NAME= variables`);let k=h.kubeContext??i?.kubeContext;o&&h.host&&k&&d("warning",`kube-context-mode: pin doesn't apply on the host ${h.host}: there kubectl's current context must already be ${k} (only checked)`);let D=[];try{D=gr(u.source,u.info,i)}catch(w){d("error",w instanceof Error?w.message:String(w))}let m=u.source.split(/\r?\n/),b=w=>{let R=m.findIndex(y=>y.includes(w));return R<0?void 0:R};for(let w of D){let R="${"+w.kind+":"+w.name;w.kind==="out"&&!l.has(w.name)&&d("error",`\${out:${w.name}} is not captured by an earlier block (add capture=${w.name} to the block that prints it)`,b(R)),w.kind==="param"&&!a.has(w.name)&&d("warning",`\${param:${w.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${w.name}=\u2026)`,b(R))}for(let w of h.checks?.captures??[])l.add(w.name)}for(let u of nc(s)){let f=s[u.at];t.push({severity:"error",message:u.message,line:f.line,cell:{index:f.cellIndex}})}let c=ot(r);if(c){let u=i?.shell?.unix;if(u&&u!=="bash"){let f=r.replace(/^/,"").split(/\r?\n/).findIndex(d=>/^shell\s*:/i.test(d));t.push({severity:"warning",line:Math.max(0,f),message:`front matter shell: ${u} in a signed runbook: servers run its signed blocks in bash, and without the gate they would run in ${u}`})}for(let f of s.filter(d=>c.changed.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let f of s.filter(d=>c.moved.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${c.cells.get(f.cellIndex).n}, after blocks that now come later`});c.textChanged&&t.push({severity:"warning",line:Math.max(0,Fi(r)),message:"the runbook changed since signing (its prose, front matter, checklists or other blocks): clients no longer show it as signed as a whole (sign it again)"});for(let f of s.filter(d=>c.unsigned.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:c.version===1?"block not covered by the signature: it was signed before manifest version 2, which signs only bash/sh blocks (sign the runbook again to cover the whole runbook)":"block not covered by the signature any more: the runbook changed since signing (sign it again)"});c.missingCalls.length>0&&t.push({severity:"warning",line:Math.max(0,Fi(r)),message:`signed runbook call${c.missingCalls.length===1?"":"s"} ${c.missingCalls.join(", ")} of ${c.manifest.calls.length} not in the file as signed (deleted or changed since signing)`}),c.missing.length>0&&t.push({severity:"warning",line:Math.max(0,Fi(r)),message:`signed block${c.missing.length===1?"":"s"} ${c.missing.join(", ")} of ${c.manifest.cells.length} not in the file as signed (deleted or changed since signing)`})}else{let u=Fi(r);u>=0&&t.push({severity:"error",line:u,message:"the signature block is damaged (sign the runbook again)"})}return t.sort((u,f)=>u.line-f.line)}function Hh(r,e,t,n){let s=[],i=(f,d,h,p)=>{s.push({severity:f,message:d,line:h===void 0?r.line:r.line+1+h,cell:{index:r.cellIndex,...h!==void 0?{sourceLine:h}:{}},...p?{fix:p}:{}})},o=me(r.info);for(let f of o.errors)i("error",`invalid cell option ${f}`);for(let f of an(r.info.replace(sc,""))){let d=f.key.toLowerCase();if(ul.has(d)||d.startsWith("env.")){i("warning",`${f.key}= has no effect on a runbook call (ignored): it runs no shell of its own; put it on the blocks of the runbook called`);continue}if(vB.has(d)||al.has(d))continue;let h=ic(d)??(["source","file","path","srcs"].includes(d)?"src":["sections","part"].includes(d)?"section":void 0);h?i("warning",`unknown cell option "${f.key}" (ignored): did you mean "${h}"?`,void 0,{option:f.key,to:h}):i("warning",`unknown cell option "${f.key}" (ignored)`)}let B=et(r.info,r.source);for(let f of B.problems)i("error",f.message,f.line);let a=[];try{a=Gt(B)}catch(f){i("error",f instanceof Error?f.message:String(f))}let l=f=>B.args.find(d=>d.value.includes(f))?.line;for(let f of a){let d="${"+f.kind+":"+f.name;f.kind==="out"&&!t.has(f.name)&&i("error",`\${out:${f.name}} is not captured by an earlier block (add capture=${f.name} to the block that prints it)`,l(d)),f.kind==="param"&&!e.has(f.name)&&i("warning",`\${param:${f.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${f.name}=\u2026)`,l(d))}if(B.src===void 0)return s;if(Er(B.src)){let f=ll(B.src),d=n.matchRunbooks?.(f);return d&&d.length===0&&i("warning",`src="${B.src}": no runbook matches ${f} yet`),s}if(!n.readRunbook)return s;let c=n.readRunbook(B.src);if(c===null)return s;if(c===void 0)return i("error",`src="${B.src}": no such runbook (relative to this file)`),s;let u=pi(B,c);for(let f of u.unknown)i("error",`${f.name}: the runbook called (${B.src}) has no parameter ${f.name}`,f.line);for(let f of u.notPassed)i("warning",`${B.src} needs \${param:${f}}, which this call doesn't pass and which has no default: it will be asked (on the command line: an error)`);for(let f of u.sections)i("error",f);for(let f of u.manualOnly)i("warning",`section="${f}" holds manual steps only (task-list items): the command line runs none of it, and a runbook that keeps evidence fails until they are ticked`);return s}function Fi(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Ke(n,e)&&(e=null):(e=_e(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function Bc(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var SB=require("node:child_process"),yB=require("node:string_decoder");function $i(r,e=process.platform){if(e==="win32"){(0,SB.spawn)("taskkill",["/PID",String(r),"/T","/F"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>{});return}let t=n=>{try{process.kill(-r,n)}catch{try{process.kill(r,n)}catch{}}};t("SIGTERM"),setTimeout(()=>t("SIGKILL"),2e3).unref()}var _h=1e3;function RB(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,i=!1,o,B=h=>{i||(i=!0,clearTimeout(o),r.signal?.removeEventListener("abort",a),t({...h,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,c()};if(r.signal?.aborted){s=!0,B({exitCode:null,signal:null});return}let l=(0,SB.spawn)(r.command,r.args,{cwd:r.cwd,env:r.env??process.env,stdio:["ignore","pipe","pipe"],windowsHide:!0,detached:process.platform!=="win32",windowsVerbatimArguments:r.windowsVerbatimArguments}),c=()=>{l.pid!==void 0&&l.exitCode===null&&$i(l.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(o=setTimeout(()=>{n=!0,c()},r.timeoutMs));let u=new yB.StringDecoder("utf8"),f=new yB.StringDecoder("utf8");l.stdout?.on("data",h=>r.onStdout(u.write(h))),l.stderr?.on("data",h=>r.onStderr(f.write(h)));let d=(h,p)=>{if(i)return;let k=u.end(),D=f.end();k&&r.onStdout(k),D&&r.onStderr(D),B({exitCode:h,signal:p})};l.on("error",h=>B({exitCode:null,signal:null,error:h.message})),l.on("close",d),l.on("exit",(h,p)=>{setTimeout(()=>{i||(l.stdout?.destroy(),l.stderr?.destroy(),d(h,p))},_h)})})}var Wt=ue(require("node:fs")),FB=ue(require("node:os")),xr=ue(require("node:path"));var uc=require("node:child_process"),Uh=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function lc(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function cc(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(o=>o.toUpperCase()===n.toUpperCase()),i=s===void 0?void 0:e[s];return i===void 0?t:i})}function ac(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function fc(r,e){let t=new Set(r.split(";").map(ac).filter(Boolean)),n=[];for(let s of e){let i=ac(s);!i||t.has(i)||(t.add(i),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var Jh=r=>new Promise(e=>{(0,uc.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),Ti,jh=3e3;async function dc(r,e=Date.now(),t=Jh){if(!Ti||e-Ti.at>=jh){let n=await Promise.all(Uh.map(async s=>lc(await t(s))));Ti={at:e,values:n}}return Ti.values.flatMap(n=>cc(n,r).split(";").filter(s=>s.trim()))}async function OB(r,e=process.platform,t=dc){if(e!=="win32")return r;let n=Object.keys(r).find(o=>o.toUpperCase()==="PATH")??"Path",s=r[n]??"",i=fc(s,await t(r));return i!==s&&(r[n]=i),r}var kr=ue(require("node:path"));function Jn(r,e,t){switch(r){case"pwsh":return Kh(e,t);case"cmd":return zh(t);case"bash":return Yh(e,t)}}function pc(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=kr.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function Kh(r,e){let t=e.platform==="win32",n=r.runbook?.powershell,s;if(n==="windows-powershell"){if(!t)return{ok:!1,error:"Windows PowerShell 5.1 runs only on Windows (the runbook's shell: windows-powershell)."};if(s=pc(e),!s)return{ok:!1,error:"Windows PowerShell 5.1 not found (the runbook's shell: windows-powershell)."}}else{if(s=r.pwshPath?.trim()||e.which("pwsh"),!s&&n==="pwsh")return{ok:!1,error:"PowerShell 7 (pwsh) not found (the runbook's shell: pwsh): install it or set mdRunbook.shell.pwshPath."};!s&&t&&(s=pc(e)),s||(s=e.which("powershell"))}if(!s)return{ok:!1,error:"PowerShell not found: install PowerShell 7 (pwsh) or set mdRunbook.shell.pwshPath."};let i=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:i,extension:".ps1",args:o=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Cc(o)],script:o=>"\uFEFF"+o.replace(/\r?\n/g,t?`\r
221
221
  `:`
222
222
  `)+(t?`\r
223
223
  `:`
@@ -225,19 +225,19 @@ ${B}</tbody>
225
225
  `)+`\r
226
226
  `}}}function AB(r){let e=kr.win32,t=[];for(let s of[r.env.ProgramFiles,r.env.ProgramW6432,r.env["ProgramFiles(x86)"]])s&&t.push(e.join(s,"Git","bin","bash.exe"));r.env.LOCALAPPDATA&&t.push(e.join(r.env.LOCALAPPDATA,"Programs","Git","bin","bash.exe")),r.env.USERPROFILE&&t.push(e.join(r.env.USERPROFILE,"scoop","apps","git","current","bin","bash.exe"));let n=r.which("git.exe")??r.which("git");if(n){let s=e.dirname(n);t.push(e.join(s,"..","bin","bash.exe"),e.join(s,"..","..","bin","bash.exe"))}return[...new Set(t.map(s=>e.normalize(s)))]}function gc(r){return/\\(System32|Sysnative)\\bash\.exe$/i.test(r)||/\\WindowsApps\\/i.test(r)}function hc(r,e){let t=r.which(e);return t&&!gc(t)?t:void 0}var mc=(r,e,t)=>({kind:"bash",command:r,label:e,extension:".sh",args:n=>[t?n.replace(/\\/g,"/"):n],script:n=>n.replace(/\r\n/g,`
227
227
  `)+`
228
- `});function Yh(r,e,t){let n=t.platform==="win32",s;if(r==="zsh")s=n?hc(t,"zsh.exe"):t.which("zsh");else if(!n)s=t.exists("/bin/sh")?"/bin/sh":t.which("sh");else{let i=e.bashPath?.trim();s=[...i?[i]:[],...AB(t)].map(o=>kr.win32.join(kr.win32.dirname(o),"sh.exe")).find(o=>t.exists(o)),s??=hc(t,"sh.exe")}return s?{ok:!0,shell:mc(s,r,n)}:{ok:!1,error:`${r} not found${n&&r==="sh"?": install Git for Windows":n?" on PATH (WSL's is not used)":" on PATH"} (the runbook's shell: ${r}).`}}function qh(r,e){let t=r.runbook?.unix;if(t==="zsh"||t==="sh")return Yh(t,r,e);let n=e.platform==="win32",s=r.bashPath?.trim()||void 0;if(!s&&n){if(s=AB(e).find(i=>e.exists(i)),!s){let i=e.which("bash.exe");i&&!gc(i)&&(s=i)}if(!s)return{ok:!1,error:"Git Bash not found: install Git for Windows or set mdRunbook.shell.bashPath to bash.exe."}}return s||(s=e.which("bash")??(t==="bash"?void 0:e.which("sh"))),s?{ok:!0,shell:mc(s,/(^|[\\/])sh$/.test(s)?"sh":"bash",n)}:{ok:!1,error:`bash not found on PATH${t==="bash"?" (the runbook's shell: bash)":""}: set mdRunbook.shell.bashPath.`}}function Ec(r,e=process.env){let t=(e.PATH??e.Path??"").split(xr.delimiter).filter(Boolean),n=process.platform==="win32"?["",...(e.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")]:[""];for(let s of t)for(let i of n){let o=xr.join(s,r.toLowerCase().endsWith(i.toLowerCase())?r:r+i);try{if(Wt.statSync(o).isFile())return o}catch{}}}function fn(r=process.env){return{platform:process.platform,env:r,exists:e=>{try{return Wt.statSync(e).isFile()}catch{return!1}},which:e=>Ec(e,r)}}async function ds(r,e,t){let n={...process.env,...e};return r.refreshPath!==!1&&await OB(n,t),bc(n,t)}function bc(r,e){return e!=="win32"||Object.keys(r).some(n=>/^(PYTHONIOENCODING|PYTHONUTF8)$/i.test(n))||(r.PYTHONIOENCODING="utf-8"),r}function Ii(r,e){return r.env===process.env?{...r,env:e,which:t=>Ec(t,e)}:r}async function jn(r,e=fn()){let t=f=>({exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:f,durationMs:0}),n=Fe(r.language);if(!n)return t(`No shell for language '${r.language}'.`);let s=await ds(r.settings,r.env,e.platform),i=Jn(n,r.settings,Ii(e,s));if(!i.ok)return t(i.error);let o=i.shell,B=Wt.mkdtempSync(xr.join($B.tmpdir(),"md-runbook-")),a=xr.join(B,"cell"+o.extension),l=r.source,c=r.cwd,u=o.args(a);o.kind==="cmd"&&/^[\\/]{2}/.test(c)&&(l=`pushd "${c}" >nul 2>&1 || (echo md-runbook: cannot open ${c} 1>&2 & exit /b 1)\r
228
+ `});function qh(r,e,t){let n=t.platform==="win32",s;if(r==="zsh")s=n?hc(t,"zsh.exe"):t.which("zsh");else if(!n)s=t.exists("/bin/sh")?"/bin/sh":t.which("sh");else{let i=e.bashPath?.trim();s=[...i?[i]:[],...AB(t)].map(o=>kr.win32.join(kr.win32.dirname(o),"sh.exe")).find(o=>t.exists(o)),s??=hc(t,"sh.exe")}return s?{ok:!0,shell:mc(s,r,n)}:{ok:!1,error:`${r} not found${n&&r==="sh"?": install Git for Windows":n?" on PATH (WSL's is not used)":" on PATH"} (the runbook's shell: ${r}).`}}function Yh(r,e){let t=r.runbook?.unix;if(t==="zsh"||t==="sh")return qh(t,r,e);let n=e.platform==="win32",s=r.bashPath?.trim()||void 0;if(!s&&n){if(s=AB(e).find(i=>e.exists(i)),!s){let i=e.which("bash.exe");i&&!gc(i)&&(s=i)}if(!s)return{ok:!1,error:"Git Bash not found: install Git for Windows or set mdRunbook.shell.bashPath to bash.exe."}}return s||(s=e.which("bash")??(t==="bash"?void 0:e.which("sh"))),s?{ok:!0,shell:mc(s,/(^|[\\/])sh$/.test(s)?"sh":"bash",n)}:{ok:!1,error:`bash not found on PATH${t==="bash"?" (the runbook's shell: bash)":""}: set mdRunbook.shell.bashPath.`}}function Ec(r,e=process.env){let t=(e.PATH??e.Path??"").split(xr.delimiter).filter(Boolean),n=process.platform==="win32"?["",...(e.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")]:[""];for(let s of t)for(let i of n){let o=xr.join(s,r.toLowerCase().endsWith(i.toLowerCase())?r:r+i);try{if(Wt.statSync(o).isFile())return o}catch{}}}function fn(r=process.env){return{platform:process.platform,env:r,exists:e=>{try{return Wt.statSync(e).isFile()}catch{return!1}},which:e=>Ec(e,r)}}async function ds(r,e,t){let n={...process.env,...e};return r.refreshPath!==!1&&await OB(n,t),bc(n,t)}function bc(r,e){return e!=="win32"||Object.keys(r).some(n=>/^(PYTHONIOENCODING|PYTHONUTF8)$/i.test(n))||(r.PYTHONIOENCODING="utf-8"),r}function Ii(r,e){return r.env===process.env?{...r,env:e,which:t=>Ec(t,e)}:r}async function jn(r,e=fn()){let t=f=>({exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:f,durationMs:0}),n=$e(r.language);if(!n)return t(`No shell for language '${r.language}'.`);let s=await ds(r.settings,r.env,e.platform),i=Jn(n,r.settings,Ii(e,s));if(!i.ok)return t(i.error);let o=i.shell,B=Wt.mkdtempSync(xr.join(FB.tmpdir(),"md-runbook-")),a=xr.join(B,"cell"+o.extension),l=r.source,c=r.cwd,u=o.args(a);o.kind==="cmd"&&/^[\\/]{2}/.test(c)&&(l=`pushd "${c}" >nul 2>&1 || (echo md-runbook: cannot open ${c} 1>&2 & exit /b 1)\r
229
229
  ${l}\r
230
- popd`,c=$B.tmpdir()),o.kind==="bash"&&e.platform==="win32"&&/['"\[\]*?{}$`]/.test(a)&&(s.MDRB_SCRIPT=u[0]??a,u=["-c",'. "$MDRB_SCRIPT"']);try{return Wt.writeFileSync(a,o.script(l),"utf8"),{...await RB({command:o.command,args:u,cwd:c,env:s,timeoutMs:r.timeoutMs,signal:r.signal,windowsVerbatimArguments:o.windowsVerbatimArguments,onStdout:r.onStdout,onStderr:r.onStderr}),shell:o}}finally{try{Wt.rmSync(B,{recursive:!0,force:!0})}catch{}}}var dn=ue(require("node:fs")),ps=ue(require("node:os")),Kn=ue(require("node:path"));var Dc={MSYS_NO_PATHCONV:"1",MSYS2_ARG_CONV_EXCL:"*"};function vr(r,e,t){if(t!=="win32")return r[e];let n=Object.keys(r).find(s=>s.toUpperCase()===e);return n===void 0?void 0:r[n]}var Qh=r=>{try{return dn.statSync(r).isFile()}catch{return!1}};function wc(r,e=process.platform,t=Qh){let n=vr(r,"KUBECONFIG",e);if(n)return n;let s=e==="win32"?Kn.win32.join:Kn.posix.join;if(e!=="win32")return s(r.HOME||ps.homedir(),".kube","config");let i=vr(r,"HOMEDRIVE",e),o=vr(r,"HOMEPATH",e);return[vr(r,"HOME",e),i&&o?i+o:void 0,vr(r,"USERPROFILE",e)].filter(l=>!!l).map(l=>s(l,".kube","config")).find(t)??s(vr(r,"USERPROFILE",e)||ps.homedir(),".kube","config")}var hs=class{constructor(e=ps.tmpdir()){this.tmp=e}tmp;dir;files=new Map;file(e){let t=this.files.get(e);t===void 0&&this.files.set(e,t=`pin-${this.files.size+1}.kubeconfig`);let n=()=>{this.dir??=dn.mkdtempSync(Kn.join(this.tmp,"md-runbook-kube-"));let s=Kn.join(this.dir,t);return dn.writeFileSync(s,Wu(e),{mode:384}),s};try{return n()}catch(s){if(s.code!=="ENOENT")throw s;return this.dir=void 0,n()}}dispose(){if(this.dir!==void 0){try{dn.rmSync(this.dir,{recursive:!0,force:!0})}catch{}this.dir=void 0}}};function FB(r){let e=r.platform??process.platform,t=r.frontMatter,n={...t?.env},s={},i=!1;if(t?.kubeContextMode==="pin"&&r.pins){let o=wc(r.env,e);r.kubeContext!==void 0?(s.KUBECONFIG=Vu(r.pins.file(r.kubeContext),o,e),i=!0):s.KUBECONFIG=o}return t?.gitBashPathConversion==="off"&&e==="win32"&&Fe(r.language)==="bash"&&Object.assign(s,Dc),{env:s,defaults:n,pinned:i}}function TB(r,e){return{...e.defaults,...r,...e.env}}var kc=require("node:child_process"),xc=require("node:crypto"),Ct=ue(require("node:fs")),vc=ue(require("node:os")),Ni=ue(require("node:path"));function Mi(r){return(0,xc.createHash)("sha256").update(r,"utf8").digest("hex")}function Li(r,e,t){return new Promise((n,s)=>{let i=(0,kc.spawn)(r,e,{stdio:[t==="inherit"?"inherit":"pipe","pipe","pipe"],windowsHide:!0}),o="",B="";i.stdout.on("data",a=>o+=a.toString("utf8")),i.stderr.on("data",a=>B+=a.toString("utf8")),i.on("error",a=>s(new Error(`${r}: ${a.message} (OpenSSH's ssh-keygen is needed)`))),i.on("close",a=>n({code:a,stdout:o,stderr:B})),t!=="inherit"&&(i.stdin.on("error",()=>{}),i.stdin.end(t))})}function yc(){return Ct.mkdtempSync(Ni.join(vc.tmpdir(),"md-runbook-sign-"))}async function zn(r,e,t={}){let n=yc();try{let s=Ni.join(n,"manifest");Ct.writeFileSync(s,r,"utf8");let i=await Li(t.sshKeygen??"ssh-keygen",["-Y","sign","-q","-f",e,"-n",t.namespace??pB,s],t.interactive===!1?"":"inherit");if(i.code!==0||!Ct.existsSync(s+".sig"))throw new Error(`ssh-keygen could not sign: ${i.stderr.trim()||`exit ${i.code}`}`);return jl(Ct.readFileSync(s+".sig","utf8"))}finally{Ct.rmSync(n,{recursive:!0,force:!0})}}async function Vt(r,e,t,n="ssh-keygen",s=pB){let i=yc();try{let o=Ni.join(i,"manifest.sig");Ct.writeFileSync(o,Si(e),"utf8");let B=await Li(n,["-Y","find-principals","-s",o,"-f",t],""),a=B.code===0?B.stdout.split(/[\r\n,]+/).filter(Boolean):[];if(a.length===0)throw new Error(`no key in ${t} made this signature`);let l="";for(let c of a){let u=await Li(n,["-Y","verify","-f",t,"-I",c,"-n",s,"-s",o],r);if(u.code===0)return c;l=(u.stderr||u.stdout).trim()}throw new Error(`the signature does not verify: ${l}`)}finally{Ct.rmSync(i,{recursive:!0,force:!0})}}async function IB(r,e){let t=[];for(let n of r.cells)if(!(n.steps.length<2))for(let s=0;s<n.steps.length;s++){let i;try{i=await Li(e,["--norc","--noprofile","-n"],n.steps[s])}catch{return}let o=i.stderr.trim().split(/\r?\n/)[0];(i.code!==0||o)&&t.push(`cell ${n.n}, command ${s+1} (${n.steps[s].split(`
231
- `)[0]}): ${o||`bash -n exit ${i.code}`}`)}return t}function Cs(r){let e=r.endsWith(".pub")?r:r+".pub";try{let t=Ct.readFileSync(e,"utf8").trim().split(/\s+/);return t.length>=3?t.slice(2).join(" "):void 0}catch{return}}var LB=1,PB="md-runbook-run",Sc=["vscode","app-ios","app-android","app-web","cli","gate"],Rc=["passed","failed","skipped","not-run","by-hand"],NB=120;var MB=20,$c=/^[A-Za-z0-9._:-]{1,128}$/,Fc=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,Tc=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?(Z|[+-]\d{2}:?\d{2})?$/i;function Wh(r){let e=gs(r.ALERT??"");if(e==="")return;let t=r.ALERT_FINGERPRINT?.trim(),n={};for(let i of(r.ALERT_LABELS??"").split(",")){let o=i.indexOf("=");if(o<=0)continue;let B=i.slice(0,o).trim(),a=gs(i.slice(o+1));Fc.test(B)&&a!==""&&Object.keys(n).length<MB&&!(B in n)&&(n[B]=a)}let s=r.ALERT_STARTS_AT?.trim();return{name:e,...t&&$c.test(t)?{fingerprint:t}:{},...s&&Tc.test(s)?{startsAt:s}:{},...Object.keys(n).length>0?{labels:n}:{}}}var Oc=r=>new Date(typeof r=="number"?r:r.getTime()).toISOString();function gs(r){let e=r.replace(/\s+/g," ").trim();return e.length>NB?e.slice(0,NB-1)+"\u2026":e}function Vh(r,e,t){let n=r.split(/[\\/]/).pop()||"runbook.md",s=un(e),i=Dt(e),o;if(i)try{let B=Un(i.manifest);o={name:B.name,version:B.version,manifest:Qt(i.manifest),signer:t??i.signer,trusted:t!==void 0}}catch{o=void 0}return{file:n,...s?{title:gs(s)}:{},sha256:Qt(Kt(e.replace(/^/,""))),...o?{signed:o}:{}}}function Ic(r){let e=typeof r.started=="number"?r.started:r.started.getTime(),t=Math.max(e,typeof r.ended=="number"?r.ended:r.ended.getTime()),n=r.steps.map((B,a)=>({n:a+1,label:gs(B.label)||`Step ${a+1}`,state:B.state,...B.ms!==void 0&&Number.isFinite(B.ms)?{ms:Math.max(0,Math.round(B.ms))}:{}})),s=B=>n.filter(a=>a.state===B).length,i=r.alertParams?Wh(r.alertParams):void 0,o={steps:n.length,passed:s("passed"),failed:s("failed"),skipped:s("skipped"),notRun:s("not-run"),byHand:s("by-hand")};return{v:LB,runbook:Vh(r.file,r.text,r.trustedSigner),who:gs(r.who)||"unknown",client:r.client,started:Oc(e),ended:Oc(t),steps:n,ran:r.steps.flatMap((B,a)=>B.ran?[a+1]:[]),totals:o,green:n.length>0&&o.failed===0&&o.notRun===0,...r.stopped?{stopped:!0}:{},...i?{alert:i}:{}}}function Yn(r){if(r===null||typeof r=="boolean"||typeof r=="string")return JSON.stringify(r);if(typeof r=="number"){if(!Number.isFinite(r))throw new Error("canonical JSON: not a finite number");return JSON.stringify(r)}if(Array.isArray(r))return"["+r.map(e=>e===void 0?"null":Yn(e)).join(",")+"]";if(typeof r=="object"){let e=r;return"{"+Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>JSON.stringify(n)+":"+Yn(e[n])).join(",")+"}"}throw new Error(`canonical JSON: can't write a ${typeof r}`)}var Zt=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),Ac=/^[0-9a-f]{64}$/,Zh=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;function pn(r,e,t,n){for(let s of Object.keys(r))e.includes(s)||n.push(`${t}: unknown field "${s}"`)}function Xh(r){let e=[];if(!Zt(r))return["not a JSON object"];if(r.v!==LB)return[`v: ${JSON.stringify(r.v)} is not a summary version this reads (${LB})`];let t=r.client==="gate";pn(r,["v","runbook","who","client","started","ended","steps","ran","totals","green","stopped","alert",...t?["gate"]:[]],"summary",e);let n=(B,a,l=NB)=>{(typeof B!="string"||B===""||B.length>l||/[\r\n]/.test(B))&&e.push(`${a}: expected one line of text (at most ${l})`)},s=r.runbook;if(!Zt(s))e.push("runbook: missing");else if(pn(s,["file","title","sha256","signed"],"runbook",e),t&&s.file===void 0||n(s.file,"runbook.file",255),typeof s.file=="string"&&/[\\/]/.test(s.file)&&e.push("runbook.file: a file name, without folders"),s.title!==void 0&&n(s.title,"runbook.title"),!(t&&s.sha256===void 0)&&(typeof s.sha256!="string"||!Ac.test(s.sha256))&&e.push("runbook.sha256: expected 64 hex digits"),t&&s.signed===void 0&&e.push("runbook.signed: a gate runs signed runbooks only"),s.signed!==void 0){let B=s.signed;Zt(B)?(pn(B,["name","version","manifest","signer","trusted"],"runbook.signed",e),n(B.name,"runbook.signed.name"),(!Number.isInteger(B.version)||B.version<1)&&e.push("runbook.signed.version: expected a positive whole number"),(typeof B.manifest!="string"||!Ac.test(B.manifest))&&e.push("runbook.signed.manifest: expected 64 hex digits"),n(B.signer,"runbook.signed.signer"),typeof B.trusted!="boolean"&&e.push("runbook.signed.trusted: expected true or false")):e.push("runbook.signed: expected an object")}n(r.who,"who"),Sc.includes(r.client)||e.push(`client: expected one of ${Sc.join(", ")}`);for(let B of["started","ended"])(typeof r[B]!="string"||!Zh.test(r[B]))&&e.push(`${B}: expected an ISO 8601 UTC time`);Array.isArray(r.steps)?r.steps.forEach((B,a)=>{let l=`steps[${a}]`;if(!Zt(B))return void e.push(`${l}: expected an object`);pn(B,["n","label","state","ms"],l,e),B.n!==a+1&&e.push(`${l}.n: expected ${a+1}`),n(B.label,`${l}.label`),Rc.includes(B.state)||e.push(`${l}.state: expected one of ${Rc.join(", ")}`),B.ms!==void 0&&(!Number.isInteger(B.ms)||B.ms<0)&&e.push(`${l}.ms: expected milliseconds`)}):e.push("steps: expected a list");let i=Array.isArray(r.steps)?r.steps.length:0;(!Array.isArray(r.ran)||!r.ran.every(B=>Number.isInteger(B)&&B>=1&&B<=i))&&e.push("ran: expected step numbers");let o=r.totals;if(!Zt(o))e.push("totals: missing");else{pn(o,["steps","passed","failed","skipped","notRun","byHand"],"totals",e);for(let B of["steps","passed","failed","skipped","notRun","byHand"])(!Number.isInteger(o[B])||o[B]<0)&&e.push(`totals.${B}: expected a count`)}if(typeof r.green!="boolean"&&e.push("green: expected true or false"),r.stopped!==void 0&&r.stopped!==!0&&e.push("stopped: expected true, or absent"),r.gate!==void 0){let B=r.gate;Zt(B)?(pn(B,["host","account","from"],"gate",e),n(B.host,"gate.host",255),n(B.account,"gate.account",64),B.from!==void 0&&n(B.from,"gate.from",64)):e.push("gate: expected an object")}if(r.alert!==void 0){let B=r.alert;if(!Zt(B))e.push("alert: expected an object");else if(pn(B,["name","fingerprint","startsAt","labels"],"alert",e),B.startsAt!==void 0&&(typeof B.startsAt!="string"||!Tc.test(B.startsAt))&&e.push("alert.startsAt: expected a time (RFC 3339)"),n(B.name,"alert.name"),B.fingerprint!==void 0&&(typeof B.fingerprint!="string"||!$c.test(B.fingerprint))&&e.push("alert.fingerprint: expected letters, digits and . _ : -"),B.labels!==void 0)if(!Zt(B.labels)||Object.keys(B.labels).length>MB)e.push(`alert.labels: expected at most ${MB} name: value pairs`);else for(let[a,l]of Object.entries(B.labels))Fc.test(a)||e.push(`alert.labels: "${a.slice(0,40)}" is not a label name`),n(l,`alert.labels.${a.slice(0,40)}`)}return e}function Gi(r,e){return Yn(e?{summary:r,signature:e.signature,...e.signer?{signer:e.signer}:{}}:r)}function Lc(r){let e;try{e=JSON.parse(r)}catch(n){return{problems:[`not JSON: ${n instanceof Error?n.message:String(n)}`]}}if(!Zt(e))return{problems:["not a JSON object"]};let t=[];return pn(e,["summary","signature","signer"],"envelope",t),(typeof e.signature!="string"||!/-----BEGIN SSH SIGNATURE-----[\s\S]+-----END SSH SIGNATURE-----/.test(e.signature))&&t.push("signature: expected an SSH signature (-----BEGIN SSH SIGNATURE-----)"),e.signer!==void 0&&typeof e.signer!="string"&&t.push("signer: expected text"),t.push(...Xh(e.summary).map(n=>`summary: ${n}`)),t.length>0?{problems:t}:{envelope:e}}function HB(r){let e=/^([a-z]+:\/\/[^/?#]+)/i.exec(r);return(e?e[1]:r).toLowerCase()}var GB=r=>HB(r).replace(/^[a-z]+:\/\//,"");function eC(r){let e=ve(r);if(e?.reportRuns)return{url:e.reportRuns,required:e.reportRunsRequired===!0,signed:e.reportRunsSigned===!0,...e.reportRunsToken?{token:e.reportRunsToken}:{}}}function tC(r,e,t=new Date){if(!Dt(r))return"the runbook is not signed";let n=ot(r);if(!n)return"the signature block is damaged";if(n.version!==2)return"the signature covers only its blocks, not the front matter (signed before manifest version 2): sign the runbook again";if(n.textChanged)return"the runbook changed since signing: sign it again";let s=n.manifest.expires;if(s&&t.toISOString().slice(0,10)>s)return`the signature expired on ${s}`;if(e===void 0)return"the signature is not checked against signers this client trusts"}function Nc(r,e,t=new Date){let n=eC(r);if(!n||zt(n.url)!==void 0)return;let s=n.required||n.signed,i=s?tC(r,e,t):void 0,o=s&&i===void 0;return{url:n.url,origin:HB(n.url),host:GB(n.url),required:o&&n.required,signed:o&&n.signed,...n.token?{token:n.token}:{},...i?{ignored:i}:{}}}var Mc="the runbook's file name, title and hash, your user name, this client, when the run started and ended, and each step's label, result and duration. Never outputs, parameter or input values, or secrets.";function Gc(r,e){let t=HB(r),n=GB(r).replace(/:\d+$/,"");return e.some(s=>{let i=s.trim().toLowerCase();return i===""?!1:i.includes("://")?i===t||i===t+"/"?!0:r.toLowerCase().startsWith(i.endsWith("/")?i:i+"/")||r.toLowerCase()===i:i===n||i===GB(r)})}var jD=168*36e5,nC=1e4;async function Pc(r){let e=r.fetch??globalThis.fetch;if(!e)return{ok:!1,retry:!1,why:"no fetch here"};let t=new AbortController,n=setTimeout(()=>t.abort(),r.timeoutMs??nC);try{let s=await e(r.url,{method:"POST",headers:{"content-type":"application/json",...r.token?{authorization:`Bearer ${r.token}`}:{}},body:r.body,signal:t.signal,redirect:"error"});return s.ok?{ok:!0}:{ok:!1,retry:s.status===408||s.status===429||s.status>=500||s.status<400,why:`the server answered ${s.status}`}}catch(s){return{ok:!1,retry:!0,why:t.signal.aborted?"no answer in time":s instanceof Error?s.message:String(s)}}finally{clearTimeout(n)}}async function _B(r,e,t="ssh-keygen"){let n=Dt(r);if(n)for(let s of Dr(n))try{return await Vt(n.manifest,s,e,t)}catch{}}async function UB(r,e,t={}){return Si(await zn(Yn(r),e,{...t,namespace:PB}))}async function JB(r,e,t="ssh-keygen"){let n=Lc(r);if("problems"in n)throw new Error(`not a signed run summary:
230
+ popd`,c=FB.tmpdir()),o.kind==="bash"&&e.platform==="win32"&&/['"\[\]*?{}$`]/.test(a)&&(s.MDRB_SCRIPT=u[0]??a,u=["-c",'. "$MDRB_SCRIPT"']);try{return Wt.writeFileSync(a,o.script(l),"utf8"),{...await RB({command:o.command,args:u,cwd:c,env:s,timeoutMs:r.timeoutMs,signal:r.signal,windowsVerbatimArguments:o.windowsVerbatimArguments,onStdout:r.onStdout,onStderr:r.onStderr}),shell:o}}finally{try{Wt.rmSync(B,{recursive:!0,force:!0})}catch{}}}var dn=ue(require("node:fs")),ps=ue(require("node:os")),Kn=ue(require("node:path"));var Dc={MSYS_NO_PATHCONV:"1",MSYS2_ARG_CONV_EXCL:"*"};function vr(r,e,t){if(t!=="win32")return r[e];let n=Object.keys(r).find(s=>s.toUpperCase()===e);return n===void 0?void 0:r[n]}var Qh=r=>{try{return dn.statSync(r).isFile()}catch{return!1}};function wc(r,e=process.platform,t=Qh){let n=vr(r,"KUBECONFIG",e);if(n)return n;let s=e==="win32"?Kn.win32.join:Kn.posix.join;if(e!=="win32")return s(r.HOME||ps.homedir(),".kube","config");let i=vr(r,"HOMEDRIVE",e),o=vr(r,"HOMEPATH",e);return[vr(r,"HOME",e),i&&o?i+o:void 0,vr(r,"USERPROFILE",e)].filter(l=>!!l).map(l=>s(l,".kube","config")).find(t)??s(vr(r,"USERPROFILE",e)||ps.homedir(),".kube","config")}var hs=class{constructor(e=ps.tmpdir()){this.tmp=e}tmp;dir;files=new Map;file(e){let t=this.files.get(e);t===void 0&&this.files.set(e,t=`pin-${this.files.size+1}.kubeconfig`);let n=()=>{this.dir??=dn.mkdtempSync(Kn.join(this.tmp,"md-runbook-kube-"));let s=Kn.join(this.dir,t);return dn.writeFileSync(s,Wu(e),{mode:384}),s};try{return n()}catch(s){if(s.code!=="ENOENT")throw s;return this.dir=void 0,n()}}dispose(){if(this.dir!==void 0){try{dn.rmSync(this.dir,{recursive:!0,force:!0})}catch{}this.dir=void 0}}};function $B(r){let e=r.platform??process.platform,t=r.frontMatter,n={...t?.env},s={},i=!1;if(t?.kubeContextMode==="pin"&&r.pins){let o=wc(r.env,e);r.kubeContext!==void 0?(s.KUBECONFIG=Vu(r.pins.file(r.kubeContext),o,e),i=!0):s.KUBECONFIG=o}return t?.gitBashPathConversion==="off"&&e==="win32"&&$e(r.language)==="bash"&&Object.assign(s,Dc),{env:s,defaults:n,pinned:i}}function TB(r,e){return{...e.defaults,...r,...e.env}}var kc=require("node:child_process"),xc=require("node:crypto"),Ct=ue(require("node:fs")),vc=ue(require("node:os")),Ni=ue(require("node:path"));function Mi(r){return(0,xc.createHash)("sha256").update(r,"utf8").digest("hex")}function Li(r,e,t){return new Promise((n,s)=>{let i=(0,kc.spawn)(r,e,{stdio:[t==="inherit"?"inherit":"pipe","pipe","pipe"],windowsHide:!0}),o="",B="";i.stdout.on("data",a=>o+=a.toString("utf8")),i.stderr.on("data",a=>B+=a.toString("utf8")),i.on("error",a=>s(new Error(`${r}: ${a.message} (OpenSSH's ssh-keygen is needed)`))),i.on("close",a=>n({code:a,stdout:o,stderr:B})),t!=="inherit"&&(i.stdin.on("error",()=>{}),i.stdin.end(t))})}function yc(){return Ct.mkdtempSync(Ni.join(vc.tmpdir(),"md-runbook-sign-"))}async function zn(r,e,t={}){let n=yc();try{let s=Ni.join(n,"manifest");Ct.writeFileSync(s,r,"utf8");let i=await Li(t.sshKeygen??"ssh-keygen",["-Y","sign","-q","-f",e,"-n",t.namespace??pB,s],t.interactive===!1?"":"inherit");if(i.code!==0||!Ct.existsSync(s+".sig"))throw new Error(`ssh-keygen could not sign: ${i.stderr.trim()||`exit ${i.code}`}`);return jl(Ct.readFileSync(s+".sig","utf8"))}finally{Ct.rmSync(n,{recursive:!0,force:!0})}}async function Vt(r,e,t,n="ssh-keygen",s=pB){let i=yc();try{let o=Ni.join(i,"manifest.sig");Ct.writeFileSync(o,Si(e),"utf8");let B=await Li(n,["-Y","find-principals","-s",o,"-f",t],""),a=B.code===0?B.stdout.split(/[\r\n,]+/).filter(Boolean):[];if(a.length===0)throw new Error(`no key in ${t} made this signature`);let l="";for(let c of a){let u=await Li(n,["-Y","verify","-f",t,"-I",c,"-n",s,"-s",o],r);if(u.code===0)return c;l=(u.stderr||u.stdout).trim()}throw new Error(`the signature does not verify: ${l}`)}finally{Ct.rmSync(i,{recursive:!0,force:!0})}}async function IB(r,e){let t=[];for(let n of r.cells)if(!(n.steps.length<2))for(let s=0;s<n.steps.length;s++){let i;try{i=await Li(e,["--norc","--noprofile","-n"],n.steps[s])}catch{return}let o=i.stderr.trim().split(/\r?\n/)[0];(i.code!==0||o)&&t.push(`cell ${n.n}, command ${s+1} (${n.steps[s].split(`
231
+ `)[0]}): ${o||`bash -n exit ${i.code}`}`)}return t}function Cs(r){let e=r.endsWith(".pub")?r:r+".pub";try{let t=Ct.readFileSync(e,"utf8").trim().split(/\s+/);return t.length>=3?t.slice(2).join(" "):void 0}catch{return}}var LB=1,PB="md-runbook-run",Sc=["vscode","app-ios","app-android","app-web","cli","gate"],Rc=["passed","failed","skipped","not-run","by-hand"],NB=120;var MB=20,Fc=/^[A-Za-z0-9._:-]{1,128}$/,$c=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,Tc=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?(Z|[+-]\d{2}:?\d{2})?$/i;function Wh(r){let e=gs(r.ALERT??"");if(e==="")return;let t=r.ALERT_FINGERPRINT?.trim(),n={};for(let i of(r.ALERT_LABELS??"").split(",")){let o=i.indexOf("=");if(o<=0)continue;let B=i.slice(0,o).trim(),a=gs(i.slice(o+1));$c.test(B)&&a!==""&&Object.keys(n).length<MB&&!(B in n)&&(n[B]=a)}let s=r.ALERT_STARTS_AT?.trim();return{name:e,...t&&Fc.test(t)?{fingerprint:t}:{},...s&&Tc.test(s)?{startsAt:s}:{},...Object.keys(n).length>0?{labels:n}:{}}}var Oc=r=>new Date(typeof r=="number"?r:r.getTime()).toISOString();function gs(r){let e=r.replace(/\s+/g," ").trim();return e.length>NB?e.slice(0,NB-1)+"\u2026":e}function Vh(r,e,t){let n=r.split(/[\\/]/).pop()||"runbook.md",s=un(e),i=Dt(e),o;if(i)try{let B=Un(i.manifest);o={name:B.name,version:B.version,manifest:Qt(i.manifest),signer:t??i.signer,trusted:t!==void 0}}catch{o=void 0}return{file:n,...s?{title:gs(s)}:{},sha256:Qt(Kt(e.replace(/^/,""))),...o?{signed:o}:{}}}function Ic(r){let e=typeof r.started=="number"?r.started:r.started.getTime(),t=Math.max(e,typeof r.ended=="number"?r.ended:r.ended.getTime()),n=r.steps.map((B,a)=>({n:a+1,label:gs(B.label)||`Step ${a+1}`,state:B.state,...B.ms!==void 0&&Number.isFinite(B.ms)?{ms:Math.max(0,Math.round(B.ms))}:{}})),s=B=>n.filter(a=>a.state===B).length,i=r.alertParams?Wh(r.alertParams):void 0,o={steps:n.length,passed:s("passed"),failed:s("failed"),skipped:s("skipped"),notRun:s("not-run"),byHand:s("by-hand")};return{v:LB,runbook:Vh(r.file,r.text,r.trustedSigner),who:gs(r.who)||"unknown",client:r.client,started:Oc(e),ended:Oc(t),steps:n,ran:r.steps.flatMap((B,a)=>B.ran?[a+1]:[]),totals:o,green:n.length>0&&o.failed===0&&o.notRun===0,...r.stopped?{stopped:!0}:{},...i?{alert:i}:{}}}function qn(r){if(r===null||typeof r=="boolean"||typeof r=="string")return JSON.stringify(r);if(typeof r=="number"){if(!Number.isFinite(r))throw new Error("canonical JSON: not a finite number");return JSON.stringify(r)}if(Array.isArray(r))return"["+r.map(e=>e===void 0?"null":qn(e)).join(",")+"]";if(typeof r=="object"){let e=r;return"{"+Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>JSON.stringify(n)+":"+qn(e[n])).join(",")+"}"}throw new Error(`canonical JSON: can't write a ${typeof r}`)}var Zt=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),Ac=/^[0-9a-f]{64}$/,Zh=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;function pn(r,e,t,n){for(let s of Object.keys(r))e.includes(s)||n.push(`${t}: unknown field "${s}"`)}function Xh(r){let e=[];if(!Zt(r))return["not a JSON object"];if(r.v!==LB)return[`v: ${JSON.stringify(r.v)} is not a summary version this reads (${LB})`];let t=r.client==="gate";pn(r,["v","runbook","who","client","started","ended","steps","ran","totals","green","stopped","alert",...t?["gate"]:[]],"summary",e);let n=(B,a,l=NB)=>{(typeof B!="string"||B===""||B.length>l||/[\r\n]/.test(B))&&e.push(`${a}: expected one line of text (at most ${l})`)},s=r.runbook;if(!Zt(s))e.push("runbook: missing");else if(pn(s,["file","title","sha256","signed"],"runbook",e),t&&s.file===void 0||n(s.file,"runbook.file",255),typeof s.file=="string"&&/[\\/]/.test(s.file)&&e.push("runbook.file: a file name, without folders"),s.title!==void 0&&n(s.title,"runbook.title"),!(t&&s.sha256===void 0)&&(typeof s.sha256!="string"||!Ac.test(s.sha256))&&e.push("runbook.sha256: expected 64 hex digits"),t&&s.signed===void 0&&e.push("runbook.signed: a gate runs signed runbooks only"),s.signed!==void 0){let B=s.signed;Zt(B)?(pn(B,["name","version","manifest","signer","trusted"],"runbook.signed",e),n(B.name,"runbook.signed.name"),(!Number.isInteger(B.version)||B.version<1)&&e.push("runbook.signed.version: expected a positive whole number"),(typeof B.manifest!="string"||!Ac.test(B.manifest))&&e.push("runbook.signed.manifest: expected 64 hex digits"),n(B.signer,"runbook.signed.signer"),typeof B.trusted!="boolean"&&e.push("runbook.signed.trusted: expected true or false")):e.push("runbook.signed: expected an object")}n(r.who,"who"),Sc.includes(r.client)||e.push(`client: expected one of ${Sc.join(", ")}`);for(let B of["started","ended"])(typeof r[B]!="string"||!Zh.test(r[B]))&&e.push(`${B}: expected an ISO 8601 UTC time`);Array.isArray(r.steps)?r.steps.forEach((B,a)=>{let l=`steps[${a}]`;if(!Zt(B))return void e.push(`${l}: expected an object`);pn(B,["n","label","state","ms"],l,e),B.n!==a+1&&e.push(`${l}.n: expected ${a+1}`),n(B.label,`${l}.label`),Rc.includes(B.state)||e.push(`${l}.state: expected one of ${Rc.join(", ")}`),B.ms!==void 0&&(!Number.isInteger(B.ms)||B.ms<0)&&e.push(`${l}.ms: expected milliseconds`)}):e.push("steps: expected a list");let i=Array.isArray(r.steps)?r.steps.length:0;(!Array.isArray(r.ran)||!r.ran.every(B=>Number.isInteger(B)&&B>=1&&B<=i))&&e.push("ran: expected step numbers");let o=r.totals;if(!Zt(o))e.push("totals: missing");else{pn(o,["steps","passed","failed","skipped","notRun","byHand"],"totals",e);for(let B of["steps","passed","failed","skipped","notRun","byHand"])(!Number.isInteger(o[B])||o[B]<0)&&e.push(`totals.${B}: expected a count`)}if(typeof r.green!="boolean"&&e.push("green: expected true or false"),r.stopped!==void 0&&r.stopped!==!0&&e.push("stopped: expected true, or absent"),r.gate!==void 0){let B=r.gate;Zt(B)?(pn(B,["host","account","from"],"gate",e),n(B.host,"gate.host",255),n(B.account,"gate.account",64),B.from!==void 0&&n(B.from,"gate.from",64)):e.push("gate: expected an object")}if(r.alert!==void 0){let B=r.alert;if(!Zt(B))e.push("alert: expected an object");else if(pn(B,["name","fingerprint","startsAt","labels"],"alert",e),B.startsAt!==void 0&&(typeof B.startsAt!="string"||!Tc.test(B.startsAt))&&e.push("alert.startsAt: expected a time (RFC 3339)"),n(B.name,"alert.name"),B.fingerprint!==void 0&&(typeof B.fingerprint!="string"||!Fc.test(B.fingerprint))&&e.push("alert.fingerprint: expected letters, digits and . _ : -"),B.labels!==void 0)if(!Zt(B.labels)||Object.keys(B.labels).length>MB)e.push(`alert.labels: expected at most ${MB} name: value pairs`);else for(let[a,l]of Object.entries(B.labels))$c.test(a)||e.push(`alert.labels: "${a.slice(0,40)}" is not a label name`),n(l,`alert.labels.${a.slice(0,40)}`)}return e}function Gi(r,e){return qn(e?{summary:r,signature:e.signature,...e.signer?{signer:e.signer}:{}}:r)}function Lc(r){let e;try{e=JSON.parse(r)}catch(n){return{problems:[`not JSON: ${n instanceof Error?n.message:String(n)}`]}}if(!Zt(e))return{problems:["not a JSON object"]};let t=[];return pn(e,["summary","signature","signer"],"envelope",t),(typeof e.signature!="string"||!/-----BEGIN SSH SIGNATURE-----[\s\S]+-----END SSH SIGNATURE-----/.test(e.signature))&&t.push("signature: expected an SSH signature (-----BEGIN SSH SIGNATURE-----)"),e.signer!==void 0&&typeof e.signer!="string"&&t.push("signer: expected text"),t.push(...Xh(e.summary).map(n=>`summary: ${n}`)),t.length>0?{problems:t}:{envelope:e}}function HB(r){let e=/^([a-z]+:\/\/[^/?#]+)/i.exec(r);return(e?e[1]:r).toLowerCase()}var GB=r=>HB(r).replace(/^[a-z]+:\/\//,"");function eC(r){let e=ve(r);if(e?.reportRuns)return{url:e.reportRuns,required:e.reportRunsRequired===!0,signed:e.reportRunsSigned===!0,...e.reportRunsToken?{token:e.reportRunsToken}:{}}}function tC(r,e,t=new Date){if(!Dt(r))return"the runbook is not signed";let n=ot(r);if(!n)return"the signature block is damaged";if(n.version!==2)return"the signature covers only its blocks, not the front matter (signed before manifest version 2): sign the runbook again";if(n.textChanged)return"the runbook changed since signing: sign it again";let s=n.manifest.expires;if(s&&t.toISOString().slice(0,10)>s)return`the signature expired on ${s}`;if(e===void 0)return"the signature is not checked against signers this client trusts"}function Nc(r,e,t=new Date){let n=eC(r);if(!n||zt(n.url)!==void 0)return;let s=n.required||n.signed,i=s?tC(r,e,t):void 0,o=s&&i===void 0;return{url:n.url,origin:HB(n.url),host:GB(n.url),required:o&&n.required,signed:o&&n.signed,...n.token?{token:n.token}:{},...i?{ignored:i}:{}}}var Mc="the runbook's file name, title and hash, your user name, this client, when the run started and ended, and each step's label, result and duration. Never outputs, parameter or input values, or secrets.";function Gc(r,e){let t=HB(r),n=GB(r).replace(/:\d+$/,"");return e.some(s=>{let i=s.trim().toLowerCase();return i===""?!1:i.includes("://")?i===t||i===t+"/"?!0:r.toLowerCase().startsWith(i.endsWith("/")?i:i+"/")||r.toLowerCase()===i:i===n||i===GB(r)})}var KD=168*36e5,nC=1e4;async function Pc(r){let e=r.fetch??globalThis.fetch;if(!e)return{ok:!1,retry:!1,why:"no fetch here"};let t=new AbortController,n=setTimeout(()=>t.abort(),r.timeoutMs??nC);try{let s=await e(r.url,{method:"POST",headers:{"content-type":"application/json",...r.token?{authorization:`Bearer ${r.token}`}:{}},body:r.body,signal:t.signal,redirect:"error"});return s.ok?{ok:!0}:{ok:!1,retry:s.status===408||s.status===429||s.status>=500||s.status<400,why:`the server answered ${s.status}`}}catch(s){return{ok:!1,retry:!0,why:t.signal.aborted?"no answer in time":s instanceof Error?s.message:String(s)}}finally{clearTimeout(n)}}async function _B(r,e,t="ssh-keygen"){let n=Dt(r);if(n)for(let s of Dr(n))try{return await Vt(n.manifest,s,e,t)}catch{}}async function UB(r,e,t={}){return Si(await zn(qn(r),e,{...t,namespace:PB}))}async function JB(r,e,t="ssh-keygen"){let n=Lc(r);if("problems"in n)throw new Error(`not a signed run summary:
232
232
  ${n.problems.map(o=>` ${o}`).join(`
233
- `)}`);let s=n.envelope.signature.replace(/-----(BEGIN|END) SSH SIGNATURE-----/g,"").replace(/\s+/g,"");return{signer:await Vt(Yn(n.envelope.summary),s,e,t,PB),envelope:n.envelope}}var hn=ue(require("node:fs")),Hc=ue(require("node:path")),_c=10*1024*1024,rC=100,ms=class{constructor(e,t,n=_c,s=rC){this.file=e;this.onError=t;this.maxBytes=n;this.batchMs=s}file;onError;maxBytes;batchMs;pending="";timer;failed=!1;append(e){this.failed||e===""||(this.pending+=e,this.timer===void 0&&(this.timer=setTimeout(()=>this.flush(),this.batchMs),this.timer.unref?.()))}flush(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0;let e=this.pending;if(this.pending="",!(this.failed||e===""))try{hn.mkdirSync(Hc.dirname(this.file),{recursive:!0});let t=0;try{t=hn.statSync(this.file).size}catch{}t>0&&t+Buffer.byteLength(e)>this.maxBytes&&hn.renameSync(this.file,`${this.file}.1`),hn.appendFileSync(this.file,e,"utf8")}catch(t){this.failed=!0,this.onError?.(t instanceof Error?t:new Error(String(t)))}}};var Ie=ue(require("node:fs")),Re=ue(require("node:path")),Uc=require("node:crypto");function Ut(r,e){return Re.resolve(Re.dirname(Re.resolve(r)),e)}function Es(r,e){return Re.relative(Re.dirname(Re.resolve(r)),e).split(Re.sep).join("/")}function yr(r,e){let t=n=>{let s=Re.resolve(n);try{s=Ie.realpathSync.native(s)}catch{}return process.platform==="linux"?s:s.toLowerCase()};return t(r)===t(e)}function jB(r){return e=>{try{let t=Ut(r,e);return Ie.statSync(t).isFile()?Ie.readFileSync(t,"utf8"):void 0}catch{return}}}function KB(r,e){let t=e.split(/[\\/]+/).filter(o=>o!==""&&o!=="."),n=o=>new RegExp(`^${o.replace(/[.+^${}()|[\]\\?]/g,"\\$&").replace(/\*/g,".*")}$`,process.platform==="linux"?"":"i"),s=[Re.dirname(Re.resolve(r))],i=[];return t.forEach((o,B)=>{let a=B===t.length-1,l=[];for(let c of s){if(!o.includes("*")){let f=Re.join(c,o);Ie.existsSync(f)&&l.push(f);continue}let u=[];try{u=Ie.readdirSync(c)}catch{continue}for(let f of u)n(o).test(f)&&!/\.\d{8}-\d{6}(?:-\d+)?\.md$/i.test(f)&&l.push(Re.join(c,f))}a?i.push(...l.filter(c=>Ie.statSync(c).isFile())):s=l.filter(c=>Ie.statSync(c).isDirectory())}),i.map(o=>Es(r,o)).sort()}function zB(r,e,t,n=new Date){let s=t?Re.resolve(Re.dirname(r),t):Re.dirname(r);Ie.mkdirSync(s,{recursive:!0});let i=bo(Re.basename(r),n),o=Re.join(s,i);for(let l=2;Ie.existsSync(o);l++)o=Re.join(s,i.replace(/\.md$/i,`-${l}.md`));let B=zo(e),a=Kt(Ie.readFileSync(r,"utf8"));return Ie.writeFileSync(o,Object.keys(B).length?bl(a,B):a,"utf8"),o}function bs(r,e,t){return Vo(e,t,(s,i)=>{let o=Ut(i??r,s);try{return{text:Ie.readFileSync(o,"utf8"),at:o}}catch{return}},Gn())}function YB(r){return(0,Uc.createHash)("sha256").update(Ie.readFileSync(r)).digest("hex")}var wt=ue(require("node:fs")),ys=ue(require("node:os")),We=ue(require("node:path"));var Jc=["\\b(delete|drain|cordon|scale\\s+.*--replicas=0)\\b","\\brm\\s+-[a-z]*r[a-z]*f","--force\\b","\\bRemove-Item\\b.*-Recurse","\\bdrop\\s+(table|database)\\b","\\brollout\\s+(restart|undo)\\b","(?<![-.])\\bpatch\\b","(?<![-.])\\bapply\\b","(?<![-.])\\breplace\\b","\\badm\\s+policy\\s+(add|remove)","\\bset\\s+(env|image|resources)\\b","\\bhelm\\s+(upgrade|rollback|uninstall)\\b","\\bcurl\\b.*(-X\\s*|--request[\\s=]+)(PUT|POST|PATCH|DELETE)\\b","\\bInvoke-(RestMethod|WebRequest)\\b.*-Method\\s+(Put|Post|Patch|Delete)\\b"];function jc(r){let e=[],t=[];for(let n of r)try{e.push(new RegExp(n,"i"))}catch(s){t.push(`${n}: ${s instanceof Error?s.message:String(s)}`)}return{regexes:e,errors:t}}function sC(r,e){let t;for(let n of e){let s=n.exec(r);s&&(!t||s.index<t.index)&&(t=s)}return t?.[0]}function qB(r,e,t,n){if(n===!1||n===void 0&&e==="never")return;let s=sC(r,t);return s!==void 0?s:n===!0||e==="always"?"":void 0}function QB(r){let e=sn(r),t=r.slice(r.toLowerCase().indexOf(e)+e.length),n={state:"none"},s=!1;for(let i of an(t)){let o=i.key.toLowerCase();o==="proposed"&&i.value===void 0?s=!0:o==="by"&&i.value?n.by=i.value:o==="reason"&&i.value!==void 0?n.reason=i.value:o==="approved-by"&&i.value?n.approvedBy=i.value:o==="approved-at"&&i.value&&(n.approvedAt=i.value)}return n.state=s?"proposed":n.approvedBy?"approved":n.by?"proposed":"none",n}var zc=require("node:child_process"),Yc=require("node:crypto"),Xt=ue(require("node:fs")),qc=ue(require("node:os")),qn=ue(require("node:path")),VB=require("node:string_decoder");var iC=1e3,Ds="MD_RUNBOOK_SESSION_DIR",Pi="MD_RUNBOOK_TERM",Qc="__mdrbCellCwd",Kc=r=>"'"+r.replace(/'/g,"'\\''")+"'",WB=r=>"'"+r.replace(/['‘’‚‛]/g,"$&$&")+"'";function oC(r,e){return r.kind==="bash"?["-s"]:["-NoLogo","-NoProfile","-NonInteractive",...e==="win32"?["-ExecutionPolicy","Bypass"]:[],"-Command","-"]}function BC(r){return r==="bash"?`__mdrb_dir=$${Ds}; unset ${Ds}
233
+ `)}`);let s=n.envelope.signature.replace(/-----(BEGIN|END) SSH SIGNATURE-----/g,"").replace(/\s+/g,"");return{signer:await Vt(qn(n.envelope.summary),s,e,t,PB),envelope:n.envelope}}var hn=ue(require("node:fs")),Hc=ue(require("node:path")),_c=10*1024*1024,rC=100,ms=class{constructor(e,t,n=_c,s=rC){this.file=e;this.onError=t;this.maxBytes=n;this.batchMs=s}file;onError;maxBytes;batchMs;pending="";timer;failed=!1;append(e){this.failed||e===""||(this.pending+=e,this.timer===void 0&&(this.timer=setTimeout(()=>this.flush(),this.batchMs),this.timer.unref?.()))}flush(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0;let e=this.pending;if(this.pending="",!(this.failed||e===""))try{hn.mkdirSync(Hc.dirname(this.file),{recursive:!0});let t=0;try{t=hn.statSync(this.file).size}catch{}t>0&&t+Buffer.byteLength(e)>this.maxBytes&&hn.renameSync(this.file,`${this.file}.1`),hn.appendFileSync(this.file,e,"utf8")}catch(t){this.failed=!0,this.onError?.(t instanceof Error?t:new Error(String(t)))}}};var Ie=ue(require("node:fs")),Re=ue(require("node:path")),Uc=require("node:crypto");function Ut(r,e){return Re.resolve(Re.dirname(Re.resolve(r)),e)}function Es(r,e){return Re.relative(Re.dirname(Re.resolve(r)),e).split(Re.sep).join("/")}function yr(r,e){let t=n=>{let s=Re.resolve(n);try{s=Ie.realpathSync.native(s)}catch{}return process.platform==="linux"?s:s.toLowerCase()};return t(r)===t(e)}function jB(r){return e=>{try{let t=Ut(r,e);return Ie.statSync(t).isFile()?Ie.readFileSync(t,"utf8"):void 0}catch{return}}}function KB(r,e){let t=e.split(/[\\/]+/).filter(o=>o!==""&&o!=="."),n=o=>new RegExp(`^${o.replace(/[.+^${}()|[\]\\?]/g,"\\$&").replace(/\*/g,".*")}$`,process.platform==="linux"?"":"i"),s=[Re.dirname(Re.resolve(r))],i=[];return t.forEach((o,B)=>{let a=B===t.length-1,l=[];for(let c of s){if(!o.includes("*")){let f=Re.join(c,o);Ie.existsSync(f)&&l.push(f);continue}let u=[];try{u=Ie.readdirSync(c)}catch{continue}for(let f of u)n(o).test(f)&&!/\.\d{8}-\d{6}(?:-\d+)?\.md$/i.test(f)&&l.push(Re.join(c,f))}a?i.push(...l.filter(c=>Ie.statSync(c).isFile())):s=l.filter(c=>Ie.statSync(c).isDirectory())}),i.map(o=>Es(r,o)).sort()}function zB(r,e,t,n=new Date){let s=t?Re.resolve(Re.dirname(r),t):Re.dirname(r);Ie.mkdirSync(s,{recursive:!0});let i=bo(Re.basename(r),n),o=Re.join(s,i);for(let l=2;Ie.existsSync(o);l++)o=Re.join(s,i.replace(/\.md$/i,`-${l}.md`));let B=zo(e),a=Kt(Ie.readFileSync(r,"utf8"));return Ie.writeFileSync(o,Object.keys(B).length?bl(a,B):a,"utf8"),o}function bs(r,e,t){return Vo(e,t,(s,i)=>{let o=Ut(i??r,s);try{return{text:Ie.readFileSync(o,"utf8"),at:o}}catch{return}},Gn())}function qB(r){return(0,Uc.createHash)("sha256").update(Ie.readFileSync(r)).digest("hex")}var wt=ue(require("node:fs")),ys=ue(require("node:os")),We=ue(require("node:path"));var Jc=["\\b(delete|drain|cordon|scale\\s+.*--replicas=0)\\b","\\brm\\s+-[a-z]*r[a-z]*f","--force\\b","\\bRemove-Item\\b.*-Recurse","\\bdrop\\s+(table|database)\\b","\\brollout\\s+(restart|undo)\\b","(?<![-.])\\bpatch\\b","(?<![-.])\\bapply\\b","(?<![-.])\\breplace\\b","\\badm\\s+policy\\s+(add|remove)","\\bset\\s+(env|image|resources)\\b","\\bhelm\\s+(upgrade|rollback|uninstall)\\b","\\bcurl\\b.*(-X\\s*|--request[\\s=]+)(PUT|POST|PATCH|DELETE)\\b","\\bInvoke-(RestMethod|WebRequest)\\b.*-Method\\s+(Put|Post|Patch|Delete)\\b"];function jc(r){let e=[],t=[];for(let n of r)try{e.push(new RegExp(n,"i"))}catch(s){t.push(`${n}: ${s instanceof Error?s.message:String(s)}`)}return{regexes:e,errors:t}}function sC(r,e){let t;for(let n of e){let s=n.exec(r);s&&(!t||s.index<t.index)&&(t=s)}return t?.[0]}function YB(r,e,t,n){if(n===!1||n===void 0&&e==="never")return;let s=sC(r,t);return s!==void 0?s:n===!0||e==="always"?"":void 0}function QB(r){let e=sn(r),t=r.slice(r.toLowerCase().indexOf(e)+e.length),n={state:"none"},s=!1;for(let i of an(t)){let o=i.key.toLowerCase();o==="proposed"&&i.value===void 0?s=!0:o==="by"&&i.value?n.by=i.value:o==="reason"&&i.value!==void 0?n.reason=i.value:o==="approved-by"&&i.value?n.approvedBy=i.value:o==="approved-at"&&i.value&&(n.approvedAt=i.value)}return n.state=s?"proposed":n.approvedBy?"approved":n.by?"proposed":"none",n}var zc=require("node:child_process"),qc=require("node:crypto"),Xt=ue(require("node:fs")),Yc=ue(require("node:os")),Yn=ue(require("node:path")),VB=require("node:string_decoder");var iC=1e3,Ds="MD_RUNBOOK_SESSION_DIR",Pi="MD_RUNBOOK_TERM",Qc="__mdrbCellCwd",Kc=r=>"'"+r.replace(/'/g,"'\\''")+"'",WB=r=>"'"+r.replace(/['‘’‚‛]/g,"$&$&")+"'";function oC(r,e){return r.kind==="bash"?["-s"]:["-NoLogo","-NoProfile","-NonInteractive",...e==="win32"?["-ExecutionPolicy","Bypass"]:[],"-Command","-"]}function BC(r){return r==="bash"?`__mdrb_dir=$${Ds}; unset ${Ds}
234
234
  `:`$__mdrbDir = $env:${Ds}; Remove-Item Env:${Ds} -ErrorAction Ignore; if ($env:${Pi}) { $env:TERM = $env:${Pi} } else { Remove-Item Env:TERM -ErrorAction Ignore }; Remove-Item Env:${Pi} -ErrorAction Ignore; [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = New-Object System.Text.UTF8Encoding $false
235
235
  `}function aC(r,e,t,n){let s=`__MDRB_${e}__`;if(r==="bash"){let B=`"$__mdrb_dir/${e}.pre${t}"`,a=`. "$__mdrb_dir/${e}${t}" </dev/null; __mdrb_rc=$?`;return(n?`__mdrb_cd=; if . ${B} </dev/null; then rm -f ${B} 2>/dev/null; ${a}; else __mdrb_rc=$?; rm -f ${B} 2>/dev/null; fi; if [ -n "$__mdrb_cd" ]; then cd -- "$__mdrb_cd" 2>/dev/null; __mdrb_cd=; fi; `:`${a}; `)+`printf '\\036%s %s\\n' ${s} "$__mdrb_rc"; printf '\\036%s %s\\n' ${s} "$__mdrb_rc" >&2
236
236
  `}let i=`"$__mdrbDir/${e}.pre${t}"`;return`$global:LASTEXITCODE = 0; $__mdrbOk = $false; $__mdrbPushed = $false; ${n?`. ${i}; Remove-Item -LiteralPath ${i} -Force -ErrorAction Ignore; `:""}. "$__mdrbDir/${e}${t}"; $__mdrbOk = $?
237
237
  if ($__mdrbPushed) { Pop-Location -StackName ${Qc} -ErrorAction Ignore; $__mdrbPushed = $false }; $__mdrbRc = if ($LASTEXITCODE) { $LASTEXITCODE } elseif (-not $__mdrbOk) { 1 } else { 0 }; $__mdrbS = [string][char]30 + "${s} $__mdrbRc\`n"; [Console]::Out.Write($__mdrbS); [Console]::Error.Write($__mdrbS)
238
238
  `}function uC(r,e,t,n=process.platform){let s=[];for(let[i,o]of Object.entries(e))r==="pwsh"?s.push(`[Environment]::SetEnvironmentVariable(${WB(i)}, ${WB(o)})`):/^[A-Za-z_][A-Za-z0-9_]*$/.test(i)&&s.push(`export ${i}=${Kc(o)}`);return t!==void 0&&(r==="pwsh"?s.push(`Push-Location -LiteralPath ${WB(t)} -StackName ${Qc} -ErrorAction Stop`,"$__mdrbPushed = $true"):s.push("__mdrb_cd=$PWD",`cd -- ${Kc(n==="win32"?t.replace(/\\/g,"/"):t)} || return 1`)),s.join(`
239
- `)}var ZB=class{constructor(e,t,n=process.platform,s=process.env){this.shell=e;this.cwd=t;this.platform=n;this.dir=Xt.mkdtempSync(qn.join(qc.tmpdir(),"md-runbook-session-"));let i=n==="win32"&&e.kind==="bash"?this.dir.replace(/\\/g,"/"):this.dir,o={...s,[Ds]:i};e.kind==="pwsh"&&(o[Pi]=o.TERM??"",o.TERM="dumb"),this.child=(0,zc.spawn)(e.command,oC(e,n),{cwd:t,env:o,stdio:["pipe","pipe","pipe"],windowsHide:!0,detached:n!=="win32"}),this.child.stdout.on("data",B=>this.deliver("out",this.outDec.write(B))),this.child.stderr.on("data",B=>this.deliver("err",this.errDec.write(B))),this.child.stdin.on("error",()=>{}),this.child.on("error",B=>{this.startError=B.message,this.end(null,null)}),this.child.on("close",(B,a)=>this.end(B,a)),this.child.on("exit",(B,a)=>setTimeout(()=>this.end(B,a),iC).unref()),this.child.stdin.write(BC(e.kind))}shell;cwd;platform;child;dir;ended=!1;killed=!1;startError;current;outDec=new VB.StringDecoder("utf8");errDec=new VB.StringDecoder("utf8");onDidEnd=()=>{};get alive(){return!this.ended&&!this.killed}get pid(){return this.child.pid}run(e){let t=Date.now();return new Promise(n=>{let s=!1,i=!1,o=!1,B,a=[],l=(D,m)=>{if(!o){o=!0,clearTimeout(B),e.signal?.removeEventListener("abort",c),this.current=void 0;for(let b of a)try{Xt.rmSync(b,{force:!0})}catch{}n({...D,timedOut:s,cancelled:i,ended:m,durationMs:Date.now()-t})}},c=()=>{i=!0,this.kill()};if(!this.alive)return l({exitCode:null,signal:null,error:this.startError??"The session has ended."},!0);if(this.current)return l({exitCode:null,signal:null,error:"The session is busy."},!1);if(e.signal?.aborted)return i=!0,l({exitCode:null,signal:null},!1);let u=(0,Yc.randomBytes)(12).toString("hex"),f=this.shell.extension,d=e.env??{},h=Object.keys(d).length>0||e.cwd!==void 0;try{let D=qn.join(this.dir,u+f);if(a.push(D),Xt.writeFileSync(D,this.shell.script(e.source),"utf8"),h){let m=qn.join(this.dir,`${u}.pre${f}`);a.push(m),Xt.writeFileSync(m,this.shell.script(uC(this.shell.kind,d,e.cwd,this.platform)),{encoding:"utf8",mode:384})}}catch(D){return l({exitCode:null,signal:null,error:D instanceof Error?D.message:String(D)},!1)}let p=new On(`__MDRB_${u}__`,e.onStdout),k=new On(`__MDRB_${u}__`,e.onStderr);this.current={out:p,err:k,check:()=>{p.done&&k.done&&l({exitCode:p.code,signal:null},!1)},onExit:(D,m)=>{p.flush(),k.flush(),l({exitCode:D,signal:m,error:this.startError},!0)}},e.signal?.addEventListener("abort",c),e.timeoutMs>0&&(B=setTimeout(()=>{s=!0,this.kill()},e.timeoutMs)),this.child.stdin.write(aC(this.shell.kind,u,f,h))})}kill(){this.killed||this.ended||(this.killed=!0,this.child.pid!==void 0&&Fi(this.child.pid,this.platform))}dispose(){this.kill(),this.ended&&this.cleanup()}deliver(e,t){let n=this.current;!n||t===""||(n[e].write(t),n.check())}end(e,t){this.ended||(this.ended=!0,this.deliver("out",this.outDec.end()),this.deliver("err",this.errDec.end()),this.current?.onExit(e,t),this.cleanup(),this.onDidEnd())}cleanup(){Xt.rm(this.dir,{recursive:!0,force:!0},()=>{})}},Hi=class{constructor(e=()=>{},t=fn(),n=" session"){this.onChange=e;this.shellEnv=t;this.labelSuffix=n}onChange;shellEnv;labelSuffix;sessions=new Map;started=new Set;settings={};labels(){return[...this.sessions.values()].filter(e=>e.alive).map(e=>e.shell.label)}session(e){let t=this.sessions.get(e);return t?.alive?t:void 0}async execute(e){let t=Fe(e.language);if(t===void 0||t==="cmd")return jn(e,this.shellEnv);this.settings=e.settings;let n=await ds(e.settings,void 0,this.shellEnv.platform),s=Jn(t,e.settings,Ii(this.shellEnv,n));if(!s.ok)return jn(e,this.shellEnv);let i=this.sessions.get(t);i&&(!i.alive||i.shell.command!==s.shell.command)&&(i.dispose(),i=void 0),i||(this.started.has(t)&&e.onStdout(`[md-runbook] new session started
240
- `),i=this.start(s.shell,e.baseCwd??e.cwd,n));let o=qn.resolve(e.cwd)===qn.resolve(i.cwd)?void 0:e.cwd,B=await i.run({source:e.source,env:e.env,cwd:o,timeoutMs:e.timeoutMs,signal:e.signal,onStdout:e.onStdout,onStderr:e.onStderr});B.ended&&!B.cancelled&&!B.timedOut&&B.error===void 0&&e.onStderr(`[md-runbook] session ended (exit ${B.exitCode??B.signal}); the next cell starts a new session
239
+ `)}var ZB=class{constructor(e,t,n=process.platform,s=process.env){this.shell=e;this.cwd=t;this.platform=n;this.dir=Xt.mkdtempSync(Yn.join(Yc.tmpdir(),"md-runbook-session-"));let i=n==="win32"&&e.kind==="bash"?this.dir.replace(/\\/g,"/"):this.dir,o={...s,[Ds]:i};e.kind==="pwsh"&&(o[Pi]=o.TERM??"",o.TERM="dumb"),this.child=(0,zc.spawn)(e.command,oC(e,n),{cwd:t,env:o,stdio:["pipe","pipe","pipe"],windowsHide:!0,detached:n!=="win32"}),this.child.stdout.on("data",B=>this.deliver("out",this.outDec.write(B))),this.child.stderr.on("data",B=>this.deliver("err",this.errDec.write(B))),this.child.stdin.on("error",()=>{}),this.child.on("error",B=>{this.startError=B.message,this.end(null,null)}),this.child.on("close",(B,a)=>this.end(B,a)),this.child.on("exit",(B,a)=>setTimeout(()=>this.end(B,a),iC).unref()),this.child.stdin.write(BC(e.kind))}shell;cwd;platform;child;dir;ended=!1;killed=!1;startError;current;outDec=new VB.StringDecoder("utf8");errDec=new VB.StringDecoder("utf8");onDidEnd=()=>{};get alive(){return!this.ended&&!this.killed}get pid(){return this.child.pid}run(e){let t=Date.now();return new Promise(n=>{let s=!1,i=!1,o=!1,B,a=[],l=(D,m)=>{if(!o){o=!0,clearTimeout(B),e.signal?.removeEventListener("abort",c),this.current=void 0;for(let b of a)try{Xt.rmSync(b,{force:!0})}catch{}n({...D,timedOut:s,cancelled:i,ended:m,durationMs:Date.now()-t})}},c=()=>{i=!0,this.kill()};if(!this.alive)return l({exitCode:null,signal:null,error:this.startError??"The session has ended."},!0);if(this.current)return l({exitCode:null,signal:null,error:"The session is busy."},!1);if(e.signal?.aborted)return i=!0,l({exitCode:null,signal:null},!1);let u=(0,qc.randomBytes)(12).toString("hex"),f=this.shell.extension,d=e.env??{},h=Object.keys(d).length>0||e.cwd!==void 0;try{let D=Yn.join(this.dir,u+f);if(a.push(D),Xt.writeFileSync(D,this.shell.script(e.source),"utf8"),h){let m=Yn.join(this.dir,`${u}.pre${f}`);a.push(m),Xt.writeFileSync(m,this.shell.script(uC(this.shell.kind,d,e.cwd,this.platform)),{encoding:"utf8",mode:384})}}catch(D){return l({exitCode:null,signal:null,error:D instanceof Error?D.message:String(D)},!1)}let p=new On(`__MDRB_${u}__`,e.onStdout),k=new On(`__MDRB_${u}__`,e.onStderr);this.current={out:p,err:k,check:()=>{p.done&&k.done&&l({exitCode:p.code,signal:null},!1)},onExit:(D,m)=>{p.flush(),k.flush(),l({exitCode:D,signal:m,error:this.startError},!0)}},e.signal?.addEventListener("abort",c),e.timeoutMs>0&&(B=setTimeout(()=>{s=!0,this.kill()},e.timeoutMs)),this.child.stdin.write(aC(this.shell.kind,u,f,h))})}kill(){this.killed||this.ended||(this.killed=!0,this.child.pid!==void 0&&$i(this.child.pid,this.platform))}dispose(){this.kill(),this.ended&&this.cleanup()}deliver(e,t){let n=this.current;!n||t===""||(n[e].write(t),n.check())}end(e,t){this.ended||(this.ended=!0,this.deliver("out",this.outDec.end()),this.deliver("err",this.errDec.end()),this.current?.onExit(e,t),this.cleanup(),this.onDidEnd())}cleanup(){Xt.rm(this.dir,{recursive:!0,force:!0},()=>{})}},Hi=class{constructor(e=()=>{},t=fn(),n=" session"){this.onChange=e;this.shellEnv=t;this.labelSuffix=n}onChange;shellEnv;labelSuffix;sessions=new Map;started=new Set;settings={};labels(){return[...this.sessions.values()].filter(e=>e.alive).map(e=>e.shell.label)}session(e){let t=this.sessions.get(e);return t?.alive?t:void 0}async execute(e){let t=$e(e.language);if(t===void 0||t==="cmd")return jn(e,this.shellEnv);this.settings=e.settings;let n=await ds(e.settings,void 0,this.shellEnv.platform),s=Jn(t,e.settings,Ii(this.shellEnv,n));if(!s.ok)return jn(e,this.shellEnv);let i=this.sessions.get(t);i&&(!i.alive||i.shell.command!==s.shell.command)&&(i.dispose(),i=void 0),i||(this.started.has(t)&&e.onStdout(`[md-runbook] new session started
240
+ `),i=this.start(s.shell,e.baseCwd??e.cwd,n));let o=Yn.resolve(e.cwd)===Yn.resolve(i.cwd)?void 0:e.cwd,B=await i.run({source:e.source,env:e.env,cwd:o,timeoutMs:e.timeoutMs,signal:e.signal,onStdout:e.onStdout,onStderr:e.onStderr});B.ended&&!B.cancelled&&!B.timedOut&&B.error===void 0&&e.onStderr(`[md-runbook] session ended (exit ${B.exitCode??B.signal}); the next cell starts a new session
241
241
  `);let{ended:a,...l}=B;return{...l,shell:{...s.shell,label:s.shell.label+this.labelSuffix}}}async restart(){let e=[...this.sessions.values()].filter(n=>n.alive);if(e.length===0)return[];let t=await ds(this.settings,void 0,this.shellEnv.platform);for(let n of e)n.dispose(),this.start(n.shell,n.cwd,t);return e.map(n=>n.shell.label)}stop(){let e=this.labels();for(let t of this.sessions.values())t.dispose();return this.sessions.clear(),this.onChange(),e}dispose(){this.stop()}start(e,t,n){let s=new ZB(e,t,this.shellEnv.platform,n);return s.onDidEnd=()=>{this.sessions.get(e.kind)===s&&this.sessions.delete(e.kind),this.onChange()},this.sessions.set(e.kind,s),this.started.add(e.kind),this.onChange(),s}};function lC(r){let e=Math.max(0,Math.round(r));return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m${Math.round(e%6e4/1e3)}s`}var Wc=r=>r.replace(/\s*[\r\n]+\s*/g," ").trim();function cC(r,e){let t=r.step!==void 0?`Step ${r.step}`:void 0,n=r.line!==void 0?`${r.runbook}:${r.line}`:r.runbook,s=[Te(r.at),n,t,r.section,r.title].filter(o=>o!==void 0&&o.trim()!==""),i=`===== ${e(s.map(Wc).join(" \xB7 "))}
242
242
  `;if(r.command!==void 0&&r.command.trim()!==""){let o=e(Ot(r.command).replace(/\r\n?/g,`
243
243
  `).replace(/\n+$/,"")).split(`
@@ -253,23 +253,23 @@ if ($__mdrbPushed) { Pop-Location -StackName ${Qc} -ErrorAction Ignore; $__mdrbP
253
253
  `)}lines(e,t){let n=(this.carry[e]+t).split(`
254
254
  `);this.carry[e]=n.pop(),n.length>0&&this.write(n.map(s=>dC[e]+s).join(`
255
255
  `)+`
256
- `)}};var gt=class extends Error{},XB=Hn;function Zc(r){let e=[...r].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(s===n?`${e[n]}`:`${e[n]}\u2013${e[s]}`),n=s+1}return t.join(", ")}function ws(r){return[...r.from!==void 0?[`--from ${r.from}`]:[],...r.to!==void 0?[`--to ${r.to}`]:[],...(r.sections??[]).map(e=>`--section ${JSON.stringify(e)}`)].join(" ")}function Xc(r,e,t,n,s=[]){let i=tf(r,t,n);if(!i)return;let o=new Set;if(e.forEach((B,a)=>{let l=t[a];i(l,B.line)&&o.add(l)}),o.size===0&&!s.some(B=>i(Math.max(B.step,1),B.line)))throw new gt(`${ws(n)} selects no step`);return o}function ef(r,e,t,n){let s=tf(r,e,t);return s?n.filter(i=>s(Math.max(i.step,1),i.line)):[...n]}function tf(r,e,t){let n=t.sections??[];if(t.from===void 0&&t.to===void 0&&n.length===0)return;let s=Math.max(0,...e);for(let[a,l]of[["--from",t.from],["--to",t.to]])if(l!==void 0&&(l<1||l>s))throw new gt(`${a} ${l} is outside the runbook: it has ${s===0?"no steps":s===1?"one step":`steps 1 to ${s}`}`);if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new gt(`--from ${t.from} is after --to ${t.to}`);let i=t.from??1,o=t.to??s,B=()=>!0;if(n.length>0){let a=XB(r),l=ci(a,n);if(l.length>0)throw new gt(`no heading starts with ${l.map(u=>JSON.stringify(u)).join(", ")} (--section matches the heading text after the #s, case-sensitive)`);let c=fi(a,n);if(c){let u=c.other!==void 0?`; for ${JSON.stringify(c.other)}, give more of it, e.g. --section ${JSON.stringify(c.other.split(/\s+/).slice(0,2).join(" "))}`:"";throw new gt(`--section ${JSON.stringify(c.section)} matches the runbook's title ${JSON.stringify(c.title)}, which holds every step${u}`)}B=_n(a,n)}return(a,l)=>a>=i&&a<=o&&B(l)}function nf(r,e){let t=[];return r.forEach((n,s)=>{if(n.runs)for(let i of new Set(n.uses)){let o=r.slice(0,s).filter(a=>a.captures.includes(i));if(o.length===0||o.some(a=>a.selected))continue;let B=o[o.length-1];t.push(`step ${n.n} (${e}:${n.loc.line+1}) uses \${out:${i}}, captured by step ${B.n} (${e}:${B.loc.line+1}), which is not selected`)}}),t}var ks=ue(require("node:fs")),Le=ue(require("node:path"));function Ui(r){let e=Le.dirname(Le.resolve(r));for(;;){if(ks.existsSync(Le.join(e,".git")))return e;let t=Le.dirname(e);if(t===e)return Le.dirname(Le.resolve(r));e=t}}function xs(r,e){let t=Le.relative(r,Le.resolve(e));return t!==""&&!t.startsWith("..")&&!Le.isAbsolute(t)}function pC(r,e){try{return new RegExp(`^(?:${e})$`).test(r)&&!/[\r\n]/.test(r)}catch{return!1}}var hC=()=>new Date().toISOString().slice(0,10);async function vs(r,e,t,n,s={}){let i=s.shown??Le.basename(r),o=[],B=D=>{o.push(`${i}: ${D}`)},a=ks.readFileSync(r,"utf8"),l=ot(a);if(!l)return B(/<!-- md-runbook:signature/.test(a)?"the signature block is damaged":"not signed (md-runbook sign)"),{problems:o};let c=l.manifest,u,f=[];for(let D of Dr(l.block))try{u=await Vt(l.block.manifest,D,t,s.sshKeygen);break}catch(m){f.push(m instanceof Error?m.message:String(m))}u||B(`its signature is not good: ${f.join("; ")}`),c.expires&&c.expires<hC()&&B(`its signature expired on ${c.expires}`);let d=new Map(ft(he(a)).map(D=>[D.cellIndex,D.line+1]));for(let D of l.changed)B(`line ${d.get(D)??"?"}: changed since signing (or never signed)`);for(let D of l.moved)B(`line ${d.get(D)??"?"}: moved since signing`);l.missing.length&&B(`signed block${l.missing.length===1?"":"s"} ${l.missing.join(", ")} not in the file as signed`),l.missingCalls.length&&B(`signed runbook call${l.missingCalls.length===1?"":"s"} ${l.missingCalls.join(", ")} not in the file as signed`),he(a).cells.forEach((D,m)=>{if(D.kind!=="code"||!ce(D.meta))return;let b=me(D.meta.info);if(b.skip||b.host||b.os&&!b.os.includes(Gn()))return;let w=Fe(D.languageId);w&&w!=="bash"&&B(`line ${d.get(m)??"?"}: a ${D.meta.lang} block is never signed (only bash/sh blocks are): it can't run in a signed run`)});let p=ve(a),k=D=>e[D]??p?.params.find(m=>m.name===D)?.default;for(let[D,m]of Object.entries(c.patterns)){let b=k(D);b!==void 0&&!pC(b,m)&&B(`${D}=${JSON.stringify(b)} doesn't match its signed pattern ${m}`)}if((s.depth??0)<3)for(let[D,m]of l.calls){let b=et(m.info,m.body);if(b.src===void 0||!Gt(b).every(S=>S.kind==="param"&&k(S.name)!==void 0))continue;let R=S=>{let O=di(S,(P,X)=>k(X));return"text"in O?O.text:S},y=Ut(r,R(b.src)),T=`line ${d.get(D)??"?"}: the runbook call of ${R(b.src)}`;if(!xs(n,y)){B(`${T} leaves the repository (${n}): a signed runbook calls runbooks in its own repository`);continue}if(!ks.existsSync(y)){B(`${T}: no such runbook`);continue}if(yr(y,r))continue;let v={};for(let S of b.args)v[S.name]=R(S.value);let E=await vs(y,v,t,n,{...s,shown:Le.relative(Le.dirname(r),y).split(Le.sep).join("/"),depth:(s.depth??0)+1});o.push(...E.problems)}return{problems:o,...u?{signer:u}:{}}}var CC=4,gC=(r,e)=>new Promise(t=>{if(e?.aborted)return t(!1);let n=setTimeout(()=>t(!0),r);e?.addEventListener("abort",()=>(clearTimeout(n),t(!1)),{once:!0})});async function ea(r,e){let t=wt.readFileSync(r.file,"utf8"),n=r.allowedSigners?r.signedRoot??Ui(r.file):void 0;if(r.allowedSigners&&n){let I=await vs(r.file,r.params,r.allowedSigners,n);if(I.problems.length>0)throw new gt(`not run as signed (--allowed-signers ${r.allowedSigners}); nothing ran:
256
+ `)}};var gt=class extends Error{},XB=Hn;function Zc(r){let e=[...r].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(s===n?`${e[n]}`:`${e[n]}\u2013${e[s]}`),n=s+1}return t.join(", ")}function ws(r){return[...r.from!==void 0?[`--from ${r.from}`]:[],...r.to!==void 0?[`--to ${r.to}`]:[],...(r.sections??[]).map(e=>`--section ${JSON.stringify(e)}`)].join(" ")}function Xc(r,e,t,n,s=[]){let i=tf(r,t,n);if(!i)return;let o=new Set;if(e.forEach((B,a)=>{let l=t[a];i(l,B.line)&&o.add(l)}),o.size===0&&!s.some(B=>i(Math.max(B.step,1),B.line)))throw new gt(`${ws(n)} selects no step`);return o}function ef(r,e,t,n){let s=tf(r,e,t);return s?n.filter(i=>s(Math.max(i.step,1),i.line)):[...n]}function tf(r,e,t){let n=t.sections??[];if(t.from===void 0&&t.to===void 0&&n.length===0)return;let s=Math.max(0,...e);for(let[a,l]of[["--from",t.from],["--to",t.to]])if(l!==void 0&&(l<1||l>s))throw new gt(`${a} ${l} is outside the runbook: it has ${s===0?"no steps":s===1?"one step":`steps 1 to ${s}`}`);if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new gt(`--from ${t.from} is after --to ${t.to}`);let i=t.from??1,o=t.to??s,B=()=>!0;if(n.length>0){let a=XB(r),l=ci(a,n);if(l.length>0)throw new gt(`no heading starts with ${l.map(u=>JSON.stringify(u)).join(", ")} (--section matches the heading text after the #s, case-sensitive)`);let c=fi(a,n);if(c){let u=c.other!==void 0?`; for ${JSON.stringify(c.other)}, give more of it, e.g. --section ${JSON.stringify(c.other.split(/\s+/).slice(0,2).join(" "))}`:"";throw new gt(`--section ${JSON.stringify(c.section)} matches the runbook's title ${JSON.stringify(c.title)}, which holds every step${u}`)}B=_n(a,n)}return(a,l)=>a>=i&&a<=o&&B(l)}function nf(r,e){let t=[];return r.forEach((n,s)=>{if(n.runs)for(let i of new Set(n.uses)){let o=r.slice(0,s).filter(a=>a.captures.includes(i));if(o.length===0||o.some(a=>a.selected))continue;let B=o[o.length-1];t.push(`step ${n.n} (${e}:${n.loc.line+1}) uses \${out:${i}}, captured by step ${B.n} (${e}:${B.loc.line+1}), which is not selected`)}}),t}var ks=ue(require("node:fs")),Le=ue(require("node:path"));function Ui(r){let e=Le.dirname(Le.resolve(r));for(;;){if(ks.existsSync(Le.join(e,".git")))return e;let t=Le.dirname(e);if(t===e)return Le.dirname(Le.resolve(r));e=t}}function xs(r,e){let t=Le.relative(r,Le.resolve(e));return t!==""&&!t.startsWith("..")&&!Le.isAbsolute(t)}function pC(r,e){try{return new RegExp(`^(?:${e})$`).test(r)&&!/[\r\n]/.test(r)}catch{return!1}}var hC=()=>new Date().toISOString().slice(0,10);async function vs(r,e,t,n,s={}){let i=s.shown??Le.basename(r),o=[],B=D=>{o.push(`${i}: ${D}`)},a=ks.readFileSync(r,"utf8"),l=ot(a);if(!l)return B(/<!-- md-runbook:signature/.test(a)?"the signature block is damaged":"not signed (md-runbook sign)"),{problems:o};let c=l.manifest,u,f=[];for(let D of Dr(l.block))try{u=await Vt(l.block.manifest,D,t,s.sshKeygen);break}catch(m){f.push(m instanceof Error?m.message:String(m))}u||B(`its signature is not good: ${f.join("; ")}`),c.expires&&c.expires<hC()&&B(`its signature expired on ${c.expires}`);let d=new Map(ft(he(a)).map(D=>[D.cellIndex,D.line+1]));for(let D of l.changed)B(`line ${d.get(D)??"?"}: changed since signing (or never signed)`);for(let D of l.moved)B(`line ${d.get(D)??"?"}: moved since signing`);l.missing.length&&B(`signed block${l.missing.length===1?"":"s"} ${l.missing.join(", ")} not in the file as signed`),l.missingCalls.length&&B(`signed runbook call${l.missingCalls.length===1?"":"s"} ${l.missingCalls.join(", ")} not in the file as signed`),he(a).cells.forEach((D,m)=>{if(D.kind!=="code"||!ce(D.meta))return;let b=me(D.meta.info);if(b.skip||b.host||b.os&&!b.os.includes(Gn()))return;let w=$e(D.languageId);w&&w!=="bash"&&B(`line ${d.get(m)??"?"}: a ${D.meta.lang} block is never signed (only bash/sh blocks are): it can't run in a signed run`)});let p=ve(a),k=D=>e[D]??p?.params.find(m=>m.name===D)?.default;for(let[D,m]of Object.entries(c.patterns)){let b=k(D);b!==void 0&&!pC(b,m)&&B(`${D}=${JSON.stringify(b)} doesn't match its signed pattern ${m}`)}if((s.depth??0)<3)for(let[D,m]of l.calls){let b=et(m.info,m.body);if(b.src===void 0||!Gt(b).every(S=>S.kind==="param"&&k(S.name)!==void 0))continue;let R=S=>{let O=di(S,(P,X)=>k(X));return"text"in O?O.text:S},y=Ut(r,R(b.src)),T=`line ${d.get(D)??"?"}: the runbook call of ${R(b.src)}`;if(!xs(n,y)){B(`${T} leaves the repository (${n}): a signed runbook calls runbooks in its own repository`);continue}if(!ks.existsSync(y)){B(`${T}: no such runbook`);continue}if(yr(y,r))continue;let v={};for(let S of b.args)v[S.name]=R(S.value);let E=await vs(y,v,t,n,{...s,shown:Le.relative(Le.dirname(r),y).split(Le.sep).join("/"),depth:(s.depth??0)+1});o.push(...E.problems)}return{problems:o,...u?{signer:u}:{}}}var CC=4,gC=(r,e)=>new Promise(t=>{if(e?.aborted)return t(!1);let n=setTimeout(()=>t(!0),r);e?.addEventListener("abort",()=>(clearTimeout(n),t(!1)),{once:!0})});async function ea(r,e){let t=wt.readFileSync(r.file,"utf8"),n=r.allowedSigners?r.signedRoot??Ui(r.file):void 0;if(r.allowedSigners&&n){let I=await vs(r.file,r.params,r.allowedSigners,n);if(I.problems.length>0)throw new gt(`not run as signed (--allowed-signers ${r.allowedSigners}); nothing ran:
257
257
  ${I.problems.map(_=>` ${_}`).join(`
258
- `)}`);e.log(`\u2713 signed${I.signer?` by ${I.signer}`:""}, unchanged, parameters as signed`)}let s=We.basename(r.file),i=We.dirname(We.resolve(r.file)),o=ve(t),B=r.inheritKubeContext,a=B&&!o?.kubeContext?{params:[],...o,kubeContext:B.context,...B.mode&&!o?.kubeContextMode?{kubeContextMode:B.mode}:{}}:o,l=a?.cwd?We.resolve(i,a.cwd):i,c=r.session??a?.mode==="session",u=new hs,f=new Set,d=ko(wo),h=I=>{let _=d.redact(I);for(let fe of[...f].sort((de,ne)=>ne.length-de.length))_=_.split(fe).join(Br);return _},p=I=>{I.length>=CC&&f.add(I)},k={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0,redact:h},{regexes:D}=jc(Jc),m=new Map,b=t,w=he(t),R=ft(w);for(let I of r.extraSecrets??[])p(I);for(let I of R){let _=Ge(I.language);if(!Fe(I.language)&&!_)continue;let fe=[];try{fe=_?Gt(et(I.info,I.source)):Xe(I.source)}catch{continue}for(let de of fe){if(!de.secret)continue;let ne=de.kind==="secret"?r.env[de.name]:de.kind==="input"?r.inputs[de.name]??r.env[de.name]:void 0;ne!==void 0&&p(ne)}}let y=w.cells.map(I=>I.kind==="code"?{kind:"code",os:me(I.meta.kind==="code"?I.meta.info:"").os}:{kind:"markup"}),T=Pn(y),v=new Set(T.filter(I=>I?.active).map(I=>I.group)),E=Bn(y),S=R.map(I=>E[I.cellIndex]),O={...r.from!==void 0?{from:r.from}:{},...r.to!==void 0?{to:r.to}:{},...r.sections?.length?{sections:r.sections}:{}},P=t.split(/\r?\n/),X=jr(t).map(I=>{let _=-1;return R.forEach((fe,de)=>{fe.line<I.line&&(_=de)}),{line:I.line,step:_>=0?S[_]:0,after:_,text:(P[I.line]??"").replace(/^.*?\[[ xX]\][ \t]*/,"").trim(),ticked:I.checked}}),Y=Xc(t,R,S,O,X),W=xB(R),ee=W.ready,q=I=>W.parts[I]??"body",se=r.setup??"auto",te=r.teardown??"no",ye=I=>ee!==void 0&&I!==ee&&se==="auto"&&(r.readyFirst?!0:q(I)==="setup");Y&&(r.addSetup&&R.forEach((I,_)=>{(q(_)==="setup"||_===ee)&&Y.add(S[_])}),r.readyFirst&&ee!==void 0&&Y.add(S[ee]));let ge=ef(t,S,O,X),Je=new Set,De=I=>{for(let _ of ge)_.after!==I||_.ticked||Je.has(_.line)||(Je.add(_.line),e.log(`\u2610 manual, not ticked \xB7 ${s}:${_.line+1} \xB7 ${h(_.text)}`))},be=R.map((I,_)=>{let fe=me(I.info),de=T[I.cellIndex],ne=QB(I.info),at=[];try{at=(Ge(I.language)?Gt(et(I.info,I.source)):gr(I.source,I.info,a)).filter(St=>St.kind==="out").map(St=>St.name)}catch{}let En=!Y||Y.has(S[_]);return{n:S[_],loc:I,selected:En,runs:En&&(!de||de.active)&&!fe.host&&!fe.skip&&fe.errors.length===0&&ne.state!=="proposed"&&ne.by===void 0&&!(q(_)==="teardown"&&te==="no")&&!(q(_)==="setup"&&se==="never")&&!(_===ee&&se!=="auto"),uses:at,captures:(fe.checks?.captures??[]).map(St=>St.name)}}),F=nf(be,s);if(F.length>0)throw new gt(`${F.join(`
258
+ `)}`);e.log(`\u2713 signed${I.signer?` by ${I.signer}`:""}, unchanged, parameters as signed`)}let s=We.basename(r.file),i=We.dirname(We.resolve(r.file)),o=ve(t),B=r.inheritKubeContext,a=B&&!o?.kubeContext?{params:[],...o,kubeContext:B.context,...B.mode&&!o?.kubeContextMode?{kubeContextMode:B.mode}:{}}:o,l=a?.cwd?We.resolve(i,a.cwd):i,c=r.session??a?.mode==="session",u=new hs,f=new Set,d=ko(wo),h=I=>{let _=d.redact(I);for(let fe of[...f].sort((de,ne)=>ne.length-de.length))_=_.split(fe).join(Br);return _},p=I=>{I.length>=CC&&f.add(I)},k={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0,redact:h},{regexes:D}=jc(Jc),m=new Map,b=t,w=he(t),R=ft(w);for(let I of r.extraSecrets??[])p(I);for(let I of R){let _=Ge(I.language);if(!$e(I.language)&&!_)continue;let fe=[];try{fe=_?Gt(et(I.info,I.source)):Xe(I.source)}catch{continue}for(let de of fe){if(!de.secret)continue;let ne=de.kind==="secret"?r.env[de.name]:de.kind==="input"?r.inputs[de.name]??r.env[de.name]:void 0;ne!==void 0&&p(ne)}}let y=w.cells.map(I=>I.kind==="code"?{kind:"code",os:me(I.meta.kind==="code"?I.meta.info:"").os}:{kind:"markup"}),T=Pn(y),v=new Set(T.filter(I=>I?.active).map(I=>I.group)),E=Bn(y),S=R.map(I=>E[I.cellIndex]),O={...r.from!==void 0?{from:r.from}:{},...r.to!==void 0?{to:r.to}:{},...r.sections?.length?{sections:r.sections}:{}},P=t.split(/\r?\n/),X=jr(t).map(I=>{let _=-1;return R.forEach((fe,de)=>{fe.line<I.line&&(_=de)}),{line:I.line,step:_>=0?S[_]:0,after:_,text:(P[I.line]??"").replace(/^.*?\[[ xX]\][ \t]*/,"").trim(),ticked:I.checked}}),q=Xc(t,R,S,O,X),W=xB(R),ee=W.ready,Y=I=>W.parts[I]??"body",se=r.setup??"auto",te=r.teardown??"no",ye=I=>ee!==void 0&&I!==ee&&se==="auto"&&(r.readyFirst?!0:Y(I)==="setup");q&&(r.addSetup&&R.forEach((I,_)=>{(Y(_)==="setup"||_===ee)&&q.add(S[_])}),r.readyFirst&&ee!==void 0&&q.add(S[ee]));let ge=ef(t,S,O,X),Je=new Set,De=I=>{for(let _ of ge)_.after!==I||_.ticked||Je.has(_.line)||(Je.add(_.line),e.log(`\u2610 manual, not ticked \xB7 ${s}:${_.line+1} \xB7 ${h(_.text)}`))},be=R.map((I,_)=>{let fe=me(I.info),de=T[I.cellIndex],ne=QB(I.info),at=[];try{at=(Ge(I.language)?Gt(et(I.info,I.source)):gr(I.source,I.info,a)).filter(St=>St.kind==="out").map(St=>St.name)}catch{}let En=!q||q.has(S[_]);return{n:S[_],loc:I,selected:En,runs:En&&(!de||de.active)&&!fe.host&&!fe.skip&&fe.errors.length===0&&ne.state!=="proposed"&&ne.by===void 0&&!(Y(_)==="teardown"&&te==="no")&&!(Y(_)==="setup"&&se==="never")&&!(_===ee&&se!=="auto"),uses:at,captures:(fe.checks?.captures??[]).map(St=>St.name)}}),$=nf(be,s);if($.length>0)throw new gt(`${$.join(`
259
259
  `)}
260
- select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let I=be.flatMap(_=>{if(!_.runs)return[];let fe=me(_.loc.info),de=qB(Ge(_.loc.language)?"":_.loc.source,"patterns",D,fe.confirm===!0?!0:void 0);if(de===void 0)return[];let ne=_.loc.source.split(/\r?\n/).find(at=>at.trim()!=="")?.trim()??"";return[` Step ${_.n} \xB7 ${s}:${_.loc.line+1} \xB7 ${h(fe.name??ne)}: ${de===""?"confirm option":`risky command \u201C${de.trim()}\u201D`}`]});if(I.length>0){let _=I.length===1;throw new gt(`${_?"a step asks":`${I.length} steps ask`} for confirmation in VS Code and ${_?"needs":"need"} --yes here; nothing ran:
260
+ select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let I=be.flatMap(_=>{if(!_.runs)return[];let fe=me(_.loc.info),de=YB(Ge(_.loc.language)?"":_.loc.source,"patterns",D,fe.confirm===!0?!0:void 0);if(de===void 0)return[];let ne=_.loc.source.split(/\r?\n/).find(at=>at.trim()!=="")?.trim()??"";return[` Step ${_.n} \xB7 ${s}:${_.loc.line+1} \xB7 ${h(fe.name??ne)}: ${de===""?"confirm option":`risky command \u201C${de.trim()}\u201D`}`]});if(I.length>0){let _=I.length===1;throw new gt(`${_?"a step asks":`${I.length} steps ask`} for confirmation in VS Code and ${_?"needs":"need"} --yes here; nothing ran:
261
261
  ${I.join(`
262
262
  `)}
263
- pass --yes to run ${_?"it":"them"}`)}}Y&&e.log(Y.size===0?`No block selected (${ws(O)}): manual steps only`:`Step${Y.size===1?"":"s"} ${Zc([...Y])} of ${Math.max(0,...S)} (${ws(O)})`);let M=`not selected (${ws(O)})`,A=c?new Hi:void 0,G=r.transcript?new ms(We.resolve(r.transcript),I=>e.log(`! the transcript ${r.transcript} can't be written, so it stops: ${I.message}`)):void 0,H=r.stepPrefix??"",J=XB(t),Q=I=>[...J].reverse().find(_=>_.line<I)?.text,z=(I,_,fe)=>{G?.append(Vc(new Date,s,`Step ${H}${I} \xB7 ${_}: ${fe}`,h)),G?.flush()},le=I=>{let _,fe=I.secret;if(I.kind==="secret")_=r.env[I.name];else if(I.kind==="input")_=r.inputs[I.name]??r.env[I.name];else if(I.kind==="param")_=r.params[I.name]??a?.params.find(de=>de.name===I.name)?.default;else{let de=m.get(I.name);_=de?.value,fe=de?.secret??!1}return _!==void 0?{value:_,secret:fe}:{missing:I.kind==="secret"?`\${secret:${I.name}}: set the environment variable ${I.name}`:I.kind==="input"?`\${input:${I.name}}: pass --input ${I.name}=\u2026 or set the environment variable ${I.name}`:I.kind==="param"?r.callers?`\${param:${I.name}}: the runbook call doesn't pass ${I.name} (${I.name}=\u2026 in its block), and it has no default`:`\${param:${I.name}}: pass --param ${I.name}=\u2026 (it has no default)`:`\${out:${I.name}} has no value yet; run the cell with capture=${I.name} first`}},ke=new Set,V=[],Me=!1,tt=be.flatMap((I,_)=>I.runs||q(_)==="teardown"&&I.selected?[_]:[]),Wn=R.map(I=>Ge(I.language)?bs(r.file,I.info,I.source):me(I.info).estimateSeconds),en=new Set,mn,tn=[],nn=0,qf=I=>{let _=q(I);return _==="setup"||_==="teardown"?{part:_}:{}},Qf=()=>{let I=Wo(tt.filter(fe=>fe!==ee).map(fe=>({estimateSeconds:Wn[fe],state:en.has(fe)?"done":"pending",...qf(fe)})),{setup:ee===void 0||se!=="auto"?"run":mn===void 0?"unchecked":mn?"up":"run",teardown:te==="no"?"offered":"chosen"}),_=mi(I,0);if(_!==void 0)return mi(I,Qo(process.stdout.isTTY?process.stdout.columns:void 0,_.length))},Ar=[...R.keys()];ee!==void 0&&be.some((I,_)=>_<ee&&I.runs&&ye(_))&&(Ar.splice(Ar.indexOf(ee),1),Ar.unshift(ee));let Ba=I=>h(r.readyFirst?un(t)??s:I.name??un(t)??s);try{for(let I of Ar){let _=R[I];De(I-1);let fe=T[_.cellIndex];if(fe&&ke.has(fe.group)){if(!fe.active)continue}else fe&&ke.add(fe.group);let de=S[I],ne=me(_.info),at=q(I),En=I===ee,St=_.source.split(/\r?\n/).find(K=>K.trim()!=="")?.trim()??"",ut=(K,Oe,nt={})=>({step:de,line:_.line+1,language:_.language,title:h(ne.name??St),status:K,exit:Oe,durationMs:0,...ne.estimateSeconds!==void 0?{estimateSeconds:ne.estimateSeconds}:{},output:"",...W.any?{part:at}:{},...nt}),Zf=at==="body"?"":at==="ready"?" [ready check]":` [${at}]`,Rt=`Step ${H}${de}${Zf} \xB7 ${s}:${_.line+1} \xB7 ${_.language}`;if(fe&&!fe.active){v.has(fe.group)||(e.log(`\u2013 ${Rt}: for ${Cr(ne.os??[])}, skipped on ${Cr([Gn()])}`),V.push(ut("skipped","skipped",{message:`for ${Cr(ne.os??[])}`})));continue}if(r.skipDone&&be[I].selected){let K=_.outputAttrs,Oe=Ws(K?.exit,K?.lines!==void 0,K?.check);if(Oe==="done"||Oe==="skipped"){e.log(`\u2013 ${Rt}: done in an earlier run, kept`),V.push(ut("skipped","skipped",{message:"done in an earlier run"})),en.add(I);continue}}if(!be[I].selected){V.push(ut("skipped","skipped",{message:M}));continue}if(ne.host){e.log(`\u2013 ${Rt}: runs on the host ${ne.host} (md-runbook app), skipped here`),V.push(ut("skipped","skipped",{message:`runs on the host ${ne.host}`}));continue}if(En&&se!=="auto"){let K=se==="never"?"--no-setup":"--setup-always";e.log(`\u2013 ${Rt}: not run (${K})`),V.push(ut("skipped","skipped",{message:`not run (${K})`}));continue}if(at==="setup"&&se==="never"){e.log(`\u2013 ${Rt}: setup, not run (--no-setup)`),V.push(ut("skipped","skipped",{message:"setup, not run (--no-setup)"}));continue}if(at==="teardown"&&te==="no"){e.log(`\u2013 ${Rt}: teardown, not run (--teardown runs it)`),V.push(ut("skipped","skipped",{message:"teardown, not chosen (--teardown runs it)"}));continue}if(Me&&!(at==="teardown"&&te==="always")){V.push(ut("not run","not run",{message:"an earlier step failed"}));continue}if(ye(I)&&mn===!0){e.log(`\u2013 ${Rt}: already up (the ready check passed), skipped`),b=An(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: already up (the ready check passed)
264
- `,attrs:{exit:"skipped",ready:"up",ran:Te(new Date)}},k)??b,V.push(ut("skipped","skipped",{message:"already up"})),en.add(I);continue}let ze=(K,Oe="not run")=>{e.log(`\u2717 ${Rt}: not run: ${K}`),z(de,h(ne.name??St),`not run: ${K}`),V.push(ut("not run",Oe,{message:K})),r.keepGoing||(Me=!0)};if(ne.errors.length>0){ze(`invalid cell option ${ne.errors.join("; ")}`,"error");continue}let ua=QB(_.info);if(ua.state==="proposed"){ze("proposed by an assistant and not approved; approve it in VS Code first");continue}if(ua.by!==void 0){ze("written by an assistant; such cells only run in VS Code (approval, read-only credentials)");continue}let Qi=Fe(_.language),Wi=Ge(_.language);if(!Qi&&!Wi)continue;if(ne.skip){e.log(`\u2013 ${Rt}: skipped (skip option)`),b=An(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: skip option
265
- `,attrs:{exit:"skipped",ran:Te(new Date)}},k)??b,V.push(ut("skipped","skipped"));continue}let Vi=qB(Wi?"":_.source,"patterns",D,ne.confirm===!0?!0:void 0);if(Vi!==void 0&&!r.yes){let K=Vi===""?"this block asks for confirmation (confirm option)":`risky command \u201C${Vi.trim()}\u201D`;b=An(b,_.cellIndex,{kind:"new",text:`[md-runbook] not confirmed: ${K}; pass --yes to run it
266
- `,attrs:{exit:"declined",ran:Te(new Date)}},k)??b,ze(`${K}; pass --yes to run it`,"declined");continue}if(Wi){let K=et(_.info,_.source);if(K.problems.length>0||K.src===void 0){ze(K.problems.map(oe=>oe.message).join("; "),"error");continue}let Oe;try{Oe=Gt(K)}catch(oe){ze(oe instanceof Error?oe.message:String(oe),"error");continue}let nt=new Map,lt;for(let oe of Oe){let Ee=le(oe);if("missing"in Ee){lt=Ee.missing;break}nt.set(oe.name,Ee),Ee.secret&&p(Ee.value)}if(lt){ze(lt,"error");continue}let jt=oe=>{let Ee=di(oe,(Ir,vn)=>nt.get(vn)?.value);return"text"in Ee?Ee.text:oe},He=Ut(r.file,jt(K.src)),Ae=Es(r.file,He);if(!wt.existsSync(He)||!wt.statSync(He).isFile()){ze(`src="${h(K.src)}": no such runbook: ${h(Ae)}`,"error");continue}if(n&&!xs(n,He)){ze(`${h(Ae)} is outside the repository (${n}): a signed runbook calls runbooks in its own repository`,"error");continue}let kn=r.callers??[We.resolve(r.file)],wa=dl(kn.map(oe=>We.relative(process.cwd(),oe)||oe),We.relative(process.cwd(),He)||He,(oe,Ee)=>yr(oe,Ee));if(wa){ze(wa,"error");continue}let ka=wt.readFileSync(He,"utf8"),so=pi(K,ka),xa=[...so.unknown.map(oe=>`${Ae} has no parameter ${oe.name}`),...so.notPassed.map(oe=>`${Ae} needs \${param:${oe}}: pass it in the call (${oe}=\u2026), it has no default`),...so.sections];if(xa.length>0){ze(xa.join("; "),"error");continue}let io={};for(let oe of K.args)io[oe.name]=jt(oe.value);let va=ve(ka),ya;try{let oe=vn=>r.params[vn]??a?.params.find(lo=>lo.name===vn)?.default,Ee=ai(Xr(ne,a),oe),Ir=ai(va?.kubeContext,vn=>io[vn]??va?.params.find(lo=>lo.name===vn)?.default);if(Ee!==void 0&&Ir!==void 0&&Ee!==Ir){ze(`${Ae} runs against the Kubernetes context ${Ir}, this runbook against ${Ee}: nothing ran`,"error");continue}Ee!==void 0&&Ir===void 0&&(ya={context:Ee,...a?.kubeContextMode?{mode:a.kubeContextMode}:{}})}catch(oe){ze(oe instanceof Error?oe.message:String(oe),"error");continue}let er,oo=!1,tr=hi(_.outputAttrs);if(tr&&!r.freshCopy&&tr.exit!==void 0&&tr.exit!=="0"&&tr.exit!=="skipped"){let oe=We.resolve(We.dirname(We.resolve(r.file)),tr.copy);wt.existsSync(oe)&&yr(Ut(r.file,tr.runbook),He)&&(er=oe,oo=!0)}er??=zB(He,t,r.copyFolder);let nr=Es(r.file,er),Sa=h(ne.name??St),Ra=K.sections.length?` (section${K.sections.length===1?"":"s"} ${K.sections.map(oe=>JSON.stringify(oe)).join(", ")})`:"";e.log(`\u25B6 ${Rt}${ne.name?` \xB7 ${ne.name}`:""} \xB7 ${h(Ae)}${Ra} \xB7 ${oo?`continuing ${nr} (steps done there are kept)`:`copy ${nr}`}`),z(de,Sa,`runs ${h(Ae)}${Ra} as ${nr}`);let Ls=new Date,Bo=new AbortController,Oa=()=>Bo.abort();r.signal?.addEventListener("abort",Oa,{once:!0});let ao=!1,td=ne.timeoutSeconds?setTimeout(()=>(ao=!0,Bo.abort()),ne.timeoutSeconds*1e3):void 0,ct,Et;try{ct=await ea({...r,file:er,params:io,from:void 0,to:void 0,skipDone:oo,sections:K.sections.length?K.sections:void 0,session:void 0,signal:Bo.signal,progress:!1,extraSecrets:[...f],callers:[...kn,He],stepPrefix:`${H}${de}.`,inheritKubeContext:ya,...n?{signedRoot:n}:{},setup:"auto",addSetup:!1,teardown:te==="always"?"always":"success",readyFirst:q(I)==="setup"},{out:e.out,log:Ee=>e.log(` ${Ee}`)}),wt.writeFileSync(er,ct.text,"utf8");for(let Ee of ct.steps)(Ee.status==="failed"||Ee.status==="not run")&&(Et??=`step ${H}${de}.${Ee.step} ${Ee.status==="failed"?"failed":"not run"}: ${Ee.message??Ee.exit}`);let oe=ct.manual.filter(Ee=>!Ee.ticked).length;!ct.ok&&Et===void 0&&oe>0&&(Et=`${oe} manual step${oe===1?"":"s"} not ticked in ${nr}, which keeps evidence: tick ${oe===1?"it":"them"} there and run the call again`)}catch(oe){Et=oe instanceof Error?oe.message:String(oe)}finally{clearTimeout(td),r.signal?.removeEventListener("abort",Oa)}ao&&(Et=`timed out after ${ne.timeoutSeconds}s; the runbook called was stopped`);let uo=new Date,Ns=oe=>ct?.steps.filter(Ee=>Ee.status===oe).length??0,Tr={runbook:Ae,copy:nr,sha256:YB(er),done:Ns("passed"),skipped:Ns("skipped"),failed:Ns("failed"),notRun:Ns("not run"),manual:ct?.manual.filter(oe=>!oe.ticked).length??0},xn=ct?.ok===!0&&!ao,rr=xn&&q(I)==="setup"&&ct?.setup?.ready===!0;q(I)==="setup"&&ct?.setup?.ready!==void 0&&tn.push(ct.setup.ready),q(I)==="setup"&&!rr&&(nn+=Date.now()-Ls.getTime());let Aa=fl(Tr,K.sections)+(rr?`[md-runbook] already up: the ready check of ${Ae} passed, so its setup was skipped
263
+ pass --yes to run ${_?"it":"them"}`)}}q&&e.log(q.size===0?`No block selected (${ws(O)}): manual steps only`:`Step${q.size===1?"":"s"} ${Zc([...q])} of ${Math.max(0,...S)} (${ws(O)})`);let M=`not selected (${ws(O)})`,A=c?new Hi:void 0,G=r.transcript?new ms(We.resolve(r.transcript),I=>e.log(`! the transcript ${r.transcript} can't be written, so it stops: ${I.message}`)):void 0,H=r.stepPrefix??"",J=XB(t),Q=I=>[...J].reverse().find(_=>_.line<I)?.text,z=(I,_,fe)=>{G?.append(Vc(new Date,s,`Step ${H}${I} \xB7 ${_}: ${fe}`,h)),G?.flush()},le=I=>{let _,fe=I.secret;if(I.kind==="secret")_=r.env[I.name];else if(I.kind==="input")_=r.inputs[I.name]??r.env[I.name];else if(I.kind==="param")_=r.params[I.name]??a?.params.find(de=>de.name===I.name)?.default;else{let de=m.get(I.name);_=de?.value,fe=de?.secret??!1}return _!==void 0?{value:_,secret:fe}:{missing:I.kind==="secret"?`\${secret:${I.name}}: set the environment variable ${I.name}`:I.kind==="input"?`\${input:${I.name}}: pass --input ${I.name}=\u2026 or set the environment variable ${I.name}`:I.kind==="param"?r.callers?`\${param:${I.name}}: the runbook call doesn't pass ${I.name} (${I.name}=\u2026 in its block), and it has no default`:`\${param:${I.name}}: pass --param ${I.name}=\u2026 (it has no default)`:`\${out:${I.name}} has no value yet; run the cell with capture=${I.name} first`}},ke=new Set,V=[],Me=!1,tt=be.flatMap((I,_)=>I.runs||Y(_)==="teardown"&&I.selected?[_]:[]),Wn=R.map(I=>Ge(I.language)?bs(r.file,I.info,I.source):me(I.info).estimateSeconds),en=new Set,mn,tn=[],nn=0,Yf=I=>{let _=Y(I);return _==="setup"||_==="teardown"?{part:_}:{}},Qf=()=>{let I=Wo(tt.filter(fe=>fe!==ee).map(fe=>({estimateSeconds:Wn[fe],state:en.has(fe)?"done":"pending",...Yf(fe)})),{setup:ee===void 0||se!=="auto"?"run":mn===void 0?"unchecked":mn?"up":"run",teardown:te==="no"?"offered":"chosen"}),_=mi(I,0);if(_!==void 0)return mi(I,Qo(process.stdout.isTTY?process.stdout.columns:void 0,_.length))},Ar=[...R.keys()];ee!==void 0&&be.some((I,_)=>_<ee&&I.runs&&ye(_))&&(Ar.splice(Ar.indexOf(ee),1),Ar.unshift(ee));let Ba=I=>h(r.readyFirst?un(t)??s:I.name??un(t)??s);try{for(let I of Ar){let _=R[I];De(I-1);let fe=T[_.cellIndex];if(fe&&ke.has(fe.group)){if(!fe.active)continue}else fe&&ke.add(fe.group);let de=S[I],ne=me(_.info),at=Y(I),En=I===ee,St=_.source.split(/\r?\n/).find(K=>K.trim()!=="")?.trim()??"",ut=(K,Oe,nt={})=>({step:de,line:_.line+1,language:_.language,title:h(ne.name??St),status:K,exit:Oe,durationMs:0,...ne.estimateSeconds!==void 0?{estimateSeconds:ne.estimateSeconds}:{},output:"",...W.any?{part:at}:{},...nt}),Zf=at==="body"?"":at==="ready"?" [ready check]":` [${at}]`,Rt=`Step ${H}${de}${Zf} \xB7 ${s}:${_.line+1} \xB7 ${_.language}`;if(fe&&!fe.active){v.has(fe.group)||(e.log(`\u2013 ${Rt}: for ${Cr(ne.os??[])}, skipped on ${Cr([Gn()])}`),V.push(ut("skipped","skipped",{message:`for ${Cr(ne.os??[])}`})));continue}if(r.skipDone&&be[I].selected){let K=_.outputAttrs,Oe=Ws(K?.exit,K?.lines!==void 0,K?.check);if(Oe==="done"||Oe==="skipped"){e.log(`\u2013 ${Rt}: done in an earlier run, kept`),V.push(ut("skipped","skipped",{message:"done in an earlier run"})),en.add(I);continue}}if(!be[I].selected){V.push(ut("skipped","skipped",{message:M}));continue}if(ne.host){e.log(`\u2013 ${Rt}: runs on the host ${ne.host} (md-runbook app), skipped here`),V.push(ut("skipped","skipped",{message:`runs on the host ${ne.host}`}));continue}if(En&&se!=="auto"){let K=se==="never"?"--no-setup":"--setup-always";e.log(`\u2013 ${Rt}: not run (${K})`),V.push(ut("skipped","skipped",{message:`not run (${K})`}));continue}if(at==="setup"&&se==="never"){e.log(`\u2013 ${Rt}: setup, not run (--no-setup)`),V.push(ut("skipped","skipped",{message:"setup, not run (--no-setup)"}));continue}if(at==="teardown"&&te==="no"){e.log(`\u2013 ${Rt}: teardown, not run (--teardown runs it)`),V.push(ut("skipped","skipped",{message:"teardown, not chosen (--teardown runs it)"}));continue}if(Me&&!(at==="teardown"&&te==="always")){V.push(ut("not run","not run",{message:"an earlier step failed"}));continue}if(ye(I)&&mn===!0){e.log(`\u2013 ${Rt}: already up (the ready check passed), skipped`),b=An(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: already up (the ready check passed)
264
+ `,attrs:{exit:"skipped",ready:"up",ran:Te(new Date)}},k)??b,V.push(ut("skipped","skipped",{message:"already up"})),en.add(I);continue}let ze=(K,Oe="not run")=>{e.log(`\u2717 ${Rt}: not run: ${K}`),z(de,h(ne.name??St),`not run: ${K}`),V.push(ut("not run",Oe,{message:K})),r.keepGoing||(Me=!0)};if(ne.errors.length>0){ze(`invalid cell option ${ne.errors.join("; ")}`,"error");continue}let ua=QB(_.info);if(ua.state==="proposed"){ze("proposed by an assistant and not approved; approve it in VS Code first");continue}if(ua.by!==void 0){ze("written by an assistant; such cells only run in VS Code (approval, read-only credentials)");continue}let Qi=$e(_.language),Wi=Ge(_.language);if(!Qi&&!Wi)continue;if(ne.skip){e.log(`\u2013 ${Rt}: skipped (skip option)`),b=An(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: skip option
265
+ `,attrs:{exit:"skipped",ran:Te(new Date)}},k)??b,V.push(ut("skipped","skipped"));continue}let Vi=YB(Wi?"":_.source,"patterns",D,ne.confirm===!0?!0:void 0);if(Vi!==void 0&&!r.yes){let K=Vi===""?"this block asks for confirmation (confirm option)":`risky command \u201C${Vi.trim()}\u201D`;b=An(b,_.cellIndex,{kind:"new",text:`[md-runbook] not confirmed: ${K}; pass --yes to run it
266
+ `,attrs:{exit:"declined",ran:Te(new Date)}},k)??b,ze(`${K}; pass --yes to run it`,"declined");continue}if(Wi){let K=et(_.info,_.source);if(K.problems.length>0||K.src===void 0){ze(K.problems.map(oe=>oe.message).join("; "),"error");continue}let Oe;try{Oe=Gt(K)}catch(oe){ze(oe instanceof Error?oe.message:String(oe),"error");continue}let nt=new Map,lt;for(let oe of Oe){let Ee=le(oe);if("missing"in Ee){lt=Ee.missing;break}nt.set(oe.name,Ee),Ee.secret&&p(Ee.value)}if(lt){ze(lt,"error");continue}let jt=oe=>{let Ee=di(oe,(Ir,vn)=>nt.get(vn)?.value);return"text"in Ee?Ee.text:oe},He=Ut(r.file,jt(K.src)),Ae=Es(r.file,He);if(!wt.existsSync(He)||!wt.statSync(He).isFile()){ze(`src="${h(K.src)}": no such runbook: ${h(Ae)}`,"error");continue}if(n&&!xs(n,He)){ze(`${h(Ae)} is outside the repository (${n}): a signed runbook calls runbooks in its own repository`,"error");continue}let kn=r.callers??[We.resolve(r.file)],wa=dl(kn.map(oe=>We.relative(process.cwd(),oe)||oe),We.relative(process.cwd(),He)||He,(oe,Ee)=>yr(oe,Ee));if(wa){ze(wa,"error");continue}let ka=wt.readFileSync(He,"utf8"),so=pi(K,ka),xa=[...so.unknown.map(oe=>`${Ae} has no parameter ${oe.name}`),...so.notPassed.map(oe=>`${Ae} needs \${param:${oe}}: pass it in the call (${oe}=\u2026), it has no default`),...so.sections];if(xa.length>0){ze(xa.join("; "),"error");continue}let io={};for(let oe of K.args)io[oe.name]=jt(oe.value);let va=ve(ka),ya;try{let oe=vn=>r.params[vn]??a?.params.find(lo=>lo.name===vn)?.default,Ee=ai(Xr(ne,a),oe),Ir=ai(va?.kubeContext,vn=>io[vn]??va?.params.find(lo=>lo.name===vn)?.default);if(Ee!==void 0&&Ir!==void 0&&Ee!==Ir){ze(`${Ae} runs against the Kubernetes context ${Ir}, this runbook against ${Ee}: nothing ran`,"error");continue}Ee!==void 0&&Ir===void 0&&(ya={context:Ee,...a?.kubeContextMode?{mode:a.kubeContextMode}:{}})}catch(oe){ze(oe instanceof Error?oe.message:String(oe),"error");continue}let er,oo=!1,tr=hi(_.outputAttrs);if(tr&&!r.freshCopy&&tr.exit!==void 0&&tr.exit!=="0"&&tr.exit!=="skipped"){let oe=We.resolve(We.dirname(We.resolve(r.file)),tr.copy);wt.existsSync(oe)&&yr(Ut(r.file,tr.runbook),He)&&(er=oe,oo=!0)}er??=zB(He,t,r.copyFolder);let nr=Es(r.file,er),Sa=h(ne.name??St),Ra=K.sections.length?` (section${K.sections.length===1?"":"s"} ${K.sections.map(oe=>JSON.stringify(oe)).join(", ")})`:"";e.log(`\u25B6 ${Rt}${ne.name?` \xB7 ${ne.name}`:""} \xB7 ${h(Ae)}${Ra} \xB7 ${oo?`continuing ${nr} (steps done there are kept)`:`copy ${nr}`}`),z(de,Sa,`runs ${h(Ae)}${Ra} as ${nr}`);let Ls=new Date,Bo=new AbortController,Oa=()=>Bo.abort();r.signal?.addEventListener("abort",Oa,{once:!0});let ao=!1,td=ne.timeoutSeconds?setTimeout(()=>(ao=!0,Bo.abort()),ne.timeoutSeconds*1e3):void 0,ct,Et;try{ct=await ea({...r,file:er,params:io,from:void 0,to:void 0,skipDone:oo,sections:K.sections.length?K.sections:void 0,session:void 0,signal:Bo.signal,progress:!1,extraSecrets:[...f],callers:[...kn,He],stepPrefix:`${H}${de}.`,inheritKubeContext:ya,...n?{signedRoot:n}:{},setup:"auto",addSetup:!1,teardown:te==="always"?"always":"success",readyFirst:Y(I)==="setup"},{out:e.out,log:Ee=>e.log(` ${Ee}`)}),wt.writeFileSync(er,ct.text,"utf8");for(let Ee of ct.steps)(Ee.status==="failed"||Ee.status==="not run")&&(Et??=`step ${H}${de}.${Ee.step} ${Ee.status==="failed"?"failed":"not run"}: ${Ee.message??Ee.exit}`);let oe=ct.manual.filter(Ee=>!Ee.ticked).length;!ct.ok&&Et===void 0&&oe>0&&(Et=`${oe} manual step${oe===1?"":"s"} not ticked in ${nr}, which keeps evidence: tick ${oe===1?"it":"them"} there and run the call again`)}catch(oe){Et=oe instanceof Error?oe.message:String(oe)}finally{clearTimeout(td),r.signal?.removeEventListener("abort",Oa)}ao&&(Et=`timed out after ${ne.timeoutSeconds}s; the runbook called was stopped`);let uo=new Date,Ns=oe=>ct?.steps.filter(Ee=>Ee.status===oe).length??0,Tr={runbook:Ae,copy:nr,sha256:qB(er),done:Ns("passed"),skipped:Ns("skipped"),failed:Ns("failed"),notRun:Ns("not run"),manual:ct?.manual.filter(oe=>!oe.ticked).length??0},xn=ct?.ok===!0&&!ao,rr=xn&&Y(I)==="setup"&&ct?.setup?.ready===!0;Y(I)==="setup"&&ct?.setup?.ready!==void 0&&tn.push(ct.setup.ready),Y(I)==="setup"&&!rr&&(nn+=Date.now()-Ls.getTime());let Aa=fl(Tr,K.sections)+(rr?`[md-runbook] already up: the ready check of ${Ae} passed, so its setup was skipped
267
267
  `:"")+(Et?`[md-runbook] ${Et}
268
- `:""),$a={exit:rr?"skipped":xn?"0":"1",...rr?{ready:"up"}:{},ran:Te(Ls),ended:Te(uo),duration:js(uo.getTime()-Ls.getTime()),...ne.name!==void 0?{name:ne.name}:{},...cl(Tr),...Xo(b,{by:Ji(),on:`${Ji()}@${ys.hostname()}`})},Ms=he(b).cells[_.cellIndex]?.meta,Gs=ce(Ms)?Ks(Ms):void 0,Fa=Gs?zs(Gs,ce(Ms)?Ms.history?.entries??[]:[],eB(b,0)):[];b=An(b,_.cellIndex,{kind:"new",text:h(Aa),attrs:$a,...Gs&&Fa.length?{previous:Gs,history:Fa}:{}},k)??b,z(de,Sa,`${xn?"done":"failed"}: ${ts(Tr)}${Et?` (${h(Et)})`:""}`),e.log(`${xn?"\u2713":"\u2717"} Step ${H}${de} \xB7 ${h(Ae)}: ${ts(Tr)}${Et?` \xB7 ${h(Et)}`:""}`),en.add(I),V.push(ut(rr?"skipped":xn?"passed":"failed",$a.exit,{durationMs:uo.getTime()-Ls.getTime(),output:h(Aa),call:{runbook:Ae,copy:nr,sha256:Tr.sha256,steps:ct?.steps??[],manual:ct?.manual??[]},...rr?{message:"already up"}:xn?{}:{message:h(Et??"the runbook called failed")}})),!xn&&!ne.continueOnError&&!r.keepGoing&&(Me=!0),r.signal?.aborted&&(Me=!0);continue}if(!Qi)continue;let rn={...ne.env},Zi,la=new Set,ca,fa;try{fa=Xe(_.source).length,ca=gr(_.source,_.info,a)}catch(K){ze(K instanceof Error?K.message:String(K),"error");continue}for(let K of ca){let Oe=le(K);if("missing"in Oe){Zi=Oe.missing;break}rn[K.name]=Oe.value,Oe.secret&&(p(Oe.value),la.add(K.name))}if(Zi){ze(Zi,"error");continue}let $r=ne.checks,Os,da=Xr(ne,a);try{$r&&($r=rl($r,rn,K=>la.has(K))),Os=ai(da,K=>rn[K])}catch(K){ze(K instanceof Error?K.message:String(K),"error");continue}let As=Nn(da)!==void 0?Os:void 0,pa=FB({language:_.language,frontMatter:a,kubeContext:Os,env:{...process.env,...a?.env,...rn},pins:u});rn=TB(rn,pa);let ha=fa>0?hr(_.source,Qi):_.source,Xi=(ne.checks?.captures??[]).some(K=>K.secret),eo="",Fr=ne.cwd!==void 0?We.resolve(i,ne.cwd):l,Ca=ne.timeoutSeconds??a?.timeoutSeconds??r.timeoutSeconds??0,bn=ne.retry?.attempts??1,Xf=ne.estimateSeconds!==void 0?` \xB7 est. ${it(ne.estimateSeconds)}`:"";e.log(`\u25B6 ${Rt}${Xf}${ne.name?` \xB7 ${ne.name}`:""}${As?` \xB7 Kubernetes context ${As}`:""}`);let Dn=new Date,Vn=G?new _i(K=>G.append(K),h,Xi):void 0;Vn?.start({at:Dn,runbook:s,step:de,line:_.line+1,section:Q(_.line),title:ne.name??St,command:ha});let Zn="",to="",Se,je,Jt=0,ga=wt.existsSync(Fr)?await qu(Os,async K=>{let Oe="",nt="",lt={language:_.language,source:K,cwd:Fr,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:15e3,env:rn,signal:r.signal,onStdout:He=>Oe+=He,onStderr:He=>nt+=He},jt=A?await A.execute({...lt,baseCwd:l}):await jn(lt);return{exitCode:jt.exitCode,stdout:Oe,stderr:jt.error??(jt.timedOut?"timed out":nt)}},pa.pinned):void 0;if(ga!==void 0)Jt=1,Se={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:ga,durationMs:0};else for(;;){Jt++,Jt>1&&Vn?.attempt(Jt,bn,new Date),Zn="",to="",eo="";let K=new Rn(Ae=>Xi?eo+=Ae:e.out(Ae),h),Oe=Ae=>kn=>{Zn+=kn,Ae&&(to+=kn),K.write(kn),Vn?.out(Ae?"stdout":"stderr",kn)},nt={language:_.language,source:ha,cwd:Fr,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:Ca*1e3,env:rn,signal:r.signal,onStdout:Oe(!0),onStderr:Oe(!1)};if(!wt.existsSync(Fr))Se={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:`Working directory not found: ${Fr}`,durationMs:0};else try{Se=A?await A.execute({...nt,baseCwd:l}):await jn(nt)}catch(Ae){Se={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:Ae instanceof Error?Ae.message:String(Ae),durationMs:0}}if(K.flush(),je=il($r)&&Se.exitCode!==null&&Se.error===void 0&&!Se.timedOut&&!Se.cancelled?ol($r,Se.exitCode,Zn,to):void 0,(je?je.ok:ar(Se))||Jt>=bn||Se.cancelled||r.signal?.aborted)break;let jt=je?.failures[0]??(Se.timedOut?"timed out":Se.error??`exit code ${Jr(Se)}`),He=ne.retry?.everyMs??0;if(e.log(` attempt ${Jt}/${bn} failed (${h(jt)}); trying again in ${He/1e3}s`),Vn?.out("stderr",`[md-runbook] attempt ${Jt}/${bn} failed (${jt}); trying again in ${He/1e3}s
268
+ `:""),Fa={exit:rr?"skipped":xn?"0":"1",...rr?{ready:"up"}:{},ran:Te(Ls),ended:Te(uo),duration:js(uo.getTime()-Ls.getTime()),...ne.name!==void 0?{name:ne.name}:{},...cl(Tr),...Xo(b,{by:Ji(),on:`${Ji()}@${ys.hostname()}`})},Ms=he(b).cells[_.cellIndex]?.meta,Gs=ce(Ms)?Ks(Ms):void 0,$a=Gs?zs(Gs,ce(Ms)?Ms.history?.entries??[]:[],eB(b,0)):[];b=An(b,_.cellIndex,{kind:"new",text:h(Aa),attrs:Fa,...Gs&&$a.length?{previous:Gs,history:$a}:{}},k)??b,z(de,Sa,`${xn?"done":"failed"}: ${ts(Tr)}${Et?` (${h(Et)})`:""}`),e.log(`${xn?"\u2713":"\u2717"} Step ${H}${de} \xB7 ${h(Ae)}: ${ts(Tr)}${Et?` \xB7 ${h(Et)}`:""}`),en.add(I),V.push(ut(rr?"skipped":xn?"passed":"failed",Fa.exit,{durationMs:uo.getTime()-Ls.getTime(),output:h(Aa),call:{runbook:Ae,copy:nr,sha256:Tr.sha256,steps:ct?.steps??[],manual:ct?.manual??[]},...rr?{message:"already up"}:xn?{}:{message:h(Et??"the runbook called failed")}})),!xn&&!ne.continueOnError&&!r.keepGoing&&(Me=!0),r.signal?.aborted&&(Me=!0);continue}if(!Qi)continue;let rn={...ne.env},Zi,la=new Set,ca,fa;try{fa=Xe(_.source).length,ca=gr(_.source,_.info,a)}catch(K){ze(K instanceof Error?K.message:String(K),"error");continue}for(let K of ca){let Oe=le(K);if("missing"in Oe){Zi=Oe.missing;break}rn[K.name]=Oe.value,Oe.secret&&(p(Oe.value),la.add(K.name))}if(Zi){ze(Zi,"error");continue}let Fr=ne.checks,Os,da=Xr(ne,a);try{Fr&&(Fr=rl(Fr,rn,K=>la.has(K))),Os=ai(da,K=>rn[K])}catch(K){ze(K instanceof Error?K.message:String(K),"error");continue}let As=Nn(da)!==void 0?Os:void 0,pa=$B({language:_.language,frontMatter:a,kubeContext:Os,env:{...process.env,...a?.env,...rn},pins:u});rn=TB(rn,pa);let ha=fa>0?hr(_.source,Qi):_.source,Xi=(ne.checks?.captures??[]).some(K=>K.secret),eo="",$r=ne.cwd!==void 0?We.resolve(i,ne.cwd):l,Ca=ne.timeoutSeconds??a?.timeoutSeconds??r.timeoutSeconds??0,bn=ne.retry?.attempts??1,Xf=ne.estimateSeconds!==void 0?` \xB7 est. ${it(ne.estimateSeconds)}`:"";e.log(`\u25B6 ${Rt}${Xf}${ne.name?` \xB7 ${ne.name}`:""}${As?` \xB7 Kubernetes context ${As}`:""}`);let Dn=new Date,Vn=G?new _i(K=>G.append(K),h,Xi):void 0;Vn?.start({at:Dn,runbook:s,step:de,line:_.line+1,section:Q(_.line),title:ne.name??St,command:ha});let Zn="",to="",Se,je,Jt=0,ga=wt.existsSync($r)?await Yu(Os,async K=>{let Oe="",nt="",lt={language:_.language,source:K,cwd:$r,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:15e3,env:rn,signal:r.signal,onStdout:He=>Oe+=He,onStderr:He=>nt+=He},jt=A?await A.execute({...lt,baseCwd:l}):await jn(lt);return{exitCode:jt.exitCode,stdout:Oe,stderr:jt.error??(jt.timedOut?"timed out":nt)}},pa.pinned):void 0;if(ga!==void 0)Jt=1,Se={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:ga,durationMs:0};else for(;;){Jt++,Jt>1&&Vn?.attempt(Jt,bn,new Date),Zn="",to="",eo="";let K=new Rn(Ae=>Xi?eo+=Ae:e.out(Ae),h),Oe=Ae=>kn=>{Zn+=kn,Ae&&(to+=kn),K.write(kn),Vn?.out(Ae?"stdout":"stderr",kn)},nt={language:_.language,source:ha,cwd:$r,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:Ca*1e3,env:rn,signal:r.signal,onStdout:Oe(!0),onStderr:Oe(!1)};if(!wt.existsSync($r))Se={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:`Working directory not found: ${$r}`,durationMs:0};else try{Se=A?await A.execute({...nt,baseCwd:l}):await jn(nt)}catch(Ae){Se={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:Ae instanceof Error?Ae.message:String(Ae),durationMs:0}}if(K.flush(),je=il(Fr)&&Se.exitCode!==null&&Se.error===void 0&&!Se.timedOut&&!Se.cancelled?ol(Fr,Se.exitCode,Zn,to):void 0,(je?je.ok:ar(Se))||Jt>=bn||Se.cancelled||r.signal?.aborted)break;let jt=je?.failures[0]??(Se.timedOut?"timed out":Se.error??`exit code ${Jr(Se)}`),He=ne.retry?.everyMs??0;if(e.log(` attempt ${Jt}/${bn} failed (${h(jt)}); trying again in ${He/1e3}s`),Vn?.out("stderr",`[md-runbook] attempt ${Jt}/${bn} failed (${jt}); trying again in ${He/1e3}s
269
269
  `),!await gC(He,r.signal))break}for(let K of je?.secretValues??[])p(K);Xi&&e.out(h(eo));let no=K=>{Zn+=K,e.out(h(K)),Vn?.out("stderr",K)};Se.error!==void 0&&no(Se.error+`
270
270
  `),Se.timedOut&&no(`[md-runbook] timed out after ${Ca}s; process tree killed
271
271
  `);for(let K of je&&!je.ok?je.failures:[])no(`[md-runbook] check failed: ${K}
272
- `);if(je?.ok)for(let K of je.captured)m.set(K.name,{value:K.value,secret:K.secret});let Xn=new Date,$s=Jr(Se),wn=En?(je?je.ok:ar(Se))&&!Se.cancelled:void 0,Fs=En?"ok":je?je.ok?"ok":"failed":void 0,ma={exit:$s,ran:Te(Dn),ended:Te(Xn),duration:js(Xn.getTime()-Dn.getTime()),...Fs?{check:Fs}:{},...wn!==void 0?{ready:wn?"up":"down"}:{},...bn>1?{attempts:String(Jt)}:{},...ne.name!==void 0?{name:ne.name}:{},...As?{"kube-context":As}:{},...Xo(b,{by:Ji(),on:`${Ji()}@${ys.hostname()}`})},Ts=he(b).cells[_.cellIndex]?.meta,Is=ce(Ts)?Ks(Ts):void 0,Ea=Is?zs(Is,ce(Ts)?Ts.history?.entries??[]:[],eB(b,0)):[];b=An(b,_.cellIndex,{kind:"new",text:Zn,attrs:ma,...Is&&Ea.length?{previous:Is,history:Ea}:{}},k)??b;let ro=En?!Se.cancelled:je?je.ok:ar(Se);if(wn!==void 0){mn=wn,tn.push(wn);let K=be.flatMap((nt,lt)=>nt.runs&&ye(lt)&&Wn[lt]!==void 0?[Wn[lt]]:[]),Oe=K.length?` - ${Yo(K.reduce((nt,lt)=>nt+lt,0))} to set it up`:"";e.log(wn?`Setup: ${Ba(ne)} is already up - setup skipped`:`Setup: ${Ba(ne)} is not up${Oe}`),z(de,h(ne.name??St),wn?"ready check: up, setup skipped":"ready check: not up, the setup runs")}at==="setup"&&(nn+=Xn.getTime()-Dn.getTime()),Vn?.end({exit:$s,durationMs:Xn.getTime()-Dn.getTime(),...Fs?{check:Fs}:{},...bn>1?{attempt:Jt,attempts:bn}:{}}),G?.flush();let{ran:PC,ended:HC,...ed}=ma;e.log(`${xo(ed)}${Se.shell?` \xB7 ${Se.shell.label}`:""}`);let ba=(Xn.getTime()-Dn.getTime())/1e3;ne.estimateSeconds!==void 0&&qo(ba,ne.estimateSeconds)&&e.log(`! Step ${H}${de} took ${it(ba)}, more than twice its estimate of ${it(ne.estimateSeconds)}`),en.add(I);let Da=r.progress?Qf():void 0;Da&&e.log(` ${Da}`),V.push(ut(ro?"passed":"failed",$s,{durationMs:Xn.getTime()-Dn.getTime(),output:h(Zn),...ro?{}:{message:je?.failures[0]??`exit ${$s}`}})),!ro&&!ne.continueOnError&&!r.keepGoing&&(Me=!0),r.signal?.aborted&&(Me=!0)}}finally{G?.flush(),A?.dispose(),u.dispose()}De(R.length-1);let qi=ge.filter(I=>!I.ticked),aa=o?.evidence===!0;if(qi.length>0){let I=qi.length;e.log(aa?`\u2717 ${I} manual step${I===1?"":"s"} not ticked, and this runbook keeps evidence: tick ${I===1?"it":"them"} (- [x]) once done, and run again`:`\u2610 ${I} manual step${I===1?"":"s"} not ticked`)}let Wf=V.every(I=>I.status==="passed"||I.status==="skipped")&&!(aa&&qi.length>0);Ar[0]!==0&&V.sort((I,_)=>I.step-_.step),W.any&&te==="no"&&be.some((I,_)=>q(_)==="teardown"&&I.selected)&&e.log("\u2610 teardown not run: run again with --teardown (or --from with its step) when you stop for the day");let Vf=W.any?{setup:{...tn.length?{ready:tn.every(Boolean)}:{},seconds:Math.round(nn/100)/10}}:{};return{steps:V,manual:ge.map(({after:I,..._})=>({..._,text:h(_.text)})),text:b,ok:Wf,redact:h,...Vf}}var Cn=r=>r.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"})[e]).replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,"");function ta(r,e=""){return r.flatMap(t=>[{...t,number:`${e}${t.step}`},...t.call?ta(t.call.steps,`${e}${t.step}.`).map(n=>({...n,file:n.file??t.call.copy})):[]])}function na(r,e,t){return[...t.map(n=>({...n,file:r})),...e.flatMap(n=>n.call?na(n.call.copy,n.call.steps,n.call.manual):[])]}function rf(r,e,t=[]){let n=ta(e),s=na(r,e,t).map(c=>{let u=` <testcase classname="${Cn(c.file)}" name="${Cn(`Manual (line ${c.line+1}): ${c.text}`)}" time="0.000">`;return c.ticked?`${u}</testcase>`:`${u}<skipped message="manual step, not ticked"/></testcase>`}),i=n.filter(c=>c.status==="failed"||c.status==="not run").length,o=n.filter(c=>c.status==="skipped").length+s.filter(c=>c.includes("<skipped")).length,B=c=>(c/1e3).toFixed(3),a=e.reduce((c,u)=>c+u.durationMs,0),l=n.map(c=>{let u=Cn(`Step ${c.number}: ${c.title}`),f=c.estimateSeconds!==void 0?`<properties><property name="estimate" value="${c.estimateSeconds}"/></properties>`:"",d=` <testcase classname="${Cn(c.file??r)}" name="${u}" time="${B(c.durationMs)}">${f}`;return c.status==="passed"?`${d}</testcase>`:c.status==="skipped"?`${d}<skipped message="${Cn(c.message??"skipped")}"/></testcase>`:`${d}
272
+ `);if(je?.ok)for(let K of je.captured)m.set(K.name,{value:K.value,secret:K.secret});let Xn=new Date,Fs=Jr(Se),wn=En?(je?je.ok:ar(Se))&&!Se.cancelled:void 0,$s=En?"ok":je?je.ok?"ok":"failed":void 0,ma={exit:Fs,ran:Te(Dn),ended:Te(Xn),duration:js(Xn.getTime()-Dn.getTime()),...$s?{check:$s}:{},...wn!==void 0?{ready:wn?"up":"down"}:{},...bn>1?{attempts:String(Jt)}:{},...ne.name!==void 0?{name:ne.name}:{},...As?{"kube-context":As}:{},...Xo(b,{by:Ji(),on:`${Ji()}@${ys.hostname()}`})},Ts=he(b).cells[_.cellIndex]?.meta,Is=ce(Ts)?Ks(Ts):void 0,Ea=Is?zs(Is,ce(Ts)?Ts.history?.entries??[]:[],eB(b,0)):[];b=An(b,_.cellIndex,{kind:"new",text:Zn,attrs:ma,...Is&&Ea.length?{previous:Is,history:Ea}:{}},k)??b;let ro=En?!Se.cancelled:je?je.ok:ar(Se);if(wn!==void 0){mn=wn,tn.push(wn);let K=be.flatMap((nt,lt)=>nt.runs&&ye(lt)&&Wn[lt]!==void 0?[Wn[lt]]:[]),Oe=K.length?` - ${qo(K.reduce((nt,lt)=>nt+lt,0))} to set it up`:"";e.log(wn?`Setup: ${Ba(ne)} is already up - setup skipped`:`Setup: ${Ba(ne)} is not up${Oe}`),z(de,h(ne.name??St),wn?"ready check: up, setup skipped":"ready check: not up, the setup runs")}at==="setup"&&(nn+=Xn.getTime()-Dn.getTime()),Vn?.end({exit:Fs,durationMs:Xn.getTime()-Dn.getTime(),...$s?{check:$s}:{},...bn>1?{attempt:Jt,attempts:bn}:{}}),G?.flush();let{ran:HC,ended:_C,...ed}=ma;e.log(`${xo(ed)}${Se.shell?` \xB7 ${Se.shell.label}`:""}`);let ba=(Xn.getTime()-Dn.getTime())/1e3;ne.estimateSeconds!==void 0&&Yo(ba,ne.estimateSeconds)&&e.log(`! Step ${H}${de} took ${it(ba)}, more than twice its estimate of ${it(ne.estimateSeconds)}`),en.add(I);let Da=r.progress?Qf():void 0;Da&&e.log(` ${Da}`),V.push(ut(ro?"passed":"failed",Fs,{durationMs:Xn.getTime()-Dn.getTime(),output:h(Zn),...ro?{}:{message:je?.failures[0]??`exit ${Fs}`}})),!ro&&!ne.continueOnError&&!r.keepGoing&&(Me=!0),r.signal?.aborted&&(Me=!0)}}finally{G?.flush(),A?.dispose(),u.dispose()}De(R.length-1);let Yi=ge.filter(I=>!I.ticked),aa=o?.evidence===!0;if(Yi.length>0){let I=Yi.length;e.log(aa?`\u2717 ${I} manual step${I===1?"":"s"} not ticked, and this runbook keeps evidence: tick ${I===1?"it":"them"} (- [x]) once done, and run again`:`\u2610 ${I} manual step${I===1?"":"s"} not ticked`)}let Wf=V.every(I=>I.status==="passed"||I.status==="skipped")&&!(aa&&Yi.length>0);Ar[0]!==0&&V.sort((I,_)=>I.step-_.step),W.any&&te==="no"&&be.some((I,_)=>Y(_)==="teardown"&&I.selected)&&e.log("\u2610 teardown not run: run again with --teardown (or --from with its step) when you stop for the day");let Vf=W.any?{setup:{...tn.length?{ready:tn.every(Boolean)}:{},seconds:Math.round(nn/100)/10}}:{};return{steps:V,manual:ge.map(({after:I,..._})=>({..._,text:h(_.text)})),text:b,ok:Wf,redact:h,...Vf}}var Cn=r=>r.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"})[e]).replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,"");function ta(r,e=""){return r.flatMap(t=>[{...t,number:`${e}${t.step}`},...t.call?ta(t.call.steps,`${e}${t.step}.`).map(n=>({...n,file:n.file??t.call.copy})):[]])}function na(r,e,t){return[...t.map(n=>({...n,file:r})),...e.flatMap(n=>n.call?na(n.call.copy,n.call.steps,n.call.manual):[])]}function rf(r,e,t=[]){let n=ta(e),s=na(r,e,t).map(c=>{let u=` <testcase classname="${Cn(c.file)}" name="${Cn(`Manual (line ${c.line+1}): ${c.text}`)}" time="0.000">`;return c.ticked?`${u}</testcase>`:`${u}<skipped message="manual step, not ticked"/></testcase>`}),i=n.filter(c=>c.status==="failed"||c.status==="not run").length,o=n.filter(c=>c.status==="skipped").length+s.filter(c=>c.includes("<skipped")).length,B=c=>(c/1e3).toFixed(3),a=e.reduce((c,u)=>c+u.durationMs,0),l=n.map(c=>{let u=Cn(`Step ${c.number}: ${c.title}`),f=c.estimateSeconds!==void 0?`<properties><property name="estimate" value="${c.estimateSeconds}"/></properties>`:"",d=` <testcase classname="${Cn(c.file??r)}" name="${u}" time="${B(c.durationMs)}">${f}`;return c.status==="passed"?`${d}</testcase>`:c.status==="skipped"?`${d}<skipped message="${Cn(c.message??"skipped")}"/></testcase>`:`${d}
273
273
  <failure message="${Cn(c.message??c.exit)}">${Cn(c.output)}</failure>
274
274
  </testcase>`});return`<?xml version="1.0" encoding="UTF-8"?>
275
275
  <testsuites>
@@ -327,7 +327,7 @@ ${Ss}`),2}if(!mt.existsSync(n.file))return process.stderr.write(`md-runbook: no
327
327
  ${Ss}`),2;s=h}}if(!s||r.includes("--allowed-signers")&&!i)return process.stderr.write(`md-runbook: ${s?"--allowed-signers needs a file":"missing the runbook file"}
328
328
 
329
329
  ${Ss}`),2;if(!mt.existsSync(s))return process.stderr.write(`md-runbook: no such file: ${s}
330
- `),2;let o=mt.readFileSync(s,"utf8"),B=ot(o),a=await vC(o,s,i,e,t);if(!B)return a!==void 0?(e(`${a?"\u2713":"\u2717"} run record${i?"":", signature not checked"} (the runbook itself is not signed)`),a?0:1):(e(`\u2717 ${s}: ${/<!-- md-runbook:signature/.test(o)?"the signature block is damaged":"not signed"}`),1);a===!1&&e(" (the run record above does not verify)");let l=B.manifest,c=(B.block.cosigners??[]).map(h=>`, co-signed by ${h.signer} on ${h.signed}`).join("");e(`${s}: ${l.name} version ${l.version}, signed by ${B.block.signer} on ${B.block.signed}${c} (as the file says)`),e(` scopes: ${l.scopes.length?l.scopes.join(" "):"none (only servers that accept any scope)"}`),l.expires&&e(` expires: ${l.expires}${l.expires<Rs()?" (expired)":""}`);for(let[h,p]of Object.entries(l.patterns))e(` parameter ${h}: ${p}`);e(` manifest sha256 ${Mi(B.block.manifest)}`);let u=!0,f=new Map(ft(he(o)).map(h=>[h.cellIndex,h.line]));for(let h of B.changed)e(`${s}:${(f.get(h)??0)+1}: changed since signing: servers that only run signed runbooks refuse this block`),u=!1;for(let h of B.moved)e(`${s}:${(f.get(h)??0)+1}: moved since signing: signed as block ${B.cells.get(h).n}, after blocks that now come later`),u=!1;if(B.missing.length>0&&(e(` signed block${B.missing.length===1?"":"s"} ${B.missing.join(", ")} of ${l.cells.length} not in the file as signed (deleted or changed)`),u=!1),l.expires&&l.expires<Rs()&&(u=!1),i){let h=Dr(B.block),p=gB(B.block),k=new Set;for(let D=0;D<h.length;D++){let m=h.length>1?`signature ${D+1} (${p[D]})`:"signature";try{let b=await Vt(B.block.manifest,h[D],i,t);k.add(b),e(` ${m}: good, by ${b} (${i})`)}catch(b){e(` ${m}: ${b instanceof Error?b.message:String(b)}`),u=!1}}h.length>1&&e(` signers: ${k.size} distinct (${[...k].join(", ")||"none"})`)}else e(" signature: NOT checked (anyone can write a signer name): add --allowed-signers FILE to check it as the gate does");B.missingCalls.length>0&&(e(` signed runbook call${B.missingCalls.length===1?"":"s"} ${B.missingCalls.join(", ")} of ${l.calls.length} not in the file as signed (deleted or changed)`),u=!1);let d=Ui(s);for(let h of B.calls.values()){let p=et(h.info,h.body).src??"";if(Er(p)){e(` runbook call: ${p}: has placeholders, checked when it runs (md-runbook run --allowed-signers)`);continue}let k=Ut(s,p);if(!xs(d,k)){e(` runbook call: ${p}: outside the repository (${d})`),u=!1;continue}if(!i){e(` runbook call: ${p}: ${ot(mt.existsSync(k)?mt.readFileSync(k,"utf8"):"")?"signed (not checked)":"NOT signed"}`);continue}let D=mt.existsSync(k)?await vs(k,{},i,d,{shown:p,...t?{sshKeygen:t}:{}}):{problems:[`${p}: no such runbook`]};e(` runbook call: ${p}: ${D.problems.length===0?"signed, good":D.problems.join("; ")}`),D.problems.length>0&&(u=!1)}return e(`${u?"\u2713":"\u2717"} ${B.cells.size} signed block${B.cells.size===1?"":"s"}${B.calls.size?`, ${B.calls.size} signed runbook call${B.calls.size===1?"":"s"}`:""}, ${B.changed.length} changed`+(i?"":", signature not checked")),u&&a!==!1?0:1}var vf=require("node:child_process"),Lt=ue(require("node:fs")),Ne=ue(require("node:path"));var yC=Ef(),bf={M:2331,L:2953};function ra(r){let e=new TextEncoder().encode(r).length,t=e<=bf.M?"M":e<=bf.L?"L":void 0;if(!t)return;let n=yC(0,t);n.addData(r,"Byte"),n.make();let s=n.getModuleCount(),i=Array.from({length:s},(o,B)=>Array.from({length:s},(a,l)=>n.isDark(B,l)));return{size:s,dark:i,level:t}}function sa(r,e={}){let t=e.scale??4,n=e.margin??4,s=(r.size+n*2)*t,i=e.caption?Math.max(14,t*4)+t*2:0,o=[];for(let a=0;a<r.size;a++){let l=0;for(;l<r.size;){if(!r.dark[a][l]){l++;continue}let c=l;for(;l<r.size&&r.dark[a][l];)l++;o.push(`M${(c+n)*t} ${(a+n)*t}h${(l-c)*t}v${t}h-${(l-c)*t}z`)}}let B=e.caption?`<text x="${s/2}" y="${s+i/2}" text-anchor="middle" dominant-baseline="middle" font-family="system-ui, sans-serif" font-size="${Math.max(12,t*3.5)}" fill="#000">${re(e.caption)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s+i}" width="${s}" height="${s+i}" shape-rendering="crispEdges"><rect width="100%" height="100%" fill="#fff"/><path fill="#000" d="${o.join("")}"/>${B}</svg>`}function Df(r,e){let t=[],n=e.map(i=>{let o=ra(i.link);return o?`<figure class="label">${sa(o,{scale:3})}<figcaption><strong>${re(i.title)}</strong>${i.subtitle?`<span>${re(i.subtitle)}</span>`:""}</figcaption></figure>`:(t.push(i.title),"")});return{html:`<!doctype html>
330
+ `),2;let o=mt.readFileSync(s,"utf8"),B=ot(o),a=await vC(o,s,i,e,t);if(!B)return a!==void 0?(e(`${a?"\u2713":"\u2717"} run record${i?"":", signature not checked"} (the runbook itself is not signed)`),a?0:1):(e(`\u2717 ${s}: ${/<!-- md-runbook:signature/.test(o)?"the signature block is damaged":"not signed"}`),1);a===!1&&e(" (the run record above does not verify)");let l=B.manifest,c=(B.block.cosigners??[]).map(h=>`, co-signed by ${h.signer} on ${h.signed}`).join("");e(`${s}: ${l.name} version ${l.version}, signed by ${B.block.signer} on ${B.block.signed}${c} (as the file says)`),e(` scopes: ${l.scopes.length?l.scopes.join(" "):"none (only servers that accept any scope)"}`),l.expires&&e(` expires: ${l.expires}${l.expires<Rs()?" (expired)":""}`);for(let[h,p]of Object.entries(l.patterns))e(` parameter ${h}: ${p}`);e(` manifest sha256 ${Mi(B.block.manifest)}`);let u=!0,f=new Map(ft(he(o)).map(h=>[h.cellIndex,h.line]));for(let h of B.changed)e(`${s}:${(f.get(h)??0)+1}: changed since signing: servers that only run signed runbooks refuse this block`),u=!1;for(let h of B.moved)e(`${s}:${(f.get(h)??0)+1}: moved since signing: signed as block ${B.cells.get(h).n}, after blocks that now come later`),u=!1;if(B.missing.length>0&&(e(` signed block${B.missing.length===1?"":"s"} ${B.missing.join(", ")} of ${l.cells.length} not in the file as signed (deleted or changed)`),u=!1),l.expires&&l.expires<Rs()&&(u=!1),i){let h=Dr(B.block),p=gB(B.block),k=new Set;for(let D=0;D<h.length;D++){let m=h.length>1?`signature ${D+1} (${p[D]})`:"signature";try{let b=await Vt(B.block.manifest,h[D],i,t);k.add(b),e(` ${m}: good, by ${b} (${i})`)}catch(b){e(` ${m}: ${b instanceof Error?b.message:String(b)}`),u=!1}}h.length>1&&e(` signers: ${k.size} distinct (${[...k].join(", ")||"none"})`)}else e(" signature: NOT checked (anyone can write a signer name): add --allowed-signers FILE to check it as the gate does");B.missingCalls.length>0&&(e(` signed runbook call${B.missingCalls.length===1?"":"s"} ${B.missingCalls.join(", ")} of ${l.calls.length} not in the file as signed (deleted or changed)`),u=!1);let d=Ui(s);for(let h of B.calls.values()){let p=et(h.info,h.body).src??"";if(Er(p)){e(` runbook call: ${p}: has placeholders, checked when it runs (md-runbook run --allowed-signers)`);continue}let k=Ut(s,p);if(!xs(d,k)){e(` runbook call: ${p}: outside the repository (${d})`),u=!1;continue}if(!i){e(` runbook call: ${p}: ${ot(mt.existsSync(k)?mt.readFileSync(k,"utf8"):"")?"signed (not checked)":"NOT signed"}`);continue}let D=mt.existsSync(k)?await vs(k,{},i,d,{shown:p,...t?{sshKeygen:t}:{}}):{problems:[`${p}: no such runbook`]};e(` runbook call: ${p}: ${D.problems.length===0?"signed, good":D.problems.join("; ")}`),D.problems.length>0&&(u=!1)}return e(`${u?"\u2713":"\u2717"} ${B.cells.size} signed block${B.cells.size===1?"":"s"}${B.calls.size?`, ${B.calls.size} signed runbook call${B.calls.size===1?"":"s"}`:""}, ${B.changed.length} changed`+(i?"":", signature not checked")),u&&a!==!1?0:1}var vf=require("node:child_process"),Lt=ue(require("node:fs")),Ne=ue(require("node:path"));function yC(r){if(typeof r=="function")return r;let e=r?.default;if(typeof e=="function")return e;throw new Error("qrcode-generator did not load as a function")}var SC=yC(Ef()),bf={M:2331,L:2953};function ra(r){let e=new TextEncoder().encode(r).length,t=e<=bf.M?"M":e<=bf.L?"L":void 0;if(!t)return;let n=SC(0,t);n.addData(r,"Byte"),n.make();let s=n.getModuleCount(),i=Array.from({length:s},(o,B)=>Array.from({length:s},(a,l)=>n.isDark(B,l)));return{size:s,dark:i,level:t}}function sa(r,e={}){let t=e.scale??4,n=e.margin??4,s=(r.size+n*2)*t,i=e.caption?Math.max(14,t*4)+t*2:0,o=[];for(let a=0;a<r.size;a++){let l=0;for(;l<r.size;){if(!r.dark[a][l]){l++;continue}let c=l;for(;l<r.size&&r.dark[a][l];)l++;o.push(`M${(c+n)*t} ${(a+n)*t}h${(l-c)*t}v${t}h-${(l-c)*t}z`)}}let B=e.caption?`<text x="${s/2}" y="${s+i/2}" text-anchor="middle" dominant-baseline="middle" font-family="system-ui, sans-serif" font-size="${Math.max(12,t*3.5)}" fill="#000">${re(e.caption)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s+i}" width="${s}" height="${s+i}" shape-rendering="crispEdges"><rect width="100%" height="100%" fill="#fff"/><path fill="#000" d="${o.join("")}"/>${B}</svg>`}function Df(r,e){let t=[],n=e.map(i=>{let o=ra(i.link);return o?`<figure class="label">${sa(o,{scale:3})}<figcaption><strong>${re(i.title)}</strong>${i.subtitle?`<span>${re(i.subtitle)}</span>`:""}</figcaption></figure>`:(t.push(i.title),"")});return{html:`<!doctype html>
331
331
  <html lang="en"><head><meta charset="utf-8">
332
332
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:">
333
333
  <title>${re(r)}</title>
@@ -373,14 +373,14 @@ says who approved it.
373
373
  --out FILE .svg (one code), .html or .pdf (labels). Default: next to the runbook
374
374
  --browser PATH Browser for a .pdf (default: CHROME_PATH, else one found on this machine)
375
375
  --link Print the link too
376
- `,vt=class extends Error{},SC=r=>{process.stdout.write(r+`
377
- `)};function RC(r){let e=[...r],t={file:"",embed:!1,pin:!1,params:{},cosign:!1,vscode:!1,printLink:!1},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new vt(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--embed":t.embed=!0;break;case"--url":t.url=n(s);break;case"--pin":t.pin=!0;break;case"--host":t.host=n(s);break;case"--param":{let i=n(s),o=i.indexOf("=");if(o<=0||!$t.test(i.slice(0,o)))throw new vt(`--param expects NAME=VALUE, got "${i}"`);t.params[i.slice(0,o)]=i.slice(o+1);break}case"--cosign":t.cosign=!0;break;case"--web-app":t.webApp=n(s);break;case"--vscode":t.vscode=!0;break;case"--labels":t.labels=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;case"--link":t.printLink=!0;break;default:if(s.startsWith("-"))throw new vt(`unknown option ${s}`);if(t.file)throw new vt(`one runbook at a time (got ${t.file} and ${s})`);t.file=s}}if(!t.file)throw new vt("missing the runbook file");if(t.embed&&t.url)throw new vt("--embed and --url: choose one");if(t.pin&&!t.url)throw new vt("--pin goes with --url (the Git address is pinned anyway)");if(t.webApp&&!/^https:\/\/[^/]+\/(?:.*\/)?open$/.test(t.webApp))throw new vt("--web-app expects https://<web app>/open");if(t.webApp&&t.vscode)throw new vt("--web-app and --vscode: choose one");return t}var Ki=(r,e)=>(0,vf.execFileSync)("git",e,{cwd:r,encoding:"utf8",windowsHide:!0,timeout:1e4,stdio:["ignore","pipe","ignore"],maxBuffer:8*1024*1024});function OC(r){let e=Ne.dirname(Ne.resolve(r)),t,n,s;try{t=Ki(e,["rev-parse","--show-toplevel"]).trim(),n=Ki(e,["remote","get-url","origin"]).trim(),s=Ki(e,["rev-parse","--abbrev-ref","HEAD"]).trim()}catch{return"not in a Git repository with a remote: use --embed, or --url"}let i=Ne.relative(t,Ne.resolve(r)).split(Ne.sep).join("/"),o=kf(n,s,i);if(!o)return`the app opens GitHub and GitLab addresses; this repository's remote is ${n}: use --embed, or --url`;try{return{web:o,sha256:ls(Ki(t,["show",`origin/${s}:${i}`]))}}catch{return{web:o}}}async function ia(r,e=SC,t=!1){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(xf),0;let n;try{n=RC(r)}catch(p){if(!(p instanceof vt))throw p;return process.stderr.write(`md-runbook: ${p.message}
376
+ `,vt=class extends Error{},RC=r=>{process.stdout.write(r+`
377
+ `)};function OC(r){let e=[...r],t={file:"",embed:!1,pin:!1,params:{},cosign:!1,vscode:!1,printLink:!1},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new vt(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--embed":t.embed=!0;break;case"--url":t.url=n(s);break;case"--pin":t.pin=!0;break;case"--host":t.host=n(s);break;case"--param":{let i=n(s),o=i.indexOf("=");if(o<=0||!Ft.test(i.slice(0,o)))throw new vt(`--param expects NAME=VALUE, got "${i}"`);t.params[i.slice(0,o)]=i.slice(o+1);break}case"--cosign":t.cosign=!0;break;case"--web-app":t.webApp=n(s);break;case"--vscode":t.vscode=!0;break;case"--labels":t.labels=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;case"--link":t.printLink=!0;break;default:if(s.startsWith("-"))throw new vt(`unknown option ${s}`);if(t.file)throw new vt(`one runbook at a time (got ${t.file} and ${s})`);t.file=s}}if(!t.file)throw new vt("missing the runbook file");if(t.embed&&t.url)throw new vt("--embed and --url: choose one");if(t.pin&&!t.url)throw new vt("--pin goes with --url (the Git address is pinned anyway)");if(t.webApp&&!/^https:\/\/[^/]+\/(?:.*\/)?open$/.test(t.webApp))throw new vt("--web-app expects https://<web app>/open");if(t.webApp&&t.vscode)throw new vt("--web-app and --vscode: choose one");return t}var Ki=(r,e)=>(0,vf.execFileSync)("git",e,{cwd:r,encoding:"utf8",windowsHide:!0,timeout:1e4,stdio:["ignore","pipe","ignore"],maxBuffer:8*1024*1024});function AC(r){let e=Ne.dirname(Ne.resolve(r)),t,n,s;try{t=Ki(e,["rev-parse","--show-toplevel"]).trim(),n=Ki(e,["remote","get-url","origin"]).trim(),s=Ki(e,["rev-parse","--abbrev-ref","HEAD"]).trim()}catch{return"not in a Git repository with a remote: use --embed, or --url"}let i=Ne.relative(t,Ne.resolve(r)).split(Ne.sep).join("/"),o=kf(n,s,i);if(!o)return`the app opens GitHub and GitLab addresses; this repository's remote is ${n}: use --embed, or --url`;try{return{web:o,sha256:ls(Ki(t,["show",`origin/${s}:${i}`]))}}catch{return{web:o}}}async function ia(r,e=RC,t=!1){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(xf),0;let n;try{n=OC(r)}catch(p){if(!(p instanceof vt))throw p;return process.stderr.write(`md-runbook: ${p.message}
378
378
 
379
379
  ${xf}`),2}if(!Lt.existsSync(n.file))return process.stderr.write(`md-runbook: no such file: ${n.file}
380
380
  `),2;if(n.vscode&&!t)return process.stderr.write(`md-runbook: --vscode is for md-runbook link (a phone camera does not open VS Code links)
381
- `),2;let s=Lt.readFileSync(n.file,"utf8"),i={params:{...n.params},...n.cosign?{action:"cosign"}:{}};if(n.embed)i.text=Kt(s);else if(n.url)i.url=n.url,n.pin&&(i.sha256=ls(s));else{let p=OC(n.file);if(typeof p=="string")return process.stderr.write(`md-runbook: ${p}
381
+ `),2;let s=Lt.readFileSync(n.file,"utf8"),i={params:{...n.params},...n.cosign?{action:"cosign"}:{}};if(n.embed)i.text=Kt(s);else if(n.url)i.url=n.url,n.pin&&(i.sha256=ls(s));else{let p=AC(n.file);if(typeof p=="string")return process.stderr.write(`md-runbook: ${p}
382
382
  `),2;i.url=p.web,p.sha256?i.sha256=p.sha256:process.stderr.write(`md-runbook: the file is not pushed yet (no origin version): the link is not pinned
383
- `)}let o=p=>n.vscode?zl(p):us(p,n.webApp??Oi),B=p=>{let k=n.vscode?Yl(decodeURIComponent(p.slice(p.indexOf("?")+1))):Ri(p);return k.ok?void 0:k.problem},a=Ne.basename(n.file).replace(/\.md$/i,""),l=un(s)??a;if(!n.labels){n.host&&(i.host=n.host);let p=o(i),k=B(p);if(k)return process.stderr.write(`md-runbook: the app would refuse this link (${k})
383
+ `)}let o=p=>n.vscode?zl(p):us(p,n.webApp??Oi),B=p=>{let k=n.vscode?ql(decodeURIComponent(p.slice(p.indexOf("?")+1))):Ri(p);return k.ok?void 0:k.problem},a=Ne.basename(n.file).replace(/\.md$/i,""),l=un(s)??a;if(!n.labels){n.host&&(i.host=n.host);let p=o(i),k=B(p);if(k)return process.stderr.write(`md-runbook: the app would refuse this link (${k})
384
384
  `),2;if(t)return e(p),0;let D=ra(p);if(!D)return process.stderr.write(`md-runbook: too much for a QR code (${Buffer.byteLength(p)} bytes; 2953 at most): use its address instead of --embed
385
385
  `),1;let m=n.out??Ne.join(Ne.dirname(n.file),`${a}.qr.svg`);return Lt.mkdirSync(Ne.dirname(Ne.resolve(m)),{recursive:!0}),Lt.writeFileSync(m,sa(D,{scale:8,caption:n.host??l})+`
386
386
  `,"utf8"),n.printLink&&e(p),e(`\u2713 ${m}: QR code (${D.size}\xD7${D.size}, level ${D.level}) for ${n.host?`${l} on ${n.host}`:l}`),0}if(n.host)return process.stderr.write(`md-runbook: --host and --labels: the hosts come from the CSV
@@ -393,7 +393,7 @@ ${Be(d.who)}
393
393
  ${Be(d.client)}`,u=new Map,f=new Map;for(let d of t){let h=c(d);switch(d.event){case"session":l++,o.set(h,new Map);break;case"load":o.has(h)||o.set(h,new Map),o.get(h).set(Be(d.runbook),{}),u.set(Be(d.hash),{runbook:Be(d.runbook),version:Be(d.version)}),typeof d["called-by"]=="string"?f.set(`${h}
394
394
  ${Be(d.runbook)}`,{hash:d["called-by"],call:Be(d.call)}):f.delete(`${h}
395
395
  ${Be(d.runbook)}`);break;case"param":{let p=o.get(h)??new Map;o.set(h,p);let k=p.get(Be(d.runbook))??{};k[Be(d.name)]=Be(d.value),p.set(Be(d.runbook),k);break}case"run":{let p={time:d.time,account:Be(d.account),who:Be(d.who),client:Be(d.client),runbook:Be(d.runbook),version:Be(d.version),hash:Be(d.hash),signer:Be(d.signer),cell:Be(d.cell),step:Be(d.step),params:{...o.get(h)?.get(Be(d.runbook))??{}}},k=f.get(`${h}
396
- ${Be(d.runbook)}`);k&&(p.calledBy={...k}),n.push(p),B.set(Be(d.id),p),a.set(Be(d.id),p);break}case"probe":{let p=Number(Be(d.days_left)),k=d.run===void 0?void 0:a.get(Be(d.run));i.push({time:d.time,account:Be(d.account),who:Be(d.who),client:Be(d.client),target:Be(d.target),address:Be(d.address),ok:d.result==="ok",detail:Be(d.detail),...Be(d.days_left)!==""&&Number.isFinite(p)?{daysLeft:p}:{},...d.not_after?{notAfter:Be(d.not_after)}:{},...d.cert_sha256?{certSha256:Be(d.cert_sha256)}:{},...k?{run:k}:{}});break}case"end":{let p=B.get(Be(d.id));if(!p)break;B.delete(Be(d.id)),p.ended=d.time,p.durationSeconds=Math.max(0,Math.round((Date.parse(d.time)-Date.parse(p.time))/1e3)),typeof d.exit=="number"&&(p.exit=d.exit);break}case"refused":case"unsigned":case"stop":s.push({time:d.time,kind:d.event,account:Be(d.account),who:Be(d.who),client:Be(d.client),detail:d.event==="refused"?Be(d.reason):d.event==="unsigned"?`unsigned code, sha256 ${Be(d.hash)}`:`stopped (${Be(d.signal)})`});break}}for(let d of n)d.calledBy&&Object.assign(d.calledBy,u.get(d.calledBy.hash)??{});return{runs:n,findings:s,probes:i,sessions:l,skipped:e}}function Rf(r,e){let t=n=>(!e.since||Date.parse(n)>=e.since.getTime())&&(!e.until||Date.parse(n)<=e.until.getTime());return{...r,runs:r.runs.filter(n=>t(n.time)&&(!e.runbook||n.runbook===e.runbook)&&(!e.who||n.who===e.who)),findings:r.findings.filter(n=>t(n.time)&&(!e.who||n.who===e.who)),probes:r.probes.filter(n=>t(n.time)&&(!e.who||n.who===e.who)&&(!e.runbook||n.run?.runbook===e.runbook))}}function Of(r,e,t,n=120){let s=ot(t),i=s?.manifest.name??"",o=he(t),B=o.cells.map(f=>ce(f.meta)?me(f.meta.info):void 0),a=Bn(o.cells.map((f,d)=>ce(f.meta)?{kind:"code",os:B[d]?.os}:{kind:"markup"})),l=[],c=[],u=new Set;for(let[f,d]of o.cells.entries()){let h=a[f];if(h===void 0||!ce(d.meta))continue;let p=d.output?.attrs.ran;if(!p||Number.isNaN(Date.parse(p)))continue;let k=s?.cells.get(f)?.n;if(k===void 0)continue;let D=r.runs.find(m=>!u.has(m)&&m.runbook===i&&m.cell===String(k)&&Math.abs(Date.parse(m.time)-Date.parse(p))<=n*1e3);D?(u.add(D),D.matched={file:e,step:h},l.push({step:h,ran:p})):c.push({step:h,ran:p})}return{file:e,runbook:i,confirmed:l,missing:c}}var Or=r=>r.replace("T"," ").replace(/Z$/," UTC");function Af(r,e,t){let n=r.runs,s=n.filter(p=>p.exit!==void 0&&p.exit!==0).length,i=new Set(n.map(p=>p.who)),o=n.length?`${Or(n[0].time)} \u2013 ${Or(n[n.length-1].time)}`:"no runs",B=new Map;for(let p of n){let k=`${p.runbook} v${p.version}`,D=B.get(k)??{version:p.version,signer:p.signer,runs:0,failed:0};D.runs++,p.exit!==void 0&&p.exit!==0&&D.failed++,B.set(k,D)}let a=p=>`<td>${re(p)}</td>`,l=p=>p.exit===void 0?'<span class="badge none">no end logged</span>':`<span class="badge ${p.exit===0?"ok":"fail"}">exit ${p.exit}</span>`,c=n.map(p=>`<tr>${a(Or(p.time))}${a(p.who)}${a(`${p.account} from ${p.client}`)}${a(`${p.runbook} v${p.version}${AC(p)}`)}${a(`${p.cell}${p.step?`.${p.step}`:""}`)}${a(Object.entries(p.params).map(([k,D])=>`${k}=${D}`).join(" "))}<td>${l(p)}</td>${a(p.durationSeconds===void 0?"":`${p.durationSeconds} s`)}${a(p.matched?`${p.matched.file}, step ${p.matched.step}`:"")}</tr>
396
+ ${Be(d.runbook)}`);k&&(p.calledBy={...k}),n.push(p),B.set(Be(d.id),p),a.set(Be(d.id),p);break}case"probe":{let p=Number(Be(d.days_left)),k=d.run===void 0?void 0:a.get(Be(d.run));i.push({time:d.time,account:Be(d.account),who:Be(d.who),client:Be(d.client),target:Be(d.target),address:Be(d.address),ok:d.result==="ok",detail:Be(d.detail),...Be(d.days_left)!==""&&Number.isFinite(p)?{daysLeft:p}:{},...d.not_after?{notAfter:Be(d.not_after)}:{},...d.cert_sha256?{certSha256:Be(d.cert_sha256)}:{},...k?{run:k}:{}});break}case"end":{let p=B.get(Be(d.id));if(!p)break;B.delete(Be(d.id)),p.ended=d.time,p.durationSeconds=Math.max(0,Math.round((Date.parse(d.time)-Date.parse(p.time))/1e3)),typeof d.exit=="number"&&(p.exit=d.exit);break}case"refused":case"unsigned":case"stop":s.push({time:d.time,kind:d.event,account:Be(d.account),who:Be(d.who),client:Be(d.client),detail:d.event==="refused"?Be(d.reason):d.event==="unsigned"?`unsigned code, sha256 ${Be(d.hash)}`:`stopped (${Be(d.signal)})`});break}}for(let d of n)d.calledBy&&Object.assign(d.calledBy,u.get(d.calledBy.hash)??{});return{runs:n,findings:s,probes:i,sessions:l,skipped:e}}function Rf(r,e){let t=n=>(!e.since||Date.parse(n)>=e.since.getTime())&&(!e.until||Date.parse(n)<=e.until.getTime());return{...r,runs:r.runs.filter(n=>t(n.time)&&(!e.runbook||n.runbook===e.runbook)&&(!e.who||n.who===e.who)),findings:r.findings.filter(n=>t(n.time)&&(!e.who||n.who===e.who)),probes:r.probes.filter(n=>t(n.time)&&(!e.who||n.who===e.who)&&(!e.runbook||n.run?.runbook===e.runbook))}}function Of(r,e,t,n=120){let s=ot(t),i=s?.manifest.name??"",o=he(t),B=o.cells.map(f=>ce(f.meta)?me(f.meta.info):void 0),a=Bn(o.cells.map((f,d)=>ce(f.meta)?{kind:"code",os:B[d]?.os}:{kind:"markup"})),l=[],c=[],u=new Set;for(let[f,d]of o.cells.entries()){let h=a[f];if(h===void 0||!ce(d.meta))continue;let p=d.output?.attrs.ran;if(!p||Number.isNaN(Date.parse(p)))continue;let k=s?.cells.get(f)?.n;if(k===void 0)continue;let D=r.runs.find(m=>!u.has(m)&&m.runbook===i&&m.cell===String(k)&&Math.abs(Date.parse(m.time)-Date.parse(p))<=n*1e3);D?(u.add(D),D.matched={file:e,step:h},l.push({step:h,ran:p})):c.push({step:h,ran:p})}return{file:e,runbook:i,confirmed:l,missing:c}}var Or=r=>r.replace("T"," ").replace(/Z$/," UTC");function Af(r,e,t){let n=r.runs,s=n.filter(p=>p.exit!==void 0&&p.exit!==0).length,i=new Set(n.map(p=>p.who)),o=n.length?`${Or(n[0].time)} \u2013 ${Or(n[n.length-1].time)}`:"no runs",B=new Map;for(let p of n){let k=`${p.runbook} v${p.version}`,D=B.get(k)??{version:p.version,signer:p.signer,runs:0,failed:0};D.runs++,p.exit!==void 0&&p.exit!==0&&D.failed++,B.set(k,D)}let a=p=>`<td>${re(p)}</td>`,l=p=>p.exit===void 0?'<span class="badge none">no end logged</span>':`<span class="badge ${p.exit===0?"ok":"fail"}">exit ${p.exit}</span>`,c=n.map(p=>`<tr>${a(Or(p.time))}${a(p.who)}${a(`${p.account} from ${p.client}`)}${a(`${p.runbook} v${p.version}${FC(p)}`)}${a(`${p.cell}${p.step?`.${p.step}`:""}`)}${a(Object.entries(p.params).map(([k,D])=>`${k}=${D}`).join(" "))}<td>${l(p)}</td>${a(p.durationSeconds===void 0?"":`${p.durationSeconds} s`)}${a(p.matched?`${p.matched.file}, step ${p.matched.step}`:"")}</tr>
397
397
  `).join(""),u=r.findings.map(p=>`<tr>${a(Or(p.time))}${a(p.kind)}${a(p.who)}${a(`${p.account} from ${p.client}`)}${a(p.detail)}</tr>
398
398
  `).join(""),f=r.probes.map(p=>`<tr>${a(Or(p.time))}${a(p.who)}${a(p.target)}${a(p.address)}<td><span class="badge ${p.ok?"ok":"fail"}">${p.ok?"up":"failed"}</span></td>${a(p.notAfter?`${Or(p.notAfter)}${p.daysLeft===void 0?"":` (${p.daysLeft} days)`}`:"")}${a(p.certSha256?`sha256 ${p.certSha256}`:"")}${a(p.run?`${p.run.runbook} v${p.run.version}, block ${p.run.cell}`:"unsigned or by hand")}${a(p.detail)}</tr>
399
399
  `).join(""),d=[...B.entries()].map(([p,k])=>`<tr>${a(p)}${a(k.signer)}${a(String(k.runs))}${a(String(k.failed))}</tr>
@@ -432,7 +432,7 @@ ${f}</tbody></table>
432
432
  `:""}${e.length?`<h2>Run records</h2>
433
433
  ${h}`:""}</body>
434
434
  </html>
435
- `}function AC(r){let e=r.calledBy;return e?` \xB7 called by ${e.runbook?`${e.runbook} v${e.version}`:`sha256 ${e.hash.slice(0,12)}\u2026`} (call ${e.call})`:""}var $f=`Usage: md-runbook audit <gate log>... [options]
435
+ `}function FC(r){let e=r.calledBy;return e?` \xB7 called by ${e.runbook?`${e.runbook} v${e.version}`:`sha256 ${e.hash.slice(0,12)}\u2026`} (call ${e.call})`:""}var Ff=`Usage: md-runbook audit <gate log>... [options]
436
436
 
437
437
  Reads md-runbook-gate's log (its log file, or syslog: journalctl -t md-runbook-gate -o cat, or
438
438
  /var/log/syslog lines with the tag) and reports every run of a signed runbook: when, the key
@@ -454,12 +454,12 @@ that checked it). "-" reads standard input.
454
454
 
455
455
  Exit code 0: nothing to flag; 1: findings, or recorded runs the log doesn't show; 2: usage.
456
456
  `,gn=class extends Error{},$C=r=>{process.stdout.write(r+`
457
- `)};function Ff(r,e){let t=new Date(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);if(Number.isNaN(t.getTime()))throw new gn(`${r} expects a date or time, got "${e}"`);return t}function FC(r){let e=[...r],t={logs:[],records:[],out:"gate-audit.html"},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new gn(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--record":t.records.push(n(s));break;case"--since":t.since=Ff(s,n(s));break;case"--until":t.until=Ff(s,n(s));break;case"--runbook":t.runbook=n(s);break;case"--who":t.who=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;default:if(s.startsWith("--"))throw new gn(`unknown option ${s}`);t.logs.push(s)}}if(t.logs.length===0)throw new gn("missing the gate log (a file, or - for standard input)");if(!/\.(html?|pdf|json)$/i.test(t.out))throw new gn("--out must end in .html, .pdf or .json");return t}async function Tf(r,e=$C,t=()=>Nt.readFileSync(0,"utf8")){if(r.includes("-h")||r.includes("--help"))return process.stdout.write($f),0;let n;try{n=FC(r)}catch(u){if(!(u instanceof gn))throw u;return process.stderr.write(`md-runbook: ${u.message}
457
+ `)};function $f(r,e){let t=new Date(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);if(Number.isNaN(t.getTime()))throw new gn(`${r} expects a date or time, got "${e}"`);return t}function TC(r){let e=[...r],t={logs:[],records:[],out:"gate-audit.html"},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new gn(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--record":t.records.push(n(s));break;case"--since":t.since=$f(s,n(s));break;case"--until":t.until=$f(s,n(s));break;case"--runbook":t.runbook=n(s);break;case"--who":t.who=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;default:if(s.startsWith("--"))throw new gn(`unknown option ${s}`);t.logs.push(s)}}if(t.logs.length===0)throw new gn("missing the gate log (a file, or - for standard input)");if(!/\.(html?|pdf|json)$/i.test(t.out))throw new gn("--out must end in .html, .pdf or .json");return t}async function Tf(r,e=$C,t=()=>Nt.readFileSync(0,"utf8")){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(Ff),0;let n;try{n=TC(r)}catch(u){if(!(u instanceof gn))throw u;return process.stderr.write(`md-runbook: ${u.message}
458
458
 
459
- ${$f}`),2}for(let u of[...n.logs.filter(f=>f!=="-"),...n.records])if(!Nt.existsSync(u))return process.stderr.write(`md-runbook: no such file: ${u}
459
+ ${Ff}`),2}for(let u of[...n.logs.filter(f=>f!=="-"),...n.records])if(!Nt.existsSync(u))return process.stderr.write(`md-runbook: no such file: ${u}
460
460
  `),2;let s=0,i=n.logs.flatMap(u=>{let f=yf(u==="-"?t():Nt.readFileSync(u,"utf8"));return s+=f.skipped,f.events}),o=Rf(Sf(i,s),n),B=n.records.map(u=>Of(o,Qn.basename(u),Nt.readFileSync(u,"utf8")));if(Nt.mkdirSync(Qn.dirname(Qn.resolve(n.out)),{recursive:!0}),/\.json$/i.test(n.out)){let u=o.probes.map(({run:f,...d})=>({...d,...f?{run:{time:f.time,runbook:f.runbook,version:f.version,cell:f.cell}}:{}}));Nt.writeFileSync(n.out,JSON.stringify({format:"md-runbook gate audit v1",sources:n.logs,...o,probes:u,records:B},null,2)+`
461
461
  `,"utf8")}else{let u=Af(o,B,{generatedAt:new Date,sources:n.logs.map(f=>f==="-"?"standard input":Qn.basename(f))});if(/\.pdf$/i.test(n.out)){let f=Sr(n.browser??process.env.CHROME_PATH);if(!f)return process.stderr.write(`md-runbook: a .pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH), or write .html
462
- `),2;await Rr(u,n.out,f)}else Nt.writeFileSync(n.out,u,"utf8")}let a=o.runs.filter(u=>u.exit!==void 0&&u.exit!==0).length,l=B.reduce((u,f)=>u+f.missing.length,0);e(`${o.runs.length} run${o.runs.length===1?"":"s"} in ${o.sessions} session${o.sessions===1?"":"s"}, ${a} failed, ${o.findings.length} finding${o.findings.length===1?"":"s"}`);for(let u of o.findings)e(` ${u.time} ${u.kind}: ${u.who} (${u.account} from ${u.client}): ${u.detail}`);if(o.probes.length){let u=o.probes.filter(f=>!f.ok);e(`${o.probes.length} endpoint check${o.probes.length===1?"":"s"} (md-runbook-probe), ${u.length} failed`);for(let f of u)e(` ${f.time} ${f.target}: ${f.detail}`)}for(let u of B)e(` ${u.file}: ${u.confirmed.length} recorded run${u.confirmed.length===1?"":"s"} confirmed by the log${u.missing.length?`, ${u.missing.length} not in it (steps ${u.missing.map(f=>f.step).join(", ")})`:""}`);let c=o.findings.length>0||l>0;return e(`${c?"\u2717":"\u2713"} ${n.out}`),c?1:0}var If=ue(require("node:fs")),Lf=ue(require("node:os"));var TC=r=>new Promise(e=>setTimeout(e,r));function Nf(r,e){return[...r,e.MD_RUNBOOK_REPORT_ALLOWED??""].flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t!=="")}async function Mf(r,e,t){if(!ve(r)?.reportRuns)return;let n=e.allowedSigners?await _B(r,e.allowedSigners):void 0,s=Nc(r,n);if(!s)return;let i=Gc(s.url,e.allowed);return s.required&&!i?`this signed runbook runs only if its run is reported to ${s.host} (${Mc}) Allow it with --report-to-allowed ${s.host}.`:s.signed&&!e.key?"this signed runbook runs only if its run summary is signed with your SSH key: add --key KEY (a key file, or a .pub whose key is in the agent), and give your server's allowed runners file its line (namespace md-runbook-run).":(i?s.ignored&&(ve(r)?.reportRunsRequired||ve(r)?.reportRunsSigned)&&t(`\u2139 report-runs-required/-signed ignored: ${s.ignored}`):t(`\u2139 the runbook reports its runs to ${s.host}: not sent (allow it with --report-to-allowed ${s.host})`),{plan:s,...n?{signer:n}:{},send:i})}function IC(){try{return Lf.userInfo().username}catch{return process.env.USER??process.env.USERNAME??"unknown"}}var LC={passed:"passed",failed:"failed",skipped:"skipped","not run":"not-run"};function NC(r,e){return[...r.map(n=>{let s=n.status==="passed"||n.status==="failed";return{at:n.line-1,label:n.title,state:LC[n.status],...s?{ms:n.durationMs,ran:s}:{}}}),...e.map(n=>({at:n.line,label:n.text,state:n.ticked?"by-hand":"not-run"}))].sort((n,s)=>n.at-s.at).map(({at:n,...s})=>s)}async function Gf(r,e,t,n,s,i=[1e3,3e3]){if(!r.send)return!0;let o=Ic({file:e.file,text:e.text,who:IC(),client:"cli",started:e.started,ended:e.ended,steps:NC(e.steps,e.manual),...r.signer?{trustedSigner:r.signer}:{},alertParams:e.params}),B;try{B=t.key?Gi(o,{signature:await UB(o,t.key)}):Gi(o)}catch(c){if(s(`run report to ${r.plan.host}: signing failed: ${c instanceof Error?c.message:String(c)}`),r.plan.signed)return!1;B=Gi(o)}let a=r.plan.token?n[r.plan.token]:void 0;if(r.plan.token&&a===void 0)return s(`run report to ${r.plan.host}: not sent: the environment variable ${r.plan.token} (report-runs-token) is not set`),!1;let l="";for(let c=0;c<=i.length;c++){c>0&&await TC(i[c-1]);let u=await Pc({url:r.plan.url,body:B,...a?{token:a}:{}});if(u.ok)return!0;if(l=u.why,!u.retry)break}return s(`run report to ${r.plan.host}: not sent (${l})`),!1}var oa=`Usage: md-runbook verify-run <envelope.json> --allowed-runners FILE
462
+ `),2;await Rr(u,n.out,f)}else Nt.writeFileSync(n.out,u,"utf8")}let a=o.runs.filter(u=>u.exit!==void 0&&u.exit!==0).length,l=B.reduce((u,f)=>u+f.missing.length,0);e(`${o.runs.length} run${o.runs.length===1?"":"s"} in ${o.sessions} session${o.sessions===1?"":"s"}, ${a} failed, ${o.findings.length} finding${o.findings.length===1?"":"s"}`);for(let u of o.findings)e(` ${u.time} ${u.kind}: ${u.who} (${u.account} from ${u.client}): ${u.detail}`);if(o.probes.length){let u=o.probes.filter(f=>!f.ok);e(`${o.probes.length} endpoint check${o.probes.length===1?"":"s"} (md-runbook-probe), ${u.length} failed`);for(let f of u)e(` ${f.time} ${f.target}: ${f.detail}`)}for(let u of B)e(` ${u.file}: ${u.confirmed.length} recorded run${u.confirmed.length===1?"":"s"} confirmed by the log${u.missing.length?`, ${u.missing.length} not in it (steps ${u.missing.map(f=>f.step).join(", ")})`:""}`);let c=o.findings.length>0||l>0;return e(`${c?"\u2717":"\u2713"} ${n.out}`),c?1:0}var If=ue(require("node:fs")),Lf=ue(require("node:os"));var IC=r=>new Promise(e=>setTimeout(e,r));function Nf(r,e){return[...r,e.MD_RUNBOOK_REPORT_ALLOWED??""].flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t!=="")}async function Mf(r,e,t){if(!ve(r)?.reportRuns)return;let n=e.allowedSigners?await _B(r,e.allowedSigners):void 0,s=Nc(r,n);if(!s)return;let i=Gc(s.url,e.allowed);return s.required&&!i?`this signed runbook runs only if its run is reported to ${s.host} (${Mc}) Allow it with --report-to-allowed ${s.host}.`:s.signed&&!e.key?"this signed runbook runs only if its run summary is signed with your SSH key: add --key KEY (a key file, or a .pub whose key is in the agent), and give your server's allowed runners file its line (namespace md-runbook-run).":(i?s.ignored&&(ve(r)?.reportRunsRequired||ve(r)?.reportRunsSigned)&&t(`\u2139 report-runs-required/-signed ignored: ${s.ignored}`):t(`\u2139 the runbook reports its runs to ${s.host}: not sent (allow it with --report-to-allowed ${s.host})`),{plan:s,...n?{signer:n}:{},send:i})}function LC(){try{return Lf.userInfo().username}catch{return process.env.USER??process.env.USERNAME??"unknown"}}var NC={passed:"passed",failed:"failed",skipped:"skipped","not run":"not-run"};function MC(r,e){return[...r.map(n=>{let s=n.status==="passed"||n.status==="failed";return{at:n.line-1,label:n.title,state:NC[n.status],...s?{ms:n.durationMs,ran:s}:{}}}),...e.map(n=>({at:n.line,label:n.text,state:n.ticked?"by-hand":"not-run"}))].sort((n,s)=>n.at-s.at).map(({at:n,...s})=>s)}async function Gf(r,e,t,n,s,i=[1e3,3e3]){if(!r.send)return!0;let o=Ic({file:e.file,text:e.text,who:LC(),client:"cli",started:e.started,ended:e.ended,steps:MC(e.steps,e.manual),...r.signer?{trustedSigner:r.signer}:{},alertParams:e.params}),B;try{B=t.key?Gi(o,{signature:await UB(o,t.key)}):Gi(o)}catch(c){if(s(`run report to ${r.plan.host}: signing failed: ${c instanceof Error?c.message:String(c)}`),r.plan.signed)return!1;B=Gi(o)}let a=r.plan.token?n[r.plan.token]:void 0;if(r.plan.token&&a===void 0)return s(`run report to ${r.plan.host}: not sent: the environment variable ${r.plan.token} (report-runs-token) is not set`),!1;let l="";for(let c=0;c<=i.length;c++){c>0&&await IC(i[c-1]);let u=await Pc({url:r.plan.url,body:B,...a?{token:a}:{}});if(u.ok)return!0;if(l=u.why,!u.retry)break}return s(`run report to ${r.plan.host}: not sent (${l})`),!1}var oa=`Usage: md-runbook verify-run <envelope.json> --allowed-runners FILE
463
463
 
464
464
  Checks a signed run summary as a server would: the signature (namespace md-runbook-run) is good
465
465
  by a key in FILE (OpenSSH allowed_signers format, e.g.
@@ -492,7 +492,7 @@ usable answer from the server (unreachable, not a library server, too many reque
492
492
 
493
493
  ${Hf}`),2);for(;s.length>0;){let w=s.shift();if(w==="-h"||w==="--help")return process.stdout.write(Hf),0;if(w==="--library")o=s.shift();else if(w==="--path")B=s.shift();else{if(w.startsWith("-"))return a(`unknown option ${w}`);if(i)return a("one runbook at a time");i=w}}if(!i)return a("missing the runbook file");if(!o)return a("--library needs the library server's address");let l=o.replace(/\/+$/,""),c=zt(l);if(c)return a(`--library ${o}: ${c}`);let u=t.MD_RUNBOOK_LIBRARY_TOKEN;if(!u)return a("set MD_RUNBOOK_LIBRARY_TOKEN to the library's upload token");let f;try{f=_f.readFileSync(i,"utf8")}catch(w){return process.stderr.write(`md-runbook: ${w instanceof Error?w.message:String(w)}
494
494
  `),2}if(!Dt(f))return e(`\u2717 ${i} is not signed: a library takes signed runbooks only (md-runbook sign ${i} --key KEY)`),1;let d=(B??Uf.basename(i)).replace(/\\/g,"/").replace(/^\/+/,""),h=`${l}/v1/library/runbooks/${d.split("/").map(encodeURIComponent).join("/")}`,p=new AbortController,k=setTimeout(()=>p.abort(),3e4),D,m;try{let w=await n(h,{method:"POST",headers:{"content-type":"text/markdown; charset=utf-8",authorization:`Bearer ${u}`},body:f,redirect:"error",signal:p.signal});D=w.status,m=await w.text()}catch(w){return process.stderr.write(`md-runbook: ${l} did not answer: ${p.signal.aborted?"no answer in 30 s":w instanceof Error?w.message:String(w)}
495
- `),2}finally{clearTimeout(k)}let b={};try{b=JSON.parse(m)}catch{b={error:m.slice(0,200)}}if(D===200||D===201)return e(b.unchanged?`\u2713 ${d}: ${b.name} version ${b.version} is published already (the same text)`:`\u2713 published ${b.name} version ${b.version} at ${d}${b.previous?` (was version ${b.previous})`:""}, signed by ${b.signer}`),0;e(`\u2717 ${d}: the library refused it (HTTP ${D}): ${b.error??"no reason given"}`);for(let w of b.problems??[])e(` ${w}`);return D===401||D===403||D===409||D===413||D===422||D===400?1:2}var Yi=`Usage: md-runbook run <file.md> [options]
495
+ `),2}finally{clearTimeout(k)}let b={};try{b=JSON.parse(m)}catch{b={error:m.slice(0,200)}}if(D===200||D===201)return e(b.unchanged?`\u2713 ${d}: ${b.name} version ${b.version} is published already (the same text)`:`\u2713 published ${b.name} version ${b.version} at ${d}${b.previous?` (was version ${b.previous})`:""}, signed by ${b.signer}`),0;e(`\u2717 ${d}: the library refused it (HTTP ${D}): ${b.error??"no reason given"}`);for(let w of b.problems??[])e(` ${w}`);return D===401||D===403||D===409||D===413||D===422||D===400?1:2}var qi=`Usage: md-runbook run <file.md> [options]
496
496
  md-runbook lint <file.md>... [--strict]
497
497
  md-runbook estimate <file.md>... (how long each section takes, by estimate=)
498
498
  md-runbook sign <file.md> --key KEY [options] (see md-runbook sign --help)
@@ -578,15 +578,15 @@ setup or teardown steps, a "Parts:" line says how long each part takes.
578
578
 
579
579
  \${secret:NAME} values come from the environment variable NAME and are redacted from output.
580
580
  On GitHub Actions, a summary table is added to the job summary.
581
- `,Bt=class extends Error{};function MC(r,e){try{return Ve.readFileSync(yt.resolve(yt.dirname(yt.resolve(r)),e),"utf8")}catch{return}}function zi(r,e){Ve.mkdirSync(yt.dirname(yt.resolve(r)),{recursive:!0}),Ve.writeFileSync(r,e,"utf8")}function jf(r){let e=[...r];if(e.length===0||e[0]==="-h"||e[0]==="--help")return"help";if(e[0]==="--version")return"version";if(e[0]!=="run")throw new Bt(`unknown command "${e[0]}" (expected run, lint, estimate, sign, verify, verify-run, publish, qr, link or audit)`);e.shift();let t={file:"",write:!0,params:{},inputs:{},yes:!1,keepGoing:!1,shell:{}},n,s,i,o,B=!1,a=[],l,c=f=>{let d=e.shift();if(d===void 0||d.startsWith("--"))throw new Bt(`${f} needs a value`);return d},u=(f,d)=>{let h=c(f),p=h.indexOf("=");if(p<=0)throw new Bt(`${f} expects NAME=VALUE, got "${h}"`);d[h.slice(0,p)]=h.slice(p+1)};for(;e.length>0;){let f=e.shift();switch(f){case"--check":t.write=!1;break;case"--out":t.out=c(f);break;case"--report":t.report=c(f);break;case"--pdf":n=c(f);break;case"--browser":s=c(f);break;case"--notify":i=c(f);break;case"--notify-on":o=c(f);break;case"--junit":t.junit=c(f);break;case"--json":t.json=c(f);break;case"--transcript":t.transcript=c(f);break;case"--param":u(f,t.params);break;case"--input":u(f,t.inputs);break;case"--yes":t.yes=!0;break;case"--keep-going":t.keepGoing=!0;break;case"--teardown":t.teardown="success";break;case"--teardown=always":t.teardown="always";break;case"--setup":t.addSetup=!0;break;case"--setup-always":case"--no-setup":{let d=f==="--no-setup"?"never":"always";if(t.setup&&t.setup!==d)throw new Bt("--setup-always and --no-setup exclude each other");t.setup=d;break}case"--from":case"--to":{let d=c(f);if(!/^[1-9]\d*$/.test(d))throw new Bt(`${f} expects a step number (1, 2, \u2026), got "${d}"`);t[f==="--from"?"from":"to"]=Number(d);break}case"--section":{let d=c(f);if(d.trim()==="")throw new Bt("--section needs the start of a heading");(t.sections??=[]).push(d);break}case"--session":t.session=!0;break;case"--isolated":t.session=!1;break;case"--timeout":{let d=Number(c(f));if(!Number.isFinite(d)||d<0)throw new Bt("--timeout expects seconds (0 = none)");t.timeoutSeconds=d;break}case"--bash":t.shell.bashPath=c(f);break;case"--pwsh":t.shell.pwshPath=c(f);break;case"--quiet":B=!0;break;case"--copy-folder":t.copyFolder=c(f);break;case"--fresh-copy":t.freshCopy=!0;break;case"--allowed-signers":t.allowedSigners=c(f);break;case"--report-to-allowed":a.push(c(f));break;case"--key":l=c(f);break;default:if(f.startsWith("-"))throw new Bt(`unknown option ${f}`);if(t.file)throw new Bt(`only one runbook per run (got "${t.file}" and "${f}")`);t.file=f}}if(!t.file)throw new Bt("missing the runbook file");if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new Bt(`--from ${t.from} is after --to ${t.to}`);return{options:t,reportAllowed:a,...l?{key:l}:{},...n?{pdf:n}:{},...s?{browser:s}:{},...i?{notify:i}:{},...o?{notifyOn:o}:{},quiet:B}}function Kf(r,e=t=>{process.stdout.write(t+`
581
+ `,Bt=class extends Error{};function GC(r,e){try{return Ve.readFileSync(yt.resolve(yt.dirname(yt.resolve(r)),e),"utf8")}catch{return}}function zi(r,e){Ve.mkdirSync(yt.dirname(yt.resolve(r)),{recursive:!0}),Ve.writeFileSync(r,e,"utf8")}function jf(r){let e=[...r];if(e.length===0||e[0]==="-h"||e[0]==="--help")return"help";if(e[0]==="--version")return"version";if(e[0]!=="run")throw new Bt(`unknown command "${e[0]}" (expected run, lint, estimate, sign, verify, verify-run, publish, qr, link or audit)`);e.shift();let t={file:"",write:!0,params:{},inputs:{},yes:!1,keepGoing:!1,shell:{}},n,s,i,o,B=!1,a=[],l,c=f=>{let d=e.shift();if(d===void 0||d.startsWith("--"))throw new Bt(`${f} needs a value`);return d},u=(f,d)=>{let h=c(f),p=h.indexOf("=");if(p<=0)throw new Bt(`${f} expects NAME=VALUE, got "${h}"`);d[h.slice(0,p)]=h.slice(p+1)};for(;e.length>0;){let f=e.shift();switch(f){case"--check":t.write=!1;break;case"--out":t.out=c(f);break;case"--report":t.report=c(f);break;case"--pdf":n=c(f);break;case"--browser":s=c(f);break;case"--notify":i=c(f);break;case"--notify-on":o=c(f);break;case"--junit":t.junit=c(f);break;case"--json":t.json=c(f);break;case"--transcript":t.transcript=c(f);break;case"--param":u(f,t.params);break;case"--input":u(f,t.inputs);break;case"--yes":t.yes=!0;break;case"--keep-going":t.keepGoing=!0;break;case"--teardown":t.teardown="success";break;case"--teardown=always":t.teardown="always";break;case"--setup":t.addSetup=!0;break;case"--setup-always":case"--no-setup":{let d=f==="--no-setup"?"never":"always";if(t.setup&&t.setup!==d)throw new Bt("--setup-always and --no-setup exclude each other");t.setup=d;break}case"--from":case"--to":{let d=c(f);if(!/^[1-9]\d*$/.test(d))throw new Bt(`${f} expects a step number (1, 2, \u2026), got "${d}"`);t[f==="--from"?"from":"to"]=Number(d);break}case"--section":{let d=c(f);if(d.trim()==="")throw new Bt("--section needs the start of a heading");(t.sections??=[]).push(d);break}case"--session":t.session=!0;break;case"--isolated":t.session=!1;break;case"--timeout":{let d=Number(c(f));if(!Number.isFinite(d)||d<0)throw new Bt("--timeout expects seconds (0 = none)");t.timeoutSeconds=d;break}case"--bash":t.shell.bashPath=c(f);break;case"--pwsh":t.shell.pwshPath=c(f);break;case"--quiet":B=!0;break;case"--copy-folder":t.copyFolder=c(f);break;case"--fresh-copy":t.freshCopy=!0;break;case"--allowed-signers":t.allowedSigners=c(f);break;case"--report-to-allowed":a.push(c(f));break;case"--key":l=c(f);break;default:if(f.startsWith("-"))throw new Bt(`unknown option ${f}`);if(t.file)throw new Bt(`only one runbook per run (got "${t.file}" and "${f}")`);t.file=f}}if(!t.file)throw new Bt("missing the runbook file");if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new Bt(`--from ${t.from} is after --to ${t.to}`);return{options:t,reportAllowed:a,...l?{key:l}:{},...n?{pdf:n}:{},...s?{browser:s}:{},...i?{notify:i}:{},...o?{notifyOn:o}:{},quiet:B}}function Kf(r,e=t=>{process.stdout.write(t+`
582
582
  `)}){let t=r.includes("--strict"),n=r.filter(a=>a!=="--strict"),s=n.find(a=>a.startsWith("-"));if(s||n.length===0)return process.stderr.write(`md-runbook: ${s?`unknown option ${s}`:"missing the runbook file(s)"}
583
583
 
584
- ${Yi}`),2;let i=process.env.GITHUB_ACTIONS==="true",o=!1,B=0;for(let a of n){if(!Ve.existsSync(a)){e(`${a}: error: no such file`),o=!0;continue}for(let l of oc(Ve.readFileSync(a,"utf8"),{readRunbook:jB(a),matchRunbooks:c=>KB(a,c)}))B++,e(Bc(a,l)),i&&e(`::${l.severity} file=${a},line=${l.line+1}::${l.message.replace(/\r?\n/g," ")}`),(l.severity==="error"||t)&&(o=!0)}return e(`${o?"\u2717":"\u2713"} ${n.length} runbook${n.length===1?"":"s"} checked, ${B} problem${B===1?"":"s"}`),o?1:0}function zf(r,e=t=>{process.stdout.write(t+`
584
+ ${qi}`),2;let i=process.env.GITHUB_ACTIONS==="true",o=!1,B=0;for(let a of n){if(!Ve.existsSync(a)){e(`${a}: error: no such file`),o=!0;continue}for(let l of oc(Ve.readFileSync(a,"utf8"),{readRunbook:jB(a),matchRunbooks:c=>KB(a,c)}))B++,e(Bc(a,l)),i&&e(`::${l.severity} file=${a},line=${l.line+1}::${l.message.replace(/\r?\n/g," ")}`),(l.severity==="error"||t)&&(o=!0)}return e(`${o?"\u2717":"\u2713"} ${n.length} runbook${n.length===1?"":"s"} checked, ${B} problem${B===1?"":"s"}`),o?1:0}function zf(r,e=t=>{process.stdout.write(t+`
585
585
  `)}){let t=r.find(s=>s.startsWith("-"));if(t||r.length===0)return process.stderr.write(`md-runbook: ${t?`unknown option ${t}`:"missing the runbook file(s)"}
586
586
 
587
- ${Yi}`),2;let n=!1;return r.forEach((s,i)=>{if(i>0&&e(""),!Ve.existsSync(s)){e(`${s}: error: no such file`),n=!0;return}let o=bi(Ve.readFileSync(s,"utf8"),void 0,(f,d)=>bs(s,f,d)),B=(f,d,h)=>d===0?"\u2013":`${h===d?"?":it(f)}${h>0?` (${Ei(h)})`:""}`,a=o.sections.map(f=>[f.level===0?"(before the first heading)":`${"#".repeat(f.level)} ${f.heading}`,B(f.seconds,f.blocks,f.unestimated)]),l=Math.min(60,Math.max(0,...a.map(([f])=>f.length)));e(s);for(let[f,d]of a)e(` ${f.length>l?f.slice(0,l-1)+"\u2026":f.padEnd(l)} ${d}`);e(` Total: ${B(o.totalSeconds,o.blocks,o.unestimated)} for ${o.blocks} block${o.blocks===1?"":"s"}`);let{setup:c,teardown:u}=o.parts;if(c.blocks>0||u.blocks>0){let f={seconds:o.totalSeconds-c.seconds-u.seconds,blocks:o.blocks-c.blocks-u.blocks,unestimated:o.unestimated-c.unestimated-u.unestimated};e(` Parts: ${[...c.blocks>0?[`setup ${B(c.seconds,c.blocks,c.unestimated)}${o.guarded?" (skipped when already up)":""}`]:[],`runbook ${B(f.seconds,f.blocks,f.unestimated)}`,...u.blocks>0?[`teardown ${B(u.seconds,u.blocks,u.unestimated)} (offered)`]:[]].join(" \xB7 ")}`)}}),n?1:0}async function Yf(r){if(r[0]==="lint")return Kf(r.slice(1));if(r[0]==="estimate")return zf(r.slice(1));if(r[0]==="sign")return pf(r.slice(1));if(r[0]==="verify")return hf(r.slice(1));if(r[0]==="verify-run")return Pf(r.slice(1));if(r[0]==="publish")return Jf(r.slice(1));if(r[0]==="qr")return ia(r.slice(1));if(r[0]==="link")return ia(r.slice(1),void 0,!0);if(r[0]==="audit")return Tf(r.slice(1));let e;try{e=jf(r)}catch(S){if(!(S instanceof Bt))throw S;return process.stderr.write(`md-runbook: ${S.message}
587
+ ${qi}`),2;let n=!1;return r.forEach((s,i)=>{if(i>0&&e(""),!Ve.existsSync(s)){e(`${s}: error: no such file`),n=!0;return}let o=bi(Ve.readFileSync(s,"utf8"),void 0,(f,d)=>bs(s,f,d)),B=(f,d,h)=>d===0?"\u2013":`${h===d?"?":it(f)}${h>0?` (${Ei(h)})`:""}`,a=o.sections.map(f=>[f.level===0?"(before the first heading)":`${"#".repeat(f.level)} ${f.heading}`,B(f.seconds,f.blocks,f.unestimated)]),l=Math.min(60,Math.max(0,...a.map(([f])=>f.length)));e(s);for(let[f,d]of a)e(` ${f.length>l?f.slice(0,l-1)+"\u2026":f.padEnd(l)} ${d}`);e(` Total: ${B(o.totalSeconds,o.blocks,o.unestimated)} for ${o.blocks} block${o.blocks===1?"":"s"}`);let{setup:c,teardown:u}=o.parts;if(c.blocks>0||u.blocks>0){let f={seconds:o.totalSeconds-c.seconds-u.seconds,blocks:o.blocks-c.blocks-u.blocks,unestimated:o.unestimated-c.unestimated-u.unestimated};e(` Parts: ${[...c.blocks>0?[`setup ${B(c.seconds,c.blocks,c.unestimated)}${o.guarded?" (skipped when already up)":""}`]:[],`runbook ${B(f.seconds,f.blocks,f.unestimated)}`,...u.blocks>0?[`teardown ${B(u.seconds,u.blocks,u.unestimated)} (offered)`]:[]].join(" \xB7 ")}`)}}),n?1:0}async function qf(r){if(r[0]==="lint")return Kf(r.slice(1));if(r[0]==="estimate")return zf(r.slice(1));if(r[0]==="sign")return pf(r.slice(1));if(r[0]==="verify")return hf(r.slice(1));if(r[0]==="verify-run")return Pf(r.slice(1));if(r[0]==="publish")return Jf(r.slice(1));if(r[0]==="qr")return ia(r.slice(1));if(r[0]==="link")return ia(r.slice(1),void 0,!0);if(r[0]==="audit")return Tf(r.slice(1));let e;try{e=jf(r)}catch(S){if(!(S instanceof Bt))throw S;return process.stderr.write(`md-runbook: ${S.message}
588
588
 
589
- ${Yi}`),2}if(e==="help")return process.stdout.write(Yi),0;if(e==="version")return process.stdout.write(`0.24.0
589
+ ${qi}`),2}if(e==="help")return process.stdout.write(qi),0;if(e==="version")return process.stdout.write(`0.24.1
590
590
  `),0;let{options:t,quiet:n}=e;if(!Ve.existsSync(t.file))return process.stderr.write(`md-runbook: no such file: ${t.file}
591
591
  `),2;let s=of(e.notify??process.env.MD_RUNBOOK_NOTIFY_URL,e.notifyOn??process.env.MD_RUNBOOK_NOTIFY_ON);if(typeof s=="string")return process.stderr.write(`md-runbook: ${s}
592
592
  `),2;delete process.env.MD_RUNBOOK_NOTIFY_URL;let i=async S=>{if(s)try{await af(s.url,S)}catch(O){process.stderr.write(`md-runbook: ${O instanceof Error?O.message:String(O)}
@@ -595,14 +595,14 @@ ${Yi}`),2}if(e==="help")return process.stdout.write(Yi),0;if(e==="version")retur
595
595
  `),2;let l=Date.now(),c=new AbortController,u=()=>c.abort();process.once("SIGINT",u),process.once("SIGTERM",u);let f;try{f=await ea({...t,env:process.env,signal:c.signal,progress:process.stdout.isTTY===!0&&!n,...s?{extraSecrets:[s.url]}:{}},{out:S=>{n||process.stdout.write(S)},log:S=>{n||process.stdout.write(S+`
596
596
  `)}})}catch(S){if(S instanceof gt)return process.off("SIGINT",u),process.off("SIGTERM",u),process.stderr.write(`md-runbook: ${S.message}
597
597
  `),2;throw await i(`\u2717 ${yt.basename(t.file)}: the run stopped with an error${ji(process.env)?`
598
- ${ji(process.env)}`:""}`),S}process.off("SIGINT",u),process.off("SIGTERM",u);let d=yt.basename(t.file),h=t.out??t.file;t.write&&zi(h,f.text);let p=()=>wB(f.text,{generatedAt:new Date,fallbackTitle:d,redact:f.redact,readCall:S=>MC(t.file,S)});if(t.report&&zi(t.report,p()),t.junit&&zi(t.junit,rf(d,f.steps,f.manual)),t.json){let S=f.setup?{setup:f.setup}:{};zi(t.json,JSON.stringify({file:d,ok:f.ok,...S,steps:f.steps,manual:f.manual,record:wi(f.text)},null,2)+`
598
+ ${ji(process.env)}`:""}`),S}process.off("SIGINT",u),process.off("SIGTERM",u);let d=yt.basename(t.file),h=t.out??t.file;t.write&&zi(h,f.text);let p=()=>wB(f.text,{generatedAt:new Date,fallbackTitle:d,redact:f.redact,readCall:S=>GC(t.file,S)});if(t.report&&zi(t.report,p()),t.junit&&zi(t.junit,rf(d,f.steps,f.manual)),t.json){let S=f.setup?{setup:f.setup}:{};zi(t.json,JSON.stringify({file:d,ok:f.ok,...S,steps:f.steps,manual:f.manual,record:wi(f.text)},null,2)+`
599
599
  `)}let k=process.env.GITHUB_STEP_SUMMARY;k&&Ve.appendFileSync(k,sf(d,f.steps,f.manual)+`
600
600
  `);let D=!1;if(e.pdf){let S=Sr(e.browser??process.env.CHROME_PATH);if(!S)process.stderr.write(`md-runbook: --pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH)
601
601
  `),D=!0;else try{Ve.mkdirSync(yt.dirname(yt.resolve(e.pdf)),{recursive:!0}),await Rr(p(),e.pdf,S)}catch(O){process.stderr.write(`md-runbook: PDF export failed: ${O instanceof Error?O.message:String(O)}
602
602
  `),D=!0}}s&&(s.on==="always"||!f.ok)&&await i(Bf(d,f,ji(process.env)));let m=Object.fromEntries((ve(o)?.params??[]).flatMap(S=>S.default!==void 0?[[S.name,S.default]]:[])),b=a?await Gf(a,{file:t.file,text:o,started:l,ended:Date.now(),steps:f.steps,manual:f.manual,params:{...m,...t.params}},B,process.env,S=>{process.stderr.write(`md-runbook: ${S}
603
603
  `)}):!0,w=S=>f.steps.filter(O=>O.status===S).length,R=[`${w("passed")} passed`,`${w("failed")} failed`];w("skipped")&&R.push(`${w("skipped")} skipped`),w("not run")&&R.push(`${w("not run")} not run`);let y=f.steps.filter(S=>S.status==="passed"||S.status==="failed"),T=y.reduce((S,O)=>S+(O.estimateSeconds??0),0),v=y.filter(S=>S.estimateSeconds===void 0).length,E=T>0?` \xB7 took ${it(y.reduce((S,O)=>S+O.durationMs,0)/1e3)}, estimated ${it(T)}`+(v>0?` (${v} step${v===1?"":"s"} without an estimate)`:""):"";return process.stdout.write(`
604
604
  ${f.ok?"\u2713":"\u2717"} ${d}: ${f.steps.length} step${f.steps.length===1?"":"s"}, ${R.join(", ")}${E}${t.write?` \xB7 outputs written to ${h}`:""}
605
- `),f.ok&&!D?!b&&a?.plan.required?3:0:1}require.main===module&&Yf(process.argv.slice(2)).then(r=>process.exitCode=r,r=>{process.stderr.write(`md-runbook: ${r instanceof Error?r.stack??r.message:String(r)}
605
+ `),f.ok&&!D?!b&&a?.plan.required?3:0:1}require.main===module&&qf(process.argv.slice(2)).then(r=>process.exitCode=r,r=>{process.stderr.write(`md-runbook: ${r instanceof Error?r.stack??r.message:String(r)}
606
606
  `),process.exitCode=1});0&&(module.exports={estimate,lint,main,parseArgs});
607
607
  /*! Bundled license information:
608
608