md-runbook 0.19.3 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +205 -196
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`}return
|
|
4
|
-
`}return Ie.substring(0,Ie.length-1)},H.renderTo2dContext=function(A,S){S=S||2;for(var R=H.getModuleCount(),$=0;$<R;$++)for(var G=0;G<R;G++)A.fillStyle=H.isDark($,G)?"black":"white",A.fillRect(G*S,$*S,S,S)},H};r.stringToBytesFuncs={default:function(E){for(var x=[],O=0;O<E.length;O+=1){var I=E.charCodeAt(O);x.push(I&255)}return x}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(E,x){var O=(function(){for(var v=f(E),L=function(){var ne=v.read();if(ne==-1)throw"eof";return ne},b=0,m={};;){var M=v.read();if(M==-1)break;var y=L(),H=L(),z=L(),j=String.fromCharCode(M<<8|y),X=H<<8|z;m[j]=X,b+=1}if(b!=x)throw b+" != "+x;return m})(),I=63;return function(v){for(var L=[],b=0;b<v.length;b+=1){var m=v.charCodeAt(b);if(m<128)L.push(m);else{var M=O[v.charAt(b)];typeof M=="number"?(M&255)==M?L.push(M):(L.push(M>>>8),L.push(M&255)):L.push(I)}}return L}};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 E=[[],[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]],x=1335,O=7973,I=21522,v={},L=function(b){for(var m=0;b!=0;)m+=1,b>>>=1;return m};return v.getBCHTypeInfo=function(b){for(var m=b<<10;L(m)-L(x)>=0;)m^=x<<L(m)-L(x);return(b<<10|m)^I},v.getBCHTypeNumber=function(b){for(var m=b<<12;L(m)-L(O)>=0;)m^=O<<L(m)-L(O);return b<<12|m},v.getPatternPosition=function(b){return E[b-1]},v.getMaskFunction=function(b){switch(b){case n.PATTERN000:return function(m,M){return(m+M)%2==0};case n.PATTERN001:return function(m,M){return m%2==0};case n.PATTERN010:return function(m,M){return M%3==0};case n.PATTERN011:return function(m,M){return(m+M)%3==0};case n.PATTERN100:return function(m,M){return(Math.floor(m/2)+Math.floor(M/3))%2==0};case n.PATTERN101:return function(m,M){return m*M%2+m*M%3==0};case n.PATTERN110:return function(m,M){return(m*M%2+m*M%3)%2==0};case n.PATTERN111:return function(m,M){return(m*M%3+(m+M)%2)%2==0};default:throw"bad maskPattern:"+b}},v.getErrorCorrectPolynomial=function(b){for(var m=i([1],0),M=0;M<b;M+=1)m=m.multiply(i([1,B.gexp(M)],0));return m},v.getLengthInBits=function(b,m){if(1<=m&&m<10)switch(b){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:"+b}else if(m<27)switch(b){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:"+b}else if(m<41)switch(b){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:"+b}else throw"type:"+m},v.getLostPoint=function(b){for(var m=b.getModuleCount(),M=0,y=0;y<m;y+=1)for(var H=0;H<m;H+=1){for(var z=0,j=b.isDark(y,H),X=-1;X<=1;X+=1)if(!(y+X<0||m<=y+X))for(var ne=-1;ne<=1;ne+=1)H+ne<0||m<=H+ne||X==0&&ne==0||j==b.isDark(y+X,H+ne)&&(z+=1);z>5&&(M+=3+z-5)}for(var y=0;y<m-1;y+=1)for(var H=0;H<m-1;H+=1){var te=0;b.isDark(y,H)&&(te+=1),b.isDark(y+1,H)&&(te+=1),b.isDark(y,H+1)&&(te+=1),b.isDark(y+1,H+1)&&(te+=1),(te==0||te==4)&&(M+=3)}for(var y=0;y<m;y+=1)for(var H=0;H<m-6;H+=1)b.isDark(y,H)&&!b.isDark(y,H+1)&&b.isDark(y,H+2)&&b.isDark(y,H+3)&&b.isDark(y,H+4)&&!b.isDark(y,H+5)&&b.isDark(y,H+6)&&(M+=40);for(var H=0;H<m;H+=1)for(var y=0;y<m-6;y+=1)b.isDark(y,H)&&!b.isDark(y+1,H)&&b.isDark(y+2,H)&&b.isDark(y+3,H)&&b.isDark(y+4,H)&&!b.isDark(y+5,H)&&b.isDark(y+6,H)&&(M+=40);for(var ae=0,H=0;H<m;H+=1)for(var y=0;y<m;y+=1)b.isDark(y,H)&&(ae+=1);var se=Math.abs(100*ae/m/m-50)/5;return M+=se*10,M},v})(),B=(function(){for(var E=new Array(256),x=new Array(256),O=0;O<8;O+=1)E[O]=1<<O;for(var O=8;O<256;O+=1)E[O]=E[O-4]^E[O-5]^E[O-6]^E[O-8];for(var O=0;O<255;O+=1)x[E[O]]=O;var I={};return I.glog=function(v){if(v<1)throw"glog("+v+")";return x[v]},I.gexp=function(v){for(;v<0;)v+=255;for(;v>=256;)v-=255;return E[v]},I})();function i(E,x){if(typeof E.length>"u")throw E.length+"/"+x;var O=(function(){for(var v=0;v<E.length&&E[v]==0;)v+=1;for(var L=new Array(E.length-v+x),b=0;b<E.length-v;b+=1)L[b]=E[b+v];return L})(),I={};return I.getAt=function(v){return O[v]},I.getLength=function(){return O.length},I.multiply=function(v){for(var L=new Array(I.getLength()+v.getLength()-1),b=0;b<I.getLength();b+=1)for(var m=0;m<v.getLength();m+=1)L[b+m]^=B.gexp(B.glog(I.getAt(b))+B.glog(v.getAt(m)));return i(L,0)},I.mod=function(v){if(I.getLength()-v.getLength()<0)return I;for(var L=B.glog(I.getAt(0))-B.glog(v.getAt(0)),b=new Array(I.getLength()),m=0;m<I.getLength();m+=1)b[m]=I.getAt(m);for(var m=0;m<v.getLength();m+=1)b[m]^=B.gexp(B.glog(v.getAt(m))+L);return i(b,0).mod(v)},I}var o=(function(){var E=[[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]],x=function(v,L){var b={};return b.totalCount=v,b.dataCount=L,b},O={},I=function(v,L){switch(L){case t.L:return E[(v-1)*4+0];case t.M:return E[(v-1)*4+1];case t.Q:return E[(v-1)*4+2];case t.H:return E[(v-1)*4+3];default:return}};return O.getRSBlocks=function(v,L){var b=I(v,L);if(typeof b>"u")throw"bad rs block @ typeNumber:"+v+"/errorCorrectionLevel:"+L;for(var m=b.length/3,M=[],y=0;y<m;y+=1)for(var H=b[y*3+0],z=b[y*3+1],j=b[y*3+2],X=0;X<H;X+=1)M.push(x(z,j));return M},O})(),a=function(){var E=[],x=0,O={};return O.getBuffer=function(){return E},O.getAt=function(I){var v=Math.floor(I/8);return(E[v]>>>7-I%8&1)==1},O.put=function(I,v){for(var L=0;L<v;L+=1)O.putBit((I>>>v-L-1&1)==1)},O.getLengthInBits=function(){return x},O.putBit=function(I){var v=Math.floor(x/8);E.length<=v&&E.push(0),I&&(E[v]|=128>>>x%8),x+=1},O},c=function(E){var x=e.MODE_NUMBER,O=E,I={};I.getMode=function(){return x},I.getLength=function(b){return O.length},I.write=function(b){for(var m=O,M=0;M+2<m.length;)b.put(v(m.substring(M,M+3)),10),M+=3;M<m.length&&(m.length-M==1?b.put(v(m.substring(M,M+1)),4):m.length-M==2&&b.put(v(m.substring(M,M+2)),7))};var v=function(b){for(var m=0,M=0;M<b.length;M+=1)m=m*10+L(b.charAt(M));return m},L=function(b){if("0"<=b&&b<="9")return b.charCodeAt(0)-48;throw"illegal char :"+b};return I},u=function(E){var x=e.MODE_ALPHA_NUM,O=E,I={};I.getMode=function(){return x},I.getLength=function(L){return O.length},I.write=function(L){for(var b=O,m=0;m+1<b.length;)L.put(v(b.charAt(m))*45+v(b.charAt(m+1)),11),m+=2;m<b.length&&L.put(v(b.charAt(m)),6)};var v=function(L){if("0"<=L&&L<="9")return L.charCodeAt(0)-48;if("A"<=L&&L<="Z")return L.charCodeAt(0)-65+10;switch(L){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 :"+L}};return I},l=function(E){var x=e.MODE_8BIT_BYTE,O=E,I=r.stringToBytes(E),v={};return v.getMode=function(){return x},v.getLength=function(L){return I.length},v.write=function(L){for(var b=0;b<I.length;b+=1)L.put(I[b],8)},v},C=function(E){var x=e.MODE_KANJI,O=E,I=r.stringToBytesFuncs.SJIS;if(!I)throw"sjis not supported.";(function(b,m){var M=I(b);if(M.length!=2||(M[0]<<8|M[1])!=m)throw"sjis not supported."})("\u53CB",38726);var v=I(E),L={};return L.getMode=function(){return x},L.getLength=function(b){return~~(v.length/2)},L.write=function(b){for(var m=v,M=0;M+1<m.length;){var y=(255&m[M])<<8|255&m[M+1];if(33088<=y&&y<=40956)y-=33088;else if(57408<=y&&y<=60351)y-=49472;else throw"illegal char at "+(M+1)+"/"+y;y=(y>>>8&255)*192+(y&255),b.put(y,13),M+=2}if(M<m.length)throw"illegal char at "+(M+1)},L},h=function(){var E=[],x={};return x.writeByte=function(O){E.push(O&255)},x.writeShort=function(O){x.writeByte(O),x.writeByte(O>>>8)},x.writeBytes=function(O,I,v){I=I||0,v=v||O.length;for(var L=0;L<v;L+=1)x.writeByte(O[L+I])},x.writeString=function(O){for(var I=0;I<O.length;I+=1)x.writeByte(O.charCodeAt(I))},x.toByteArray=function(){return E},x.toString=function(){var O="";O+="[";for(var I=0;I<E.length;I+=1)I>0&&(O+=","),O+=E[I];return O+="]",O},x},p=function(){var E=0,x=0,O=0,I="",v={},L=function(m){I+=String.fromCharCode(b(m&63))},b=function(m){if(!(m<0)){if(m<26)return 65+m;if(m<52)return 97+(m-26);if(m<62)return 48+(m-52);if(m==62)return 43;if(m==63)return 47}throw"n:"+m};return v.writeByte=function(m){for(E=E<<8|m&255,x+=8,O+=1;x>=6;)L(E>>>x-6),x-=6},v.flush=function(){if(x>0&&(L(E<<6-x),E=0,x=0),O%3!=0)for(var m=3-O%3,M=0;M<m;M+=1)I+="="},v.toString=function(){return I},v},f=function(E){var x=E,O=0,I=0,v=0,L={};L.read=function(){for(;v<8;){if(O>=x.length){if(v==0)return-1;throw"unexpected end of file./"+v}var m=x.charAt(O);if(O+=1,m=="=")return v=0,-1;if(m.match(/^\s$/))continue;I=I<<6|b(m.charCodeAt(0)),v+=6}var M=I>>>v-8&255;return v-=8,M};var b=function(m){if(65<=m&&m<=90)return m-65;if(97<=m&&m<=122)return m-97+26;if(48<=m&&m<=57)return m-48+52;if(m==43)return 62;if(m==47)return 63;throw"c:"+m};return L},w=function(E,x){var O=E,I=x,v=new Array(E*x),L={};L.setPixel=function(y,H,z){v[H*O+y]=z},L.write=function(y){y.writeString("GIF87a"),y.writeShort(O),y.writeShort(I),y.writeByte(128),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(255),y.writeByte(255),y.writeByte(255),y.writeString(","),y.writeShort(0),y.writeShort(0),y.writeShort(O),y.writeShort(I),y.writeByte(0);var H=2,z=m(H);y.writeByte(H);for(var j=0;z.length-j>255;)y.writeByte(255),y.writeBytes(z,j,255),j+=255;y.writeByte(z.length-j),y.writeBytes(z,j,z.length-j),y.writeByte(0),y.writeString(";")};var b=function(y){var H=y,z=0,j=0,X={};return X.write=function(ne,te){if(ne>>>te)throw"length over";for(;z+te>=8;)H.writeByte(255&(ne<<z|j)),te-=8-z,ne>>>=8-z,j=0,z=0;j=ne<<z|j,z=z+te},X.flush=function(){z>0&&H.writeByte(j)},X},m=function(y){for(var H=1<<y,z=(1<<y)+1,j=y+1,X=M(),ne=0;ne<H;ne+=1)X.add(String.fromCharCode(ne));X.add(String.fromCharCode(H)),X.add(String.fromCharCode(z));var te=h(),ae=b(te);ae.write(H,j);var se=0,De=String.fromCharCode(v[se]);for(se+=1;se<v.length;){var de=String.fromCharCode(v[se]);se+=1,X.contains(De+de)?De=De+de:(ae.write(X.indexOf(De),j),X.size()<4095&&(X.size()==1<<j&&(j+=1),X.add(De+de)),De=de)}return ae.write(X.indexOf(De),j),ae.write(z,j),ae.flush(),te.toByteArray()},M=function(){var y={},H=0,z={};return z.add=function(j){if(z.contains(j))throw"dup key:"+j;y[j]=H,H+=1},z.size=function(){return H},z.indexOf=function(j){return y[j]},z.contains=function(j){return typeof y[j]<"u"},z};return L},k=function(E,x,O){for(var I=w(E,x),v=0;v<x;v+=1)for(var L=0;L<E;L+=1)I.setPixel(L,v,O(L,v));var b=h();I.write(b);for(var m=p(),M=b.toByteArray(),y=0;y<M.length;y+=1)m.writeByte(M[y]);return m.flush(),"data:image/gif;base64,"+m};return r})();(function(){Cl.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var B=t.charCodeAt(s);B<128?n.push(B):B<2048?n.push(192|B>>6,128|B&63):B<55296||B>=57344?n.push(224|B>>12,128|B>>6&63,128|B&63):(s++,B=65536+((B&1023)<<10|t.charCodeAt(s)&1023),n.push(240|B>>18,128|B>>12&63,128|B>>6&63,128|B&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof fl=="object"&&(hl.exports=r())})(function(){return Cl})});var MC={};Pl(MC,{lint:()=>yl,main:()=>Il,parseArgs:()=>Fl});module.exports=_l(MC);var qe=Ce(require("node:fs")),Et=Ce(require("node:path"));var XB={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function me(r){return typeof r=="string"}function ei(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&me(e.lead)&&me(e.content)&&me(e.trail)&&(e.eol===`
|
|
2
|
+
"use strict";var Zl=Object.create;var vr=Object.defineProperty;var Xl=Object.getOwnPropertyDescriptor;var eu=Object.getOwnPropertyNames;var tu=Object.getPrototypeOf,nu=Object.prototype.hasOwnProperty;var ru=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},su=(r,e)=>{for(var t in e)vr(r,t,{get:e[t],enumerable:!0})},Ci=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of eu(e))!nu.call(r,s)&&s!==t&&vr(r,s,{get:()=>e[s],enumerable:!(n=Xl(e,s))||n.enumerable});return r};var ae=(r,e,t)=>(t=r!=null?Zl(tu(r)):{},Ci(e||!r||!r.__esModule?vr(t,"default",{value:r,enumerable:!0}):t,r)),Bu=r=>Ci(vr({},"__esModule",{value:!0}),r);var Fl=ru((Rl,yl)=>{var Al=(function(){var r=function(E,S){var w=236,y=17,O=E,$=t[S],b=null,m=0,G=null,T=[],H={},Q=function(x,v){m=O*4+17,b=(function(A){for(var N=new Array(A),F=0;F<A;F+=1){N[F]=new Array(A);for(var P=0;P<A;P+=1)N[F][P]=null}return N})(m),z(0,0),z(m-7,0),z(0,m-7),ee(),V(),te(x,v),O>=7&&Be(x),G==null&&(G=$e(O,$,T)),De(G,v)},z=function(x,v){for(var A=-1;A<=7;A+=1)if(!(x+A<=-1||m<=x+A))for(var N=-1;N<=7;N+=1)v+N<=-1||m<=v+N||(0<=A&&A<=6&&(N==0||N==6)||0<=N&&N<=6&&(A==0||A==6)||2<=A&&A<=4&&2<=N&&N<=4?b[x+A][v+N]=!0:b[x+A][v+N]=!1)},q=function(){for(var x=0,v=0,A=0;A<8;A+=1){Q(!0,A);var N=s.getLostPoint(H);(A==0||x>N)&&(x=N,v=A)}return v},V=function(){for(var x=8;x<m-8;x+=1)b[x][6]==null&&(b[x][6]=x%2==0);for(var v=8;v<m-8;v+=1)b[6][v]==null&&(b[6][v]=v%2==0)},ee=function(){for(var x=s.getPatternPosition(O),v=0;v<x.length;v+=1)for(var A=0;A<x.length;A+=1){var N=x[v],F=x[A];if(b[N][F]==null)for(var P=-2;P<=2;P+=1)for(var j=-2;j<=2;j+=1)P==-2||P==2||j==-2||j==2||P==0&&j==0?b[N+P][F+j]=!0:b[N+P][F+j]=!1}},Be=function(x){for(var v=s.getBCHTypeNumber(O),A=0;A<18;A+=1){var N=!x&&(v>>A&1)==1;b[Math.floor(A/3)][A%3+m-8-3]=N}for(var A=0;A<18;A+=1){var N=!x&&(v>>A&1)==1;b[A%3+m-8-3][Math.floor(A/3)]=N}},te=function(x,v){for(var A=$<<3|v,N=s.getBCHTypeInfo(A),F=0;F<15;F+=1){var P=!x&&(N>>F&1)==1;F<6?b[F][8]=P:F<8?b[F+1][8]=P:b[m-15+F][8]=P}for(var F=0;F<15;F+=1){var P=!x&&(N>>F&1)==1;F<8?b[8][m-F-1]=P:F<9?b[8][15-F-1+1]=P:b[8][15-F-1]=P}b[m-8][8]=!x},De=function(x,v){for(var A=-1,N=m-1,F=7,P=0,j=s.getMaskFunction(v),U=m-1;U>0;U-=2)for(U==6&&(U-=1);;){for(var ne=0;ne<2;ne+=1)if(b[N][U-ne]==null){var ce=!1;P<x.length&&(ce=(x[P]>>>F&1)==1);var X=j(N,U-ne);X&&(ce=!ce),b[N][U-ne]=ce,F-=1,F==-1&&(P+=1,F=7)}if(N+=A,N<0||m<=N){N-=A,A=-A;break}}},pe=function(x,v){for(var A=0,N=0,F=0,P=new Array(v.length),j=new Array(v.length),U=0;U<v.length;U+=1){var ne=v[U].dataCount,ce=v[U].totalCount-ne;N=Math.max(N,ne),F=Math.max(F,ce),P[U]=new Array(ne);for(var X=0;X<P[U].length;X+=1)P[U][X]=255&x.getBuffer()[X+A];A+=ne;var Oe=s.getErrorCorrectPolynomial(ce),ge=i(P[U],Oe.getLength()-1),Zt=ge.mod(Oe);j[U]=new Array(Oe.getLength()-1);for(var X=0;X<j[U].length;X+=1){var Sn=X+Zt.getLength()-j[U].length;j[U][X]=Sn>=0?Zt.getAt(Sn):0}}for(var On=0,X=0;X<v.length;X+=1)On+=v[X].totalCount;for(var Xt=new Array(On),it=0,X=0;X<N;X+=1)for(var U=0;U<v.length;U+=1)X<P[U].length&&(Xt[it]=P[U][X],it+=1);for(var X=0;X<F;X+=1)for(var U=0;U<v.length;U+=1)X<j[U].length&&(Xt[it]=j[U][X],it+=1);return Xt},$e=function(x,v,A){for(var N=o.getRSBlocks(x,v),F=a(),P=0;P<A.length;P+=1){var j=A[P];F.put(j.getMode(),4),F.put(j.getLength(),s.getLengthInBits(j.getMode(),x)),j.write(F)}for(var U=0,P=0;P<N.length;P+=1)U+=N[P].dataCount;if(F.getLengthInBits()>U*8)throw"code length overflow. ("+F.getLengthInBits()+">"+U*8+")";for(F.getLengthInBits()+4<=U*8&&F.put(0,4);F.getLengthInBits()%8!=0;)F.putBit(!1);for(;!(F.getLengthInBits()>=U*8||(F.put(w,8),F.getLengthInBits()>=U*8));)F.put(y,8);return pe(F,N)};H.addData=function(x,v){v=v||"Byte";var A=null;switch(v){case"Numeric":A=c(x);break;case"Alphanumeric":A=u(x);break;case"Byte":A=l(x);break;case"Kanji":A=f(x);break;default:throw"mode:"+v}T.push(A),G=null},H.isDark=function(x,v){if(x<0||m<=x||v<0||m<=v)throw x+","+v;return b[x][v]},H.getModuleCount=function(){return m},H.make=function(){if(O<1){for(var x=1;x<40;x++){for(var v=o.getRSBlocks(x,$),A=a(),N=0;N<T.length;N++){var F=T[N];A.put(F.getMode(),4),A.put(F.getLength(),s.getLengthInBits(F.getMode(),x)),F.write(A)}for(var P=0,N=0;N<v.length;N++)P+=v[N].dataCount;if(A.getLengthInBits()<=P*8)break}O=x}Q(!1,q())},H.createTableTag=function(x,v){x=x||2,v=typeof v>"u"?x*4:v;var A="";A+='<table style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: "+v+"px;",A+='">',A+="<tbody>";for(var N=0;N<H.getModuleCount();N+=1){A+="<tr>";for(var F=0;F<H.getModuleCount();F+=1)A+='<td style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: 0px;",A+=" width: "+x+"px;",A+=" height: "+x+"px;",A+=" background-color: ",A+=H.isDark(N,F)?"#000000":"#ffffff",A+=";",A+='"/>';A+="</tr>"}return A+="</tbody>",A+="</table>",A},H.createSvgTag=function(x,v,A,N){var F={};typeof arguments[0]=="object"&&(F=arguments[0],x=F.cellSize,v=F.margin,A=F.alt,N=F.title),x=x||2,v=typeof v>"u"?x*4:v,A=typeof A=="string"?{text:A}:A||{},A.text=A.text||null,A.id=A.text?A.id||"qrcode-description":null,N=typeof N=="string"?{text:N}:N||{},N.text=N.text||null,N.id=N.text?N.id||"qrcode-title":null;var P=H.getModuleCount()*x+v*2,j,U,ne,ce,X="",Oe;for(Oe="l"+x+",0 0,"+x+" -"+x+",0 0,-"+x+"z ",X+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',X+=F.scalable?"":' width="'+P+'px" height="'+P+'px"',X+=' viewBox="0 0 '+P+" "+P+'" ',X+=' preserveAspectRatio="xMinYMin meet"',X+=N.text||A.text?' role="img" aria-labelledby="'+he([N.id,A.id].join(" ").trim())+'"':"",X+=">",X+=N.text?'<title id="'+he(N.id)+'">'+he(N.text)+"</title>":"",X+=A.text?'<description id="'+he(A.id)+'">'+he(A.text)+"</description>":"",X+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',X+='<path d="',ne=0;ne<H.getModuleCount();ne+=1)for(ce=ne*x+v,j=0;j<H.getModuleCount();j+=1)H.isDark(ne,j)&&(U=j*x+v,X+="M"+U+","+ce+Oe);return X+='" stroke="transparent" fill="black"/>',X+="</svg>",X},H.createDataURL=function(x,v){x=x||2,v=typeof v>"u"?x*4:v;var A=H.getModuleCount()*x+v*2,N=v,F=A-v;return R(A,A,function(P,j){if(N<=P&&P<F&&N<=j&&j<F){var U=Math.floor((P-N)/x),ne=Math.floor((j-N)/x);return H.isDark(ne,U)?0:1}else return 1})},H.createImgTag=function(x,v,A){x=x||2,v=typeof v>"u"?x*4:v;var N=H.getModuleCount()*x+v*2,F="";return F+="<img",F+=' src="',F+=H.createDataURL(x,v),F+='"',F+=' width="',F+=N,F+='"',F+=' height="',F+=N,F+='"',A&&(F+=' alt="',F+=he(A),F+='"'),F+="/>",F};var he=function(x){for(var v="",A=0;A<x.length;A+=1){var N=x.charAt(A);switch(N){case"<":v+="<";break;case">":v+=">";break;case"&":v+="&";break;case'"':v+=""";break;default:v+=N;break}}return v},ke=function(x){var v=1;x=typeof x>"u"?v*2:x;var A=H.getModuleCount()*v+x*2,N=x,F=A-x,P,j,U,ne,ce,X={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},Oe={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},ge="";for(P=0;P<A;P+=2){for(U=Math.floor((P-N)/v),ne=Math.floor((P+1-N)/v),j=0;j<A;j+=1)ce="\u2588",N<=j&&j<F&&N<=P&&P<F&&H.isDark(U,Math.floor((j-N)/v))&&(ce=" "),N<=j&&j<F&&N<=P+1&&P+1<F&&H.isDark(ne,Math.floor((j-N)/v))?ce+=" ":ce+="\u2588",ge+=x<1&&P+1>=F?Oe[ce]:X[ce];ge+=`
|
|
3
|
+
`}return A%2&&x>0?ge.substring(0,ge.length-A-1)+Array(A+1).join("\u2580"):ge.substring(0,ge.length-1)};return H.createASCII=function(x,v){if(x=x||1,x<2)return ke(v);x-=1,v=typeof v>"u"?x*2:v;var A=H.getModuleCount()*x+v*2,N=v,F=A-v,P,j,U,ne,ce=Array(x+1).join("\u2588\u2588"),X=Array(x+1).join(" "),Oe="",ge="";for(P=0;P<A;P+=1){for(U=Math.floor((P-N)/x),ge="",j=0;j<A;j+=1)ne=1,N<=j&&j<F&&N<=P&&P<F&&H.isDark(U,Math.floor((j-N)/x))&&(ne=0),ge+=ne?ce:X;for(U=0;U<x;U+=1)Oe+=ge+`
|
|
4
|
+
`}return Oe.substring(0,Oe.length-1)},H.renderTo2dContext=function(x,v){v=v||2;for(var A=H.getModuleCount(),N=0;N<A;N++)for(var F=0;F<A;F++)x.fillStyle=H.isDark(N,F)?"black":"white",x.fillRect(F*v,N*v,v,v)},H};r.stringToBytesFuncs={default:function(E){for(var S=[],w=0;w<E.length;w+=1){var y=E.charCodeAt(w);S.push(y&255)}return S}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(E,S){var w=(function(){for(var O=h(E),$=function(){var V=O.read();if(V==-1)throw"eof";return V},b=0,m={};;){var G=O.read();if(G==-1)break;var T=$(),H=$(),Q=$(),z=String.fromCharCode(G<<8|T),q=H<<8|Q;m[z]=q,b+=1}if(b!=S)throw b+" != "+S;return m})(),y=63;return function(O){for(var $=[],b=0;b<O.length;b+=1){var m=O.charCodeAt(b);if(m<128)$.push(m);else{var G=w[O.charAt(b)];typeof G=="number"?(G&255)==G?$.push(G):($.push(G>>>8),$.push(G&255)):$.push(y)}}return $}};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 E=[[],[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]],S=1335,w=7973,y=21522,O={},$=function(b){for(var m=0;b!=0;)m+=1,b>>>=1;return m};return O.getBCHTypeInfo=function(b){for(var m=b<<10;$(m)-$(S)>=0;)m^=S<<$(m)-$(S);return(b<<10|m)^y},O.getBCHTypeNumber=function(b){for(var m=b<<12;$(m)-$(w)>=0;)m^=w<<$(m)-$(w);return b<<12|m},O.getPatternPosition=function(b){return E[b-1]},O.getMaskFunction=function(b){switch(b){case n.PATTERN000:return function(m,G){return(m+G)%2==0};case n.PATTERN001:return function(m,G){return m%2==0};case n.PATTERN010:return function(m,G){return G%3==0};case n.PATTERN011:return function(m,G){return(m+G)%3==0};case n.PATTERN100:return function(m,G){return(Math.floor(m/2)+Math.floor(G/3))%2==0};case n.PATTERN101:return function(m,G){return m*G%2+m*G%3==0};case n.PATTERN110:return function(m,G){return(m*G%2+m*G%3)%2==0};case n.PATTERN111:return function(m,G){return(m*G%3+(m+G)%2)%2==0};default:throw"bad maskPattern:"+b}},O.getErrorCorrectPolynomial=function(b){for(var m=i([1],0),G=0;G<b;G+=1)m=m.multiply(i([1,B.gexp(G)],0));return m},O.getLengthInBits=function(b,m){if(1<=m&&m<10)switch(b){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:"+b}else if(m<27)switch(b){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:"+b}else if(m<41)switch(b){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:"+b}else throw"type:"+m},O.getLostPoint=function(b){for(var m=b.getModuleCount(),G=0,T=0;T<m;T+=1)for(var H=0;H<m;H+=1){for(var Q=0,z=b.isDark(T,H),q=-1;q<=1;q+=1)if(!(T+q<0||m<=T+q))for(var V=-1;V<=1;V+=1)H+V<0||m<=H+V||q==0&&V==0||z==b.isDark(T+q,H+V)&&(Q+=1);Q>5&&(G+=3+Q-5)}for(var T=0;T<m-1;T+=1)for(var H=0;H<m-1;H+=1){var ee=0;b.isDark(T,H)&&(ee+=1),b.isDark(T+1,H)&&(ee+=1),b.isDark(T,H+1)&&(ee+=1),b.isDark(T+1,H+1)&&(ee+=1),(ee==0||ee==4)&&(G+=3)}for(var T=0;T<m;T+=1)for(var H=0;H<m-6;H+=1)b.isDark(T,H)&&!b.isDark(T,H+1)&&b.isDark(T,H+2)&&b.isDark(T,H+3)&&b.isDark(T,H+4)&&!b.isDark(T,H+5)&&b.isDark(T,H+6)&&(G+=40);for(var H=0;H<m;H+=1)for(var T=0;T<m-6;T+=1)b.isDark(T,H)&&!b.isDark(T+1,H)&&b.isDark(T+2,H)&&b.isDark(T+3,H)&&b.isDark(T+4,H)&&!b.isDark(T+5,H)&&b.isDark(T+6,H)&&(G+=40);for(var Be=0,H=0;H<m;H+=1)for(var T=0;T<m;T+=1)b.isDark(T,H)&&(Be+=1);var te=Math.abs(100*Be/m/m-50)/5;return G+=te*10,G},O})(),B=(function(){for(var E=new Array(256),S=new Array(256),w=0;w<8;w+=1)E[w]=1<<w;for(var w=8;w<256;w+=1)E[w]=E[w-4]^E[w-5]^E[w-6]^E[w-8];for(var w=0;w<255;w+=1)S[E[w]]=w;var y={};return y.glog=function(O){if(O<1)throw"glog("+O+")";return S[O]},y.gexp=function(O){for(;O<0;)O+=255;for(;O>=256;)O-=255;return E[O]},y})();function i(E,S){if(typeof E.length>"u")throw E.length+"/"+S;var w=(function(){for(var O=0;O<E.length&&E[O]==0;)O+=1;for(var $=new Array(E.length-O+S),b=0;b<E.length-O;b+=1)$[b]=E[b+O];return $})(),y={};return y.getAt=function(O){return w[O]},y.getLength=function(){return w.length},y.multiply=function(O){for(var $=new Array(y.getLength()+O.getLength()-1),b=0;b<y.getLength();b+=1)for(var m=0;m<O.getLength();m+=1)$[b+m]^=B.gexp(B.glog(y.getAt(b))+B.glog(O.getAt(m)));return i($,0)},y.mod=function(O){if(y.getLength()-O.getLength()<0)return y;for(var $=B.glog(y.getAt(0))-B.glog(O.getAt(0)),b=new Array(y.getLength()),m=0;m<y.getLength();m+=1)b[m]=y.getAt(m);for(var m=0;m<O.getLength();m+=1)b[m]^=B.gexp(B.glog(O.getAt(m))+$);return i(b,0).mod(O)},y}var o=(function(){var E=[[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]],S=function(O,$){var b={};return b.totalCount=O,b.dataCount=$,b},w={},y=function(O,$){switch($){case t.L:return E[(O-1)*4+0];case t.M:return E[(O-1)*4+1];case t.Q:return E[(O-1)*4+2];case t.H:return E[(O-1)*4+3];default:return}};return w.getRSBlocks=function(O,$){var b=y(O,$);if(typeof b>"u")throw"bad rs block @ typeNumber:"+O+"/errorCorrectionLevel:"+$;for(var m=b.length/3,G=[],T=0;T<m;T+=1)for(var H=b[T*3+0],Q=b[T*3+1],z=b[T*3+2],q=0;q<H;q+=1)G.push(S(Q,z));return G},w})(),a=function(){var E=[],S=0,w={};return w.getBuffer=function(){return E},w.getAt=function(y){var O=Math.floor(y/8);return(E[O]>>>7-y%8&1)==1},w.put=function(y,O){for(var $=0;$<O;$+=1)w.putBit((y>>>O-$-1&1)==1)},w.getLengthInBits=function(){return S},w.putBit=function(y){var O=Math.floor(S/8);E.length<=O&&E.push(0),y&&(E[O]|=128>>>S%8),S+=1},w},c=function(E){var S=e.MODE_NUMBER,w=E,y={};y.getMode=function(){return S},y.getLength=function(b){return w.length},y.write=function(b){for(var m=w,G=0;G+2<m.length;)b.put(O(m.substring(G,G+3)),10),G+=3;G<m.length&&(m.length-G==1?b.put(O(m.substring(G,G+1)),4):m.length-G==2&&b.put(O(m.substring(G,G+2)),7))};var O=function(b){for(var m=0,G=0;G<b.length;G+=1)m=m*10+$(b.charAt(G));return m},$=function(b){if("0"<=b&&b<="9")return b.charCodeAt(0)-48;throw"illegal char :"+b};return y},u=function(E){var S=e.MODE_ALPHA_NUM,w=E,y={};y.getMode=function(){return S},y.getLength=function($){return w.length},y.write=function($){for(var b=w,m=0;m+1<b.length;)$.put(O(b.charAt(m))*45+O(b.charAt(m+1)),11),m+=2;m<b.length&&$.put(O(b.charAt(m)),6)};var O=function($){if("0"<=$&&$<="9")return $.charCodeAt(0)-48;if("A"<=$&&$<="Z")return $.charCodeAt(0)-65+10;switch($){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 :"+$}};return y},l=function(E){var S=e.MODE_8BIT_BYTE,w=E,y=r.stringToBytes(E),O={};return O.getMode=function(){return S},O.getLength=function($){return y.length},O.write=function($){for(var b=0;b<y.length;b+=1)$.put(y[b],8)},O},f=function(E){var S=e.MODE_KANJI,w=E,y=r.stringToBytesFuncs.SJIS;if(!y)throw"sjis not supported.";(function(b,m){var G=y(b);if(G.length!=2||(G[0]<<8|G[1])!=m)throw"sjis not supported."})("\u53CB",38726);var O=y(E),$={};return $.getMode=function(){return S},$.getLength=function(b){return~~(O.length/2)},$.write=function(b){for(var m=O,G=0;G+1<m.length;){var T=(255&m[G])<<8|255&m[G+1];if(33088<=T&&T<=40956)T-=33088;else if(57408<=T&&T<=60351)T-=49472;else throw"illegal char at "+(G+1)+"/"+T;T=(T>>>8&255)*192+(T&255),b.put(T,13),G+=2}if(G<m.length)throw"illegal char at "+(G+1)},$},C=function(){var E=[],S={};return S.writeByte=function(w){E.push(w&255)},S.writeShort=function(w){S.writeByte(w),S.writeByte(w>>>8)},S.writeBytes=function(w,y,O){y=y||0,O=O||w.length;for(var $=0;$<O;$+=1)S.writeByte(w[$+y])},S.writeString=function(w){for(var y=0;y<w.length;y+=1)S.writeByte(w.charCodeAt(y))},S.toByteArray=function(){return E},S.toString=function(){var w="";w+="[";for(var y=0;y<E.length;y+=1)y>0&&(w+=","),w+=E[y];return w+="]",w},S},d=function(){var E=0,S=0,w=0,y="",O={},$=function(m){y+=String.fromCharCode(b(m&63))},b=function(m){if(!(m<0)){if(m<26)return 65+m;if(m<52)return 97+(m-26);if(m<62)return 48+(m-52);if(m==62)return 43;if(m==63)return 47}throw"n:"+m};return O.writeByte=function(m){for(E=E<<8|m&255,S+=8,w+=1;S>=6;)$(E>>>S-6),S-=6},O.flush=function(){if(S>0&&($(E<<6-S),E=0,S=0),w%3!=0)for(var m=3-w%3,G=0;G<m;G+=1)y+="="},O.toString=function(){return y},O},h=function(E){var S=E,w=0,y=0,O=0,$={};$.read=function(){for(;O<8;){if(w>=S.length){if(O==0)return-1;throw"unexpected end of file./"+O}var m=S.charAt(w);if(w+=1,m=="=")return O=0,-1;if(m.match(/^\s$/))continue;y=y<<6|b(m.charCodeAt(0)),O+=6}var G=y>>>O-8&255;return O-=8,G};var b=function(m){if(65<=m&&m<=90)return m-65;if(97<=m&&m<=122)return m-97+26;if(48<=m&&m<=57)return m-48+52;if(m==43)return 62;if(m==47)return 63;throw"c:"+m};return $},k=function(E,S){var w=E,y=S,O=new Array(E*S),$={};$.setPixel=function(T,H,Q){O[H*w+T]=Q},$.write=function(T){T.writeString("GIF87a"),T.writeShort(w),T.writeShort(y),T.writeByte(128),T.writeByte(0),T.writeByte(0),T.writeByte(0),T.writeByte(0),T.writeByte(0),T.writeByte(255),T.writeByte(255),T.writeByte(255),T.writeString(","),T.writeShort(0),T.writeShort(0),T.writeShort(w),T.writeShort(y),T.writeByte(0);var H=2,Q=m(H);T.writeByte(H);for(var z=0;Q.length-z>255;)T.writeByte(255),T.writeBytes(Q,z,255),z+=255;T.writeByte(Q.length-z),T.writeBytes(Q,z,Q.length-z),T.writeByte(0),T.writeString(";")};var b=function(T){var H=T,Q=0,z=0,q={};return q.write=function(V,ee){if(V>>>ee)throw"length over";for(;Q+ee>=8;)H.writeByte(255&(V<<Q|z)),ee-=8-Q,V>>>=8-Q,z=0,Q=0;z=V<<Q|z,Q=Q+ee},q.flush=function(){Q>0&&H.writeByte(z)},q},m=function(T){for(var H=1<<T,Q=(1<<T)+1,z=T+1,q=G(),V=0;V<H;V+=1)q.add(String.fromCharCode(V));q.add(String.fromCharCode(H)),q.add(String.fromCharCode(Q));var ee=C(),Be=b(ee);Be.write(H,z);var te=0,De=String.fromCharCode(O[te]);for(te+=1;te<O.length;){var pe=String.fromCharCode(O[te]);te+=1,q.contains(De+pe)?De=De+pe:(Be.write(q.indexOf(De),z),q.size()<4095&&(q.size()==1<<z&&(z+=1),q.add(De+pe)),De=pe)}return Be.write(q.indexOf(De),z),Be.write(Q,z),Be.flush(),ee.toByteArray()},G=function(){var T={},H=0,Q={};return Q.add=function(z){if(Q.contains(z))throw"dup key:"+z;T[z]=H,H+=1},Q.size=function(){return H},Q.indexOf=function(z){return T[z]},Q.contains=function(z){return typeof T[z]<"u"},Q};return $},R=function(E,S,w){for(var y=k(E,S),O=0;O<S;O+=1)for(var $=0;$<E;$+=1)y.setPixel($,O,w($,O));var b=C();y.write(b);for(var m=d(),G=b.toByteArray(),T=0;T<G.length;T+=1)m.writeByte(G[T]);return m.flush(),"data:image/gif;base64,"+m};return r})();(function(){Al.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var B=t.charCodeAt(s);B<128?n.push(B):B<2048?n.push(192|B>>6,128|B&63):B<55296||B>=57344?n.push(224|B>>12,128|B>>6&63,128|B&63):(s++,B=65536+((B&1023)<<10|t.charCodeAt(s)&1023),n.push(240|B>>18,128|B>>12&63,128|B>>6&63,128|B&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof Rl=="object"&&(yl.exports=r())})(function(){return Al})});var BC={};su(BC,{estimate:()=>Ql,lint:()=>Yl,main:()=>ql,parseArgs:()=>zl});module.exports=Bu(BC);var He=ae(require("node:fs")),Dt=ae(require("node:path"));var hi={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function Ee(r){return typeof r=="string"}function di(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&Ee(e.lead)&&Ee(e.content)&&Ee(e.trail)&&(e.eol===`
|
|
5
5
|
`||e.eol===`\r
|
|
6
|
-
`)&&
|
|
6
|
+
`)&&Ee(e.finalEol)&&Ee(e.value)}function pi(r){if(typeof r!="object"||r===null)return!1;let e=r;return(e.raw===void 0||Ee(e.raw))&&Ee(e.text)&&typeof e.attrs=="object"&&e.attrs!==null&&Object.values(e.attrs).every(Ee)}function iu(r){if(typeof r!="object"||r===null)return!1;let e=r;return Ee(e.raw)&&Ee(e.gap)&&Array.isArray(e.entries)&&e.entries.every(pi)}function ou(r){if(typeof r!="object"||r===null)return!1;let e=r;return Ee(e.raw)&&Ee(e.gap)}function le(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="code"&&Ee(e.lead)&&Ee(e.open)&&Ee(e.body)&&Ee(e.close)&&Ee(e.trail)&&Ee(e.indent)&&(e.fenceChar==="`"||e.fenceChar==="~")&&typeof e.fenceLen=="number"&&Ee(e.info)&&Ee(e.lang)&&(e.eol===`
|
|
7
7
|
`||e.eol===`\r
|
|
8
|
-
`)&&
|
|
8
|
+
`)&&Ee(e.value)&&(e.output===void 0||ou(e.output))&&(e.history===void 0||iu(e.history))}function gi(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
|
-
`)}function
|
|
10
|
+
`)}function Nt(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 at(r){let e="";for(let t of r)e+=t.text+t.eol;return e}function Sr(r,e){let t=0,n=0;for(let s of r)s.eol===`\r
|
|
11
11
|
`?t++:s.eol===`
|
|
12
12
|
`&&n++;return t===0&&n===0?e:t>n?`\r
|
|
13
13
|
`:`
|
|
14
|
-
`}function
|
|
14
|
+
`}function Or(r){return r.endsWith(`\r
|
|
15
15
|
`)?`\r
|
|
16
16
|
`:r.endsWith(`
|
|
17
17
|
`)?`
|
|
18
|
-
`:r.endsWith("\r")?"\r":""}function
|
|
19
|
-
`)}var
|
|
20
|
-
`)s[i]+=B,B="",i++,c(i),o=0;else if(
|
|
21
|
-
`)}var
|
|
22
|
-
`).map((n,s)=>n.includes(
|
|
23
|
-
`),stderr:e}}function
|
|
24
|
-
`);if(t.length<=e)return r;let n=Math.ceil(e/2),s=e-n,B=t.length-e;return[...t.slice(0,n),
|
|
25
|
-
`)}function
|
|
26
|
-
`),
|
|
27
|
-
`),B="`".repeat(Math.max(3,
|
|
28
|
-
`),B=[],i="",o=u=>{if(u.length===0)return;let l=0,
|
|
29
|
-
`),
|
|
30
|
-
`),
|
|
31
|
-
`);return{meta:{raw:
|
|
32
|
-
`},s=n.eol,B="",i=!1,o=!1;for(let a of e){let c=
|
|
33
|
-
`).map(n
|
|
34
|
-
`))e?
|
|
35
|
-
`),
|
|
36
|
-
`);if(t>=0&&(this.held+=this.pending.slice(0,t+1),this.pending=this.pending.slice(t+1),(!
|
|
37
|
-
`);if(i>=0){let o=Number.parseInt(t.slice(this.needle.length,i),10);this.code=Number.isNaN(o)?1:o,t=""}this.pending=t;return}let s=t.lastIndexOf(""),B=s>=0&&this.needle.startsWith(t.slice(s))?s:t.length;this.send(t.slice(0,B)),this.pending=t.slice(B)}flush(){this.send(this.pending),this.pending=""}send(e){e!==""&&this.emit(e)}};function
|
|
38
|
-
`}var
|
|
39
|
-
`))}finally{
|
|
40
|
-
`)),wt(s.info)),t=c+1;continue}let B
|
|
41
|
-
`,t++;continue}if(
|
|
42
|
-
`,t++;continue}if(
|
|
43
|
-
${
|
|
44
|
-
`;continue}if(
|
|
18
|
+
`:r.endsWith("\r")?"\r":""}function yn(r){return Or(r)!==""}function sn(r){return r.replace(/\r\n?/g,`
|
|
19
|
+
`)}var Bn=/^[ \t]*$/;var au=new Set(["sh","bash","pwsh","powershell","cmd"]),lu={sh:"shellscript",bash:"shellscript",pwsh:"powershell",powershell:"powershell",cmd:"bat"},mi={shellscript:"bash",powershell:"pwsh",bat:"cmd"},cC=Object.keys(mi);function Os(r){return au.has(r)}function Ar(r){return lu[r]??r}function Ei(r){return mi[r]??r}var uu=/^([ \t]*)(`{3,}|~{3,})(.*)$/,Di=/^[ \t]*(`{3,}|~{3,})[ \t]*$/;function Ae(r){let e=uu.exec(r);if(!e)return null;let t=e[1]??"",n=e[2]??"",s=e[3]??"",B=n[0];return B==="`"&&s.includes("`")?null:{indent:t,char:B,len:n.length,info:s}}function Le(r,e){let t=Di.exec(r);if(!t)return!1;let n=t[1]??"";return n[0]===e.char&&n.length>=e.len}var bi=/^(\s*)([^\s{]+)/;function wt(r){let e=bi.exec(r);return e?(e[2]??"").toLowerCase():""}function wi(r,e){let t=bi.exec(r);return t?(t[1]??"")+e+r.slice(t[0].length):e+r}function xi(r,e){let t=0;for(let n of r){let B=Di.exec(n)?.[1];B&&B[0]===e&&(t=Math.max(t,B.length))}return t}function As(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 $t(r,e){return r===""?r:e+r}var cu=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 Ve(r){return r.replace(cu,"")}var fu=/^\u001b\[([0-9;?]*)([ -/]*)([@-~])/,Cu=/^\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/,hu=/[\r\b\u0000-\u0008\u000b-\u001a\u001c-\u001f\u007f]|\u001b\[[0-9;?]*[ -/]*[A-GJKsu]|\u001b[78]/;function Fn(r,e=""){if(!hu.test(r))return r;let t=[[]],n=[!1],s=[""],B="",i=0,o=0,a=[0,0],c=f=>{for(;t.length<=f;)t.push([]),n.push(!1),s.push("")},u=f=>{let C=t[i];for(;C.length<o;)C.push(" ");C[o]=B+f,B="",o++},l=(f,C)=>{let d=parseInt(f.split(";")[0]??"",10);return Number.isFinite(d)&&d>0?d:C};for(let f=0;f<r.length;){let C=r[f];if(C==="\x1B"){let d=r.slice(f,f+256),h=fu.exec(d);if(h){let[E,S,w,y]=h;if(f+=E.length,w!==""||S.startsWith("?")){y==="m"&&(B+=E);continue}let O=l(S,1);switch(y){case"A":i=Math.max(0,i-O);break;case"B":i+=O,c(i);break;case"C":o+=O;break;case"D":o=Math.max(0,o-O);break;case"E":i+=O,c(i),o=0;break;case"F":i=Math.max(0,i-O),o=0;break;case"G":o=O-1;break;case"K":{let $=l(S,0),b=t[i];if($===0)b.length=Math.min(b.length,o);else if($===1)for(let m=0;m<=o&&m<b.length;m++)b[m]=" ";else b.length=0;break}case"J":{let $=l(S,0);if($===0)t[i].length=Math.min(t[i].length,o),t.length=i+1,n.length=i+1,s.length=i+1;else if($===1){for(let b=0;b<i;b++)t[b]=[];for(let b=0;b<=o&&b<t[i].length;b++)t[i][b]=" "}break}case"s":a=[i,o];break;case"u":[i,o]=a,c(i);break;default:B+=E}continue}let k=Cu.exec(d);if(k&&k[0].length>2){B+=k[0],f+=k[0].length;continue}let R=r[f+1];R==="7"?a=[i,o]:R==="8"&&([i,o]=a,c(i)),f+=R===void 0?1:2;continue}if(f++,C===`
|
|
20
|
+
`)s[i]+=B,B="",i++,c(i),o=0;else if(C==="\r")o=0;else if(C==="\b")o=Math.max(0,o-1);else if(e!==""&&C===e)n[i]=!0;else if(C===" ")u(C);else{if(C<" "||C==="\x7F")continue;C>="\uD800"&&C<="\uDBFF"&&f<r.length?u(C+r[f++]):u(C)}}return s[i]+=B,t.map((f,C)=>(n[C]?e:"")+f.join("")+s[C]).join(`
|
|
21
|
+
`)}var vi=[{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]"]}],du=new Set(["ALERT","NOTICE","HINT","PASS","DONE","OK","EE","WW","II","ERR","EROR","CRIT","EMERG","WRN","DBUG","DBG","VRB"]),ki=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),pu=r=>r[0]+r.slice(1).toLowerCase(),mC=new RegExp(vi.map(r=>{let e=[],t=[...r.words,...r.capitalized?r.words.filter(n=>!du.has(n)&&!n.includes("_")).map(pu):[]];return e.push(`\\b(?:${t.map(ki).join("|")})\\b`),r.colon?.length&&e.push(`\\b(?:${r.colon.map(ki).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 on="\uE000";function Rs(r){if(!r.includes(on))return{text:r,stderr:[]};let e=[];return{text:r.split(`
|
|
22
|
+
`).map((n,s)=>n.includes(on)?(e.push(s),n.split(on).join("")):n).join(`
|
|
23
|
+
`),stderr:e}}function ys(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 Rr=/^[ \t]*<!--[ \t]*md-runbook:output start\b(.*?)-->[ \t]*$/,Fs=/^[ \t]*<!--[ \t]*md-runbook:output end[ \t]*-->[ \t]*$/,Si=/^[ \t]*<details>[ \t]*<summary>[ \t]*md-runbook:[^<]*<\/summary>[ \t]*$/,Oi=/^[ \t]*<\/details>[ \t]*$/,gu=/([\w-]+)=(?:"([^"]*)"|(\S+))/g;function In(r){let e={};for(let t of r.matchAll(gu)){let n=t[1];n&&(e[n]=t[2]??t[3]??"")}return e}function Ai(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 mu(r){return`\u2026 [md-runbook: ${r} line${r===1?"":"s"} truncated] \u2026`}function Ri(r,e){if(e<=0)return r;let t=r.split(`
|
|
24
|
+
`);if(t.length<=e)return r;let n=Math.ceil(e/2),s=e-n,B=t.length-e;return[...t.slice(0,n),mu(B),...t.slice(t.length-s)].join(`
|
|
25
|
+
`)}function yi(r,e){let t=Fn(r.replace(/\r\n/g,`
|
|
26
|
+
`),on);e.stripAnsi&&(t=Ve(t)),e.redact&&(t=e.redact(t)),t=t.replace(/\n+$/,"");let n=Rs(Ri(t,e.maxOutputLines));return{text:n.text,stderr:ys(n.stderr)}}function Tn(r,e,t,n){let s=r===""?[]:sn(r).split(`
|
|
27
|
+
`),B="`".repeat(Math.max(3,Eu(s)+1));return[`<!-- md-runbook:output start${Ai(e)} -->`,B+"text",...s,B,"<!-- md-runbook:output end -->"].map(o=>$t(o,t)).join(n)+n}function Eu(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 Is(r){return`${(Math.max(0,r)/1e3).toFixed(3)}s`}function Se(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 Ce(r){let e=r,t=!1;e.charCodeAt(0)===65279&&(t=!0,e=e.slice(1));let n=Nt(e),s=Sr(n,`
|
|
28
|
+
`),B=[],i="",o=u=>{if(u.length===0)return;let l=0,f=u.length;for(;l<f&&Bn.test(u[l].text);)l++;for(;f>l&&Bn.test(u[f-1].text);)f--;if(l===f){let k=at(u),R=B[B.length-1];R?R.meta.trail+=k:i+=k;return}let C=u.slice(l,f),d=C.map(k=>k.text).join(`
|
|
29
|
+
`),h={kind:"markup",lead:i+at(u.slice(0,l)),content:at(C),trail:at(u.slice(f)),eol:Sr(C,s),finalEol:C[C.length-1].eol,value:d};i="",B.push({kind:"markup",value:d,languageId:"markdown",meta:h})},a=0,c=0;for(;c<n.length;){let u=Ae(n[c].text);if(!u){c++;continue}let l=c+1;for(;l<n.length&&!Le(n[l].text,u);)l++;if(l>=n.length)break;let f=wt(u.info);if(!Os(f)){c=l+1;continue}o(n.slice(a,c));let C=n[c],d=n.slice(c+1,l),h=d.map(w=>As(w.text,u.indent)).join(`
|
|
30
|
+
`),k={kind:"code",lead:i,open:C.text+C.eol,body:at(d),close:n[l].text+n[l].eol,trail:"",indent:u.indent,fenceChar:u.char,fenceLen:u.len,info:u.info,lang:f,eol:Sr([C,...d],s),value:h};i="";let R={kind:"code",value:h,languageId:Ar(f),meta:k},E=l+1,S=Ts(n,E);if(S){k.output=S.meta,R.output=S.output,E=S.end;let w=Du(n,E);w&&(k.history=w.meta,E=w.end)}B.push(R),c=E,a=E}return o(n.slice(a)),i!==""&&B.push({kind:"markup",value:"",languageId:"markdown",meta:{kind:"markup",lead:i,content:"",trail:"",eol:s,finalEol:"",value:""}}),{meta:{bom:t,eol:s},cells:B}}function Ts(r,e){let t=e;for(;t<r.length&&Bn.test(r[t].text);)t++;let n=r[t]?Rr.exec(r[t].text):null;if(!n)return null;let s=t+1,B=r[s]?Ae(r[s].text):null;if(!B)return null;let i=s+1;for(;i<r.length&&!Le(r[i].text,B);)i++;let o=i+1;if(o>=r.length||!Fs.test(r[o].text))return null;let a=r.slice(s+1,i).map(c=>As(c.text,B.indent)).join(`
|
|
31
|
+
`);return{meta:{raw:at(r.slice(e,o+1)),gap:at(r.slice(e,t))},output:{text:a,attrs:In(n[1]??"")},end:o+1}}function Du(r,e){let t=e;for(;t<r.length&&Bn.test(r[t].text);)t++;if(!r[t]||!Si.test(r[t].text))return null;let n=[],s=t+1;for(;;){let B=Ts(r,s);if(!B)break;n.push({raw:B.meta.raw.slice(B.meta.gap.length),...B.output}),s=B.end}for(;s<r.length&&Bn.test(r[s].text);)s++;return n.length===0||!r[s]||!Oi.test(r[s].text)?null:{meta:{raw:at(r.slice(e,s+1)),gap:at(r.slice(e,t)),entries:n},end:s+1}}function Ls(r){let e=Nt(r),t=Ts(e,0);return t&&t.end===e.length?t.output:null}function Ns(r){if(!r.output)return;let e=r.output.raw.slice(r.output.gap.length),t=Ls(e);return t?{raw:e,...t}:void 0}function $s(r,e,t){return!r||t<=0?[]:[r,...e].slice(0,t)}function bu(r){return`md-runbook: ${r} previous run${r===1?"":"s"}`}function Ms(r,e,t){let n=$t(`<details><summary>${bu(r.length)}</summary>`,e)+t;for(let s of r)n+=t,s.raw!==void 0?n+=yn(s.raw)?s.raw:s.raw+t:n+=Tn(s.text,s.attrs,e,t);return n+t+$t("</details>",e)+t}function yr(r,e,t){let n=gi(r)?r:{bom:!1,eol:`
|
|
32
|
+
`},s=n.eol,B="",i=!1,o=!1;for(let a of e){let c=sn(a.value),u=a.kind==="markup"?di(a.meta)?a.meta:void 0:le(a.meta)?a.meta:void 0,l=u===void 0;B!==""&&!yn(B)&&(B+=s);let f=o&&B!=="",C=a.kind==="markup"?vu(c,u,s,f):Su(c,a.languageId,u,a.output,s,t,f);B!==""&&(l||i)&&!xu(B)&&!wu(C)&&(B+=s),B+=C,i=l,o=u!==void 0&&u.trail!==""}return(n.bom?"\uFEFF":"")+B}function wu(r){return/^[ \t]*(?:\r\n|\n|\r)/.test(r)}function xu(r){return/(?:\r\n|\n|\r)[ \t]*(?:\r\n|\n|\r)$/.test(r)||/^[ \t]*(?:\r\n|\n|\r)$/.test(r)}function Ii(r,e,t=""){return r===""?"":r.split(`
|
|
33
|
+
`).map(n=>$t(n,t)).join(e)}function ku(r){let e=null;for(let t of r.split(`
|
|
34
|
+
`))e?Le(t,e)&&(e=null):e=Ae(t);return e?e.indent+e.char.repeat(e.len):""}function Fi(r,e,t){let n=ku(r);return Ii(r,e)+(n===""?"":e+n)+t}function vu(r,e,t,n){if(!e)return r===""?"":Fi(r,t,t);let s=n?"":e.lead;if(r===e.value)return s+e.content+e.trail;let B=r===""?"":Fi(r,e.eol,e.finalEol);return s+B+e.trail}function Su(r,e,t,n,s,B,i){let o=t!==void 0&&e!==void 0&&Ar(t.lang)!==e,a=i?"":t?.lead??"";if(t&&!o&&r===t.value)a+=t.open+t.body+t.close;else{let u=t?.eol??s,l=t?.indent??"",f=t?.fenceChar??"`",C=t?.fenceLen??3,d=Math.max(C,xi(r.split(`
|
|
35
|
+
`),f)+1),h=Ei(e??"shellscript"),k=l+f.repeat(d),R,E;if(t){let w=o?wi(t.info,h):t.info,y=Or(t.open);R=d===C&&!o&&y!=="\r"?t.open:k+w+(y==="\r"?u:y||u),E=d===C?t.close:k+Or(t.close)}else R=k+h+u,E=k+u;let S=r===""?"":Ii(r,u,l)+u;a+=R+S+E}let c=Ou(n,t,s,B);return c!==""&&(yn(a)||(a+=t?.eol??s),a+=c),a+(t?.trail??"")}function Ou(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:B}=yi(r.text,n),i=e?.eol??t,o=e?.indent??"",{stderr:a,...c}=r.attrs,u=B?{...c,stderr:B}:c,l=r.previous?{...u,changed:r.previous.text===s?"no":"yes"}:u,f=(e?.output?.gap??"")+Tn(s,l,o,i);return r.history?.length&&(f+=(e?.history?.gap??"")+Ms(r.history,o,i)),f}function Fr(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 Gs(r){let e=Ce(r);return yr(e.meta,Fr(e,!1),hi)}var an="[REDACTED]",Hs="password|passwd|pwd|secret|token|api[_-]?key|access[_-]?key|private[_-]?key|privatekey|client[_-]?key|credentials?|\\.key",Au=`(?:\\$\\{[^}\\s]*\\}|\\$\\([^)\\r\\n]*\\)|\\$env:\\w+|%[A-Za-z_]\\w*%)(?![^\\s"',;&])`,Ir=`(?<!\\$\\{(?:secret|secretFile|input|param):)(?!(?:Bearer|Basic|Negotiate|true|false|null|none)\\b)(?!${Au})`,Ti="k8s-secret-data",Ps=[{name:"pem-private-key",pattern:"(?<=-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----)[\\s\\S]+?(?=-----END [A-Z0-9 ]*PRIVATE KEY-----|$)"},{name:Ti,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.-]*(?:${Hs})[\\w.-]*["']?[ \\t]*[:=][ \\t]*")${Ir}[^"\\r\\n]+(?=")|(?<=\\b[\\w.-]*(?:${Hs})[\\w.-]*["']?[ \\t]*[:=][ \\t]*')${Ir}[^'\\r\\n]+(?=')`,flags:"i"},{name:"secret-key-value",pattern:`(?<=\\b[\\w.-]*(?:${Hs})[\\w.-]*["']?[ \\t]*[:=][ \\t]*["']?)${Ir}[^\\s"',;&}]+`,flags:"i"},{name:"pass-key-value",pattern:`(?<=(?:^|[^A-Za-z0-9])(?:[\\w.-]*[_.-])?pass["']?[ \\t]*[:=][ \\t]*["']?)${Ir}[^\\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 Ru(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,B,i)=>{let o=i.replace(/^([ \t]+[^\s:#][^:\r\n]*:[ \t]*)(?:\|[-+]?|>[-+]?)?[ \t]*(\S[^\r\n]*)?$/gm,(a,c,u)=>u===void 0||u.startsWith("[REDACTED]")?a:`${c}${an}`);return`${n}${s}:${B}${o}`});return e=e.replace(/("(?:data|stringData)"[ \t]*:[ \t]*\{)([^{}]*)(\})/g,(t,n,s,B)=>n+s.replace(/("[^"\r\n]+"[ \t]*:[ \t]*)"[^"]*"/g,`$1"${an}"`)+B),e}function yu(r){let e=new Set((r??"").replace(/[gy]/g,"").split(""));return e.add("g"),[...e].join("")}function Fu(r){let e=typeof r=="string"?{pattern:r}:r;return new RegExp(e.pattern,yu(e.flags))}function _s(r){let e=[],t=[],n=!1;for(let s of r){if(typeof s!="string"&&s.name===Ti){n=!0;continue}try{e.push(Fu(s))}catch(B){let i=typeof s=="string"?s:s.name??s.pattern;t.push(`${i}: ${B instanceof Error?B.message:String(B)}`)}}return{errors:t,redact(s){let B=n?Ru(s):s;for(let i of e)i.lastIndex=0,B=B.replace(i,o=>o===""?o:an);return B}}}var Iu=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----(?![\s\S]*-----END [A-Z0-9 ]*PRIVATE KEY-----)/,Mt=class{constructor(e,t=B=>B,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),(!Iu.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,B=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.release(this.held+B)}}flush(){this.release(this.held+this.pending),this.pending=""}release(e){this.held="",e!==""&&this.emit(this.transform(e))}};function Re(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 Ln=["bash","zsh","sh"],Nn=["pwsh","windows-powershell"];function $n(r){let e={},t=[],n=[],s=r.replace(/^\s*\[|\]\s*$/g,"").split(/[\s,]+/).map(B=>B.replace(/^["']|["']$/g,"")).filter(Boolean);for(let B of s){let i=B.toLowerCase();Ln.includes(i)?e.unix?n.push(B):e.unix=i:Nn.includes(i)?e.powershell?n.push(B):e.powershell=i:t.push(B)}return{shells:e,unknown:t,twice:n}}function Mn(r){return r.timedOut?"timeout":r.cancelled?"cancelled":r.error!==void 0?"error":r.exitCode!==null?String(r.exitCode):r.signal??"unknown"}function Gn(r){return!r.timedOut&&!r.cancelled&&r.error===void 0&&r.exitCode===0}var Gt=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 i=t.indexOf(`
|
|
37
|
+
`);if(i>=0){let o=Number.parseInt(t.slice(this.needle.length,i),10);this.code=Number.isNaN(o)?1:o,t=""}this.pending=t;return}let s=t.lastIndexOf(""),B=s>=0&&this.needle.startsWith(t.slice(s))?s:t.length;this.send(t.slice(0,B)),this.pending=t.slice(B)}flush(){this.send(this.pending),this.pending=""}send(e){e!==""&&this.emit(e)}};function Tr(r){return r.match(/\r\n|\n|\r/g)?.length??0}function Ht(r){let e=[],t=0;return r.cells.forEach((n,s)=>{let B=n.meta;if(le(B)){let i=t+Tr(B.lead);e.push({cellIndex:s,line:i,closeLine:i+1+Tr(B.body),language:B.lang,info:B.info,source:n.value,outputAttrs:n.output?.attrs}),t+=Tr(B.lead+B.open+B.body+B.close+(B.output?.raw??"")+(B.history?.raw??"")+B.trail)}else t+=Tr(B.lead+B.content+B.trail)}),e}function Hn(r,e,t,n){let s=Ce(r);if(s.cells[e]?.kind!=="code")return;let B=Fr(s);return B[e].output=t,yr(s.meta,B,n)}function Js(r,e=new Date){let t=r.exit??"?",s=[`${r.check==="failed"?"\u2717":r.check==="ok"||t==="0"||t==="done"?"\u2713":["skipped","declined","proposed","running"].includes(t)?"\u2013":"\u2717"} ${/^-?\d+$/.test(t)?`exit ${t}`:t}`];r.check==="failed"&&s.push("check failed"),r.attempts&&s.push(`${r.attempts} attempts`),r.lines&&s.push(`lines ${r.lines}`);let B=r.duration?parseFloat(r.duration):NaN;isNaN(B)||s.push(B<60?`${B.toFixed(1)}s`:`${Math.floor(B/60)}m${Math.round(B%60)}s`);let i=Date.parse(r.ended??r.ran??"");return isNaN(i)||s.push(Tu(e.getTime()-i)),s.join(" \xB7 ")}function Tu(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 Z(r){return r.replace(/[&<>"']/g,e=>`&${{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#39"}[e]};`)}function Ni(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 $i=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,Mi=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,_n=/^([ \t]*)([-*+]|(\d{1,9})[.)])([ \t]+|$)(.*)$/,Us=/^ {0,3}> ?(.*)$/,Lu=/^[ \t]*\|?[ \t]*:?-+:?[ \t]*(\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/,ln=/^[ \t]*$/;function Pn(r){let e=0;for(let t of r)e+=t===" "?4-e%4:1;return e}function Nr(r,e){return`<div class="code">${e?`<span class="lang">${Z(e)}</span>`:""}<pre><code>${Z(r)}</code></pre></div>
|
|
38
|
+
`}var Lr=r=>r;function Ks(r,e){let t=Lr;Lr=e??(n=>n);try{return js(sn(r).split(`
|
|
39
|
+
`))}finally{Lr=t}}function Gi(r){return $i.test(r)||Mi.test(r)||Us.test(r)||Ae(r)!==null||/^[ \t]*<!--/.test(r)}function js(r){let e="",t=0;for(;t<r.length;){let n=r[t];if(ln.test(n)){t++;continue}if(/^[ \t]*<!--/.test(n)){for(;t<r.length&&!r[t].includes("-->");)t++;t++;continue}let s=Ae(n);if(s){let c=t+1;for(;c<r.length&&!Le(r[c],s);)c++;let u=l=>l.replace(new RegExp(`^[ \\t]{0,${s.indent.length}}`),"");e+=Nr(Lr(r.slice(t+1,c).map(u).join(`
|
|
40
|
+
`)),wt(s.info)),t=c+1;continue}let B=$i.exec(n);if(B){let c=B[1].length;e+=`<h${c}>${xt(B[2]??"")}</h${c}>
|
|
41
|
+
`,t++;continue}if(Mi.test(n)){e+=`<hr>
|
|
42
|
+
`,t++;continue}if(Us.test(n)){let c=[];for(;t<r.length&&!ln.test(r[t]);){let u=Us.exec(r[t]);c.push(u?u[1]:r[t]),t++}e+=`<blockquote>
|
|
43
|
+
${js(c)}</blockquote>
|
|
44
|
+
`;continue}if(_n.test(n)){let c=Nu(r,t);e+=c.html,t=c.end;continue}if(n.includes("|")&&t+1<r.length&&Lu.test(r[t+1])&&r[t+1].includes("-")){let c=[n],u=t+2;for(;u<r.length&&!ln.test(r[u])&&r[u].includes("|");)c.push(r[u++]);e+=Mu(c),t=u;continue}let i=[];for(;t<r.length&&!ln.test(r[t])&&(i.length===0||!Gi(r[t])&&!_n.test(r[t]));)i.push(r[t]),t++;let o=c=>/ {2,}$|\\$/.test(c),a=i.map((c,u)=>xt(c.trim().replace(/\\$/,""))+(u===i.length-1?"":o(c)?`<br>
|
|
45
45
|
`:`
|
|
46
46
|
`));e+=`<p>${a.join("")}</p>
|
|
47
|
-
`}return e}function
|
|
48
|
-
`;for(let u of B){let l=/^\[([ xX])\][ \t]+/.exec(u[0]);l&&(u[0]=u[0].slice(l[0].length));let
|
|
49
|
-
`);c+=`<li${l?' class="task"':""}>${
|
|
47
|
+
`}return e}function Nu(r,e){let t=_n.exec(r[e]),n=Pn(t[1]),s=t[3]!==void 0,B=[],i=e;for(;i<r.length;){let u=_n.exec(r[i]);if(u&&Pn(u[1])<=n+1&&u[3]!==void 0===s){let l=Pn(u[1]+u[2]+(u[4]||" ")),f=[u[5]];for(i++;i<r.length;){let C=r[i];if(ln.test(C)){let h=i;for(;h<r.length&&ln.test(r[h]);)h++;if(h<r.length&&Pn(/^[ \t]*/.exec(r[h])[0])>=l){for(;i<h;)f.push(r[i++].trim());continue}break}if(Pn(/^[ \t]*/.exec(C)[0])>=l)f.push($u(C,l));else if(!_n.test(C)&&!Gi(C))f.push(C.trim());else break;i++}B.push(f);continue}break}let o=s?"ol":"ul",a=s&&t[3]!=="1"?` start="${parseInt(t[3],10)}"`:"",c=`<${o}${a}>
|
|
48
|
+
`;for(let u of B){let l=/^\[([ xX])\][ \t]+/.exec(u[0]);l&&(u[0]=u[0].slice(l[0].length));let f=l?`<input type="checkbox" disabled${l[1]===" "?"":" checked"}> `:"",C=u.length===1?xt(u[0]):js(u).replace(/^<p>([\s\S]*?)<\/p>\n/,`$1
|
|
49
|
+
`);c+=`<li${l?' class="task"':""}>${f}${C}</li>
|
|
50
50
|
`}return{html:c+`</${o}>
|
|
51
|
-
`,end:i}}function
|
|
51
|
+
`,end:i}}function $u(r,e){let t=0,n=0;for(;n<r.length&&t<e&&(r[n]===" "||r[n]===" ");)t+=r[n]===" "?4-t%4:1,n++;return r.slice(n)}function Mu(r){let e=B=>B.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,"").split(/(?<!\\)\|/).map(i=>i.trim().replace(/\\\|/g,"|")),[t,...n]=r,s=`<table>
|
|
52
52
|
<thead><tr>`+e(t).map(B=>`<th>${xt(B)}</th>`).join("")+`</tr></thead>
|
|
53
53
|
<tbody>
|
|
54
54
|
`;for(let B of n)s+="<tr>"+e(B).map(i=>`<td>${xt(i)}</td>`).join("")+`</tr>
|
|
55
55
|
`;return s+`</tbody>
|
|
56
56
|
</table>
|
|
57
|
-
`}function xt(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,B,i)=>t(`<code>${Z(i.replace(/^ (.*) $/,"$1"))}</code>`)),n=n.replace(/\\([!-/:-@[-`{-~])/g,(s,B)=>t(Z(B))),n=Z(n),n=n.replace(/!?\[([^\]]*)\]\(([^)\s]*)(?:\s+"[^)]*?")?\)/g,(s,B,i)=>{let o=
|
|
58
|
-
`,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<Un)return Us[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>Tr?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>Tr?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<Un)return Ks[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>Tr?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>Tr?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},d=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}},Vi=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)Vi[e.charCodeAt(r)]=r;var Zi=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let B=Vi[r.charCodeAt(s)];t|=(B&31)<<n,(B&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Zi(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),B=0,i=0;for(let o=0;o<n;o++)B+=t[i++],s[o*3]=B,B+=t[i++],s[o*3+1]=B,s[o*3+2]=e?1:t[i++];return s},Du=r=>{let e=Zi(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let B=e[s+1],i=B>>>1^-(B&1);t.set(n,n+i)}return t},Lr=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}},Me=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Du("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-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBB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HBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new d(g("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static get Upper(){return this.CATEGORIES.get("Lu")}static SCRIPTS=new Lr({Adlam:()=>new d(g("go6DrCFJFB",!0)),Ahom:()=>new d(g("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new d(g("ggxCmS",!0)),Arabic:()=>new d(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new d(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new d(g("g4iC1BEG",!0)),Balinese:()=>new d(g("g4GsCCxB",!0)),Bamum:()=>new d(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new d(g("w26CdDF",!0)),Batak:()=>new d(g("g+GzBJD",!0)),Bengali:()=>new d(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new d(g("g17CYDY",!0)),Bhaiksuki:()=>new d(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new d(g("qXB6wLqBxDf",!0)),Brahmi:()=>new d(g("ggkCtCFjBKA",!0)),Braille:()=>new d(g("ggK-H",!0)),Buginese:()=>new d(g("gwGbDB",!0)),Buhid:()=>new d(g("g6FT",!0)),Canadian_Aboriginal:()=>new d(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new d(g("g1gCwB",!0)),Caucasian_Albanian:()=>new d(g("wphCzBMA",!0)),Chakma:()=>new d(g("gokC0BCR",!0)),Cham:()=>new d(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new d(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new d(g("w9jCb",!0)),Common:()=>new d(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new d(g("ifNxkKzDGG",!0)),Cuneiform:()=>new d(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new d(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new d(g("w8rCiD",!0)),Cyrillic:()=>new d(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new d(g("gghCvC",!0)),Devanagari:()=>new d(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new d(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new d(g("ggmC7B",!0)),Duployan:()=>new d(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new d(g("ggsC1iBL68D",!0)),Elbasan:()=>new d(g("gohCnB",!0)),Elymaic:()=>new d(g("g-jCW",!0)),Ethiopic:()=>new d(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new d(g("gqjClBEcJB",!0)),Georgian:()=>new d(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new d(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new d(g("w5gCa",!0)),Grantha:()=>new d(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new d(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new d(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new d(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new d(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new d(g("go4C5B",!0)),Han:()=>new d(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new d(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new d(g("gojCnBJJ",!0)),Hanunoo:()=>new d(g("g5FU",!0)),Hatran:()=>new d(g("gniCSCBGE",!0)),Hebrew:()=>new d(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new d(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new d(g("giiCVCI",!0)),Inherited:()=>new d(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new d(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new d(g("g6iCVDH",!0)),Javanese:()=>new d(g("gsqBtCDJFB",!0)),Kaithi:()=>new d(g("gkkCiCLA",!0)),Kannada:()=>new d(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new d(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new d(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new d(g("goqBtBCA",!0)),Kharoshthi:()=>new d(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new d(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new d(g("g8F9CDJHJnPf",!0)),Khojki:()=>new d(g("gwkCRCuB",!0)),Khudawadi:()=>new d(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new d(g("gq7C5B",!0)),Lao:()=>new d(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new d(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new d(g("ggH3BEOEC",!0)),Limbu:()=>new d(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new d(g("gwhC2JKVLH",!0)),Linear_B:()=>new d(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new d(g("wmpBvBx1eA",!0)),Lycian:()=>new d(g("g0gCc",!0)),Lydian:()=>new d(g("gpiCZGA",!0)),Mahajani:()=>new d(g("wqkCmB",!0)),Makasar:()=>new d(g("g3nCY",!0)),Malayalam:()=>new d(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new d(g("giCbDA",!0)),Manichaean:()=>new d(g("g2iCmBFL",!0)),Marchen:()=>new d(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new d(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new d(g("gy7C6C",!0)),Meetei_Mayek:()=>new d(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new d(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new d(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new d(g("gsiCf",!0)),Miao:()=>new d(g("g47CqCF4BIQ",!0)),Modi:()=>new d(g("gwlCkCMJ",!0)),Mongolian:()=>new d(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new d(g("gy6CeCJFB",!0)),Multani:()=>new d(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new d(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new d(g("gkiCeJI",!0)),Nag_Mundari:()=>new d(g("wm5DpB",!0)),Nandinagari:()=>new d(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new d(g("gsGrBFZHKEB",!0)),Newa:()=>new d(g("gglC7CCE",!0)),Nko:()=>new d(g("g+B6BDC",!0)),Nushu:()=>new d(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new d(g("go4DsBENDJFB",!0)),Ogham:()=>new d(g("g0Fc",!0)),Ol_Chiki:()=>new d(g("wiHvB",!0)),Ol_Onal:()=>new d(g("wu5DqBFA",!0)),Old_Hungarian:()=>new d(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new d(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new d(g("g0iCf",!0)),Old_Permic:()=>new d(g("w6gCqB",!0)),Old_Persian:()=>new d(g("g9gCjBFN",!0)),Old_Sogdian:()=>new d(g("g4jCnB",!0)),Old_South_Arabian:()=>new d(g("gziCf",!0)),Old_Turkic:()=>new d(g("ggjCoC",!0)),Old_Uyghur:()=>new d(g("w7jCZ",!0)),Oriya:()=>new d(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new d(g("wlhCjBFjB",!0)),Osmanya:()=>new d(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new d(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new d(g("gjiCf",!0)),Pau_Cin_Hau:()=>new d(g("g2mC4B",!0)),Phags_Pa:()=>new d(g("giqB3B",!0)),Phoenician:()=>new d(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new d(g("g8iCRIDNG",!0)),Rejang:()=>new d(g("wpqBjBMA",!0)),Runic:()=>new d(g("g1FqCEK",!0)),Samaritan:()=>new d(g("ggCtBDO",!0)),Saurashtra:()=>new d(g("gkqBlCJL",!0)),Sharada:()=>new d(g("gskC-ChsCH",!0)),Shavian:()=>new d(g("wihCvB",!0)),Siddham:()=>new d(g("gslC1BDlB",!0)),Sidetic:()=>new d(g("gqiCZ",!0)),SignWriting:()=>new d(g("gg2DrUQECO",!0)),Sinhala:()=>new d(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new d(g("w5jCpB",!0)),Sora_Sompeng:()=>new d(g("wmkCYIJ",!0)),Soyombo:()=>new d(g("wymCyC",!0)),Sundanese:()=>new d(g("g8G-BhIH",!0)),Sunuwar:()=>new d(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new d(g("ggqBsB",!0)),Syriac:()=>new d(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new d(g("g4FVKA",!0)),Tagbanwa:()=>new d(g("g7FMCCCB",!0)),Tai_Le:()=>new d(g("wqGdDE",!0)),Tai_Tham:()=>new d(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new d(g("g0qBiCZE",!0)),Tai_Yo:()=>new d(g("g25DeCVJB",!0)),Takri:()=>new d(g("g0lC5BHJ",!0)),Tamil:()=>new d(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new d(g("wz6CuCCJ",!0)),Tangut:()=>new d(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new d(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new d(g("g8BxB",!0)),Thai:()=>new d(g("hwD5BGb",!0)),Tibetan:()=>new d(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new d(g("wpL3BIBPA",!0)),Tirhuta:()=>new d(g("gklCnCJJ",!0)),Todhri:()=>new d(g("guhCzB",!0)),Tolong_Siki:()=>new d(g("wtnCrBFJ",!0)),Toto:()=>new d(g("w04De",!0)),Tulu_Tigalari:()=>new d(g("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new d(g("g8gCdCA",!0)),Unknown:()=>new d(g("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCB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EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new d(g("gopBrJ",!0)),Vithkuqi:()=>new d(g("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new d(g("g24D5BGA",!0)),Warang_Citi:()=>new d(g("glmCyCNA",!0)),Yezidi:()=>new d(g("g0jCpBCCDB",!0)),Yi:()=>new d(g("ggoBskBE2B",!0)),Zanabazar_Square:()=>new d(g("gwmCnC",!0))});static FOLD_CATEGORIES=new Lr({L:()=>new d(g("laA",!0)),LC:()=>new d(g("laA",!0)),Ll:()=>new d(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new d(g("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new d(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq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BjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new Lr({Common:()=>new d(g("8cgBgB",!1)),Greek:()=>new d(g("1FwUwU",!1)),Inherited:()=>new d(g("5cgBgBlgHAB",!1))})},J=class Re{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===Re.RUNE_ERROR||e>=Re.MIN_HIGH_SURROGATE&&e<=Re.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 B=n+Math.floor((s-n)/2),i=e.getLo(B),o=e.getHi(B);if(i<=t&&t<=o){let a=e.getStride(B);return(t-i)%a===0}t<i?s=B:n=B+1}return!1}static is(e,t){if(t<=Re.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 B=e.getStride(n);return(t-s)%B===0}return!1}return e.length>0&&t>=e.getLo(0)&&Re.is32(e,t)}static isUpper(e){if(e<=Re.MAX_LATIN1){let t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return Re.is(Me.Upper,e)}static isPrint(e){return e<=Re.MAX_LATIN1?e>=32&&e<Re.MAX_ASCII||e>=161&&e!==173:Re.is(Me.Print,e)}static simpleFold(e){if(Me.CASE_ORBIT.has(e))return Me.CASE_ORBIT.get(e);if(e<=Re.MAX_ASCII){let t=T.toLowerCase(e);return t!==e?t:T.toUpperCase(e)}return e}static equalsIgnoreCase(e,t){if(e===t)return!0;if(e<0||t<0)return!1;if(e<=Re.MAX_ASCII&&t<=Re.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let n=Re.simpleFold(e);n!==e;n=Re.simpleFold(n))if(n===t)return!0;return!1}},Ys=256,Xi=new Uint8Array(Ys);for(let r=0;r<Ys;r++)Xi[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var Hs=null,Ps=null,_=class He{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 T.CODES.get("0")<=e&&e<=T.CODES.get("9")||T.CODES.get("a")<=e&&e<=T.CODES.get("z")||T.CODES.get("A")<=e&&e<=T.CODES.get("Z")}static unhex(e){return T.CODES.get("0")<=e&&e<=T.CODES.get("9")?e-T.CODES.get("0"):T.CODES.get("a")<=e&&e<=T.CODES.get("f")?e-T.CODES.get("a")+10:T.CODES.get("A")<=e&&e<=T.CODES.get("F")?e-T.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(J.isPrint(e))He.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case T.CODES.get('"'):t+='\\"';break;case T.CODES.get("\\"):t+="\\\\";break;case T.CODES.get(" "):t+="\\t";break;case T.CODES.get(`
|
|
59
|
-
`):t+="\\n";break;case T.CODES.get("\r"):t+="\\r";break;case T.CODES.get("\b"):t+="\\b";break;case T.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 B=t.codePointAt(s);n.push(B),s+=B>J.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<Ys?Xi[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=He.EMPTY_BEGIN_TEXT|He.EMPTY_BEGIN_LINE),e===10&&(n|=He.EMPTY_BEGIN_LINE),t<0&&(n|=He.EMPTY_END_TEXT|He.EMPTY_END_LINE),t===10&&(n|=He.EMPTY_END_LINE),He.isWordRune(e)!==He.isWordRune(t)?n|=He.EMPTY_WORD_BOUNDARY:n|=He.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>He.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 Hs||(Hs=new TextEncoder),Hs.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let B=e.charCodeAt(s);B<128?t[n++]=B:B<2048?(t[n++]=B>>6|192,t[n++]=B&63|128):(B&64512)===J.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===J.MIN_LOW_SURROGATE?(B=J.MIN_SUPPLEMENTARY_CODE_POINT+((B&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=B>>18|240,t[n++]=B>>12&63|128,t[n++]=B>>6&63|128,t[n++]=B&63|128):(t[n++]=B>>12|224,t[n++]=B>>6&63|128,t[n++]=B&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){Ps||(Ps=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return Ps.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let B=e[n++];if(B<128)t[s++]=String.fromCharCode(B);else if(B>191&&B<224){let i=e[n++];t[s++]=String.fromCharCode((B&31)<<6|i&63)}else if(B>239&&B<365){let i=e[n++],o=e[n++],a=e[n++],c=((B&7)<<18|(i&63)<<12|(o&63)<<6|a&63)-J.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(J.MIN_HIGH_SURROGATE+(c>>10)),t[s++]=String.fromCharCode(J.MIN_LOW_SURROGATE+(c&1023))}else{let i=e[n++],o=e[n++];t[s++]=String.fromCharCode((B&15)<<12|(i&63)<<6|o&63)}}return t.join("")}}},eo=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],B=e+n;t[s]=B,t[B]=s}return Object.freeze(t)},jt=class js{static Encoding=eo(["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()===js.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===js.Encoding.UTF_16}},vi=class extends jt{constructor(r=null){super(),this.bytes=r}getEncoding(){return jt.Encoding.UTF_8}asCharSequence(){return _.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},bu=class extends jt{constructor(r=null){super(),this.charSequence=r}getEncoding(){return jt.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return _.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},Kt=class{static utf16(r){return new bu(r)}static utf8(r){return _.isByteArray(r)?new vi(r):new vi(_.stringToUtf8ByteArray(r))}},$e=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}},wu=class an extends $e{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 $e.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,B=128,i=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?B=160:t===237&&(i=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?B=144:t===244&&(i=143);else return an.RUNE_ERROR_STEP;if(e+n>this.end)return an.RUNE_ERROR_STEP;let o=this.bytes[e+1]&255;if(o<B||o>i)return an.RUNE_ERROR_STEP;if(s=s<<6|o&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return an.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let c=this.bytes[e+3]&255;if((c&192)!==128)return an.RUNE_ERROR_STEP;s=s<<6|c&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 B=e-4;for(B<this.start&&(B=this.start);s>=B&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let i=this.step(s-this.start);t=s+(i&7)===e?i>>3:J.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return _.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let B=t[0],i=this.end-s,o=typeof e.indexOf=="function",a=n;for(;a<=i;){if(o){if(a=e.indexOf(B,a),a===-1||a>i)return-1}else{for(;a<=i&&e[a]!==B;)a++;if(a>i)return-1}let c=!0;for(let u=1;u<s;u++)if(e[a+u]!==t[u]){c=!1;break}if(c)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},xu=class extends $e{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 $e.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 _.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},fe=class{static fromUTF8(r,e=0,t=r.length){return new wu(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new xu(r,e,t)}},Kn=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},he=class extends Kn{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}},_n=class extends Kn{constructor(r){super(r),this.name="RE2JSCompileException"}},Ge=class extends Kn{constructor(r){super(r),this.name="RE2JSGroupException"}},vu=class extends Kn{constructor(r){super(r),this.name="RE2JSFlagsException"}},Jn=class extends Kn{constructor(r){super(r),this.name="RE2JSInternalException"}},ki=class to{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===T.CODES.get("\\")||s===T.CODES.get("$")?`\\${n}`:n}).join(""):e.indexOf("$")<0?e:e.split("").map(n=>n.codePointAt(0)===T.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 jt?this.resetMatcherInput(t):_.isByteArray(t)?this.resetMatcherInput(Kt.utf8(t)):this.resetMatcherInput(Kt.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 jt||(_.isByteArray(e)?e=Kt.utf8(e):e=Kt.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 Ge(`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 Ge(`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 Ge(`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 Ge("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 Ge(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new Ge("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 Ge("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 Ge(`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()?fe.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):fe.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()?_.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(),B=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=B,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,B=0;for(;B<s;){let i=e.codePointAt(B);if(i===T.CODES.get("\\")){if(n<B&&(t+=e.substring(n,B)),B++,B>=s)throw new Ge("character to be escaped is missing");n=B,B++;continue}if(i===T.CODES.get("$")){if(n<B&&(t+=e.substring(n,B)),B+1>=s)throw new Ge("Illegal group reference: group index is missing");let o=e.codePointAt(B+1);if(T.CODES.get("0")<=o&&o<=T.CODES.get("9")){let a=o-T.CODES.get("0"),c=B+2;for(;c<s;c++){let l=e.codePointAt(c);if(l<T.CODES.get("0")||l>T.CODES.get("9")||a*10+l-T.CODES.get("0")>this.patternGroupCount)break;a=a*10+l-T.CODES.get("0")}if(a>this.patternGroupCount)throw new Ge(`n > number of groups: ${a}`);let u=this.group(a);u!==null&&(t+=u),B=c,n=B}else if(o===T.CODES.get("{")){let a=B+2;for(;a<s&&e.codePointAt(a)!==T.CODES.get("}");)a++;if(a>=s)throw new Ge("named capture group is missing trailing '}'");let c=e.substring(B+2,a),u=this.group(c);u!==null&&(t+=u),B=a+1,n=B}else throw new Ge("Illegal group reference");continue}B++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let B=0;B<s-1;B++)if(e.codePointAt(B)===T.CODES.get("$")){let i=e.codePointAt(B+1);if(T.CODES.get("$")===i){n<B&&(t+=e.substring(n,B)),t+="$",B++,n=B+1;continue}else if(T.CODES.get("&")===i){n<B&&(t+=e.substring(n,B));let o=this.group(0);o!==null?t+=o:t+="$&",B++,n=B+1;continue}else if(T.CODES.get("`")===i){n<B&&(t+=e.substring(n,B)),t+=this.substring(0,this.start(0)),B++,n=B+1;continue}else if(T.CODES.get("'")===i){n<B&&(t+=e.substring(n,B)),t+=this.substring(this.end(0),this.matcherInputLength),B++,n=B+1;continue}else if(T.CODES.get("1")<=i&&i<=T.CODES.get("9")){let o=i-T.CODES.get("0");for(n<B&&(t+=e.substring(n,B)),B+=2;B<s&&(i=e.codePointAt(B),!(i<T.CODES.get("0")||i>T.CODES.get("9")||o*10+i-T.CODES.get("0")>this.patternGroupCount));B++)o=o*10+i-T.CODES.get("0");if(o>this.patternGroupCount){t+=`$${o}`,n=B,B--;continue}let a=this.group(o);a!==null&&(t+=a),n=B,B--;continue}else if(i===T.CODES.get("<")){n<B&&(t+=e.substring(n,B)),B++;let o=B+1;for(;o<e.length&&e.codePointAt(o)!==T.CODES.get(">")&&e.codePointAt(o)!==T.CODES.get(" ");)o++;if(o===e.length||e.codePointAt(o)!==T.CODES.get(">")){t+=e.substring(B-1,o+1),n=o+1,B=o;continue}let a=e.substring(B+1,o);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let c=this.group(a);c!==null&&(t+=c)}else t+=`$<${a}>`;n=o+1,B=o;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 B=typeof e=="function",i=Object.keys(this.namedGroups).length>0,o=null;if(B){if(this.groupCount()>=to.MAX_REPLACER_ARGS)throw new Ge("Too many capture groups to safely invoke replacer function");o=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=B?this.appendReplacementFunc(e,i,o):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",B=this.start(),i=this.end();this.appendPos<B&&(s+=this.substring(this.appendPos,B)),this.appendPos=i;let o=this.buildReplacerArgs(B,t,n);return s+=String(e(...o)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],B=this.groupCount();for(let i=1;i<=B;i++){let o=this.start(i);o<0?s.push(void 0):s.push(this.substring(o,this.end(i)))}if(s.push(e),s.push(n),t){let i=this.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);s.push(i)}return s}},F=class xe{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 xe.RUNE<=e&&e<=xe.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=_.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 i=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?J.equalsIgnoreCase(i,e):e===i}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let i=0;i<t;i+=2){if(e<this.runes[i])return!1;if(e<=this.runes[i+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let i=s>>1;n+=this.runes[n+i<<1]<=e?i:0,s-=i}n+=this.runes[n<<1]<=e?1:0;let B=n-1;return B>=0&&e<=this.runes[B<<1|1]}matchRunePos(e){if(this.runes.length===1){let i=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?J.equalsIgnoreCase(i,e)?0:-1:e===i?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let i=0;i<t;i+=2){if(e<this.runes[i])return-1;if(e<=this.runes[i+1])return Math.floor(i/2)}return-1}let n=0,s=t>>1;for(;s>1;){let i=s>>1;n+=this.runes[n+i<<1]<=e?i:0,s-=i}n+=this.runes[n<<1]<=e?1:0;let B=n-1;return B>=0&&e<=this.runes[B<<1|1]?B:-1}toString(){switch(this.op){case xe.ALT:return`alt -> ${this.out}, ${this.arg}`;case xe.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case xe.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case xe.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case xe.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case xe.FAIL:return"fail";case xe.NOP:return`nop -> ${this.out}`;case xe.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case xe.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case xe.RUNE:return this.runes===null?"rune <null>":["rune ",xe.escapeRunes(this.runes),(this.arg&N.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case xe.RUNE1:return`rune1 ${xe.escapeRunes(this.runes)} -> ${this.out}`;case xe.RUNE_ANY:return`any -> ${this.out}`;case xe.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},Oi=class no{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,no.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}},ku=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}},ro=class so{static fromRE2(e){let t=new so;return t.prog=e.prog,t.re2=e,t.q0=new Oi(t.prog.numInst()),t.q1=new Oi(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?_.emptyInts():_.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let B=this.re2.cond;if(B===_.EMPTY_ALL||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let i=this.prog.numLb>0,o=t,a=t,c=!1;i&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,c=!0):a=0);let u=i&&s!==null,l=this.q0,C=this.q1,h=e.step(a),p=h>>3,f=h&7,w=-1,k=0;h!==$e.EOF()&&(h=e.step(a+f),w=h>>3,k=h&7);let E;for(a===0?E=_.emptyOpContext(-1,p):E=e.context(a),i&&(c?this.restoreLookbehinds(s,l,E):this.spawnLookbehinds(l,a,E));;){if(l.mainThreads===0){if((B&_.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&l.isEmpty()&&this.re2.prefix.length!==0&&w!==this.re2.prefixRune&&e.canCheckPrefix()){let I=e.index(this.re2,a);if(I<0)break;a+=I,h=e.step(a),p=h>>3,f=h&7,h=e.step(a+f),w=h>>3,k=h&7,E=e.context(a)}}a>=o&&(u&&(this.saveLookbehinds(s,l,a),u=!1),!this.matched&&(a===0||n===N.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(l,this.prog.start,a,this.matchcap,0,E)));let x=a+f;if(E=e.context(x),this.step(l,C,a,x,p,E,n,a===e.endPos()),f===0||this.ncap===0&&this.matched)break;a+=f,p=w,f=k,p!==-1&&(h=e.step(a+f),w=h>>3,k=h&7);let O=l;l=C,C=O}return l.clear(),C.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===_.EMPTY_ALL)return[];if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let B=this.prog.numLb>0?0:t,i=t,o=this.q0,a=this.q1,c=e.step(B),u=c>>3,l=c&7,C=-1,h=0;c!==$e.EOF()&&(c=e.step(B+l),C=c>>3,h=c&7);let p=B===0?_.emptyOpContext(-1,u):e.context(B),f=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(o,B,p);!(o.mainThreads===0&&((s&_.EMPTY_BEGIN_TEXT)!==0&&B!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&B!==0));){(B===0||n===N.UNANCHORED)&&B>=i&&this.add(o,this.prog.start,B,this.matchcap,0,p);let w=B+l;p=e.context(w);for(let E=0;E<o.size;E++){let x=o.densePcs[E],O=this.prog.inst[x],I=E*this.ncap,v=!1;switch(O.op){case F.MATCH:if(n===N.ANCHOR_BOTH&&B!==e.endPos())break;f.add(O.arg);break;case F.RUNE:v=O.matchRune(u);break;case F.RUNE1:v=u===O.runes[0];break;case F.RUNE_ANY:v=!0;break;case F.RUNE_ANY_NOT_NL:v=u!==10;break;default:continue}v&&this.add(a,O.out,w,o.denseCaps,I,p)}if(o.clear(),l===0)break;B+=l,u=C,l=h,u!==-1&&(c=e.step(B+l),C=c>>3,h=c&7);let k=o;o=a,a=k}return a.clear(),Array.from(f).sort((w,k)=>w-k)}step(e,t,n,s,B,i,o,a){let c=this.re2.longest;for(let u=0;u<e.size;u++){let l=e.densePcs[u],C=u*this.ncap;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[C])continue;let h=this.prog.inst[l],p=!1;switch(h.op){case F.MATCH:if(o===N.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!c||!this.matched||this.matchcap[1]<n)){e.denseCaps[C+1]=n;for(let f=0;f<this.ncap;f++)this.matchcap[f]=e.denseCaps[C+f]}c||(e.size=0),this.matched=!0;break;case F.RUNE:p=h.matchRune(B);break;case F.RUNE1:p=B===h.runes[0];break;case F.RUNE_ANY:p=!0;break;case F.RUNE_ANY_NOT_NL:p=B!==10;break;default:continue}p&&this.add(t,h.out,s,e.denseCaps,C,i)}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 B=0;B<t.size;B++){let i=t.densePcs[B];this.prog.lbInst[i]===1&&F.isRuneOp(this.prog.inst[i].op)&&(e.pcs[s++]=i)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,B,i){let o=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let u=e.add(t),l=this.prog.inst[t];switch(l.op){case F.FAIL:t=0;break;case F.ALT:case F.ALT_MATCH:o[a++]=l.arg,o[a++]=0,t=l.out;break;case F.EMPTY_WIDTH:t=(l.arg&~i)===0?l.out:0;break;case F.NOP:t=l.out;break;case F.CAPTURE:l.arg<this.ncap&&(o[a++]=-l.arg-1,o[a++]=s[B+l.arg],s[B+l.arg]=n),t=l.out;break;case F.LB_WRITE:this.lbTable[Math.abs(l.arg)]=n,t=l.out;break;case F.LB_CHECK:l.arg>0?t=this.lbTable[l.arg]===n?l.out:0:t=this.lbTable[-l.arg]!==n?l.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 C=u*this.ncap;C+this.ncap>e.denseCaps.length&&e.growCaps(C+this.ncap);for(let h=0;h<this.ncap;h++)e.denseCaps[C+h]=s[B+h]}t=0;break;default:throw new Jn("unhandled")}}if(a===0)return;a-=2;let c=o[a];c<0?(s[B-c-1]=o[a+1],t=0):t=c}}},Ou=(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},Si=(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},_s=[],Hn=-1,Su=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&Qs.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},Qs=class Pe{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,B)=>{e.add(s),e.add(B+1)};for(let s=0;s<this.prog.numInst();s++){let B=this.prog.getInst(s);switch(B.op){case F.RUNE:case F.RUNE1:if(B.runes.length===1){if(t(B.runes[0],B.runes[0]),(B.arg&N.FOLD_CASE)!==0)for(let i=J.simpleFold(B.runes[0]);i!==B.runes[0];i=J.simpleFold(i))t(i,i)}else for(let i=0;i<B.runes.length;i+=2)t(B.runes[i],B.runes[i+1]);break;case F.RUNE_ANY_NOT_NL:t(10,10);break;case F.EMPTY_WIDTH:(B.arg&(_.EMPTY_BEGIN_LINE|_.EMPTY_END_LINE))!==0&&t(10,10),(B.arg&(_.EMPTY_WORD_BOUNDARY|_.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 B=n+s>>1;t[B]<=e?n=B+1:s=B}return n}closure(e,t){let n=new Set,s=Array.from(e),B=0;for(;s.length>0;){let i=s.pop();if(i===0||n.has(i))continue;n.add(i);let o=this.prog.getInst(i);switch(o.op){case F.ALT:case F.ALT_MATCH:s.push(o.out),s.push(o.arg);break;case F.NOP:case F.CAPTURE:s.push(o.out);break;case F.EMPTY_WIDTH:B|=o.arg,(o.arg&~t)===0&&s.push(o.out)}}return{pcs:Int32Array.from(n).sort(),needflags:B}}getState(e,t,n){let s=Ou(e,t,n),B=this.stateCache.get(s);if(B)for(let a=0;a<B.length;a++){let c=B[a];if(c.flag===t&&Si(c.nfaStates,e)&&Si(c.matchIDs,n))return c}let i=Pe.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<i)return null;this.memBudget-=i,B||(B=[],this.stateCache.set(s,B));let o=new Su(e,t,n);return B.push(o),this.stateCount++,o}makeState(e,t,n){let s=this.closure(e,t&Pe.FLAG_EMPTY_MASK),B=t;return s.needflags===0&&(B&=Pe.FLAG_MATCH),B|=s.needflags<<Pe.FLAG_NEED_SHIFT,this.getState(s.pcs,B,n)}allocTable(e,t){let n=this.numClasses+1,s=Pe.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let B=new Array(n).fill(null);return t===N.UNANCHORED?e.next=B:e.nextAnchored=B,B}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 B=s===N.UNANCHORED?e.next:e.nextAnchored;if(B!==null){let E=B[t];if(E!==null)return E}else if(B=this.allocTable(e,s),B===null)return null;let i=e.flag>>>Pe.FLAG_NEED_SHIFT,o=e.flag&Pe.FLAG_EMPTY_MASK,a=o,c=0;n===10&&(a|=_.EMPTY_END_LINE,c|=_.EMPTY_BEGIN_LINE),n===Hn&&(a|=_.EMPTY_END_LINE|_.EMPTY_END_TEXT);let u=(e.flag&Pe.FLAG_LAST_WORD)!==0,l=n!==Hn&&_.isWordRune(n);a|=l===u?_.EMPTY_NO_WORD_BOUNDARY:_.EMPTY_WORD_BOUNDARY;let C=e.nfaStates;(a&~o&i)!==0&&(C=this.closure(C,a).pcs);let h=[],p=!1,f=_s;for(let E=0;E<C.length;E++){let x=this.prog.getInst(C[E]);x.op===F.MATCH?(p||(p=!0,f=[]),f.push(x.arg)):n!==Hn&&F.isRuneOp(x.op)&&x.matchRune(n)&&h.push(x.out)}f.length>1&&f.sort((E,x)=>E-x),s===N.UNANCHORED&&n!==Hn&&h.push(this.prog.start);let w=c;p&&(w|=Pe.FLAG_MATCH),l&&(w|=Pe.FLAG_LAST_WORD);let k=this.makeState(h,w,f);return k===null?null:(B[t]=k,k)}start(e,t){let n=e.context(t),s;if((n&_.EMPTY_BEGIN_TEXT)!==0)s=_.EMPTY_BEGIN_TEXT|_.EMPTY_BEGIN_LINE;else if((n&_.EMPTY_BEGIN_LINE)!==0)s=_.EMPTY_BEGIN_LINE;else{let i=e.step(t),o=i>=0&&_.isWordRune(i>>3);s=(n&_.EMPTY_WORD_BOUNDARY)!==0!==o?Pe.FLAG_LAST_WORD:0}let B=this.startStates.get(s);if(B===void 0){if(B=this.makeState([this.prog.start],s,_s),B===null&&(this.clearCache(),B=this.makeState([this.prog.start],s,_s),B===null))return null;this.startStates.set(s,B)}return B}stepOrReset(e,t,n,s,B,i){let o=this.step(e,t,n,s);if(o!==null)return o;if(i.resetPos>=0&&B-i.resetPos<Pe.PROGRESS_PER_STATE*this.stateCount)return null;i.resetPos=B;let a=this.resetCache(e);return a===null?null:(o=this.step(a,t,n,s),o)}run(e,t,n,s,B){let i=e.endPos(),o=this.latin1Class,a=n===N.UNANCHORED,c={resetPos:-1},u=t;for(;u<i;){let l=e.step(u),C=l>>3,h=l&7;if(h===0)break;let p=C<=J.MAX_LATIN1?o[C]:this.runeClass(C),f=a&&s.next!==null?s.next[p]:null;if(f===null&&(f=this.stepOrReset(s,p,C,n,u,c),f===null))return null;if(s=f,s.isMatch&&B(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;u+=h}return s=this.stepOrReset(s,this.numClasses,Hn,n,u,c),s===null?null:s.isMatch&&B(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,(B,i)=>n!==N.ANCHOR_BOTH||i)}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 B=new Set,i=(o,a)=>{if(n!==N.ANCHOR_BOTH||a)for(let c=0;c<o.matchIDs.length;c++)B.add(o.matchIDs[c]);return!1};return this.run(e,t,n,s,i)===null?null:Array.from(B).sort((o,a)=>o-a)}},Au=32,Ru=500,Js=256,Fu=262144,yu=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(Js),this.jobArg=new Uint8Array(Js),this.jobPos=new Int32Array(Js),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)+Au-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,B=new Int32Array(s);B.set(this.jobPc),this.jobPc=B;let i=new Uint8Array(s);i.set(this.jobArg),this.jobArg=i;let o=new Int32Array(s);o.set(this.jobPos),this.jobPos=o}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 B=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let i=this.jobPc[this.jobLen],o=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],c=!0;for(;!(!c&&!this.shouldVisit(i,a));){c=!1;let u=r.prog.getInst(i);switch(u.op){case F.FAIL:throw new Jn("unexpected InstFail");case F.ALT:if(o){o=!1,i=u.arg;continue}else{this.push(r,i,a,!0),i=u.out;continue}case F.ALT_MATCH:{let l=r.prog.getInst(u.out);if(F.isRuneOp(l.op)){this.push(r,u.arg,a,!1),i=u.arg,a=this.end;continue}this.push(r,u.out,this.end,!1),i=u.out;continue}case F.RUNE:{let l=e.step(a);if(l===$e.EOF()||!u.matchRune(l>>3))break;a+=l&7,i=u.out;continue}case F.RUNE1:{let l=e.step(a);if(l===$e.EOF()||l>>3!==u.runes[0])break;a+=l&7,i=u.out;continue}case F.RUNE_ANY_NOT_NL:{let l=e.step(a);if(l===$e.EOF()||l>>3===10)break;a+=l&7,i=u.out;continue}case F.RUNE_ANY:{let l=e.step(a);if(l===$e.EOF())break;a+=l&7,i=u.out;continue}case F.CAPTURE:if(o){this.cap[u.arg]=a;break}else{u.arg<this.ncap&&(this.push(r,i,this.cap[u.arg],!0),this.cap[u.arg]=a),i=u.out;continue}case F.EMPTY_WIDTH:{let l=e.context(a);if((u.arg&~l)!==0)break;i=u.out;continue}case F.NOP:i=u.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 l=this.matchcap[1];if((l===-1||B&&a>0&&a>l)&&this.matchcap.set(this.cap),!B||a===this.end)return!0;break}case F.LB_WRITE:case F.LB_CHECK:throw new Jn("Backtracker cannot evaluate Lookbehind instructions");default:throw new Jn("bad inst")}break}}return B&&this.matchcap.length>1&&this.matchcap[1]>=0}},Nr=[],$r=class Bo{static shouldBacktrack(e){return e.numInst()<=Ru}static maxBitStateLen(e){return Bo.shouldBacktrack(e)?Math.floor(Fu/e.numInst()):0}static execute(e,t,n,s,B){let i=e.cond;if(i===_.EMPTY_ALL||(s===N.ANCHOR_START||s===N.ANCHOR_BOTH)&&n!==0||(i&_.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let o=Nr.length>0?Nr.pop():new yu,a=t.endPos();o.reset(e.prog,a,B);let c=!1;if((i&_.EMPTY_BEGIN_TEXT)!==0||s===N.ANCHOR_START||s===N.ANCHOR_BOTH)o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)&&(c=!0);else{let l=-1;for(;n<=a&&l!==0;n+=l){if(e.prefix.length>0){let h=t.index(e,n);if(h<0)break;n+=h}if(o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)){c=!0;break}let C=t.step(n);l=C===$e.EOF()?0:C&7}}if(!c)return Nr.push(o),null;let u=B===0?[]:_.toArray(o.matchcap.subarray(0,B));return Nr.push(o),u}},Ai=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++)}},Iu=(r,e,t,n)=>{let s=r.length,B=e.length,i=0,o=0,a=[],c=[],u=!0,l=-1,C=h=>{let p=h?r:e,f=h?i:o,w=h?t:n;return l>0&&p[f]<=a[l]?!1:(a.push(p[f],p[f+1]),h?i+=2:o+=2,l+=2,c.push(w),!0)};for(;i<s||o<B;)if(o>=B?u=C(!0):i>=s||e[o]<r[i]?u=C(!1):u=C(!0),!u)return null;return{merged:a,next:c}},Tu=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}}},Lu=r=>{let e=new Tu(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",B="arg",i=e.inst[n[B]];if(i.op!==F.ALT&&i.op!==F.ALT_MATCH&&(s="arg",B="out",i=e.inst[n[B]],i.op!==F.ALT&&i.op!==F.ALT_MATCH))continue;let o=e.inst[n[s]];if(o.op===F.ALT||o.op===F.ALT_MATCH)continue;let a="out",c="arg",u=!1;i.out===t?u=!0:i.arg===t&&(u=!0,a="arg",c="out"),u&&(i[a]=n[s]),n[s]===i[a]&&(n[B]=i[c])}return e},Nu=r=>{if(r.inst.length>=1e3)return null;let e=new Ai(r.inst.length),t=new Ai(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),B=i=>{let o=!0,a=r.inst[i];if(t.contains(i))return!0;switch(t.insert(i),a.op){case F.ALT:case F.ALT_MATCH:{o=B(a.out)&&B(a.arg);let c=s[a.out],u=s[a.arg];if(c&&u)return!1;if(u){let p=a.out;a.out=a.arg,a.arg=p;let f=c;c=u,u=f}c&&(s[i]=!0,a.op=F.ALT_MATCH);let l=n[a.out]||[],C=n[a.arg]||[],h=Iu(l,C,a.out,a.arg);if(!h)return!1;n[i]=new Int32Array(h.merged),a.next=new Uint32Array(h.next);break}case F.CAPTURE:case F.EMPTY_WIDTH:case F.NOP:o=B(a.out),s[i]=s[a.out],n[i]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[i].length/2)+1).fill(a.out);break;case F.MATCH:case F.FAIL:s[i]=a.op===F.MATCH;break;case F.RUNE:{if(s[i]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[i]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let c=[];if(a.runes.length===1&&(a.arg&N.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=J.simpleFold(u);l!==u;l=J.simpleFold(l))c.push(l,l);c.sort((l,C)=>l-C)}else for(let u=0;u<a.runes.length;u++)c.push(a.runes[u]);n[i]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=F.RUNE;break}case F.RUNE1:{if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let c=[];if((a.arg&N.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=J.simpleFold(u);l!==u;l=J.simpleFold(l))c.push(l,l);c.sort((l,C)=>l-C)}else c.push(a.runes[0],a.runes[0]);n[i]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=F.RUNE;break}case F.RUNE_ANY:if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[i]=new Int32Array([0,J.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case F.RUNE_ANY_NOT_NL:if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[i]=new Int32Array([0,9,11,J.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[i].length/2)+1).fill(a.out)}return o};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!B(e.next()))return null;for(let i=0;i<r.inst.length;i++)n[i]&&(r.inst[i].runes=n[i]);return r},$u=(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)}}},Ri=class io{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&_.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let B=0;B<e.inst.length;B++)if(e.inst[B].op===F.ALT||e.inst[B].op===F.ALT_MATCH){n=!0;break}for(let B=0;B<e.inst.length;B++){let i=e.inst[B],o=e.inst[i.out].op;switch(i.op){case F.ALT:case F.ALT_MATCH:if(o===F.MATCH||e.inst[i.arg].op===F.MATCH)return null;break;case F.EMPTY_WIDTH:if(o===F.MATCH){if((i.arg&_.EMPTY_END_TEXT)===_.EMPTY_END_TEXT)continue;return null}break;default:if(o===F.MATCH&&n)return null}}let s=Lu(e);return s=Nu(s),s!==null&&$u(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,B){let i=e.onepass;if(!i)return null;let o=new Int32Array(B).fill(-1),a=!1,c=t.step(n),u=c>>3,l=c&7,C=$e.EOF(),h=-1,p=0;c!==$e.EOF()&&(C=t.step(n+l),C!==$e.EOF()&&(h=C>>3,p=C&7));let f=n===0?_.emptyOpContext(-1,u):t.context(n),w=i.start,k;for(;;){switch(k=i.inst[w],w=k.out,k.op){case F.MATCH:return s===N.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,o.length>0&&(o[0]=0,o[1]=n),B===0?[]:_.toArray(o));case F.RUNE:if(!k.matchRune(u))return null;break;case F.RUNE1:if(u!==k.runes[0])return null;break;case F.RUNE_ANY:break;case F.RUNE_ANY_NOT_NL:if(u===10)return null;break;case F.ALT:case F.ALT_MATCH:w=io.next(k,u);continue;case F.FAIL:return null;case F.NOP:continue;case F.EMPTY_WIDTH:if((k.arg&~f)!==0)return null;continue;case F.CAPTURE:k.arg<o.length&&(o[k.arg]=n);continue;default:throw new Jn("bad inst")}if(l===0)break;f=_.emptyOpContext(u,h),n+=l,u=h,l=p,u!==-1&&(C=t.step(n+l),C!==$e.EOF()?(h=C>>3,p=C&7):(h=-1,p=0))}return a?B===0?[]:_.toArray(o):null}},D=class V{static Op=eo(["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>=V.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===T.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new V(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=V.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=V.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 V.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case V.Op.EMPTY_MATCH:e+="(?:)";break;case V.Op.STAR:case V.Op.PLUS:case V.Op.QUEST:case V.Op.REPEAT:{let t=this.subs[0];switch(t.op>V.Op.CAPTURE||t.op===V.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case V.Op.STAR:e+="*";break;case V.Op.PLUS:e+="+";break;case V.Op.QUEST:e+="?";break;case V.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 V.Op.CONCAT:for(let t of this.subs)t.op===V.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case V.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case V.Op.LITERAL:(this.flags&N.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=_.escapeRune(t);(this.flags&N.FOLD_CASE)!==0&&(e+=")");break;case V.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case V.Op.ANY_CHAR:e+="(?s:.)";break;case V.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case V.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case V.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==V.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case V.Op.BEGIN_TEXT:e+="\\A";break;case V.Op.END_TEXT:(this.flags&N.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case V.Op.BEGIN_LINE:e+="^";break;case V.Op.END_LINE:e+="$";break;case V.Op.WORD_BOUNDARY:e+="\\b";break;case V.Op.NO_WORD_BOUNDARY:e+="\\B";break;case V.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+=V.quoteIfHyphen(n),e+=_.escapeRune(n),n!==s&&(e+="-",e+=V.quoteIfHyphen(s),e+=_.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=V.quoteIfHyphen(n),e+=_.escapeRune(n),n!==s&&(e+="-",e+=V.quoteIfHyphen(s),e+=_.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===V.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 V)||this.op!==e.op)return!1;switch(this.op){case V.Op.END_TEXT:if((this.flags&N.WAS_DOLLAR)!==(e.flags&N.WAS_DOLLAR))return!1;break;case V.Op.LITERAL:case V.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 V.Op.ALTERNATE:case V.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 V.Op.STAR:case V.Op.PLUS:case V.Op.QUEST:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case V.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 V.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 V.Op.PLB:case V.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},qs=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let B=e.enter(n);if(B.result===void 0){t.push({re:n,state:B,i:0}),n=n.subs[0];continue}s=B.result}for(;;){if(t.length===0)return s;let B=t[t.length-1];if(e.child(B.re,B.state,s,B.i),B.i++,B.state.result===void 0&&B.i<B.re.subs.length){n=B.re.subs[B.i];break}t.pop(),s=B.state.result!==void 0?B.state.result:e.leave(B.re,B.state)}}}},Fi=class{constructor(r,e){let t=new Map,n=[0],s=[0],B=[0],i=[0];for(let p of r){let f=0;for(let w=0;w<p.length;w++){let k=f*e+p[w],E=t.get(k);E===void 0&&(E=n.length,t.set(k,E),n.push(f),s.push(p[w]),B.push(B[f]+1),i.push(0)),f=E}i[f]=1}let o=n.length,a=new Int32Array(o-1);for(let p=1;p<o;p++)a[p-1]=p;a.sort((p,f)=>n[p]-n[f]||s[p]-s[f]);let c=new Int32Array(o+1);for(let p=1;p<o;p++)c[n[p]+1]++;for(let p=0;p<o;p++)c[p+1]+=c[p];let u=new Int32Array(o-1);for(let p=0;p<a.length;p++)u[p]=s[a[p]];this.childStart=c,this.childUnit=u,this.childNode=a;let l=new Int32Array(o);for(let p=0;p<o;p++)l[p]=p;l.sort((p,f)=>B[p]-B[f]);let C=new Int32Array(o),h=Uint8Array.from(i);for(let p=1;p<o;p++){let f=l[p],w=n[f];if(w!==0){let k=C[w],E=this.next(k,s[f]);for(;E<0&&k!==0;)k=C[k],E=this.next(k,s[f]);C[f]=E>=0?E:0}h[f]|=h[C[f]]}this.fail=C,this.match=h}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let B=t+n>>1,i=s[B];if(i===e)return this.childNode[B];i<e?t=B+1:n=B}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}},Be=class ln{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===ln.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 Fi(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new Fi(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case ln.Type.NONE:return!0;case ln.Type.EXACT:return e.hasString(this,t);case ln.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case ln.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}}},Gu=class un{static build(e){return e?qs.walk(e,un.WALKER):new Be(Be.Type.NONE)}static WALKER={leaf:e=>un.leaf(e),enter:e=>un.enter(e),child:(e,t,n)=>un.child(e,t,n),leave:(e,t)=>un.leave(e,t)};static leaf(e){if(e.op!==D.Op.LITERAL)return new Be(Be.Type.NONE);if(e.runes.length===0||(e.flags&N.FOLD_CASE)!==0)return new Be(Be.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(J.isUnsearchable(e.runes[s]))return new Be(Be.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new Be(Be.Type.EXACT);return n.str=t,n.bytes=_.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case D.Op.CAPTURE:case D.Op.PLUS:return{sub:null};case D.Op.REPEAT:return e.min>=1?{sub:null}:{result:new Be(Be.Type.NONE)};case D.Op.CONCAT:return{pf:new Be(Be.Type.AND),subs:[]};case D.Op.ALTERNATE:return{pf:new Be(Be.Type.OR),subs:[]};default:return{result:new Be(Be.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===Be.Type.AND){if(n.type===Be.Type.NONE)return;if(n.type===Be.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===Be.Type.NONE){t.result=new Be(Be.Type.NONE);return}if(n.type===Be.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,B=[];for(let c of t.subs){if(c.type===Be.Type.EXACT){if(s.has(c.str))continue;s.add(c.str)}B.push(c)}if(n.type===Be.Type.AND){let c=[],u=0;for(let l of B)u+l.cost>Be.MAX_SCANS||(c.push(l),u+=l.cost);return c.length===0?new Be(Be.Type.NONE):c.length===1?c[0]:(n.subs=c,n.cost=u,n)}if(B.length===0)return new Be(Be.Type.NONE);if(B.length===1)return B[0];n.subs=B;let i=!0,o=0,a=0;for(let c of B)c.type!==Be.Type.EXACT?i=!1:a+=c.bytes.length,o+=c.cost;return i?a>Be.MAX_AC_UNITS?new Be(Be.Type.NONE):(n.allExact=!0,n.cost=1,n):o>Be.MAX_SCANS?new Be(Be.Type.NONE):(n.cost=o,n)}},Ke=class{constructor(r=0,e=0){this.head=r,this.tail=e}},Mu=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 Ke(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+=`
|
|
60
|
-
`}return r}},
|
|
61
|
-
`)-1,
|
|
62
|
-
`)+1,J.MAX_RUNE]),
|
|
63
|
-
`)-1&&e[2]===
|
|
64
|
-
`)+1&&e[3]===J.MAX_RUNE&&(s.op=
|
|
65
|
-
`)-1&&e.runes[2]===
|
|
66
|
-
`)+1&&e.runes[3]===J.MAX_RUNE)return new D(D.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case D.Op.PLB:case D.Op.NLB:case D.Op.CAPTURE:case D.Op.STAR:case D.Op.PLUS:case D.Op.QUEST:return{sub:null};case D.Op.CONCAT:case D.Op.ALTERNATE:return{subs:[],changed:!1};case D.Op.REPEAT:return e.min===0&&e.max===0?{result:new D(D.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===D.Op.CONCAT){if(n.op===D.Op.NO_MATCH){t.result=new D(D.Op.NO_MATCH);return}if(n.op===D.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===D.Op.CONCAT){t.changed=!0;for(let B=0;B<n.subs.length;B++)t.subs.push(n.subs[B]);return}}else{if(n.op===D.Op.NO_MATCH){t.changed=!0;return}if(n.op===D.Op.ALTERNATE){t.changed=!0;for(let B=0;B<n.subs.length;B++)t.subs.push(n.subs[B]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case D.Op.PLB:case D.Op.NLB:case D.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=D.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case D.Op.CONCAT:case D.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new D(e.op===D.Op.CONCAT?D.Op.EMPTY_MATCH:D.Op.NO_MATCH);if(n.length===1)return n[0];let s=D.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case D.Op.STAR:case D.Op.PLUS:case D.Op.QUEST:return Fe.simplify1(e.op,e.flags,t.sub,e);case D.Op.REPEAT:return Fe.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return Fe.simplify1(D.Op.STAR,e.flags,t,null);if(e.min===1)return Fe.simplify1(D.Op.PLUS,e.flags,t,null);let s=[];for(let B=0;B<e.min-1;B++)s.push(t);return s.push(Fe.simplify1(D.Op.PLUS,e.flags,t,null)),Fe.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=Fe.simplify1(D.Op.QUEST,e.flags,t,null);for(let B=e.min+1;B<e.max;B++)s=Fe.simplify1(D.Op.QUEST,e.flags,Fe.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?Fe.concat(n):new D(D.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let B=e[s];if(B.op===D.Op.NO_MATCH)return new D(D.Op.NO_MATCH);if(B.op!==D.Op.EMPTY_MATCH){if(B.op===D.Op.CONCAT){for(let i=0;i<B.subs.length;i++)t.push(B.subs[i]);continue}t.push(B)}}if(t.length===0)return new D(D.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new D(D.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===D.Op.EMPTY_MATCH)return n;if(n.op===D.Op.NO_MATCH)return e===D.Op.PLUS?n:new D(D.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 B=new D(e);return B.flags=t,B.subs=[n],B}},le=class{constructor(r,e){this.sign=r,this.cls=e}},Ii=[48,57],Ti=[9,10,12,13,32,32],Li=[48,57,65,90,95,95,97,122],Ni=new Map([["\\d",new le(1,Ii)],["\\D",new le(-1,Ii)],["\\s",new le(1,Ti)],["\\S",new le(-1,Ti)],["\\w",new le(1,Li)],["\\W",new le(-1,Li)]]),$i=[48,57,65,90,97,122],Gi=[65,90,97,122],Mi=[0,127],Hi=[9,9,32,32],Pi=[0,31,127,127],_i=[48,57],Ji=[33,126],Ui=[97,122],Ki=[32,126],ji=[33,47,58,64,91,96,123,126],zi=[9,13,32,32],Yi=[65,90],Qi=[48,57,65,90,95,95,97,122],qi=[48,57,65,70,97,102],Wi=new Map([["[:alnum:]",new le(1,$i)],["[:^alnum:]",new le(-1,$i)],["[:alpha:]",new le(1,Gi)],["[:^alpha:]",new le(-1,Gi)],["[:ascii:]",new le(1,Mi)],["[:^ascii:]",new le(-1,Mi)],["[:blank:]",new le(1,Hi)],["[:^blank:]",new le(-1,Hi)],["[:cntrl:]",new le(1,Pi)],["[:^cntrl:]",new le(-1,Pi)],["[:digit:]",new le(1,_i)],["[:^digit:]",new le(-1,_i)],["[:graph:]",new le(1,Ji)],["[:^graph:]",new le(-1,Ji)],["[:lower:]",new le(1,Ui)],["[:^lower:]",new le(-1,Ui)],["[:print:]",new le(1,Ki)],["[:^print:]",new le(-1,Ki)],["[:punct:]",new le(1,ji)],["[:^punct:]",new le(-1,ji)],["[:space:]",new le(1,zi)],["[:^space:]",new le(-1,zi)],["[:upper:]",new le(1,Yi)],["[:^upper:]",new le(-1,Yi)],["[:word:]",new le(1,Qi)],["[:^word:]",new le(-1,Qi)],["[:xdigit:]",new le(1,qi)],["[:^xdigit:]",new le(-1,qi)]]),_t=class Mr{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let B=e[s],i=e[s+1];B===i?n+=`0x${B.toString(16)}`:n+=`0x${B.toString(16)}-0x${i.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let i=0;i<n;i++)s[i]=i;s.sort((i,o)=>e[2*i]-e[2*o]||e[2*o+1]-e[2*i+1]);let B=e.slice(0,t);for(let i=0;i<n;i++)e[2*i]=B[2*s[i]],e[2*i+1]=B[2*s[i]+1]}constructor(e=_.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;Mr.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],B=this.r[this.len-n+1];if(e<=B+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>B&&(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],B=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=B+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),B=e.getStride(t);if(B===1){this.appendRange(n,s);continue}for(let i=n;i<=s;i+=B)this.appendRange(i,i)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),B=e.getHi(n),i=e.getStride(n);if(i===1){t<=s-1&&this.appendRange(t,s-1),t=B+1;continue}for(let o=s;o<=B;o+=i)t<=o-1&&this.appendRange(t,o-1),t=o+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],B=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=B+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 Mr().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return Mr.charClassToString(this.r,this.len)}},Pu=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+=_.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()}},Pn=class Y{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 d(new Uint32Array([0,J.MAX_RUNE,1]));static ASCII_TABLE=new d(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new d(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:Y.ANY_TABLE,fold:Y.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Y.ASCII_TABLE,fold:Y.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:Me.CATEGORIES.get("Cn"),fold:Me.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:Me.CATEGORIES.get("LC"),fold:Me.FOLD_CATEGORIES.get("LC"),sign:1}:Me.CATEGORIES.has(e)?{tab:Me.CATEGORIES.get(e),fold:Me.FOLD_CATEGORIES.get(e),sign:1}:Me.SCRIPTS.has(e)?{tab:Me.SCRIPTS.get(e),fold:Me.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===D.Op.EMPTY_MATCH)return null;if(e.op===D.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===D.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new D(D.Op.LITERAL);return n.flags=t,n.runes=_.stringToRunes(e),n}static parse(e,t){return new Y(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=Y.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=Y.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 he(Y.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!==T.CODES.get("_")&&!_.isalnum(n))return!1}return!0}static parseInt(e){let t=e.pos();for(;e.more()&&e.peek()>=T.CODES.get("0")&&e.peek()<=T.CODES.get("9");)e.skip(1);let n=e.from(t);return n.length===0||n.length>1&&n.codePointAt(0)===T.CODES.get("0")?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===D.Op.LITERAL&&e.runes.length===1||e.op===D.Op.CHAR_CLASS||e.op===D.Op.ANY_CHAR_NOT_NL||e.op===D.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case D.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case D.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 D.Op.ANY_CHAR_NOT_NL:return t!==T.CODES.get(`
|
|
67
|
-
`);case D.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case D.Op.ANY_CHAR:break;case D.Op.ANY_CHAR_NOT_NL:Y.matchRune(t,
|
|
68
|
-
`))&&(e.op=D.Op.ANY_CHAR);break;case D.Op.CHAR_CLASS:{let n=new
|
|
69
|
-
`);case
|
|
70
|
-
`)-1&&e.runes[2]===
|
|
71
|
-
`)+1&&e.runes[3]===J.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=D.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let n=0;for(let o of e)n+=o.op===t?o.subs.length:1;let s=new Array(n).fill(null),B=0;for(let o of e)if(o.op===t){for(let a=0;a<o.subs.length;a++)s[B++]=o.subs[a];this.reuse(o)}else s[B++]=o;let i=this.newRegexp(t);if(i.subs=s,t===D.Op.ALTERNATE&&(i.subs=this.factor(i.subs),i.subs.length===1)){let o=i;i=i.subs[0],this.reuse(o)}return i}factor(e){if(e.length<2)return e;let t=0,n=e.length,s=0,B=null,i=0,o=0,a=0;for(let u=0;u<=n;u++){let l=null,
|
|
72
|
-
`),
|
|
73
|
-
`)));let i=!0;for(;!e.more()||e.peek()!==T.CODES.get("]")||i;){if(e.more()&&e.lookingAt("-")&&(this.flags&N.PERL_X)===0&&!i){let u=e.rest();if(u==="-"||!u.startsWith("-]"))throw e.rewindTo(t),new he(Y.ERR_INVALID_CHAR_RANGE,e.rest())}i=!1;let o=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(o)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(o);let a=Y.parseClassChar(e,t),c=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(c=Y.parseClassChar(e,t),c<a)throw new he(Y.ERR_INVALID_CHAR_RANGE,e.from(o))}(this.flags&N.FOLD_CASE)===0?s.appendRange(a,c):s.appendFoldedRange(a,c)}e.skip(1),s.cleanClass(),B<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},_u=class Ut{static initTest(e){let t=Ut.compile(e),n=new Ut(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 Ut.compileImpl(e,N.PERL,!1)}static compilePOSIX(e){return Ut.compileImpl(e,N.POSIX,!0)}static compileImpl(e,t,n){let s=Pn.parse(e,t),B=s.maxCap(),i=s.namedGroups;s=ao.simplify(s);let o=Gu.build(s),a=oo.compileRegexp(s),c=new Ut(e,a,B,n);c.prefilter=o.type===Be.Type.NONE?null:o;let[u,l]=a.prefix();return c.prefixComplete=u,c.prefix=l,c.prefixUTF8=_.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=i,c}static match(e,t){return Ut.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 Qs(this.prog),this.onepass=Ri.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 B=-1,i=-1,o=e.prefixLength(this);if(n===N.UNANCHORED){let a=e.index(this,t);if(a<0)return null;B=t+a,i=B+o}else if(n===N.ANCHOR_BOTH){if(e.endPos()!==o||e.index(this,0)!==0)return null;B=0,i=o}else if(n===N.ANCHOR_START){if(e.index(this,0)!==0)return null;B=0,i=o}if(B<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=B,a[1]=i,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new ku(this.prog):null}executeEngine(e,t,n,s,B=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 Ri.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=$r.maxBitStateLen(this.prog)?$r.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,B);if(this.prog.numLb===0){let i=this.dfa.match(e,t,n);if(i!==null)return i?[]:null;if(e.endPos()<=$r.maxBitStateLen(this.prog))return $r.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,B)}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,B=null){let i=this.get();i||(i=ro.fromRE2(this)),i.init(s);let o=i.match(e,t,n,B)?i.submatches():null;return this.put(i),o}match(e){return this.executeEngine(fe.fromUTF16(e),0,N.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,B,i=null){return e instanceof jt||(_.isByteArray(e)?e=Kt.utf8(e):e=Kt.utf16(e)),this.matchMachineInput(e,t,n,s,B,i)}matchMachineInput(e,t,n,s,B,i=null){if(t>n)return[!1,null];let o=e.isUTF16Encoding()?fe.fromUTF16(e.asCharSequence(),0,n):fe.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(o,t,s,2*B,i);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(fe.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,B=0,i="",o=fe.fromUTF16(e),a=this.createLookbehindState(),c=0;for(;B<=e.length;){let u=this.executeEngine(o,B,N.UNANCHORED,2,a);if(u===null||u.length===0)break;i+=e.substring(s,u[0]),(u[1]>s||u[0]===0)&&(i+=t(e.substring(u[0],u[1])),c++),s=u[1];let l=o.step(B)&7;if(B+l>u[1]?B+=l:B+1>u[1]?B++:B=u[1],c>=n)break}return i+=e.substring(s),i}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=[],B=e.endPos();t<0&&(t=B+1);let i=0,o=0,a=-1,c=this.createLookbehindState();for(;o<t&&i<=B;){let u=this.executeEngine(e,i,N.UNANCHORED,this.prog.numCap,c);if(u===null||u.length===0)break;let l=!0;if(u[1]===i){u[0]===a&&(l=!1);let C=e.step(i);C<0?i=B+1:i+=C&7}else i=u[1];a=u[1],l&&(s.push(n(this.pad(u))),o++)}return s}findUTF8(e){let t=this.executeEngine(fe.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(fe.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(fe.fromUTF16(e),0,N.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(fe.fromUTF16(e),0,N.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(fe.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(fe.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(fe.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(fe.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(fe.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(fe.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(fe.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(fe.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(fe.fromUTF8(e),t,s=>{let B=new Array(s.length/2|0).fill(null);for(let i=0;i<B.length;i++)s[2*i]>=0&&(B[i]=e.slice(s[2*i],s[2*i+1]));return B});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(fe.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(fe.fromUTF16(e),t,s=>{let B=new Array(s.length/2|0).fill(null);for(let i=0;i<B.length;i++)s[2*i]>=0&&(B[i]=e.substring(s[2*i],s[2*i+1]));return B});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(fe.fromUTF16(e),t);return n.length===0?null:n}},th=class Hr{static UNANCHORED=N.UNANCHORED;static ANCHOR_START=N.ANCHOR_START;static ANCHOR_BOTH=N.ANCHOR_BOTH;constructor(e=Hr.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=N.PERL;(t&Ve.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&Ve.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 _n("Cannot add patterns after compile");let t=e;(this.jsFlags&Ve.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&Ve.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&Ve.MULTILINE)!==0&&(t=`(?m)${t}`);let n=Pn.parse(t,this.re2Flags);return this.regexps.push(ao.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=oo.compileSet(this.regexps);if(e.numInst()>Pn.MAX_SIZE)throw new _n(`${Pn.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${Pn.MAX_SIZE}`);this.prog=e,this.dfa=new Qs(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=_.isByteArray(e)?fe.fromUTF8(e):fe.fromUTF16(e),n=N.UNANCHORED;this.anchor===Hr.ANCHOR_START?n=N.ANCHOR_START:this.anchor===Hr.ANCHOR_BOTH&&(n=N.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let B=ro.fromRE2(this.dummyRe2);return B.init(0),B.matchSet(t,0,n)}},Ju=class cn{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,B=e.length;B===0&&(n="(?:)",s=!0);let i=!1,o=0;for(;o<B;){let c=e[o];if(c==="\\"){if(o+1<B)switch(c=e[o+1],c){case"\\":n+="\\\\",o+=2;continue;case"c":if(o+2<B){let C=e[o+2].charCodeAt(0);if(C>=65&&C<=90||C>=97&&C<=122){let h=C%32;n+="\\x",n+=(h>>4).toString(16).toUpperCase(),n+=(h&15).toString(16).toUpperCase(),o+=3,s=!0;continue}}n+="c",o+=2,s=!0;continue;case"u":if(o+2<B){if(e[o+2]==="{"){let C=o+3,h=!1,p=!1;for(;C<B;){let f=e[C];if(f==="}"){p=!0;break}if(!cn.isHexadecimal(f))break;h=!0,C++}if(p&&h){n+="\\x",o+=2,s=!0;continue}}else if(o+5<B){let C=!0;for(let h=0;h<4;h++)if(!cn.isHexadecimal(e[o+2+h])){C=!1;break}if(C){n+="\\x{"+e.substring(o+2,o+6)+"}",o+=6,s=!0;continue}}}n+="u",o+=2,s=!0;continue;case"x":{let C=!1;if(o+2<B&&e[o+2]==="{"){let h=o+3,p=!1,f=!1;for(;h<B;){let w=e[h];if(w==="}"){f=!0;break}if(!cn.isHexadecimal(w))break;p=!0,h++}f&&p&&(C=!0)}else o+3<B&&cn.isHexadecimal(e[o+2])&&cn.isHexadecimal(e[o+3])&&(C=!0);C?(n+="\\x",o+=2):(n+="x",o+=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+="\\"+c,o+=2;continue;default:{let C=e.codePointAt(o+1);if(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122){let h=_.charCount(C);n+=e.substring(o+1,o+1+h),o+=h+1,s=!0}else{n+="\\";let h=_.charCount(C);n+=e.substring(o+1,o+1+h),o+=h+1}continue}}}else if(c==="/"){n+="\\/",o+=1,s=!0;continue}else if(c==="[")i=!0;else if(c==="]")i=!1;else if(!i&&c==="("&&o+2<B&&e[o+1]==="?"&&e[o+2]==="<"&&o+3<B&&!"=!>)".includes(e[o+3])){n+="(?P<",o+=3,s=!0;continue}let u=e.codePointAt(o),l=_.charCount(u);n+=e.substring(o,o+l),o+=l}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},Cn=class ye{static CASE_INSENSITIVE=Ve.CASE_INSENSITIVE;static DOTALL=Ve.DOTALL;static MULTILINE=Ve.MULTILINE;static DISABLE_UNICODE_GROUPS=Ve.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=Ve.LONGEST_MATCH;static LOOKBEHINDS=Ve.LOOKBEHINDS;static quote(e){return _.quoteMeta(e)}static quoteReplacement(e,t=!1){return ki.quoteReplacement(e,t)}static translateRegExp(e){return Ju.translate(e)}static compile(e,t=0){let n=e;if((t&ye.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&ye.DOTALL)!==0&&(n=`(?s)${n}`),(t&ye.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(ye.MULTILINE|ye.DOTALL|ye.CASE_INSENSITIVE|ye.DISABLE_UNICODE_GROUPS|ye.LONGEST_MATCH|ye.LOOKBEHINDS))!==0)throw new vu("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=N.PERL;(t&ye.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&ye.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND);let B=new ye(e,t);return B.re2Input=_u.compileImpl(n,s,(t&ye.LONGEST_MATCH)!==0),B}static matches(e,t){return ye.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 ye(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 _.isByteArray(e)&&(e=Kt.utf8(e)),new ki(this,e)}test(e){return _.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=_.isByteArray(e)?fe.fromUTF8(e):fe.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 B=1;B<=t.groupCount();B++){let i=t.group(B);n.push(i===null?void 0:i)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let B=t.getNamedGroups();for(let i in B)B[i]===null&&(B[i]=void 0);n.groups=B}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],B=0,i=0;for(;n.find();){if(i===0&&n.end()===0){i=n.end();continue}if(t>0&&s.length===t-1)break;if(i===n.start()){if(t===0){B+=1,i=n.end();continue}}else for(;B>0;)s.push(""),B-=1;s.push(n.substring(i,n.start())),i=n.end()}if(t===0&&i!==n.inputLength()){for(;B>0;)s.push(""),B-=1;s.push(n.substring(i,n.inputLength()))}return(t!==0||s.length===0&&!(i===n.inputLength()&&i>0))&&s.push(n.substring(i,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let B=1;B<=t.groupCount();B++){let i=t.group(B);n.push(i===null?void 0:i)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let B=t.getNamedGroups();for(let i in B)B[i]===null&&(B[i]=void 0);n.groups=B}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 lo="kubectl config current-context",Uu=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function uo(r){return r.length<=253&&Uu.test(r)}var Ku=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function zt(r){return r===void 0?void 0:Ku.exec(r)?.[1]}function Pr(r){return uo(r)||zt(r)!==void 0}function _r(r,e){return r.kubeContext??e?.kubeContext}function co(r,e){let t=zt(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(!uo(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 Co(r){let e=zt(r);return e===void 0?"":`\${param:${e}}`}function ju(r,e){let t=e.stdout.split(/\r?\n/).map(B=>B.trim()).find(B=>B!=="");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(B=>B.trim()).find(B=>B!=="");return`${n}, and \`${lo}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function fo(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?mo(r):lo)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?zu(r,n):ju(r,n)}var ho=["check","pin"];function po(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
|
|
57
|
+
`}function xt(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,B,i)=>t(`<code>${Z(i.replace(/^ (.*) $/,"$1"))}</code>`)),n=n.replace(/\\([!-/:-@[-`{-~])/g,(s,B)=>t(Z(B))),n=Z(n),n=n.replace(/!?\[([^\]]*)\]\(([^)\s]*)(?:\s+"[^)]*?")?\)/g,(s,B,i)=>{let o=Ni(i.replace(/&/g,"&")),a=Li(B)||i;return t(o===void 0?a:`<a href="${Z(o)}">${a}</a>`)}),n=n.replace(/<((?:https?:\/\/|mailto:)[^\s&]+(?:&[^\s&]+)*)>/g,(s,B)=>t(`<a href="${B}">${B}</a>`)),n=Li(n);/\u0000\d+\u0000/.test(n);)n=n.replace(/\u0000(\d+)\u0000/g,(s,B)=>e[Number(B)]);return n}function Li(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 M=class _t{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=_t.CLASS_NL|_t.DOT_NL;static PERL=_t.CLASS_NL|_t.ONE_LINE|_t.PERL_X|_t.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2},Ze={CASE_INSENSITIVE:1,DOTALL:2,MULTILINE:4,DISABLE_UNICODE_GROUPS:8,LONGEST_MATCH:16,LOOKBEHINDS:512},zn=128,Ws=new Int32Array(zn),Vs=new Int32Array(zn),$r=65535;for(let r=0;r<zn;r++)r>=97&&r<=122?Ws[r]=r-32:Ws[r]=r,r>=65&&r<=90?Vs[r]=r+32:Vs[r]=r;var L=class{static CODES=new Map([["\x07",7],["\b",8],[" ",9],[`
|
|
58
|
+
`,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<zn)return Ws[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>$r?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>$r?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<zn)return Vs[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>$r?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>$r?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},p=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}},fo=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)fo[e.charCodeAt(r)]=r;var Co=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let B=fo[r.charCodeAt(s)];t|=(B&31)<<n,(B&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Co(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),B=0,i=0;for(let o=0;o<n;o++)B+=t[i++],s[o*3]=B,B+=t[i++],s[o*3+1]=B,s[o*3+2]=e?1:t[i++];return s},Gu=r=>{let e=Co(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let B=e[s+1],i=B>>>1^-(B&1);t.set(n,n+i)}return t},Mr=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}},Ge=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Gu("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-B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BFBB-MCBuBmUmUBrCrCBspBspBBDB6vRBBmEiCiCBBBLqRqRBoJoJBnwTnwTovHDB",!1)),Uppercase:()=>new p(g("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new p(g("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static get Upper(){return this.CATEGORIES.get("Lu")}static SCRIPTS=new Mr({Adlam:()=>new p(g("go6DrCFJFB",!0)),Ahom:()=>new p(g("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new p(g("ggxCmS",!0)),Arabic:()=>new p(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new p(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new p(g("g4iC1BEG",!0)),Balinese:()=>new p(g("g4GsCCxB",!0)),Bamum:()=>new p(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new p(g("w26CdDF",!0)),Batak:()=>new p(g("g+GzBJD",!0)),Bengali:()=>new p(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new p(g("g17CYDY",!0)),Bhaiksuki:()=>new p(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new p(g("qXB6wLqBxDf",!0)),Brahmi:()=>new p(g("ggkCtCFjBKA",!0)),Braille:()=>new p(g("ggK-H",!0)),Buginese:()=>new p(g("gwGbDB",!0)),Buhid:()=>new p(g("g6FT",!0)),Canadian_Aboriginal:()=>new p(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new p(g("g1gCwB",!0)),Caucasian_Albanian:()=>new p(g("wphCzBMA",!0)),Chakma:()=>new p(g("gokC0BCR",!0)),Cham:()=>new p(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new p(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new p(g("w9jCb",!0)),Common:()=>new p(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new p(g("ifNxkKzDGG",!0)),Cuneiform:()=>new p(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new p(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new p(g("w8rCiD",!0)),Cyrillic:()=>new p(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new p(g("gghCvC",!0)),Devanagari:()=>new p(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new p(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new p(g("ggmC7B",!0)),Duployan:()=>new p(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new p(g("ggsC1iBL68D",!0)),Elbasan:()=>new p(g("gohCnB",!0)),Elymaic:()=>new p(g("g-jCW",!0)),Ethiopic:()=>new p(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new p(g("gqjClBEcJB",!0)),Georgian:()=>new p(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new p(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new p(g("w5gCa",!0)),Grantha:()=>new p(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new p(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new p(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new p(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new p(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new p(g("go4C5B",!0)),Han:()=>new p(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new p(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new p(g("gojCnBJJ",!0)),Hanunoo:()=>new p(g("g5FU",!0)),Hatran:()=>new p(g("gniCSCBGE",!0)),Hebrew:()=>new p(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new p(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new p(g("giiCVCI",!0)),Inherited:()=>new p(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new p(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new p(g("g6iCVDH",!0)),Javanese:()=>new p(g("gsqBtCDJFB",!0)),Kaithi:()=>new p(g("gkkCiCLA",!0)),Kannada:()=>new p(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new p(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new p(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new p(g("goqBtBCA",!0)),Kharoshthi:()=>new p(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new p(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new p(g("g8F9CDJHJnPf",!0)),Khojki:()=>new p(g("gwkCRCuB",!0)),Khudawadi:()=>new p(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new p(g("gq7C5B",!0)),Lao:()=>new p(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new p(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new p(g("ggH3BEOEC",!0)),Limbu:()=>new p(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new p(g("gwhC2JKVLH",!0)),Linear_B:()=>new p(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new p(g("wmpBvBx1eA",!0)),Lycian:()=>new p(g("g0gCc",!0)),Lydian:()=>new p(g("gpiCZGA",!0)),Mahajani:()=>new p(g("wqkCmB",!0)),Makasar:()=>new p(g("g3nCY",!0)),Malayalam:()=>new p(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new p(g("giCbDA",!0)),Manichaean:()=>new p(g("g2iCmBFL",!0)),Marchen:()=>new p(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new p(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new p(g("gy7C6C",!0)),Meetei_Mayek:()=>new p(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new p(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new p(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new p(g("gsiCf",!0)),Miao:()=>new p(g("g47CqCF4BIQ",!0)),Modi:()=>new p(g("gwlCkCMJ",!0)),Mongolian:()=>new p(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new p(g("gy6CeCJFB",!0)),Multani:()=>new p(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new p(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new p(g("gkiCeJI",!0)),Nag_Mundari:()=>new p(g("wm5DpB",!0)),Nandinagari:()=>new p(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new p(g("gsGrBFZHKEB",!0)),Newa:()=>new p(g("gglC7CCE",!0)),Nko:()=>new p(g("g+B6BDC",!0)),Nushu:()=>new p(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new p(g("go4DsBENDJFB",!0)),Ogham:()=>new p(g("g0Fc",!0)),Ol_Chiki:()=>new p(g("wiHvB",!0)),Ol_Onal:()=>new p(g("wu5DqBFA",!0)),Old_Hungarian:()=>new p(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new p(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new p(g("g0iCf",!0)),Old_Permic:()=>new p(g("w6gCqB",!0)),Old_Persian:()=>new p(g("g9gCjBFN",!0)),Old_Sogdian:()=>new p(g("g4jCnB",!0)),Old_South_Arabian:()=>new p(g("gziCf",!0)),Old_Turkic:()=>new p(g("ggjCoC",!0)),Old_Uyghur:()=>new p(g("w7jCZ",!0)),Oriya:()=>new p(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new p(g("wlhCjBFjB",!0)),Osmanya:()=>new p(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new p(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new p(g("gjiCf",!0)),Pau_Cin_Hau:()=>new p(g("g2mC4B",!0)),Phags_Pa:()=>new p(g("giqB3B",!0)),Phoenician:()=>new p(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new p(g("g8iCRIDNG",!0)),Rejang:()=>new p(g("wpqBjBMA",!0)),Runic:()=>new p(g("g1FqCEK",!0)),Samaritan:()=>new p(g("ggCtBDO",!0)),Saurashtra:()=>new p(g("gkqBlCJL",!0)),Sharada:()=>new p(g("gskC-ChsCH",!0)),Shavian:()=>new p(g("wihCvB",!0)),Siddham:()=>new p(g("gslC1BDlB",!0)),Sidetic:()=>new p(g("gqiCZ",!0)),SignWriting:()=>new p(g("gg2DrUQECO",!0)),Sinhala:()=>new p(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new p(g("w5jCpB",!0)),Sora_Sompeng:()=>new p(g("wmkCYIJ",!0)),Soyombo:()=>new p(g("wymCyC",!0)),Sundanese:()=>new p(g("g8G-BhIH",!0)),Sunuwar:()=>new p(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new p(g("ggqBsB",!0)),Syriac:()=>new p(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new p(g("g4FVKA",!0)),Tagbanwa:()=>new p(g("g7FMCCCB",!0)),Tai_Le:()=>new p(g("wqGdDE",!0)),Tai_Tham:()=>new p(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new p(g("g0qBiCZE",!0)),Tai_Yo:()=>new p(g("g25DeCVJB",!0)),Takri:()=>new p(g("g0lC5BHJ",!0)),Tamil:()=>new p(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new p(g("wz6CuCCJ",!0)),Tangut:()=>new p(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new p(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new p(g("g8BxB",!0)),Thai:()=>new p(g("hwD5BGb",!0)),Tibetan:()=>new p(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>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BNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new p(g("gopBrJ",!0)),Vithkuqi:()=>new p(g("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new p(g("g24D5BGA",!0)),Warang_Citi:()=>new p(g("glmCyCNA",!0)),Yezidi:()=>new p(g("g0jCpBCCDB",!0)),Yi:()=>new p(g("ggoBskBE2B",!0)),Zanabazar_Square:()=>new p(g("gwmCnC",!0))});static FOLD_CATEGORIES=new Mr({L:()=>new p(g("laA",!0)),LC:()=>new p(g("laA",!0)),Ll:()=>new p(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCO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BCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new p(g("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new p(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new Mr({Common:()=>new p(g("8cgBgB",!1)),Greek:()=>new p(g("1FwUwU",!1)),Inherited:()=>new p(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 B=n+Math.floor((s-n)/2),i=e.getLo(B),o=e.getHi(B);if(i<=t&&t<=o){let a=e.getStride(B);return(t-i)%a===0}t<i?s=B:n=B+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 B=e.getStride(n);return(t-s)%B===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(Ge.Upper,e)}static isPrint(e){return e<=ye.MAX_LATIN1?e>=32&&e<ye.MAX_ASCII||e>=161&&e!==173:ye.is(Ge.Print,e)}static simpleFold(e){if(Ge.CASE_ORBIT.has(e))return Ge.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}},eB=256,ho=new Uint8Array(eB);for(let r=0;r<eB;r++)ho[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var zs=null,Ys=null,_=class Pe{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))Pe.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(`
|
|
59
|
+
`):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 B=t.codePointAt(s);n.push(B),s+=B>J.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<eB?ho[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=Pe.EMPTY_BEGIN_TEXT|Pe.EMPTY_BEGIN_LINE),e===10&&(n|=Pe.EMPTY_BEGIN_LINE),t<0&&(n|=Pe.EMPTY_END_TEXT|Pe.EMPTY_END_LINE),t===10&&(n|=Pe.EMPTY_END_LINE),Pe.isWordRune(e)!==Pe.isWordRune(t)?n|=Pe.EMPTY_WORD_BOUNDARY:n|=Pe.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>Pe.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 zs||(zs=new TextEncoder),zs.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let B=e.charCodeAt(s);B<128?t[n++]=B:B<2048?(t[n++]=B>>6|192,t[n++]=B&63|128):(B&64512)===J.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===J.MIN_LOW_SURROGATE?(B=J.MIN_SUPPLEMENTARY_CODE_POINT+((B&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=B>>18|240,t[n++]=B>>12&63|128,t[n++]=B>>6&63|128,t[n++]=B&63|128):(t[n++]=B>>12|224,t[n++]=B>>6&63|128,t[n++]=B&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){Ys||(Ys=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return Ys.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let B=e[n++];if(B<128)t[s++]=String.fromCharCode(B);else if(B>191&&B<224){let i=e[n++];t[s++]=String.fromCharCode((B&31)<<6|i&63)}else if(B>239&&B<365){let i=e[n++],o=e[n++],a=e[n++],c=((B&7)<<18|(i&63)<<12|(o&63)<<6|a&63)-J.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(J.MIN_HIGH_SURROGATE+(c>>10)),t[s++]=String.fromCharCode(J.MIN_LOW_SURROGATE+(c&1023))}else{let i=e[n++],o=e[n++];t[s++]=String.fromCharCode((B&15)<<12|(i&63)<<6|o&63)}}return t.join("")}}},po=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],B=e+n;t[s]=B,t[B]=s}return Object.freeze(t)},Kt=class Zs{static Encoding=po(["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()===Zs.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===Zs.Encoding.UTF_16}},Hi=class extends Kt{constructor(r=null){super(),this.bytes=r}getEncoding(){return Kt.Encoding.UTF_8}asCharSequence(){return _.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},Hu=class extends Kt{constructor(r=null){super(),this.charSequence=r}getEncoding(){return Kt.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return _.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},Ut=class{static utf16(r){return new Hu(r)}static utf8(r){return _.isByteArray(r)?new Hi(r):new Hi(_.stringToUtf8ByteArray(r))}},Ne=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}},Pu=class un extends Ne{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 Ne.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,B=128,i=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?B=160:t===237&&(i=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?B=144:t===244&&(i=143);else return un.RUNE_ERROR_STEP;if(e+n>this.end)return un.RUNE_ERROR_STEP;let o=this.bytes[e+1]&255;if(o<B||o>i)return un.RUNE_ERROR_STEP;if(s=s<<6|o&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return un.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let c=this.bytes[e+3]&255;if((c&192)!==128)return un.RUNE_ERROR_STEP;s=s<<6|c&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 B=e-4;for(B<this.start&&(B=this.start);s>=B&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let i=this.step(s-this.start);t=s+(i&7)===e?i>>3:J.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return _.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let B=t[0],i=this.end-s,o=typeof e.indexOf=="function",a=n;for(;a<=i;){if(o){if(a=e.indexOf(B,a),a===-1||a>i)return-1}else{for(;a<=i&&e[a]!==B;)a++;if(a>i)return-1}let c=!0;for(let u=1;u<s;u++)if(e[a+u]!==t[u]){c=!1;break}if(c)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},_u=class extends Ne{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 Ne.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 _.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},ue=class{static fromUTF8(r,e=0,t=r.length){return new Pu(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new _u(r,e,t)}},Yn=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},fe=class extends Yn{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}},Kn=class extends Yn{constructor(r){super(r),this.name="RE2JSCompileException"}},Me=class extends Yn{constructor(r){super(r),this.name="RE2JSGroupException"}},Ju=class extends Yn{constructor(r){super(r),this.name="RE2JSFlagsException"}},jn=class extends Yn{constructor(r){super(r),this.name="RE2JSInternalException"}},Pi=class go{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 Kt?this.resetMatcherInput(t):_.isByteArray(t)?this.resetMatcherInput(Ut.utf8(t)):this.resetMatcherInput(Ut.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 Kt||(_.isByteArray(e)?e=Ut.utf8(e):e=Ut.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 Me(`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 Me(`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 Me(`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 Me("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 Me(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new Me("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 Me("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,M.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,M.ANCHOR_START)}find(e=null){if(e!==null){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new Me(`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()?ue.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):ue.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,M.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()?_.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(),B=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=B,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,B=0;for(;B<s;){let i=e.codePointAt(B);if(i===L.CODES.get("\\")){if(n<B&&(t+=e.substring(n,B)),B++,B>=s)throw new Me("character to be escaped is missing");n=B,B++;continue}if(i===L.CODES.get("$")){if(n<B&&(t+=e.substring(n,B)),B+1>=s)throw new Me("Illegal group reference: group index is missing");let o=e.codePointAt(B+1);if(L.CODES.get("0")<=o&&o<=L.CODES.get("9")){let a=o-L.CODES.get("0"),c=B+2;for(;c<s;c++){let l=e.codePointAt(c);if(l<L.CODES.get("0")||l>L.CODES.get("9")||a*10+l-L.CODES.get("0")>this.patternGroupCount)break;a=a*10+l-L.CODES.get("0")}if(a>this.patternGroupCount)throw new Me(`n > number of groups: ${a}`);let u=this.group(a);u!==null&&(t+=u),B=c,n=B}else if(o===L.CODES.get("{")){let a=B+2;for(;a<s&&e.codePointAt(a)!==L.CODES.get("}");)a++;if(a>=s)throw new Me("named capture group is missing trailing '}'");let c=e.substring(B+2,a),u=this.group(c);u!==null&&(t+=u),B=a+1,n=B}else throw new Me("Illegal group reference");continue}B++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let B=0;B<s-1;B++)if(e.codePointAt(B)===L.CODES.get("$")){let i=e.codePointAt(B+1);if(L.CODES.get("$")===i){n<B&&(t+=e.substring(n,B)),t+="$",B++,n=B+1;continue}else if(L.CODES.get("&")===i){n<B&&(t+=e.substring(n,B));let o=this.group(0);o!==null?t+=o:t+="$&",B++,n=B+1;continue}else if(L.CODES.get("`")===i){n<B&&(t+=e.substring(n,B)),t+=this.substring(0,this.start(0)),B++,n=B+1;continue}else if(L.CODES.get("'")===i){n<B&&(t+=e.substring(n,B)),t+=this.substring(this.end(0),this.matcherInputLength),B++,n=B+1;continue}else if(L.CODES.get("1")<=i&&i<=L.CODES.get("9")){let o=i-L.CODES.get("0");for(n<B&&(t+=e.substring(n,B)),B+=2;B<s&&(i=e.codePointAt(B),!(i<L.CODES.get("0")||i>L.CODES.get("9")||o*10+i-L.CODES.get("0")>this.patternGroupCount));B++)o=o*10+i-L.CODES.get("0");if(o>this.patternGroupCount){t+=`$${o}`,n=B,B--;continue}let a=this.group(o);a!==null&&(t+=a),n=B,B--;continue}else if(i===L.CODES.get("<")){n<B&&(t+=e.substring(n,B)),B++;let o=B+1;for(;o<e.length&&e.codePointAt(o)!==L.CODES.get(">")&&e.codePointAt(o)!==L.CODES.get(" ");)o++;if(o===e.length||e.codePointAt(o)!==L.CODES.get(">")){t+=e.substring(B-1,o+1),n=o+1,B=o;continue}let a=e.substring(B+1,o);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let c=this.group(a);c!==null&&(t+=c)}else t+=`$<${a}>`;n=o+1,B=o;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 B=typeof e=="function",i=Object.keys(this.namedGroups).length>0,o=null;if(B){if(this.groupCount()>=go.MAX_REPLACER_ARGS)throw new Me("Too many capture groups to safely invoke replacer function");o=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=B?this.appendReplacementFunc(e,i,o):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",B=this.start(),i=this.end();this.appendPos<B&&(s+=this.substring(this.appendPos,B)),this.appendPos=i;let o=this.buildReplacerArgs(B,t,n);return s+=String(e(...o)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],B=this.groupCount();for(let i=1;i<=B;i++){let o=this.start(i);o<0?s.push(void 0):s.push(this.substring(o,this.end(i)))}if(s.push(e),s.push(n),t){let i=this.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);s.push(i)}return s}},I=class xe{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 xe.RUNE<=e&&e<=xe.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=_.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 i=this.runes[0];return(this.arg&M.FOLD_CASE)!==0?J.equalsIgnoreCase(i,e):e===i}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let i=0;i<t;i+=2){if(e<this.runes[i])return!1;if(e<=this.runes[i+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let i=s>>1;n+=this.runes[n+i<<1]<=e?i:0,s-=i}n+=this.runes[n<<1]<=e?1:0;let B=n-1;return B>=0&&e<=this.runes[B<<1|1]}matchRunePos(e){if(this.runes.length===1){let i=this.runes[0];return(this.arg&M.FOLD_CASE)!==0?J.equalsIgnoreCase(i,e)?0:-1:e===i?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let i=0;i<t;i+=2){if(e<this.runes[i])return-1;if(e<=this.runes[i+1])return Math.floor(i/2)}return-1}let n=0,s=t>>1;for(;s>1;){let i=s>>1;n+=this.runes[n+i<<1]<=e?i:0,s-=i}n+=this.runes[n<<1]<=e?1:0;let B=n-1;return B>=0&&e<=this.runes[B<<1|1]?B:-1}toString(){switch(this.op){case xe.ALT:return`alt -> ${this.out}, ${this.arg}`;case xe.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case xe.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case xe.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case xe.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case xe.FAIL:return"fail";case xe.NOP:return`nop -> ${this.out}`;case xe.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case xe.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case xe.RUNE:return this.runes===null?"rune <null>":["rune ",xe.escapeRunes(this.runes),(this.arg&M.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case xe.RUNE1:return`rune1 ${xe.escapeRunes(this.runes)} -> ${this.out}`;case xe.RUNE_ANY:return`any -> ${this.out}`;case xe.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},_i=class mo{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,mo.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}},Uu=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}},Eo=class Do{static fromRE2(e){let t=new Do;return t.prog=e.prog,t.re2=e,t.q0=new _i(t.prog.numInst()),t.q1=new _i(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?_.emptyInts():_.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let B=this.re2.cond;if(B===_.EMPTY_ALL||(n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let i=this.prog.numLb>0,o=t,a=t,c=!1;i&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,c=!0):a=0);let u=i&&s!==null,l=this.q0,f=this.q1,C=e.step(a),d=C>>3,h=C&7,k=-1,R=0;C!==Ne.EOF()&&(C=e.step(a+h),k=C>>3,R=C&7);let E;for(a===0?E=_.emptyOpContext(-1,d):E=e.context(a),i&&(c?this.restoreLookbehinds(s,l,E):this.spawnLookbehinds(l,a,E));;){if(l.mainThreads===0){if((B&_.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&l.isEmpty()&&this.re2.prefix.length!==0&&k!==this.re2.prefixRune&&e.canCheckPrefix()){let y=e.index(this.re2,a);if(y<0)break;a+=y,C=e.step(a),d=C>>3,h=C&7,C=e.step(a+h),k=C>>3,R=C&7,E=e.context(a)}}a>=o&&(u&&(this.saveLookbehinds(s,l,a),u=!1),!this.matched&&(a===0||n===M.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(l,this.prog.start,a,this.matchcap,0,E)));let S=a+h;if(E=e.context(S),this.step(l,f,a,S,d,E,n,a===e.endPos()),h===0||this.ncap===0&&this.matched)break;a+=h,d=k,h=R,d!==-1&&(C=e.step(a+h),k=C>>3,R=C&7);let w=l;l=f,f=w}return l.clear(),f.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===_.EMPTY_ALL)return[];if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return[];let B=this.prog.numLb>0?0:t,i=t,o=this.q0,a=this.q1,c=e.step(B),u=c>>3,l=c&7,f=-1,C=0;c!==Ne.EOF()&&(c=e.step(B+l),f=c>>3,C=c&7);let d=B===0?_.emptyOpContext(-1,u):e.context(B),h=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(o,B,d);!(o.mainThreads===0&&((s&_.EMPTY_BEGIN_TEXT)!==0&&B!==0||(n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&B!==0));){(B===0||n===M.UNANCHORED)&&B>=i&&this.add(o,this.prog.start,B,this.matchcap,0,d);let k=B+l;d=e.context(k);for(let E=0;E<o.size;E++){let S=o.densePcs[E],w=this.prog.inst[S],y=E*this.ncap,O=!1;switch(w.op){case I.MATCH:if(n===M.ANCHOR_BOTH&&B!==e.endPos())break;h.add(w.arg);break;case I.RUNE:O=w.matchRune(u);break;case I.RUNE1:O=u===w.runes[0];break;case I.RUNE_ANY:O=!0;break;case I.RUNE_ANY_NOT_NL:O=u!==10;break;default:continue}O&&this.add(a,w.out,k,o.denseCaps,y,d)}if(o.clear(),l===0)break;B+=l,u=f,l=C,u!==-1&&(c=e.step(B+l),f=c>>3,C=c&7);let R=o;o=a,a=R}return a.clear(),Array.from(h).sort((k,R)=>k-R)}step(e,t,n,s,B,i,o,a){let c=this.re2.longest;for(let u=0;u<e.size;u++){let l=e.densePcs[u],f=u*this.ncap;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[f])continue;let C=this.prog.inst[l],d=!1;switch(C.op){case I.MATCH:if(o===M.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!c||!this.matched||this.matchcap[1]<n)){e.denseCaps[f+1]=n;for(let h=0;h<this.ncap;h++)this.matchcap[h]=e.denseCaps[f+h]}c||(e.size=0),this.matched=!0;break;case I.RUNE:d=C.matchRune(B);break;case I.RUNE1:d=B===C.runes[0];break;case I.RUNE_ANY:d=!0;break;case I.RUNE_ANY_NOT_NL:d=B!==10;break;default:continue}d&&this.add(t,C.out,s,e.denseCaps,f,i)}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 B=0;B<t.size;B++){let i=t.densePcs[B];this.prog.lbInst[i]===1&&I.isRuneOp(this.prog.inst[i].op)&&(e.pcs[s++]=i)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,B,i){let o=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let u=e.add(t),l=this.prog.inst[t];switch(l.op){case I.FAIL:t=0;break;case I.ALT:case I.ALT_MATCH:o[a++]=l.arg,o[a++]=0,t=l.out;break;case I.EMPTY_WIDTH:t=(l.arg&~i)===0?l.out:0;break;case I.NOP:t=l.out;break;case I.CAPTURE:l.arg<this.ncap&&(o[a++]=-l.arg-1,o[a++]=s[B+l.arg],s[B+l.arg]=n),t=l.out;break;case I.LB_WRITE:this.lbTable[Math.abs(l.arg)]=n,t=l.out;break;case I.LB_CHECK:l.arg>0?t=this.lbTable[l.arg]===n?l.out:0:t=this.lbTable[-l.arg]!==n?l.out:0;break;case I.MATCH:case I.RUNE:case I.RUNE1:case I.RUNE_ANY:case I.RUNE_ANY_NOT_NL:if(this.prog.lbInst[t]===0&&e.mainThreads++,this.ncap>0){let f=u*this.ncap;f+this.ncap>e.denseCaps.length&&e.growCaps(f+this.ncap);for(let C=0;C<this.ncap;C++)e.denseCaps[f+C]=s[B+C]}t=0;break;default:throw new jn("unhandled")}}if(a===0)return;a-=2;let c=o[a];c<0?(s[B-c-1]=o[a+1],t=0):t=c}}},Ku=(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},Ji=(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},Qs=[],Jn=-1,ju=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&tB.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},tB=class _e{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===I.LB_WRITE||s===I.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){let e=new Set,t=(s,B)=>{e.add(s),e.add(B+1)};for(let s=0;s<this.prog.numInst();s++){let B=this.prog.getInst(s);switch(B.op){case I.RUNE:case I.RUNE1:if(B.runes.length===1){if(t(B.runes[0],B.runes[0]),(B.arg&M.FOLD_CASE)!==0)for(let i=J.simpleFold(B.runes[0]);i!==B.runes[0];i=J.simpleFold(i))t(i,i)}else for(let i=0;i<B.runes.length;i+=2)t(B.runes[i],B.runes[i+1]);break;case I.RUNE_ANY_NOT_NL:t(10,10);break;case I.EMPTY_WIDTH:(B.arg&(_.EMPTY_BEGIN_LINE|_.EMPTY_END_LINE))!==0&&t(10,10),(B.arg&(_.EMPTY_WORD_BOUNDARY|_.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 B=n+s>>1;t[B]<=e?n=B+1:s=B}return n}closure(e,t){let n=new Set,s=Array.from(e),B=0;for(;s.length>0;){let i=s.pop();if(i===0||n.has(i))continue;n.add(i);let o=this.prog.getInst(i);switch(o.op){case I.ALT:case I.ALT_MATCH:s.push(o.out),s.push(o.arg);break;case I.NOP:case I.CAPTURE:s.push(o.out);break;case I.EMPTY_WIDTH:B|=o.arg,(o.arg&~t)===0&&s.push(o.out)}}return{pcs:Int32Array.from(n).sort(),needflags:B}}getState(e,t,n){let s=Ku(e,t,n),B=this.stateCache.get(s);if(B)for(let a=0;a<B.length;a++){let c=B[a];if(c.flag===t&&Ji(c.nfaStates,e)&&Ji(c.matchIDs,n))return c}let i=_e.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<i)return null;this.memBudget-=i,B||(B=[],this.stateCache.set(s,B));let o=new ju(e,t,n);return B.push(o),this.stateCount++,o}makeState(e,t,n){let s=this.closure(e,t&_e.FLAG_EMPTY_MASK),B=t;return s.needflags===0&&(B&=_e.FLAG_MATCH),B|=s.needflags<<_e.FLAG_NEED_SHIFT,this.getState(s.pcs,B,n)}allocTable(e,t){let n=this.numClasses+1,s=_e.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let B=new Array(n).fill(null);return t===M.UNANCHORED?e.next=B:e.nextAnchored=B,B}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 B=s===M.UNANCHORED?e.next:e.nextAnchored;if(B!==null){let E=B[t];if(E!==null)return E}else if(B=this.allocTable(e,s),B===null)return null;let i=e.flag>>>_e.FLAG_NEED_SHIFT,o=e.flag&_e.FLAG_EMPTY_MASK,a=o,c=0;n===10&&(a|=_.EMPTY_END_LINE,c|=_.EMPTY_BEGIN_LINE),n===Jn&&(a|=_.EMPTY_END_LINE|_.EMPTY_END_TEXT);let u=(e.flag&_e.FLAG_LAST_WORD)!==0,l=n!==Jn&&_.isWordRune(n);a|=l===u?_.EMPTY_NO_WORD_BOUNDARY:_.EMPTY_WORD_BOUNDARY;let f=e.nfaStates;(a&~o&i)!==0&&(f=this.closure(f,a).pcs);let C=[],d=!1,h=Qs;for(let E=0;E<f.length;E++){let S=this.prog.getInst(f[E]);S.op===I.MATCH?(d||(d=!0,h=[]),h.push(S.arg)):n!==Jn&&I.isRuneOp(S.op)&&S.matchRune(n)&&C.push(S.out)}h.length>1&&h.sort((E,S)=>E-S),s===M.UNANCHORED&&n!==Jn&&C.push(this.prog.start);let k=c;d&&(k|=_e.FLAG_MATCH),l&&(k|=_e.FLAG_LAST_WORD);let R=this.makeState(C,k,h);return R===null?null:(B[t]=R,R)}start(e,t){let n=e.context(t),s;if((n&_.EMPTY_BEGIN_TEXT)!==0)s=_.EMPTY_BEGIN_TEXT|_.EMPTY_BEGIN_LINE;else if((n&_.EMPTY_BEGIN_LINE)!==0)s=_.EMPTY_BEGIN_LINE;else{let i=e.step(t),o=i>=0&&_.isWordRune(i>>3);s=(n&_.EMPTY_WORD_BOUNDARY)!==0!==o?_e.FLAG_LAST_WORD:0}let B=this.startStates.get(s);if(B===void 0){if(B=this.makeState([this.prog.start],s,Qs),B===null&&(this.clearCache(),B=this.makeState([this.prog.start],s,Qs),B===null))return null;this.startStates.set(s,B)}return B}stepOrReset(e,t,n,s,B,i){let o=this.step(e,t,n,s);if(o!==null)return o;if(i.resetPos>=0&&B-i.resetPos<_e.PROGRESS_PER_STATE*this.stateCount)return null;i.resetPos=B;let a=this.resetCache(e);return a===null?null:(o=this.step(a,t,n,s),o)}run(e,t,n,s,B){let i=e.endPos(),o=this.latin1Class,a=n===M.UNANCHORED,c={resetPos:-1},u=t;for(;u<i;){let l=e.step(u),f=l>>3,C=l&7;if(C===0)break;let d=f<=J.MAX_LATIN1?o[f]:this.runeClass(f),h=a&&s.next!==null?s.next[d]:null;if(h===null&&(h=this.stepOrReset(s,d,f,n,u,c),h===null))return null;if(s=h,s.isMatch&&B(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;u+=C}return s=this.stepOrReset(s,this.numClasses,Jn,n,u,c),s===null?null:s.isMatch&&B(s,!0)}match(e,t,n){if(this.failed)return null;if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return!1;let s=this.start(e,t);return s===null?null:this.run(e,t,n,s,(B,i)=>n!==M.ANCHOR_BOTH||i)}matchSet(e,t,n){if(this.failed)return null;if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return[];let s=this.start(e,t);if(s===null)return null;let B=new Set,i=(o,a)=>{if(n!==M.ANCHOR_BOTH||a)for(let c=0;c<o.matchIDs.length;c++)B.add(o.matchIDs[c]);return!1};return this.run(e,t,n,s,i)===null?null:Array.from(B).sort((o,a)=>o-a)}},zu=32,Yu=500,qs=256,Qu=262144,qu=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(qs),this.jobArg=new Uint8Array(qs),this.jobPos=new Int32Array(qs),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)+zu-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!==I.FAIL&&(n||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){let s=this.jobPc.length*2,B=new Int32Array(s);B.set(this.jobPc),this.jobPc=B;let i=new Uint8Array(s);i.set(this.jobArg),this.jobArg=i;let o=new Int32Array(s);o.set(this.jobPos),this.jobPos=o}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 B=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let i=this.jobPc[this.jobLen],o=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],c=!0;for(;!(!c&&!this.shouldVisit(i,a));){c=!1;let u=r.prog.getInst(i);switch(u.op){case I.FAIL:throw new jn("unexpected InstFail");case I.ALT:if(o){o=!1,i=u.arg;continue}else{this.push(r,i,a,!0),i=u.out;continue}case I.ALT_MATCH:{let l=r.prog.getInst(u.out);if(I.isRuneOp(l.op)){this.push(r,u.arg,a,!1),i=u.arg,a=this.end;continue}this.push(r,u.out,this.end,!1),i=u.out;continue}case I.RUNE:{let l=e.step(a);if(l===Ne.EOF()||!u.matchRune(l>>3))break;a+=l&7,i=u.out;continue}case I.RUNE1:{let l=e.step(a);if(l===Ne.EOF()||l>>3!==u.runes[0])break;a+=l&7,i=u.out;continue}case I.RUNE_ANY_NOT_NL:{let l=e.step(a);if(l===Ne.EOF()||l>>3===10)break;a+=l&7,i=u.out;continue}case I.RUNE_ANY:{let l=e.step(a);if(l===Ne.EOF())break;a+=l&7,i=u.out;continue}case I.CAPTURE:if(o){this.cap[u.arg]=a;break}else{u.arg<this.ncap&&(this.push(r,i,this.cap[u.arg],!0),this.cap[u.arg]=a),i=u.out;continue}case I.EMPTY_WIDTH:{let l=e.context(a);if((u.arg&~l)!==0)break;i=u.out;continue}case I.NOP:i=u.out;continue;case I.MATCH:{if(s===M.ANCHOR_BOTH&&a!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=a);let l=this.matchcap[1];if((l===-1||B&&a>0&&a>l)&&this.matchcap.set(this.cap),!B||a===this.end)return!0;break}case I.LB_WRITE:case I.LB_CHECK:throw new jn("Backtracker cannot evaluate Lookbehind instructions");default:throw new jn("bad inst")}break}}return B&&this.matchcap.length>1&&this.matchcap[1]>=0}},Gr=[],Hr=class bo{static shouldBacktrack(e){return e.numInst()<=Yu}static maxBitStateLen(e){return bo.shouldBacktrack(e)?Math.floor(Qu/e.numInst()):0}static execute(e,t,n,s,B){let i=e.cond;if(i===_.EMPTY_ALL||(s===M.ANCHOR_START||s===M.ANCHOR_BOTH)&&n!==0||(i&_.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let o=Gr.length>0?Gr.pop():new qu,a=t.endPos();o.reset(e.prog,a,B);let c=!1;if((i&_.EMPTY_BEGIN_TEXT)!==0||s===M.ANCHOR_START||s===M.ANCHOR_BOTH)o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)&&(c=!0);else{let l=-1;for(;n<=a&&l!==0;n+=l){if(e.prefix.length>0){let C=t.index(e,n);if(C<0)break;n+=C}if(o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)){c=!0;break}let f=t.step(n);l=f===Ne.EOF()?0:f&7}}if(!c)return Gr.push(o),null;let u=B===0?[]:_.toArray(o.matchcap.subarray(0,B));return Gr.push(o),u}},Ui=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++)}},Wu=(r,e,t,n)=>{let s=r.length,B=e.length,i=0,o=0,a=[],c=[],u=!0,l=-1,f=C=>{let d=C?r:e,h=C?i:o,k=C?t:n;return l>0&&d[h]<=a[l]?!1:(a.push(d[h],d[h+1]),C?i+=2:o+=2,l+=2,c.push(k),!0)};for(;i<s||o<B;)if(o>=B?u=f(!0):i>=s||e[o]<r[i]?u=f(!1):u=f(!0),!u)return null;return{merged:a,next:c}},Vu=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 I(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}}},Zu=r=>{let e=new Vu(r);for(let t=0;t<e.inst.length;t++){let n=e.inst[t];if(n.op!==I.ALT&&n.op!==I.ALT_MATCH)continue;let s="out",B="arg",i=e.inst[n[B]];if(i.op!==I.ALT&&i.op!==I.ALT_MATCH&&(s="arg",B="out",i=e.inst[n[B]],i.op!==I.ALT&&i.op!==I.ALT_MATCH))continue;let o=e.inst[n[s]];if(o.op===I.ALT||o.op===I.ALT_MATCH)continue;let a="out",c="arg",u=!1;i.out===t?u=!0:i.arg===t&&(u=!0,a="arg",c="out"),u&&(i[a]=n[s]),n[s]===i[a]&&(n[B]=i[c])}return e},Xu=r=>{if(r.inst.length>=1e3)return null;let e=new Ui(r.inst.length),t=new Ui(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),B=i=>{let o=!0,a=r.inst[i];if(t.contains(i))return!0;switch(t.insert(i),a.op){case I.ALT:case I.ALT_MATCH:{o=B(a.out)&&B(a.arg);let c=s[a.out],u=s[a.arg];if(c&&u)return!1;if(u){let d=a.out;a.out=a.arg,a.arg=d;let h=c;c=u,u=h}c&&(s[i]=!0,a.op=I.ALT_MATCH);let l=n[a.out]||[],f=n[a.arg]||[],C=Wu(l,f,a.out,a.arg);if(!C)return!1;n[i]=new Int32Array(C.merged),a.next=new Uint32Array(C.next);break}case I.CAPTURE:case I.EMPTY_WIDTH:case I.NOP:o=B(a.out),s[i]=s[a.out],n[i]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[i].length/2)+1).fill(a.out);break;case I.MATCH:case I.FAIL:s[i]=a.op===I.MATCH;break;case I.RUNE:{if(s[i]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[i]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let c=[];if(a.runes.length===1&&(a.arg&M.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=J.simpleFold(u);l!==u;l=J.simpleFold(l))c.push(l,l);c.sort((l,f)=>l-f)}else for(let u=0;u<a.runes.length;u++)c.push(a.runes[u]);n[i]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=I.RUNE;break}case I.RUNE1:{if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let c=[];if((a.arg&M.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=J.simpleFold(u);l!==u;l=J.simpleFold(l))c.push(l,l);c.sort((l,f)=>l-f)}else c.push(a.runes[0],a.runes[0]);n[i]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=I.RUNE;break}case I.RUNE_ANY:if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[i]=new Int32Array([0,J.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case I.RUNE_ANY_NOT_NL:if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[i]=new Int32Array([0,9,11,J.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[i].length/2)+1).fill(a.out)}return o};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!B(e.next()))return null;for(let i=0;i<r.inst.length;i++)n[i]&&(r.inst[i].runes=n[i]);return r},ec=(r,e)=>{for(let t=0;t<e.inst.length;t++){let n=e.inst[t];switch(n.op){case I.ALT:case I.ALT_MATCH:case I.RUNE:break;case I.CAPTURE:case I.EMPTY_WIDTH:case I.NOP:case I.MATCH:case I.FAIL:r.inst[t].next=null;break;case I.RUNE1:case I.RUNE_ANY:case I.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)}}},Ki=class wo{static compile(e){if(e.start===0||e.numLb>0)return null;let t=e.inst[e.start];if(t.op!==I.EMPTY_WIDTH||(t.arg&_.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let B=0;B<e.inst.length;B++)if(e.inst[B].op===I.ALT||e.inst[B].op===I.ALT_MATCH){n=!0;break}for(let B=0;B<e.inst.length;B++){let i=e.inst[B],o=e.inst[i.out].op;switch(i.op){case I.ALT:case I.ALT_MATCH:if(o===I.MATCH||e.inst[i.arg].op===I.MATCH)return null;break;case I.EMPTY_WIDTH:if(o===I.MATCH){if((i.arg&_.EMPTY_END_TEXT)===_.EMPTY_END_TEXT)continue;return null}break;default:if(o===I.MATCH&&n)return null}}let s=Zu(e);return s=Xu(s),s!==null&&ec(s,e),s}static next(e,t){let n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===I.ALT_MATCH?e.out:0}static execute(e,t,n,s,B){let i=e.onepass;if(!i)return null;let o=new Int32Array(B).fill(-1),a=!1,c=t.step(n),u=c>>3,l=c&7,f=Ne.EOF(),C=-1,d=0;c!==Ne.EOF()&&(f=t.step(n+l),f!==Ne.EOF()&&(C=f>>3,d=f&7));let h=n===0?_.emptyOpContext(-1,u):t.context(n),k=i.start,R;for(;;){switch(R=i.inst[k],k=R.out,R.op){case I.MATCH:return s===M.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,o.length>0&&(o[0]=0,o[1]=n),B===0?[]:_.toArray(o));case I.RUNE:if(!R.matchRune(u))return null;break;case I.RUNE1:if(u!==R.runes[0])return null;break;case I.RUNE_ANY:break;case I.RUNE_ANY_NOT_NL:if(u===10)return null;break;case I.ALT:case I.ALT_MATCH:k=wo.next(R,u);continue;case I.FAIL:return null;case I.NOP:continue;case I.EMPTY_WIDTH:if((R.arg&~h)!==0)return null;continue;case I.CAPTURE:R.arg<o.length&&(o[R.arg]=n);continue;default:throw new jn("bad inst")}if(l===0)break;h=_.emptyOpContext(u,C),n+=l,u=C,l=d,u!==-1&&(f=t.step(n+l),f!==Ne.EOF()?(C=f>>3,d=f&7):(C=-1,d=0))}return a?B===0?[]:_.toArray(o):null}},D=class W{static Op=po(["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>=W.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===L.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new W(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=W.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=W.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 W.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case W.Op.EMPTY_MATCH:e+="(?:)";break;case W.Op.STAR:case W.Op.PLUS:case W.Op.QUEST:case W.Op.REPEAT:{let t=this.subs[0];switch(t.op>W.Op.CAPTURE||t.op===W.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case W.Op.STAR:e+="*";break;case W.Op.PLUS:e+="+";break;case W.Op.QUEST:e+="?";break;case W.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}(this.flags&M.NON_GREEDY)!==0&&(e+="?");break}case W.Op.CONCAT:for(let t of this.subs)t.op===W.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case W.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case W.Op.LITERAL:(this.flags&M.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=_.escapeRune(t);(this.flags&M.FOLD_CASE)!==0&&(e+=")");break;case W.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case W.Op.ANY_CHAR:e+="(?s:.)";break;case W.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case W.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case W.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==W.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case W.Op.BEGIN_TEXT:e+="\\A";break;case W.Op.END_TEXT:(this.flags&M.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case W.Op.BEGIN_LINE:e+="^";break;case W.Op.END_LINE:e+="$";break;case W.Op.WORD_BOUNDARY:e+="\\b";break;case W.Op.NO_WORD_BOUNDARY:e+="\\B";break;case W.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+=W.quoteIfHyphen(n),e+=_.escapeRune(n),n!==s&&(e+="-",e+=W.quoteIfHyphen(s),e+=_.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=W.quoteIfHyphen(n),e+=_.escapeRune(n),n!==s&&(e+="-",e+=W.quoteIfHyphen(s),e+=_.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===W.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 W)||this.op!==e.op)return!1;switch(this.op){case W.Op.END_TEXT:if((this.flags&M.WAS_DOLLAR)!==(e.flags&M.WAS_DOLLAR))return!1;break;case W.Op.LITERAL:case W.Op.CHAR_CLASS:if((this.flags&M.FOLD_CASE)!==(e.flags&M.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 W.Op.ALTERNATE:case W.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 W.Op.STAR:case W.Op.PLUS:case W.Op.QUEST:if((this.flags&M.NON_GREEDY)!==(e.flags&M.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case W.Op.REPEAT:if((this.flags&M.NON_GREEDY)!==(e.flags&M.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case W.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 W.Op.PLB:case W.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},nB=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let B=e.enter(n);if(B.result===void 0){t.push({re:n,state:B,i:0}),n=n.subs[0];continue}s=B.result}for(;;){if(t.length===0)return s;let B=t[t.length-1];if(e.child(B.re,B.state,s,B.i),B.i++,B.state.result===void 0&&B.i<B.re.subs.length){n=B.re.subs[B.i];break}t.pop(),s=B.state.result!==void 0?B.state.result:e.leave(B.re,B.state)}}}},ji=class{constructor(r,e){let t=new Map,n=[0],s=[0],B=[0],i=[0];for(let d of r){let h=0;for(let k=0;k<d.length;k++){let R=h*e+d[k],E=t.get(R);E===void 0&&(E=n.length,t.set(R,E),n.push(h),s.push(d[k]),B.push(B[h]+1),i.push(0)),h=E}i[h]=1}let o=n.length,a=new Int32Array(o-1);for(let d=1;d<o;d++)a[d-1]=d;a.sort((d,h)=>n[d]-n[h]||s[d]-s[h]);let c=new Int32Array(o+1);for(let d=1;d<o;d++)c[n[d]+1]++;for(let d=0;d<o;d++)c[d+1]+=c[d];let u=new Int32Array(o-1);for(let d=0;d<a.length;d++)u[d]=s[a[d]];this.childStart=c,this.childUnit=u,this.childNode=a;let l=new Int32Array(o);for(let d=0;d<o;d++)l[d]=d;l.sort((d,h)=>B[d]-B[h]);let f=new Int32Array(o),C=Uint8Array.from(i);for(let d=1;d<o;d++){let h=l[d],k=n[h];if(k!==0){let R=f[k],E=this.next(R,s[h]);for(;E<0&&R!==0;)R=f[R],E=this.next(R,s[h]);f[h]=E>=0?E:0}C[h]|=C[f[h]]}this.fail=f,this.match=C}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let B=t+n>>1,i=s[B];if(i===e)return this.childNode[B];i<e?t=B+1:n=B}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}},re=class cn{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===cn.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 ji(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new ji(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case cn.Type.NONE:return!0;case cn.Type.EXACT:return e.hasString(this,t);case cn.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case cn.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}}},tc=class fn{static build(e){return e?nB.walk(e,fn.WALKER):new re(re.Type.NONE)}static WALKER={leaf:e=>fn.leaf(e),enter:e=>fn.enter(e),child:(e,t,n)=>fn.child(e,t,n),leave:(e,t)=>fn.leave(e,t)};static leaf(e){if(e.op!==D.Op.LITERAL)return new re(re.Type.NONE);if(e.runes.length===0||(e.flags&M.FOLD_CASE)!==0)return new re(re.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(J.isUnsearchable(e.runes[s]))return new re(re.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new re(re.Type.EXACT);return n.str=t,n.bytes=_.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case D.Op.CAPTURE:case D.Op.PLUS:return{sub:null};case D.Op.REPEAT:return e.min>=1?{sub:null}:{result:new re(re.Type.NONE)};case D.Op.CONCAT:return{pf:new re(re.Type.AND),subs:[]};case D.Op.ALTERNATE:return{pf:new re(re.Type.OR),subs:[]};default:return{result:new re(re.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===re.Type.AND){if(n.type===re.Type.NONE)return;if(n.type===re.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===re.Type.NONE){t.result=new re(re.Type.NONE);return}if(n.type===re.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,B=[];for(let c of t.subs){if(c.type===re.Type.EXACT){if(s.has(c.str))continue;s.add(c.str)}B.push(c)}if(n.type===re.Type.AND){let c=[],u=0;for(let l of B)u+l.cost>re.MAX_SCANS||(c.push(l),u+=l.cost);return c.length===0?new re(re.Type.NONE):c.length===1?c[0]:(n.subs=c,n.cost=u,n)}if(B.length===0)return new re(re.Type.NONE);if(B.length===1)return B[0];n.subs=B;let i=!0,o=0,a=0;for(let c of B)c.type!==re.Type.EXACT?i=!1:a+=c.bytes.length,o+=c.cost;return i?a>re.MAX_AC_UNITS?new re(re.Type.NONE):(n.allExact=!0,n.cost=1,n):o>re.MAX_SCANS?new re(re.Type.NONE):(n.cost=o,n)}},je=class{constructor(r=0,e=0){this.head=r,this.tail=e}},nc=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 I(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 I.ALT:case I.ALT_MATCH:e.push(n.out,n.arg);break;case I.MATCH:case I.FAIL:break;default:e.push(n.out)}}this.lbInst=r}skipNop(r){let e=this.inst[r];for(;e.op===I.NOP||e.op===I.CAPTURE;)e=this.inst[r],r=e.out;return e}prefix(){let r="",e=this.skipNop(this.start);if(!I.isRuneOp(e.op)||e.runes.length!==1)return[e.op===I.MATCH,r];for(;I.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&M.FOLD_CASE)===0&&!J.isUnsearchable(e.runes[0]);)r+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===I.MATCH,r]}startCond(){let r=0,e=this.start;e:for(;;){let t=this.inst[e];switch(t.op){case I.EMPTY_WIDTH:r|=t.arg;break;case I.FAIL:return-1;case I.CAPTURE:case I.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 je(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+=`
|
|
60
|
+
`}return r}},rc=new Int32Array([0,L.CODES.get(`
|
|
61
|
+
`)-1,L.CODES.get(`
|
|
62
|
+
`)+1,J.MAX_RUNE]),zi=new Int32Array([0,J.MAX_RUNE]),Pr=class{constructor(r=0,e=new je,t=!1){this.i=r,this.out=e,this.nullable=t}},xo=class Xs{static compileRegexp(e){let t=new Xs,n=t.compile(e);return t.prog.patch(n.out,t.newInst(I.MATCH).i),t.prog.start=n.i,t.prog.markLookbehindInsts(),t.prog}static compileSet(e){let t=new Xs;if(e.length===0)return t.prog.start=t.newInst(I.FAIL).i,t.prog.markLookbehindInsts(),t.prog;let n=[];for(let B=0;B<e.length;B++){let i=t.compile(e[B]),o=t.newInst(I.MATCH);t.prog.getInst(o.i).arg=B,t.prog.patch(i.out,o.i),n.push(i.i)}let s=n[0];for(let B=1;B<n.length;B++){let i=t.newInst(I.ALT),o=t.prog.getInst(i.i);o.out=s,o.arg=n[B],s=i.i}return t.prog.start=s,t.prog.markLookbehindInsts(),t.prog}constructor(){this.prog=new nc,this.newInst(I.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 Pr(this.prog.numInst()-1,new je,!0)}nop(){let e=this.newInst(I.NOP);return e.out=new je(e.i<<1,e.i<<1),e}fail(){return new Pr}cap(e){let t=this.newInst(I.CAPTURE);return t.out=new je(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 Pr(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(I.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(I.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new je(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new je(n.i<<1|1,n.i<<1|1)),this.prog.patch(e.out,n.i),n}quest(e,t){let n=this.newInst(I.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new je(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new je(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 Pr(e.i,this.loop(e,t).out,e.nullable)}empty(e){let t=this.newInst(I.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new je(t.i<<1,t.i<<1),t}rune(e,t){let n=this.newInst(I.RUNE);n.nullable=!1;let s=this.prog.getInst(n.i);return s.runes=e,t&=M.FOLD_CASE,(e.length!==1||J.simpleFold(e[0])===e[0])&&(t&=~M.FOLD_CASE),s.arg=t,n.out=new je(n.i<<1,n.i<<1),(t&M.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?s.op=I.RUNE1:e.length===2&&e[0]===0&&e[1]===J.MAX_RUNE?s.op=I.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===L.CODES.get(`
|
|
63
|
+
`)-1&&e[2]===L.CODES.get(`
|
|
64
|
+
`)+1&&e[3]===J.MAX_RUNE&&(s.op=I.RUNE_ANY_NOT_NL),n}lookBehind(e,t){let n=this.newInst(I.LB_WRITE);this.prog.getInst(n.i).arg=t;let s=this.rune(zi,0),B=this.star(s,!0),i=this.cat(B,e);this.prog.patch(i.out,n.i);let o=this.newInst(I.LB_CHECK);return this.prog.getInst(o.i).arg=t,this.prog.lbStarts.push(i.i),Math.abs(t)>this.prog.numLb&&(this.prog.numLb=Math.abs(t)),o.out=new je(o.i<<1,o.i<<1),o}compile(e){return nB.walk(e,this.walker)}leaf(e){switch(e.op){case D.Op.NO_MATCH:return this.fail();case D.Op.EMPTY_MATCH:return this.nop();case D.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 B=this.rune(s,e.flags);t=t===null?B:this.cat(t,B)}return t}case D.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case D.Op.ANY_CHAR_NOT_NL:return this.rune(rc,0);case D.Op.ANY_CHAR:return this.rune(zi,0);case D.Op.BEGIN_LINE:return this.empty(_.EMPTY_BEGIN_LINE);case D.Op.END_LINE:return this.empty(_.EMPTY_END_LINE);case D.Op.BEGIN_TEXT:return this.empty(_.EMPTY_BEGIN_TEXT);case D.Op.END_TEXT:return this.empty(_.EMPTY_END_TEXT);case D.Op.WORD_BOUNDARY:return this.empty(_.EMPTY_WORD_BOUNDARY);case D.Op.NO_WORD_BOUNDARY:return this.empty(_.EMPTY_NO_WORD_BOUNDARY);case D.Op.CONCAT:case D.Op.ALTERNATE:return this.nop();default:throw new Kn("regexp: unhandled case in compile")}}enter(e){switch(e.op){case D.Op.PLB:case D.Op.NLB:case D.Op.STAR:case D.Op.PLUS:case D.Op.QUEST:return{sub:null};case D.Op.CAPTURE:return{bra:this.cap(e.cap<<1),sub:null};case D.Op.CONCAT:case D.Op.ALTERNATE:return{f:null};default:throw new Kn("regexp: unhandled case in compile")}}child(e,t,n){e.op===D.Op.CONCAT?t.f=t.f===null?n:this.cat(t.f,n):e.op===D.Op.ALTERNATE?t.f=t.f===null?n:this.alt(t.f,n):t.sub=n}leave(e,t){switch(e.op){case D.Op.PLB:case D.Op.NLB:return this.lookBehind(t.sub,e.lb);case D.Op.CAPTURE:{let n=this.cap(e.cap<<1|1);return this.cat(this.cat(t.bra,t.sub),n)}case D.Op.STAR:return this.star(t.sub,(e.flags&M.NON_GREEDY)!==0);case D.Op.PLUS:return this.plus(t.sub,(e.flags&M.NON_GREEDY)!==0);case D.Op.QUEST:return this.quest(t.sub,(e.flags&M.NON_GREEDY)!==0);case D.Op.CONCAT:case D.Op.ALTERNATE:return t.f;default:throw new Kn("regexp: unhandled case in compile")}}},ko=class Fe{static simplify(e){return e===null?null:nB.walk(e,Fe.WALKER)}static WALKER={leaf:e=>Fe.leaf(e),enter:e=>Fe.enter(e),child:(e,t,n,s)=>Fe.child(e,t,n,s),leave:(e,t)=>Fe.leave(e,t)};static leaf(e){if(e.op===D.Op.CHAR_CLASS){if(e.runes===null)return e;if(e.runes.length===0)return new D(D.Op.NO_MATCH);if(e.runes.length===2&&e.runes[0]===0&&e.runes[1]===J.MAX_RUNE)return new D(D.Op.ANY_CHAR);if(e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
|
|
65
|
+
`)-1&&e.runes[2]===L.CODES.get(`
|
|
66
|
+
`)+1&&e.runes[3]===J.MAX_RUNE)return new D(D.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case D.Op.PLB:case D.Op.NLB:case D.Op.CAPTURE:case D.Op.STAR:case D.Op.PLUS:case D.Op.QUEST:return{sub:null};case D.Op.CONCAT:case D.Op.ALTERNATE:return{subs:[],changed:!1};case D.Op.REPEAT:return e.min===0&&e.max===0?{result:new D(D.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===D.Op.CONCAT){if(n.op===D.Op.NO_MATCH){t.result=new D(D.Op.NO_MATCH);return}if(n.op===D.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===D.Op.CONCAT){t.changed=!0;for(let B=0;B<n.subs.length;B++)t.subs.push(n.subs[B]);return}}else{if(n.op===D.Op.NO_MATCH){t.changed=!0;return}if(n.op===D.Op.ALTERNATE){t.changed=!0;for(let B=0;B<n.subs.length;B++)t.subs.push(n.subs[B]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case D.Op.PLB:case D.Op.NLB:case D.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=D.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case D.Op.CONCAT:case D.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new D(e.op===D.Op.CONCAT?D.Op.EMPTY_MATCH:D.Op.NO_MATCH);if(n.length===1)return n[0];let s=D.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case D.Op.STAR:case D.Op.PLUS:case D.Op.QUEST:return Fe.simplify1(e.op,e.flags,t.sub,e);case D.Op.REPEAT:return Fe.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return Fe.simplify1(D.Op.STAR,e.flags,t,null);if(e.min===1)return Fe.simplify1(D.Op.PLUS,e.flags,t,null);let s=[];for(let B=0;B<e.min-1;B++)s.push(t);return s.push(Fe.simplify1(D.Op.PLUS,e.flags,t,null)),Fe.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=Fe.simplify1(D.Op.QUEST,e.flags,t,null);for(let B=e.min+1;B<e.max;B++)s=Fe.simplify1(D.Op.QUEST,e.flags,Fe.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?Fe.concat(n):new D(D.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let B=e[s];if(B.op===D.Op.NO_MATCH)return new D(D.Op.NO_MATCH);if(B.op!==D.Op.EMPTY_MATCH){if(B.op===D.Op.CONCAT){for(let i=0;i<B.subs.length;i++)t.push(B.subs[i]);continue}t.push(B)}}if(t.length===0)return new D(D.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new D(D.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===D.Op.EMPTY_MATCH)return n;if(n.op===D.Op.NO_MATCH)return e===D.Op.PLUS?n:new D(D.Op.EMPTY_MATCH);if(e===n.op&&(t&M.NON_GREEDY)===(n.flags&M.NON_GREEDY))return n;if(s!==null&&s.op===e&&(s.flags&M.NON_GREEDY)===(t&M.NON_GREEDY)&&n===s.subs[0])return s;let B=new D(e);return B.flags=t,B.subs=[n],B}},ie=class{constructor(r,e){this.sign=r,this.cls=e}},Yi=[48,57],Qi=[9,10,12,13,32,32],qi=[48,57,65,90,95,95,97,122],Wi=new Map([["\\d",new ie(1,Yi)],["\\D",new ie(-1,Yi)],["\\s",new ie(1,Qi)],["\\S",new ie(-1,Qi)],["\\w",new ie(1,qi)],["\\W",new ie(-1,qi)]]),Vi=[48,57,65,90,97,122],Zi=[65,90,97,122],Xi=[0,127],eo=[9,9,32,32],to=[0,31,127,127],no=[48,57],ro=[33,126],so=[97,122],Bo=[32,126],io=[33,47,58,64,91,96,123,126],oo=[9,13,32,32],ao=[65,90],lo=[48,57,65,90,95,95,97,122],uo=[48,57,65,70,97,102],co=new Map([["[:alnum:]",new ie(1,Vi)],["[:^alnum:]",new ie(-1,Vi)],["[:alpha:]",new ie(1,Zi)],["[:^alpha:]",new ie(-1,Zi)],["[:ascii:]",new ie(1,Xi)],["[:^ascii:]",new ie(-1,Xi)],["[:blank:]",new ie(1,eo)],["[:^blank:]",new ie(-1,eo)],["[:cntrl:]",new ie(1,to)],["[:^cntrl:]",new ie(-1,to)],["[:digit:]",new ie(1,no)],["[:^digit:]",new ie(-1,no)],["[:graph:]",new ie(1,ro)],["[:^graph:]",new ie(-1,ro)],["[:lower:]",new ie(1,so)],["[:^lower:]",new ie(-1,so)],["[:print:]",new ie(1,Bo)],["[:^print:]",new ie(-1,Bo)],["[:punct:]",new ie(1,io)],["[:^punct:]",new ie(-1,io)],["[:space:]",new ie(1,oo)],["[:^space:]",new ie(-1,oo)],["[:upper:]",new ie(1,ao)],["[:^upper:]",new ie(-1,ao)],["[:word:]",new ie(1,lo)],["[:^word:]",new ie(-1,lo)],["[:xdigit:]",new ie(1,uo)],["[:^xdigit:]",new ie(-1,uo)]]),Pt=class _r{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let B=e[s],i=e[s+1];B===i?n+=`0x${B.toString(16)}`:n+=`0x${B.toString(16)}-0x${i.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let i=0;i<n;i++)s[i]=i;s.sort((i,o)=>e[2*i]-e[2*o]||e[2*o+1]-e[2*i+1]);let B=e.slice(0,t);for(let i=0;i<n;i++)e[2*i]=B[2*s[i]],e[2*i+1]=B[2*s[i]+1]}constructor(e=_.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;_r.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&M.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],B=this.r[this.len-n+1];if(e<=B+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>B&&(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],B=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=B+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),B=e.getStride(t);if(B===1){this.appendRange(n,s);continue}for(let i=n;i<=s;i+=B)this.appendRange(i,i)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),B=e.getHi(n),i=e.getStride(n);if(i===1){t<=s-1&&this.appendRange(t,s-1),t=B+1;continue}for(let o=s;o<=B;o+=i)t<=o-1&&this.appendRange(t,o-1),t=o+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],B=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=B+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 _r().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return _r.charClassToString(this.r,this.len)}},sc=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+=_.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()}},Un=class Y{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 p(new Uint32Array([0,J.MAX_RUNE,1]));static ASCII_TABLE=new p(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new p(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:Y.ANY_TABLE,fold:Y.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Y.ASCII_TABLE,fold:Y.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:Ge.CATEGORIES.get("Cn"),fold:Ge.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:Ge.CATEGORIES.get("LC"),fold:Ge.FOLD_CATEGORIES.get("LC"),sign:1}:Ge.CATEGORIES.has(e)?{tab:Ge.CATEGORIES.get(e),fold:Ge.FOLD_CATEGORIES.get(e),sign:1}:Ge.SCRIPTS.has(e)?{tab:Ge.SCRIPTS.get(e),fold:Ge.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===D.Op.EMPTY_MATCH)return null;if(e.op===D.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===D.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new D(D.Op.LITERAL);return n.flags=t,n.runes=_.stringToRunes(e),n}static parse(e,t){return new Y(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=Y.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=Y.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 fe(Y.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("_")&&!_.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===D.Op.LITERAL&&e.runes.length===1||e.op===D.Op.CHAR_CLASS||e.op===D.Op.ANY_CHAR_NOT_NL||e.op===D.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case D.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case D.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 D.Op.ANY_CHAR_NOT_NL:return t!==L.CODES.get(`
|
|
67
|
+
`);case D.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case D.Op.ANY_CHAR:break;case D.Op.ANY_CHAR_NOT_NL:Y.matchRune(t,L.CODES.get(`
|
|
68
|
+
`))&&(e.op=D.Op.ANY_CHAR);break;case D.Op.CHAR_CLASS:{let n=new Pt(Array.isArray(e.runes)?e.runes:Array.from(e.runes));t.op===D.Op.LITERAL?n.appendLiteral(t.runes[0],t.flags):n.appendClass(t.runes),e.runes=n.toGrowableArray();break}case D.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=D.Op.CHAR_CLASS,e.runes=new Pt().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 fe(Y.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 B=1;B<3&&!(!e.more()||e.peek()<L.CODES.get("0")||e.peek()>L.CODES.get("7"));B++)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 i=0,o=0;for(;;){if(!e.more())break e;if(n=e.pop(),n===L.CODES.get("}"))break;let a=_.unhex(n);if(a<0||(o=o*16+a,o>J.MAX_RUNE))break e;i++}if(i===0)break e;return o}let s=_.unhex(n);if(!e.more())break;n=e.pop();let B=_.unhex(n);if(s<0||B<0)break;return s*16+B}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(`
|
|
69
|
+
`);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&&!_.isalnum(n))return n}throw new fe(Y.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new fe(Y.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?Y.parseEscape(e):e.pop()}static hasCapture(e){if(e===null)return!1;if(e.op===D.Op.CAPTURE)return!0;if(e.subs){for(let t of e.subs)if(Y.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 D(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>Y.MAX_RUNES)throw new fe(Y.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===D.Op.REPEAT){let t=e.max;t===-1&&(t=e.min),t<=0&&(t=1),t>Math.floor(Y.MAX_SIZE/this.repeats)?this.repeats=Y.MAX_SIZE:this.repeats*=t}if(this.numRegexp<Math.floor(Y.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>Y.MAX_SIZE)throw new fe(Y.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 D.Op.LITERAL:n=e.runes.length;break;case D.Op.PLB:case D.Op.NLB:case D.Op.CAPTURE:case D.Op.STAR:n=2+this.calcSize(e.subs[0]);break;case D.Op.PLUS:case D.Op.QUEST:n=1+this.calcSize(e.subs[0]);break;case D.Op.CONCAT:for(let s of e.subs)n=n+this.calcSize(s);break;case D.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 D.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<Y.MAX_HEIGHT)){if(this.height===null){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>Y.MAX_HEIGHT)throw new fe(Y.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 B=this.calcHeight(s);n<1+B&&(n=1+B)}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&&!D.isPseudoOp(this.stack[t-1].op);)t--;return this.stack.splice(t,e-t)}push(e){if(this.numRunes+=e.runes.length,e.op===D.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&~M.FOLD_CASE))return null;e.op=D.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&~M.FOLD_CASE}else if(e.op===D.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===D.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|M.FOLD_CASE))return null;e.op=D.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|M.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],B=this.stack[n-2];if(s.op!==D.Op.LITERAL||B.op!==D.Op.LITERAL||(s.flags&M.FOLD_CASE)!==(B.flags&M.FOLD_CASE))return!1;Array.isArray(B.runes)||(B.runes=Array.from(B.runes));for(let i=0;i<s.runes.length;i++)B.runes.push(s.runes[i]);return e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1)}newLiteral(e,t){let n=this.newRegexp(D.Op.LITERAL);return n.flags=t,(t&M.FOLD_CASE)!==0&&(e=Y.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,B,i){let o=this.flags;if((o&M.PERL_X)!==0&&(B.more()&&B.lookingAt("?")&&(B.skip(1),o^=M.NON_GREEDY),i!==-1))throw new fe(Y.ERR_INVALID_REPEAT_OP,B.from(i));let a=this.stack.length;if(a===0)throw new fe(Y.ERR_MISSING_REPEAT_ARGUMENT,B.from(s));let c=this.stack[a-1];if(D.isPseudoOp(c.op))throw new fe(Y.ERR_MISSING_REPEAT_ARGUMENT,B.from(s));let u=this.newRegexp(e);if(u.min=t,u.max=n,u.flags=o,u.subs=[c],this.stack[a-1]=u,this.checkLimits(u),e===D.Op.REPEAT&&(t>=2||n>=2)&&!this.repeatIsValid(u,1e3))throw new fe(Y.ERR_INVALID_REPEAT_SIZE,B.from(s))}repeatIsValid(e,t){if(e.op===D.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(D.Op.EMPTY_MATCH)):this.push(this.collapse(e,D.Op.CONCAT))}alternate(){let e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(D.Op.NO_MATCH)):this.push(this.collapse(e,D.Op.ALTERNATE))}cleanAlt(e){e.op===D.Op.CHAR_CLASS&&(e.runes=new Pt(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=D.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
|
|
70
|
+
`)-1&&e.runes[2]===L.CODES.get(`
|
|
71
|
+
`)+1&&e.runes[3]===J.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=D.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let n=0;for(let o of e)n+=o.op===t?o.subs.length:1;let s=new Array(n).fill(null),B=0;for(let o of e)if(o.op===t){for(let a=0;a<o.subs.length;a++)s[B++]=o.subs[a];this.reuse(o)}else s[B++]=o;let i=this.newRegexp(t);if(i.subs=s,t===D.Op.ALTERNATE&&(i.subs=this.factor(i.subs),i.subs.length===1)){let o=i;i=i.subs[0],this.reuse(o)}return i}factor(e){if(e.length<2)return e;let t=0,n=e.length,s=0,B=null,i=0,o=0,a=0;for(let u=0;u<=n;u++){let l=null,f=0,C=0;if(u<n){let d=e[t+u];if(d.op===D.Op.CONCAT&&d.subs.length>0&&(d=d.subs[0]),d.op===D.Op.LITERAL&&(l=d.runes,f=d.runes.length,C=d.flags&M.FOLD_CASE),C===o){let h=0;for(;h<i&&h<f&&B[h]===l[h];)h++;if(h>0){i=h;continue}}}if(u!==a)if(u===a+1)e[s++]=e[t+a];else{let d=this.newRegexp(D.Op.LITERAL);d.flags=o,d.runes=B.slice(0,i);for(let R=a;R<u;R++)e[t+R]=this.removeLeadingString(e[t+R],i),this.checkLimits(e[t+R]);let h=this.collapse(e.slice(t+a,t+u),D.Op.ALTERNATE),k=this.newRegexp(D.Op.CONCAT);k.subs=[d,h],e[s++]=k}a=u,B=l,i=f,o=C}n=s,t=0,a=0,s=0;let c=null;for(let u=0;u<=n;u++){let l=null;if(!(u<n&&(l=Y.leadingRegexp(e[t+u]),c!==null&&c.equals(l)&&(Y.isCharClass(c)||c.op===D.Op.REPEAT&&c.min===c.max&&Y.isCharClass(c.subs[0]))))){if(u!==a)if(u===a+1)e[s++]=e[t+a];else{let f=c;for(let h=a;h<u;h++){let k=h!==a;e[t+h]=this.removeLeadingRegexp(e[t+h],k),this.checkLimits(e[t+h])}let C=this.collapse(e.slice(t+a,t+u),D.Op.ALTERNATE),d=this.newRegexp(D.Op.CONCAT);d.subs=[f,C],e[s++]=d}a=u,c=l}}n=s,t=0,a=0,s=0;for(let u=0;u<=n;u++)if(!(u<n&&Y.isCharClass(e[t+u]))){if(u!==a)if(u===a+1)e[s++]=e[t+a];else{let l=a;for(let C=a+1;C<u;C++){let d=e[t+l],h=e[t+C];(d.op<h.op||d.op===h.op&&(d.runes!==null?d.runes.length:0)<(h.runes!==null?h.runes.length:0))&&(l=C)}let f=e[t+a];e[t+a]=e[t+l],e[t+l]=f;for(let C=a+1;C<u;C++)Y.mergeCharClass(e[t+a],e[t+C]),this.reuse(e[t+C]);this.cleanAlt(e[t+a]),e[s++]=e[t+a]}u<n&&(e[s++]=e[t+u]),a=u+1}n=s,t=0,a=0,s=0;for(let u=0;u<n;++u)u+1<n&&e[t+u].op===D.Op.EMPTY_MATCH&&e[t+u+1].op===D.Op.EMPTY_MATCH||(e[s++]=e[t+u]);return n=s,t=0,e.slice(t,n)}removeLeadingString(e,t){if(e.op===D.Op.CONCAT&&e.subs.length>0){let n=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=n,n.op===D.Op.EMPTY_MATCH)switch(this.reuse(n),e.subs.length){case 0:case 1:e.op=D.Op.EMPTY_MATCH,e.subs=D.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===D.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),e.runes.length===0&&(e.op=D.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===D.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=D.Op.EMPTY_MATCH,e.subs=D.emptySubs();break;case 1:{let n=e;e=e.subs[0],this.reuse(n);break}}return e}return t&&this.reuse(e),this.newRegexp(D.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&M.LITERAL)!==0)return Y.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,n=-1,s=new sc(this.wholeRegexp);for(;s.more();){let B=-1;e:switch(s.peek()){case L.CODES.get("("):if((this.flags&M.LOOKBEHIND)!==0){if(s.lookingAt("(?<=")){this.parsePosLookBehind(),s.skip(4);break}if(s.lookingAt("(?<!")){this.parseNegLookBehind(),s.skip(4);break}}if((this.flags&M.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(D.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&M.ONE_LINE)!==0?this.op(D.Op.BEGIN_TEXT):this.op(D.Op.BEGIN_LINE),s.skip(1);break;case L.CODES.get("$"):(this.flags&M.ONE_LINE)!==0?this.op(D.Op.END_TEXT).flags|=M.WAS_DOLLAR:this.op(D.Op.END_LINE),s.skip(1);break;case L.CODES.get("."):(this.flags&M.DOT_NL)!==0?this.op(D.Op.ANY_CHAR):this.op(D.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("?"):{B=s.pos();let i=null;switch(s.pop()){case L.CODES.get("*"):i=D.Op.STAR;break;case L.CODES.get("+"):i=D.Op.PLUS;break;case L.CODES.get("?"):i=D.Op.QUEST}this.repeat(i,t,n,B,s,e);break}case L.CODES.get("{"):{let i=s.pos(),o=Y.parseRepeat(s);if(o<0){s.rewindTo(i),this.literal(s.pop());break}B=i,t=o>>16,n=(o&J.MAX_BMP)<<16>>16,this.repeat(D.Op.REPEAT,t,n,B,s,e);break}case L.CODES.get("\\"):{let i=s.pos();if(s.skip(1),(this.flags&M.PERL_X)!==0&&s.more())switch(s.pop()){case L.CODES.get("A"):this.op(D.Op.BEGIN_TEXT);break e;case L.CODES.get("b"):this.op(D.Op.WORD_BOUNDARY);break e;case L.CODES.get("B"):this.op(D.Op.NO_WORD_BOUNDARY);break e;case L.CODES.get("C"):throw new fe(Y.ERR_INVALID_ESCAPE,"\\C");case L.CODES.get("Q"):{let c=s.rest(),u=c.indexOf("\\E");u>=0?(c=c.substring(0,u),s.skipString(c),s.skipString("\\E")):s.skipString(c);let l=0;for(;l<c.length;){let f=c.codePointAt(l);this.literal(f),l+=_.charCount(f)}break e}case L.CODES.get("z"):this.op(D.Op.END_TEXT);break e;default:s.rewindTo(i)}else s.rewindTo(i);let o=this.newRegexp(D.Op.CHAR_CLASS);if(o.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){let c=new Pt;if(this.parseUnicodeClass(s,c)){o.runes=c.toArray(),this.push(o);break e}}let a=new Pt;if(this.parsePerlClassEscape(s,a)){o.runes=a.toArray(),this.push(o);break e}s.rewindTo(i),this.reuse(o),this.literal(Y.parseEscape(s));break}default:this.literal(s.pop())}e=B}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new fe(Y.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 o=n.charAt(2)==="P"?4:3,a=n.indexOf(">");if(a<0)throw new fe(Y.ERR_INVALID_NAMED_CAPTURE,n);let c=n.substring(o,a);if(e.skipString(c),e.skip(o+1),!Y.isValidCaptureName(c))throw new fe(Y.ERR_INVALID_NAMED_CAPTURE,n.substring(0,a+1));let u=this.op(D.Op.LEFT_PAREN);if(u.cap=++this.numCap,this.namedGroups[c])throw new fe(Y.ERR_DUPLICATE_NAMED_CAPTURE,c);this.namedGroups[c]=this.numCap,u.name=c;return}e.skip(2);let s=this.flags,B=1,i=!1;e:for(;e.more();){let o=e.pop();switch(o){case L.CODES.get("i"):s|=M.FOLD_CASE,i=!0;break;case L.CODES.get("m"):s&=~M.ONE_LINE,i=!0;break;case L.CODES.get("s"):s|=M.DOT_NL,i=!0;break;case L.CODES.get("U"):s|=M.NON_GREEDY,i=!0;break;case L.CODES.get("-"):if(B<0)break e;B=-1,s=~s,i=!1;break;case L.CODES.get(":"):case L.CODES.get(")"):if(B<0){if(!i)break e;s=~s}o===L.CODES.get(":")&&this.op(D.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new fe(Y.ERR_INVALID_PERL_OP,e.from(t))}parsePosLookBehind(){let e=this.newRegexp(D.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){let e=this.newRegexp(D.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(D.Op.VERTICAL_BAR)}swapVerticalBar(){let e=this.stack.length;if(e>=3&&this.stack[e-2].op===D.Op.VERTICAL_BAR&&Y.isCharClass(this.stack[e-1])&&Y.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 Y.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===D.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 fe(Y.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let e=this.pop(),t=this.pop();if(t.op!==D.Op.LEFT_PAREN)throw new fe(Y.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=t.flags,t.lb!==0){if(Y.hasCapture(e))throw new fe(Y.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);t.lb>0?t.op=D.Op.PLB:t.op=D.Op.NLB,t.subs=[e],this.push(t);return}t.cap===0?this.push(e):(t.op=D.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){let n=e.pos();if((this.flags&M.PERL_X)===0||!e.more()||e.pop()!==L.CODES.get("\\")||!e.more())return!1;e.pop();let s=e.from(n),B=Wi.has(s)?Wi.get(s):null;return B===null?!1:(t.appendGroup(B,(this.flags&M.FOLD_CASE)!==0),!0)}parseNamedClass(e,t){let n=e.rest(),s=n.indexOf(":]");if(s<0)return!1;let B=n.substring(0,s+2);e.skipString(B);let i=co.has(B)?co.get(B):null;if(i===null)throw new fe(Y.ERR_INVALID_CHAR_RANGE,B);return t.appendGroup(i,(this.flags&M.FOLD_CASE)!==0),!0}parseUnicodeClass(e,t){let n=e.pos();if((this.flags&M.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let s=1,B=e.pop();if(B===L.CODES.get("P")&&(s=-1),!e.more())throw e.rewindTo(n),new fe(Y.ERR_INVALID_CHAR_RANGE,e.rest());B=e.pop();let i;if(B!==L.CODES.get("{"))i=_.runeToString(B);else{let u=e.rest(),l=u.indexOf("}");if(l<0)throw e.rewindTo(n),new fe(Y.ERR_INVALID_CHAR_RANGE,e.rest());i=u.substring(0,l),e.skipString(i),e.skip(1)}i.length!==0&&i.codePointAt(0)===L.CODES.get("^")&&(s=0-s,i=i.substring(1));let o=Y.unicodeTable(i);if(o===null)throw new fe(Y.ERR_INVALID_CHAR_RANGE,e.from(n));o.sign<0&&(s=0-s);let a=o.tab,c=o.fold;if((this.flags&M.FOLD_CASE)===0||c===null)t.appendTableWithSign(a,s);else{let u=new Pt().appendTable(a).appendTable(c).cleanClass().toArray();t.appendClassWithSign(Array.from(u),s)}return!0}parseClass(e){let t=e.pos();e.skip(1);let n=this.newRegexp(D.Op.CHAR_CLASS);n.flags=this.flags;let s=new Pt,B=1;e.more()&&e.lookingAt("^")&&(B=-1,e.skip(1),(this.flags&M.CLASS_NL)===0&&s.appendRange(L.CODES.get(`
|
|
72
|
+
`),L.CODES.get(`
|
|
73
|
+
`)));let i=!0;for(;!e.more()||e.peek()!==L.CODES.get("]")||i;){if(e.more()&&e.lookingAt("-")&&(this.flags&M.PERL_X)===0&&!i){let u=e.rest();if(u==="-"||!u.startsWith("-]"))throw e.rewindTo(t),new fe(Y.ERR_INVALID_CHAR_RANGE,e.rest())}i=!1;let o=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(o)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(o);let a=Y.parseClassChar(e,t),c=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(c=Y.parseClassChar(e,t),c<a)throw new fe(Y.ERR_INVALID_CHAR_RANGE,e.from(o))}(this.flags&M.FOLD_CASE)===0?s.appendRange(a,c):s.appendFoldedRange(a,c)}e.skip(1),s.cleanClass(),B<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},Bc=class Jt{static initTest(e){let t=Jt.compile(e),n=new Jt(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 Jt.compileImpl(e,M.PERL,!1)}static compilePOSIX(e){return Jt.compileImpl(e,M.POSIX,!0)}static compileImpl(e,t,n){let s=Un.parse(e,t),B=s.maxCap(),i=s.namedGroups;s=ko.simplify(s);let o=tc.build(s),a=xo.compileRegexp(s),c=new Jt(e,a,B,n);c.prefilter=o.type===re.Type.NONE?null:o;let[u,l]=a.prefix();return c.prefixComplete=u,c.prefix=l,c.prefixUTF8=_.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=i,c}static match(e,t){return Jt.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 tB(this.prog),this.onepass=Ki.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,n,s){if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return null;let B=-1,i=-1,o=e.prefixLength(this);if(n===M.UNANCHORED){let a=e.index(this,t);if(a<0)return null;B=t+a,i=B+o}else if(n===M.ANCHOR_BOTH){if(e.endPos()!==o||e.index(this,0)!==0)return null;B=0,i=o}else if(n===M.ANCHOR_START){if(e.index(this,0)!==0)return null;B=0,i=o}if(B<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=B,a[1]=i,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new Uu(this.prog):null}executeEngine(e,t,n,s,B=null){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,n,s);if(this.prefilter!==null&&n===M.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return Ki.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=Hr.maxBitStateLen(this.prog)?Hr.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,B);if(this.prog.numLb===0){let i=this.dfa.match(e,t,n);if(i!==null)return i?[]:null;if(e.endPos()<=Hr.maxBitStateLen(this.prog))return Hr.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,B)}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,B=null){let i=this.get();i||(i=Eo.fromRE2(this)),i.init(s);let o=i.match(e,t,n,B)?i.submatches():null;return this.put(i),o}match(e){return this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,B,i=null){return e instanceof Kt||(_.isByteArray(e)?e=Ut.utf8(e):e=Ut.utf16(e)),this.matchMachineInput(e,t,n,s,B,i)}matchMachineInput(e,t,n,s,B,i=null){if(t>n)return[!1,null];let o=e.isUTF16Encoding()?ue.fromUTF16(e.asCharSequence(),0,n):ue.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(o,t,s,2*B,i);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(ue.fromUTF8(e),0,M.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,B=0,i="",o=ue.fromUTF16(e),a=this.createLookbehindState(),c=0;for(;B<=e.length;){let u=this.executeEngine(o,B,M.UNANCHORED,2,a);if(u===null||u.length===0)break;i+=e.substring(s,u[0]),(u[1]>s||u[0]===0)&&(i+=t(e.substring(u[0],u[1])),c++),s=u[1];let l=o.step(B)&7;if(B+l>u[1]?B+=l:B+1>u[1]?B++:B=u[1],c>=n)break}return i+=e.substring(s),i}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=[],B=e.endPos();t<0&&(t=B+1);let i=0,o=0,a=-1,c=this.createLookbehindState();for(;o<t&&i<=B;){let u=this.executeEngine(e,i,M.UNANCHORED,this.prog.numCap,c);if(u===null||u.length===0)break;let l=!0;if(u[1]===i){u[0]===a&&(l=!1);let f=e.step(i);f<0?i=B+1:i+=f&7}else i=u[1];a=u[1],l&&(s.push(n(this.pad(u))),o++)}return s}findUTF8(e){let t=this.executeEngine(ue.fromUTF8(e),0,M.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(ue.fromUTF8(e),0,M.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(ue.fromUTF8(e),0,M.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(ue.fromUTF8(e),0,M.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(ue.fromUTF16(e),0,M.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(ue.fromUTF16(e),0,M.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(ue.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(ue.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(ue.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(ue.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(ue.fromUTF8(e),t,s=>{let B=new Array(s.length/2|0).fill(null);for(let i=0;i<B.length;i++)s[2*i]>=0&&(B[i]=e.slice(s[2*i],s[2*i+1]));return B});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(ue.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(ue.fromUTF16(e),t,s=>{let B=new Array(s.length/2|0).fill(null);for(let i=0;i<B.length;i++)s[2*i]>=0&&(B[i]=e.substring(s[2*i],s[2*i+1]));return B});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(ue.fromUTF16(e),t);return n.length===0?null:n}},bh=class Jr{static UNANCHORED=M.UNANCHORED;static ANCHOR_START=M.ANCHOR_START;static ANCHOR_BOTH=M.ANCHOR_BOTH;constructor(e=Jr.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=M.PERL;(t&Ze.DISABLE_UNICODE_GROUPS)!==0&&(s&=~M.UNICODE_GROUPS),(t&Ze.LOOKBEHINDS)!==0&&(s|=M.LOOKBEHIND),this.re2Flags=s,this.regexps=[],this.prog=null,this.dfa=null,this.dummyRe2=null}add(e){if(this.prog)throw new Kn("Cannot add patterns after compile");let t=e;(this.jsFlags&Ze.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&Ze.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&Ze.MULTILINE)!==0&&(t=`(?m)${t}`);let n=Un.parse(t,this.re2Flags);return this.regexps.push(ko.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=xo.compileSet(this.regexps);if(e.numInst()>Un.MAX_SIZE)throw new Kn(`${Un.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${Un.MAX_SIZE}`);this.prog=e,this.dfa=new tB(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=_.isByteArray(e)?ue.fromUTF8(e):ue.fromUTF16(e),n=M.UNANCHORED;this.anchor===Jr.ANCHOR_START?n=M.ANCHOR_START:this.anchor===Jr.ANCHOR_BOTH&&(n=M.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let B=Eo.fromRE2(this.dummyRe2);return B.init(0),B.matchSet(t,0,n)}},ic=class Cn{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,B=e.length;B===0&&(n="(?:)",s=!0);let i=!1,o=0;for(;o<B;){let c=e[o];if(c==="\\"){if(o+1<B)switch(c=e[o+1],c){case"\\":n+="\\\\",o+=2;continue;case"c":if(o+2<B){let f=e[o+2].charCodeAt(0);if(f>=65&&f<=90||f>=97&&f<=122){let C=f%32;n+="\\x",n+=(C>>4).toString(16).toUpperCase(),n+=(C&15).toString(16).toUpperCase(),o+=3,s=!0;continue}}n+="c",o+=2,s=!0;continue;case"u":if(o+2<B){if(e[o+2]==="{"){let f=o+3,C=!1,d=!1;for(;f<B;){let h=e[f];if(h==="}"){d=!0;break}if(!Cn.isHexadecimal(h))break;C=!0,f++}if(d&&C){n+="\\x",o+=2,s=!0;continue}}else if(o+5<B){let f=!0;for(let C=0;C<4;C++)if(!Cn.isHexadecimal(e[o+2+C])){f=!1;break}if(f){n+="\\x{"+e.substring(o+2,o+6)+"}",o+=6,s=!0;continue}}}n+="u",o+=2,s=!0;continue;case"x":{let f=!1;if(o+2<B&&e[o+2]==="{"){let C=o+3,d=!1,h=!1;for(;C<B;){let k=e[C];if(k==="}"){h=!0;break}if(!Cn.isHexadecimal(k))break;d=!0,C++}h&&d&&(f=!0)}else o+3<B&&Cn.isHexadecimal(e[o+2])&&Cn.isHexadecimal(e[o+3])&&(f=!0);f?(n+="\\x",o+=2):(n+="x",o+=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+="\\"+c,o+=2;continue;default:{let f=e.codePointAt(o+1);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122){let C=_.charCount(f);n+=e.substring(o+1,o+1+C),o+=C+1,s=!0}else{n+="\\";let C=_.charCount(f);n+=e.substring(o+1,o+1+C),o+=C+1}continue}}}else if(c==="/"){n+="\\/",o+=1,s=!0;continue}else if(c==="[")i=!0;else if(c==="]")i=!1;else if(!i&&c==="("&&o+2<B&&e[o+1]==="?"&&e[o+2]==="<"&&o+3<B&&!"=!>)".includes(e[o+3])){n+="(?P<",o+=3,s=!0;continue}let u=e.codePointAt(o),l=_.charCount(u);n+=e.substring(o,o+l),o+=l}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},hn=class Ie{static CASE_INSENSITIVE=Ze.CASE_INSENSITIVE;static DOTALL=Ze.DOTALL;static MULTILINE=Ze.MULTILINE;static DISABLE_UNICODE_GROUPS=Ze.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=Ze.LONGEST_MATCH;static LOOKBEHINDS=Ze.LOOKBEHINDS;static quote(e){return _.quoteMeta(e)}static quoteReplacement(e,t=!1){return Pi.quoteReplacement(e,t)}static translateRegExp(e){return ic.translate(e)}static compile(e,t=0){let n=e;if((t&Ie.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&Ie.DOTALL)!==0&&(n=`(?s)${n}`),(t&Ie.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(Ie.MULTILINE|Ie.DOTALL|Ie.CASE_INSENSITIVE|Ie.DISABLE_UNICODE_GROUPS|Ie.LONGEST_MATCH|Ie.LOOKBEHINDS))!==0)throw new Ju("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=M.PERL;(t&Ie.DISABLE_UNICODE_GROUPS)!==0&&(s&=~M.UNICODE_GROUPS),(t&Ie.LOOKBEHINDS)!==0&&(s|=M.LOOKBEHIND);let B=new Ie(e,t);return B.re2Input=Bc.compileImpl(n,s,(t&Ie.LONGEST_MATCH)!==0),B}static matches(e,t){return Ie.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 Ie(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 _.isByteArray(e)&&(e=Ut.utf8(e)),new Pi(this,e)}test(e){return _.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=_.isByteArray(e)?ue.fromUTF8(e):ue.fromUTF16(e);return this.re2Input.executeEngine(t,0,M.ANCHOR_BOTH,0)!==null}exec(e){let t=this.matcher(e);if(!t.find())return null;let n=[t.group(0)];for(let B=1;B<=t.groupCount();B++){let i=t.group(B);n.push(i===null?void 0:i)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let B=t.getNamedGroups();for(let i in B)B[i]===null&&(B[i]=void 0);n.groups=B}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],B=0,i=0;for(;n.find();){if(i===0&&n.end()===0){i=n.end();continue}if(t>0&&s.length===t-1)break;if(i===n.start()){if(t===0){B+=1,i=n.end();continue}}else for(;B>0;)s.push(""),B-=1;s.push(n.substring(i,n.start())),i=n.end()}if(t===0&&i!==n.inputLength()){for(;B>0;)s.push(""),B-=1;s.push(n.substring(i,n.inputLength()))}return(t!==0||s.length===0&&!(i===n.inputLength()&&i>0))&&s.push(n.substring(i,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let B=1;B<=t.groupCount();B++){let i=t.group(B);n.push(i===null?void 0:i)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let B=t.getNamedGroups();for(let i in B)B[i]===null&&(B[i]=void 0);n.groups=B}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 vo="kubectl config current-context",oc=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function So(r){return r.length<=253&&oc.test(r)}var ac=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function jt(r){return r===void 0?void 0:ac.exec(r)?.[1]}function Ur(r){return So(r)||jt(r)!==void 0}function Kr(r,e){return r.kubeContext??e?.kubeContext}function Oo(r,e){let t=jt(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(!So(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 Ao(r){let e=jt(r);return e===void 0?"":`\${param:${e}}`}function lc(r,e){let t=e.stdout.split(/\r?\n/).map(B=>B.trim()).find(B=>B!=="");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(B=>B.trim()).find(B=>B!=="");return`${n}, and \`${vo}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function Ro(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?To(r):vo)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?uc(r,n):lc(r,n)}var yo=["check","pin"];function Fo(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
|
|
74
74
|
# Only the current context is here; clusters, users and credentials come from your own kubeconfig.
|
|
75
75
|
apiVersion: v1
|
|
76
76
|
kind: Config
|
|
@@ -79,67 +79,67 @@ clusters: []
|
|
|
79
79
|
contexts: []
|
|
80
80
|
users: []
|
|
81
81
|
current-context: ${JSON.stringify(r)}
|
|
82
|
-
`}function
|
|
82
|
+
`}function Io(r,e,t){return r+(t==="win32"?";":":")+e}function To(r){return`kubectl config get-contexts ${r}`}function uc(r,e){let t=e.stdout.split(/\r?\n/).map(B=>B.trim().split(/\s+/));if(e.exitCode===0&&t.some(B=>B[0]==="*"&&B[1]===r))return;let n=`md-runbook: this runbook pins the Kubernetes context ${r}`;if(e.exitCode===0&&t.some(B=>B[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(B=>B.trim()).find(B=>B!=="");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 \`${To(r)}\` ${s?`failed (${s})`:"did not list it"}: nothing ran.`}var ht=/^[A-Za-z_][A-Za-z0-9_]*$/,rB=/\$\{(secret|input|param|out):([A-Za-z_][A-Za-z0-9_]*)(:secret)?\}/g;function cc(r){return/_(PASSWORD|TOKEN|SECRET)$/i.test(r)}function Xe(r){let e=new Map;for(let t of r.matchAll(rB)){let n=t[1],s=t[2];if(t[3]&&n!=="input")continue;let B=n==="secret"||n==="input"&&(!!t[3]||cc(s)),i=e.get(s);if(i&&i.kind!==n)throw new Error(`${s} is referenced as both ${i.kind} and ${n}`);i?i.secret||=B:e.set(s,{kind:n,name:s,secret:B})}return[...e.values()]}function zr(r,e){return r.replace(rB,(t,n,s,B)=>B&&n!=="input"?t:e(n,s))}function fc(r,e){switch(e){case"bash":return"${"+r+"}";case"pwsh":return"${env:"+r+"}";case"cmd":return"!"+r+"!"}}var Cc="@setlocal EnableDelayedExpansion";function dn(r,e){let t=!1,n=r.replace(rB,(B,i,o,a)=>a&&i!=="input"?B:(t=!0,fc(o,e)));if(e!=="cmd"||!t)return n;let s=/\r\n/.test(r)?`\r
|
|
83
83
|
`:`
|
|
84
|
-
`;return
|
|
85
|
-
`)}function
|
|
86
|
-
`);function
|
|
87
|
-
`))}function
|
|
88
|
-
`).trim().replace(/^\*\*[^*]*:\*\*\s*/,""),B=rB.includes(n.milestone??"")?n.milestone:void 0;e.push({at:n.at,kind:"note",text:s,...n.by?{by:n.by}:{},...B?{milestone:B}:{}})}return e}var ic=(r,e)=>e==="failed"||r!==void 0&&!["0","done","skipped","running","proposed","declined"].includes(r)&&e!=="ok";function Fo(r,e,t,n,s){if(!r.ran||Number.isNaN(Date.parse(r.ran)))return;let B=r.exit==="done"||r.exit==="skipped",i=s===void 0?[]:Ro(s);return{at:r.ran,kind:B&&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:!ic(r.exit,r.check),...r.duration?{duration:r.duration}:{},...n?{earlier:!0}:{},...i.length?{checks:i}:{}}}var jr=(r,e)=>Math.max(0,Math.round((Date.parse(e)-Date.parse(r))/1e3));function zr(r){let e=Xe(r),t=[],n=Ee(r),s=n.cells.map(h=>pe(h.meta)?ve(h.meta.info):void 0),B=vt(n.cells.map((h,p)=>pe(h.meta)?{kind:"code",os:s[p]?.os}:{kind:"markup"}));for(let[h,p]of n.cells.entries()){let f=B[h];if(f===void 0||!pe(p.meta))continue;let w=s[h]?.name??p.value.split(/\r?\n/).find(E=>E.trim()!=="")?.trim()??`step ${f}`,k=Ao(p.value);if(p.output){let E=Fo(p.output.attrs,f,w,!1,k?p.output.text:void 0);E&&t.push(E)}for(let E of p.meta.history?.entries??[]){let x=Fo(E.attrs,f,w,!0,k?E.text:void 0);x&&t.push(x)}}t.push(...Bc(r)),t.sort((h,p)=>Date.parse(h.at)-Date.parse(p.at)||(h.step??0)-(p.step??0));let i={};for(let h of t)h.milestone&&!i[h.milestone]&&(i[h.milestone]=h.at);let o=t.filter(h=>h.kind==="run"),a=t[0]?.at,c=t[t.length-1]?.at,u=i.detected??a,l={...e?.incident?{incident:e.incident}:{},...e?.severity?{severity:e.severity}:{},...e?.drill?{drill:!0}:{},...a?{start:a}:{},...c?{end:c}:{},...a&&c?{durationSeconds:jr(a,c)}:{},runs:o.length,failedAttempts:o.filter(h=>!h.ok).length,milestones:i,...u&&i.mitigated?{timeToMitigateSeconds:jr(u,i.mitigated)}:{},...u&&i.resolved?{timeToResolveSeconds:jr(u,i.resolved)}:{},people:[...new Set(t.flatMap(h=>h.by?[h.by]:[]))],places:[...new Set(t.flatMap(h=>h.on?[h.on]:[]))]},C=t.flatMap(h=>h.earlier?[]:h.checks??[]);if(C.length&&(l.endpointChecks={total:C.length,failed:C.filter(h=>!h.ok).length}),e?.rtoSeconds!==void 0){l.rtoSeconds=e.rtoSeconds;let h=i.resolved??c;a&&h&&(l.rtoMet=jr(a,h)<=e.rtoSeconds)}return{events:t,summary:l}}function Qn(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 oc=100;function yo(r,e,t=!1){return!t&&!Xe(r)?.evidence?{}:{...e.by?{by:e.by}:{},...e.on?{on:e.on}:{}}}function Io(r,e){return Xe(r)?.evidence?Math.max(e,oc):e}var $o=require("module"),ac=(0,$o.createRequire)("/"),lc;try{lc=ac("worker_threads").Worker}catch{}var we=Uint8Array,_e=Uint16Array,cB=Int32Array,Yr=new we([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]),Qr=new we([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]),oB=new we([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Go=function(r,e){for(var t=new _e(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new cB(t[30]),n=1;n<30;++n)for(var B=t[n];B<t[n+1];++B)s[B]=B-t[n]<<5|n;return{b:t,r:s}},Mo=Go(Yr,2),Ho=Mo.b,aB=Mo.r;Ho[28]=258,aB[258]=28;var Po=Go(Qr,0),uc=Po.b,To=Po.r,lB=new _e(32768);for(ce=0;ce<32768;++ce)ht=(ce&43690)>>1|(ce&21845)<<1,ht=(ht&52428)>>2|(ht&13107)<<2,ht=(ht&61680)>>4|(ht&3855)<<4,lB[ce]=((ht&65280)>>8|(ht&255)<<8)>>1;var ht,ce,ot=(function(r,e,t){for(var n=r.length,s=0,B=new _e(e);s<n;++s)r[s]&&++B[r[s]-1];var i=new _e(e);for(s=1;s<e;++s)i[s]=i[s-1]+B[s-1]<<1;var o;if(t){o=new _e(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var c=s<<4|r[s],u=e-r[s],l=i[r[s]-1]++<<u,C=l|(1<<u)-1;l<=C;++l)o[lB[l]>>a]=c}else for(o=new _e(n),s=0;s<n;++s)r[s]&&(o[s]=lB[i[r[s]-1]++]>>15-r[s]);return o}),kt=new we(288);for(ce=0;ce<144;++ce)kt[ce]=8;var ce;for(ce=144;ce<256;++ce)kt[ce]=9;var ce;for(ce=256;ce<280;++ce)kt[ce]=7;var ce;for(ce=280;ce<288;++ce)kt[ce]=8;var ce,Zn=new we(32);for(ce=0;ce<32;++ce)Zn[ce]=5;var ce,cc=ot(kt,9,0),Cc=ot(kt,9,1),fc=ot(Zn,5,0),hc=ot(Zn,5,1),sB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},et=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},BB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},CB=function(r){return(r+7)/8|0},Vn=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new we(r.subarray(e,t))};var pc=["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||pc[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,tt),!t)throw n;return n},dc=function(r,e,t,n){var s=r.length,B=n?n.length:0;if(!s||e.f&&!e.l)return t||new we(0);var i=!t,o=i||e.i!=2,a=e.i;i&&(t=new we(s*3));var c=function(q){var Q=t.length;if(q>Q){var oe=new we(Math.max(Q*2,q));oe.set(t),t=oe}},u=e.f||0,l=e.p||0,C=e.b||0,h=e.l,p=e.d,f=e.m,w=e.n,k=s*8;do{if(!h){u=et(r,l,1);var E=et(r,l+1,3);if(l+=3,E)if(E==1)h=Cc,p=hc,f=9,w=5;else if(E==2){var v=et(r,l,31)+257,L=et(r,l+10,15)+4,b=v+et(r,l+5,31)+1;l+=14;for(var m=new we(b),M=new we(19),y=0;y<L;++y)M[oB[y]]=et(r,l+y*3,7);l+=L*3;for(var H=sB(M),z=(1<<H)-1,j=ot(M,H,1),y=0;y<b;){var X=j[et(r,l,z)];l+=X&15;var x=X>>4;if(x<16)m[y++]=x;else{var ne=0,te=0;for(x==16?(te=3+et(r,l,3),l+=2,ne=m[y-1]):x==17?(te=3+et(r,l,7),l+=3):x==18&&(te=11+et(r,l,127),l+=7);te--;)m[y++]=ne}}var ae=m.subarray(0,v),se=m.subarray(v);f=sB(ae),w=sB(se),h=ot(ae,f,1),p=ot(se,w,1)}else tt(1);else{var x=CB(l)+4,O=r[x-4]|r[x-3]<<8,I=x+O;if(I>s){a&&tt(0);break}o&&c(C+O),t.set(r.subarray(x,I),C),e.b=C+=O,e.p=l=I*8,e.f=u;continue}if(l>k){a&&tt(0);break}}o&&c(C+131072);for(var De=(1<<f)-1,de=(1<<w)-1,W=l;;W=l){var ne=h[BB(r,l)&De],U=ne>>4;if(l+=ne&15,l>k){a&&tt(0);break}if(ne||tt(2),U<256)t[C++]=U;else if(U==256){W=l,h=null;break}else{var re=U-254;if(U>264){var y=U-257,A=Yr[y];re=et(r,l,(1<<A)-1)+Ho[y],l+=A}var S=p[BB(r,l)&de],R=S>>4;S||tt(3),l+=S&15;var se=uc[R];if(R>3){var A=Qr[R];se+=BB(r,l)&(1<<A)-1,l+=A}if(l>k){a&&tt(0);break}o&&c(C+131072);var $=C+re;if(C<se){var G=B-se,P=Math.min(se,$);for(G+C<0&&tt(3);C<P;++C)t[C]=n[G+C]}for(;C<$;++C)t[C]=t[C-se]}}e.l=h,e.p=W,e.b=C,e.f=u,h&&(u=1,e.m=f,e.d=p,e.n=w)}while(!u);return C!=t.length&&i?Vn(t,0,C):t.subarray(0,C)},pt=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},qn=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},iB=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,B=t.slice();if(!s)return{t:Jo,l:0};if(s==1){var i=new we(t[0].s+1);return i[t[0].s]=1,{t:i,l:1}}t.sort(function(I,v){return I.f-v.f}),t.push({s:-1,f:25001});var o=t[0],a=t[1],c=0,u=1,l=2;for(t[0]={s:-1,f:o.f+a.f,l:o,r:a};u!=s-1;)o=t[t[c].f<t[l].f?c++:l++],a=t[c!=u&&t[c].f<t[l].f?c++:l++],t[u++]={s:-1,f:o.f+a.f,l:o,r:a};for(var C=B[0].s,n=1;n<s;++n)B[n].s>C&&(C=B[n].s);var h=new _e(C+1),p=uB(t[u-1],h,0);if(p>e){var n=0,f=0,w=p-e,k=1<<w;for(B.sort(function(v,L){return h[L.s]-h[v.s]||v.f-L.f});n<s;++n){var E=B[n].s;if(h[E]>e)f+=k-(1<<p-h[E]),h[E]=e;else break}for(f>>=w;f>0;){var x=B[n].s;h[x]<e?f-=1<<e-h[x]++-1:++n}for(;n>=0&&f;--n){var O=B[n].s;h[O]==e&&(--h[O],++f)}p=e}return{t:new we(h),l:p}},uB=function(r,e,t){return r.s==-1?Math.max(uB(r.l,e,t+1),uB(r.r,e,t+1)):e[r.s]=t},Lo=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new _e(++e),n=0,s=r[0],B=1,i=function(a){t[n++]=a},o=1;o<=e;++o)if(r[o]==s&&o!=e)++B;else{if(!s&&B>2){for(;B>138;B-=138)i(32754);B>2&&(i(B>10?B-11<<5|28690:B-3<<5|12305),B=0)}else if(B>3){for(i(s),--B;B>6;B-=6)i(8304);B>2&&(i(B-3<<5|8208),B=0)}for(;B--;)i(s);B=1,s=r[o]}return{c:t.subarray(0,n),n:e}},Wn=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},_o=function(r,e,t){var n=t.length,s=CB(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 B=0;B<n;++B)r[s+B+4]=t[B];return(s+4+n)*8},No=function(r,e,t,n,s,B,i,o,a,c,u){pt(e,u++,t),++s[256];for(var l=iB(s,15),C=l.t,h=l.l,p=iB(B,15),f=p.t,w=p.l,k=Lo(C),E=k.c,x=k.n,O=Lo(f),I=O.c,v=O.n,L=new _e(19),b=0;b<E.length;++b)++L[E[b]&31];for(var b=0;b<I.length;++b)++L[I[b]&31];for(var m=iB(L,7),M=m.t,y=m.l,H=19;H>4&&!M[oB[H-1]];--H);var z=c+5<<3,j=Wn(s,kt)+Wn(B,Zn)+i,X=Wn(s,C)+Wn(B,f)+i+14+3*H+Wn(L,M)+2*L[16]+3*L[17]+7*L[18];if(a>=0&&z<=j&&z<=X)return _o(e,u,r.subarray(a,a+c));var ne,te,ae,se;if(pt(e,u,1+(X<j)),u+=2,X<j){ne=ot(C,h,0),te=C,ae=ot(f,w,0),se=f;var De=ot(M,y,0);pt(e,u,x-257),pt(e,u+5,v-1),pt(e,u+10,H-4),u+=14;for(var b=0;b<H;++b)pt(e,u+3*b,M[oB[b]]);u+=3*H;for(var de=[E,I],W=0;W<2;++W)for(var U=de[W],b=0;b<U.length;++b){var re=U[b]&31;pt(e,u,De[re]),u+=M[re],re>15&&(pt(e,u,U[b]>>5&127),u+=U[b]>>12)}}else ne=cc,te=kt,ae=fc,se=Zn;for(var b=0;b<o;++b){var A=n[b];if(A>255){var re=A>>18&31;qn(e,u,ne[re+257]),u+=te[re+257],re>7&&(pt(e,u,A>>23&31),u+=Yr[re]);var S=A&31;qn(e,u,ae[S]),u+=se[S],S>3&&(qn(e,u,A>>5&8191),u+=Qr[S])}else qn(e,u,ne[A]),u+=te[A]}return qn(e,u,ne[256]),u+te[256]},gc=new cB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new we(0),mc=function(r,e,t,n,s,B){var i=B.z||r.length,o=new we(n+i+5*(1+Math.ceil(i/7e3))+s),a=o.subarray(n,o.length-s),c=B.l,u=(B.r||0)&7;if(e){u&&(a[0]=B.r>>3);for(var l=gc[e-1],C=l>>13,h=l&8191,p=(1<<t)-1,f=B.p||new _e(32768),w=B.h||new _e(p+1),k=Math.ceil(t/3),E=2*k,x=function(ue){return(r[ue]^r[ue+1]<<k^r[ue+2]<<E)&p},O=new cB(25e3),I=new _e(288),v=new _e(32),L=0,b=0,m=B.i||0,M=0,y=B.w||0,H=0;m+2<i;++m){var z=x(m),j=m&32767,X=w[z];if(f[j]=X,w[z]=j,y<=m){var ne=i-m;if((L>7e3||M>24576)&&(ne>423||!c)){u=No(r,a,0,O,I,v,b,M,H,m-H,u),M=L=b=0,H=m;for(var te=0;te<286;++te)I[te]=0;for(var te=0;te<30;++te)v[te]=0}var ae=2,se=0,De=h,de=j-X&32767;if(ne>2&&z==x(m-de))for(var W=Math.min(C,ne)-1,U=Math.min(32767,m),re=Math.min(258,ne);de<=U&&--De&&j!=X;){if(r[m+ae]==r[m+ae-de]){for(var A=0;A<re&&r[m+A]==r[m+A-de];++A);if(A>ae){if(ae=A,se=de,A>W)break;for(var S=Math.min(de,A-2),R=0,te=0;te<S;++te){var $=m-de+te&32767,G=f[$],P=$-G&32767;P>R&&(R=P,X=$)}}}j=X,X=f[j],de+=j-X&32767}if(se){O[M++]=268435456|aB[ae]<<18|To[se];var q=aB[ae]&31,Q=To[se]&31;b+=Yr[q]+Qr[Q],++I[257+q],++v[Q],y=m+ae,++L}else O[M++]=r[m],++I[r[m]]}}for(m=Math.max(m,y);m<i;++m)O[M++]=r[m],++I[r[m]];u=No(r,a,c,O,I,v,b,M,H,m-H,u),c||(B.r=u&7|a[u/8|0]<<3,u-=7,B.h=w,B.p=f,B.i=m,B.w=y)}else{for(var m=B.w||0;m<i+c;m+=65535){var oe=m+65535;oe>=i&&(a[u/8|0]=c,oe=i),u=_o(a,u+1,r.subarray(m,oe))}B.i=i}return Vn(o,0,n+CB(u)+s)};var Ec=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var B=e.dictionary.subarray(-32768),i=new we(B.length+r.length);i.set(B),i.set(r,B.length),r=i,s.w=B.length}return mc(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 Uo(r,e){return Ec(r,e||{},0,0)}var Ko=(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 we(32768),this.p=new we(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 we(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=dc(this.p,this.s,this.o);this.ondata(Vn(n,t,this.s.b),this.d),this.o=Vn(n,this.s.b-32768),this.s.b=this.o.length,this.p=Vn(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 Dc=typeof TextDecoder<"u"&&new TextDecoder,bc=0;try{Dc.decode(Jo,{stream:!0}),bc=1}catch{}var wc=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]),at=(r,e)=>r>>>e|r<<32-e;function jo(r){return Array.from(xc(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function xc(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]),B=new Uint32Array(64);for(let i=0;i<t.length;i+=64){for(let f=0;f<16;f++)B[f]=n.getUint32(i+f*4);for(let f=16;f<64;f++){let w=at(B[f-15],7)^at(B[f-15],18)^B[f-15]>>>3,k=at(B[f-2],17)^at(B[f-2],19)^B[f-2]>>>10;B[f]=B[f-16]+w+B[f-7]+k>>>0}let[o,a,c,u,l,C,h,p]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let f=0;f<64;f++){let w=at(l,6)^at(l,11)^at(l,25),k=l&C^~l&h,E=p+w+k+wc[f]+B[f]>>>0,x=at(o,2)^at(o,13)^at(o,22),O=o&a^o&c^a&c,I=x+O>>>0;p=h,h=C,C=l,l=u+E>>>0,u=c,c=a,a=o,o=E+I>>>0}s[0]=s[0]+o>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+c>>>0,s[3]=s[3]+u>>>0,s[4]=s[4]+l>>>0,s[5]=s[5]+C>>>0,s[6]=s[6]+h>>>0,s[7]=s[7]+p>>>0}return s}var qr=/[ \t]/,zo=/[A-Za-z0-9_]/,vc=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function kc(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&qr.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let B=r[t];if(B==="'"||B==='"'){let i=r.indexOf(B,t+1);if(i<0)return;let o=r.slice(t+1,i);s+=B==='"'?o.replace(/\\([\\"$`])/g,"$1"):o,t=i+1}else B==="\\"?(s+=r[t+1]??"",t+=2):(s+=B,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var fB=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 o=this.heredocs[0];return(o.strip?e.replace(/^\t+/,""):e)===o.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",B=e.length,i=0;for(;i<B;){let o=e[i];if(this.quote==="'"||this.quote==="$'"){o==="\\"&&this.quote==="$'"?i++:o==="'"&&(this.quote=""),i++;continue}if(this.quote==='"'||this.quote==="`"){o==="\\"?(i===B-1&&(this.cont=!0),i++):o===this.quote&&(this.quote=""),i++;continue}if(qr.test(o)){i++;continue}if(o==="#"&&(i===0||/[\s;&|()]/.test(e[i-1])))break;if(t=!0,o==="\\"){i===B-1&&(this.cont=!0),s="",n=!1,i+=2;continue}if(o==="'"||o==='"'||o==="`")this.quote=o;else if(o==="$"&&e[i+1]==="'")this.quote="$'",i++;else if(o==="<"&&e.startsWith("<<",i)&&e[i+2]!=="<"){let a=kc(e,i+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),i=a.end,s="x",n=!1;continue}}else if(o==="("||o===")")this.top()!=="case"&&(o==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(o==="{")this.stack.push("{");else if(o==="}")this.top()==="{"&&this.stack.pop();else if(n&&zo.test(o)){let a=i;for(;a<B&&zo.test(e[a]);)a++;let c=e.slice(i,a);if((a===B||/[\s;&|()<>]/.test(e[a]))&&this.keyword(c)){i=a,s=c;continue}i=a,s=c,n=!1;continue}n=o===";"||o==="&"||o==="|"||o==="("||o==="{"||o==="}"||o==="!",s=(s+o).slice(-2),i++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&vc.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}}},hB=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,B=0;for(;B<s;){let i=e[B];if(this.blockComment){e.startsWith("#>",B)?(this.blockComment=!1,B+=2):B++;continue}if(this.quote==="'"){(i==="'"||i==="\u2018"||i==="\u2019")&&(e[B+1]===i?B++:this.quote=""),B++;continue}if(this.quote==='"'){i==="`"?B++:i==='"'&&(e[B+1]==='"'?B++:this.quote=""),B++;continue}if(qr.test(i)){B++;continue}if(e.startsWith("<#",B)){this.blockComment=!0,B+=2;continue}if(i==="#")break;if(t=!0,i==="`"){B===s-1&&(this.cont=!0),n="`",B+=2;continue}if(i==="@"&&(e[B+1]==="'"||e[B+1]==='"')&&e.slice(B+2).trim()==="")return this.quote=e[B+1]==="'"?"@'":'@"',!0;i==="'"||i==='"'||i==="\u2018"||i==="\u2019"?this.quote=i==='"'?'"':"'":i==="("||i==="{"||i==="["?this.depth++:(i===")"||i==="}"||i==="]")&&this.depth>0&&this.depth--,n=(n+i).slice(-4),B++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},pB=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 B=e[s];if(qr.test(B)||(n=!0),B==='"')t=!t;else{if(t)continue;B==="^"?(s===e.length-1&&(this.cont=!0),s++):B==="("?this.depth++:B===")"&&this.depth>0&&this.depth--}}return n}};function Oc(r){return r==="pwsh"?new hB:r==="cmd"?new pB:new fB}function Sc(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function Yo(r,e){let t=$t(r),n=Oc(e),s=[],B,i=a=>{s.push({start:B,end:a,text:t.slice(B,a+1).map((c,u,l)=>c.text+(u<l.length-1?c.eol:"")).join("")}),B=void 0},o=a=>t.slice(a+1).find(c=>c.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let c=n.line(t[a].text);if(B===void 0){if(!c)continue;B=a}if(n.open())continue;let u=o(a);u!==void 0&&Sc(e,u)||i(a)}if(B!==void 0){let a=t.length-1;for(;a>B&&t[a].text.trim()==="";)a--;i(a)}return s}var gB="md-runbook",qo="md-runbook-manifest 1",Wo=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,Ac=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Rc=/^\d{4}-\d{2}-\d{2}$/,Fc=r=>Rc.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function Qo(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 yc=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,Xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Ot(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],B=e[n+1],i=e[n+2];t+=Xn[s>>2]+Xn[(s&3)<<4|(B??0)>>4],t+=B===void 0?"=":Xn[(B&15)<<2|(i??0)>>6],t+=i===void 0?"=":Xn[i&63]}return t}function Vo(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 B=0;B<r.length;B+=4){let i=[0,1,2,3].map(a=>r[B+a]==="="?0:Xn.indexOf(r[B+a])),o=i[0]<<18|i[1]<<12|i[2]<<6|i[3];for(let a of[o>>16,o>>8&255,o&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return Ot(s)===r?s:void 0}function dB(r){let e=[];return Ee(r).cells.forEach((t,n)=>{t.kind!=="code"||!pe(t.meta)||Ae(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function Ic(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,B)=>{if(t){Ne(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${B+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let i=Se(s);if(i){/^( {4}|\t| {0,3}\t)/.test(i.indent)&&e.push(`line ${B+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&Ae(wt(i.info))==="bash"&&e.push(`line ${B+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=i;return}for(let o of s.matchAll(/<!--|-->/g))n=o[0]==="<!--"}),e}function mB(r,e){let t=[];Wo.test(e.name)||t.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&t.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!Fc(e.expires)&&t.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let a of e.scopes)Ac.test(a)||t.push(`scope "${a}": use letters, digits and . _ - (at most 64)`);for(let[a,c]of Object.entries(e.patterns))ft.test(a)?Qo(a)&&t.push(`\${param:${a}}: ${a} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):t.push(`pattern for "${a}": not a parameter name`),c===""||/[\r\n]/.test(c)?t.push(`pattern for ${a}: empty or more than one line`):yc.test(c)&&t.push(`pattern for ${a}: ${c} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);t.push(...Ic(ta(r)));let n=Xe(r)?.shell?.unix;n&&n!=="bash"&&t.push(`front matter shell: ${n}: servers run signed runbooks in bash; remove it, or write shell: bash`);let s=new Set;for(let a of dB(r))for(let c of ve(a.info).checks?.captures??[])c.secret&&s.add(c.name);let B=[];for(let a of dB(r)){let c=B.length+1,u=`cell ${c} (${a.value.split(`
|
|
89
|
-
`)[0]?.slice(0,40)??""})`,l=
|
|
84
|
+
`;return Cc+s+n}function jr(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 hc(r){let e=r.trim(),t=/^("(?:[^"\\]|\\.)*"|'(?:[^']|'')*')\s*(?:#.*)?$/.exec(e);return t?jr(t[1]):e.startsWith("#")?"":e.replace(/\s+#.*$/,"")}var sB=/^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:(?:\s+(.*?))?\s*$/;function dc(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 et(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return;let t=[],n,s,B,i,o,a,c,u,l,f,C,d,h,k=Object.create(null),R=!1,E=!1;for(let S=1;S<e.length;S++){let w=e[S];if(/^(---|\.\.\.)\s*$/.test(w))return{params:t,...n?{mode:n}:{},...s!==void 0?{timeoutSeconds:s}:{},...B!==void 0?{cwd:B}:{},...i?{shell:i}:{},...o?{incident:o}:{},...a?{severity:a}:{},...c||o?{evidence:!0}:{},...u!==void 0?{rtoSeconds:u}:{},...l?{practice:l}:{},...f?{drill:f}:{},...C?{kubeContext:C}:{},...d?{kubeContextMode:d}:{},...h?{gitBashPathConversion:h}:{},...Object.keys(k).length>0?{env:k}:{}};if(w.trim()===""||w.trim().startsWith("#"))continue;if(!/^\s/.test(w)&&!w.startsWith("-")){R=/^params\s*:\s*$/.test(w),E=/^env\s*:\s*(#.*)?$/i.test(w);let $=/^mode\s*:\s*["']?(session|isolated)["']?\s*(#.*)?$/i.exec(w);$&&(n=$[1].toLowerCase());let b=/^timeout\s*:\s*["']?(\d+(?:\.\d+)?)s?["']?\s*(#.*)?$/i.exec(w);b&&(s=Number(b[1]));let m=/^cwd\s*:\s*(.*?)\s*$/i.exec(w);m&&m[1]!==""&&(B=jr(m[1].replace(/\s+#.*$/,"")));let G=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(w);if(G){let{shells:Be}=$n(G[1]);(Be.unix||Be.powershell)&&(i={...Be,...i})}let T=Be=>{let te=new RegExp(`^${Be}\\s*:\\s*(.*?)\\s*$`,"i").exec(w)?.[1];return te===void 0||te===""?void 0:jr(te.replace(/\s+#.*$/,""))};o=T("incident")??o,a=T("severity")??a,l=T("practice")??l;let H=T("drill");H!==void 0&&(f=/^(true|yes|on)$/i.test(H));let Q=T("evidence");Q!==void 0&&(c=/^(true|yes|on)$/i.test(Q));let z=T("rto");z!==void 0&&(u=dc(z)??u);let q=T("kube-context");q!==void 0&&Ur(q)&&(C=q);let V=T("kube-context-mode")?.toLowerCase();V!==void 0&&yo.includes(V)&&(d=V);let ee=T("git-bash-path-conversion")?.toLowerCase();(ee==="on"||ee==="off")&&(h=ee);continue}if(E){let $=sB.exec(w);$&&!($[1]in k)&&(k[$[1]]=hc($[2]??""));continue}if(!R)continue;let y=/^\s*-\s+([A-Za-z_][A-Za-z0-9_]*)\s*(?::\s*(.*?))?\s*$/.exec(w);if(!y)continue;let O=y[1];t.some($=>$.name===O)||t.push(y[2]!==void 0&&y[2]!==""?{name:O,default:jr(y[2])}:{name:O})}}var BB=100,$o=36e5,Qn=class{constructor(e,t){this.source=e;this.flags=t;let n=0;t.includes("i")&&(n|=hn.CASE_INSENSITIVE),t.includes("m")&&(n|=hn.MULTILINE),t.includes("s")&&(n|=hn.DOTALL);try{this.re=hn.compile(e,n)}catch(s){let B=s instanceof Error?s.message:String(s);throw new Error(`invalid regular expression /${e}/${t}: ${B} (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}`}},pc=/^\/([\s\S]*)\/([imsu]*)$/;function iB(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=pc.exec(r);return t?(Xe(t[1]).length>0&&new Qn(zr(t[1],()=>"(?:x)"),t[2]),{kind:"regex",re:new Qn(t[1],t[2])}):{kind:"text",text:r}}function oB(r){return[r?.expect,r?.expectNot].filter(e=>e!==void 0).map(e=>e.kind==="text"?e.text:e.re.source).join(`
|
|
85
|
+
`)}function gc(r){return Xe(oB(r))}function Mo(r,e,t=()=>!1){let n=(o,a,c)=>{let u=e[a];if(u===void 0)throw new Error(`\${${o}:${a}} in a check has no value`);if(t(a))throw new Error(`a check can't use \${${o}:${a}}: it is a secret value, and a check's text is shown when it fails`);return c(u)},s=o=>{if(o===void 0)return;if(o.kind==="text")return{kind:"text",text:zr(o.text,(c,u)=>n(c,u,l=>l))};let a=zr(o.re.source,(c,u)=>n(c,u,l=>`(?:${hn.quote(l)})`));return a===o.re.source?o:{kind:"regex",re:new Qn(a,o.re.flags)}};if(gc(r).length===0)return r;let B=s(r.expect),i=s(r.expectNot);return{...r,...B?{expect:B}:{},...i?{expectNot:i}:{}}}function Yr(r){return r.kind==="text"?JSON.stringify(r.text):String(r.re)}function Go(r,e){let t=r.indexOf(":"),n=t<0?r:r.slice(0,t);if(!ht.test(n))throw new Error("expected a variable name (letters, digits, _)");if(t<0)return{name:n,secret:e};let s=iB(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 Ho(r){return!!r&&(r.expect!==void 0||r.expectNot!==void 0||r.expectExit!==void 0||r.captures.length>0)}var Lo=r=>Ve(r).replace(/\r\n?/g,`
|
|
86
|
+
`);function No(r,e){return r.kind==="text"?e.includes(r.text):r.re.exec(e)!==null}function Po(r,e,t,n){let s=[],B=r.expectExit??0,i=e===B;!i&&r.expectExit!==void 0&&s.push(`exit code ${e}, expected ${B}`);let o=Lo(t);r.expect&&!No(r.expect,o)&&(i=!1,s.push(r.expect.kind==="text"?`the output does not contain ${Yr(r.expect)}`:`the output does not match ${Yr(r.expect)}`)),r.expectNot&&No(r.expectNot,o)&&(i=!1,s.push(r.expectNot.kind==="text"?`the output contains ${Yr(r.expectNot)}`:`the output matches ${Yr(r.expectNot)}`));let a=[],c=[];if(i){let u=Lo(n);for(let l of r.captures){let f;if(l.pattern){let C=l.pattern.exec(u);f=C?C[1]??C[0]:void 0,f===void 0&&s.push(`capture ${l.name}: nothing in the output matches ${String(l.pattern)}`)}else f=u.trim(),f===""&&(s.push(`capture ${l.name}: the cell printed nothing`),f=void 0);f!==void 0&&a.push({name:l.name,value:f,secret:l.secret}),f!==void 0&&l.secret&&c.push(f)}a.length<r.captures.length&&(i=!1,a.length=0)}return{ok:i,failures:s,captured:a,secretValues:c}}var mc={h:36e5,m:6e4,s:1e3,ms:1};function aB(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,B]of e.matchAll(/(\d+(?:\.\d+)?)(ms|h|m|s)/gi)){let i=mc[B.toLowerCase()];if(i>=n)return;n=i,t+=Number(s)*i}return Math.round(t)}var Ec={windows:"windows",win:"windows",win32:"windows",linux:"linux",macos:"macos",mac:"macos",osx:"macos",darwin:"macos"},Dc={windows:"Windows",linux:"Linux",macos:"macOS"};function _o(r){let e=[];for(let t of r.split(",").map(n=>n.trim().toLowerCase())){let n=Ec[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 lB(r=process.platform){return r==="win32"?"windows":r==="darwin"?"macos":"linux"}function pn(r){return r.map(e=>Dc[e]).join(", ")}function zt(r,e=lB()){let t=-1,n=new Set,s=!1;return r.map((B,i)=>{if(B.kind!=="markup"){if(!B.os){s=!1;return}(!s||B.os.some(o=>n.has(o)))&&(t=i,n=new Set),s=!0;for(let o of B.os)n.add(o);return{group:t,active:B.os.includes(e)}}})}function kt(r){let e=zt(r),t=new Map,n=0;return r.map((s,B)=>{if(s.kind!=="code")return;let i=e[B];return i&&t.has(i.group)?t.get(i.group):(n++,i&&t.set(i.group,n),n)})}var uB=r=>r===" "||r===" ";function qn(r){let e=[],t=r.length,n=0;for(;n<t;){for(;n<t&&uB(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&&!uB(r[n])&&r[n]!=="=";)n++;let B=r.slice(s,n);if(r[n]!=="="){e.push({key:B,start:s,end:n});continue}n++;let i=r[n],o;if(i==='"'||i==="'"){let a=r.indexOf(i,n+1);o=r.slice(n+1,a<0?t:a),n=a<0?t:a+1}else{let a=n;for(;n<t&&!uB(r[n]);)n++;o=r.slice(a,n)}B!==""&&e.push({key:B,value:o,start:s,end:n})}return e}var bc=/^\s*[^\s{]*/;function gn(r,e,t){let n=de(e),s=[oB(n.checks),Ao(Kr(n,t))].filter(B=>B!=="");return Xe([r,...s].join(`
|
|
87
|
+
`))}function de(r){let e={env:{},errors:[]},t=()=>e.checks??={captures:[]},n;for(let{key:s,value:B}of qn(r.replace(bc,""))){let i=s.toLowerCase();if(B===void 0)i==="continue-on-error"?e.continueOnError=!0:i==="skip"?e.skip=!0:i==="confirm"?e.confirm=!0:i==="no-confirm"?e.confirm=!1:i==="terminal"&&(e.terminal=!0);else if(i==="timeout"){let o=Number(B.replace(/s$/i,""));B.trim()===""||!Number.isFinite(o)||o<0?e.errors.push(`timeout=${B}: expected seconds (0 = none)`):e.timeoutSeconds=o}else if(i==="estimate"){let o=aB(B);o===void 0?e.errors.push(`estimate=${B}: expected a duration such as 2m30s, 45s or 90 (seconds)`):e.estimateSeconds=o/1e3}else if(i==="cwd")B===""?e.errors.push("cwd: empty path"):e.cwd=B;else if(i==="name")e.name=B;else if(i==="expect"||i==="expect-not")try{t()[i==="expect"?"expect":"expectNot"]=iB(B)}catch(o){e.errors.push(`${i}=${B}: ${o instanceof Error?o.message:String(o)}`)}else if(i==="expect-exit")/^-?\d+$/.test(B.trim())?t().expectExit=Number(B):e.errors.push(`expect-exit=${B}: expected an exit code`);else if(i==="capture"||i==="capture-secret")try{t().captures.push(Go(B,i==="capture-secret"))}catch(o){e.errors.push(`${i}=${B}: ${o instanceof Error?o.message:String(o)}`)}else if(i==="os"){let o=_o(B);typeof o=="string"?e.errors.push(`os=${B}: ${o}`):e.os=o}else if(i==="host")B.trim()===""?e.errors.push("host: empty name"):e.host=B.trim();else if(i==="kube-context")Ur(B.trim())?e.kubeContext=B.trim():e.errors.push(`kube-context=${B}: expected a Kubernetes context name or \${param:NAME}`);else if(i==="lines")B.toLowerCase()!=="any"?e.errors.push(`lines=${B}: expected lines=any`):e.lines="any";else if(i==="retry"){let o=Number(B);!Number.isInteger(o)||o<1||o>BB?e.errors.push(`retry=${B}: expected the number of attempts (1 to ${BB})`):e.retry={attempts:o,everyMs:5e3}}else i==="every"?(n=aB(B),n===void 0?e.errors.push(`every=${B}: expected a duration such as 15s, 500ms or 2m`):n>$o&&e.errors.push(`every=${B}: at most 1h`)):i.startsWith("env.")&&s.length>4&&(e.env[s.slice(4)]=B)}return e.retry&&n!==void 0&&(e.retry.everyMs=n),e}function Qr(r){let e=/^?---[ \t]*\r?\n(?:[\s\S]*?\r?\n)?(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/.exec(r);return e?r.slice(e[0].length):r}function qr(r){let e=[],t;return r.split(/\r?\n/).forEach((n,s)=>{let B=/^ {0,3}(`{3,}|~{3,})/.exec(n)?.[1];if(t!==void 0){B&&B[0]===t[0]&&B.length>=t.length&&n.trim()===B&&(t=void 0);return}if(B){t=B;return}let i=/^ {0,3}(#{1,6})[ \t]+(.+?)(?:[ \t]+#+)?[ \t]*$/.exec(n),o=i?.[2]?.trim();i&&o&&e.push({level:i[1].length,text:o,line:s})}),e}function cB(r){return qr(Qr(r)).find(e=>e.level===1)?.text}function ze(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),B=t%60;return[n?`${n}h`:"",s?`${s}m`:"",B||!n&&!s?`${B}s`:""].join("")}function Jo(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 fB(r,e){return r>2*e&&r-e>60}function Uo(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 CB(r){let e={totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:r.length,unestimated:0,unestimatedLeft:0};for(let t of r){if(t.estimateSeconds===void 0){e.unestimated++,t.state!=="done"&&e.unestimatedLeft++;continue}e.totalSeconds+=t.estimateSeconds,t.state==="done"?e.doneSeconds+=t.estimateSeconds:t.state==="running"?e.leftSeconds+=Math.max(0,t.estimateSeconds-(t.elapsedSeconds??0)):e.leftSeconds+=t.estimateSeconds}return e.totalSeconds>0&&(e.fraction=e.doneSeconds/e.totalSeconds),e}function hB(r,e=10){if(r.fraction===void 0)return;let t=[`${Uo(r.fraction,e)} ${Math.floor(r.fraction*100)}%`,r.leftSeconds>0?`${Jo(r.leftSeconds)} left`:"nothing left"];return r.unestimatedLeft>0&&t.push(Wr(r.unestimatedLeft)),t.join(" \xB7 ")}function Wr(r){return`${r} block${r===1?"":"s"} without an estimate`}function dB(r,e){let t=Ce(r).cells,n=t.map(f=>f.kind==="code"&&le(f.meta)?de(f.meta.info):void 0),s=zt(t.map((f,C)=>({kind:f.kind,...n[C]?.os?{os:n[C].os}:{}})),e),B=new Map,i=new Map;s.forEach((f,C)=>{f&&i.set(f.group,[...i.get(f.group)??[],{active:f.active,e:n[C]?.estimateSeconds}])});for(let[f,C]of i){let d=e!==void 0?C.find(k=>k.active):void 0,h=C.flatMap(k=>k.e===void 0?[]:[k.e]);B.set(f,d?d.e:h.length?Math.max(...h):void 0)}let o=new Set,a=[],c=[],u=[],l;return t.forEach((f,C)=>{if(f.kind!=="code"){a.push(void 0),c.push(!1);for(let E of qr(C===0?Qr(f.value):f.value))E.level>2||(l={heading:E.text,level:E.level,cell:C,seconds:0,blocks:0,unestimated:0},u.push(l));return}let d=n[C],h=s[C],k=d!==void 0&&!d.skip,R=d?.estimateSeconds;k&&h&&(o.has(h.group)?k=!1:(o.add(h.group),R=B.get(h.group))),a.push(d?.estimateSeconds),c.push(k),k&&(l||(l={level:0,cell:-1,seconds:0,blocks:0,unestimated:0},u.unshift(l)),l.blocks++,R===void 0?l.unestimated++:l.seconds+=R)}),{sections:u,totalSeconds:u.reduce((f,C)=>f+C.seconds,0),blocks:u.reduce((f,C)=>f+C.blocks,0),unestimated:u.reduce((f,C)=>f+C.unestimated,0),perCell:a,counts:c}}function Ko(r){return/(^|[\s;|&(])md-runbook-probe(\s|$)/m.test(r)}var xc=/^(OK|FAIL) {2,}(\S+) {2,}(.+)$/;function jo(r){let e=[];for(let t of r.split(/\r?\n/)){let n=xc.exec(t.trimEnd());if(!n)continue;let s=n[3],B={target:n[2],ok:n[1]==="OK",detail:s},i=/(\d+) days left \((\d{4}-\d\d-\d\d)\)/.exec(s),o=/expires in (-?\d+) days \((\d{4}-\d\d-\d\d)\)/.exec(s),a=/expires (\d{4}-\d\d-\d\d) \((-?\d+) days\)/.exec(s),c=/EXPIRED on (\d{4}-\d\d-\d\d) \((\d+) days ago\)/.exec(s);if(i||o){let u=i??o;B.daysLeft=Number(u[1]),B.expires=u[2]}else a?(B.daysLeft=Number(a[2]),B.expires=a[1]):c&&(B.daysLeft=-Number(c[2]),B.expires=c[1]);e.push(B)}return e}var pB=["detected","mitigated","resolved"],kc=/^[ \t]*<!--[ \t]*md-runbook:note\b(.*?)-->[ \t]*\r?\n((?:[ \t]*>.*(?:\r?\n|$))*)/gm;function vc(r){let e=[];for(let t of r.matchAll(kc)){let n=In(t[1]??"");if(!n.at||Number.isNaN(Date.parse(n.at)))continue;let s=(t[2]??"").split(/\r?\n/).map(i=>i.replace(/^[ \t]*>[ \t]?/,"")).join(`
|
|
88
|
+
`).trim().replace(/^\*\*[^*]*:\*\*\s*/,""),B=pB.includes(n.milestone??"")?n.milestone:void 0;e.push({at:n.at,kind:"note",text:s,...n.by?{by:n.by}:{},...B?{milestone:B}:{}})}return e}var Sc=(r,e)=>e==="failed"||r!==void 0&&!["0","done","skipped","running","proposed","declined"].includes(r)&&e!=="ok";function zo(r,e,t,n,s){if(!r.ran||Number.isNaN(Date.parse(r.ran)))return;let B=r.exit==="done"||r.exit==="skipped",i=s===void 0?[]:jo(s);return{at:r.ran,kind:B&&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:!Sc(r.exit,r.check),...r.duration?{duration:r.duration}:{},...n?{earlier:!0}:{},...i.length?{checks:i}:{}}}var Vr=(r,e)=>Math.max(0,Math.round((Date.parse(e)-Date.parse(r))/1e3));function Zr(r){let e=et(r),t=[],n=Ce(r),s=n.cells.map(C=>le(C.meta)?de(C.meta.info):void 0),B=kt(n.cells.map((C,d)=>le(C.meta)?{kind:"code",os:s[d]?.os}:{kind:"markup"}));for(let[C,d]of n.cells.entries()){let h=B[C];if(h===void 0||!le(d.meta))continue;let k=s[C]?.name??d.value.split(/\r?\n/).find(E=>E.trim()!=="")?.trim()??`step ${h}`,R=Ko(d.value);if(d.output){let E=zo(d.output.attrs,h,k,!1,R?d.output.text:void 0);E&&t.push(E)}for(let E of d.meta.history?.entries??[]){let S=zo(E.attrs,h,k,!0,R?E.text:void 0);S&&t.push(S)}}t.push(...vc(r)),t.sort((C,d)=>Date.parse(C.at)-Date.parse(d.at)||(C.step??0)-(d.step??0));let i={};for(let C of t)C.milestone&&!i[C.milestone]&&(i[C.milestone]=C.at);let o=t.filter(C=>C.kind==="run"),a=t[0]?.at,c=t[t.length-1]?.at,u=i.detected??a,l={...e?.incident?{incident:e.incident}:{},...e?.severity?{severity:e.severity}:{},...e?.drill?{drill:!0}:{},...a?{start:a}:{},...c?{end:c}:{},...a&&c?{durationSeconds:Vr(a,c)}:{},runs:o.length,failedAttempts:o.filter(C=>!C.ok).length,milestones:i,...u&&i.mitigated?{timeToMitigateSeconds:Vr(u,i.mitigated)}:{},...u&&i.resolved?{timeToResolveSeconds:Vr(u,i.resolved)}:{},people:[...new Set(t.flatMap(C=>C.by?[C.by]:[]))],places:[...new Set(t.flatMap(C=>C.on?[C.on]:[]))]},f=t.flatMap(C=>C.earlier?[]:C.checks??[]);if(f.length&&(l.endpointChecks={total:f.length,failed:f.filter(C=>!C.ok).length}),e?.rtoSeconds!==void 0){l.rtoSeconds=e.rtoSeconds;let C=i.resolved??c;a&&C&&(l.rtoMet=Vr(a,C)<=e.rtoSeconds)}return{events:t,summary:l}}function Wn(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 Oc=100;function Yo(r,e,t=!1){return!t&&!et(r)?.evidence?{}:{...e.by?{by:e.by}:{},...e.on?{on:e.on}:{}}}function Qo(r,e){return et(r)?.evidence?Math.max(e,Oc):e}var Zo=require("module"),Ac=(0,Zo.createRequire)("/"),Rc;try{Rc=Ac("worker_threads").Worker}catch{}var we=Uint8Array,Je=Uint16Array,kB=Int32Array,Xr=new we([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]),es=new we([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]),DB=new we([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xo=function(r,e){for(var t=new Je(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new kB(t[30]),n=1;n<30;++n)for(var B=t[n];B<t[n+1];++B)s[B]=B-t[n]<<5|n;return{b:t,r:s}},ea=Xo(Xr,2),ta=ea.b,bB=ea.r;ta[28]=258,bB[258]=28;var na=Xo(es,0),yc=na.b,qo=na.r,wB=new Je(32768);for(oe=0;oe<32768;++oe)dt=(oe&43690)>>1|(oe&21845)<<1,dt=(dt&52428)>>2|(dt&13107)<<2,dt=(dt&61680)>>4|(dt&3855)<<4,wB[oe]=((dt&65280)>>8|(dt&255)<<8)>>1;var dt,oe,lt=(function(r,e,t){for(var n=r.length,s=0,B=new Je(e);s<n;++s)r[s]&&++B[r[s]-1];var i=new Je(e);for(s=1;s<e;++s)i[s]=i[s-1]+B[s-1]<<1;var o;if(t){o=new Je(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var c=s<<4|r[s],u=e-r[s],l=i[r[s]-1]++<<u,f=l|(1<<u)-1;l<=f;++l)o[wB[l]>>a]=c}else for(o=new Je(n),s=0;s<n;++s)r[s]&&(o[s]=wB[i[r[s]-1]++]>>15-r[s]);return o}),vt=new we(288);for(oe=0;oe<144;++oe)vt[oe]=8;var oe;for(oe=144;oe<256;++oe)vt[oe]=9;var oe;for(oe=256;oe<280;++oe)vt[oe]=7;var oe;for(oe=280;oe<288;++oe)vt[oe]=8;var oe,er=new we(32);for(oe=0;oe<32;++oe)er[oe]=5;var oe,Fc=lt(vt,9,0),Ic=lt(vt,9,1),Tc=lt(er,5,0),Lc=lt(er,5,1),gB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},tt=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},mB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},vB=function(r){return(r+7)/8|0},Xn=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new we(r.subarray(e,t))};var Nc=["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"],nt=function(r,e,t){var n=new Error(e||Nc[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,nt),!t)throw n;return n},$c=function(r,e,t,n){var s=r.length,B=n?n.length:0;if(!s||e.f&&!e.l)return t||new we(0);var i=!t,o=i||e.i!=2,a=e.i;i&&(t=new we(s*3));var c=function(j){var U=t.length;if(j>U){var ne=new we(Math.max(U*2,j));ne.set(t),t=ne}},u=e.f||0,l=e.p||0,f=e.b||0,C=e.l,d=e.d,h=e.m,k=e.n,R=s*8;do{if(!C){u=tt(r,l,1);var E=tt(r,l+1,3);if(l+=3,E)if(E==1)C=Ic,d=Lc,h=9,k=5;else if(E==2){var O=tt(r,l,31)+257,$=tt(r,l+10,15)+4,b=O+tt(r,l+5,31)+1;l+=14;for(var m=new we(b),G=new we(19),T=0;T<$;++T)G[DB[T]]=tt(r,l+T*3,7);l+=$*3;for(var H=gB(G),Q=(1<<H)-1,z=lt(G,H,1),T=0;T<b;){var q=z[tt(r,l,Q)];l+=q&15;var S=q>>4;if(S<16)m[T++]=S;else{var V=0,ee=0;for(S==16?(ee=3+tt(r,l,3),l+=2,V=m[T-1]):S==17?(ee=3+tt(r,l,7),l+=3):S==18&&(ee=11+tt(r,l,127),l+=7);ee--;)m[T++]=V}}var Be=m.subarray(0,O),te=m.subarray(O);h=gB(Be),k=gB(te),C=lt(Be,h,1),d=lt(te,k,1)}else nt(1);else{var S=vB(l)+4,w=r[S-4]|r[S-3]<<8,y=S+w;if(y>s){a&&nt(0);break}o&&c(f+w),t.set(r.subarray(S,y),f),e.b=f+=w,e.p=l=y*8,e.f=u;continue}if(l>R){a&&nt(0);break}}o&&c(f+131072);for(var De=(1<<h)-1,pe=(1<<k)-1,$e=l;;$e=l){var V=C[mB(r,l)&De],he=V>>4;if(l+=V&15,l>R){a&&nt(0);break}if(V||nt(2),he<256)t[f++]=he;else if(he==256){$e=l,C=null;break}else{var ke=he-254;if(he>264){var T=he-257,x=Xr[T];ke=tt(r,l,(1<<x)-1)+ta[T],l+=x}var v=d[mB(r,l)&pe],A=v>>4;v||nt(3),l+=v&15;var te=yc[A];if(A>3){var x=es[A];te+=mB(r,l)&(1<<x)-1,l+=x}if(l>R){a&&nt(0);break}o&&c(f+131072);var N=f+ke;if(f<te){var F=B-te,P=Math.min(te,N);for(F+f<0&&nt(3);f<P;++f)t[f]=n[F+f]}for(;f<N;++f)t[f]=t[f-te]}}e.l=C,e.p=$e,e.b=f,e.f=u,C&&(u=1,e.m=h,e.d=d,e.n=k)}while(!u);return f!=t.length&&i?Xn(t,0,f):t.subarray(0,f)},pt=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},Vn=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},EB=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,B=t.slice();if(!s)return{t:sa,l:0};if(s==1){var i=new we(t[0].s+1);return i[t[0].s]=1,{t:i,l:1}}t.sort(function(y,O){return y.f-O.f}),t.push({s:-1,f:25001});var o=t[0],a=t[1],c=0,u=1,l=2;for(t[0]={s:-1,f:o.f+a.f,l:o,r:a};u!=s-1;)o=t[t[c].f<t[l].f?c++:l++],a=t[c!=u&&t[c].f<t[l].f?c++:l++],t[u++]={s:-1,f:o.f+a.f,l:o,r:a};for(var f=B[0].s,n=1;n<s;++n)B[n].s>f&&(f=B[n].s);var C=new Je(f+1),d=xB(t[u-1],C,0);if(d>e){var n=0,h=0,k=d-e,R=1<<k;for(B.sort(function(O,$){return C[$.s]-C[O.s]||O.f-$.f});n<s;++n){var E=B[n].s;if(C[E]>e)h+=R-(1<<d-C[E]),C[E]=e;else break}for(h>>=k;h>0;){var S=B[n].s;C[S]<e?h-=1<<e-C[S]++-1:++n}for(;n>=0&&h;--n){var w=B[n].s;C[w]==e&&(--C[w],++h)}d=e}return{t:new we(C),l:d}},xB=function(r,e,t){return r.s==-1?Math.max(xB(r.l,e,t+1),xB(r.r,e,t+1)):e[r.s]=t},Wo=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Je(++e),n=0,s=r[0],B=1,i=function(a){t[n++]=a},o=1;o<=e;++o)if(r[o]==s&&o!=e)++B;else{if(!s&&B>2){for(;B>138;B-=138)i(32754);B>2&&(i(B>10?B-11<<5|28690:B-3<<5|12305),B=0)}else if(B>3){for(i(s),--B;B>6;B-=6)i(8304);B>2&&(i(B-3<<5|8208),B=0)}for(;B--;)i(s);B=1,s=r[o]}return{c:t.subarray(0,n),n:e}},Zn=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},ra=function(r,e,t){var n=t.length,s=vB(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 B=0;B<n;++B)r[s+B+4]=t[B];return(s+4+n)*8},Vo=function(r,e,t,n,s,B,i,o,a,c,u){pt(e,u++,t),++s[256];for(var l=EB(s,15),f=l.t,C=l.l,d=EB(B,15),h=d.t,k=d.l,R=Wo(f),E=R.c,S=R.n,w=Wo(h),y=w.c,O=w.n,$=new Je(19),b=0;b<E.length;++b)++$[E[b]&31];for(var b=0;b<y.length;++b)++$[y[b]&31];for(var m=EB($,7),G=m.t,T=m.l,H=19;H>4&&!G[DB[H-1]];--H);var Q=c+5<<3,z=Zn(s,vt)+Zn(B,er)+i,q=Zn(s,f)+Zn(B,h)+i+14+3*H+Zn($,G)+2*$[16]+3*$[17]+7*$[18];if(a>=0&&Q<=z&&Q<=q)return ra(e,u,r.subarray(a,a+c));var V,ee,Be,te;if(pt(e,u,1+(q<z)),u+=2,q<z){V=lt(f,C,0),ee=f,Be=lt(h,k,0),te=h;var De=lt(G,T,0);pt(e,u,S-257),pt(e,u+5,O-1),pt(e,u+10,H-4),u+=14;for(var b=0;b<H;++b)pt(e,u+3*b,G[DB[b]]);u+=3*H;for(var pe=[E,y],$e=0;$e<2;++$e)for(var he=pe[$e],b=0;b<he.length;++b){var ke=he[b]&31;pt(e,u,De[ke]),u+=G[ke],ke>15&&(pt(e,u,he[b]>>5&127),u+=he[b]>>12)}}else V=Fc,ee=vt,Be=Tc,te=er;for(var b=0;b<o;++b){var x=n[b];if(x>255){var ke=x>>18&31;Vn(e,u,V[ke+257]),u+=ee[ke+257],ke>7&&(pt(e,u,x>>23&31),u+=Xr[ke]);var v=x&31;Vn(e,u,Be[v]),u+=te[v],v>3&&(Vn(e,u,x>>5&8191),u+=es[v])}else Vn(e,u,V[x]),u+=ee[x]}return Vn(e,u,V[256]),u+ee[256]},Mc=new kB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sa=new we(0),Gc=function(r,e,t,n,s,B){var i=B.z||r.length,o=new we(n+i+5*(1+Math.ceil(i/7e3))+s),a=o.subarray(n,o.length-s),c=B.l,u=(B.r||0)&7;if(e){u&&(a[0]=B.r>>3);for(var l=Mc[e-1],f=l>>13,C=l&8191,d=(1<<t)-1,h=B.p||new Je(32768),k=B.h||new Je(d+1),R=Math.ceil(t/3),E=2*R,S=function(ce){return(r[ce]^r[ce+1]<<R^r[ce+2]<<E)&d},w=new kB(25e3),y=new Je(288),O=new Je(32),$=0,b=0,m=B.i||0,G=0,T=B.w||0,H=0;m+2<i;++m){var Q=S(m),z=m&32767,q=k[Q];if(h[z]=q,k[Q]=z,T<=m){var V=i-m;if(($>7e3||G>24576)&&(V>423||!c)){u=Vo(r,a,0,w,y,O,b,G,H,m-H,u),G=$=b=0,H=m;for(var ee=0;ee<286;++ee)y[ee]=0;for(var ee=0;ee<30;++ee)O[ee]=0}var Be=2,te=0,De=C,pe=z-q&32767;if(V>2&&Q==S(m-pe))for(var $e=Math.min(f,V)-1,he=Math.min(32767,m),ke=Math.min(258,V);pe<=he&&--De&&z!=q;){if(r[m+Be]==r[m+Be-pe]){for(var x=0;x<ke&&r[m+x]==r[m+x-pe];++x);if(x>Be){if(Be=x,te=pe,x>$e)break;for(var v=Math.min(pe,x-2),A=0,ee=0;ee<v;++ee){var N=m-pe+ee&32767,F=h[N],P=N-F&32767;P>A&&(A=P,q=N)}}}z=q,q=h[z],pe+=z-q&32767}if(te){w[G++]=268435456|bB[Be]<<18|qo[te];var j=bB[Be]&31,U=qo[te]&31;b+=Xr[j]+es[U],++y[257+j],++O[U],T=m+Be,++$}else w[G++]=r[m],++y[r[m]]}}for(m=Math.max(m,T);m<i;++m)w[G++]=r[m],++y[r[m]];u=Vo(r,a,c,w,y,O,b,G,H,m-H,u),c||(B.r=u&7|a[u/8|0]<<3,u-=7,B.h=k,B.p=h,B.i=m,B.w=T)}else{for(var m=B.w||0;m<i+c;m+=65535){var ne=m+65535;ne>=i&&(a[u/8|0]=c,ne=i),u=ra(a,u+1,r.subarray(m,ne))}B.i=i}return Xn(o,0,n+vB(u)+s)};var Hc=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var B=e.dictionary.subarray(-32768),i=new we(B.length+r.length);i.set(B),i.set(r,B.length),r=i,s.w=B.length}return Gc(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 Ba(r,e){return Hc(r,e||{},0,0)}var ia=(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 we(32768),this.p=new we(0),n&&this.o.set(n)}return r.prototype.e=function(e){if(this.ondata||nt(5),this.d&&nt(4),!this.p.length)this.p=e;else if(e.length){var t=new we(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=$c(this.p,this.s,this.o);this.ondata(Xn(n,t,this.s.b),this.d),this.o=Xn(n,this.s.b-32768),this.s.b=this.o.length,this.p=Xn(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 Pc=typeof TextDecoder<"u"&&new TextDecoder,_c=0;try{Pc.decode(sa,{stream:!0}),_c=1}catch{}var Jc=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]),ut=(r,e)=>r>>>e|r<<32-e;function oa(r){return Array.from(Uc(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function Uc(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]),B=new Uint32Array(64);for(let i=0;i<t.length;i+=64){for(let h=0;h<16;h++)B[h]=n.getUint32(i+h*4);for(let h=16;h<64;h++){let k=ut(B[h-15],7)^ut(B[h-15],18)^B[h-15]>>>3,R=ut(B[h-2],17)^ut(B[h-2],19)^B[h-2]>>>10;B[h]=B[h-16]+k+B[h-7]+R>>>0}let[o,a,c,u,l,f,C,d]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let h=0;h<64;h++){let k=ut(l,6)^ut(l,11)^ut(l,25),R=l&f^~l&C,E=d+k+R+Jc[h]+B[h]>>>0,S=ut(o,2)^ut(o,13)^ut(o,22),w=o&a^o&c^a&c,y=S+w>>>0;d=C,C=f,f=l,l=u+E>>>0,u=c,c=a,a=o,o=E+y>>>0}s[0]=s[0]+o>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+c>>>0,s[3]=s[3]+u>>>0,s[4]=s[4]+l>>>0,s[5]=s[5]+f>>>0,s[6]=s[6]+C>>>0,s[7]=s[7]+d>>>0}return s}var ts=/[ \t]/,aa=/[A-Za-z0-9_]/,Kc=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function jc(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&ts.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let B=r[t];if(B==="'"||B==='"'){let i=r.indexOf(B,t+1);if(i<0)return;let o=r.slice(t+1,i);s+=B==='"'?o.replace(/\\([\\"$`])/g,"$1"):o,t=i+1}else B==="\\"?(s+=r[t+1]??"",t+=2):(s+=B,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var SB=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 o=this.heredocs[0];return(o.strip?e.replace(/^\t+/,""):e)===o.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",B=e.length,i=0;for(;i<B;){let o=e[i];if(this.quote==="'"||this.quote==="$'"){o==="\\"&&this.quote==="$'"?i++:o==="'"&&(this.quote=""),i++;continue}if(this.quote==='"'||this.quote==="`"){o==="\\"?(i===B-1&&(this.cont=!0),i++):o===this.quote&&(this.quote=""),i++;continue}if(ts.test(o)){i++;continue}if(o==="#"&&(i===0||/[\s;&|()]/.test(e[i-1])))break;if(t=!0,o==="\\"){i===B-1&&(this.cont=!0),s="",n=!1,i+=2;continue}if(o==="'"||o==='"'||o==="`")this.quote=o;else if(o==="$"&&e[i+1]==="'")this.quote="$'",i++;else if(o==="<"&&e.startsWith("<<",i)&&e[i+2]!=="<"){let a=jc(e,i+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),i=a.end,s="x",n=!1;continue}}else if(o==="("||o===")")this.top()!=="case"&&(o==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(o==="{")this.stack.push("{");else if(o==="}")this.top()==="{"&&this.stack.pop();else if(n&&aa.test(o)){let a=i;for(;a<B&&aa.test(e[a]);)a++;let c=e.slice(i,a);if((a===B||/[\s;&|()<>]/.test(e[a]))&&this.keyword(c)){i=a,s=c;continue}i=a,s=c,n=!1;continue}n=o===";"||o==="&"||o==="|"||o==="("||o==="{"||o==="}"||o==="!",s=(s+o).slice(-2),i++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&Kc.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}}},OB=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,B=0;for(;B<s;){let i=e[B];if(this.blockComment){e.startsWith("#>",B)?(this.blockComment=!1,B+=2):B++;continue}if(this.quote==="'"){(i==="'"||i==="\u2018"||i==="\u2019")&&(e[B+1]===i?B++:this.quote=""),B++;continue}if(this.quote==='"'){i==="`"?B++:i==='"'&&(e[B+1]==='"'?B++:this.quote=""),B++;continue}if(ts.test(i)){B++;continue}if(e.startsWith("<#",B)){this.blockComment=!0,B+=2;continue}if(i==="#")break;if(t=!0,i==="`"){B===s-1&&(this.cont=!0),n="`",B+=2;continue}if(i==="@"&&(e[B+1]==="'"||e[B+1]==='"')&&e.slice(B+2).trim()==="")return this.quote=e[B+1]==="'"?"@'":'@"',!0;i==="'"||i==='"'||i==="\u2018"||i==="\u2019"?this.quote=i==='"'?'"':"'":i==="("||i==="{"||i==="["?this.depth++:(i===")"||i==="}"||i==="]")&&this.depth>0&&this.depth--,n=(n+i).slice(-4),B++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},AB=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 B=e[s];if(ts.test(B)||(n=!0),B==='"')t=!t;else{if(t)continue;B==="^"?(s===e.length-1&&(this.cont=!0),s++):B==="("?this.depth++:B===")"&&this.depth>0&&this.depth--}}return n}};function zc(r){return r==="pwsh"?new OB:r==="cmd"?new AB:new SB}function Yc(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function la(r,e){let t=Nt(r),n=zc(e),s=[],B,i=a=>{s.push({start:B,end:a,text:t.slice(B,a+1).map((c,u,l)=>c.text+(u<l.length-1?c.eol:"")).join("")}),B=void 0},o=a=>t.slice(a+1).find(c=>c.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let c=n.line(t[a].text);if(B===void 0){if(!c)continue;B=a}if(n.open())continue;let u=o(a);u!==void 0&&Yc(e,u)||i(a)}if(B!==void 0){let a=t.length-1;for(;a>B&&t[a].text.trim()==="";)a--;i(a)}return s}var yB="md-runbook",ca="md-runbook-manifest 1",fa=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,Qc=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,qc=/^\d{4}-\d{2}-\d{2}$/,Wc=r=>qc.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function ua(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 Vc=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function St(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],B=e[n+1],i=e[n+2];t+=tr[s>>2]+tr[(s&3)<<4|(B??0)>>4],t+=B===void 0?"=":tr[(B&15)<<2|(i??0)>>6],t+=i===void 0?"=":tr[i&63]}return t}function Ca(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 B=0;B<r.length;B+=4){let i=[0,1,2,3].map(a=>r[B+a]==="="?0:tr.indexOf(r[B+a])),o=i[0]<<18|i[1]<<12|i[2]<<6|i[3];for(let a of[o>>16,o>>8&255,o&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return St(s)===r?s:void 0}function RB(r){let e=[];return Ce(r).cells.forEach((t,n)=>{t.kind!=="code"||!le(t.meta)||Re(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function Zc(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,B)=>{if(t){Le(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${B+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let i=Ae(s);if(i){/^( {4}|\t| {0,3}\t)/.test(i.indent)&&e.push(`line ${B+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&Re(wt(i.info))==="bash"&&e.push(`line ${B+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=i;return}for(let o of s.matchAll(/<!--|-->/g))n=o[0]==="<!--"}),e}function FB(r,e){let t=[];fa.test(e.name)||t.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&t.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!Wc(e.expires)&&t.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let a of e.scopes)Qc.test(a)||t.push(`scope "${a}": use letters, digits and . _ - (at most 64)`);for(let[a,c]of Object.entries(e.patterns))ht.test(a)?ua(a)&&t.push(`\${param:${a}}: ${a} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):t.push(`pattern for "${a}": not a parameter name`),c===""||/[\r\n]/.test(c)?t.push(`pattern for ${a}: empty or more than one line`):Vc.test(c)&&t.push(`pattern for ${a}: ${c} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);t.push(...Zc(ga(r)));let n=et(r)?.shell?.unix;n&&n!=="bash"&&t.push(`front matter shell: ${n}: servers run signed runbooks in bash; remove it, or write shell: bash`);let s=new Set;for(let a of RB(r))for(let c of de(a.info).checks?.captures??[])c.secret&&s.add(c.name);let B=[];for(let a of RB(r)){let c=B.length+1,u=`cell ${c} (${a.value.split(`
|
|
89
|
+
`)[0]?.slice(0,40)??""})`,l=de(a.info);for(let d of l.errors)t.push(`${u}: invalid option ${d}`);let f=[];try{for(let d of Xe(a.value)){let h=`\${${d.kind}:${d.name}${d.kind==="input"&&d.secret?":secret":""}}`;d.kind==="secret"?t.push(`${u}: ${h} can't be signed (servers log the values signed cells get)`):d.secret?t.push(`${u}: ${h} can't be signed: a secret input would be in the servers' logs`):d.kind==="out"&&s.has(d.name)?t.push(`${u}: ${h} comes from capture-secret= and can't be signed (servers log the values)`):e.patterns[d.name]===void 0?t.push(`${u}: ${h} needs a pattern (--pattern ${d.name}=REGEX)`):f.includes(d.name)||f.push(d.name)}}catch(d){t.push(`${u}: ${d instanceof Error?d.message:String(d)}`)}for(let d of a.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])||t.push(`${u}: ${d[0]}} is not a plain \${${d[1]}:NAME} and can't be signed`);let C=jt(l.kubeContext);C!==void 0&&e.patterns[C]===void 0&&t.push(`${u}: kube-context=\${param:${C}} needs a pattern (--pattern ${C}=REGEX)`);for(let[d,h]of Object.entries(l.env))ht.test(d)?ua(d)&&t.push(`${u}: env.${d} can't be set by a signed runbook (it changes how the shell runs the code)`):t.push(`${u}: env.${d} is not a variable name`),/\$\{(secret|input|param|out):/.test(h)&&t.push(`${u}: env.${d} can't use placeholders in a signed runbook`);B.push({n:c,lines:l.lines==="any"?"any":"all",info:a.info,code:dn(a.value,"bash"),needs:f,...l.cwd!==void 0?{cwd:l.cwd}:{},env:l.env,steps:la(a.value,"bash").map(d=>dn(d.text,"bash"))})}if(B.length===0&&t.push("no bash or sh cells to sign"),t.length>0)return{errors:t};let i=new Set(B.flatMap(a=>a.needs)),o=Object.fromEntries(Object.entries(e.patterns).filter(([a])=>i.has(a)));return{manifest:{...e,scopes:[...new Set(e.scopes)],patterns:o,cells:B}}}function IB(r){let e=[ca,`name ${r.name}`,`version ${r.version}`];r.expires&&e.push(`expires ${r.expires}`),r.scopes.length>0&&e.push(`scope ${r.scopes.join(" ")}`);for(let[t,n]of Object.entries(r.patterns))e.push(`param ${t} ${St(n)}`);for(let t of r.cells){e.push(`cell ${t.n} ${t.lines}`,`info ${St(t.info)}`,`code ${St(t.code)}`);for(let n of t.needs)e.push(`needs ${n}`);t.cwd!==void 0&&e.push(`cwd ${St(t.cwd)}`);for(let[n,s]of Object.entries(t.env))e.push(`env ${n} ${St(s)}`);for(let n of t.steps)e.push(`step ${St(n)}`)}return e.push("end"),e.join(`
|
|
90
90
|
`)+`
|
|
91
|
-
`}function
|
|
92
|
-
`);if(e[0]!==
|
|
93
|
-
`).trimEnd(),
|
|
91
|
+
`}function nr(r){let e=r.split(`
|
|
92
|
+
`);if(e[0]!==ca)throw new Error("not an md-runbook manifest (or a newer version)");let t={name:"",version:0,scopes:[],patterns:{},cells:[]},n,s=(o,a)=>{let c=o===void 0?void 0:Ca(o);if(c===void 0)throw new Error(`manifest: bad ${a}`);return c},B=o=>{if(!n)throw new Error(`manifest: ${o} outside a cell`);return n},i=!1;for(let o of e.slice(1)){if(i){if(o!=="")throw new Error("manifest: text after end");continue}if(o==="")continue;let[a,c,u,...l]=o.split(" ");if(l.length>0&&a!=="scope")throw new Error(`manifest: bad line "${o.slice(0,40)}"`);switch(a){case"name":t.name=c??"";break;case"version":t.version=Number(c);break;case"expires":t.expires=c;break;case"scope":t.scopes=o.split(" ").slice(1);break;case"param":t.patterns[c??""]=s(u,"pattern");break;case"cell":n={n:Number(c),lines:u==="any"?"any":"all",info:"",code:"",needs:[],env:{},steps:[]},t.cells.push(n);break;case"info":B("info").info=s(c,"info");break;case"code":B("code").code=s(c,"code");break;case"needs":B("needs").needs.push(c??"");break;case"cwd":B("cwd").cwd=s(c,"cwd");break;case"env":B("env").env[c??""]=s(u,"env");break;case"step":B("step").steps.push(s(c,"step"));break;case"end":i=!0;break;default:throw new Error(`manifest: unknown item "${a}"`)}}if(!i)throw new Error("manifest: no end");if(!fa.test(t.name)||!Number.isInteger(t.version)||t.version<1)throw new Error("manifest: bad name or version");return t}var Xc=/^<!-- 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,ef=/cosign signer=(\S+) signed=(\d{4}-\d{2}-\d{2})\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,ns=r=>r.replace(/.{1,76}/g,`$&
|
|
93
|
+
`).trimEnd(),Ot=r=>r.replace(/[^\w@.+-]+/g,"_").replace(/-{2,}/g,"-")||"unknown";function tf(r){return`<!-- md-runbook:signature v1 signer=${Ot(r.signer)} signed=${r.signed}
|
|
94
94
|
manifest
|
|
95
|
-
${
|
|
95
|
+
${ns(St(r.manifest))}
|
|
96
96
|
signature
|
|
97
|
-
${
|
|
98
|
-
`+(r.cosigners??[]).map(e=>`cosign signer=${
|
|
99
|
-
${
|
|
100
|
-
`).join("")+"-->"}function
|
|
101
|
-
`)){let o=i.replace(/\r$/,"");t?(e.add(n),
|
|
97
|
+
${ns(r.signature)}
|
|
98
|
+
`+(r.cosigners??[]).map(e=>`cosign signer=${Ot(e.signer)} signed=${e.signed}
|
|
99
|
+
${ns(e.signature)}
|
|
100
|
+
`).join("")+"-->"}function ha(r){let e=new Set,t=null,n=0;for(let i of r.split(`
|
|
101
|
+
`)){let o=i.replace(/\r$/,"");t?(e.add(n),Le(o,t)&&(t=null)):t=Ae(o),n+=i.length+1}let s=new RegExp(Xc.source,"gm"),B;for(let i=s.exec(r);i;i=s.exec(r))e.has(i.index)||(B=i);return B}function TB(r){let e=ha(r);if(!e)return;let t=Ca(e[3].replace(/\s+/g,""));if(t===void 0)return;let n=[...(e[5]??"").trim().matchAll(ef)].map(s=>({signer:s[1],signed:s[2],signature:s[3].replace(/\s+/g,"")}));return{signer:e[1],signed:e[2],manifest:t,signature:e[4].replace(/\s+/g,""),...n.length?{cosigners:n}:{}}}function da(r,e){let t;try{t=nr(e.manifest)}catch{return!1}let n=FB(r,{name:t.name,version:t.version,...t.expires?{expires:t.expires}:{},scopes:t.scopes,patterns:t.patterns});return!("errors"in n)&&IB(n.manifest)===e.manifest}function pa(r){return[r.signature,...(r.cosigners??[]).map(e=>e.signature)]}function LB(r){return[r.signer,...(r.cosigners??[]).map(e=>e.signer)]}function ga(r){let e=ha(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 NB(r,e){let t=ga(r),n=/\r\n/.test(t)?`\r
|
|
102
102
|
`:`
|
|
103
|
-
`,s=
|
|
104
|
-
${
|
|
103
|
+
`,s=tf(e).replace(/\n/g,n),B=t.replace(/(\r?\n)*$/,"");return(B===""?"":B+n+n)+s+n}function ma(r){return`-----BEGIN SSH SIGNATURE-----
|
|
104
|
+
${ns(r)}
|
|
105
105
|
-----END SSH SIGNATURE-----
|
|
106
|
-
`}function
|
|
107
|
-
`).trimEnd();function
|
|
106
|
+
`}function Ea(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 At(r){let e=TB(r);if(!e)return;let t;try{t=nr(e.manifest)}catch{return}let n=[...t.cells],s=new Map,B=[],i=[],o=0;for(let a of RB(r)){let c=dn(a.value,"bash"),u=n.findIndex(f=>f.info===a.info&&f.code===c);if(u<0){B.push(a.index);continue}let l=n.splice(u,1)[0];s.set(a.index,{n:l.n,lines:l.lines,steps:l.steps,needs:l.needs}),l.n<o&&i.push(a.index),o=Math.max(o,l.n)}return{block:e,manifest:t,cells:s,changed:B,missing:n.map(a=>a.n),moved:i}}var ss="mdrunbook://open",nf=256*1024,rf=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,sf=/^[0-9a-f]{64}$/;function rs(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:{}},B=t.get("url"),i=t.get("rb");if(B!==null&&i!==null)return{ok:!1,problem:"both"};if(B!==null){try{if(new URL(B).protocol!=="https:")return{ok:!1,problem:"not-https"}}catch{return{ok:!1,problem:"not-https"}}s.url=B}else if(i!==null){let c=of(i);if(typeof c!="string")return{ok:!1,problem:c.problem};s.text=c}else return{ok:!1,problem:"no-runbook"};let o=t.get("sha256");if(o!==null){if(!sf.test(o.toLowerCase()))return{ok:!1,problem:"bad-sha256"};s.sha256=o.toLowerCase()}let a=t.get("host");if(a!==null){if(!rf.test(a))return{ok:!1,problem:"bad-host"};s.host=a}for(let[c,u]of t){if(!c.startsWith("p."))continue;let l=c.slice(2);if(!ht.test(l)||/[\r\n]/.test(u))return{ok:!1,problem:"bad-param"};s.params[l]=u}return t.get("action")==="cosign"&&(s.action="cosign"),{ok:!0,link:s}}function sr(r,e=ss){let t=[],n=(s,B)=>t.push(`${encodeURIComponent(s)}=${encodeURIComponent(B)}`);r.url!==void 0?n("url",r.url):r.text!==void 0&&n("rb",xa(r.text)),r.sha256&&n("sha256",r.sha256),r.host&&n("host",r.host);for(let[s,B]of Object.entries(r.params))n(`p.${s}`,B);return r.action&&n("action",r.action),`${e}?${t.join("&")}`}var Da="vscode://smojon.md-runbook/open",Bf=/[&=#+%]/;function ba(r){return[r.url,r.text!==void 0?xa(r.text):void 0,r.sha256,r.host,...Object.entries(r.params).flat()].some(t=>t!==void 0&&Bf.test(t))?`${Da}?link=${encodeURIComponent(sr(r))}`:sr(r,Da)}function wa(r){if(r.startsWith("link="))return rs(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 rs(`${ss}?${e.join("&")}`)}function Br(r){return oa(r.replace(/^/,""))}function xa(r){return af(Ba(new TextEncoder().encode(r),{level:9}))}function of(r){let e;try{e=lf(r)}catch{return{problem:"bad-text"}}let t=[],n=0,s=!1,B=new ia(a=>{n+=a.length,n>nf?s=!0:t.push(a)});try{for(let a=0;a<e.length&&!s;a+=4096)B.push(e.subarray(a,a+4096),a+4096>=e.length)}catch{return{problem:"bad-text"}}if(s)return{problem:"too-large"};let i=new Uint8Array(n),o=0;for(let a of t)i.set(a,o),o+=a.length;try{return new TextDecoder().decode(i)}catch{return{problem:"bad-text"}}}var rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function af(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+=rr[n>>18&63]+rr[n>>12&63],t+1<r.length&&(e+=rr[n>>6&63]),t+2<r.length&&(e+=rr[n&63])}return e}function lf(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,B=0;for(let i of e)s=s<<6|rr.indexOf(i),n+=6,n>=8&&(n-=8,t[B++]=s>>n&255);return t}var ka="[A-Za-z0-9+/=\\r\\n]+?",Sa=new RegExp(`^<!-- md-runbook:record-signature v1 signer=(\\S+) signed=(\\S+) sha256=([0-9a-f]{64})\\r?\\nsignature\\r?\\n(${ka})((?:\\r?\\ncosign signer=\\S+ signed=\\S+\\r?\\n${ka})*)\\r?\\n-->[ \\t]*$`,"m"),uf=/cosign signer=(\S+) signed=(\S+)\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,va=r=>r.replace(/.{1,76}/g,`$&
|
|
107
|
+
`).trimEnd();function $B(r){return`md-runbook run record v1
|
|
108
108
|
sha256 ${r}
|
|
109
|
-
`}function
|
|
109
|
+
`}function cf(r){let e=Sa.exec(r);if(!e)return;let t=[...(e[5]??"").trim().matchAll(uf)].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 Oa(r){let e=Sa.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 Bs(r){return Br(Oa(r))}function ff(r){return`<!-- md-runbook:record-signature v1 signer=${Ot(r.signer)} signed=${r.signed} sha256=${r.sha256}
|
|
110
110
|
signature
|
|
111
|
-
${
|
|
112
|
-
`+(r.cosigners??[]).map(e=>`cosign signer=${
|
|
113
|
-
${
|
|
114
|
-
`).join("")+"-->"}function
|
|
111
|
+
${va(r.signature)}
|
|
112
|
+
`+(r.cosigners??[]).map(e=>`cosign signer=${Ot(e.signer)} signed=${e.signed}
|
|
113
|
+
${va(e.signature)}
|
|
114
|
+
`).join("")+"-->"}function Aa(r,e){let t=Oa(r),n=/\r\n/.test(t)?`\r
|
|
115
115
|
`:`
|
|
116
|
-
`;return`${t.replace(/(\r?\n)*$/,"")}${n}${n}${
|
|
117
|
-
`)){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
|
|
116
|
+
`;return`${t.replace(/(\r?\n)*$/,"")}${n}${n}${ff(e).replace(/\n/g,n)}${n}`}function ir(r){let e=cf(r);return e?{block:e,unchanged:Bs(r)===e.sha256}:void 0}var mn=r=>[r.signer,...(r.cosigners??[]).map(e=>e.signer)];function Ra(r,e){return{...r,cosigners:[...(r.cosigners??[]).filter(t=>t.signer!==Ot(e.signer)),e]}}function MB(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 Cf(r,e,t){if(e!==void 0&&MB(r,e,t)==="none")return`<span class="badge none">${Z(`\u2013 lines ${e} ran`)}</span>`;if(t==="failed")return`<span class="badge fail">${Z("\u2717 check failed")}</span>`;if(t==="ok")return`<span class="badge ok">${Z(`\u2713 ${/^-?\d+$/.test(r??"")?`exit ${r}`:r??""}`)}</span>`;let n=MB(r),s=r!==void 0&&!/^-?\d+$/.test(r),B=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}">${Z(B)}</span>`}function hf(r){let e;for(let t of r.split(`
|
|
117
|
+
`)){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 df(r){let e=r.split(`
|
|
118
118
|
`);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(`
|
|
119
119
|
`),rest:e.slice(t+1).join(`
|
|
120
|
-
`)}}function
|
|
121
|
-
`,
|
|
122
|
-
`).find(
|
|
123
|
-
`,i+=`<section class="step ${
|
|
124
|
-
<div class="step-head">Step ${
|
|
125
|
-
`,i+=
|
|
120
|
+
`)}}function GB(r,e){let t=Ce(r),n=R=>e.redact?e.redact(R):R,s,B="",i="",o=0,a={ok:0,fail:0,skip:0,none:0},c=R=>{let E=t.cells[R].meta;return le(E)?de(E.info).os:void 0},u=zt(t.cells.map((R,E)=>le(R.meta)?{kind:"code",os:c(E)}:{kind:"markup"})),l=new Map;u.forEach((R,E)=>{if(!R)return;let S=l.get(R.group);(S===void 0||!t.cells[S].output&&t.cells[E].output)&&l.set(R.group,E)});let f=kt(t.cells.map((R,E)=>le(R.meta)?{kind:"code",os:c(E)}:{kind:"markup"})),C=new Map;f.forEach((R,E)=>R!==void 0&&C.set(E,R)),o=Math.max(0,...f.filter(R=>R!==void 0));for(let[R,E]of t.cells.entries()){if(!le(E.meta)){let q=E.value;if(R===0){let V=df(q);V&&(i+=`<div class="front-matter">${Nr(n(V.yaml),"front matter")}</div>
|
|
121
|
+
`,q=V.rest)}s??=hf(q),i+=Ks(q,n);continue}let S=u[R],w=S!==void 0&&l.get(S.group)!==R,y=C.get(R),O=E.output?.attrs??{},$=w?"skip":MB(O.exit,O.lines,O.check);w||a[$]++;let b=w?`<span class="badge skip">${Z(`\u2013 for ${pn(c(R)??[])}`)}</span>`:Cf(O.exit,O.lines,O.check),m=w?`step-${y}-${R}`:`step-${y}`,G=E.meta.lang,T=n(E.value),H=T.split(`
|
|
122
|
+
`).find(q=>q.trim()!=="")?.trim()??"",Q=de(E.meta.info).estimateSeconds,z=Q!==void 0?`est. ${ze(Q)}`:void 0;if(B+=`<tr class="${$}"><td><a href="#${m}">${y}</a></td><td><code>${Z(H)}</code></td><td>${Z(G)}</td><td>${b}</td><td>${Z(O.ran??"")}</td><td>${Z([O.duration,z].filter(Boolean).join(" \xB7 "))}</td></tr>
|
|
123
|
+
`,i+=`<section class="step ${$}" id="${m}">
|
|
124
|
+
<div class="step-head">Step ${y}${w?" (alternative)":""}</div>
|
|
125
|
+
`,i+=Nr(T,G),E.output){let q=[O.ran&&`ran ${O.ran}`,O.duration,z].filter(Boolean).map(V=>Z(V));i+=`<div class="output"><div class="output-head">${b} ${q.join(" \xB7 ")}</div><pre>${Z(n(Ve(E.output.text)))}</pre></div>
|
|
126
126
|
`}i+=`</section>
|
|
127
|
-
`}let
|
|
127
|
+
`}let d=s??e.fallbackTitle??"Runbook report",h=[`${o} step${o===1?"":"s"}`,`${a.ok} passed`,`${a.fail} failed`];a.skip&&h.push(`${a.skip} skipped`),a.none&&h.push(`${a.none} not run`);let k=pf(Zr(r),ir(r),n);return`<!DOCTYPE html>
|
|
128
128
|
<html lang="en">
|
|
129
129
|
<head>
|
|
130
130
|
<meta charset="utf-8">
|
|
131
131
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'">
|
|
132
132
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
133
133
|
<meta name="generator" content="md-runbook">
|
|
134
|
-
<title>${Z(
|
|
135
|
-
<style>${
|
|
134
|
+
<title>${Z(d)}</title>
|
|
135
|
+
<style>${HB}${k.pageCss}</style>
|
|
136
136
|
</head>
|
|
137
137
|
<body>
|
|
138
138
|
<header>
|
|
139
|
-
<h1 class="title">${xt(
|
|
140
|
-
<p class="meta">Generated ${Z(
|
|
139
|
+
<h1 class="title">${xt(d)}</h1>
|
|
140
|
+
<p class="meta">Generated ${Z(Se(e.generatedAt))} \xB7 ${h.join(" \xB7 ")}</p>
|
|
141
141
|
</header>
|
|
142
|
-
${
|
|
142
|
+
${k.html}<table class="summary">
|
|
143
143
|
<thead><tr><th>#</th><th>Command</th><th>Shell</th><th>Exit</th><th>Ran</th><th>Duration</th></tr></thead>
|
|
144
144
|
<tbody>
|
|
145
145
|
${B}</tbody>
|
|
@@ -148,7 +148,7 @@ ${B}</tbody>
|
|
|
148
148
|
${i}</main>
|
|
149
149
|
</body>
|
|
150
150
|
</html>
|
|
151
|
-
`}var
|
|
151
|
+
`}var HB=`
|
|
152
152
|
:root{--bg:#fff;--fg:#1f2328;--muted:#656d76;--border:#d0d7de;--code:#f6f8fa;--ok:#1a7f37;--fail:#cf222e;--skip:#9a6700;--link:#0969da}
|
|
153
153
|
@media (prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--muted:#8d96a0;--border:#30363d;--code:#161b22;--ok:#3fb950;--fail:#f85149;--skip:#d29922;--link:#4493f8}}
|
|
154
154
|
*{box-sizing:border-box}
|
|
@@ -185,8 +185,8 @@ blockquote{margin:0;padding:0 1em;color:var(--muted);border-left:.25em solid var
|
|
|
185
185
|
.badge.milestone{color:var(--link)}
|
|
186
186
|
.earlier{font-size:12px;color:var(--muted)}
|
|
187
187
|
@media print{.facts div,.timeline tr{break-inside:avoid}.timeline tr.note td{background:none}}
|
|
188
|
-
`,
|
|
189
|
-
`}).join(""),o=r.events.flatMap(l=>(l.checks??[]).map(
|
|
188
|
+
`,or=r=>r.replace("T"," ").replace(/([+-]\d\d:\d\d|Z)$/," $1");function pf(r,e,t){let n=r.summary;if(r.events.length===0&&!n.incident&&!e)return{html:"",pageCss:""};let s=[];n.incident&&s.push([n.drill?"Drill":"Incident",[n.incident,n.severity].filter(Boolean).join(" \xB7 ")]),n.start&&s.push(["Start",or(n.start)]),n.end&&s.push(["End",or(n.end)]),n.durationSeconds!==void 0&&s.push(["Duration",Wn(n.durationSeconds)]);for(let l of pB)n.milestones[l]&&s.push([l[0].toUpperCase()+l.slice(1),or(n.milestones[l])]);if(n.timeToMitigateSeconds!==void 0&&s.push(["Time to mitigate",Wn(n.timeToMitigateSeconds)]),n.timeToResolveSeconds!==void 0&&s.push(["Time to resolve",Wn(n.timeToResolveSeconds)]),n.rtoSeconds!==void 0&&s.push(["RTO",`${Wn(n.rtoSeconds)}${n.rtoMet===void 0?"":n.rtoMet?" \xB7 met":" \xB7 missed"}`]),s.push(["Runs",`${n.runs}${n.failedAttempts?` \xB7 ${n.failedAttempts} failed`:""}`]),n.endpointChecks&&s.push(["Endpoint checks",`${n.endpointChecks.total}${n.endpointChecks.failed?` \xB7 ${n.endpointChecks.failed} failed`:" \xB7 all up"}`]),n.people.length&&s.push(["People",n.people.join(", ")]),n.places.length&&s.push(["Ran on",n.places.join(", ")]),e){let l=mn(e.block).join(", ");s.push(["Record signed",e.unchanged?`by ${l} \xB7 unchanged since`:`by ${l} \xB7 CHANGED since signing`])}let B=s.map(([l,f])=>`<div${l==="Record signed"&&e&&!e.unchanged?' class="changed"':""}><dt>${Z(l)}</dt><dd>${Z(t(f))}</dd></div>`).join(""),i=r.events.map(l=>{let f=l.kind==="note"?`${l.milestone?`<span class="badge milestone">${Z(l.milestone)}</span> `:""}${Z(t(l.text??"")).replace(/\n/g,"<br>")}`:`<a href="#step-${l.step}">${l.step}</a> <code>${Z(t(l.label??""))}</code>${l.earlier?' <span class="earlier">earlier attempt</span>':""}`,C=l.kind==="note"?"":`<span class="badge ${l.ok?l.exit==="skipped"?"skip":"ok":"fail"}">${Z(l.check==="failed"?"check failed":l.exit==="0"?"exit 0":/^-?\d+$/.test(l.exit??"")?`exit ${l.exit}`:l.exit??"")}</span>`;return`<tr class="${l.kind}"><td>${Z(or(l.at))}</td><td>${f}</td><td>${Z(t(l.by??""))}</td><td>${Z(t(l.on??""))}</td><td>${C}</td><td>${Z(l.duration??"")}</td></tr>
|
|
189
|
+
`}).join(""),o=r.events.flatMap(l=>(l.checks??[]).map(f=>({e:l,c:f}))).map(({e:l,c:f})=>`<tr><td>${Z(or(l.at))}</td><td><a href="#step-${l.step}">${l.step}</a>${l.earlier?' <span class="earlier">earlier attempt</span>':""}</td><td><code>${Z(t(f.target))}</code></td><td><span class="badge ${f.ok?"ok":"fail"}">${f.ok?"up":"failed"}</span></td><td>${f.expires?Z(`${f.expires} (${f.daysLeft!==void 0&&f.daysLeft<0?`expired ${-f.daysLeft} days ago`:`${f.daysLeft} days`})`):""}</td><td>${Z(t(f.detail))}</td></tr>
|
|
190
190
|
`).join(""),a=`<section class="record">
|
|
191
191
|
<h2>${n.drill?"Drill record":n.incident?"Incident record":"Run record"}</h2>
|
|
192
192
|
<dl class="facts">${B}</dl>
|
|
@@ -202,72 +202,72 @@ ${i}</tbody>
|
|
|
202
202
|
${o}</tbody>
|
|
203
203
|
</table>
|
|
204
204
|
`:"")+`</section>
|
|
205
|
-
`,c=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",u=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${c?`@top-right{content:${JSON.stringify(c)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:u}}var da=new Set(["timeout","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","proposed","by","reason","approved","approved-by","approved-at"]),Vc=/^\s*[^\s{]*/;function ha(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(B,i)=>s===0?i:i===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let B=r[n-1]===e[s-1]?0:1,i=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+B);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(i=Math.min(i,t[n-2][s-2]+1)),t[n][s]=i}return t[r.length][e.length]}function Zc(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,B=!1;for(let i of da){let o=i.endsWith("y")?`${i.slice(0,-1)}ies`:`${i}s`,a=Math.min(ha(e,i),ha(e,o));a<s?(n=i,s=a,B=!1):a===s&&(B=!0)}return n!==void 0&&s<=t&&!B?n:void 0}var Xc=/^(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 eC(r,e,t){let n=[],s=r.findIndex((i,o)=>o>0&&o<e&&/^env\s*:/i.test(i));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 B=new Set;for(let i=s+1;i<e;i++){let o=r[i];if(o.trim()===""||o.trim().startsWith("#"))continue;if(!/^\s/.test(o))break;let a=Vs.exec(o);if(!a){n.push({severity:"warning",line:i,message:`front matter env: "${o.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let c=a[1];if(B.has(c)){n.push({severity:"warning",line:i,message:`front matter env: ${c} is set twice: the first one counts`});continue}B.add(c),Xc.test(c)&&n.push({severity:"warning",line:i,message:`front matter env: ${c} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${c}=)`})}return t&&B.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 ga(r){let e=[],t=Ee(r),n=Pt(t),s=Xe(r);if(s){let u=r.replace(/^/,"").split(/\r?\n/),l=u.findIndex((h,p)=>p>0&&/^(---|\.\.\.)\s*$/.test(h));for(let h=1;h<l;h++){let p=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion)\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;let f=p[1].toLowerCase();if(f==="mode"&&s.mode===void 0||f==="timeout"&&s.timeoutSeconds===void 0||f==="cwd"&&s.cwd===void 0||f==="kube-context"&&s.kubeContext===void 0||f==="kube-context-mode"&&s.kubeContextMode===void 0||f==="git-bash-path-conversion"&&s.gitBashPathConversion===void 0){let k={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"};e.push({severity:"warning",line:h,message:`front matter ${f}: "${p[2]}" is ignored (expected ${k[f]})`})}}let C={};for(let h=1;h<l;h++){let p=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;if(p[1]===""){e.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:f,unknown:w,twice:k}=Tn(p[1]);for(let E of["unix","powershell"]){let x=f[E];x&&(C[E]?k.push(x):C[E]=x)}for(let E of w){let x=/[\\/]/.test(E)?`front matter shell: "${E}" is ignored: name a shell (${[...yn,...In].join(", ")}), never a path`:`front matter shell: "${E}" is ignored (expected ${yn.join(", ")} for sh/bash cells, ${In.join(" or ")} for PowerShell cells)`;e.push({severity:"warning",line:h,message:x})}for(let E of k)e.push({severity:"warning",line:h,message:`front matter shell: "${E}" is ignored: one shell per kind of cell, the first one counts`})}e.push(...eC(u,l,At(r)!==void 0))}let B=s?.kubeContextMode==="pin",i=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(u=>/^kube-context-mode\s*:/i.test(u)));B&&!s?.kubeContext&&!n.some(u=>ve(u.info).kubeContext!==void 0)&&e.push({severity:"warning",line:i(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),B&&s?.practice&&e.push({severity:"warning",line:i(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${s.practice}: there the Kubernetes context is only checked`});let o=new Set((s?.params??[]).map(u=>u.name)),a=new Set;for(let u of n){let l=t.cells[u.cellIndex];if(!pe(l.meta)||!Ae(u.language))continue;let C=(x,O,I,v)=>{e.push({severity:x,message:O,line:I===void 0?u.line:u.line+1+I,cell:{index:u.cellIndex,...I!==void 0?{sourceLine:I}:{}},...v?{fix:v}:{}})},h=ve(u.info);for(let x of h.errors)C("error",`invalid cell option ${x}`);let p=u.info.replace(Vc,"");for(let x of Yn(p)){let O=x.key.toLowerCase();if(da.has(O)||O.startsWith("env.")&&O.length>4)continue;let I=Zc(O);I?C("warning",`unknown cell option "${x.key}" (ignored): did you mean "${I}"?`,void 0,{option:x.key,to:I}):C("warning",`unknown cell option "${x.key}" (ignored)`)}/(^|\s)every=/i.test(p)&&!h.retry&&C("warning","every= has no effect without retry="),h.host&&s?.env&&C("warning",`front matter env: doesn't apply on the host ${h.host}: there the cell gets only its own env.NAME= variables`);let f=h.kubeContext??s?.kubeContext;B&&h.host&&f&&C("warning",`kube-context-mode: pin doesn't apply on the host ${h.host}: there kubectl's current context must already be ${f} (only checked)`);let w=[];try{w=pn(u.source,u.info,s)}catch(x){C("error",x instanceof Error?x.message:String(x))}let k=u.source.split(/\r?\n/),E=x=>{let O=k.findIndex(I=>I.includes(x));return O<0?void 0:O};for(let x of w){let O="${"+x.kind+":"+x.name;x.kind==="out"&&!a.has(x.name)&&C("error",`\${out:${x.name}} is not captured by an earlier block (add capture=${x.name} to the block that prints it)`,E(O)),x.kind==="param"&&!o.has(x.name)&&C("warning",`\${param:${x.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${x.name}=\u2026)`,E(O))}for(let x of h.checks?.captures??[])a.add(x.name)}let c=At(r);if(c){let u=s?.shell?.unix;if(u&&u!=="bash"){let l=r.replace(/^/,"").split(/\r?\n/).findIndex(C=>/^shell\s*:/i.test(C));e.push({severity:"warning",line:Math.max(0,l),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 l of n.filter(C=>c.changed.includes(C.cellIndex)))e.push({severity:"warning",line:l.line,cell:{index:l.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let l of n.filter(C=>c.moved.includes(C.cellIndex)))e.push({severity:"warning",line:l.line,cell:{index:l.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${c.cells.get(l.cellIndex).n}, after blocks that now come later`});c.missing.length>0&&e.push({severity:"warning",line:Math.max(0,pa(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=pa(r);u>=0&&e.push({severity:"error",line:u,message:"the signature block is damaged (sign the runbook again)"})}return e.sort((u,l)=>u.line-l.line)}function pa(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Ne(n,e)&&(e=null):(e=Se(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function ma(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var fr=Ce(require("node:fs")),cs=Ce(require("node:os")),mt=Ce(require("node:path"));var AB=require("node:child_process"),SB=require("node:string_decoder");function es(r,e=process.platform){if(e==="win32"){(0,AB.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 tC=1e3;function RB(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,B=!1,i,o=p=>{B||(B=!0,clearTimeout(i),r.signal?.removeEventListener("abort",a),t({...p,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,u()};if(r.signal?.aborted){s=!0,o({exitCode:null,signal:null});return}let c=(0,AB.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}),u=()=>{c.pid!==void 0&&c.exitCode===null&&es(c.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(i=setTimeout(()=>{n=!0,u()},r.timeoutMs));let l=new SB.StringDecoder("utf8"),C=new SB.StringDecoder("utf8");c.stdout?.on("data",p=>r.onStdout(l.write(p))),c.stderr?.on("data",p=>r.onStderr(C.write(p)));let h=(p,f)=>{if(B)return;let w=l.end(),k=C.end();w&&r.onStdout(w),k&&r.onStderr(k),o({exitCode:p,signal:f})};c.on("error",p=>o({exitCode:null,signal:null,error:p.message})),c.on("close",h),c.on("exit",(p,f)=>{setTimeout(()=>{B||(c.stdout?.destroy(),c.stderr?.destroy(),h(p,f))},tC)})})}var dt=Ce(require("node:fs")),IB=Ce(require("node:os")),mn=Ce(require("node:path"));var Da=require("node:child_process"),nC=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function ba(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function wa(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(i=>i.toUpperCase()===n.toUpperCase()),B=s===void 0?void 0:e[s];return B===void 0?t:B})}function Ea(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function xa(r,e){let t=new Set(r.split(";").map(Ea).filter(Boolean)),n=[];for(let s of e){let B=Ea(s);!B||t.has(B)||(t.add(B),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var rC=r=>new Promise(e=>{(0,Da.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),ts,sC=3e3;async function va(r,e=Date.now(),t=rC){if(!ts||e-ts.at>=sC){let n=await Promise.all(nC.map(async s=>ba(await t(s))));ts={at:e,values:n}}return ts.values.flatMap(n=>wa(n,r).split(";").filter(s=>s.trim()))}async function FB(r,e=process.platform,t=va){if(e!=="win32")return r;let n=Object.keys(r).find(i=>i.toUpperCase()==="PATH")??"Path",s=r[n]??"",B=xa(s,await t(r));return B!==s&&(r[n]=B),r}var gn=Ce(require("node:path"));function Yt(r,e,t){switch(r){case"pwsh":return BC(e,t);case"cmd":return iC(t);case"bash":return aC(e,t)}}function ka(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=gn.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function BC(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=ka(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=ka(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 B=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:B,extension:".ps1",args:i=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Sa(i)],script:i=>"\uFEFF"+i.replace(/\r?\n/g,t?`\r
|
|
205
|
+
`,c=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",u=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${c?`@top-right{content:${JSON.stringify(c)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:u}}var Ia=new Set(["timeout","estimate","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","proposed","by","reason","approved","approved-by","approved-at"]),mf=/^\s*[^\s{]*/;function ya(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(B,i)=>s===0?i:i===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let B=r[n-1]===e[s-1]?0:1,i=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+B);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(i=Math.min(i,t[n-2][s-2]+1)),t[n][s]=i}return t[r.length][e.length]}function Ef(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,B=!1;for(let i of Ia){let o=i.endsWith("y")?`${i.slice(0,-1)}ies`:`${i}s`,a=Math.min(ya(e,i),ya(e,o));a<s?(n=i,s=a,B=!1):a===s&&(B=!0)}return n!==void 0&&s<=t&&!B?n:void 0}var Df=/^(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 bf(r,e,t){let n=[],s=r.findIndex((i,o)=>o>0&&o<e&&/^env\s*:/i.test(i));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 B=new Set;for(let i=s+1;i<e;i++){let o=r[i];if(o.trim()===""||o.trim().startsWith("#"))continue;if(!/^\s/.test(o))break;let a=sB.exec(o);if(!a){n.push({severity:"warning",line:i,message:`front matter env: "${o.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let c=a[1];if(B.has(c)){n.push({severity:"warning",line:i,message:`front matter env: ${c} is set twice: the first one counts`});continue}B.add(c),Df.test(c)&&n.push({severity:"warning",line:i,message:`front matter env: ${c} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${c}=)`})}return t&&B.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 Ta(r){let e=[],t=Ce(r),n=Ht(t),s=et(r);if(s){let u=r.replace(/^/,"").split(/\r?\n/),l=u.findIndex((C,d)=>d>0&&/^(---|\.\.\.)\s*$/.test(C));for(let C=1;C<l;C++){let d=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion)\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[C]);if(!d)continue;let h=d[1].toLowerCase();if(h==="mode"&&s.mode===void 0||h==="timeout"&&s.timeoutSeconds===void 0||h==="cwd"&&s.cwd===void 0||h==="kube-context"&&s.kubeContext===void 0||h==="kube-context-mode"&&s.kubeContextMode===void 0||h==="git-bash-path-conversion"&&s.gitBashPathConversion===void 0){let R={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"};e.push({severity:"warning",line:C,message:`front matter ${h}: "${d[2]}" is ignored (expected ${R[h]})`})}}let f={};for(let C=1;C<l;C++){let d=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[C]);if(!d)continue;if(d[1]===""){e.push({severity:"warning",line:C,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:h,unknown:k,twice:R}=$n(d[1]);for(let E of["unix","powershell"]){let S=h[E];S&&(f[E]?R.push(S):f[E]=S)}for(let E of k){let S=/[\\/]/.test(E)?`front matter shell: "${E}" is ignored: name a shell (${[...Ln,...Nn].join(", ")}), never a path`:`front matter shell: "${E}" is ignored (expected ${Ln.join(", ")} for sh/bash cells, ${Nn.join(" or ")} for PowerShell cells)`;e.push({severity:"warning",line:C,message:S})}for(let E of R)e.push({severity:"warning",line:C,message:`front matter shell: "${E}" is ignored: one shell per kind of cell, the first one counts`})}e.push(...bf(u,l,At(r)!==void 0))}let B=s?.kubeContextMode==="pin",i=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(u=>/^kube-context-mode\s*:/i.test(u)));B&&!s?.kubeContext&&!n.some(u=>de(u.info).kubeContext!==void 0)&&e.push({severity:"warning",line:i(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),B&&s?.practice&&e.push({severity:"warning",line:i(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${s.practice}: there the Kubernetes context is only checked`});let o=new Set((s?.params??[]).map(u=>u.name)),a=new Set;for(let u of n){let l=t.cells[u.cellIndex];if(!le(l.meta)||!Re(u.language))continue;let f=(S,w,y,O)=>{e.push({severity:S,message:w,line:y===void 0?u.line:u.line+1+y,cell:{index:u.cellIndex,...y!==void 0?{sourceLine:y}:{}},...O?{fix:O}:{}})},C=de(u.info);for(let S of C.errors)f("error",`invalid cell option ${S}`);let d=u.info.replace(mf,"");for(let S of qn(d)){let w=S.key.toLowerCase();if(Ia.has(w)||w.startsWith("env.")&&w.length>4)continue;let y=Ef(w);y?f("warning",`unknown cell option "${S.key}" (ignored): did you mean "${y}"?`,void 0,{option:S.key,to:y}):f("warning",`unknown cell option "${S.key}" (ignored)`)}/(^|\s)every=/i.test(d)&&!C.retry&&f("warning","every= has no effect without retry="),C.host&&s?.env&&f("warning",`front matter env: doesn't apply on the host ${C.host}: there the cell gets only its own env.NAME= variables`);let h=C.kubeContext??s?.kubeContext;B&&C.host&&h&&f("warning",`kube-context-mode: pin doesn't apply on the host ${C.host}: there kubectl's current context must already be ${h} (only checked)`);let k=[];try{k=gn(u.source,u.info,s)}catch(S){f("error",S instanceof Error?S.message:String(S))}let R=u.source.split(/\r?\n/),E=S=>{let w=R.findIndex(y=>y.includes(S));return w<0?void 0:w};for(let S of k){let w="${"+S.kind+":"+S.name;S.kind==="out"&&!a.has(S.name)&&f("error",`\${out:${S.name}} is not captured by an earlier block (add capture=${S.name} to the block that prints it)`,E(w)),S.kind==="param"&&!o.has(S.name)&&f("warning",`\${param:${S.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${S.name}=\u2026)`,E(w))}for(let S of C.checks?.captures??[])a.add(S.name)}let c=At(r);if(c){let u=s?.shell?.unix;if(u&&u!=="bash"){let l=r.replace(/^/,"").split(/\r?\n/).findIndex(f=>/^shell\s*:/i.test(f));e.push({severity:"warning",line:Math.max(0,l),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 l of n.filter(f=>c.changed.includes(f.cellIndex)))e.push({severity:"warning",line:l.line,cell:{index:l.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let l of n.filter(f=>c.moved.includes(f.cellIndex)))e.push({severity:"warning",line:l.line,cell:{index:l.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${c.cells.get(l.cellIndex).n}, after blocks that now come later`});c.missing.length>0&&e.push({severity:"warning",line:Math.max(0,Fa(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=Fa(r);u>=0&&e.push({severity:"error",line:u,message:"the signature block is damaged (sign the runbook again)"})}return e.sort((u,l)=>u.line-l.line)}function Fa(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Le(n,e)&&(e=null):(e=Ae(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function La(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var dr=ae(require("node:fs")),gs=ae(require("node:os")),Et=ae(require("node:path"));var _B=require("node:child_process"),PB=require("node:string_decoder");function is(r,e=process.platform){if(e==="win32"){(0,_B.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 wf=1e3;function JB(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,B=!1,i,o=d=>{B||(B=!0,clearTimeout(i),r.signal?.removeEventListener("abort",a),t({...d,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,u()};if(r.signal?.aborted){s=!0,o({exitCode:null,signal:null});return}let c=(0,_B.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}),u=()=>{c.pid!==void 0&&c.exitCode===null&&is(c.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(i=setTimeout(()=>{n=!0,u()},r.timeoutMs));let l=new PB.StringDecoder("utf8"),f=new PB.StringDecoder("utf8");c.stdout?.on("data",d=>r.onStdout(l.write(d))),c.stderr?.on("data",d=>r.onStderr(f.write(d)));let C=(d,h)=>{if(B)return;let k=l.end(),R=f.end();k&&r.onStdout(k),R&&r.onStderr(R),o({exitCode:d,signal:h})};c.on("error",d=>o({exitCode:null,signal:null,error:d.message})),c.on("close",C),c.on("exit",(d,h)=>{setTimeout(()=>{B||(c.stdout?.destroy(),c.stderr?.destroy(),C(d,h))},wf)})})}var gt=ae(require("node:fs")),jB=ae(require("node:os")),Dn=ae(require("node:path"));var $a=require("node:child_process"),xf=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function Ma(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function Ga(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(i=>i.toUpperCase()===n.toUpperCase()),B=s===void 0?void 0:e[s];return B===void 0?t:B})}function Na(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function Ha(r,e){let t=new Set(r.split(";").map(Na).filter(Boolean)),n=[];for(let s of e){let B=Na(s);!B||t.has(B)||(t.add(B),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var kf=r=>new Promise(e=>{(0,$a.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),os,vf=3e3;async function Pa(r,e=Date.now(),t=kf){if(!os||e-os.at>=vf){let n=await Promise.all(xf.map(async s=>Ma(await t(s))));os={at:e,values:n}}return os.values.flatMap(n=>Ga(n,r).split(";").filter(s=>s.trim()))}async function UB(r,e=process.platform,t=Pa){if(e!=="win32")return r;let n=Object.keys(r).find(i=>i.toUpperCase()==="PATH")??"Path",s=r[n]??"",B=Ha(s,await t(r));return B!==s&&(r[n]=B),r}var En=ae(require("node:path"));function Yt(r,e,t){switch(r){case"pwsh":return Sf(e,t);case"cmd":return Of(t);case"bash":return Rf(e,t)}}function _a(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=En.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function Sf(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=_a(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=_a(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 B=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:B,extension:".ps1",args:i=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Ua(i)],script:i=>"\uFEFF"+i.replace(/\r?\n/g,t?`\r
|
|
206
206
|
`:`
|
|
207
207
|
`)+(t?`\r
|
|
208
208
|
`:`
|
|
209
|
-
`)}}}function
|
|
209
|
+
`)}}}function Ua(r){return["[Console]::OutputEncoding = [System.Text.Encoding]::UTF8","$OutputEncoding = New-Object System.Text.UTF8Encoding $false","$global:LASTEXITCODE = 0",`& ${"'"+r.replace(/['\u2018\u2019\u201A\u201B]/g,t=>t+t)+"'"}`,"$mdRunbookOk = $?","if ($LASTEXITCODE) { exit $LASTEXITCODE } elseif (-not $mdRunbookOk) { exit 1 } else { exit 0 }"].join("; ")}function Of(r){if(r.platform!=="win32")return{ok:!1,error:"cmd blocks can only run on Windows."};let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows";return{ok:!0,shell:{kind:"cmd",command:r.env.ComSpec??r.env.COMSPEC??En.win32.join(e,"System32","cmd.exe"),label:"cmd",extension:".cmd",args:n=>["/d","/s","/c",`""${n}""`],windowsVerbatimArguments:!0,script:n=>["@echo off","@chcp 65001 >nul",...n.split(/\r?\n/)].join(`\r
|
|
210
210
|
`)+`\r
|
|
211
|
-
`}}}function
|
|
211
|
+
`}}}function KB(r){let e=En.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 Ka(r){return/\\(System32|Sysnative)\\bash\.exe$/i.test(r)||/\\WindowsApps\\/i.test(r)}function Ja(r,e){let t=r.which(e);return t&&!Ka(t)?t:void 0}var ja=(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,`
|
|
212
212
|
`)+`
|
|
213
|
-
`});function
|
|
213
|
+
`});function Af(r,e,t){let n=t.platform==="win32",s;if(r==="zsh")s=n?Ja(t,"zsh.exe"):t.which("zsh");else if(!n)s=t.exists("/bin/sh")?"/bin/sh":t.which("sh");else{let B=e.bashPath?.trim();s=[...B?[B]:[],...KB(t)].map(i=>En.win32.join(En.win32.dirname(i),"sh.exe")).find(i=>t.exists(i)),s??=Ja(t,"sh.exe")}return s?{ok:!0,shell:ja(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 Rf(r,e){let t=r.runbook?.unix;if(t==="zsh"||t==="sh")return Af(t,r,e);let n=e.platform==="win32",s=r.bashPath?.trim()||void 0;if(!s&&n){if(s=KB(e).find(B=>e.exists(B)),!s){let B=e.which("bash.exe");B&&!Ka(B)&&(s=B)}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:ja(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 za(r,e=process.env){let t=(e.PATH??e.Path??"").split(Dn.delimiter).filter(Boolean),n=process.platform==="win32"?["",...(e.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")]:[""];for(let s of t)for(let B of n){let i=Dn.join(s,r.toLowerCase().endsWith(B.toLowerCase())?r:r+B);try{if(gt.statSync(i).isFile())return i}catch{}}}function Rt(r=process.env){return{platform:process.platform,env:r,exists:e=>{try{return gt.statSync(e).isFile()}catch{return!1}},which:e=>za(e,r)}}async function ar(r,e,t){let n={...process.env,...e};return r.refreshPath!==!1&&await UB(n,t),Ya(n,t)}function Ya(r,e){return e!=="win32"||Object.keys(r).some(n=>/^(PYTHONIOENCODING|PYTHONUTF8)$/i.test(n))||(r.PYTHONIOENCODING="utf-8"),r}function as(r,e){return r.env===process.env?{...r,env:e,which:t=>za(t,e)}:r}async function Qt(r,e=Rt()){let t=f=>({exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:f,durationMs:0}),n=Re(r.language);if(!n)return t(`No shell for language '${r.language}'.`);let s=await ar(r.settings,r.env,e.platform),B=Yt(n,r.settings,as(e,s));if(!B.ok)return t(B.error);let i=B.shell,o=gt.mkdtempSync(Dn.join(jB.tmpdir(),"md-runbook-")),a=Dn.join(o,"cell"+i.extension),c=r.source,u=r.cwd,l=i.args(a);i.kind==="cmd"&&/^[\\/]{2}/.test(u)&&(c=`pushd "${u}" >nul 2>&1 || (echo md-runbook: cannot open ${u} 1>&2 & exit /b 1)\r
|
|
214
214
|
${c}\r
|
|
215
|
-
popd`,u=
|
|
216
|
-
`)[0]}): ${i||`bash -n exit ${B.code}`}`)}return t}function
|
|
217
|
-
`:`$__mdrbDir = $env:${
|
|
218
|
-
`}function
|
|
215
|
+
popd`,u=jB.tmpdir()),i.kind==="bash"&&e.platform==="win32"&&/['"\[\]*?{}$`]/.test(a)&&(s.MDRB_SCRIPT=l[0]??a,l=["-c",'. "$MDRB_SCRIPT"']);try{return gt.writeFileSync(a,i.script(c),"utf8"),{...await JB({command:i.command,args:l,cwd:u,env:s,timeoutMs:r.timeoutMs,signal:r.signal,windowsVerbatimArguments:i.windowsVerbatimArguments,onStdout:r.onStdout,onStderr:r.onStderr}),shell:i}}finally{try{gt.rmSync(o,{recursive:!0,force:!0})}catch{}}}var yt=ae(require("node:fs")),lr=ae(require("node:os")),qt=ae(require("node:path"));var Qa={MSYS_NO_PATHCONV:"1",MSYS2_ARG_CONV_EXCL:"*"};function bn(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 yf=r=>{try{return yt.statSync(r).isFile()}catch{return!1}};function qa(r,e=process.platform,t=yf){let n=bn(r,"KUBECONFIG",e);if(n)return n;let s=e==="win32"?qt.win32.join:qt.posix.join;if(e!=="win32")return s(r.HOME||lr.homedir(),".kube","config");let B=bn(r,"HOMEDRIVE",e),i=bn(r,"HOMEPATH",e);return[bn(r,"HOME",e),B&&i?B+i:void 0,bn(r,"USERPROFILE",e)].filter(c=>!!c).map(c=>s(c,".kube","config")).find(t)??s(bn(r,"USERPROFILE",e)||lr.homedir(),".kube","config")}var ur=class{constructor(e=lr.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??=yt.mkdtempSync(qt.join(this.tmp,"md-runbook-kube-"));let s=qt.join(this.dir,t);return yt.writeFileSync(s,Fo(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{yt.rmSync(this.dir,{recursive:!0,force:!0})}catch{}this.dir=void 0}}};function zB(r){let e=r.platform??process.platform,t=r.frontMatter,n={...t?.env},s={},B=!1;if(t?.kubeContextMode==="pin"&&r.pins){let i=qa(r.env,e);r.kubeContext!==void 0?(s.KUBECONFIG=Io(r.pins.file(r.kubeContext),i,e),B=!0):s.KUBECONFIG=i}return t?.gitBashPathConversion==="off"&&e==="win32"&&Re(r.language)==="bash"&&Object.assign(s,Qa),{env:s,defaults:n,pinned:B}}function YB(r,e){return{...e.defaults,...r,...e.env}}var Wa=require("node:child_process"),Va=require("node:crypto"),Ue=ae(require("node:fs")),Za=ae(require("node:os")),us=ae(require("node:path"));function cs(r){return(0,Va.createHash)("sha256").update(r,"utf8").digest("hex")}function ls(r,e,t){return new Promise((n,s)=>{let B=(0,Wa.spawn)(r,e,{stdio:[t==="inherit"?"inherit":"pipe","pipe","pipe"],windowsHide:!0}),i="",o="";B.stdout.on("data",a=>i+=a.toString("utf8")),B.stderr.on("data",a=>o+=a.toString("utf8")),B.on("error",a=>s(new Error(`${r}: ${a.message} (OpenSSH's ssh-keygen is needed)`))),B.on("close",a=>n({code:a,stdout:i,stderr:o})),t!=="inherit"&&(B.stdin.on("error",()=>{}),B.stdin.end(t))})}function Xa(){return Ue.mkdtempSync(us.join(Za.tmpdir(),"md-runbook-sign-"))}async function cr(r,e,t={}){let n=Xa();try{let s=us.join(n,"manifest");Ue.writeFileSync(s,r,"utf8");let B=await ls(t.sshKeygen??"ssh-keygen",["-Y","sign","-q","-f",e,"-n",yB,s],t.interactive===!1?"":"inherit");if(B.code!==0||!Ue.existsSync(s+".sig"))throw new Error(`ssh-keygen could not sign: ${B.stderr.trim()||`exit ${B.code}`}`);return Ea(Ue.readFileSync(s+".sig","utf8"))}finally{Ue.rmSync(n,{recursive:!0,force:!0})}}async function fs(r,e,t,n="ssh-keygen"){let s=Xa();try{let B=us.join(s,"manifest.sig");Ue.writeFileSync(B,ma(e),"utf8");let i=await ls(n,["-Y","find-principals","-s",B,"-f",t],""),o=i.code===0?i.stdout.split(/[\r\n,]+/).filter(Boolean):[];if(o.length===0)throw new Error(`no key in ${t} made this signature`);let a="";for(let c of o){let u=await ls(n,["-Y","verify","-f",t,"-I",c,"-n",yB,"-s",B],r);if(u.code===0)return c;a=(u.stderr||u.stdout).trim()}throw new Error(`the signature does not verify: ${a}`)}finally{Ue.rmSync(s,{recursive:!0,force:!0})}}async function QB(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 B;try{B=await ls(e,["--norc","--noprofile","-n"],n.steps[s])}catch{return}let i=B.stderr.trim().split(/\r?\n/)[0];(B.code!==0||i)&&t.push(`cell ${n.n}, command ${s+1} (${n.steps[s].split(`
|
|
216
|
+
`)[0]}): ${i||`bash -n exit ${B.code}`}`)}return t}function fr(r){let e=r.endsWith(".pub")?r:r+".pub";try{let t=Ue.readFileSync(e,"utf8").trim().split(/\s+/);return t.length>=3?t.slice(2).join(" "):void 0}catch{return}}var Ft=ae(require("node:fs")),el=ae(require("node:path")),tl=10*1024*1024,Ff=100,Cr=class{constructor(e,t,n=tl,s=Ff){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{Ft.mkdirSync(el.dirname(this.file),{recursive:!0});let t=0;try{t=Ft.statSync(this.file).size}catch{}t>0&&t+Buffer.byteLength(e)>this.maxBytes&&Ft.renameSync(this.file,`${this.file}.1`),Ft.appendFileSync(this.file,e,"utf8")}catch(t){this.failed=!0,this.onError?.(t instanceof Error?t:new Error(String(t)))}}};var nl=["\\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 rl(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 If(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=If(r,t);return s!==void 0?s:n===!0||e==="always"?"":void 0}function WB(r){let e=wt(r),t=r.slice(r.toLowerCase().indexOf(e)+e.length),n={state:"none"},s=!1;for(let B of qn(t)){let i=B.key.toLowerCase();i==="proposed"&&B.value===void 0?s=!0:i==="by"&&B.value?n.by=B.value:i==="reason"&&B.value!==void 0?n.reason=B.value:i==="approved-by"&&B.value?n.approvedBy=B.value:i==="approved-at"&&B.value&&(n.approvedAt=B.value)}return n.state=s?"proposed":n.approvedBy?"approved":n.by?"proposed":"none",n}var Bl=require("node:child_process"),il=require("node:crypto"),mt=ae(require("node:fs")),ol=ae(require("node:os")),Wt=ae(require("node:path")),ZB=require("node:string_decoder");var Tf=1e3,hr="MD_RUNBOOK_SESSION_DIR",Cs="MD_RUNBOOK_TERM",al="__mdrbCellCwd",sl=r=>"'"+r.replace(/'/g,"'\\''")+"'",VB=r=>"'"+r.replace(/['‘’‚‛]/g,"$&$&")+"'";function Lf(r,e){return r.kind==="bash"?["-s"]:["-NoLogo","-NoProfile","-NonInteractive",...e==="win32"?["-ExecutionPolicy","Bypass"]:[],"-Command","-"]}function Nf(r){return r==="bash"?`__mdrb_dir=$${hr}; unset ${hr}
|
|
217
|
+
`:`$__mdrbDir = $env:${hr}; Remove-Item Env:${hr} -ErrorAction Ignore; if ($env:${Cs}) { $env:TERM = $env:${Cs} } else { Remove-Item Env:TERM -ErrorAction Ignore }; Remove-Item Env:${Cs} -ErrorAction Ignore; [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = New-Object System.Text.UTF8Encoding $false
|
|
218
|
+
`}function $f(r,e,t,n){let s=`__MDRB_${e}__`;if(r==="bash"){let o=`"$__mdrb_dir/${e}.pre${t}"`,a=`. "$__mdrb_dir/${e}${t}" </dev/null; __mdrb_rc=$?`;return(n?`__mdrb_cd=; if . ${o} </dev/null; then rm -f ${o} 2>/dev/null; ${a}; else __mdrb_rc=$?; rm -f ${o} 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
|
|
219
219
|
`}let B=`"$__mdrbDir/${e}.pre${t}"`;return`$global:LASTEXITCODE = 0; $__mdrbOk = $false; $__mdrbPushed = $false; ${n?`. ${B}; Remove-Item -LiteralPath ${B} -Force -ErrorAction Ignore; `:""}. "$__mdrbDir/${e}${t}"; $__mdrbOk = $?
|
|
220
|
-
if ($__mdrbPushed) { Pop-Location -StackName ${
|
|
221
|
-
`}function
|
|
222
|
-
`)}var
|
|
220
|
+
if ($__mdrbPushed) { Pop-Location -StackName ${al} -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)
|
|
221
|
+
`}function Mf(r,e,t,n=process.platform){let s=[];for(let[B,i]of Object.entries(e))r==="pwsh"?s.push(`[Environment]::SetEnvironmentVariable(${VB(B)}, ${VB(i)})`):/^[A-Za-z_][A-Za-z0-9_]*$/.test(B)&&s.push(`export ${B}=${sl(i)}`);return t!==void 0&&(r==="pwsh"?s.push(`Push-Location -LiteralPath ${VB(t)} -StackName ${al} -ErrorAction Stop`,"$__mdrbPushed = $true"):s.push("__mdrb_cd=$PWD",`cd -- ${sl(n==="win32"?t.replace(/\\/g,"/"):t)} || return 1`)),s.join(`
|
|
222
|
+
`)}var XB=class{constructor(e,t,n=process.platform,s=process.env){this.shell=e;this.cwd=t;this.platform=n;this.dir=mt.mkdtempSync(Wt.join(ol.tmpdir(),"md-runbook-session-"));let B=n==="win32"&&e.kind==="bash"?this.dir.replace(/\\/g,"/"):this.dir,i={...s,[hr]:B};e.kind==="pwsh"&&(i[Cs]=i.TERM??"",i.TERM="dumb"),this.child=(0,Bl.spawn)(e.command,Lf(e,n),{cwd:t,env:i,stdio:["pipe","pipe","pipe"],windowsHide:!0,detached:n!=="win32"}),this.child.stdout.on("data",o=>this.deliver("out",this.outDec.write(o))),this.child.stderr.on("data",o=>this.deliver("err",this.errDec.write(o))),this.child.stdin.on("error",()=>{}),this.child.on("error",o=>{this.startError=o.message,this.end(null,null)}),this.child.on("close",(o,a)=>this.end(o,a)),this.child.on("exit",(o,a)=>setTimeout(()=>this.end(o,a),Tf).unref()),this.child.stdin.write(Nf(e.kind))}shell;cwd;platform;child;dir;ended=!1;killed=!1;startError;current;outDec=new ZB.StringDecoder("utf8");errDec=new ZB.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,B=!1,i=!1,o,a=[],c=(R,E)=>{if(!i){i=!0,clearTimeout(o),e.signal?.removeEventListener("abort",u),this.current=void 0;for(let S of a)try{mt.rmSync(S,{force:!0})}catch{}n({...R,timedOut:s,cancelled:B,ended:E,durationMs:Date.now()-t})}},u=()=>{B=!0,this.kill()};if(!this.alive)return c({exitCode:null,signal:null,error:this.startError??"The session has ended."},!0);if(this.current)return c({exitCode:null,signal:null,error:"The session is busy."},!1);if(e.signal?.aborted)return B=!0,c({exitCode:null,signal:null},!1);let l=(0,il.randomBytes)(12).toString("hex"),f=this.shell.extension,C=e.env??{},d=Object.keys(C).length>0||e.cwd!==void 0;try{let R=Wt.join(this.dir,l+f);if(a.push(R),mt.writeFileSync(R,this.shell.script(e.source),"utf8"),d){let E=Wt.join(this.dir,`${l}.pre${f}`);a.push(E),mt.writeFileSync(E,this.shell.script(Mf(this.shell.kind,C,e.cwd,this.platform)),{encoding:"utf8",mode:384})}}catch(R){return c({exitCode:null,signal:null,error:R instanceof Error?R.message:String(R)},!1)}let h=new Gt(`__MDRB_${l}__`,e.onStdout),k=new Gt(`__MDRB_${l}__`,e.onStderr);this.current={out:h,err:k,check:()=>{h.done&&k.done&&c({exitCode:h.code,signal:null},!1)},onExit:(R,E)=>{h.flush(),k.flush(),c({exitCode:R,signal:E,error:this.startError},!0)}},e.signal?.addEventListener("abort",u),e.timeoutMs>0&&(o=setTimeout(()=>{s=!0,this.kill()},e.timeoutMs)),this.child.stdin.write($f(this.shell.kind,l,f,d))})}kill(){this.killed||this.ended||(this.killed=!0,this.child.pid!==void 0&&is(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(){mt.rm(this.dir,{recursive:!0,force:!0},()=>{})}},hs=class{constructor(e=()=>{},t=Rt(),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=Re(e.language);if(t===void 0||t==="cmd")return Qt(e,this.shellEnv);this.settings=e.settings;let n=await ar(e.settings,void 0,this.shellEnv.platform),s=Yt(t,e.settings,as(this.shellEnv,n));if(!s.ok)return Qt(e,this.shellEnv);let B=this.sessions.get(t);B&&(!B.alive||B.shell.command!==s.shell.command)&&(B.dispose(),B=void 0),B||(this.started.has(t)&&e.onStdout(`[md-runbook] new session started
|
|
223
223
|
`),B=this.start(s.shell,e.baseCwd??e.cwd,n));let i=Wt.resolve(e.cwd)===Wt.resolve(B.cwd)?void 0:e.cwd,o=await B.run({source:e.source,env:e.env,cwd:i,timeoutMs:e.timeoutMs,signal:e.signal,onStdout:e.onStdout,onStderr:e.onStderr});o.ended&&!o.cancelled&&!o.timedOut&&o.error===void 0&&e.onStderr(`[md-runbook] session ended (exit ${o.exitCode??o.signal}); the next cell starts a new session
|
|
224
|
-
`);let{ended:a,...c}=o;return{...c,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
|
|
225
|
-
`;if(r.command!==void 0&&r.command.trim()!==""){let i=e(
|
|
224
|
+
`);let{ended:a,...c}=o;return{...c,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 ar(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 XB(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 Gf(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 ll=r=>r.replace(/\s*[\r\n]+\s*/g," ").trim();function Hf(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=[Se(r.at),n,t,r.section,r.title].filter(i=>i!==void 0&&i.trim()!==""),B=`===== ${e(s.map(ll).join(" \xB7 "))}
|
|
225
|
+
`;if(r.command!==void 0&&r.command.trim()!==""){let i=e(Ve(r.command).replace(/\r\n?/g,`
|
|
226
226
|
`).replace(/\n+$/,"")).split(`
|
|
227
227
|
`);B+=i.map(o=>`$ ${o}`).join(`
|
|
228
228
|
`)+`
|
|
229
|
-
`}return B}function
|
|
229
|
+
`}return B}function Pf(r){return`===== ${[`exit=${r.exit}`,Gf(r.durationMs),r.check&&`check ${r.check==="ok"?"passed":"failed"}`,r.attempt!==void 0&&r.attempts!==void 0&&r.attempts>1&&`attempt ${r.attempt}/${r.attempts}`,r.lines&&`lines ${r.lines}`].filter(Boolean).join(" \xB7 ")}
|
|
230
230
|
|
|
231
|
-
`}function
|
|
231
|
+
`}function ul(r,e,t,n){return`===== ${n(ll(`${Se(r)} \xB7 ${e} \xB7 ${t}`))}
|
|
232
232
|
|
|
233
|
-
`}var
|
|
234
|
-
`)))),B=i=>new Mt(o=>this.lines(i,o),s);this.buffers={stdout:B("stdout"),stderr:B("stderr")}}write;redact;hold;buffers;carry={stdout:"",stderr:""};held=[];ended=!1;start(e){this.write(
|
|
235
|
-
`))}end(e){this.ended||(this.release(),this.ended=!0,this.write(
|
|
233
|
+
`}var _f={stdout:"| ",stderr:"! "},ds=class{constructor(e,t,n=!1){this.write=e;this.redact=t;this.hold=n;let s=i=>this.redact(Ve(Fn(i.replace(/\r\n/g,`
|
|
234
|
+
`)))),B=i=>new Mt(o=>this.lines(i,o),s);this.buffers={stdout:B("stdout"),stderr:B("stderr")}}write;redact;hold;buffers;carry={stdout:"",stderr:""};held=[];ended=!1;start(e){this.write(Hf(e,this.redact))}out(e,t){this.ended||t===""||(this.hold?this.held.push({stream:e,text:t}):this.buffers[e].write(t))}attempt(e,t,n){this.ended||(this.release(),this.write(`----- attempt ${e}/${t} \xB7 ${Se(n)}
|
|
235
|
+
`))}end(e){this.ended||(this.release(),this.ended=!0,this.write(Pf(e)))}release(){for(let e of this.held.splice(0))this.buffers[e.stream].write(e.text);for(let e of["stdout","stderr"])this.buffers[e].flush(),this.carry[e]!==""&&this.lines(e,`
|
|
236
236
|
`)}lines(e,t){let n=(this.carry[e]+t).split(`
|
|
237
|
-
`);this.carry[e]=n.pop(),n.length>0&&this.write(n.map(s=>
|
|
237
|
+
`);this.carry[e]=n.pop(),n.length>0&&this.write(n.map(s=>_f[e]+s).join(`
|
|
238
238
|
`)+`
|
|
239
|
-
`)}};var
|
|
239
|
+
`)}};var Ye=class extends Error{},Jf=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/;function ei(r){let e=Nt(r.replace(/^/,"")).map(s=>s.text),t=[],n=0;if(e[0]?.trimEnd()==="---"){let s=e.findIndex((B,i)=>i>0&&/^(---|\.\.\.)\s*$/.test(B));s>0&&(n=s+1)}for(;n<e.length;n++){let s=Ae(e[n]);if(s){for(;n+1<e.length&&!Le(e[n+1],s);)n++;n++;continue}let B=Jf.exec(e[n]);if(!B)continue;let i=(B[2]??"").replace(/(^|[ \t]+)#+$/,"").trim();t.push({line:n,level:B[1].length,text:i})}return t}function cl(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 ps(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 fl(r,e,t,n){let s=n.sections??[];if(n.from===void 0&&n.to===void 0&&s.length===0)return;let B=Math.max(0,...t);for(let[u,l]of[["--from",n.from],["--to",n.to]])if(l!==void 0&&(l<1||l>B))throw new Ye(`${u} ${l} is outside the runbook: it has ${B===0?"no steps":B===1?"one step":`steps 1 to ${B}`}`);if(n.from!==void 0&&n.to!==void 0&&n.from>n.to)throw new Ye(`--from ${n.from} is after --to ${n.to}`);let i=n.from??1,o=n.to??B,a=()=>!0;if(s.length>0){let u=ei(r),l=s.filter(d=>!u.some(h=>h.text.startsWith(d)));if(l.length>0)throw new Ye(`no heading starts with ${l.map(d=>JSON.stringify(d)).join(", ")} (--section matches the heading text after the #s, case-sensitive)`);let f=Math.min(...u.map(d=>d.level)),C=u.filter(d=>d.level===f);if(C.length===1&&u.length>1){let d=C[0],h=s.filter(k=>d.text.startsWith(k));if(h.length>0){let k=h[0],R=u.filter(S=>S!==d&&S.text.startsWith(k)).map(S=>S.text),E=R.length>0?`; for ${JSON.stringify(R[0])}, give more of it, e.g. --section ${JSON.stringify(R[0].split(/\s+/).slice(0,2).join(" "))}`:"";throw new Ye(`--section ${JSON.stringify(k)} matches the runbook's title ${JSON.stringify(d.text)}, which holds every step${E}`)}}a=d=>{let h=[];for(let k of u){if(k.line>=d)break;for(;h.length>0&&h[h.length-1].level>=k.level;)h.pop();h.push(k)}return h.some(k=>s.some(R=>k.text.startsWith(R)))}}let c=new Set;if(e.forEach((u,l)=>{let f=t[l];f>=i&&f<=o&&a(u.line)&&c.add(f)}),c.size===0)throw new Ye(`${ps(n)} selects no step`);return c}function Cl(r,e){let t=[];return r.forEach((n,s)=>{if(n.runs)for(let B of new Set(n.uses)){let i=r.slice(0,s).filter(a=>a.captures.includes(B));if(i.length===0||i.some(a=>a.selected))continue;let o=i[i.length-1];t.push(`step ${n.n} (${e}:${n.loc.line+1}) uses \${out:${B}}, captured by step ${o.n} (${e}:${o.loc.line+1}), which is not selected`)}}),t}var Uf=4,Kf=(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 dl(r,e){let t=dr.readFileSync(r.file,"utf8"),n=Et.basename(r.file),s=Et.dirname(Et.resolve(r.file)),B=et(t),i=B?.cwd?Et.resolve(s,B.cwd):s,o=r.session??B?.mode==="session",a=new ur,c=new Set,u=_s(Ps),l=x=>{let v=u.redact(x);for(let A of[...c].sort((N,F)=>F.length-N.length))v=v.split(A).join(an);return v},f=x=>{x.length>=Uf&&c.add(x)},C={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0,redact:l},{regexes:d}=rl(nl),h=new Map,k=t,R=Ce(t),E=Ht(R);for(let x of r.extraSecrets??[])f(x);for(let x of E){if(!Re(x.language))continue;let v=[];try{v=Xe(x.source)}catch{continue}for(let A of v){if(!A.secret)continue;let N=A.kind==="secret"?r.env[A.name]:A.kind==="input"?r.inputs[A.name]??r.env[A.name]:void 0;N!==void 0&&f(N)}}let S=R.cells.map(x=>x.kind==="code"?{kind:"code",os:de(x.meta.kind==="code"?x.meta.info:"").os}:{kind:"markup"}),w=zt(S),y=new Set(w.filter(x=>x?.active).map(x=>x.group)),O=kt(S),$=E.map(x=>O[x.cellIndex]),b={...r.from!==void 0?{from:r.from}:{},...r.to!==void 0?{to:r.to}:{},...r.sections?.length?{sections:r.sections}:{}},m=fl(t,E,$,b),G=E.map((x,v)=>{let A=de(x.info),N=w[x.cellIndex],F=WB(x.info),P=[];try{P=gn(x.source,x.info,B).filter(U=>U.kind==="out").map(U=>U.name)}catch{}let j=!m||m.has($[v]);return{n:$[v],loc:x,selected:j,runs:j&&(!N||N.active)&&!A.host&&!A.skip&&A.errors.length===0&&F.state!=="proposed"&&F.by===void 0,uses:P,captures:(A.checks?.captures??[]).map(U=>U.name)}}),T=Cl(G,n);if(T.length>0)throw new Ye(`${T.join(`
|
|
240
240
|
`)}
|
|
241
|
-
select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let
|
|
242
|
-
${
|
|
241
|
+
select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let x=G.flatMap(v=>{if(!v.runs)return[];let A=de(v.loc.info),N=qB(v.loc.source,"patterns",d,A.confirm===!0?!0:void 0);if(N===void 0)return[];let F=v.loc.source.split(/\r?\n/).find(P=>P.trim()!=="")?.trim()??"";return[` Step ${v.n} \xB7 ${n}:${v.loc.line+1} \xB7 ${l(A.name??F)}: ${N===""?"confirm option":`risky command \u201C${N.trim()}\u201D`}`]});if(x.length>0){let v=x.length===1;throw new Ye(`${v?"a step asks":`${x.length} steps ask`} for confirmation in VS Code and ${v?"needs":"need"} --yes here; nothing ran:
|
|
242
|
+
${x.join(`
|
|
243
243
|
`)}
|
|
244
|
-
pass --yes to run ${
|
|
245
|
-
`,attrs:{exit:"skipped",ran:
|
|
246
|
-
`,attrs:{exit:"declined",ran:
|
|
247
|
-
`),!await
|
|
248
|
-
`),
|
|
249
|
-
`);for(let K of
|
|
250
|
-
`);if(
|
|
251
|
-
<failure message="${
|
|
244
|
+
pass --yes to run ${v?"it":"them"}`)}}m&&e.log(`Step${m.size===1?"":"s"} ${cl([...m])} of ${Math.max(0,...$)} (${ps(b)})`);let H=`not selected (${ps(b)})`,Q=o?new hs:void 0,z=r.transcript?new Cr(Et.resolve(r.transcript),x=>e.log(`! the transcript ${r.transcript} can't be written, so it stops: ${x.message}`)):void 0,q=ei(t),V=x=>[...q].reverse().find(v=>v.line<x)?.text,ee=(x,v,A)=>{z?.append(ul(new Date,n,`Step ${x} \xB7 ${v}: ${A}`,l)),z?.flush()},Be=new Set,te=[],De=!1,pe=G.flatMap((x,v)=>x.runs?[v]:[]),$e=new Set,he=()=>hB(CB(pe.map(x=>({estimateSeconds:de(E[x].info).estimateSeconds,state:$e.has(x)?"done":"pending"}))));try{for(let[x,v]of E.entries()){let A=w[v.cellIndex];if(A&&Be.has(A.group)){if(!A.active)continue}else A&&Be.add(A.group);let N=$[x],F=de(v.info),P=v.source.split(/\r?\n/).find(K=>K.trim()!=="")?.trim()??"",j=(K,ve,ot={})=>({step:N,line:v.line+1,language:v.language,title:l(F.name??P),status:K,exit:ve,durationMs:0,...F.estimateSeconds!==void 0?{estimateSeconds:F.estimateSeconds}:{},output:"",...ot}),U=`Step ${N} \xB7 ${n}:${v.line+1} \xB7 ${v.language}`;if(A&&!A.active){y.has(A.group)||(e.log(`\u2013 ${U}: for ${pn(F.os??[])}, skipped on ${pn([lB()])}`),te.push(j("skipped","skipped",{message:`for ${pn(F.os??[])}`})));continue}if(!G[x].selected){te.push(j("skipped","skipped",{message:H}));continue}if(F.host){e.log(`\u2013 ${U}: runs on the host ${F.host} (md-runbook app), skipped here`),te.push(j("skipped","skipped",{message:`runs on the host ${F.host}`}));continue}if(De){te.push(j("not run","not run",{message:"an earlier step failed"}));continue}let ne=(K,ve="not run")=>{e.log(`\u2717 ${U}: not run: ${K}`),ee(N,l(F.name??P),`not run: ${K}`),te.push(j("not run",ve,{message:K})),r.keepGoing||(De=!0)};if(F.errors.length>0){ne(`invalid cell option ${F.errors.join("; ")}`,"error");continue}let ce=WB(v.info);if(ce.state==="proposed"){ne("proposed by an assistant and not approved; approve it in VS Code first");continue}if(ce.by!==void 0){ne("written by an assistant; such cells only run in VS Code (approval, read-only credentials)");continue}let X=Re(v.language);if(!X)continue;if(F.skip){e.log(`\u2013 ${U}: skipped (skip option)`),k=Hn(k,v.cellIndex,{kind:"new",text:`[md-runbook] skipped: skip option
|
|
245
|
+
`,attrs:{exit:"skipped",ran:Se(new Date)}},C)??k,te.push(j("skipped","skipped"));continue}let Oe=qB(v.source,"patterns",d,F.confirm===!0?!0:void 0);if(Oe!==void 0&&!r.yes){let K=Oe===""?"this block asks for confirmation (confirm option)":`risky command \u201C${Oe.trim()}\u201D`;k=Hn(k,v.cellIndex,{kind:"new",text:`[md-runbook] not confirmed: ${K}; pass --yes to run it
|
|
246
|
+
`,attrs:{exit:"declined",ran:Se(new Date)}},C)??k,ne(`${K}; pass --yes to run it`,"declined");continue}let ge={...F.env},Zt,Sn=new Set,On,Xt;try{Xt=Xe(v.source).length,On=gn(v.source,v.info,B)}catch(K){ne(K instanceof Error?K.message:String(K),"error");continue}for(let K of On){let ve,ot=K.secret;if(K.kind==="secret")ve=r.env[K.name];else if(K.kind==="input")ve=r.inputs[K.name]??r.env[K.name];else if(K.kind==="param")ve=r.params[K.name]??B?.params.find(bt=>bt.name===K.name)?.default;else{let bt=h.get(K.name);ve=bt?.value,ot=bt?.secret??!1}if(ve===void 0){Zt=K.kind==="secret"?`\${secret:${K.name}}: set the environment variable ${K.name}`:K.kind==="input"?`\${input:${K.name}}: pass --input ${K.name}=\u2026 or set the environment variable ${K.name}`:K.kind==="param"?`\${param:${K.name}}: pass --param ${K.name}=\u2026 (it has no default)`:`\${out:${K.name}} has no value yet; run the cell with capture=${K.name} first`;break}ge[K.name]=ve,ot&&(f(ve),Sn.add(K.name))}if(Zt){ne(Zt,"error");continue}let it=F.checks,mr,si=Kr(F,B);try{it&&(it=Mo(it,ge,K=>Sn.has(K))),mr=Oo(si,K=>ge[K])}catch(K){ne(K instanceof Error?K.message:String(K),"error");continue}let Er=jt(si)!==void 0?mr:void 0,Bi=zB({language:v.language,frontMatter:B,kubeContext:mr,env:{...process.env,...B?.env,...ge},pins:a});ge=YB(ge,Bi);let ii=Xt>0?dn(v.source,X):v.source,ws=(F.checks?.captures??[]).some(K=>K.secret),xs="",An=F.cwd!==void 0?Et.resolve(s,F.cwd):i,oi=F.timeoutSeconds??B?.timeoutSeconds??r.timeoutSeconds??0,Tt=F.retry?.attempts??1,Wl=F.estimateSeconds!==void 0?` \xB7 est. ${ze(F.estimateSeconds)}`:"";e.log(`\u25B6 ${U}${Wl}${F.name?` \xB7 ${F.name}`:""}${Er?` \xB7 Kubernetes context ${Er}`:""}`);let en=new Date,tn=z?new ds(K=>z.append(K),l,ws):void 0;tn?.start({at:en,runbook:n,step:N,line:v.line+1,section:V(v.line),title:F.name??P,command:ii});let nn="",ks="",me,Te,ft=0,ai=dr.existsSync(An)?await Ro(mr,async K=>{let ve="",ot="",bt={language:v.language,source:K,cwd:An,settings:B?.shell?{...r.shell,runbook:B.shell}:r.shell,timeoutMs:15e3,env:ge,signal:r.signal,onStdout:Lt=>ve+=Lt,onStderr:Lt=>ot+=Lt},rn=Q?await Q.execute({...bt,baseCwd:i}):await Qt(bt);return{exitCode:rn.exitCode,stdout:ve,stderr:rn.error??(rn.timedOut?"timed out":ot)}},Bi.pinned):void 0;if(ai!==void 0)ft=1,me={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:ai,durationMs:0};else for(;;){ft++,ft>1&&tn?.attempt(ft,Tt,new Date),nn="",ks="",xs="";let K=new Mt(Ct=>ws?xs+=Ct:e.out(Ct),l),ve=Ct=>kr=>{nn+=kr,Ct&&(ks+=kr),K.write(kr),tn?.out(Ct?"stdout":"stderr",kr)},ot={language:v.language,source:ii,cwd:An,settings:B?.shell?{...r.shell,runbook:B.shell}:r.shell,timeoutMs:oi*1e3,env:ge,signal:r.signal,onStdout:ve(!0),onStderr:ve(!1)};if(!dr.existsSync(An))me={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:`Working directory not found: ${An}`,durationMs:0};else try{me=Q?await Q.execute({...ot,baseCwd:i}):await Qt(ot)}catch(Ct){me={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:Ct instanceof Error?Ct.message:String(Ct),durationMs:0}}if(K.flush(),Te=Ho(it)&&me.exitCode!==null&&me.error===void 0&&!me.timedOut&&!me.cancelled?Po(it,me.exitCode,nn,ks):void 0,(Te?Te.ok:Gn(me))||ft>=Tt||me.cancelled||r.signal?.aborted)break;let rn=Te?.failures[0]??(me.timedOut?"timed out":me.error??`exit code ${Mn(me)}`),Lt=F.retry?.everyMs??0;if(e.log(` attempt ${ft}/${Tt} failed (${l(rn)}); trying again in ${Lt/1e3}s`),tn?.out("stderr",`[md-runbook] attempt ${ft}/${Tt} failed (${rn}); trying again in ${Lt/1e3}s
|
|
247
|
+
`),!await Kf(Lt,r.signal))break}for(let K of Te?.secretValues??[])f(K);ws&&e.out(l(xs));let vs=K=>{nn+=K,e.out(l(K)),tn?.out("stderr",K)};me.error!==void 0&&vs(me.error+`
|
|
248
|
+
`),me.timedOut&&vs(`[md-runbook] timed out after ${oi}s; process tree killed
|
|
249
|
+
`);for(let K of Te&&!Te.ok?Te.failures:[])vs(`[md-runbook] check failed: ${K}
|
|
250
|
+
`);if(Te?.ok)for(let K of Te.captured)h.set(K.name,{value:K.value,secret:K.secret});let Rn=new Date,Dr=Mn(me),br=Te?Te.ok?"ok":"failed":void 0,li={exit:Dr,ran:Se(en),ended:Se(Rn),duration:Is(Rn.getTime()-en.getTime()),...br?{check:br}:{},...Tt>1?{attempts:String(ft)}:{},...F.name!==void 0?{name:F.name}:{},...Er?{"kube-context":Er}:{},...Yo(k,{by:hl(),on:`${hl()}@${gs.hostname()}`})},wr=Ce(k).cells[v.cellIndex]?.meta,xr=le(wr)?Ns(wr):void 0,ui=xr?$s(xr,le(wr)?wr.history?.entries??[]:[],Qo(k,0)):[];k=Hn(k,v.cellIndex,{kind:"new",text:nn,attrs:li,...xr&&ui.length?{previous:xr,history:ui}:{}},C)??k;let Ss=Te?Te.ok:Gn(me);tn?.end({exit:Dr,durationMs:Rn.getTime()-en.getTime(),...br?{check:br}:{},...Tt>1?{attempt:ft,attempts:Tt}:{}}),z?.flush();let{ran:iC,ended:oC,...Vl}=li;e.log(`${Js(Vl)}${me.shell?` \xB7 ${me.shell.label}`:""}`);let ci=(Rn.getTime()-en.getTime())/1e3;F.estimateSeconds!==void 0&&fB(ci,F.estimateSeconds)&&e.log(`! Step ${N} took ${ze(ci)}, more than twice its estimate of ${ze(F.estimateSeconds)}`),$e.add(x);let fi=r.progress?he():void 0;fi&&e.log(` ${fi}`),te.push(j(Ss?"passed":"failed",Dr,{durationMs:Rn.getTime()-en.getTime(),output:l(nn),...Ss?{}:{message:Te?.failures[0]??`exit ${Dr}`}})),!Ss&&!F.continueOnError&&!r.keepGoing&&(De=!0),r.signal?.aborted&&(De=!0)}}finally{z?.flush(),Q?.dispose(),a.dispose()}let ke=te.every(x=>x.status==="passed"||x.status==="skipped");return{steps:te,text:k,ok:ke,redact:l}}var wn=r=>r.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]).replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,"");function pl(r,e){let t=e.filter(o=>o.status==="failed"||o.status==="not run").length,n=e.filter(o=>o.status==="skipped").length,s=o=>(o/1e3).toFixed(3),B=e.reduce((o,a)=>o+a.durationMs,0),i=e.map(o=>{let a=wn(`Step ${o.step}: ${o.title}`),c=o.estimateSeconds!==void 0?`<properties><property name="estimate" value="${o.estimateSeconds}"/></properties>`:"",u=` <testcase classname="${wn(r)}" name="${a}" time="${s(o.durationMs)}">${c}`;return o.status==="passed"?`${u}</testcase>`:o.status==="skipped"?`${u}<skipped message="${wn(o.message??"skipped")}"/></testcase>`:`${u}
|
|
251
|
+
<failure message="${wn(o.message??o.exit)}">${wn(o.output)}</failure>
|
|
252
252
|
</testcase>`});return`<?xml version="1.0" encoding="UTF-8"?>
|
|
253
253
|
<testsuites>
|
|
254
|
-
<testsuite name="${
|
|
254
|
+
<testsuite name="${wn(r)}" tests="${e.length}" failures="${t}" skipped="${n}" time="${s(B)}">
|
|
255
255
|
`+i.join(`
|
|
256
256
|
`)+`
|
|
257
257
|
</testsuite>
|
|
258
258
|
</testsuites>
|
|
259
|
-
`}function
|
|
259
|
+
`}function gl(r,e){let t={passed:"\u2705",failed:"\u274C",skipped:"\u23ED\uFE0F","not run":"\u26D4"},n=i=>i.replace(/\|/g,"\\|").replace(/\r?\n/g," "),s=e.map(i=>`| ${i.step} | ${t[i.status]} ${i.status} | \`${n(i.title).slice(0,80)}\` | ${n(i.exit)} | ${(i.durationMs/1e3).toFixed(1)}s${i.estimateSeconds!==void 0?` (est. ${ze(i.estimateSeconds)})`:""} | ${n(i.message??"")} |`),B=e.filter(i=>i.status==="passed").length;return`### ${n(r)}: ${B}/${e.length} steps passed
|
|
260
260
|
|
|
261
261
|
| Step | Result | Command | Exit | Time | Note |
|
|
262
262
|
|---|---|---|---|---|---|
|
|
263
263
|
${s.join(`
|
|
264
264
|
`)}
|
|
265
|
-
`}function
|
|
266
|
-
`)}function
|
|
267
|
-
`).map((n,s)=>({type:"TextBlock",text:n,wrap:!0,...s===0?{weight:"Bolder"}:{}}))}}]}:{text:e}}async function
|
|
265
|
+
`}function hl(){try{return gs.userInfo().username}catch{return process.env.USER??process.env.USERNAME??"unknown"}}function ml(r,e){let t=r?.trim();if(!t)return;let n=(e?.trim()||"failure").toLowerCase();if(n!=="failure"&&n!=="always")return`notify-on must be "failure" or "always", not "${e}"`;let s;try{s=new URL(t)}catch{return"the notification URL is not a valid URL"}let B=s.hostname==="localhost"||s.hostname==="127.0.0.1"||s.hostname==="[::1]";return s.protocol!=="https:"&&!(s.protocol==="http:"&&B)?"the notification URL must use https":{url:t,on:n}}function ms(r){let{GITHUB_SERVER_URL:e,GITHUB_REPOSITORY:t,GITHUB_RUN_ID:n}=r;return e&&t&&n?`${e}/${t}/actions/runs/${n}`:void 0}var jf=r=>`Step ${r.step} (line ${r.line}) ${r.status==="failed"?"failed":"was not run"}${r.message?`: ${r.message}`:""}`;function El(r,e,t){let n=e.steps.length,s=e.steps.filter(o=>o.status==="failed"||o.status==="not run"),i=[e.ok?`\u2713 ${r}: all ${n} step${n===1?"":"s"} passed`:`\u2717 ${r}: ${s.length} of ${n} steps failed or did not run`,...s.filter(o=>o.status==="failed"||o.message!=="an earlier step failed").slice(0,5).map(o=>`\u2022 ${jf(o)}`)];return t&&i.push(t),i.join(`
|
|
266
|
+
`)}function zf(r,e){let t=new URL(r).hostname.toLowerCase();return t==="discord.com"||t.endsWith(".discord.com")||t==="discordapp.com"?{content:e.slice(0,2e3)}:t.endsWith(".logic.azure.com")||t.endsWith(".powerplatform.com")||t.endsWith(".webhook.office.com")?{type:"message",attachments:[{contentType:"application/vnd.microsoft.card.adaptive",content:{$schema:"http://adaptivecards.io/schemas/adaptive-card.json",type:"AdaptiveCard",version:"1.4",body:e.split(`
|
|
267
|
+
`).map((n,s)=>({type:"TextBlock",text:n,wrap:!0,...s===0?{weight:"Bolder"}:{}}))}}]}:{text:e}}async function Dl(r,e,t=fetch){let n;try{n=await t(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(zf(r,e)),signal:AbortSignal.timeout(15e3)})}catch(s){let B=s instanceof Error&&s.name==="TimeoutError"?"no answer within 15 s":"the request failed";throw new Error(`could not send the notification (${B})`)}if(!n.ok)throw new Error(`could not send the notification (HTTP ${n.status})`)}var bl=require("node:child_process"),qe=ae(require("node:fs")),wl=ae(require("node:os")),Qe=ae(require("node:path")),xl=require("node:url");function Yf(r){let e=r.env;return r.platform==="win32"?[e.ProgramFiles,e["ProgramFiles(x86)"],e.LOCALAPPDATA].filter(n=>!!n).flatMap(n=>[Qe.win32.join(n,"Google","Chrome","Application","chrome.exe"),Qe.win32.join(n,"Microsoft","Edge","Application","msedge.exe"),Qe.win32.join(n,"Chromium","Application","chrome.exe")]):r.platform==="darwin"?["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Chromium.app/Contents/MacOS/Chromium"]:["google-chrome","google-chrome-stable","chromium","chromium-browser","microsoft-edge"].map(t=>r.which(t)).filter(t=>t!==void 0)}function xn(r,e=Rt()){return r||Yf(e).find(t=>e.exists(t))}async function kn(r,e,t){let n=qe.mkdtempSync(Qe.join(wl.tmpdir(),"md-runbook-pdf-")),s=Qe.join(n,"report.html"),B=Qe.resolve(e);qe.writeFileSync(s,r,"utf8");try{qe.rmSync(B,{force:!0});let i=["--headless=new","--disable-gpu","--no-first-run","--no-default-browser-check",`--user-data-dir=${Qe.join(n,"profile")}`,...process.platform==="linux"&&process.getuid?.()===0?["--no-sandbox"]:[],"--no-pdf-header-footer",`--print-to-pdf=${B}`,(0,xl.pathToFileURL)(s).href];await new Promise((o,a)=>{(0,bl.execFile)(t,i,{timeout:12e4,windowsHide:!0},(c,u,l)=>{if(qe.existsSync(B)&&qe.statSync(B).size>0)return o();a(new Error(`${Qe.basename(t)} did not write the PDF${c?`: ${c.message}`:""}${l.trim()?`
|
|
268
268
|
${l.trim().split(`
|
|
269
269
|
`).slice(-3).join(`
|
|
270
|
-
`)}`:""}`))})})}finally{
|
|
270
|
+
`)}`:""}`))})})}finally{qe.rm(n,{recursive:!0,force:!0,maxRetries:3},()=>{})}}var ct=ae(require("node:fs")),kl=ae(require("node:path"));var pr=`Usage: md-runbook sign <file.md> --key KEY [options]
|
|
271
271
|
md-runbook verify <file.md> [--allowed-signers FILE]
|
|
272
272
|
|
|
273
273
|
sign writes a signature block at the end of the runbook: its bash blocks as servers with
|
|
@@ -293,19 +293,19 @@ verify shows what a runbook's signature covers and which blocks changed since si
|
|
|
293
293
|
with --allowed-signers (a server's allowed_signers file) does it check the signature as the gate
|
|
294
294
|
would; without it, the signer's name is just what the file says. Exit code 0 when everything is
|
|
295
295
|
signed (and, with --allowed-signers, the signature verifies).
|
|
296
|
-
`,
|
|
297
|
-
`)};async function
|
|
296
|
+
`,rt=class extends Error{},gr=(r=0)=>new Date(Date.now()+r*864e5).toISOString().slice(0,10);function Qf(r){return kl.basename(r).replace(/(\.runbook)?\.md$/i,"").replace(/[^A-Za-z0-9._/-]+/g,"-").replace(/^[^A-Za-z0-9]+/,"")||"runbook"}function qf(r){let e=[...r],t={patterns:{}},n=s=>{let B=e.shift();if(B===void 0||B.startsWith("--"))throw new rt(`${s} needs a value`);return B};for(;e.length>0;){let s=e.shift();switch(s){case"--key":t.key=n(s);break;case"--signer":t.signer=n(s);break;case"--name":t.name=n(s);break;case"--out":t.out=n(s);break;case"--cosign":t.cosign=!0;break;case"--record":t.record=!0;break;case"--version":{let B=Number(n(s));if(!Number.isInteger(B)||B<1)throw new rt("--version expects a positive whole number");t.version=B;break}case"--expires":t.expires=n(s);break;case"--expires-in":{let B=Number(n(s));if(!Number.isInteger(B)||B<0)throw new rt("--expires-in expects days");t.expires=gr(B);break}case"--scope":(t.scopes??=[]).push(n(s));break;case"--pattern":{let B=n(s),i=B.indexOf("=");if(i<=0)throw new rt(`--pattern expects NAME=REGEX, got "${B}"`);t.patterns[B.slice(0,i)]=B.slice(i+1);break}default:if(s.startsWith("-"))throw new rt(`unknown option ${s}`);if(t.file)throw new rt(`one runbook at a time (got "${t.file}" and "${s}")`);t.file=s}}if(!t.file)throw new rt("missing the runbook file");if(!t.key)throw new rt("missing --key");return t}var vl=r=>{process.stdout.write(r+`
|
|
297
|
+
`)};async function Sl(r,e=vl,t){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(pr),0;let n;try{n=qf(r)}catch(h){if(!(h instanceof rt))throw h;return process.stderr.write(`md-runbook: ${h.message}
|
|
298
298
|
|
|
299
|
-
${
|
|
300
|
-
`),2;let s=
|
|
301
|
-
`),1;if(r.cosign&&s&&!s.unchanged)return process.stderr.write(`md-runbook: ${r.file}: the run record changed since ${
|
|
302
|
-
`),1;let B=
|
|
303
|
-
`),1}let o=r.signer??
|
|
299
|
+
${pr}`),2}if(!ct.existsSync(n.file))return process.stderr.write(`md-runbook: no such file: ${n.file}
|
|
300
|
+
`),2;let s=ct.readFileSync(n.file,"utf8"),B=(()=>{let h=TB(s);try{return h?{block:h,manifest:nr(h.manifest)}:void 0}catch{return}})();if(n.record)return Vf(n,s,e,t);if(n.cosign)return Wf(n,s,B?.block,e,t);let i={name:n.name??B?.manifest.name??Qf(n.file),version:n.version??(B?B.manifest.version+1:1),...n.expires?{expires:n.expires}:{},scopes:n.scopes??B?.manifest.scopes??[],patterns:{...B?.manifest.patterns??{},...n.patterns}},o=FB(s,i);if("errors"in o){for(let h of o.errors)e(`${n.file}: error: ${h}`);return e("\u2717 not signed"),1}let a=Yt("bash",{},Rt()),c=a.ok?await QB(o.manifest,a.shell.command):void 0;if(c?.length){for(let h of c)e(`${n.file}: error: ${h}`);return e("\u2717 not signed: a server runs these commands one by one; make each a whole command (or end the cell differently)"),1}c||e(" note: bash not found, so the commands were not checked one by one (bash -n)");let u=IB(o.manifest),l;try{l=await cr(u,n.key,{sshKeygen:t})}catch(h){return e(`\u2717 ${h instanceof Error?h.message:String(h)}`),1}let f=n.signer??fr(n.key)??B?.block.signer??"unknown",C=n.out??n.file;ct.writeFileSync(C,NB(s,{signer:f,signed:gr(),manifest:u,signature:l}),"utf8");let d=o.manifest;return e(`\u2713 ${d.name} version ${d.version} signed by ${f}: ${d.cells.length} block${d.cells.length===1?"":"s"}${d.scopes.length?`, scopes ${d.scopes.join(" ")}`:""}${d.expires?`, until ${d.expires}`:""} \xB7 written to ${C}`),e(` manifest sha256 ${cs(u)} (list it in a server's revoked file to withdraw this version)`),0}async function Wf(r,e,t,n,s){if(!t)return n(`\u2717 ${r.file} is not signed yet: sign it first, then a second signer adds --cosign`),1;if(r.name||r.version||r.expires||r.scopes||Object.keys(r.patterns).length)return n("\u2717 --cosign signs the manifest as it is: --name, --version, --expires, --scope and --pattern belong to signing"),1;if(!da(e,t))return n(`\u2717 ${r.file} changed since ${t.signer} signed it: sign it again (a new version), then co-sign that`),1;let B;try{B=await cr(t.manifest,r.key,{sshKeygen:s})}catch(l){return n(`\u2717 ${l instanceof Error?l.message:String(l)}`),1}let i=r.signer??fr(r.key)??"unknown",o=[...(t.cosigners??[]).filter(l=>l.signer!==Ot(i)),{signer:i,signed:gr(),signature:B}],a=r.out??r.file,c={...t,cosigners:o};ct.writeFileSync(a,NB(e,c),"utf8");let u=nr(t.manifest);return n(`\u2713 ${u.name} version ${u.version} co-signed by ${i}: signed by ${LB(c).join(", ")} \xB7 written to ${a}`),0}async function Vf(r,e,t,n){let s=ir(e);if(r.cosign&&!s)return process.stderr.write(`md-runbook: ${r.file}: the run record is not signed yet (sign it first, then a second person co-signs)
|
|
301
|
+
`),1;if(r.cosign&&s&&!s.unchanged)return process.stderr.write(`md-runbook: ${r.file}: the run record changed since ${mn(s.block).join(", ")} signed it: sign it again first
|
|
302
|
+
`),1;let B=Bs(e),i;try{i=await cr($B(B),r.key,{sshKeygen:n})}catch(l){return process.stderr.write(`md-runbook: ${l instanceof Error?l.message:String(l)}
|
|
303
|
+
`),1}let o=r.signer??fr(r.key)??"unknown",a=Se(new Date),c=r.cosign&&s?Ra(s.block,{signer:o,signed:a,signature:i}):{signer:o,signed:a,sha256:B,signature:i},u=r.out??r.file;return ct.writeFileSync(u,Aa(e,c),"utf8"),t(`\u2713 ${u}: run record signed by ${mn(c).join(", ")} (sha256 ${B})`),0}async function Zf(r,e,t,n,s){let B=ir(r);if(!B)return;let i=B.block,o=(i.cosigners??[]).map(c=>`, co-signed by ${c.signer} at ${c.signed}`).join("");n(`${e}: run record signed by ${i.signer} at ${i.signed}${o} (as the file says)`),n(` record sha256 ${i.sha256}: ${B.unchanged?"unchanged since signing":`CHANGED since signing (now ${Bs(r)})`}`);let a=B.unchanged;if(t){let c=[i.signature,...(i.cosigners??[]).map(l=>l.signature)],u=mn(i);for(let l=0;l<c.length;l++)try{n(` record signature ${l+1} (${u[l]}): good, by ${await fs($B(i.sha256),c[l],t,s)} (${t})`)}catch(f){n(` record signature ${l+1} (${u[l]}): ${f instanceof Error?f.message:String(f)}`),a=!1}}else n(" record signature: NOT checked: add --allowed-signers FILE");return a}async function Ol(r,e=vl,t){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(pr),0;let n=[...r],s,B;for(;n.length>0;){let C=n.shift();if(C==="--allowed-signers")B=n.shift();else{if(C.startsWith("-")||s)return process.stderr.write(`md-runbook: ${C.startsWith("-")?`unknown option ${C}`:"one runbook at a time"}
|
|
304
304
|
|
|
305
|
-
${
|
|
305
|
+
${pr}`),2;s=C}}if(!s||r.includes("--allowed-signers")&&!B)return process.stderr.write(`md-runbook: ${s?"--allowed-signers needs a file":"missing the runbook file"}
|
|
306
306
|
|
|
307
|
-
${
|
|
308
|
-
`),2;let i=
|
|
307
|
+
${pr}`),2;if(!ct.existsSync(s))return process.stderr.write(`md-runbook: no such file: ${s}
|
|
308
|
+
`),2;let i=ct.readFileSync(s,"utf8"),o=At(i),a=await Zf(i,s,B,e,t);if(!o)return a!==void 0?(e(`${a?"\u2713":"\u2717"} run record${B?"":", signature not checked"} (the runbook itself is not signed)`),a?0:1):(e(`\u2717 ${s}: ${/<!-- md-runbook:signature/.test(i)?"the signature block is damaged":"not signed"}`),1);a===!1&&e(" (the run record above does not verify)");let c=o.manifest,u=(o.block.cosigners??[]).map(C=>`, co-signed by ${C.signer} on ${C.signed}`).join("");e(`${s}: ${c.name} version ${c.version}, signed by ${o.block.signer} on ${o.block.signed}${u} (as the file says)`),e(` scopes: ${c.scopes.length?c.scopes.join(" "):"none (only servers that accept any scope)"}`),c.expires&&e(` expires: ${c.expires}${c.expires<gr()?" (expired)":""}`);for(let[C,d]of Object.entries(c.patterns))e(` parameter ${C}: ${d}`);e(` manifest sha256 ${cs(o.block.manifest)}`);let l=!0,f=new Map(Ht(Ce(i)).map(C=>[C.cellIndex,C.line]));for(let C of o.changed)e(`${s}:${(f.get(C)??0)+1}: changed since signing: servers that only run signed runbooks refuse this block`),l=!1;for(let C of o.moved)e(`${s}:${(f.get(C)??0)+1}: moved since signing: signed as block ${o.cells.get(C).n}, after blocks that now come later`),l=!1;if(o.missing.length>0&&(e(` signed block${o.missing.length===1?"":"s"} ${o.missing.join(", ")} of ${c.cells.length} not in the file as signed (deleted or changed)`),l=!1),c.expires&&c.expires<gr()&&(l=!1),B){let C=pa(o.block),d=LB(o.block),h=new Set;for(let k=0;k<C.length;k++){let R=C.length>1?`signature ${k+1} (${d[k]})`:"signature";try{let E=await fs(o.block.manifest,C[k],B,t);h.add(E),e(` ${R}: good, by ${E} (${B})`)}catch(E){e(` ${R}: ${E instanceof Error?E.message:String(E)}`),l=!1}}C.length>1&&e(` signers: ${h.size} distinct (${[...h].join(", ")||"none"})`)}else e(" signature: NOT checked (anyone can write a signer name): add --allowed-signers FILE to check it as the gate does");return e(`${l?"\u2713":"\u2717"} ${o.cells.size} signed block${o.cells.size===1?"":"s"}, ${o.changed.length} changed`+(B?"":", signature not checked")),l&&a!==!1?0:1}var Ml=require("node:child_process"),st=ae(require("node:fs")),be=ae(require("node:path"));var Xf=Fl(),Il={M:2331,L:2953};function ti(r){let e=new TextEncoder().encode(r).length,t=e<=Il.M?"M":e<=Il.L?"L":void 0;if(!t)return;let n=Xf(0,t);n.addData(r,"Byte"),n.make();let s=n.getModuleCount(),B=Array.from({length:s},(i,o)=>Array.from({length:s},(a,c)=>n.isDark(o,c)));return{size:s,dark:B,level:t}}function ni(r,e={}){let t=e.scale??4,n=e.margin??4,s=(r.size+n*2)*t,B=e.caption?Math.max(14,t*4)+t*2:0,i=[];for(let a=0;a<r.size;a++){let c=0;for(;c<r.size;){if(!r.dark[a][c]){c++;continue}let u=c;for(;c<r.size&&r.dark[a][c];)c++;i.push(`M${(u+n)*t} ${(a+n)*t}h${(c-u)*t}v${t}h-${(c-u)*t}z`)}}let o=e.caption?`<text x="${s/2}" y="${s+B/2}" text-anchor="middle" dominant-baseline="middle" font-family="system-ui, sans-serif" font-size="${Math.max(12,t*3.5)}" fill="#000">${Z(e.caption)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s+B}" width="${s}" height="${s+B}" shape-rendering="crispEdges"><rect width="100%" height="100%" fill="#fff"/><path fill="#000" d="${i.join("")}"/>${o}</svg>`}function Tl(r,e){let t=[],n=e.map(B=>{let i=ti(B.link);return i?`<figure class="label">${ni(i,{scale:3})}<figcaption><strong>${Z(B.title)}</strong>${B.subtitle?`<span>${Z(B.subtitle)}</span>`:""}</figcaption></figure>`:(t.push(B.title),"")});return{html:`<!doctype html>
|
|
309
309
|
<html lang="en"><head><meta charset="utf-8">
|
|
310
310
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:">
|
|
311
311
|
<title>${Z(r)}</title>
|
|
@@ -325,9 +325,9 @@ ${n.filter(Boolean).join(`
|
|
|
325
325
|
`)}
|
|
326
326
|
</div>
|
|
327
327
|
</body></html>
|
|
328
|
-
`,tooLong:t}}function
|
|
328
|
+
`,tooLong:t}}function Ll(r){let e=[],t=[],n="",s=!1,B=r.replace(/^/,"");for(let c=0;c<B.length;c++){let u=B[c];s?u==='"'&&B[c+1]==='"'?(n+='"',c++):u==='"'?s=!1:n+=u:u==='"'?s=!0:u===","?(t.push(n),n=""):u===`
|
|
329
329
|
`||u==="\r"?(u==="\r"&&B[c+1]===`
|
|
330
|
-
`&&c++,t.push(n),e.push(t),t=[],n=""):n+=u}(n!==""||t.length>0)&&(t.push(n),e.push(t));let[i,...o]=e.filter(c=>c.some(u=>u.trim()!==""));if(!i)return[];let a=i.map(c=>c.trim());return o.map(c=>Object.fromEntries(a.map((u,l)=>[u,(c[l]??"").trim()])))}function
|
|
330
|
+
`&&c++,t.push(n),e.push(t),t=[],n=""):n+=u}(n!==""||t.length>0)&&(t.push(n),e.push(t));let[i,...o]=e.filter(c=>c.some(u=>u.trim()!==""));if(!i)return[];let a=i.map(c=>c.trim());return o.map(c=>Object.fromEntries(a.map((u,l)=>[u,(c[l]??"").trim()])))}function Nl(r,e,t){let n=r.trim().replace(/\.git$/,""),s=/^(?:git@([^:]+):|ssh:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/|https:\/\/(?:[^@/]+@)?([^/]+)\/)(.+)$/.exec(n);if(!s)return;let B=(s[1]??s[2]??s[3]).toLowerCase(),i=s[4],o=c=>c.split(/[\\/]/).map(encodeURIComponent).join("/"),a=o(t);if(B==="github.com")return`https://github.com/${i}/blob/${o(e)}/${a}`;if(B.includes("gitlab"))return`https://${B}/${i}/-/blob/${o(e)}/${a}`}var $l=`Usage: md-runbook qr <file.md> [options]
|
|
331
331
|
md-runbook link <file.md> [options] (prints the link: a pager alert, a chat)
|
|
332
332
|
md-runbook qr <file.md> --labels hosts.csv [options]
|
|
333
333
|
|
|
@@ -351,29 +351,29 @@ says who approved it.
|
|
|
351
351
|
--out FILE .svg (one code), .html or .pdf (labels). Default: next to the runbook
|
|
352
352
|
--browser PATH Browser for a .pdf (default: CHROME_PATH, else one found on this machine)
|
|
353
353
|
--link Print the link too
|
|
354
|
-
`,
|
|
355
|
-
`)};function
|
|
354
|
+
`,We=class extends Error{},eC=r=>{process.stdout.write(r+`
|
|
355
|
+
`)};function tC(r){let e=[...r],t={file:"",embed:!1,pin:!1,params:{},cosign:!1,vscode:!1,printLink:!1},n=s=>{let B=e.shift();if(B===void 0||B.startsWith("--"))throw new We(`${s} needs a value`);return B};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 B=n(s),i=B.indexOf("=");if(i<=0||!ht.test(B.slice(0,i)))throw new We(`--param expects NAME=VALUE, got "${B}"`);t.params[B.slice(0,i)]=B.slice(i+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 We(`unknown option ${s}`);if(t.file)throw new We(`one runbook at a time (got ${t.file} and ${s})`);t.file=s}}if(!t.file)throw new We("missing the runbook file");if(t.embed&&t.url)throw new We("--embed and --url: choose one");if(t.pin&&!t.url)throw new We("--pin goes with --url (the Git address is pinned anyway)");if(t.webApp&&!/^https:\/\/[^/]+\/(?:.*\/)?open$/.test(t.webApp))throw new We("--web-app expects https://<web app>/open");if(t.webApp&&t.vscode)throw new We("--web-app and --vscode: choose one");return t}var Es=(r,e)=>(0,Ml.execFileSync)("git",e,{cwd:r,encoding:"utf8",windowsHide:!0,timeout:1e4,stdio:["ignore","pipe","ignore"],maxBuffer:8*1024*1024});function nC(r){let e=be.dirname(be.resolve(r)),t,n,s;try{t=Es(e,["rev-parse","--show-toplevel"]).trim(),n=Es(e,["remote","get-url","origin"]).trim(),s=Es(e,["rev-parse","--abbrev-ref","HEAD"]).trim()}catch{return"not in a Git repository with a remote: use --embed, or --url"}let B=be.relative(t,be.resolve(r)).split(be.sep).join("/"),i=Nl(n,s,B);if(!i)return`the app opens GitHub and GitLab addresses; this repository's remote is ${n}: use --embed, or --url`;try{return{web:i,sha256:Br(Es(t,["show",`origin/${s}:${B}`]))}}catch{return{web:i}}}async function ri(r,e=eC,t=!1){if(r.includes("-h")||r.includes("--help"))return process.stdout.write($l),0;let n;try{n=tC(r)}catch(h){if(!(h instanceof We))throw h;return process.stderr.write(`md-runbook: ${h.message}
|
|
356
356
|
|
|
357
|
-
${
|
|
357
|
+
${$l}`),2}if(!st.existsSync(n.file))return process.stderr.write(`md-runbook: no such file: ${n.file}
|
|
358
358
|
`),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)
|
|
359
|
-
`),2;let s=
|
|
360
|
-
`),2;B.url=
|
|
361
|
-
`)}let i=
|
|
362
|
-
`),2;if(t)return e(
|
|
363
|
-
`),1;let E=n.out??be.join(be.dirname(n.file),`${a}.qr.svg`);return
|
|
364
|
-
`,"utf8"),n.printLink&&e(
|
|
365
|
-
`),2;let u=
|
|
366
|
-
`),2;let l=[];for(let[
|
|
367
|
-
`),2;t?e(`${
|
|
368
|
-
`),1;let
|
|
369
|
-
`),1;await
|
|
370
|
-
${
|
|
371
|
-
${
|
|
372
|
-
`).join(""),l=r.findings.map(
|
|
373
|
-
`).join(""),
|
|
374
|
-
`).join(""),
|
|
375
|
-
`).join(""),
|
|
376
|
-
<p>${
|
|
359
|
+
`),2;let s=st.readFileSync(n.file,"utf8"),B={params:{...n.params},...n.cosign?{action:"cosign"}:{}};if(n.embed)B.text=Gs(s);else if(n.url)B.url=n.url,n.pin&&(B.sha256=Br(s));else{let h=nC(n.file);if(typeof h=="string")return process.stderr.write(`md-runbook: ${h}
|
|
360
|
+
`),2;B.url=h.web,h.sha256?B.sha256=h.sha256:process.stderr.write(`md-runbook: the file is not pushed yet (no origin version): the link is not pinned
|
|
361
|
+
`)}let i=h=>n.vscode?ba(h):sr(h,n.webApp??ss),o=h=>{let k=n.vscode?wa(decodeURIComponent(h.slice(h.indexOf("?")+1))):rs(h);return k.ok?void 0:k.problem},a=be.basename(n.file).replace(/\.md$/i,""),c=cB(s)??a;if(!n.labels){n.host&&(B.host=n.host);let h=i(B),k=o(h);if(k)return process.stderr.write(`md-runbook: the app would refuse this link (${k})
|
|
362
|
+
`),2;if(t)return e(h),0;let R=ti(h);if(!R)return process.stderr.write(`md-runbook: too much for a QR code (${Buffer.byteLength(h)} bytes; 2953 at most): use its address instead of --embed
|
|
363
|
+
`),1;let E=n.out??be.join(be.dirname(n.file),`${a}.qr.svg`);return st.mkdirSync(be.dirname(be.resolve(E)),{recursive:!0}),st.writeFileSync(E,ni(R,{scale:8,caption:n.host??c})+`
|
|
364
|
+
`,"utf8"),n.printLink&&e(h),e(`\u2713 ${E}: QR code (${R.size}\xD7${R.size}, level ${R.level}) for ${n.host?`${c} on ${n.host}`:c}`),0}if(n.host)return process.stderr.write(`md-runbook: --host and --labels: the hosts come from the CSV
|
|
365
|
+
`),2;let u=Ll(st.readFileSync(n.labels,"utf8"));if(u.length===0||!("host"in u[0]))return process.stderr.write(`md-runbook: ${n.labels}: expected a header row with a host column (and optional label, p.NAME columns)
|
|
366
|
+
`),2;let l=[];for(let[h,k]of u.entries()){let R={...B.params};for(let[w,y]of Object.entries(k))w.startsWith("p.")&&y!==""&&(R[w.slice(2)]=y);let E=i({...B,...k.host?{host:k.host}:{},params:R}),S=o(E);if(S)return process.stderr.write(`md-runbook: ${n.labels} row ${h+2}: the app would refuse its link (${S})
|
|
367
|
+
`),2;t?e(`${k.host} ${E}`):n.printLink&&e(E),l.push({link:E,title:k.host||c,subtitle:k.label||(k.host?c:void 0)})}if(t)return 0;let{html:f,tooLong:C}=Tl(c,l);if(C.length>0)return process.stderr.write(`md-runbook: too much for a QR code: ${C.join(", ")} (use its address instead of --embed)
|
|
368
|
+
`),1;let d=n.out??be.join(be.dirname(n.file),`${a}.labels.html`);if(st.mkdirSync(be.dirname(be.resolve(d)),{recursive:!0}),/\.pdf$/i.test(d)){let h=xn(n.browser??process.env.CHROME_PATH);if(!h)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
|
|
369
|
+
`),1;await kn(f,d,h)}else st.writeFileSync(d,f,"utf8");return e(`\u2713 ${d}: ${l.length} label${l.length===1?"":"s"}`),0}var Bt=ae(require("node:fs")),Vt=ae(require("node:path"));function Gl(r){let e=[],t=0;for(let n of r.split(/\r?\n/)){if(n.trim()==="")continue;let s=n.indexOf("{");if(s<0){t++;continue}try{let B=JSON.parse(n.slice(s));typeof B.time=="string"&&typeof B.event=="string"?e.push(B):t++}catch{t++}}return{events:e,skipped:t}}var se=r=>typeof r=="string"?r:r===void 0?"":String(r);function Hl(r,e=0){let t=[...r].sort((l,f)=>Date.parse(l.time)-Date.parse(f.time)),n=[],s=[],B=[],i=new Map,o=new Map,a=new Map,c=0,u=l=>`${se(l.account)}
|
|
370
|
+
${se(l.who)}
|
|
371
|
+
${se(l.client)}`;for(let l of t){let f=u(l);switch(l.event){case"session":c++,i.set(f,new Map);break;case"load":i.has(f)||i.set(f,new Map),i.get(f).set(se(l.runbook),{});break;case"param":{let C=i.get(f)??new Map;i.set(f,C);let d=C.get(se(l.runbook))??{};d[se(l.name)]=se(l.value),C.set(se(l.runbook),d);break}case"run":{let C={time:l.time,account:se(l.account),who:se(l.who),client:se(l.client),runbook:se(l.runbook),version:se(l.version),hash:se(l.hash),signer:se(l.signer),cell:se(l.cell),step:se(l.step),params:{...i.get(f)?.get(se(l.runbook))??{}}};n.push(C),o.set(se(l.id),C),a.set(se(l.id),C);break}case"probe":{let C=Number(se(l.days_left)),d=l.run===void 0?void 0:a.get(se(l.run));B.push({time:l.time,account:se(l.account),who:se(l.who),client:se(l.client),target:se(l.target),address:se(l.address),ok:l.result==="ok",detail:se(l.detail),...se(l.days_left)!==""&&Number.isFinite(C)?{daysLeft:C}:{},...l.not_after?{notAfter:se(l.not_after)}:{},...l.cert_sha256?{certSha256:se(l.cert_sha256)}:{},...d?{run:d}:{}});break}case"end":{let C=o.get(se(l.id));if(!C)break;o.delete(se(l.id)),C.ended=l.time,C.durationSeconds=Math.max(0,Math.round((Date.parse(l.time)-Date.parse(C.time))/1e3)),typeof l.exit=="number"&&(C.exit=l.exit);break}case"refused":case"unsigned":case"stop":s.push({time:l.time,kind:l.event,account:se(l.account),who:se(l.who),client:se(l.client),detail:l.event==="refused"?se(l.reason):l.event==="unsigned"?`unsigned code, sha256 ${se(l.hash)}`:`stopped (${se(l.signal)})`});break}}return{runs:n,findings:s,probes:B,sessions:c,skipped:e}}function Pl(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 _l(r,e,t,n=120){let s=At(t),B=s?.manifest.name??"",i=Ce(t),o=i.cells.map(f=>le(f.meta)?de(f.meta.info):void 0),a=kt(i.cells.map((f,C)=>le(f.meta)?{kind:"code",os:o[C]?.os}:{kind:"markup"})),c=[],u=[],l=new Set;for(let[f,C]of i.cells.entries()){let d=a[f];if(d===void 0||!le(C.meta))continue;let h=C.output?.attrs.ran;if(!h||Number.isNaN(Date.parse(h)))continue;let k=s?.cells.get(f)?.n;if(k===void 0)continue;let R=r.runs.find(E=>!l.has(E)&&E.runbook===B&&E.cell===String(k)&&Math.abs(Date.parse(E.time)-Date.parse(h))<=n*1e3);R?(l.add(R),R.matched={file:e,step:d},c.push({step:d,ran:h})):u.push({step:d,ran:h})}return{file:e,runbook:B,confirmed:c,missing:u}}var vn=r=>r.replace("T"," ").replace(/Z$/," UTC");function Jl(r,e,t){let n=r.runs,s=n.filter(h=>h.exit!==void 0&&h.exit!==0).length,B=new Set(n.map(h=>h.who)),i=n.length?`${vn(n[0].time)} \u2013 ${vn(n[n.length-1].time)}`:"no runs",o=new Map;for(let h of n){let k=`${h.runbook} v${h.version}`,R=o.get(k)??{version:h.version,signer:h.signer,runs:0,failed:0};R.runs++,h.exit!==void 0&&h.exit!==0&&R.failed++,o.set(k,R)}let a=h=>`<td>${Z(h)}</td>`,c=h=>h.exit===void 0?'<span class="badge none">no end logged</span>':`<span class="badge ${h.exit===0?"ok":"fail"}">exit ${h.exit}</span>`,u=n.map(h=>`<tr>${a(vn(h.time))}${a(h.who)}${a(`${h.account} from ${h.client}`)}${a(`${h.runbook} v${h.version}`)}${a(`${h.cell}${h.step?`.${h.step}`:""}`)}${a(Object.entries(h.params).map(([k,R])=>`${k}=${R}`).join(" "))}<td>${c(h)}</td>${a(h.durationSeconds===void 0?"":`${h.durationSeconds} s`)}${a(h.matched?`${h.matched.file}, step ${h.matched.step}`:"")}</tr>
|
|
372
|
+
`).join(""),l=r.findings.map(h=>`<tr>${a(vn(h.time))}${a(h.kind)}${a(h.who)}${a(`${h.account} from ${h.client}`)}${a(h.detail)}</tr>
|
|
373
|
+
`).join(""),f=r.probes.map(h=>`<tr>${a(vn(h.time))}${a(h.who)}${a(h.target)}${a(h.address)}<td><span class="badge ${h.ok?"ok":"fail"}">${h.ok?"up":"failed"}</span></td>${a(h.notAfter?`${vn(h.notAfter)}${h.daysLeft===void 0?"":` (${h.daysLeft} days)`}`:"")}${a(h.certSha256?`sha256 ${h.certSha256}`:"")}${a(h.run?`${h.run.runbook} v${h.run.version}, block ${h.run.cell}`:"unsigned or by hand")}${a(h.detail)}</tr>
|
|
374
|
+
`).join(""),C=[...o.entries()].map(([h,k])=>`<tr>${a(h)}${a(k.signer)}${a(String(k.runs))}${a(String(k.failed))}</tr>
|
|
375
|
+
`).join(""),d=e.map(h=>`<h3>${Z(h.file)}${h.runbook?` (${Z(h.runbook)})`:""}</h3>
|
|
376
|
+
<p>${h.confirmed.length} recorded run${h.confirmed.length===1?"":"s"} of signed blocks confirmed by the log`+(h.missing.length?`; <strong>not in the log</strong>: ${h.missing.map(k=>`step ${k.step} at ${Z(k.ran)}`).join(", ")} (ran elsewhere, unsigned, or the log is incomplete)`:"")+`.</p>
|
|
377
377
|
`).join("");return`<!DOCTYPE html>
|
|
378
378
|
<html lang="en">
|
|
379
379
|
<head>
|
|
@@ -382,32 +382,32 @@ ${ie(l.client)}`;for(let l of t){let C=u(l);switch(l.event){case"session":c++,i.
|
|
|
382
382
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
383
383
|
<meta name="generator" content="md-runbook audit">
|
|
384
384
|
<title>Gate audit</title>
|
|
385
|
-
<style>${
|
|
385
|
+
<style>${HB}@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}}</style>
|
|
386
386
|
</head>
|
|
387
387
|
<body>
|
|
388
388
|
<header>
|
|
389
389
|
<h1 class="title">Gate audit</h1>
|
|
390
|
-
<p class="meta">Generated ${Z(
|
|
390
|
+
<p class="meta">Generated ${Z(Se(t.generatedAt))} from ${Z(t.sources.join(", "))} \xB7 ${r.sessions} session${r.sessions===1?"":"s"} \xB7 ${n.length} run${n.length===1?"":"s"} by ${B.size} ${B.size===1?"key":"keys"} \xB7 ${s} failed \xB7 ${r.findings.length} finding${r.findings.length===1?"":"s"}</p>
|
|
391
391
|
</header>
|
|
392
392
|
<section class="record">
|
|
393
393
|
<dl class="facts"><div><dt>Period</dt><dd>${Z(i)}</dd></div><div><dt>Runs</dt><dd>${n.length}${s?` \xB7 ${s} failed`:""}</dd></div><div><dt>Findings</dt><dd>${r.findings.length}</dd></div>${r.skipped?`<div><dt>Other log lines</dt><dd>${r.skipped} skipped</dd></div>`:""}</dl>
|
|
394
394
|
</section>
|
|
395
395
|
<h2>Runbooks</h2>
|
|
396
396
|
<table class="timeline"><thead><tr><th>Runbook</th><th>Signer (as the gate accepted)</th><th>Runs</th><th>Failed</th></tr></thead><tbody>
|
|
397
|
-
${
|
|
397
|
+
${C}</tbody></table>
|
|
398
398
|
<h2>Runs</h2>
|
|
399
399
|
<table class="timeline"><thead><tr><th>Time</th><th>Who (key)</th><th>Account, client</th><th>Runbook</th><th>Block</th><th>Parameters</th><th>Result</th><th>Duration</th><th>In run record</th></tr></thead><tbody>
|
|
400
400
|
${u}</tbody></table>
|
|
401
401
|
<h2>Findings</h2>
|
|
402
402
|
${l?`<table class="timeline"><thead><tr><th>Time</th><th>What</th><th>Who (key)</th><th>Account, client</th><th>Detail</th></tr></thead><tbody>
|
|
403
403
|
${l}</tbody></table>`:"<p>None: no refusals, no unsigned code, no stopped runs.</p>"}
|
|
404
|
-
${
|
|
404
|
+
${f?`<h2>Endpoint checks</h2>
|
|
405
405
|
<table class="timeline"><thead><tr><th>Time</th><th>Who (key)</th><th>Endpoint</th><th>Address</th><th>Result</th><th>Certificate expires</th><th>Certificate</th><th>Signed run</th><th>Detail</th></tr></thead><tbody>
|
|
406
|
-
${
|
|
406
|
+
${f}</tbody></table>
|
|
407
407
|
`:""}${e.length?`<h2>Run records</h2>
|
|
408
|
-
${
|
|
408
|
+
${d}`:""}</body>
|
|
409
409
|
</html>
|
|
410
|
-
`}var
|
|
410
|
+
`}var Ul=`Usage: md-runbook audit <gate log>... [options]
|
|
411
411
|
|
|
412
412
|
Reads md-runbook-gate's log (its log file, or syslog: journalctl -t md-runbook-gate -o cat, or
|
|
413
413
|
/var/log/syslog lines with the tag) and reports every run of a signed runbook: when, the key
|
|
@@ -428,14 +428,15 @@ that checked it). "-" reads standard input.
|
|
|
428
428
|
--browser PATH Browser for a .pdf (default: CHROME_PATH, else one found on this machine)
|
|
429
429
|
|
|
430
430
|
Exit code 0: nothing to flag; 1: findings, or recorded runs the log doesn't show; 2: usage.
|
|
431
|
-
`,It=class extends Error{}
|
|
432
|
-
`)};function
|
|
431
|
+
`,It=class extends Error{},rC=r=>{process.stdout.write(r+`
|
|
432
|
+
`)};function Kl(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 It(`${r} expects a date or time, got "${e}"`);return t}function sC(r){let e=[...r],t={logs:[],records:[],out:"gate-audit.html"},n=s=>{let B=e.shift();if(B===void 0||B.startsWith("--"))throw new It(`${s} needs a value`);return B};for(;e.length>0;){let s=e.shift();switch(s){case"--record":t.records.push(n(s));break;case"--since":t.since=Kl(s,n(s));break;case"--until":t.until=Kl(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 It(`unknown option ${s}`);t.logs.push(s)}}if(t.logs.length===0)throw new It("missing the gate log (a file, or - for standard input)");if(!/\.(html?|pdf|json)$/i.test(t.out))throw new It("--out must end in .html, .pdf or .json");return t}async function jl(r,e=rC,t=()=>Bt.readFileSync(0,"utf8")){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(Ul),0;let n;try{n=sC(r)}catch(l){if(!(l instanceof It))throw l;return process.stderr.write(`md-runbook: ${l.message}
|
|
433
433
|
|
|
434
|
-
${
|
|
435
|
-
`),2;let s=0,B=n.logs.flatMap(l=>{let
|
|
436
|
-
`,"utf8")}else{let l=
|
|
437
|
-
`),2;await
|
|
434
|
+
${Ul}`),2}for(let l of[...n.logs.filter(f=>f!=="-"),...n.records])if(!Bt.existsSync(l))return process.stderr.write(`md-runbook: no such file: ${l}
|
|
435
|
+
`),2;let s=0,B=n.logs.flatMap(l=>{let f=Gl(l==="-"?t():Bt.readFileSync(l,"utf8"));return s+=f.skipped,f.events}),i=Pl(Hl(B,s),n),o=n.records.map(l=>_l(i,Vt.basename(l),Bt.readFileSync(l,"utf8")));if(Bt.mkdirSync(Vt.dirname(Vt.resolve(n.out)),{recursive:!0}),/\.json$/i.test(n.out)){let l=i.probes.map(({run:f,...C})=>({...C,...f?{run:{time:f.time,runbook:f.runbook,version:f.version,cell:f.cell}}:{}}));Bt.writeFileSync(n.out,JSON.stringify({format:"md-runbook gate audit v1",sources:n.logs,...i,probes:l,records:o},null,2)+`
|
|
436
|
+
`,"utf8")}else{let l=Jl(i,o,{generatedAt:new Date,sources:n.logs.map(f=>f==="-"?"standard input":Vt.basename(f))});if(/\.pdf$/i.test(n.out)){let f=xn(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
|
|
437
|
+
`),2;await kn(l,n.out,f)}else Bt.writeFileSync(n.out,l,"utf8")}let a=i.runs.filter(l=>l.exit!==void 0&&l.exit!==0).length,c=o.reduce((l,f)=>l+f.missing.length,0);e(`${i.runs.length} run${i.runs.length===1?"":"s"} in ${i.sessions} session${i.sessions===1?"":"s"}, ${a} failed, ${i.findings.length} finding${i.findings.length===1?"":"s"}`);for(let l of i.findings)e(` ${l.time} ${l.kind}: ${l.who} (${l.account} from ${l.client}): ${l.detail}`);if(i.probes.length){let l=i.probes.filter(f=>!f.ok);e(`${i.probes.length} endpoint check${i.probes.length===1?"":"s"} (md-runbook-probe), ${l.length} failed`);for(let f of l)e(` ${f.time} ${f.target}: ${f.detail}`)}for(let l of o)e(` ${l.file}: ${l.confirmed.length} recorded run${l.confirmed.length===1?"":"s"} confirmed by the log${l.missing.length?`, ${l.missing.length} not in it (steps ${l.missing.map(f=>f.step).join(", ")})`:""}`);let u=i.findings.length>0||c>0;return e(`${u?"\u2717":"\u2713"} ${n.out}`),u?1:0}var bs=`Usage: md-runbook run <file.md> [options]
|
|
438
438
|
md-runbook lint <file.md>... [--strict]
|
|
439
|
+
md-runbook estimate <file.md>... (how long each section takes, by estimate=)
|
|
439
440
|
md-runbook sign <file.md> --key KEY [options] (see md-runbook sign --help)
|
|
440
441
|
md-runbook verify <file.md> [--allowed-signers FILE]
|
|
441
442
|
md-runbook qr <file.md> [options] (see md-runbook qr --help)
|
|
@@ -481,28 +482,36 @@ lint checks runbooks without running them (invalid or unknown cell options, \${o
|
|
|
481
482
|
without an earlier capture=NAME, undeclared \${param:NAME}, ignored front matter values) and
|
|
482
483
|
exits with 1 when it finds an error (with --strict: also a warning).
|
|
483
484
|
|
|
485
|
+
estimate adds up the blocks' estimate= options (e.g. estimate=2m30s): one line per # and ##
|
|
486
|
+
section with its time and the blocks without an estimate, then the runbook's total. A run
|
|
487
|
+
prints a step's estimate on its "\u25B6 Step N" line, warns when the step took more than twice it,
|
|
488
|
+
and in a terminal shows after each step how far the run is and about how long is left.
|
|
489
|
+
|
|
484
490
|
\${secret:NAME} values come from the environment variable NAME and are redacted from output.
|
|
485
491
|
On GitHub Actions, a summary table is added to the job summary.
|
|
486
|
-
`,
|
|
492
|
+
`,Ke=class extends Error{};function Ds(r,e){He.mkdirSync(Dt.dirname(Dt.resolve(r)),{recursive:!0}),He.writeFileSync(r,e,"utf8")}function zl(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 Ke(`unknown command "${e[0]}" (expected run, lint, estimate, sign, verify, qr, link or audit)`);e.shift();let t={file:"",write:!0,params:{},inputs:{},yes:!1,keepGoing:!1,shell:{}},n,s,B,i,o=!1,a=u=>{let l=e.shift();if(l===void 0||l.startsWith("--"))throw new Ke(`${u} needs a value`);return l},c=(u,l)=>{let f=a(u),C=f.indexOf("=");if(C<=0)throw new Ke(`${u} expects NAME=VALUE, got "${f}"`);l[f.slice(0,C)]=f.slice(C+1)};for(;e.length>0;){let u=e.shift();switch(u){case"--check":t.write=!1;break;case"--out":t.out=a(u);break;case"--report":t.report=a(u);break;case"--pdf":n=a(u);break;case"--browser":s=a(u);break;case"--notify":B=a(u);break;case"--notify-on":i=a(u);break;case"--junit":t.junit=a(u);break;case"--json":t.json=a(u);break;case"--transcript":t.transcript=a(u);break;case"--param":c(u,t.params);break;case"--input":c(u,t.inputs);break;case"--yes":t.yes=!0;break;case"--keep-going":t.keepGoing=!0;break;case"--from":case"--to":{let l=a(u);if(!/^[1-9]\d*$/.test(l))throw new Ke(`${u} expects a step number (1, 2, \u2026), got "${l}"`);t[u==="--from"?"from":"to"]=Number(l);break}case"--section":{let l=a(u);if(l.trim()==="")throw new Ke("--section needs the start of a heading");(t.sections??=[]).push(l);break}case"--session":t.session=!0;break;case"--isolated":t.session=!1;break;case"--timeout":{let l=Number(a(u));if(!Number.isFinite(l)||l<0)throw new Ke("--timeout expects seconds (0 = none)");t.timeoutSeconds=l;break}case"--bash":t.shell.bashPath=a(u);break;case"--pwsh":t.shell.pwshPath=a(u);break;case"--quiet":o=!0;break;default:if(u.startsWith("-"))throw new Ke(`unknown option ${u}`);if(t.file)throw new Ke(`only one runbook per run (got "${t.file}" and "${u}")`);t.file=u}}if(!t.file)throw new Ke("missing the runbook file");if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new Ke(`--from ${t.from} is after --to ${t.to}`);return{options:t,...n?{pdf:n}:{},...s?{browser:s}:{},...B?{notify:B}:{},...i?{notifyOn:i}:{},quiet:o}}function Yl(r,e=t=>{process.stdout.write(t+`
|
|
487
493
|
`)}){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)"}
|
|
488
494
|
|
|
489
|
-
${
|
|
495
|
+
${bs}`),2;let B=process.env.GITHUB_ACTIONS==="true",i=!1,o=0;for(let a of n){if(!He.existsSync(a)){e(`${a}: error: no such file`),i=!0;continue}for(let c of Ta(He.readFileSync(a,"utf8")))o++,e(La(a,c)),B&&e(`::${c.severity} file=${a},line=${c.line+1}::${c.message.replace(/\r?\n/g," ")}`),(c.severity==="error"||t)&&(i=!0)}return e(`${i?"\u2717":"\u2713"} ${n.length} runbook${n.length===1?"":"s"} checked, ${o} problem${o===1?"":"s"}`),i?1:0}function Ql(r,e=t=>{process.stdout.write(t+`
|
|
496
|
+
`)}){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)"}
|
|
497
|
+
|
|
498
|
+
${bs}`),2;let n=!1;return r.forEach((s,B)=>{if(B>0&&e(""),!He.existsSync(s)){e(`${s}: error: no such file`),n=!0;return}let i=dB(He.readFileSync(s,"utf8")),o=(u,l,f)=>l===0?"\u2013":`${f===l?"?":ze(u)}${f>0?` (${Wr(f)})`:""}`,a=i.sections.map(u=>[u.level===0?"(before the first heading)":`${"#".repeat(u.level)} ${u.heading}`,o(u.seconds,u.blocks,u.unestimated)]),c=Math.min(60,Math.max(0,...a.map(([u])=>u.length)));e(s);for(let[u,l]of a)e(` ${u.length>c?u.slice(0,c-1)+"\u2026":u.padEnd(c)} ${l}`);e(` Total: ${o(i.totalSeconds,i.blocks,i.unestimated)} for ${i.blocks} block${i.blocks===1?"":"s"}`)}),n?1:0}async function ql(r){if(r[0]==="lint")return Yl(r.slice(1));if(r[0]==="estimate")return Ql(r.slice(1));if(r[0]==="sign")return Sl(r.slice(1));if(r[0]==="verify")return Ol(r.slice(1));if(r[0]==="qr")return ri(r.slice(1));if(r[0]==="link")return ri(r.slice(1),void 0,!0);if(r[0]==="audit")return jl(r.slice(1));let e;try{e=zl(r)}catch(w){if(!(w instanceof Ke))throw w;return process.stderr.write(`md-runbook: ${w.message}
|
|
490
499
|
|
|
491
|
-
${
|
|
492
|
-
`),0;let{options:t,quiet:n}=e;if(!
|
|
493
|
-
`),2;let s=
|
|
494
|
-
`),2;delete process.env.MD_RUNBOOK_NOTIFY_URL;let B=async w=>{if(s)try{await
|
|
495
|
-
`)}},i=new AbortController,o=()=>i.abort();process.once("SIGINT",o),process.once("SIGTERM",o);let a;try{a=await
|
|
496
|
-
`)}})}catch(w){if(w instanceof
|
|
497
|
-
`),2;throw await B(`\u2717 ${
|
|
498
|
-
${
|
|
499
|
-
`);let
|
|
500
|
-
`);let
|
|
501
|
-
`),
|
|
502
|
-
`),
|
|
503
|
-
${a.ok?"\u2713":"\u2717"} ${c}: ${a.steps.length} step${a.steps.length===1?"":"s"}, ${
|
|
504
|
-
`),a.ok&&!
|
|
505
|
-
`),process.exitCode=1});0&&(module.exports={lint,main,parseArgs});
|
|
500
|
+
${bs}`),2}if(e==="help")return process.stdout.write(bs),0;if(e==="version")return process.stdout.write(`0.20.0
|
|
501
|
+
`),0;let{options:t,quiet:n}=e;if(!He.existsSync(t.file))return process.stderr.write(`md-runbook: no such file: ${t.file}
|
|
502
|
+
`),2;let s=ml(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}
|
|
503
|
+
`),2;delete process.env.MD_RUNBOOK_NOTIFY_URL;let B=async w=>{if(s)try{await Dl(s.url,w)}catch(y){process.stderr.write(`md-runbook: ${y instanceof Error?y.message:String(y)}
|
|
504
|
+
`)}},i=new AbortController,o=()=>i.abort();process.once("SIGINT",o),process.once("SIGTERM",o);let a;try{a=await dl({...t,env:process.env,signal:i.signal,progress:process.stdout.isTTY===!0&&!n,...s?{extraSecrets:[s.url]}:{}},{out:w=>{n||process.stdout.write(w)},log:w=>{n||process.stdout.write(w+`
|
|
505
|
+
`)}})}catch(w){if(w instanceof Ye)return process.off("SIGINT",o),process.off("SIGTERM",o),process.stderr.write(`md-runbook: ${w.message}
|
|
506
|
+
`),2;throw await B(`\u2717 ${Dt.basename(t.file)}: the run stopped with an error${ms(process.env)?`
|
|
507
|
+
${ms(process.env)}`:""}`),w}process.off("SIGINT",o),process.off("SIGTERM",o);let c=Dt.basename(t.file),u=t.out??t.file;t.write&&Ds(u,a.text);let l=()=>GB(a.text,{generatedAt:new Date,fallbackTitle:c,redact:a.redact});t.report&&Ds(t.report,l()),t.junit&&Ds(t.junit,pl(c,a.steps)),t.json&&Ds(t.json,JSON.stringify({file:c,ok:a.ok,steps:a.steps,record:Zr(a.text)},null,2)+`
|
|
508
|
+
`);let f=process.env.GITHUB_STEP_SUMMARY;f&&He.appendFileSync(f,gl(c,a.steps)+`
|
|
509
|
+
`);let C=!1;if(e.pdf){let w=xn(e.browser??process.env.CHROME_PATH);if(!w)process.stderr.write(`md-runbook: --pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH)
|
|
510
|
+
`),C=!0;else try{He.mkdirSync(Dt.dirname(Dt.resolve(e.pdf)),{recursive:!0}),await kn(l(),e.pdf,w)}catch(y){process.stderr.write(`md-runbook: PDF export failed: ${y instanceof Error?y.message:String(y)}
|
|
511
|
+
`),C=!0}}s&&(s.on==="always"||!a.ok)&&await B(El(c,a,ms(process.env)));let d=w=>a.steps.filter(y=>y.status===w).length,h=[`${d("passed")} passed`,`${d("failed")} failed`];d("skipped")&&h.push(`${d("skipped")} skipped`),d("not run")&&h.push(`${d("not run")} not run`);let k=a.steps.filter(w=>w.status==="passed"||w.status==="failed"),R=k.reduce((w,y)=>w+(y.estimateSeconds??0),0),E=k.filter(w=>w.estimateSeconds===void 0).length,S=R>0?` \xB7 took ${ze(k.reduce((w,y)=>w+y.durationMs,0)/1e3)}, estimated ${ze(R)}`+(E>0?` (${E} step${E===1?"":"s"} without an estimate)`:""):"";return process.stdout.write(`
|
|
512
|
+
${a.ok?"\u2713":"\u2717"} ${c}: ${a.steps.length} step${a.steps.length===1?"":"s"}, ${h.join(", ")}${S}${t.write?` \xB7 outputs written to ${u}`:""}
|
|
513
|
+
`),a.ok&&!C?0:1}require.main===module&&ql(process.argv.slice(2)).then(r=>process.exitCode=r,r=>{process.stderr.write(`md-runbook: ${r instanceof Error?r.stack??r.message:String(r)}
|
|
514
|
+
`),process.exitCode=1});0&&(module.exports={estimate,lint,main,parseArgs});
|
|
506
515
|
/*! Bundled license information:
|
|
507
516
|
|
|
508
517
|
re2js/build/index.js:
|