checksync
Version:
A tool that allows code to be annotated across different files to ensure they remain in sync.
25 lines • 682 kB
JavaScript
"use strict";var e=require("fs"),t=require("os"),a=require("tty"),n=require("path"),p=require("node:path"),r=require("node:fs"),i=require("readline"),d=require("util"),s=require("stream"),o=require("events"),l=require("fs/promises"),m=require("http"),u=require("url"),c=require("punycode"),h=require("https"),f=require("zlib"),g=require("assert"),v="undefined"!=typeof document?document.currentScript:null;function y(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var b=y(p),w=y(r),D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function E(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var a=function e(){var a=!1;try{a=this instanceof e}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),a}var S,C,A,O,x,N,$,T,k,F,j,R,P,I,V,M,L,B,H,U={exports:{}};function q(){if(O)return A;O=1;const e=C?S:(C=1,S={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),t={};for(const a of Object.keys(e))t[e[a]]=a;const a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};A=a;for(const e of Object.keys(a)){if(!("channels"in a[e]))throw new Error("missing channels property: "+e);if(!("labels"in a[e]))throw new Error("missing channel labels property: "+e);if(a[e].labels.length!==a[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=a[e];delete a[e].channels,delete a[e].labels,Object.defineProperty(a[e],"channels",{value:t}),Object.defineProperty(a[e],"labels",{value:n})}return a.rgb.hsl=function(e){const t=e[0]/255,a=e[1]/255,n=e[2]/255,p=Math.min(t,a,n),r=Math.max(t,a,n),i=r-p;let d,s;r===p?d=0:t===r?d=(a-n)/i:a===r?d=2+(n-t)/i:n===r&&(d=4+(t-a)/i),d=Math.min(60*d,360),d<0&&(d+=360);const o=(p+r)/2;return s=r===p?0:o<=.5?i/(r+p):i/(2-r-p),[d,100*s,100*o]},a.rgb.hsv=function(e){let t,a,n,p,r;const i=e[0]/255,d=e[1]/255,s=e[2]/255,o=Math.max(i,d,s),l=o-Math.min(i,d,s),m=function(e){return(o-e)/6/l+.5};return 0===l?(p=0,r=0):(r=l/o,t=m(i),a=m(d),n=m(s),i===o?p=n-a:d===o?p=1/3+t-n:s===o&&(p=2/3+a-t),p<0?p+=1:p>1&&(p-=1)),[360*p,100*r,100*o]},a.rgb.hwb=function(e){const t=e[0],n=e[1];let p=e[2];const r=a.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(n,p));return p=1-1/255*Math.max(t,Math.max(n,p)),[r,100*i,100*p]},a.rgb.cmyk=function(e){const t=e[0]/255,a=e[1]/255,n=e[2]/255,p=Math.min(1-t,1-a,1-n);return[100*((1-t-p)/(1-p)||0),100*((1-a-p)/(1-p)||0),100*((1-n-p)/(1-p)||0),100*p]},a.rgb.keyword=function(a){const n=t[a];if(n)return n;let p,r=1/0;for(const t of Object.keys(e)){const n=e[t],s=(d=n,((i=a)[0]-d[0])**2+(i[1]-d[1])**2+(i[2]-d[2])**2);s<r&&(r=s,p=t)}var i,d;return p},a.keyword.rgb=function(t){return e[t]},a.rgb.xyz=function(e){let t=e[0]/255,a=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;return[100*(.4124*t+.3576*a+.1805*n),100*(.2126*t+.7152*a+.0722*n),100*(.0193*t+.1192*a+.9505*n)]},a.rgb.lab=function(e){const t=a.rgb.xyz(e);let n=t[0],p=t[1],r=t[2];n/=95.047,p/=100,r/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,p=p>.008856?p**(1/3):7.787*p+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*p-16,500*(n-p),200*(p-r)]},a.hsl.rgb=function(e){const t=e[0]/360,a=e[1]/100,n=e[2]/100;let p,r,i;if(0===a)return i=255*n,[i,i,i];p=n<.5?n*(1+a):n+a-n*a;const d=2*n-p,s=[0,0,0];for(let e=0;e<3;e++)r=t+1/3*-(e-1),r<0&&r++,r>1&&r--,i=6*r<1?d+6*(p-d)*r:2*r<1?p:3*r<2?d+(p-d)*(2/3-r)*6:d,s[e]=255*i;return s},a.hsl.hsv=function(e){const t=e[0];let a=e[1]/100,n=e[2]/100,p=a;const r=Math.max(n,.01);n*=2,a*=n<=1?n:2-n,p*=r<=1?r:2-r;return[t,100*(0===n?2*p/(r+p):2*a/(n+a)),100*((n+a)/2)]},a.hsv.rgb=function(e){const t=e[0]/60,a=e[1]/100;let n=e[2]/100;const p=Math.floor(t)%6,r=t-Math.floor(t),i=255*n*(1-a),d=255*n*(1-a*r),s=255*n*(1-a*(1-r));switch(n*=255,p){case 0:return[n,s,i];case 1:return[d,n,i];case 2:return[i,n,s];case 3:return[i,d,n];case 4:return[s,i,n];case 5:return[n,i,d]}},a.hsv.hsl=function(e){const t=e[0],a=e[1]/100,n=e[2]/100,p=Math.max(n,.01);let r,i;i=(2-a)*n;const d=(2-a)*p;return r=a*p,r/=d<=1?d:2-d,r=r||0,i/=2,[t,100*r,100*i]},a.hwb.rgb=function(e){const t=e[0]/360;let a=e[1]/100,n=e[2]/100;const p=a+n;let r;p>1&&(a/=p,n/=p);const i=Math.floor(6*t),d=1-n;r=6*t-i,1&i&&(r=1-r);const s=a+r*(d-a);let o,l,m;switch(i){default:case 6:case 0:o=d,l=s,m=a;break;case 1:o=s,l=d,m=a;break;case 2:o=a,l=d,m=s;break;case 3:o=a,l=s,m=d;break;case 4:o=s,l=a,m=d;break;case 5:o=d,l=a,m=s}return[255*o,255*l,255*m]},a.cmyk.rgb=function(e){const t=e[0]/100,a=e[1]/100,n=e[2]/100,p=e[3]/100;return[255*(1-Math.min(1,t*(1-p)+p)),255*(1-Math.min(1,a*(1-p)+p)),255*(1-Math.min(1,n*(1-p)+p))]},a.xyz.rgb=function(e){const t=e[0]/100,a=e[1]/100,n=e[2]/100;let p,r,i;return p=3.2406*t+-1.5372*a+-.4986*n,r=-.9689*t+1.8758*a+.0415*n,i=.0557*t+-.204*a+1.057*n,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,p=Math.min(Math.max(0,p),1),r=Math.min(Math.max(0,r),1),i=Math.min(Math.max(0,i),1),[255*p,255*r,255*i]},a.xyz.lab=function(e){let t=e[0],a=e[1],n=e[2];t/=95.047,a/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;return[116*a-16,500*(t-a),200*(a-n)]},a.lab.xyz=function(e){let t,a,n;a=(e[0]+16)/116,t=e[1]/500+a,n=a-e[2]/200;const p=a**3,r=t**3,i=n**3;return a=p>.008856?p:(a-16/116)/7.787,t=r>.008856?r:(t-16/116)/7.787,n=i>.008856?i:(n-16/116)/7.787,t*=95.047,a*=100,n*=108.883,[t,a,n]},a.lab.lch=function(e){const t=e[0],a=e[1],n=e[2];let p;p=360*Math.atan2(n,a)/2/Math.PI,p<0&&(p+=360);return[t,Math.sqrt(a*a+n*n),p]},a.lch.lab=function(e){const t=e[0],a=e[1],n=e[2]/360*2*Math.PI;return[t,a*Math.cos(n),a*Math.sin(n)]},a.rgb.ansi16=function(e,t=null){const[n,p,r]=e;let i=null===t?a.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),0===i)return 30;let d=30+(Math.round(r/255)<<2|Math.round(p/255)<<1|Math.round(n/255));return 2===i&&(d+=60),d},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){const t=e[0],a=e[1],n=e[2];if(t===a&&a===n)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(a/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const a=.5*(1+~~(e>50));return[(1&t)*a*255,(t>>1&1)*a*255,(t>>2&1)*a*255]},a.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},a.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let a=t[0];3===t[0].length&&(a=a.split("").map((e=>e+e)).join(""));const n=parseInt(a,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){const t=e[0]/255,a=e[1]/255,n=e[2]/255,p=Math.max(Math.max(t,a),n),r=Math.min(Math.min(t,a),n),i=p-r;let d,s;return d=i<1?r/(1-i):0,s=i<=0?0:p===t?(a-n)/i%6:p===a?2+(n-t)/i:4+(t-a)/i,s/=6,s%=1,[360*s,100*i,100*d]},a.hsl.hcg=function(e){const t=e[1]/100,a=e[2]/100,n=a<.5?2*t*a:2*t*(1-a);let p=0;return n<1&&(p=(a-.5*n)/(1-n)),[e[0],100*n,100*p]},a.hsv.hcg=function(e){const t=e[1]/100,a=e[2]/100,n=t*a;let p=0;return n<1&&(p=(a-n)/(1-n)),[e[0],100*n,100*p]},a.hcg.rgb=function(e){const t=e[0]/360,a=e[1]/100,n=e[2]/100;if(0===a)return[255*n,255*n,255*n];const p=[0,0,0],r=t%1*6,i=r%1,d=1-i;let s=0;switch(Math.floor(r)){case 0:p[0]=1,p[1]=i,p[2]=0;break;case 1:p[0]=d,p[1]=1,p[2]=0;break;case 2:p[0]=0,p[1]=1,p[2]=i;break;case 3:p[0]=0,p[1]=d,p[2]=1;break;case 4:p[0]=i,p[1]=0,p[2]=1;break;default:p[0]=1,p[1]=0,p[2]=d}return s=(1-a)*n,[255*(a*p[0]+s),255*(a*p[1]+s),255*(a*p[2]+s)]},a.hcg.hsv=function(e){const t=e[1]/100,a=t+e[2]/100*(1-t);let n=0;return a>0&&(n=t/a),[e[0],100*n,100*a]},a.hcg.hsl=function(e){const t=e[1]/100,a=e[2]/100*(1-t)+.5*t;let n=0;return a>0&&a<.5?n=t/(2*a):a>=.5&&a<1&&(n=t/(2*(1-a))),[e[0],100*n,100*a]},a.hcg.hwb=function(e){const t=e[1]/100,a=t+e[2]/100*(1-t);return[e[0],100*(a-t),100*(1-a)]},a.hwb.hcg=function(e){const t=e[1]/100,a=1-e[2]/100,n=a-t;let p=0;return n<1&&(p=(a-n)/(1-n)),[e[0],100*n,100*p]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=function(e){return[0,0,e[0]]},a.gray.hsv=a.gray.hsl,a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),a=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(a.length)+a},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},A}function z(){if(N)return x;N=1;const e=q();function t(t){const a=function(){const t={},a=Object.keys(e);for(let e=a.length,n=0;n<e;n++)t[a[n]]={distance:-1,parent:null};return t}(),n=[t];for(a[t].distance=0;n.length;){const t=n.pop(),p=Object.keys(e[t]);for(let e=p.length,r=0;r<e;r++){const e=p[r],i=a[e];-1===i.distance&&(i.distance=a[t].distance+1,i.parent=t,n.unshift(e))}}return a}function a(e,t){return function(a){return t(e(a))}}function n(t,n){const p=[n[t].parent,t];let r=e[n[t].parent][t],i=n[t].parent;for(;n[i].parent;)p.unshift(n[i].parent),r=a(e[n[i].parent][i],r),i=n[i].parent;return r.conversion=p,r}return x=function(e){const a=t(e),p={},r=Object.keys(a);for(let e=r.length,t=0;t<e;t++){const e=r[t];null!==a[e].parent&&(p[e]=n(e,a))}return p}}function W(){if(T)return $;T=1;const e=q(),t=z(),a={};return Object.keys(e).forEach((n=>{a[n]={},Object.defineProperty(a[n],"channels",{value:e[n].channels}),Object.defineProperty(a[n],"labels",{value:e[n].labels});const p=t(n);Object.keys(p).forEach((e=>{const t=p[e];a[n][e]=function(e){const t=function(...t){const a=t[0];if(null==a)return a;a.length>1&&(t=a);const n=e(t);if("object"==typeof n)for(let e=n.length,t=0;t<e;t++)n[t]=Math.round(n[t]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(t),a[n][e].raw=function(e){const t=function(...t){const a=t[0];return null==a?a:(a.length>1&&(t=a),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)}))})),$=a}function G(){return k||(k=1,function(e){const t=(e,t)=>(...a)=>`[${e(...a)+t}m`,a=(e,t)=>(...a)=>{const n=e(...a);return`[${38+t};5;${n}m`},n=(e,t)=>(...a)=>{const n=e(...a);return`[${38+t};2;${n[0]};${n[1]};${n[2]}m`},p=e=>e,r=(e,t,a)=>[e,t,a],i=(e,t,a)=>{Object.defineProperty(e,t,{get:()=>{const n=a();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})};let d;const s=(e,t,a,n)=>{void 0===d&&(d=W());const p=n?10:0,r={};for(const[n,i]of Object.entries(d)){const d="ansi16"===n?"ansi":n;n===t?r[d]=e(a,p):"object"==typeof i&&(r[d]=e(i[t],p))}return r};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,d={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};d.color.gray=d.color.blackBright,d.bgColor.bgGray=d.bgColor.bgBlackBright,d.color.grey=d.color.blackBright,d.bgColor.bgGrey=d.bgColor.bgBlackBright;for(const[t,a]of Object.entries(d)){for(const[t,n]of Object.entries(a))d[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},a[t]=d[t],e.set(n[0],n[1]);Object.defineProperty(d,t,{value:a,enumerable:!1})}return Object.defineProperty(d,"codes",{value:e,enumerable:!1}),d.color.close="[39m",d.bgColor.close="[49m",i(d.color,"ansi",(()=>s(t,"ansi16",p,!1))),i(d.color,"ansi256",(()=>s(a,"ansi256",p,!1))),i(d.color,"ansi16m",(()=>s(n,"rgb",r,!1))),i(d.bgColor,"ansi",(()=>s(t,"ansi16",p,!0))),i(d.bgColor,"ansi256",(()=>s(a,"ansi256",p,!0))),i(d.bgColor,"ansi16m",(()=>s(n,"rgb",r,!0))),d}})}(U)),U.exports}function K(){return j?F:(j=1,F=(e,t=process.argv)=>{const a=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(a+e),p=t.indexOf("--");return-1!==n&&(-1===p||n<p)})}var J=function(){if(H)return B;H=1;const e=G(),{stdout:n,stderr:p}=function(){if(P)return R;P=1;const e=t,n=a,p=K(),{env:r}=process;let i;function d(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(t,a){if(0===i)return 0;if(p("color=16m")||p("color=full")||p("color=truecolor"))return 3;if(p("color=256"))return 2;if(t&&!a&&void 0===i)return 0;const n=i||0;if("dumb"===r.TERM)return n;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:n;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:n}return p("no-color")||p("no-colors")||p("color=false")||p("color=never")?i=0:(p("color")||p("colors")||p("color=true")||p("color=always"))&&(i=1),"FORCE_COLOR"in r&&(i="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),R={supportsColor:function(e){return d(s(e,e&&e.isTTY))},stdout:d(s(!0,n.isatty(1))),stderr:d(s(!0,n.isatty(2)))},R}(),{stringReplaceAll:r,stringEncaseCRLFWithFirstIndex:i}=(V||(V=1,I={stringReplaceAll:(e,t,a)=>{let n=e.indexOf(t);if(-1===n)return e;const p=t.length;let r=0,i="";do{i+=e.substr(r,n-r)+t+a,r=n+p,n=e.indexOf(t,r)}while(-1!==n);return i+=e.substr(r),i},stringEncaseCRLFWithFirstIndex:(e,t,a,n)=>{let p=0,r="";do{const i="\r"===e[n-1];r+=e.substr(p,(i?n-1:n)-p)+t+(i?"\r\n":"\n")+a,p=n+1,n=e.indexOf("\n",p)}while(-1!==n);return r+=e.substr(p),r}}),I),{isArray:d}=Array,s=["ansi","ansi","ansi256","ansi16m"],o=Object.create(null);class l{constructor(e){return m(e)}}const m=e=>{const t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const a=n?n.level:0;e.level=void 0===t.level?a:t.level})(t,e),t.template=(...e)=>b(t.template,...e),Object.setPrototypeOf(t,u.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=l,t.template};function u(e){return m(e)}for(const[t,a]of Object.entries(e))o[t]={get(){const e=g(this,f(a.open,a.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:e}),e}};o.visible={get(){const e=g(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const c=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of c)o[t]={get(){const{level:a}=this;return function(...n){const p=f(e.color[s[a]][t](...n),e.color.close,this._styler);return g(this,p,this._isEmpty)}}};for(const t of c){o["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:a}=this;return function(...n){const p=f(e.bgColor[s[a]][t](...n),e.bgColor.close,this._styler);return g(this,p,this._isEmpty)}}}}const h=Object.defineProperties((()=>{}),{...o,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),f=(e,t,a)=>{let n,p;return void 0===a?(n=e,p=t):(n=a.openAll+e,p=t+a.closeAll),{open:e,close:t,openAll:n,closeAll:p,parent:a}},g=(e,t,a)=>{const n=(...e)=>d(e[0])&&d(e[0].raw)?v(n,b(n,...e)):v(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,h),n._generator=e,n._styler=t,n._isEmpty=a,n},v=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let a=e._styler;if(void 0===a)return t;const{openAll:n,closeAll:p}=a;if(-1!==t.indexOf(""))for(;void 0!==a;)t=r(t,a.close,a.open),a=a.parent;const d=t.indexOf("\n");return-1!==d&&(t=i(t,p,n,d)),n+t+p};let y;const b=(e,...t)=>{const[a]=t;if(!d(a)||!d(a.raw))return t.join(" ");const n=t.slice(1),p=[a.raw[0]];for(let e=1;e<a.length;e++)p.push(String(n[e-1]).replace(/[{}\\]/g,"\\$&"),String(a.raw[e]));return void 0===y&&(y=function(){if(L)return M;L=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,a=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,p=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function r(e){const t="u"===e[0],a="{"===e[1];return t&&!a&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&a?String.fromCodePoint(parseInt(e.slice(2,-1),16)):p.get(e)||e}function i(e,t){const p=[],i=t.trim().split(/\s*,\s*/g);let d;for(const t of i){const i=Number(t);if(Number.isNaN(i)){if(!(d=t.match(a)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);p.push(d[2].replace(n,((e,t,a)=>t?r(t):a)))}else p.push(i)}return p}function d(e){t.lastIndex=0;const a=[];let n;for(;null!==(n=t.exec(e));){const e=n[1];if(n[2]){const t=i(e,n[2]);a.push([e].concat(t))}else a.push([e])}return a}function s(e,t){const a={};for(const e of t)for(const t of e.styles)a[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const[e,t]of Object.entries(a))if(Array.isArray(t)){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=t.length>0?n[e](...t):n[e]}return n}return M=(t,a)=>{const n=[],p=[];let i=[];if(a.replace(e,((e,a,o,l,m,u)=>{if(a)i.push(r(a));else if(l){const e=i.join("");i=[],p.push(0===n.length?e:s(t,n)(e)),n.push({inverse:o,styles:d(l)})}else if(m){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");p.push(s(t,n)(i.join(""))),i=[],n.pop()}else i.push(u)})),p.push(i.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return p.join("")},M}()),y(e,p.join(""))};Object.defineProperties(u.prototype,o);const w=u();return w.supportsColor=n,w.stderr=u({level:p?p.level:0}),w.stderr.supportsColor=p,B=w}(),Y=_(J);let Q=function(e){return e[e.SUCCESS=0]="SUCCESS",e[e.NO_FILES=1]="NO_FILES",e[e.PARSE_ERRORS=2]="PARSE_ERRORS",e[e.DESYNCHRONIZED_BLOCKS=3]="DESYNCHRONIZED_BLOCKS",e[e.UNKNOWN_ARGS=4]="UNKNOWN_ARGS",e[e.CATASTROPHIC=5]="CATASTROPHIC",e[e.BAD_CONFIG=6]="BAD_CONFIG",e[e.BAD_CACHE=7]="BAD_CACHE",e}({});function Z(e){return n.relative(process.cwd(),e)}let X=function(e){return e.couldNotParse="could-not-parse",e.malformedStartTag="malformed-start-tag",e.malformedEndTag="malformed-end-tag",e.endTagWithoutStartTag="end-tag-without-start-tag",e.emptyMarker="empty-marker",e.duplicateMarker="duplicate-marker",e.startTagWithoutEndTag="start-tag-witout-end-tag",e.mismatchedChecksum="mismatched-checksum",e.duplicateTarget="duplicate-target",e.startTagAfterContent="start-tag-after-content",e.fileDoesNotExist="file-does-not-exist",e.noReturnTag="no-return-tag",e.selfTargeting="self-targeting",e.differentCommentSyntax="different-comment-syntax",e.pendingMigration="pending-migration",e}({});var ee,te,ae,ne,pe,re,ie,de,se,oe,le,me,ue,ce,he,fe,ge,ve,ye,be,we,De,_e,Ee,Se,Ce;function Ae(){if(ne)return ae;ne=1;var e=function(){if(te)return ee;te=1;var e="object"==typeof D&&D&&D.Object===Object&&D;return ee=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,a=e||t||Function("return this")();return ae=a}function Oe(){if(re)return pe;re=1;var e=Ae().Symbol;return pe=e}function xe(){if(fe)return he;fe=1;var e=Oe(),t=function(){if(me)return le;me=1;var e=Oe(),t=Object.prototype,a=t.hasOwnProperty,n=t.toString,p=e?e.toStringTag:void 0;return le=function(e){var t=a.call(e,p),r=e[p];try{e[p]=void 0;var i=!0}catch(e){}var d=n.call(e);return i&&(t?e[p]=r:delete e[p]),d}}(),a=function(){if(ce)return ue;ce=1;var e=Object.prototype.toString;return ue=function(t){return e.call(t)}}(),n=e?e.toStringTag:void 0;return he=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?t(e):a(e)}}function Ne(){if(be)return ye;be=1;var e=xe(),t=ve?ge:(ve=1,ge=function(e){return null!=e&&"object"==typeof e});return ye=function(a){return"symbol"==typeof a||t(a)&&"[object Symbol]"==e(a)}}function $e(){if(De)return we;De=1;var e=Oe(),t=(de||(de=1,ie=function(e,t){for(var a=-1,n=null==e?0:e.length,p=Array(n);++a<n;)p[a]=t(e[a],a,e);return p}),ie),a=function(){if(oe)return se;oe=1;var e=Array.isArray;return se=e}(),n=Ne(),p=e?e.prototype:void 0,r=p?p.toString:void 0;return we=function e(p){if("string"==typeof p)return p;if(a(p))return t(p,e)+"";if(n(p))return r?r.call(p):"";var i=p+"";return"0"==i&&1/p==-1/0?"-0":i},we}var Te=function(){if(Ce)return Se;Ce=1;var e=function(){if(Ee)return _e;Ee=1;var e=$e();return _e=function(t){return null==t?"":e(t)}}(),t=/[\\^$.*+?()[\]{}|]/g,a=RegExp(t.source);return Se=function(n){return(n=e(n))&&a.test(n)?n.replace(t,"\\$&"):n},Se}(),ke=_(Te);const Fe=e=>e.replace(new RegExp(ke(n.sep),"g"),"/"),je=new Map,Re=(e,t)=>{for(const a of e)je.set(a,t)},Pe=(e,t)=>{throw new Error(`Could not find marker, "${t}", from given starting location "${e}"`)},Ie=({from:e,marker:t,includeFrom:a,force:n})=>{b.isAbsolute(e)||(e=>{throw new Error(`The starting path must be absolute, but "${e}" is relative`)})(e);const p=a=>{if(n)return;const p=(e=>je.get(e))(a);if(null!=p)return p;null===p&&Pe(e,t)},r=(e,a)=>{const n=e.split(b.sep).join("/");return a?`includeFrom:${n}:${t}`:`${n}:${t}`};if(a){const a=r(e,!0),n=p(a);if(null!=n)return n;if(w.existsSync(b.join(e,t)))return Re([a],e),e}const i=[];let d=null,s=e;for(;null==d;){const a=r(s,!1);i.push(a);const n=p(a);if(null!=n){d=n;continue}const o=b.dirname(s);o!==s&&null!=o||(Re(i,null),Pe(e,t));const l=b.join(o,t);w.existsSync(l)?(i.push(r(o,!0)),Re(i,o),d=o):s=o}return d},Ve=()=>Ie({force:!1,from:__dirname,marker:Me,includeFrom:!1}),Me="package.json",Le=(e,t)=>{const a=((e,t)=>"string"==typeof e?{force:!1,from:e,includeFrom:!1,marker:t??Me}:"object"==typeof e&&null!==e?{force:e.force??!1,from:e.from??Ve(),marker:e.marker??Me,includeFrom:e.includeFrom??!1}:{force:!1,from:Ve(),marker:Me,includeFrom:!1})(e,t);return a.from===Ve()&&(a.from=p.dirname(a.from)),Ie({...a,includeFrom:!0})};function Be(e,t){if(!n.isAbsolute(e))return e;const a=Le(e,t??void 0);return n.relative(a,e)}const He=(e,t)=>({markerID:null,code:X.couldNotParse,reason:`Could not parse ${e}: ${t}`}),Ue=(e,t)=>({markerID:e,reason:`Sync-tag '${e}' declared multiple times`,location:{line:t},code:X.duplicateMarker}),qe=(e,t)=>({markerID:e,reason:`Sync-tag '${e}' has no content`,location:{line:t},code:X.emptyMarker}),ze=(e,t,a,n,p,r,i,d)=>{const s=Z(a);return{markerID:e,code:X.mismatchedChecksum,reason:`Looks like you changed the target content for sync-tag '${e}' in '${s}:${n}'. Make sure you've made corresponding changes in the source file, if necessary (${r} != ${i})`,location:{line:n},fix:{type:"replace",line:p,text:d,declaration:t,description:`Updated checksum for sync-tag '${e}' referencing '${s}:${n}' from ${r.toLowerCase()} to ${i}.`}}},We=(e,t,a,n,p,r,i)=>({markerID:e,code:X.mismatchedChecksum,reason:`Looks like you changed the content of sync-tag '${e}' or the path of the file that contains the tag. Make sure you've made corresponding changes at ${a}, if necessary (${p} != ${r})`,location:{line:n},fix:{type:"replace",line:n,text:i,declaration:t,description:`Updated checksum for sync-tag '${e}' referencing '${a}' from ${p.toLowerCase()} to ${r}.`}}),Ge=(e,t,a)=>({markerID:e,reason:`No return tag named '${e}' in '${a}'`,code:X.noReturnTag,location:{line:t}}),Ke=(e,t,a,n,p,r,i,d)=>({markerID:e,reason:`Recommended migration to remote target '${p}' and update checksum to ${i}.`,code:X.pendingMigration,location:{line:a},fix:{type:"replace",line:a,text:d,declaration:t,description:`Migrated sync-tag '${e}'. Target changed from '${n}' to '${p}'. Checksum updated from ${r.toLowerCase()} to ${i}`}}),Je=(e,t,a,n,p,r,i,d,s)=>{const o=Z(p),l=Fe(Be(p,e.rootMarker));return{markerID:t,reason:`No return tag named '${t}' in '${o}'. Recommend migration to remote target '${r}' and update checksum to ${d}.`,code:X.pendingMigration,location:{line:n},fix:{type:"replace",line:n,text:s,declaration:a,description:`Migrated sync-tag '${t}'. Target changed from '${l}' to '${r}'. Checksum updated from ${i.toLowerCase()} to ${d}`}}},Ye=(e,t)=>({markerID:e,reason:`Sync-tag '${e}' cannot target itself`,location:{line:t},code:X.selfTargeting}),Qe=(e,t)=>({markerID:e,reason:`Sync-start '${e}' has no corresponding sync-end`,location:{line:t},code:X.startTagWithoutEndTag}),Ze="No checksum",Xe=(e,t)=>{const{migratedTarget:a}=Object.entries(e.migration?.mappings??{}).reduce(((a,[n,p])=>{const r=Fe(Be(t.target,e.rootMarker));return r.startsWith(n)&&n.length>a.matchLength?{matchLength:n.length,migratedTarget:r.replace(n,p)}:a}),{matchLength:0,migratedTarget:void 0});return a},et=(e,t)=>{if(null==e)return null;const a=Object.entries(e.targets).find((([e,a])=>t.includes(a.target)));if(null==a)return null;const[n]=a;return{line:parseInt(n),checksum:e.contentChecksum}},tt=(e,t,a,n,p)=>`${t} sync-start:${e} ${n} ${p}${a||""}`;function*at(e,t,a){const n=a[t];if(null==n)return;for(const t of n.errors){if(t.code===X.fileDoesNotExist){const a=n.markers[t.markerID];if(a){const n=a.targets[t.location.line];if(null!=Xe(e,n))continue}}yield t}const{markers:p,aliases:r,readOnly:i}=n;if(!i)for(const t of Object.keys(p)){const n=p[t],i=Object.keys(n.targets).map((e=>parseInt(e)));for(const p of i){const i=n.targets[p],d=i.declaration.indexOf(n.commentStart),s=i.declaration.substring(0,d);if("all"!==e.migration?.mode)if("local"===i.type){const d=a[i.target],o=d?.markers[t],l=et(o,r),m=i.checksum,u=l?.checksum;if(m===u)continue;if(null==l?.line||null==u){const a=Xe(e,i);null==a?yield Ge(t,p,Z(i.target)):yield Je(e,t,i.declaration,p,i.target,a,m||Ze,n.selfChecksum,`${s}${tt(t,n.commentStart,n.commentEnd,n.selfChecksum,a)}`);continue}yield ze(t,i.declaration,i.target,l.line,p,m||Ze,u,`${s}${tt(t,n.commentStart,n.commentEnd,u,Fe(Be(i.target,e.rootMarker)))}`)}else{if("remote"!==i.type)throw new Error(`Unknown target type: ${i.type}`);{const e=i.checksum,a=n.selfChecksum;if(e===a)continue;yield We(t,i.declaration,i.target,p,e||Ze,a,`${s}${tt(t,n.commentStart,n.commentEnd,a,i.target)}`)}}else{const a=Xe(e,i);if(null!=a){const r="local"===i.type?Fe(Be(i.target,e.rootMarker)):i.target;yield Ke(t,i.declaration,p,r,a,i.checksum,n.selfChecksum,`${s}${tt(t,n.commentStart,n.commentEnd,n.selfChecksum,a)}`)}}}}}var nt=function(e){return e.Verbose="Verbose",e.Error="Error",e.Info="Info",e.Warning="Warning",e.Mismatch="Mismatch",e.Migrate="Migrate",e.Fix="Fix",e}(nt||{});const pt=Math.max(...Object.values(nt).map((e=>e.length))),rt=e=>`${e}${" ".repeat(pt-e.length)}`,it=e=>`${Y.grey(rt(nt.Verbose))} ${Y.dim(e)}`,dt=e=>(e.startsWith("Error: ")&&(e=e.substring(7)),`${Y.red(rt(nt.Error))} ${e}`),st=e=>`${Y.blue(rt(nt.Info))} ${e}`,ot=e=>`${Y.yellow(rt(nt.Warning))} ${e}`,lt=e=>`${Y.bold.yellowBright(rt(nt.Mismatch))} ${e}`,mt=e=>`${Y.bold.yellowBright(rt(nt.Migrate))} ${e}`,ut=e=>`${Y.bold.greenBright(rt(nt.Fix))} ${e}`,ct=e=>`${Y.gray(Z(e))}`,ht=e=>`${Y.bold.yellow(e)}`,ft=e=>`${Y.bold.green(e)}`;class gt{constructor(e,t){this._log=t,this._file=e}get file(){return this._file}mismatch=(e,t)=>this._log.log(lt(this._format(e,t)));migrate=(e,t)=>this._log.log(mt(this._format(e,t)));fix=(e,t)=>this._log.log(ut(this._format(e,t)));log=(e,t)=>this._log.log(this._format(e,t));info=(e,t)=>this._log.info(this._format(e,t));warn=(e,t)=>this._log.warn(this._format(e,t));error=(e,t)=>this._log.error(this._format(e,t));group=(...e)=>this._log.group(...e);groupEnd=()=>this._log.groupEnd();verbose=(e,t)=>this._log.verbose((()=>{const a=e();return a?this._format(a,t):null}));_format=(e,t)=>`${this._formatRef(t)}\n${e.split(". ").join("\n")}\n`;_formatRef=e=>ct(`${this._file}${e&&`:${e}`||""}`)}const vt={autoFix:!1,json:!1,allowEmptyTags:!1,comments:["#","//","{/*"],excludeGlobs:[],dryRun:!1,ignoreFiles:[".gitignore"],includeGlobs:[`${process.cwd()}**`],cachePath:"cache.json",cacheMode:"ignore"};var yt="10.0.2";class bt{_fixableFileNames=new Set;_errorsByFile={};_filesWithUnfixableErrors=new Set;_fileLog=null;constructor(e,t){this._mainLog=t,this._options=e}_getKeyForFile(e){try{return Be(e,this._options.rootMarker)}catch(t){return e}}_getErrorsForFile(e){return this._errorsByFile[this._getKeyForFile(e)]}_initErrorsForFile(e){this._errorsByFile[this._getKeyForFile(e)]=[]}_cleanUpErrorlessFile(e){const t=this._getKeyForFile(e);return 0===this._errorsByFile[t].length&&(delete this._errorsByFile[t],!0)}startFile(e){if(null!=this._fileLog)throw new Error("Cannot start processing a file while already processing another");if(null!=this._getErrorsForFile(e))throw new Error("File has already been drained to the output sink");this._fileLog=new gt(e,this._mainLog),this._initErrorsForFile(e)}processError(e){const t=this._fileLog;if(null==t)throw new Error("Cannot process errors before file processing has started");null==e.fix&&this._filesWithUnfixableErrors.add(t.file),this._options.json||function(e,t){null==t.fix&&e.error(t.reason,t.location?.line)}(t,e);const{fix:a,reason:n,code:p}=e;null!=a&&(this._fixableFileNames.add(t.file),this._options.autoFix||this._options.json||(p===X.mismatchedChecksum?t.mismatch(n,a.line):p===X.pendingMigration?t.migrate(n,a.line):t.warn(n,a.line))),this._getErrorsForFile(t.file).push(e)}async endFile(){const t=this._fileLog;if(null==t)throw new Error("Cannot end processing a file before file processing has started");try{if(this._cleanUpErrorlessFile(t.file))return;if(this._options.autoFix&&!this._filesWithUnfixableErrors.has(t.file)){t.verbose((()=>"File has errors; skipping auto-fix"));const d=this._getErrorsForFile(t.file).reduce(((e,t)=>{const{declaration:a}=t.fix,n=e[a]||[];return n.push(t),e[a]=n,e}),{});await(a=this._options,n=t.file,p=t,r=d,new Promise(((t,d)=>{if(null==r||0===Object.keys(r).length)return void t();const s=e.openSync(n,"r+"),o=a.dryRun?{write:e=>{},end:e=>t(),bytesWritten:0}:e.createWriteStream(n,{fd:s,start:0});let l=1;i.createInterface({input:e.createReadStream(n,{fd:s,start:0,autoClose:!1}),crlfDelay:1/0,terminal:!1}).on("line",(e=>{const t=r[e]?.find((e=>e.fix?.line===l))?.fix;l++,((e,t)=>{null!=e&&t.fix(e.description,e.line)})(t,p),"delete"===t?.type||("replace"===t?.type?o.write(`${t.text}\n`):o.write(`${e}\n`))})).on("close",(()=>{o.end((()=>{e.truncate(n,o.bytesWritten,(()=>t()))}))}))})))}}finally{this._fileLog=null}var a,n,p,r}_getFullLaunchString(){const e=[];e.push(function(){const e=Z(process.argv[1]);if(e.endsWith(n.join(".bin","checksync"))){if(process.env.npm_execpath){if(process.env.npm_execpath.indexOf("yarn")>=0)return"yarn checksync";if(process.env.npm_execpath.indexOf("pnpm")>=0)return"pnpm checksync"}return"npx checksync"}return e}());const t=[...this._options.comments].sort().join(" ");t!==[...vt.comments].sort().join(" ")&&(e.push("-c"),e.push(`"${t}"`));const a=this._options.rootMarker;return null!=a&&(e.push("-m"),e.push(`"${a}"`)),e.push("-u"),e.push(Array.from(this._fixableFileNames).map(Z).join(" ")),e.join(" ")}_outputJson(){this._filesWithUnfixableErrors.size>0&&this._mainLog.error(this._options.autoFix?"🛑 Could not update all tags due to unfixable errors. Fix the errors and try again.":"🛑 Unfixable errors found. Fix the errors and try again."),this._mainLog.log(JSON.stringify({version:yt,launchString:this._getFullLaunchString(),files:this._errorsByFile},null,4))}_outputText(){if(this._fixableFileNames.size>0)if(this._options.autoFix)this._options.dryRun?(this._mainLog.log(""),this._mainLog.group(`${this._fixableFileNames.size} file(s) would have been fixed.\nTo fix, run:`),this._mainLog.log(this._getFullLaunchString()),this._mainLog.groupEnd()):this._mainLog.info(`Fixed issues in ${this._fixableFileNames.size} file(s)`);else{this._mainLog.log("");const e=this._filesWithUnfixableErrors.size>0?"🛑 Desynchronized blocks detected and parsing errors were found. Fix the errors, update the blocks, then update the sync-start tags using:":"🛠 Desynchronized blocks detected. Check them and update as required before resynchronizing:";this._mainLog.group(`${e}`),this._mainLog.log(""),this._mainLog.log(this._getFullLaunchString()),this._mainLog.groupEnd()}this._filesWithUnfixableErrors.size>0&&(this._mainLog.log(""),this._mainLog.group(this._options.autoFix?"🛑 Could not update all tags due to unfixable errors. Fix the errors in these files and try again.":"🛑 Unfixable errors found. Fix the errors in these files and try again."),this._mainLog.log(Array.from(this._filesWithUnfixableErrors).map(Z).join("\n")),this._mainLog.groupEnd())}end(){return this._options.json?this._outputJson():this._outputText(),this._filesWithUnfixableErrors.size>0?Q.PARSE_ERRORS:this._fixableFileNames.size>0&&!this._options.autoFix?Q.DESYNCHRONIZED_BLOCKS:(this._options.json||this._mainLog.log("🎉 Everything is in sync!"),Q.SUCCESS)}}const wt=Object.freeze({tagId:1,checksum:2,targetPath:3,commentEnd:4});class Dt{_openMarkers={};constructor(e,t,a,n){this._addMarker=t,this._recordError=a,this._normalizePath=e,this._lineNumber=1;const p=n.map((e=>`(?:${ke(e)})`)).join("|");this._startTagRegExp=`^(${p})\\s*sync-start:(.*)$`,this._startTagDecodeRegExp="^([^\\s]+)\\s+([0-9]*)?\\s*(\\S*)(\\s+[^\\s\\w]*)?$",this._endTagRegExp=`^(?:${p})\\s*sync-end:(.*)$`,this._endTagDecodeRegExp="^(\\S+)\\s*\\S*$"}_recordMarkerStart=(e,t,a,n,p,r,i)=>{this._openMarkers[e]=this._openMarkers[e]||{content:[],targets:{},commentStart:p,commentEnd:r};const d=this._normalizePath(t),s={type:d.type,line:a,checksum:n,declaration:i};this._openMarkers[e].commentStart!==p&&this._recordError(((e,t)=>({markerID:e,reason:`Sync-start tags for '${e}' given in different comment styles. Please use the same style for all sync-start tags that have identical identifiers.`,location:{line:t},code:X.differentCommentSyntax}))(e,a)),d.exists||this._recordError(((e,t,a)=>({markerID:e,reason:`Sync-start for '${e}' points to '${a}', which does not exist or is a directory`,location:{line:t},code:X.fileDoesNotExist}))(e,a,t)),this._openMarkers[e].targets[d.path]&&this._recordError(((e,t,a)=>({markerID:e,reason:`Duplicate target for sync-tag '${e}'`,location:{line:t},code:X.duplicateTarget,fix:{type:"delete",description:`Removed duplicate target for sync-tag '${e}'`,declaration:a,line:t}}))(e,a,i)),0!==this._openMarkers[e].content.length&&this._recordError(((e,t)=>({markerID:e,reason:`Sync-start for '${e}' found after content started`,location:{line:t},code:X.startTagAfterContent}))(e,a));const o=this._openMarkers[e].targets[d.path]||[];o.push(s),this._openMarkers[e].targets[d.path]=o};_recordMarkerEnd=(e,t)=>{const a=this._openMarkers[e];delete this._openMarkers[e],null==a&&this._recordError(((e,t)=>({markerID:e,reason:`Sync-end for '${e}' found, but there was no corresponding sync-start`,location:{line:t},code:X.endTagWithoutStartTag}))(e,t)),this._addMarker(e,a?.content,null==a?{}:(e=>{const t={};for(const a of Object.keys(e))for(const{line:n,...p}of e[a])t[n]={target:a,...p};return t})(a.targets),a?.commentStart,a?.commentEnd)};_recordUnterminatedMarkerEnd=e=>{const t=this._openMarkers[e];delete this._openMarkers[e];const a=Object.keys(t.targets)[0];for(const{line:n}of t.targets[a])this._recordError(Qe(e,n))};_addContentToOpenMarkers=e=>{for(const t of Object.keys(this._openMarkers))this._openMarkers[t].content.push(e+"\n")};recordUnterminatedMarkers=()=>{for(const e of Object.keys(this._openMarkers))this._recordUnterminatedMarkerEnd(e)};parseLine=e=>{const t=this._lineNumber++,a=e.trim(),n=new RegExp(this._startTagRegExp).exec(a);if(null!=n){const a=new RegExp(this._startTagDecodeRegExp).exec(n[2]);return void(null==a?this._recordError({markerID:null,reason:"Malformed sync-start: format should be 'sync-start:<label> [checksum] <filename> <optional_comment_end>'",location:{line:t},code:X.malformedStartTag}):this._recordMarkerStart(a[wt.tagId],a[wt.targetPath],t,a[wt.checksum]||"",n[1],a[wt.commentEnd]||"",e))}const p=new RegExp(this._endTagRegExp).exec(a);if(null==p)this._addContentToOpenMarkers(e);else{const e=new RegExp(this._endTagDecodeRegExp).exec(p[1]);null==e?this._recordError((e=>({markerID:null,reason:"Malformed sync-end: format should be 'sync-end:<label>'",location:{line:e},code:X.malformedEndTag}))(t)):this._recordMarkerEnd(e[1],t)}}}var _t,Et={};var St,Ct=(_t||(_t=1,St=function(e){e.version="1.3.1",e.bstr=function(e,t){var a=1,n=0,p=e.length,r=0;"number"==typeof t&&(a=65535&t,n=t>>>16);for(var i=0;i<p;){for(r=Math.min(p-i,2654)+i;i<r;i++)n+=a+=255&e.charCodeAt(i);a=15*(a>>>16)+(65535&a),n=15*(n>>>16)+(65535&n)}return n%65521<<16|a%65521},e.buf=function(e,t){var a=1,n=0,p=e.length,r=0;"number"==typeof t&&(a=65535&t,n=t>>>16&65535);for(var i=0;i<p;){for(r=Math.min(p-i,2654)+i;i<r;i++)n+=a+=255&e[i];a=15*(a>>>16)+(65535&a),n=15*(n>>>16)+(65535&n)}return n%65521<<16|a%65521},e.str=function(e,t){var a=1,n=0,p=e.length,r=0,i=0,d=0;"number"==typeof t&&(a=65535&t,n=t>>>16);for(var s=0;s<p;){for(r=Math.min(p-s,2918);r>0;)(i=e.charCodeAt(s++))<128?a+=i:i<2048?(n+=a+=192|i>>6&31,--r,a+=128|63&i):i>=55296&&i<57344?(n+=a+=240|(i=64+(1023&i))>>8&7,--r,n+=a+=128|i>>2&63,--r,n+=a+=128|(d=1023&e.charCodeAt(s++))>>6&15|(3&i)<<4,--r,a+=128|63&d):(n+=a+=224|i>>12&15,--r,n+=a+=128|i>>6&63,--r,a+=128|63&i),n+=a,--r;a=15*(a>>>16)+(65535&a),n=15*(n>>>16)+(65535&n)}return n%65521<<16|a%65521}},"undefined"==typeof DO_NOT_EXPORT_ADLER?St(Et):St({})),Et),At=_(Ct);const Ot=["\n"];function xt(e){const t=[...Ot,...e].join("");return`${At.str(t)}`.replace("-","")}function Nt(t,a,p){const r=Le(a,t.rootMarker??void 0),d={},s=[],o=e=>{s.push(e)},l=[],m=t=>{const a=((t,a)=>{if(a.includes("://"))return{path:a,exists:!0,type:"remote"};const p=n.isAbsolute(a)?a:n.join(t,a),r=n.normalize(p).replace(new RegExp("/","g"),n.sep);return{path:r,exists:e.existsSync(r)&&e.lstatSync(r).isFile(),type:"local"}})(r,t);return!p&&a.exists&&"local"===a.type&&l.push(a.path),a};return new Promise(((u,c)=>{try{const c=new Dt(m,((e,p,i,s,l)=>((e,n,p,r,i,s)=>{for(const n of Object.keys(r)){const i=parseInt(n);0!==(p?.length??0)||t.allowEmptyTags||o(qe(e,i)),d[e]&&o(Ue(e,i)),r[i].target===a&&o(Ye(e,i))}d[e]={contentChecksum:null==p?Ze:xt(p),selfChecksum:xt([...p??[],n]),targets:r,commentStart:i,commentEnd:s}})(e,Fe(n.relative(r,a)),p,i,s,l)),o,t.comments),h=e.openSync(a,"r"),f=e.createReadStream(a,{fd:h});let g=0;i.createInterface({input:f,crlfDelay:1/0}).on("line",(e=>{g++,c.parseLine(e)})).on("close",(()=>{c.recordUnterminatedMarkers();const e=Object.keys(d).length;u({...{markers:0===e?null:d,referencedFiles:l,errors:s,lineCount:g},readOnly:p})}))}catch(e){c(e)}})).then((e=>e),(e=>(o(He(a,e.message)),{markers:null,referencedFiles:[],errors:s,readOnly:p})))}var $t,Tt={},kt={},Ft={};function jt(){if($t)return Ft;return $t=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.splitWhen=Ft.flatten=void 0,Ft.flatten=function(e){return e.reduce(((e,t)=>[].concat(e,t)),[])},Ft.splitWhen=function(e,t){const a=[[]];let n=0;for(const p of e)t(p)?(n++,a[n]=[]):a[n].push(p);return a},Ft}var Rt,Pt={};function It(){if(Rt)return Pt;return Rt=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.isEnoentCodeError=void 0,Pt.isEnoentCodeError=function(e){return"ENOENT"===e.code},Pt}var Vt,Mt={};var Lt,Bt={};function Ht(){if(Lt)return Bt;Lt=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.convertPosixPathToPattern=Bt.convertWindowsPathToPattern=Bt.convertPathToPattern=Bt.escapePosixPath=Bt.escapeWindowsPath=Bt.escape=Bt.removeLeadingDotSegment=Bt.makeAbsolute=Bt.unixify=void 0;const e=n,a="win32"===t.platform(),p=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,r=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,i=/^\\\\([.?])/,d=/\\(?![!()+@[\]{}])/g;function s(e){return e.replace(r,"\\$2")}function o(e){return e.replace(p,"\\$2")}function l(e){return s(e).replace(i,"//$1").replace(d,"/")}function m(e){return o(e)}return Bt.unixify=function(e){return e.replace(/\\/g,"/")},Bt.makeAbsolute=function(t,a){return e.resolve(t,a)},Bt.removeLeadingDotSegment=function(e){if("."===e.charAt(0)){const t=e.charAt(1);if("/"===t||"\\"===t)return e.slice(2)}return e},Bt.escape=a?s:o,Bt.escapeWindowsPath=s,Bt.escapePosixPath=o,Bt.convertPathToPattern=a?l:m,Bt.convertWindowsPathToPattern=l,Bt.convertPosixPathToPattern=m,Bt}var Ut,qt,zt,Wt,Gt,Kt,Jt={};
/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/function Yt(){return qt?Ut:(qt=1,Ut=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1})}
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function Qt(){if(Wt)return zt;Wt=1;var e=Yt(),t={"{":"}","(":")","[":"]"},a=function(e){if("!"===e[0])return!0;for(var a=0,n=-2,p=-2,r=-2,i=-2,d=-2;a<e.length;){if("*"===e[a])return!0;if("?"===e[a+1]&&/[\].+)]/.test(e[a]))return!0;if(-1!==p&&"["===e[a]&&"]"!==e[a+1]&&(p<a&&(p=e.indexOf("]",a)),p>a)){if(-1===d||d>p)return!0;if(-1===(d=e.indexOf("\\",a))||d>p)return!0}if(-1!==r&&"{"===e[a]&&"}"!==e[a+1]&&(r=e.indexOf("}",a))>a&&(-1===(d=e.indexOf("\\",a))||d>r))return!0;if(-1!==i&&"("===e[a]&&"?"===e[a+1]&&/[:!=]/.test(e[a+2])&&")"!==e[a+3]&&(i=e.indexOf(")",a))>a&&(-1===(d=e.indexOf("\\",a))||d>i))return!0;if(-1!==n&&"("===e[a]&&"|"!==e[a+1]&&(n<a&&(n=e.indexOf("|",a)),-1!==n&&")"!==e[n+1]&&(i=e.indexOf(")",n))>n&&(-1===(d=e.indexOf("\\",n))||d>i)))return!0;if("\\"===e[a]){var s=e[a+1];a+=2;var o=t[s];if(o){var l=e.indexOf(o,a);-1!==l&&(a=l+1)}if("!"===e[a])return!0}else a++}return!1},n=function(e){if("!"===e[0])return!0;for(var a=0;a<e.length;){if(/[*?{}()[\]]/.test(e[a]))return!0;if("\\"===e[a]){var n=e[a+1];a+=2;var p=t[n];if(p){var r=e.indexOf(p,a);-1!==r&&(a=r+1)}if("!"===e[a])return!0}else a++}return!1};return zt=function(t,p){if("string"!=typeof t||""===t)return!1;if(e(t))return!0;var r=a;return p&&!1===p.strict&&(r=n),r(t)}}function Zt(){if(Kt)return Gt;Kt=1;var e=Qt(),a=n.posix.dirname,p="win32"===t.platform(),r=/\\/g,i=/[\{\[].*[\}\]]$/,d=/(^|[^\\])([\{\[]|\([^\)]+$)/,s=/\\([\!\*\?\|\[\]\(\)\{\}])/g;return Gt=function(t,n){Object.assign({flipBackslashes:!0},n).flipBackslashes&&p&&t.indexOf("/")<0&&(t=t.replace(r,"/")),i.test(t)&&(t+="/"),t+="a";do{t=a(t)}while(e(t)||d.test(t));return t.replace(s,"$1")}}var Xt,ea,ta,aa,na,pa,ra,ia,da,sa,oa,la,ma,ua,ca,ha,fa,ga,va,ya={};function ba(){return Xt||(Xt=1,function(e){e.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,a,n=1,p)=>!1!==p&&(!(!e.isInteger(t)||!e.isInteger(a))&&(Number(a)-Number(t))/Number(n)>=p),e.escapeNode=(e,t=0,a)=>{const n=e.nodes[t];n&&(a&&n.type===a||"open"===n.type||"close"===n.type)&&!0!==n.escaped&&(n.value="\\"+n.value,n.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&(!(e.commas>>0+e.ranges)&&(e.invalid=!0,!0)),e.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges?(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0):(e.invalid=!0,!0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],a=e=>{for(let n=0;n<e.length;n++){const p=e[n];Array.isArray(p)?a(p):void 0!==p&&t.push(p)}return t};return a(e),t}}(ya)),ya}function wa(){if(ta)return ea;ta=1;const e=ba();return ea=(t,a={})=>{const n=(t,p={})=>{const r=a.escapeInvalid&&e.isInvalidBrace(p),i=!0===t.invalid&&!0===a.escapeInvalid;let d="";if(t.value)return(r||i)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(const e of t.nodes)d+=n(e);return d};return n(t)}}
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/function Da(){return na?aa:(na=1,aa=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))})}
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/function _a(){if(ra)return pa;ra=1;const e=Da(),t=(a,r,i)=>{if(!1===e(a))throw new TypeError("toRegexRange: expected the first argument to be a numb